Skip to content

Commit 6f5b0a8

Browse files
author
Guillaume Chau
committed
feat(widget): better config loading UX
1 parent 81ec5c0 commit 6f5b0a8

File tree

1 file changed

+11
-1
lines changed
  • packages/@vue/cli-ui/src/components/dashboard

1 file changed

+11
-1
lines changed

packages/@vue/cli-ui/src/components/dashboard/Widget.vue

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,12 @@
141141
@close="showConfig = false"
142142
>
143143
<div class="default-body">
144+
<VueLoadingIndicator
145+
v-if="loadingConfig"
146+
class="big accent"
147+
/>
144148
<PromptsList
149+
v-else
145150
:prompts="visiblePrompts"
146151
@answer="answerPrompt"
147152
/>
@@ -151,6 +156,7 @@
151156
<VueButton
152157
class="primary big"
153158
:label="$t('org.vue.components.widget.save')"
159+
:disabled="loadingConfig"
154160
@click="saveConfig()"
155161
/>
156162
</div>
@@ -259,6 +265,7 @@ export default {
259265
data () {
260266
return {
261267
showConfig: false,
268+
loadingConfig: false,
262269
showDetails: false,
263270
injected: {
264271
// State
@@ -324,17 +331,20 @@ export default {
324331
325332
methods: {
326333
async openConfig () {
334+
this.loadingConfig = true
335+
this.showConfig = true
327336
await this.$apollo.mutate({
328337
mutation: WIDGET_CONFIG_OPEN,
329338
variables: {
330339
id: this.widget.id
331340
}
332341
})
333-
this.showConfig = true
342+
this.loadingConfig = false
334343
},
335344
336345
async saveConfig () {
337346
this.showConfig = false
347+
this.loadingConfig = false
338348
await this.$apollo.mutate({
339349
mutation: WIDGET_CONFIG_SAVE,
340350
variables: {

0 commit comments

Comments
 (0)