Skip to content

Commit 6c00ac8

Browse files
authored
Merge pull request #256 from haystack/develop
Add loading indicator for generating grades
2 parents e489e61 + c862d81 commit 6c00ac8

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/components/grader/Grader.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
<span class="label"> Deadline: </span>
3333
<datepicker v-model="date" :bootstrap-styling="true"></datepicker>
3434
</div>
35-
<button :disabled="!submitEnabled" @click="createGrades">
36-
Generate Grades
35+
<button :disabled="!submitEnabled || isGeneratingGrades" @click="createGrades">
36+
{{isGeneratingGrades ? 'Generating...' : 'Generate Grades'}}
3737
</button>
3838
</div>
3939
</div>
@@ -60,6 +60,7 @@
6060
sources: [],
6161
selectedGrading: null,
6262
selectedSource: null,
63+
isGeneratingGrades: false,
6364
date: new Date() // TODO: default to the assignment due date instead
6465
}
6566
},
@@ -106,6 +107,7 @@
106107
},
107108
methods: {
108109
createGrades: function() {
110+
this.isGeneratingGrades = true
109111
const url = this.sources[this.selectedSource].id === 'OVERALL' ? '/api/grades/all' : '/api/grades/grades'
110112
const token = localStorage.getItem("nb.user");
111113
const course = JSON.parse(localStorage.getItem('nb.current.course'))
@@ -136,6 +138,7 @@
136138
hiddenElement.target = '_blank';
137139
hiddenElement.download = 'grades.csv';
138140
hiddenElement.click();
141+
this.isGeneratingGrades = false
139142
})
140143
}
141144
},

0 commit comments

Comments
 (0)