Skip to content

Commit

Permalink
only show save success msg when saving
Browse files Browse the repository at this point in the history
  • Loading branch information
nucleogenesis committed Jul 1, 2024
1 parent 18fef12 commit 4893a79
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,11 @@
return '--';
},
},
mounted() {
if (this.$route.query.snackbar) {
this.$store.dispatch('createSnackbar', this.$route.query.snackbar);
}
},
methods: {
handleOpenQuiz(quizId) {
const promise = ExamResource.saveModel({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,6 @@
numberOfReplacementsAvailable$,
sectionDeletedNotification$,
deleteConfirmation$,
changesSavedSuccessfully$,
questionsDeletedNotification$,
expandAll$,
collapseAll$,
Expand Down Expand Up @@ -449,7 +448,6 @@
numberOfReplacementsAvailable$,
sectionDeletedNotification$,
deleteConfirmation$,
changesSavedSuccessfully$,
questionsDeletedNotification$,
toggleQuestionInSelection,
Expand Down Expand Up @@ -657,7 +655,6 @@
questions: newArray,
};
this.updateSection(payload);
this.$store.dispatch('createSnackbar', this.changesSavedSuccessfully$());
this.dragActive = false;
},
handleAddSection() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,6 @@
numberOfSelectedBookmarks$,
selectResourcesDescription$,
questionsFromResources$,
changesSavedSuccessfully$,
cannotSelectSomeTopicWarning$,
closeConfirmationMessage$,
closeConfirmationTitle$,
Expand Down Expand Up @@ -662,7 +661,6 @@
cannotSelectSomeTopicWarning$,
closeConfirmationMessage$,
closeConfirmationTitle$,
changesSavedSuccessfully$,
sectionSettings$,
numberOfQuestionsSelected$,
tooManyQuestions$,
Expand Down Expand Up @@ -809,7 +807,6 @@
...this.$route.params,
},
});
this.$store.dispatch('createSnackbar', this.changesSavedSuccessfully$());
},
// The message put onto the content's card when listed
selectionMetadata(content) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,6 @@
closeConfirmationMessage$,
closeConfirmationTitle$,
deleteConfirmation$,
changesSavedSuccessfully$,
addQuestionsLabel$,
addMoreQuestionsLabel$,
sectionDeletedNotification$,
Expand Down Expand Up @@ -401,7 +400,6 @@
currentSection$,
deleteSectionLabel$,
applySettings$,
changesSavedSuccessfully$,
closeConfirmationTitle$,
closeConfirmationMessage$,
deleteConfirmation$,
Expand Down Expand Up @@ -478,7 +476,6 @@
question_sources,
});
}
this.$store.dispatch('createSnackbar', this.changesSavedSuccessfully$());
},
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@
allSectionsEmptyWarning$,
closeConfirmationTitle$,
closeConfirmationMessage$,
changesSavedSuccessfully$,
sectionOrderLabel$,
randomizedLabel$,
fixedLabel$,
Expand All @@ -165,6 +166,7 @@
allSectionsEmpty,
allSectionsEmptyWarning$,
saveAndClose$,
changesSavedSuccessfully$,
sectionOrderLabel$,
randomizedLabel$,
fixedLabel$,
Expand Down Expand Up @@ -238,12 +240,16 @@
saveQuizAndRedirect(close = true) {
this.saveQuiz()
.then(exam => {
this.$store.dispatch('createSnackbar', this.changesSavedSuccessfully$());
if (close) {
this.$router.replace({
name: PageNames.EXAMS,
params: {
classId: this.$route.params.classId,
},
query: {
snackbar: this.changesSavedSuccessfully$(),
},
});
} else {
if (String(this.$route.params.quizId) === String(exam.id)) {
Expand Down

0 comments on commit 4893a79

Please sign in to comment.