diff --git a/client/components/forms/CodeInput.vue b/client/components/forms/CodeInput.client.vue similarity index 98% rename from client/components/forms/CodeInput.vue rename to client/components/forms/CodeInput.client.vue index f373f18..e276856 100644 --- a/client/components/forms/CodeInput.vue +++ b/client/components/forms/CodeInput.client.vue @@ -36,8 +36,6 @@ import { inputProps, useFormInput } from './useFormInput.js' import InputWrapper from './components/InputWrapper.vue' export default { - name: 'CodeInput', - components: { InputWrapper, codemirror }, props: { ...inputProps diff --git a/client/components/forms/DateInput.vue b/client/components/forms/DateInput.vue index 35b953d..44afd99 100644 --- a/client/components/forms/DateInput.vue +++ b/client/components/forms/DateInput.vue @@ -46,7 +46,6 @@ diff --git a/client/components/open/forms/components/FormEditor.vue b/client/components/open/forms/components/FormEditor.vue index 1a6ac96..91372cb 100644 --- a/client/components/open/forms/components/FormEditor.vue +++ b/client/components/open/forms/components/FormEditor.vue @@ -77,17 +77,12 @@ /> -
+
diff --git a/client/pages/forms/create/index.vue b/client/pages/forms/create/index.vue new file mode 100644 index 0000000..d4e1419 --- /dev/null +++ b/client/pages/forms/create/index.vue @@ -0,0 +1,117 @@ + + + + diff --git a/client/pages/home.vue b/client/pages/home.vue index b2e5eaf..d3bbbbb 100644 --- a/client/pages/home.vue +++ b/client/pages/home.vue @@ -133,14 +133,18 @@ definePageMeta({ const authStore = useAuthStore() const formsStore = useFormsStore() +formsStore.startLoading() const workspacesStore = useWorkspacesStore() onMounted(() => { - formsStore.load(workspacesStore.currentId) + if (!formsStore.allLoaded) { + console.log('starting to load') + formsStore.load(workspacesStore.currentId) + } }) // State -const {getAll: forms, loading: formsLoading} = storeToRefs(formsStore) +const {getAll: forms, loading: formsLoading, allTags} = storeToRefs(formsStore) const showEditFormModal = ref(false) const selectedForm = ref(null) const search = ref('') @@ -167,15 +171,7 @@ const viewForm = (form) => { const isFilteringForms = computed(() => { return (search.value !== '' && search.value !== null) || selectedTags.value.size > 0 }) -const allTags = computed(() => { - let tags = [] - forms.value.forEach((form) => { - if (form.tags && form.tags.length) { - tags = tags.concat(form.tags.split(',')) - } - }) - return [...new Set(tags)] -}) + const enrichedForms = computed(() => { let enrichedForms = forms.value.map((form) => { form.workspace = workspacesStore.getByKey(form.workspace_id) diff --git a/client/stores/app.js b/client/stores/app.js index 4eb2af4..e40e8f8 100644 --- a/client/stores/app.js +++ b/client/stores/app.js @@ -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' }, diff --git a/client/stores/forms.js b/client/stores/forms.js index 60b7fed..1191afb 100644 --- a/client/stores/forms.js +++ b/client/stores/forms.js @@ -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 } }) diff --git a/resources/js/components/open/forms/fields/components/FieldOptions.vue b/resources/js/components/open/forms/fields/components/FieldOptions.vue index 7293013..52280ae 100644 --- a/resources/js/components/open/forms/fields/components/FieldOptions.vue +++ b/resources/js/components/open/forms/fields/components/FieldOptions.vue @@ -387,6 +387,7 @@