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 3e057319a..14ee9696a 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 @@ -34,43 +34,52 @@ @if (getCustomFieldByID(atom.field)?.data_type === CustomFieldDataType.Date) { @let relativeDate = getRelativeDate(atom); - - @if (relativeDate) { -
- @if (relativeDate.unit.includes('{n}')) { - - } - +
+
+ + + +
- } @else { - - - -
- - -
-
- } +
+ @if (relativeDate) { + @if (relativeDate.unit.includes('{n}')) { + + } + + } @else { + + + +
+ + +
+
+ } +
+
} @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) { @@ -119,7 +128,7 @@ [appendTo]="selectAppendTo" (mousedown)="$event.stopImmediatePropagation()" > - @for (operator of getOperatorsForField(atom.field); track operator.label) { } 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 c2e09000e..406523494 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 @@ -11,6 +11,7 @@ border-top-right-radius: 0 !important; border-bottom-right-radius: 0 !important; height: 100% !important; + min-height: calc(1.5em + 0.5rem + calc(var(--bs-border-width) * 2)) !important; } :host ::ng-deep .rounded-end .ng-select-container { diff --git a/src-ui/src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.spec.ts b/src-ui/src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.spec.ts index dbe77757a..ae54b85ba 100644 --- a/src-ui/src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.spec.ts +++ b/src-ui/src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.spec.ts @@ -258,10 +258,10 @@ describe('CustomFieldsQueryDropdownComponent', () => { await fixture.whenStable() const query = (selector: string) => fixture.nativeElement.querySelector(selector) - const toggle: HTMLButtonElement = query('button[title="Relative date"]') expect(query('[ngbDatepicker]')).not.toBeNull() + expect(query('input[id$="_fixed"]').checked).toBe(true) - toggle.click() + query('input[id$="_relative"]').click() fixture.detectChanges() await fixture.whenStable() expect(atom.value).toBeNull() @@ -279,7 +279,7 @@ describe('CustomFieldsQueryDropdownComponent', () => { expect(atom.serialize()).toEqual([4, 'gte', 'today']) expect(query('input[aria-label="Amount"]')).toBeNull() - toggle.click() + query('input[id$="_fixed"]').click() fixture.detectChanges() expect(atom.value).toBeNull() expect(query('[ngbDatepicker]')).not.toBeNull() 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 87ea17c8b..874655e11 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 @@ -352,6 +352,15 @@ export class CustomFieldsQueryDropdownComponent extends LoadingComponentWithPerm return this.relativeDates.get(atom.id) } + hasDateValueRow(atom: CustomFieldQueryAtom): boolean { + return ( + this.getCustomFieldByID(atom.field)?.data_type === + CustomFieldDataType.Date && + atom.operator !== CustomFieldQueryOperator.Exists && + atom.operator !== CustomFieldQueryOperator.IsNull + ) + } + toggleRelativeDate(atom: CustomFieldQueryAtom) { if (this.getRelativeDate(atom)) { this.relativeDates.delete(atom.id)