Skip to content

Commit

Permalink
add isloading hooks for all workflow states
Browse files Browse the repository at this point in the history
  • Loading branch information
jlaney committed Oct 30, 2024
1 parent 3006d69 commit dd2a094
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
10 changes: 8 additions & 2 deletions course_grader_vue/components/workflow/review-conversion.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
<SectionHeader :section="section" :title="gettext('review_import_grades')" />
</template>

<template v-if="errorResponse">
<template v-if="isLoading">
Importing grades...
</template>
<template v-else-if="errorResponse">
<Errors :error-response="errorResponse" />
</template>
<template v-else-if="appState.gradeImport.students">
Expand All @@ -19,7 +22,7 @@
</ul>
</template>

<template #footer>
<template v-if="!isLoading && !errorResponse" #footer>
<div class="d-flex">
<div class="text-nowrap">
<BButton variant="outline-primary" @click="editConversion">
Expand Down Expand Up @@ -71,6 +74,7 @@ export default {
},
data() {
return {
isLoading: false,
errorResponse: null,
};
},
Expand All @@ -85,6 +89,7 @@ export default {
data.conversion_scale = this.calculatorStore.conversionData;
data.converted_grades = this.appState.convertedGradeData;
this.isLoading = true;
this.saveImportedGrades(url, JSON.stringify(data))
.then((response) => {
return response.data;
Expand All @@ -94,6 +99,7 @@ export default {
})
.catch((error) => {
this.errorResponse = error.response;
this.isLoading = false;
});
},
},
Expand Down
3 changes: 3 additions & 0 deletions course_grader_vue/components/workflow/review-grades.vue
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ export default {
},
data() {
return {
isLoading: false,
errorResponse: null,
};
},
Expand All @@ -113,6 +114,7 @@ export default {
this.appState.editGrades();
},
submitGrades: function () {
this.isLoading = true;
this.submitGraderoster(this.section.graderoster_url, {})
.then((response) => {
return response.data;
Expand All @@ -122,6 +124,7 @@ export default {
})
.catch((error) => {
this.errorResponse = error.response;
this.isLoading = false;
});
},
},
Expand Down

0 comments on commit dd2a094

Please sign in to comment.