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

Add "Update resources" option to Options dropdown #12137

Merged
merged 2 commits into from
May 14, 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 @@ -389,6 +389,7 @@
questionList$,
sectionDeletedNotification$,
deleteConfirmation$,
updateResources$,
} = enhancedQuizManagementStrings;

const {
Expand Down Expand Up @@ -461,6 +462,7 @@
updateQuiz,
addQuestionToSelection,
removeQuestionFromSelection,
updateResources$,

// Computed
channels,
Expand Down Expand Up @@ -532,6 +534,11 @@
icon: 'delete',
id: 'delete',
},
{
label: this.updateResources$(),
icon: 'plus',
id: 'plus',
},
];
},
},
Expand Down Expand Up @@ -566,13 +573,19 @@
handleActiveSectionAction(opt) {
const section_id = this.activeSection.section_id;
const editRoute = this.$router.getRoute(PageNames.QUIZ_SECTION_EDITOR, { section_id });
const resourcesRoute = this.$router.getRoute(PageNames.QUIZ_SELECT_RESOURCES, {
Copy link
Member

Choose a reason for hiding this comment

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

@AllanOXDi, No blocker, just a clarification on whether this route would not need the optional topic_id param too?

Copy link
Member Author

Choose a reason for hiding this comment

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

Update this handleActiveSectionAction method so that it also checks against the string used for the label and routes the user to the select QUIZ_SELECT_RESOURCES route

No, The topic_id is optional. From my understand of the above. ResourceSelection component should be rendered when navigating to QUIZ_SELECT_RESOURCES route which expects an optional topic_id parameter and it can be accessed within the ResourceSelection component.

section_id,
});
switch (opt.label) {
case this.editSectionLabel$():
this.$router.push(editRoute);
break;
case this.deleteSectionLabel$():
this.handleShowConfirmation(section_id);
break;
case this.updateResources$():
this.$router.push(resourcesRoute);
break;
}
},
tabRefLabel(section_id) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,4 +182,7 @@ export const enhancedQuizManagementStrings = createTranslator('EnhancedQuizManag
message: "Section '{ section_title }' deleted",
context: 'A snackbar message that appears when the user deletes a section',
},
updateResources: {
message: 'Update resources',
},
});