Added created time column
This commit is contained in:
parent
8d4d5ebb16
commit
9623d62831
@ -14,7 +14,11 @@
|
||||
/// limitations under the License.
|
||||
///
|
||||
|
||||
import { EntityTableColumn, EntityTableConfig } from '@home/models/entity/entities-table-config.models';
|
||||
import {
|
||||
DateEntityTableColumn,
|
||||
EntityTableColumn,
|
||||
EntityTableConfig
|
||||
} from '@home/models/entity/entities-table-config.models';
|
||||
import { EntityType, entityTypeTranslations } from '@shared/models/entity-type.models';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { Direction } from '@shared/models/page/sort-order';
|
||||
@ -54,6 +58,7 @@ import {
|
||||
} from './components/public-api';
|
||||
import { ImportExportService } from '@shared/import-export/import-export.service';
|
||||
import { isObject } from '@core/utils';
|
||||
import { DatePipe } from '@angular/common';
|
||||
|
||||
export class CalculatedFieldsTableConfig extends EntityTableConfig<CalculatedField, PageLink> {
|
||||
|
||||
@ -70,6 +75,7 @@ export class CalculatedFieldsTableConfig extends EntityTableConfig<CalculatedFie
|
||||
constructor(private calculatedFieldsService: CalculatedFieldsService,
|
||||
private translate: TranslateService,
|
||||
private dialog: MatDialog,
|
||||
private datePipe: DatePipe,
|
||||
public entityId: EntityId = null,
|
||||
private store: Store<AppState>,
|
||||
private durationLeft: DurationLeftPipe,
|
||||
@ -108,7 +114,7 @@ export class CalculatedFieldsTableConfig extends EntityTableConfig<CalculatedFie
|
||||
}
|
||||
];
|
||||
|
||||
this.defaultSortOrder = {property: 'name', direction: Direction.DESC};
|
||||
this.defaultSortOrder = {property: 'createdTime', direction: Direction.DESC};
|
||||
|
||||
const expressionColumn = new EntityTableColumn<CalculatedField>('expression', 'calculated-fields.expression', '300px');
|
||||
expressionColumn.sortable = false;
|
||||
@ -121,6 +127,7 @@ export class CalculatedFieldsTableConfig extends EntityTableConfig<CalculatedFie
|
||||
return expressionLabel.length < 50 ? null : expressionLabel
|
||||
};
|
||||
|
||||
this.columns.push(new DateEntityTableColumn<CalculatedField>('createdTime', 'common.created-time', this.datePipe, '150px'));
|
||||
this.columns.push(new EntityTableColumn<CalculatedField>('name', 'common.name', '33%'));
|
||||
this.columns.push(new EntityTableColumn<CalculatedField>('type', 'common.type', '50px', entity => this.translate.instant(CalculatedFieldTypeTranslations.get(entity.type))));
|
||||
this.columns.push(expressionColumn);
|
||||
|
||||
@ -35,6 +35,7 @@ import { DurationLeftPipe } from '@shared/pipe/duration-left.pipe';
|
||||
import { TbPopoverService } from '@shared/components/popover.service';
|
||||
import { CalculatedFieldsService } from '@core/http/calculated-fields.service';
|
||||
import { ImportExportService } from '@shared/import-export/import-export.service';
|
||||
import { DatePipe } from '@angular/common';
|
||||
|
||||
@Component({
|
||||
selector: 'tb-calculated-fields-table',
|
||||
@ -56,6 +57,7 @@ export class CalculatedFieldsTableComponent {
|
||||
private translate: TranslateService,
|
||||
private dialog: MatDialog,
|
||||
private store: Store<AppState>,
|
||||
private datePipe: DatePipe,
|
||||
private durationLeft: DurationLeftPipe,
|
||||
private popoverService: TbPopoverService,
|
||||
private cd: ChangeDetectorRef,
|
||||
@ -69,6 +71,7 @@ export class CalculatedFieldsTableComponent {
|
||||
this.calculatedFieldsService,
|
||||
this.translate,
|
||||
this.dialog,
|
||||
this.datePipe,
|
||||
this.entityId(),
|
||||
this.store,
|
||||
this.durationLeft,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user