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

EQM: Only show save success message when saving #12389

Merged
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 @@ -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 @@ -574,10 +572,7 @@
}
},
handleConfirmDelete() {
const section_title = displaySectionTitle(
this.activeSection.value,
this.activeSectionIndex.value,
);
const section_title = displaySectionTitle(this.activeSection, this.activeSectionIndex);
const newIndex = this.activeSectionIndex > 0 ? this.activeSectionIndex - 1 : 0;
this.setActiveSection(newIndex);
this.removeSection(this.activeSectionIndex);
Expand Down Expand Up @@ -657,7 +652,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,7 @@
question_sources,
});
}
this.$store.dispatch('createSnackbar', this.changesSavedSuccessfully$());
this.$emit('closePanel');
},
},
};
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,17 @@
saveQuizAndRedirect(close = true) {
this.saveQuiz()
.then(exam => {
this.$refs.detailsModal.handleSubmitSuccess();
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
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
<UiAlert
v-if="showServerError"
type="error"
:dismissible="false"
:dismissible="true"
@dismiss="showServerError = false"
>
{{ submitErrorMessage }}
</UiAlert>
Expand Down Expand Up @@ -319,6 +320,13 @@
// Scroll to the title field in case focus() didn't do that immediately
window.scrollTo({ top: 0, behavior: 'smooth' });
},
/**
* @public
*/
handleSubmitSuccess() {
this.showTitleError = false;
this.showServerError = false;
},
},
};

Expand Down