diff --git a/src/app/common/dialog/dialog.model.ts b/src/app/common/dialog/dialog.model.ts index f1bae4bb..15d72e33 100644 --- a/src/app/common/dialog/dialog.model.ts +++ b/src/app/common/dialog/dialog.model.ts @@ -13,7 +13,7 @@ export class DialogReturn { export function isDialogActionOK() { return (source$: Observable>) => - source$.pipe(filter((result) => result.action === DialogAction.OK)); + source$.pipe(filter((result) => result?.action === DialogAction.OK)); } export function mapToDialogReturnData() { diff --git a/src/app/common/pipes/utc-date-pipe/utc-date-utils.service.ts b/src/app/common/pipes/utc-date-pipe/utc-date-utils.service.ts index 02b69c6b..117adc6f 100644 --- a/src/app/common/pipes/utc-date-pipe/utc-date-utils.service.ts +++ b/src/app/common/pipes/utc-date-pipe/utc-date-utils.service.ts @@ -7,7 +7,7 @@ export class UtcDateUtils { value: string | number | Date | DateTime | null | undefined, format?: string ): string { - if (null != value) { + if (value) { let luxonDate; if (value instanceof DateTime) { luxonDate = value; @@ -15,8 +15,15 @@ export class UtcDateUtils { luxonDate = DateTime.fromJSDate(value).toUTC(); } else if (typeof value === 'number') { luxonDate = DateTime.fromMillis(value).toUTC(); - } else if (typeof value === 'string') { + } else { luxonDate = DateTime.fromISO(value).toUTC(); + + if (!luxonDate.isValid) { + luxonDate = DateTime.fromFormat(value, 'D').toUTC(); + } + if (!luxonDate.isValid) { + luxonDate = DateTime.fromFormat(value, 'M-d-yyyy').toUTC(); + } if (!luxonDate.isValid) { // converts a string of milliseconds into a number value = +value; diff --git a/src/app/common/table/asy-table-data-source.ts b/src/app/common/table/asy-table-data-source.ts index e3a15ff0..81f6c457 100644 --- a/src/app/common/table/asy-table-data-source.ts +++ b/src/app/common/table/asy-table-data-source.ts @@ -86,7 +86,7 @@ export class AsyTableDataSource extends DataSource { switchMap(([search, filter]) => pagingOptions$.pipe(map((pagingOptions) => [pagingOptions, search, filter])) ), - tap(([pagingOptions]) => { + tap(() => { this.loading$.next(true); this.pagingResults$.next(NULL_PAGING_RESULTS); }), diff --git a/src/app/common/table/columns/expander/asy-expander-column.component.html b/src/app/common/table/columns/expander/asy-expander-column.component.html index 83d8da84..0def06bb 100644 --- a/src/app/common/table/columns/expander/asy-expander-column.component.html +++ b/src/app/common/table/columns/expander/asy-expander-column.component.html @@ -4,7 +4,7 @@ @if (isExpandable()(index, item)) {
diff --git a/src/app/common/table/columns/selection/asy-selection-column.component.html b/src/app/common/table/columns/selection/asy-selection-column.component.html index e4c4ef06..01512dae 100644 --- a/src/app/common/table/columns/selection/asy-selection-column.component.html +++ b/src/app/common/table/columns/selection/asy-selection-column.component.html @@ -9,7 +9,6 @@ [checked]="_isAllSelected$ | async" (change)="_toggleAll()" /> - } @@ -23,10 +22,6 @@ [disabled]="!isSelectable()(_isMultiTemplateDataRows ? dataIndex : index, result)" (change)="toggle(_isMultiTemplateDataRows ? dataIndex : index, result)" /> - diff --git a/src/app/common/table/columns/text/text-column.component.html b/src/app/common/table/columns/text/text-column.component.html index 5814c578..1a64a7be 100644 --- a/src/app/common/table/columns/text/text-column.component.html +++ b/src/app/common/table/columns/text/text-column.component.html @@ -12,6 +12,6 @@ - {{ obj[name] }} + {{ obj[name] || defaultValue() }} diff --git a/src/app/common/table/columns/text/text-column.component.ts b/src/app/common/table/columns/text/text-column.component.ts index ad6f0e1c..f39fd3da 100644 --- a/src/app/common/table/columns/text/text-column.component.ts +++ b/src/app/common/table/columns/text/text-column.component.ts @@ -1,6 +1,6 @@ import { CdkTableModule } from '@angular/cdk/table'; import { CommonModule } from '@angular/common'; -import { Component } from '@angular/core'; +import { Component, input } from '@angular/core'; import { AsySortHeaderComponent } from '../../sort/asy-sort-header/asy-sort-header.component'; import { AsyAbstractValueColumnComponent } from '../asy-abstract-value-column.component'; @@ -12,4 +12,6 @@ import { AsyAbstractValueColumnComponent } from '../asy-abstract-value-column.co templateUrl: './text-column.component.html', styleUrls: ['./text-column.component.scss'] }) -export class TextColumnComponent extends AsyAbstractValueColumnComponent {} +export class TextColumnComponent extends AsyAbstractValueColumnComponent { + readonly defaultValue = input(''); +} diff --git a/src/app/common/table/filter/asy-header-date-filter/asy-header-date-filter.component.html b/src/app/common/table/filter/asy-header-date-filter/asy-header-date-filter.component.html index 43eecb3a..f91c4ab0 100644 --- a/src/app/common/table/filter/asy-header-date-filter/asy-header-date-filter.component.html +++ b/src/app/common/table/filter/asy-header-date-filter/asy-header-date-filter.component.html @@ -24,7 +24,7 @@ cdkConnectedOverlay [cdkConnectedOverlayOpen]="isOpen()" [cdkConnectedOverlayOrigin]="trigger" - (overlayOutsideClick)="isOpen.set(isClickOnDateRangePicker($event))" + (overlayOutsideClick)="handleOutsideClick($event)" >