From 76d2100b17bb15e39c59b48f671c2624895c3149 Mon Sep 17 00:00:00 2001 From: marcellamaki Date: Fri, 27 Oct 2023 13:24:37 -0400 Subject: [PATCH] Revert "Disabling additional user import until multiple user syncing is working" --- .../assets/src/views/ImportMultipleUsers.vue | 19 ---------- .../assets/src/views/LoadingTaskPage.vue | 37 +++++++------------ 2 files changed, 14 insertions(+), 42 deletions(-) diff --git a/kolibri/plugins/setup_wizard/assets/src/views/ImportMultipleUsers.vue b/kolibri/plugins/setup_wizard/assets/src/views/ImportMultipleUsers.vue index 4fcde188bf6..a6a1e1bbdee 100644 --- a/kolibri/plugins/setup_wizard/assets/src/views/ImportMultipleUsers.vue +++ b/kolibri/plugins/setup_wizard/assets/src/views/ImportMultipleUsers.vue @@ -32,7 +32,6 @@ v-if="!isImported(userRow.user) && !isImporting(userRow.user)" :text="coreString('importAction')" appearance="flat-button" - :disabled="isImportingUserDisabled" @click="startImport(userRow.user)" /> 0 || - this.wizardService.state.context.importedUsers.length > 0 - ) { - this.wizardService.send('LOADING'); - } TaskResource.list({ queue: SoudQueue }).then(tasks => { if (tasks.length) { tasks.forEach(task => { @@ -197,7 +186,6 @@ } }, startImport(learner) { - this.isImportingUserDisabled = true; // Push the learner into being imported, we'll remove it if we get an error later on this.learnersBeingImported.push(learner.id); @@ -219,21 +207,14 @@ } TaskResource.startTask(params).catch(() => { this.learnersBeingImported = this.learnersBeingImported.filter(id => id != learner.id); - this.isImportingUserDisabled = false; }); }, isImported(learner) { return this.importedLearners().find(u => u === learner.username); }, isImporting(learner) { - this.checkImportedUser(learner); return this.learnersBeingImported.includes(learner.id); }, - checkImportedUser(learner) { - if (this.learnersBeingImported.length > 0 || this.isImported(learner)) { - this.isImportingUserDisabled = true; - } - }, }, $trs: { commaSeparatedPair: { diff --git a/kolibri/plugins/setup_wizard/assets/src/views/LoadingTaskPage.vue b/kolibri/plugins/setup_wizard/assets/src/views/LoadingTaskPage.vue index 001a01e3853..6511bdfc2f6 100644 --- a/kolibri/plugins/setup_wizard/assets/src/views/LoadingTaskPage.vue +++ b/kolibri/plugins/setup_wizard/assets/src/views/LoadingTaskPage.vue @@ -35,13 +35,12 @@ - - + /> @@ -54,12 +53,7 @@ import commonSyncElements from 'kolibri.coreVue.mixins.commonSyncElements'; import { TaskResource } from 'kolibri.resources'; import { TaskStatuses } from 'kolibri.utils.syncTaskUtils'; - import { - DeviceTypePresets, - // LodTypePresets, - SoudQueue, - FooterMessageTypes, - } from '../constants'; + import { DeviceTypePresets, LodTypePresets, SoudQueue, FooterMessageTypes } from '../constants'; import OnboardingStepBase from './OnboardingStepBase'; export default { @@ -130,10 +124,9 @@ isSoud() { return this.queue === SoudQueue; }, - // TODO: role this back when multiple user syncing is working in the upcoming release! - // isImportingSoud() { - // return this.wizardService.state.context.lodImportOrJoin === LodTypePresets.IMPORT; - // }, + isImportingSoud() { + return this.wizardService.state.context.lodImportOrJoin === LodTypePresets.IMPORT; + }, queue() { return this.wizardService.state.context.fullOrLOD === DeviceTypePresets.LOD ? SoudQueue @@ -150,11 +143,10 @@ this.pollTask(); }, methods: { - // TODO: role this back when multiple user syncing is working in the upcoming release! - // importAnother() { - // this.isPolling = false; - // this.wizardService.send('IMPORT_ANOTHER'); - // }, + importAnother() { + this.isPolling = false; + this.wizardService.send('IMPORT_ANOTHER'); + }, pushCompletedToWizardMachine() { this.completedTasks.forEach(task => { if (!this.wizardService.state.context.importedUsers.includes(task.username)) { @@ -234,11 +226,10 @@ }, }, $trs: { - // TODO: role this back when multiple user syncing is working in the upcoming release! - // importAnother: { - // message: 'Import another user account', - // context: 'Link to restart the import step for another user. ', - // }, + importAnother: { + message: 'Import another user account', + context: 'Link to restart the import step for another user. ', + }, loadUserTitle: { message: 'Load user account', context: 'Title of a page where user is waiting for a user to be imported',