Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(dedicated.pcc): fix display of operation tasks #14696

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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: {
Expand Down Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Constant necessary ?

this.progressionFilterList = map(this.stateEnum, (state) => ({
value: state,
label: this.$translate.instant(
Expand Down Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading