Skip to content

Commit

Permalink
feat(widget): better config loading UX
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Chau committed Oct 29, 2018
1 parent 81ec5c0 commit 6f5b0a8
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/@vue/cli-ui/src/components/dashboard/Widget.vue
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,12 @@
@close="showConfig = false"
>
<div class="default-body">
<VueLoadingIndicator
v-if="loadingConfig"
class="big accent"
/>
<PromptsList
v-else
:prompts="visiblePrompts"
@answer="answerPrompt"
/>
Expand All @@ -151,6 +156,7 @@
<VueButton
class="primary big"
:label="$t('org.vue.components.widget.save')"
:disabled="loadingConfig"
@click="saveConfig()"
/>
</div>
Expand Down Expand Up @@ -259,6 +265,7 @@ export default {
data () {
return {
showConfig: false,
loadingConfig: false,
showDetails: false,
injected: {
// State
Expand Down Expand Up @@ -324,17 +331,20 @@ export default {
methods: {
async openConfig () {
this.loadingConfig = true
this.showConfig = true
await this.$apollo.mutate({
mutation: WIDGET_CONFIG_OPEN,
variables: {
id: this.widget.id
}
})
this.showConfig = true
this.loadingConfig = false
},
async saveConfig () {
this.showConfig = false
this.loadingConfig = false
await this.$apollo.mutate({
mutation: WIDGET_CONFIG_SAVE,
variables: {
Expand Down

0 comments on commit 6f5b0a8

Please sign in to comment.