Browse Source

Show overlay while waiting bulk assignment

pull/2261/head
Hironsan 1 year ago
parent
commit
d46990e9f8
1 changed files with 8 additions and 2 deletions
  1. 10
      frontend/components/example/FormAssignment.vue

10
frontend/components/example/FormAssignment.vue

@ -48,13 +48,16 @@
<v-btn <v-btn
class="text-none" class="text-none"
text text
:disabled="!validateWeight"
:disabled="!validateWeight || isWaiting"
data-test="delete-button" data-test="delete-button"
@click="agree" @click="agree"
> >
Assign Assign
</v-btn> </v-btn>
</v-card-actions> </v-card-actions>
<v-overlay :value="isWaiting">
<v-progress-circular indeterminate size="64" />
</v-overlay>
</v-card> </v-card>
</template> </template>
@ -67,7 +70,8 @@ export default Vue.extend({
return { return {
members: [] as MemberItem[], members: [] as MemberItem[],
workloadAllocation: [] as number[], workloadAllocation: [] as number[],
selectedStrategy: 'weighted_sequential'
selectedStrategy: 'weighted_sequential',
isWaiting: false
} }
}, },
@ -114,6 +118,7 @@ export default Vue.extend({
methods: { methods: {
async agree() { async agree() {
this.isWaiting = true
const workloads = this.workloadAllocation.map((weight, i) => ({ const workloads = this.workloadAllocation.map((weight, i) => ({
weight, weight,
member_id: this.members[i].id member_id: this.members[i].id
@ -122,6 +127,7 @@ export default Vue.extend({
strategy_name: this.selectedStrategy, strategy_name: this.selectedStrategy,
workloads workloads
}) })
this.isWaiting = false
this.$emit('assigned') this.$emit('assigned')
}, },
cancel() { cancel() {

Loading…
Cancel
Save