fix(stacks): sort by date [EE-5766] (#10758)

pull/10819/head
Chaim Lev-Ari 2023-12-10 10:26:06 +01:00 committed by GitHub
parent c58fa274e7
commit 57b80cd9ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 11 deletions

View File

@ -144,18 +144,18 @@
<table-column-header <table-column-header
col-title="'Created'" col-title="'Created'"
can-sort="true" can-sort="true"
is-sorted="$ctrl.state.orderBy === 'ResourceControl.CreationDate'" is-sorted="$ctrl.state.orderBy === 'CreationDate'"
is-sorted-desc="$ctrl.state.orderBy === 'ResourceControl.CreationDate' && $ctrl.state.reverseOrder" is-sorted-desc="$ctrl.state.orderBy === 'CreationDate' && $ctrl.state.reverseOrder"
ng-click="$ctrl.changeOrderBy('ResourceControl.CreationDate')" ng-click="$ctrl.changeOrderBy('CreationDate')"
></table-column-header> ></table-column-header>
</th> </th>
<th ng-if="$ctrl.columnVisibility.columns.updated.display"> <th ng-if="$ctrl.columnVisibility.columns.updated.display">
<table-column-header <table-column-header
col-title="'Updated'" col-title="'Updated'"
can-sort="true" can-sort="true"
is-sorted="$ctrl.state.orderBy === 'ResourceControl.UpdateDate'" is-sorted="$ctrl.state.orderBy === 'UpdateDate'"
is-sorted-desc="$ctrl.state.orderBy === 'ResourceControl.UpdateDate' && $ctrl.state.reverseOrder" is-sorted-desc="$ctrl.state.orderBy === 'UpdateDate' && $ctrl.state.reverseOrder"
ng-click="$ctrl.changeOrderBy('ResourceControl.UpdateDate')" ng-click="$ctrl.changeOrderBy('UpdateDate')"
></table-column-header> ></table-column-header>
</th> </th>
<th> <th>

View File

@ -13,9 +13,9 @@ export function StackViewModel(data) {
this.ResourceControl = new ResourceControlViewModel(data.ResourceControl); this.ResourceControl = new ResourceControlViewModel(data.ResourceControl);
} }
this.Status = data.Status; this.Status = data.Status;
this.CreationDate = data.CreationDate; this.CreationDate = data.CreationDate || undefined; // set undefined for angular sorting
this.CreatedBy = data.CreatedBy; this.CreatedBy = data.CreatedBy;
this.UpdateDate = data.UpdateDate; this.UpdateDate = data.UpdateDate || undefined; // set undefined for angular sorting
this.UpdatedBy = data.UpdatedBy; this.UpdatedBy = data.UpdatedBy;
this.Regular = true; this.Regular = true;
this.External = false; this.External = false;
@ -30,7 +30,7 @@ export function StackViewModel(data) {
export function ExternalStackViewModel(name, type, creationDate) { export function ExternalStackViewModel(name, type, creationDate) {
this.Name = name; this.Name = name;
this.Type = type; this.Type = type;
this.CreationDate = creationDate; this.CreationDate = creationDate || undefined; // set undefined for angular sorting
this.Regular = false; this.Regular = false;
this.External = true; this.External = true;
@ -50,9 +50,9 @@ export function OrphanedStackViewModel(data) {
this.ResourceControl = new ResourceControlViewModel(data.ResourceControl); this.ResourceControl = new ResourceControlViewModel(data.ResourceControl);
} }
this.Status = data.Status; this.Status = data.Status;
this.CreationDate = data.CreationDate; this.CreationDate = data.CreationDate || undefined; // set undefined for angular sorting
this.CreatedBy = data.CreatedBy; this.CreatedBy = data.CreatedBy;
this.UpdateDate = data.UpdateDate; this.UpdateDate = data.UpdateDate || undefined; // set undefined for angular sorting
this.UpdatedBy = data.UpdatedBy; this.UpdatedBy = data.UpdatedBy;
this.Regular = false; this.Regular = false;