diff --git a/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/dedicatedCloud.service.js b/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/dedicatedCloud.service.js index d4e57795a3e7..1297a33f0d9d 100644 --- a/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/dedicatedCloud.service.js +++ b/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/dedicatedCloud.service.js @@ -551,7 +551,7 @@ class DedicatedCloudService { /* ------- ICEBERG -------*/ - icebergQuery(url, params) { + icebergQuery(url, paginationParams, urlParams) { const { filters, pageSize, @@ -559,7 +559,7 @@ class DedicatedCloudService { sort, sortOrder, defaultFilterColumn, - } = params; + } = paginationParams; let request = this.iceberg(url) .query() @@ -573,7 +573,7 @@ class DedicatedCloudService { } return this.$q - .resolve(request.execute(null, true).$promise) + .resolve(request.execute(urlParams, true).$promise) .then(({ data, headers }) => ({ data, meta: { @@ -1468,8 +1468,12 @@ class DedicatedCloudService { /* ------- Operations -------*/ - getOperations(serviceName, params) { - return this.icebergQuery(`/dedicatedCloud/${serviceName}/task`, params); + getOperations(serviceName, paginationParams, urlParams) { + return this.icebergQuery( + `/dedicatedCloud/${serviceName}/task`, + paginationParams, + urlParams, + ); } getOperation(serviceName, opts) { diff --git a/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/operation/dedicatedCloud-operation.controller.js b/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/operation/dedicatedCloud-operation.controller.js index 038cc7892c7f..e0a3be23cb56 100644 --- a/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/operation/dedicatedCloud-operation.controller.js +++ b/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/operation/dedicatedCloud-operation.controller.js @@ -28,7 +28,7 @@ export default class { return this.DedicatedCloud.getModels() .then((data) => { this.stateEnum = data.models['dedicatedCloud.TaskStateEnum'].enum; - this.progressionFilter = null; + this.progressionFilter = 'doing'; this.progressionFilterList = map(this.stateEnum, (state) => ({ value: state, label: this.$translate.instant( @@ -57,23 +57,25 @@ export default class { } loadOperations({ offset, pageSize, sort }) { - const params = { + const paginationParams = { offset, pageSize, sort: sort.property, sortOrder: sort.dir === 1 ? 'ASC' : 'DESC', defaultFilterColumn: 'executionDate', - filters: this.progressionFilter - ? [ - { - field: 'state', - comparator: 'is', - reference: [this.progressionFilter], - }, - ] - : [], }; - return this.DedicatedCloud.getOperations(this.productId, params); + // limitation to one year in case of too many data + const executionDate = new Date(); + executionDate.setFullYear(executionDate.getFullYear() - 1); + const urlParams = { + state: this.progressionFilter, + executionDate: executionDate.toISOString(), + }; + return this.DedicatedCloud.getOperations( + this.productId, + paginationParams, + urlParams, + ); } setRelatedServices(operation) { diff --git a/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/operation/dedicatedCloud-operation.html b/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/operation/dedicatedCloud-operation.html index 79fc49b0937c..1eacdd845b96 100644 --- a/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/operation/dedicatedCloud-operation.html +++ b/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/operation/dedicatedCloud-operation.html @@ -10,6 +10,7 @@
data-ng-if="!$ctrl.loading" data-rows-loader="$ctrl.loadOperations($config)" data-row-loader="$ctrl.loadOperationAdditionalData($row)" + data-pagination-mode="select" >