Skip to content

Commit

Permalink
Add additional TaskType constant for sync cleanup tasks, and filter o…
Browse files Browse the repository at this point in the history
…ut sync cleanup and LOD sync tasks from the Facility Task Management display
  • Loading branch information
marcellamaki committed Nov 21, 2023
1 parent feb5d34 commit 4eeedcc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions kolibri/core/assets/src/utils/syncTaskUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export const TaskTypes = {
IMPORTUSERSFROMCSV: 'kolibri.core.auth.tasks.importusersfromcsv',
EXPORTUSERSTOCSV: 'kolibri.core.auth.tasks.exportuserstocsv',
IMPORTLODUSER: 'kolibri.core.auth.tasks.peeruserimport',
CLEANUPSYNC: 'kolibri.core.auth.tasks.cleanupsync',
};

// identical to facility constants.js
Expand Down
7 changes: 7 additions & 0 deletions kolibri/core/assets/src/views/sync/FacilityTaskPanel.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<template>

<FacilityTaskPanelDetails
v-if="taskShouldDisplay"
:statusMsg="taskInfo.statusMsg"
:headingMsg="taskInfo.headingMsg"
:underHeadingMsg="taskInfo.deviceNameMsg"
Expand Down Expand Up @@ -73,6 +74,9 @@
isImportTask() {
return this.task.type === TaskTypes.SYNCPEERPULL;
},
isSyncCleanupTask() {
return this.task.type === TaskTypes.CLEANUPSYNC;
},
taskInfo() {
if (this.isSetupImportTask) {
return importFacilityTaskDisplayInfo(this.task);
Expand All @@ -88,6 +92,9 @@
}
return {};
},
taskShouldDisplay() {
return !this.isLODImportTask && !this.isSyncCleanupTask;
},
loaderType() {
const { sync_state = '' } = this.task;
if (indeterminateSyncStatuses.find(s => s === sync_state)) {
Expand Down

0 comments on commit 4eeedcc

Please sign in to comment.