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

Make no unused properties checking maximally strict #12910

Merged
merged 2 commits into from
Dec 13, 2024
Merged
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 @@ -118,15 +118,13 @@
}
return {};
},
/* eslint-disable vue/no-unused-properties */
/**
* @public
* Note: the default duration historically for HTML5 Apps has been 5 min
*/
defaultDuration() {
return 300;
},
/* eslint-enable vue/no-unused-properties */
},
watch: {
userData(newValue) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@

const Stages = {
SELECT_CLASSROOM: 'SELECT_CLASSROOM',
/* eslint-disable vue/no-unused-properties */
SELECT_GROUPS: 'SELECT_GROUPS',
/* eslint-enable */
};

export default {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@

import commonCoreStrings from 'kolibri/uiText/commonCoreStrings';
import commonCoach from '../../common';
import { useCoachTabs } from '../../../composables/useCoachTabs';
import ReportsControls from '../../common/ReportsControls';

export default {
Expand All @@ -122,13 +121,6 @@
ReportsControls,
},
mixins: [commonCoach, commonCoreStrings],
setup() {
const { saveTabsClick, wereTabsClickedRecently } = useCoachTabs();
Copy link
Member Author

Choose a reason for hiding this comment

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

Broader question - do we still need this composable at all? @AlexVelezLl

Copy link
Member

Choose a reason for hiding this comment

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

Hmmm no, we can remove this.

return {
saveTabsClick,
wereTabsClickedRecently,
};
},
computed: {
learner() {
return this.learnerMap[this.$route.params.learnerId];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@

<script>

import { computed, toRefs } from 'vue';
import commonCoreStrings from 'kolibri/uiText/commonCoreStrings';
import { ViewMoreButtonStates } from '../../../constants/index';
import LessonContentCard from './LessonContentCard';
Expand All @@ -99,14 +98,8 @@
LessonContentCard,
},
mixins: [commonCoreStrings],
setup(props) {
const { selectAllChecked, selectAllIndeterminate } = toRefs(props);
// Code too long to display in template
const ariaChecked = computed(() => {
return selectAllChecked.value ? true : selectAllIndeterminate.value ? 'mixed' : false;
});
setup() {
return {
ariaChecked,
Copy link
Member Author

Choose a reason for hiding this comment

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

@nucleogenesis was this actually needed anywhere?

Copy link
Member

Choose a reason for hiding this comment

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

I think it probably should have been passed to KCheckbox to the :ariaChecked attr

Copy link
Member Author

Choose a reason for hiding this comment

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

This is handled internally by KCheckbox: https://github.com/learningequality/kolibri-design-system/blob/develop/lib/KCheckbox.vue#L15 after your PR: learningequality/kolibri-design-system#572 so this does seem safe to cleanup!

ViewMoreButtonStates,
};
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,6 @@
mixins: [commonCoreStrings, commonCoach],
setup() {
const {
sectionLabel$,
selectAllLabel$,
addSectionLabel$,
quizSectionsLabel$,
Expand All @@ -369,7 +368,6 @@
questionsDeletedNotification$,
expandAll$,
collapseAll$,
questionDeletionConfirmation$,
} = enhancedQuizManagementStrings;

const { upLabel$, downLabel$ } = searchAndFilterStrings;
Expand All @@ -382,7 +380,6 @@
deleteActiveSelectedQuestions,
addSection,
removeSection,
updateQuiz,
selectAllQuestions,
replacementQuestionPool,
// Computed
Expand All @@ -391,7 +388,6 @@
activeSectionIndex,
activeSection,
activeResourceMap,
activeResourcePool,
activeQuestions,
selectedActiveQuestions,
} = injectQuizCreation();
Expand All @@ -403,7 +399,6 @@

return {
dragActive,
sectionLabel$,
expandAll$,
collapseAll$,
selectAllLabel$,
Expand All @@ -415,7 +410,6 @@
addQuizSectionQuestionsInstructions$,
editSectionLabel$,
deleteSectionLabel$,
questionDeletionConfirmation$,
replaceAction$,
questionsLabel$,
numberOfReplacementsAvailable$,
Expand All @@ -431,7 +425,6 @@
deleteActiveSelectedQuestions,
addSection,
removeSection,
updateQuiz,
displaySectionTitle,
displayQuestionTitle,

Expand All @@ -443,7 +436,6 @@
activeSectionIndex,
activeSection,
activeResourceMap,
activeResourcePool,
replacementQuestionPool,
activeQuestions,
selectedActiveQuestions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,6 @@
return {
content,
questions,
currentQuestion,
annotatedSections,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@
} from 'kolibri-common/strings/enhancedQuizManagementStrings';
import { getCurrentInstance, computed, ref } from 'vue';
import { get } from '@vueuse/core';
import isEqual from 'lodash/isEqual';
import commonCoreStrings from 'kolibri/uiText/commonCoreStrings';
import AccordionItem from 'kolibri-common/components/AccordionItem';
import AccordionContainer from 'kolibri-common/components/AccordionContainer';
Expand All @@ -174,7 +173,6 @@

const {
replaceQuestions$,
deleteSectionLabel$,
replaceAction$,
selectAllLabel$,
closeConfirmationMessage$,
Expand All @@ -185,7 +183,6 @@
numberOfQuestionsReplaced$,
noUndoWarning$,
selectQuestionsToContinue$,
selectFewerQuestion$,
collapseAll$,
expandAll$,
} = enhancedQuizManagementStrings;
Expand All @@ -198,19 +195,9 @@
activeResourceMap,
replacementQuestionPool,
clearSelectedQuestions,
replaceSelectedQuestions,
toggleQuestionInSelection,
handleReplacement,
allSections,
} = injectQuizCreation();

const activeSectionTitle = computed(() => {
const activeSectionIndex = allSections.value.findIndex(section =>
isEqual(JSON.stringify(section), JSON.stringify(activeSection.value)),
);
return displaySectionTitle(activeSection.value, activeSectionIndex);
});

Copy link
Member

Choose a reason for hiding this comment

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

@nucleogenesis there's a fair amount of stuff here that's unused in the create exam page, and I think (?) you might be best positioned to take a look and confirm what of this was just leftover from refactoring and other adjustments at the end of 0.17. It seems mostly like that, but... could you just take an extra look through this? I think you will have a better sense than I do.

const showCloseConfirmation = ref(false);
const showReplacementConfirmation = ref(false);
const replacements = ref([]);
Expand Down Expand Up @@ -273,8 +260,6 @@
useAccordion(replacementQuestionPool);

return {
createSnackbar,

toggle,
isExpanded,
collapseAll,
Expand All @@ -285,24 +270,20 @@
toggleInReplacements,
activeSection,
activeSectionIndex,
activeSectionTitle,
selectAllReplacementQuestions,
selectedActiveQuestions,
replacementQuestionPool,
selectAllIsIndeterminate,
selectAllIsChecked,
replaceSelectedQuestions,
activeResourceMap,
showCloseConfirmation,
showReplacementConfirmation,
confirmReplacement,

handleConfirmClose,
toggleQuestionInSelection,
submitReplacement,
replacements,
replaceQuestions$,
deleteSectionLabel$,
replaceAction$,
selectAllLabel$,
numberOfSelectedReplacements$,
Expand All @@ -312,7 +293,6 @@
replaceQuestionsExplaination$,
replaceQuestionsHeading$,
selectQuestionsToContinue$,
selectFewerQuestion$,
collapseAll$,
expandAll$,
displayQuestionTitle,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,6 @@
allResourceMap,
updateSection,
addQuestionsToSectionFromResources,
selectAllQuestions,
allQuestionsInQuiz,
activeQuestions,
addSection,
Expand All @@ -268,7 +267,6 @@
const selectPracticeQuiz = computed(() => props.selectPracticeQuiz);

const {
sectionSettings$,
numberOfSelectedBookmarks$,
selectResourcesDescription$,
questionsFromResources$,
Expand Down Expand Up @@ -722,8 +720,6 @@
activeSectionIndex,
activeQuestions,
addSection,
allResourceMap,
allQuestionsInQuiz,
selectAllChecked,
selectAllIndeterminate,
showSelectAll,
Expand All @@ -734,12 +730,9 @@
handleConfirmClose,
handleCancelClose,
topic,
topicId,
contentList,
resources,
showCloseConfirmation,
loading,
hasMore,
loadingMore,
fetchMoreResources,
resetWorkingResourcePool,
Expand All @@ -748,13 +741,11 @@
questionCount,
maxQuestions,
maxSectionQuestionOptions,
MAX_QUESTIONS_PER_QUIZ_SECTION,
workingPoolUnusedQuestions,
disableSave,
cannotSelectSomeTopicWarning$,
closeConfirmationMessage$,
closeConfirmationTitle$,
sectionSettings$,
numberOfQuestionsSelected$,
tooManyQuestions$,
maxNumberOfQuestions$,
Expand All @@ -764,14 +755,10 @@
questionsFromResources$,
windowIsSmall,
bookmarks,
channels,
viewMoreButtonState,
updateSection,
addQuestionsToSectionFromResources,
selectAllQuestions,
workingResourcePool,
addToWorkingResourcePool,
removeFromWorkingResourcePool,
showBookmarks,
selectQuiz$,
numberOfQuestionsToAdd$,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,9 @@
} from 'kolibri-common/strings/enhancedQuizManagementStrings';
import commonCoreStrings from 'kolibri/uiText/commonCoreStrings';
import { MAX_QUESTIONS_PER_QUIZ_SECTION } from 'kolibri/constants';
import useKResponsiveWindow from 'kolibri-design-system/lib/composables/useKResponsiveWindow';
import useSnackbar from 'kolibri/composables/useSnackbar';
import { PageNames } from '../../../constants/index';
import { injectQuizCreation } from '../../../composables/useQuizCreation.js';
import useDrag from './useDrag.js';

export default {
name: 'SectionEditor',
Expand All @@ -153,12 +151,10 @@
sectionSettings$,
sectionTitle$,
sectionTitleUniqueWarning$,
numberOfQuestionsLabel$,
optionalDescriptionLabel$,
numberOfQuestionsSelected$,
deleteSectionLabel$,
applySettings$,
sectionOrder$,
questionOrder$,
randomizedLabel$,
randomizedOptionDescription$,
Expand All @@ -176,16 +172,13 @@
const {
activeSectionIndex,
activeSection,
activeResourcePool,
activeQuestions,
allSections,
updateSection,
updateQuiz,
removeSection,
} = injectQuizCreation();

const { moveDownOne, moveUpOne } = useDrag();

const showCloseConfirmation = ref(false);

function handleCancelClose() {
Expand Down Expand Up @@ -271,8 +264,6 @@
return activeSectionChanged.value || sectionOrderChanged.value;
});

const { windowIsLarge, windowIsSmall } = useKResponsiveWindow();

const resourceButtonLabel = computed(() => {
if (activeQuestions.value.length === 0) {
return addQuestionsLabel$();
Expand Down Expand Up @@ -304,49 +295,35 @@
// useQuizCreation
activeSectionIndex,
activeSection,
activeResourcePool,
activeQuestions,
allSections,
sectionOrderList,
updateSection,
updateQuiz,
handleDeleteSection,
// dragging a11y
moveDownOne,
moveUpOne,
// Form models
learners_see_fixed_order,
description,
section_title,
resourceButtonLabel,
showResourceButton,
maxQuestionsLabel,
// Responsiveness
windowIsLarge,
windowIsSmall,
// i18n
displaySectionTitle,
addQuestionsLabel$,
sectionSettings$,
sectionTitle$,
numberOfQuestionsLabel$,
optionalDescriptionLabel$,
numberOfQuestionsSelected$,
sectionDeletedNotification$,
deleteSectionLabel$,
applySettings$,
closeConfirmationTitle$,
closeConfirmationMessage$,
deleteConfirmation$,
addMoreQuestionsLabel$,
sectionOrder$,
questionOrder$,
randomizedLabel$,
randomizedOptionDescription$,
fixedLabel$,
fixedOptionDescription$,

createSnackbar,
};
},
computed: {
Expand Down
Loading
Loading