Skip to content

Commit

Permalink
more comment fix
Browse files Browse the repository at this point in the history
  • Loading branch information
AllanOXDi committed Dec 18, 2024
1 parent a9eb601 commit 26142c6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
import { mapState } from 'vuex';
import { searchAndFilterStrings } from 'kolibri-common/strings/searchAndFilterStrings';
import commonCoreStrings from 'kolibri/uiText/commonCoreStrings';
import { ref, getCurrentInstance, computed } from 'vue';
import { ref, getCurrentInstance } from 'vue';
import { enhancedQuizManagementStrings } from 'kolibri-common/strings/enhancedQuizManagementStrings';
import { PageNames } from '../../../../constants';
import commonCoach from '../../../common';
Expand All @@ -79,31 +79,28 @@
mixins: [commonCoach, commonCoreStrings],
setup() {
const showModal = ref(false);
const backupResources = ref([]);
const store = getCurrentInstance().proxy.$store;
const hasArrayChanged = ref(false);
const router = getCurrentInstance().proxy.$router;
const workingResourcePool = computed(() => store.state.lessonSummary.workingResources);
const { saveLessonResources$, numberOfSelectedResource$ } = searchAndFilterStrings;
const { closeConfirmationTitle$, closeConfirmationMessage$ } = enhancedQuizManagementStrings;
function closeModal() {
showModal.value = false;
}
function hasModifiedArray() {
hasArrayChanged.value = true;
}
function closeSidePanel() {
if (workingResourcePool.value !== backupResources.value) {
if (hasArrayChanged.value) {
showModal.value = true;
} else {
router.go(-1);
}
showModal.value = true;
}
function saveResourcesCopy() {
backupResources.value = workingResourcePool;
}
saveResourcesCopy();
return {
saveLessonResources$,
numberOfSelectedResource$,
Expand All @@ -112,6 +109,7 @@
showModal,
closeModal,
closeSidePanel,
hasModifiedArray,
};
},
data() {
Expand All @@ -121,13 +119,6 @@
},
computed: {
...mapState('lessonSummary', ['currentLesson', 'workingResources', 'resourceCache']),
lessonOrderListButtonBorder() {
return {
borderBottom: `1px solid ${this.$themePalette.grey.v_200}`,
height: `4em`,
marginTop: `0.5em`,
};
},
},
mounted() {
setTimeout(() => {
Expand All @@ -137,6 +128,7 @@
methods: {
removeResource(id) {
this.resources = this.resources.filter(lesson => lesson.id !== id);
this.hasModifiedArray();
},
navigateToParent(id) {
this.$router.push({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<template>

<div v-if="loading">
<div
v-if="loading"
class="resource-list-style"
>
<KCircularLoader />
</div>
<div
Expand Down

0 comments on commit 26142c6

Please sign in to comment.