From 3d15d3ed615795b95b70fb3033f869823be9f683 Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Thu, 6 Feb 2025 22:33:31 -0800 Subject: [PATCH] Add today and close button --- src-ui/messages.xlf | 123 +++++++++++++----- ...ustom-fields-query-dropdown.component.html | 9 +- ...ustom-fields-query-dropdown.component.scss | 6 + .../custom-fields-query-dropdown.component.ts | 2 + .../dates-dropdown.component.html | 32 ++++- .../dates-dropdown.component.scss | 6 + .../dates-dropdown.component.ts | 2 + .../common/input/date/date.component.html | 8 +- .../common/input/date/date.component.scss | 5 + .../common/input/date/date.component.ts | 2 + 10 files changed, 153 insertions(+), 42 deletions(-) diff --git a/src-ui/messages.xlf b/src-ui/messages.xlf index f2c64d076..c24c9ae03 100644 --- a/src-ui/messages.xlf +++ b/src-ui/messages.xlf @@ -3318,48 +3318,114 @@ 93 - - True + + Today + + src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.html + 39 + + + src/app/components/common/dates-dropdown/dates-dropdown.component.html + 50 + + + src/app/components/common/dates-dropdown/dates-dropdown.component.html + 76 + + + src/app/components/common/dates-dropdown/dates-dropdown.component.html + 126 + + + src/app/components/common/dates-dropdown/dates-dropdown.component.html + 152 + + + src/app/components/common/input/date/date.component.html + 21 + + + + Close src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.html 40 - src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.html + src/app/components/common/dates-dropdown/dates-dropdown.component.html + 51 + + + src/app/components/common/dates-dropdown/dates-dropdown.component.html 77 + + src/app/components/common/dates-dropdown/dates-dropdown.component.html + 127 + + + src/app/components/common/dates-dropdown/dates-dropdown.component.html + 153 + + + src/app/components/common/input/date/date.component.html + 22 + + + src/app/components/document-detail/document-detail.component.html + 94 + + + src/app/components/document-detail/document-detail.component.ts + 1375 + + + src/app/guards/dirty-saved-view.guard.ts + 37 + + + + True src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.html - 83 + 47 + + + src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.html + 84 + + + src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.html + 90 False src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.html - 41 + 48 src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.html - 78 + 85 src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.html - 84 + 91 Search docs... src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.html - 100 + 107 Any src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.html - 132 + 139 src/app/components/common/filterable-dropdown/filterable-dropdown.component.html @@ -3370,7 +3436,7 @@ All src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.html - 134 + 141 src/app/components/common/filterable-dropdown/filterable-dropdown.component.html @@ -3397,21 +3463,21 @@ Not src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.html - 137 + 144 Add query src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.html - 156 + 163 Add expression src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.html - 159 + 166 @@ -3422,7 +3488,7 @@ src/app/components/common/dates-dropdown/dates-dropdown.component.html - 89 + 101 @@ -3433,25 +3499,25 @@ src/app/components/common/dates-dropdown/dates-dropdown.component.html - 106 + 118 To src/app/components/common/dates-dropdown/dates-dropdown.component.html - 62 + 68 src/app/components/common/dates-dropdown/dates-dropdown.component.html - 126 + 144 Added src/app/components/common/dates-dropdown/dates-dropdown.component.html - 74 + 86 src/app/components/common/edit-dialog/workflow-edit-dialog/workflow-edit-dialog.component.ts @@ -5063,14 +5129,14 @@ Invalid date. src/app/components/common/input/date/date.component.html - 25 + 31 Suggestions: src/app/components/common/input/date/date.component.html - 31 + 37 src/app/components/common/input/select/select.component.html @@ -5085,7 +5151,7 @@ Filter documents with this src/app/components/common/input/date/date.component.ts - 121 + 123 src/app/components/common/input/select/select.component.ts @@ -6249,21 +6315,6 @@ 70 - - Close - - src/app/components/document-detail/document-detail.component.html - 94 - - - src/app/components/document-detail/document-detail.component.ts - 1375 - - - src/app/guards/dirty-saved-view.guard.ts - 37 - - Previous diff --git a/src-ui/src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.html b/src-ui/src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.html index 2f119b074..742dd8e8a 100644 --- a/src-ui/src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.html +++ b/src-ui/src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.html @@ -29,10 +29,17 @@ + #d="ngbDatepicker" + [footerTemplate]="datePickerFooterTemplate" /> + +
+ + +
+
} @else if (getCustomFieldByID(atom.field)?.data_type === CustomFieldDataType.Float || getCustomFieldByID(atom.field)?.data_type === CustomFieldDataType.Integer) { } @else if (getCustomFieldByID(atom.field)?.data_type === CustomFieldDataType.Boolean) { diff --git a/src-ui/src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.scss b/src-ui/src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.scss index f38bb4002..2f9e2c45e 100644 --- a/src-ui/src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.scss +++ b/src-ui/src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.scss @@ -41,3 +41,9 @@ min-width: 140px; } } + +.btn-group-xs { + > .btn { + border-radius: 0.15rem; + } +} diff --git a/src-ui/src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.ts b/src-ui/src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.ts index 0fa7fe536..324fd27a5 100644 --- a/src-ui/src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.ts +++ b/src-ui/src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.ts @@ -241,6 +241,8 @@ export class CustomFieldsQueryDropdownComponent extends LoadingComponentWithPerm customFields: CustomField[] = [] + public readonly today: string = new Date().toISOString().split('T')[0] + constructor(protected customFieldsService: CustomFieldsService) { super() this.selectionModel = new CustomFieldQueriesModel() diff --git a/src-ui/src/app/components/common/dates-dropdown/dates-dropdown.component.html b/src-ui/src/app/components/common/dates-dropdown/dates-dropdown.component.html index 0b923ed31..c3ff61ba8 100644 --- a/src-ui/src/app/components/common/dates-dropdown/dates-dropdown.component.html +++ b/src-ui/src/app/components/common/dates-dropdown/dates-dropdown.component.html @@ -41,10 +41,16 @@
From + maxlength="10" [(ngModel)]="createdDateFrom" ngbDatepicker #createdDateFromPicker="ngbDatepicker" [footerTemplate]="createdFromFooterTemplate"> + +
+ + +
+
@@ -61,10 +67,16 @@
To + maxlength="10" [(ngModel)]="createdDateTo" ngbDatepicker #createdDateToPicker="ngbDatepicker" [footerTemplate]="createdToFooterTemplate"> + +
+ + +
+
@@ -105,10 +117,16 @@
From + maxlength="10" [(ngModel)]="addedDateFrom" ngbDatepicker #addedDateFromPicker="ngbDatepicker" [footerTemplate]="addedFromFooterTemplate"> + +
+ + +
+
@@ -125,10 +143,16 @@
To + maxlength="10" [(ngModel)]="addedDateTo" ngbDatepicker #addedDateToPicker="ngbDatepicker" [footerTemplate]="addedToFooterTemplate"> + +
+ + +
+
diff --git a/src-ui/src/app/components/common/dates-dropdown/dates-dropdown.component.scss b/src-ui/src/app/components/common/dates-dropdown/dates-dropdown.component.scss index e101a131d..ebd34b29a 100644 --- a/src-ui/src/app/components/common/dates-dropdown/dates-dropdown.component.scss +++ b/src-ui/src/app/components/common/dates-dropdown/dates-dropdown.component.scss @@ -41,3 +41,9 @@ } } } + +.btn-group-xs { + > .btn { + border-radius: 0.15rem; + } +} diff --git a/src-ui/src/app/components/common/dates-dropdown/dates-dropdown.component.ts b/src-ui/src/app/components/common/dates-dropdown/dates-dropdown.component.ts index 478519487..e7d506d18 100644 --- a/src-ui/src/app/components/common/dates-dropdown/dates-dropdown.component.ts +++ b/src-ui/src/app/components/common/dates-dropdown/dates-dropdown.component.ts @@ -133,6 +133,8 @@ export class DatesDropdownComponent implements OnInit, OnDestroy { @Input() disabled: boolean = false + public readonly today: string = new Date().toISOString().split('T')[0] + get isActive(): boolean { return ( this.createdRelativeDate !== null || diff --git a/src-ui/src/app/components/common/input/date/date.component.html b/src-ui/src/app/components/common/input/date/date.component.html index 8f386e2c8..3221677fc 100644 --- a/src-ui/src/app/components/common/input/date/date.component.html +++ b/src-ui/src/app/components/common/input/date/date.component.html @@ -12,10 +12,16 @@
+ name="dp" [(ngModel)]="value" ngbDatepicker #datePicker="ngbDatepicker" #datePickerContent="ngModel" [disabled]="disabled" [footerTemplate]="datePickerFooterTemplate"> + +
+ + +
+
@if (showFilter) {