Skip to content

Commit

Permalink
Show loading spinner before displaying page list
Browse files Browse the repository at this point in the history
  • Loading branch information
katrinDY committed Dec 19, 2022
1 parent 6124ffa commit c47188d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
18 changes: 18 additions & 0 deletions client/web/compose/src/views/Admin/Pages/List.vue
Expand Up @@ -74,7 +74,20 @@
</b-col>
</b-row>

<div
class="text-center text-muted m-5"
v-if="processing"
>
<div>
<b-spinner
class="align-middle m-2"
/>
</div>
{{ $t('loading') }}
</div>

<page-tree
v-else
v-model="tree"
:namespace="namespace"
class="pb-2"
Expand Down Expand Up @@ -115,6 +128,7 @@ export default {
return {
tree: [],
page: new compose.Page({ visible: true }),
processing: false,
}
},
Expand All @@ -128,10 +142,14 @@ export default {
}),
loadTree () {
this.processing = true
const { namespaceID } = this.namespace
this.$ComposeAPI.pageTree({ namespaceID }).then((tree) => {
this.tree = tree.map(p => new compose.Page(p))
}).catch(this.toastErrorHandler(this.$t('notification:page.loadFailed')))
.finally(() => {
this.processing = false
})
},
handleAddPageFormSubmit () {
Expand Down
1 change: 1 addition & 0 deletions locale/en/corteza-webapp-compose/page.yaml
Expand Up @@ -31,6 +31,7 @@ label:
pageBuilder: Page builder
permissions: Permissions
saveAndClose: Save and close
loading: Loading
moduleEdit: Edit module
navigation:
page: Pages
Expand Down

0 comments on commit c47188d

Please sign in to comment.