Fix some small frontend things

This commit is contained in:
shamoon 2024-10-23 22:00:35 -07:00
parent 2c05247d84
commit 8454182c72
No known key found for this signature in database
3 changed files with 11 additions and 11 deletions

View File

@ -4769,14 +4769,14 @@
<source>Create new workflow</source> <source>Create new workflow</source>
<context-group purpose="location"> <context-group purpose="location">
<context context-type="sourcefile">src/app/components/common/edit-dialog/workflow-edit-dialog/workflow-edit-dialog.component.ts</context> <context context-type="sourcefile">src/app/components/common/edit-dialog/workflow-edit-dialog/workflow-edit-dialog.component.ts</context>
<context context-type="linenumber">166</context> <context context-type="linenumber">172</context>
</context-group> </context-group>
</trans-unit> </trans-unit>
<trans-unit id="5996779210524133604" datatype="html"> <trans-unit id="5996779210524133604" datatype="html">
<source>Edit workflow</source> <source>Edit workflow</source>
<context-group purpose="location"> <context-group purpose="location">
<context context-type="sourcefile">src/app/components/common/edit-dialog/workflow-edit-dialog/workflow-edit-dialog.component.ts</context> <context context-type="sourcefile">src/app/components/common/edit-dialog/workflow-edit-dialog/workflow-edit-dialog.component.ts</context>
<context context-type="linenumber">170</context> <context context-type="linenumber">176</context>
</context-group> </context-group>
</trans-unit> </trans-unit>
<trans-unit id="6381578200008167206" datatype="html"> <trans-unit id="6381578200008167206" datatype="html">

View File

@ -123,7 +123,7 @@
<p class="small" i18n>Set scheduled trigger offset and which field to use.</p> <p class="small" i18n>Set scheduled trigger offset and which field to use.</p>
<div class="row"> <div class="row">
<div class="col-4"> <div class="col-4">
<pngx-input-number i18n-title title="Offset" formControlName="schedule_offset_days" i18n-hint hint="Offset in days. Use 0 for immediate." [error]="error?.schedule_offset_days"></pngx-input-number> <pngx-input-number i18n-title title="Offset" formControlName="schedule_offset_days" i18n-hint hint="Offset in days. Use 0 for immediate." [showAdd]="false" [error]="error?.schedule_offset_days"></pngx-input-number>
<pngx-input-check i18n-title title="Repeat" formControlName="schedule_is_recurring" i18n-hint hint="Repeat the trigger after the delay." [error]="error?.schedule_is_recurring"></pngx-input-check> <pngx-input-check i18n-title title="Repeat" formControlName="schedule_is_recurring" i18n-hint hint="Repeat the trigger after the delay." [error]="error?.schedule_is_recurring"></pngx-input-check>
</div> </div>
<div class="col-4"> <div class="col-4">

View File

@ -120,6 +120,7 @@ export class WorkflowEditDialogComponent
storagePaths: StoragePath[] storagePaths: StoragePath[]
mailRules: MailRule[] mailRules: MailRule[]
customFields: CustomField[] customFields: CustomField[]
dateCustomFields: CustomField[]
expandedItem: number = null expandedItem: number = null
@ -159,7 +160,12 @@ export class WorkflowEditDialogComponent
customFieldsService customFieldsService
.listAll() .listAll()
.pipe(first()) .pipe(first())
.subscribe((result) => (this.customFields = result.results)) .subscribe((result) => {
this.customFields = result.results
this.dateCustomFields = this.customFields?.filter(
(f) => f.data_type === CustomFieldDataType.Date
)
})
} }
getCreateTitle() { getCreateTitle() {
@ -422,12 +428,6 @@ export class WorkflowEditDialogComponent
return SCHEDULE_DATE_FIELD_OPTIONS return SCHEDULE_DATE_FIELD_OPTIONS
} }
get dateCustomFields() {
return this.customFields?.filter(
(f) => f.data_type === CustomFieldDataType.Date
)
}
getTriggerTypeOptionName(type: WorkflowTriggerType): string { getTriggerTypeOptionName(type: WorkflowTriggerType): string {
return this.triggerTypeOptions.find((t) => t.id === type)?.name ?? '' return this.triggerTypeOptions.find((t) => t.id === type)?.name ?? ''
} }
@ -448,7 +448,7 @@ export class WorkflowEditDialogComponent
matching_algorithm: MATCH_NONE, matching_algorithm: MATCH_NONE,
match: '', match: '',
is_insensitive: true, is_insensitive: true,
schedule_offset_days: null, schedule_offset_days: 0,
schedule_is_recurring: false, schedule_is_recurring: false,
schedule_date_field: ScheduleDateField.Added, schedule_date_field: ScheduleDateField.Added,
schedule_date_custom_field: null, schedule_date_custom_field: null,