From e40d90e09babb621f770943772da2e91fb79016d Mon Sep 17 00:00:00 2001 From: Jacob Pierce Date: Fri, 16 Feb 2024 11:15:35 -0800 Subject: [PATCH] add messages; slots for showing them w/out issues in other usages of card list --- .../plan/CreateExamPage/ResourceSelection.vue | 34 +++++++++++++++++-- .../ContentCardList.vue | 6 +++- .../LessonContentCard/index.vue | 1 + .../strings/enhancedQuizManagementStrings.js | 7 ++++ 4 files changed, 45 insertions(+), 3 deletions(-) diff --git a/kolibri/plugins/coach/assets/src/views/plan/CreateExamPage/ResourceSelection.vue b/kolibri/plugins/coach/assets/src/views/plan/CreateExamPage/ResourceSelection.vue index 62cda5b4a6c..fcd648b49ec 100644 --- a/kolibri/plugins/coach/assets/src/views/plan/CreateExamPage/ResourceSelection.vue +++ b/kolibri/plugins/coach/assets/src/views/plan/CreateExamPage/ResourceSelection.vue @@ -50,6 +50,14 @@ +
+ {{ cannotSelectSomeTopicWarning$() }} +
+ + > + +
@@ -145,6 +160,8 @@ numberOfSelectedResources$, numberOfResources$, selectedResourcesInformation$, + cannotSelectTopicCard$, + cannotSelectSomeTopicWarning$, } = enhancedQuizManagementStrings; // TODO let's not use text for this @@ -383,6 +400,8 @@ resetWorkingResourcePool, contentPresentInWorkingResourcePool, //contentList, + cannotSelectTopicCard$, + cannotSelectSomeTopicWarning$, sectionSettings$, selectFromBookmarks$, numberOfSelectedBookmarks$, @@ -439,6 +458,12 @@ }, }, methods: { + showTopicSizeWarningCard(content) { + return !this.hasCheckbox(content) && content.kind === ContentNodeKinds.TOPIC; + }, + showTopicSizeWarning() { + return this.contentList.some(this.showTopicSizeWarningCard); + }, /** @public */ focusFirstEl() { this.$refs.textbox.focus(); @@ -593,4 +618,9 @@ margin-top: 2em; } - + .shadow { + box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 1px 1px 0 rgba(0, 0, 0, 0.14), + 0 2px 1px -1px rgba(0, 0, 0, 0.12); + } + + diff --git a/kolibri/plugins/coach/assets/src/views/plan/LessonResourceSelectionPage/ContentCardList.vue b/kolibri/plugins/coach/assets/src/views/plan/LessonResourceSelectionPage/ContentCardList.vue index d0dfd643cc9..ffc72b8e6c3 100644 --- a/kolibri/plugins/coach/assets/src/views/plan/LessonResourceSelectionPage/ContentCardList.vue +++ b/kolibri/plugins/coach/assets/src/views/plan/LessonResourceSelectionPage/ContentCardList.vue @@ -33,7 +33,11 @@ :link="contentCardLink(content)" :numCoachContents="content.num_coach_contents" :isLeaf="content.is_leaf" - /> + > + + diff --git a/kolibri/plugins/coach/assets/src/views/plan/LessonResourceSelectionPage/LessonContentCard/index.vue b/kolibri/plugins/coach/assets/src/views/plan/LessonResourceSelectionPage/LessonContentCard/index.vue index c64bf7f18ca..e3ed3035d4e 100644 --- a/kolibri/plugins/coach/assets/src/views/plan/LessonResourceSelectionPage/LessonContentCard/index.vue +++ b/kolibri/plugins/coach/assets/src/views/plan/LessonResourceSelectionPage/LessonContentCard/index.vue @@ -52,6 +52,7 @@ :isTopic="isTopic" />
+ diff --git a/packages/kolibri-common/strings/enhancedQuizManagementStrings.js b/packages/kolibri-common/strings/enhancedQuizManagementStrings.js index 039a606f141..adff03bdcfa 100644 --- a/packages/kolibri-common/strings/enhancedQuizManagementStrings.js +++ b/packages/kolibri-common/strings/enhancedQuizManagementStrings.js @@ -154,4 +154,11 @@ export const enhancedQuizManagementStrings = createTranslator('EnhancedQuizManag message: '{count, number, integer} of {total, number, integer} {total, plural, one {resource selected} other {resources selected}}', }, + cannotSelectTopicCard: { + message: 'Folder exceeds 12 exercises', + }, + cannotSelectSomeTopicWarning: { + message: + 'Select only folders with 12 or fewer exercises and no subfolders to avoid oversized quizzes. Proceed to choose a smaller folder.', + }, });