Skip to content

Commit

Permalink
appease the linter
Browse files Browse the repository at this point in the history
  • Loading branch information
nucleogenesis committed Jul 17, 2024
1 parent 846b97f commit 979e360
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 73 deletions.
2 changes: 1 addition & 1 deletion kolibri/plugins/coach/assets/src/routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export default [
{
path: '/:classId/home/activity',
component: HomeActivityPage,
handler: async (toRoute, fromRoute, next) => {
handler: async toRoute => {
await showHomePage(toRoute);
store.dispatch('notLoading');
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@
}"
>
<ul class="question-list">
<li v-for="(question, i) in section.questions">
<li
v-for="(question, i) in section.questions"
:key="`question-list-${i}`"
>
<KButton
tabindex="0"
class="question-button"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,22 +144,12 @@
} from 'kolibri-common/strings/enhancedQuizManagementStrings';
import commonCoreStrings from 'kolibri.coreVue.mixins.commonCoreStrings';
import useKResponsiveWindow from 'kolibri-design-system/lib/composables/useKResponsiveWindow';
import Draggable from 'kolibri.coreVue.components.Draggable';
import DragContainer from 'kolibri.coreVue.components.DragContainer';
import DragHandle from 'kolibri.coreVue.components.DragHandle';
import DragSortWidget from 'kolibri.coreVue.components.DragSortWidget';
import { PageNames } from '../../../constants/index';
import { injectQuizCreation } from '../../../composables/useQuizCreation';
import useDrag from './useDrag.js';
export default {
name: 'SectionEditor',
components: {
Draggable,
DragContainer,
DragHandle,
DragSortWidget,
},
mixins: [commonCoreStrings],
setup(_, context) {
const router = getCurrentInstance().proxy.$router;
Expand Down Expand Up @@ -351,23 +341,9 @@
};
},
computed: {
borderStyle() {
return `border: 1px solid ${this.$themeTokens.fineLine}`;
},
activeSectionStyles() {
return {
backgroundColor: this.$themePalette.grey.v_50,
border: `1px solid ${this.$themeTokens.fineLine}`,
};
},
dividerStyle() {
return `color : ${this.$themeTokens.fineLine}`;
},
draggableStyle() {
return {
backgroundColor: this.$themeTokens.surface,
};
},
selectResourcesRoute() {
return { name: PageNames.QUIZ_SELECT_RESOURCES };
},
Expand All @@ -386,13 +362,6 @@
}
},
methods: {
handleSectionSort(e) {
this.sectionOrderList = e.newArray;
const reorderedId = this.allSections[this.activeSectionIndex].section_id;
this.reorderedSectionIndex = this.sectionOrderList.findIndex(
section => section.section_id === reorderedId,
);
},
applySettings(nextRouteName = PageNames.EXAM_CREATION_ROOT) {
if (this.sectionTitleInvalid) {
this.$refs.sectionTitle.focus();
Expand Down Expand Up @@ -437,20 +406,6 @@
this.$emit('closePanel');
}
},
handleKeyboardDragDown(oldIndex, array) {
const newArray = this.moveDownOne(oldIndex, array);
this.sectionOrderList = newArray;
},
handleKeyboardDragUp(oldIndex, array) {
const newArray = this.moveUpOne(oldIndex, array);
this.sectionOrderList = newArray;
},
sectionOrderingTitle(section) {
const sectionIndexOrder = this.allSections.findIndex(
s => s.section_id === section.section_id,
);
return displaySectionTitle(section, sectionIndexOrder).toUpperCase();
},
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<span
v-if="section.description"
class="current-section-style"
style="flex: 2; text-overflow: ellipses"
style="flex: 2; text-overflow: ellipsis"
>
{{ section.description }}
</span>
Expand Down Expand Up @@ -87,8 +87,7 @@
<script>
import isEqual from 'lodash/isEqual';
import pick from 'lodash/pick';
import { getCurrentInstance, computed, ref } from 'kolibri.lib.vueCompositionApi';
import { computed, ref } from 'kolibri.lib.vueCompositionApi';
import {
displaySectionTitle,
enhancedQuizManagementStrings,
Expand All @@ -113,12 +112,9 @@
},
mixins: [commonCoreStrings],
setup(_, context) {
const router = getCurrentInstance().proxy.$router;
const {
sectionSettings$,
sectionTitle$,
sectionTitleUniqueWarning$,
numberOfQuestionsLabel$,
optionalDescriptionLabel$,
numberOfQuestionsSelected$,
Expand Down Expand Up @@ -148,7 +144,6 @@
allSections,
updateSection,
updateQuiz,
removeSection,
} = injectQuizCreation();
const { moveDownOne, moveUpOne } = useDrag();
Expand All @@ -166,19 +161,6 @@
// This is used to track the section that was moved
const reorderedSectionIndex = ref(null);
const section_title = ref(activeSection?.value?.section_title?.trim() || '');
const activeSectionChanged = computed(() => {
return !isEqual(
{
learners_see_fixed_order: learners_see_fixed_order.value,
description: description.value,
section_title: section_title.value.trim(),
},
pick(activeSection.value, ['learners_see_fixed_order', 'description', 'section_title']),
);
});
const sectionOrderList = ref(allSections.value);
const sectionOrderChanged = computed(() => {
Expand Down Expand Up @@ -261,17 +243,11 @@
border: `1px solid ${this.$themeTokens.fineLine}`,
};
},
dividerStyle() {
return `color : ${this.$themeTokens.fineLine}`;
},
draggableStyle() {
return {
backgroundColor: this.$themeTokens.surface,
};
},
selectResourcesRoute() {
return { name: PageNames.QUIZ_SELECT_RESOURCES };
},
},
beforeRouteLeave(to, __, next) {
if (this.formDataHasChanged && !this.showCloseConfirmation) {
Expand Down

0 comments on commit 979e360

Please sign in to comment.