Skip to content

Commit

Permalink
fix(dedicated.pcc): fix display of operation tasks
Browse files Browse the repository at this point in the history
ref: MANAGER-16581 PRB0040995 PRB0041695

Signed-off-by: David Arsène <david.arsene.ext@ovhcloud.com>
  • Loading branch information
darsene committed Dec 20, 2024
1 parent 5dc4f4b commit a17b4d3
Showing 3 changed files with 24 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -551,15 +551,15 @@ class DedicatedCloudService {

/* ------- ICEBERG -------*/

icebergQuery(url, params) {
icebergQuery(url, paginationParams, urlParams) {
const {
filters,
pageSize,
offset,
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) {
Original file line number Diff line number Diff line change
@@ -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) {
Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@ <h2 data-translate="dedicatedCloud_tab_operation"></h2>
data-ng-if="!$ctrl.loading"
data-rows-loader="$ctrl.loadOperations($config)"
data-row-loader="$ctrl.loadOperationAdditionalData($row)"
data-pagination-mode="select"
>
<oui-datagrid-column
data-title=":: 'dedicatedCloud_OPERATIONS_taskId' | translate"

0 comments on commit a17b4d3

Please sign in to comment.