Fixed form creation

This commit is contained in:
Julien Nahum
2023-12-20 16:10:32 +01:00
parent b598a16406
commit af5656ce81
34 changed files with 363 additions and 356 deletions

View File

@@ -5,6 +5,7 @@ import { nextTick } from 'vue'
export const useAppStore = defineStore('app', {
state: () => ({
layout: 'default',
navbarHidden: false,
// App Loader
loader: {
@@ -17,6 +18,12 @@ export const useAppStore = defineStore('app', {
}
}),
actions: {
hideNavbar () {
this.navbarHidden = true
},
showNavbar () {
this.navbarHidden = false
},
setLayout (layout) {
this.layout = layout ?? 'default'
},

View File

@@ -6,7 +6,7 @@ export const formsEndpoint = '/open/workspaces/{workspaceId}/forms'
export const useFormsStore = defineStore('forms', () => {
const contentStore = useContentStore('slug')
contentStore.startLoading()
const allLoaded = ref(false)
const currentPage = ref(1)
const load = (workspaceId) => {
@@ -23,14 +23,27 @@ export const useFormsStore = defineStore('forms', () => {
currentPage.value++
load(workspaceId)
} else {
allLoaded.value = true
contentStore.stopLoading()
currentPage.value = 1
}
})
}
const allTags = computed(() => {
let tags = []
contentStore.getAll.value.forEach((form) => {
if (form.tags && form.tags.length) {
tags = tags.concat(form.tags.split(','))
}
})
return [...new Set(tags)]
})
return {
...contentStore,
allLoaded,
allTags,
load
}
})