diff --git a/.eslintrc-auto-import.json b/.eslintrc-auto-import.json index 715e227..163199f 100644 --- a/.eslintrc-auto-import.json +++ b/.eslintrc-auto-import.json @@ -6,6 +6,7 @@ "ComponentPublicInstance": true, "ComputedRef": true, "DEFAULT_USER": true, + "DashboardState": true, "DirectiveBinding": true, "DownloadsState": true, "EffectScope": true, diff --git a/src/stores/migrations.ts b/src/stores/migrations.ts index 3237e30..5ed39d2 100644 --- a/src/stores/migrations.ts +++ b/src/stores/migrations.ts @@ -1,4 +1,5 @@ import type { VOneSuit } from './settings' +import type { DataTableSortItem } from 'vuetify' export type OldRootState = { v: 2 | 3 | 4 | 5 @@ -100,10 +101,18 @@ export interface RootState { ecosystem: { bin: { wordWrap: boolean + dashboard?: DashboardState } play: { showErrors: boolean wordWrap: boolean + dashboard?: DashboardState + } + studio?: { + dashboard?: DashboardState + } + link?: { + dashboard?: DashboardState } docs: { api: 'link-only' | 'inline' @@ -153,6 +162,12 @@ export interface RootState { } } +export interface DashboardState { + [key: string]: any + sortBy: DataTableSortItem[] + itemsPerPage: number +} + const migrations = [ (d: any) => { if (!d.v) { @@ -231,6 +246,8 @@ function migrateV5ToV6 (v5Data: any): RootState { showErrors: true, wordWrap: false, }, + studio: {}, + link: {}, docs: { api: v5Data.api || 'link-only', composition: v5Data.composition || 'composition', diff --git a/src/stores/one.ts b/src/stores/one.ts index 0d5367c..7d27331 100644 --- a/src/stores/one.ts +++ b/src/stores/one.ts @@ -32,7 +32,7 @@ interface Invoice { } interface OneState { - info: Ref + info: Ref interval: ComputedRef subscriptionType: ComputedRef access: Ref @@ -73,8 +73,8 @@ export const useOneStore = defineStore('one', (): OneState => { const isLoading = shallowRef(false) const isOpen = shallowRef(false) - const info = ref() - const invoices = ref([]) + const info = ref(null) + const invoices = ref([]) const sessionId = computed(() => query.value.session_id) const interval = computed(() => info.value?.items[0].plan.interval) const subscriptionType = computed(() => info.value?.items[0].plan.type) diff --git a/src/stores/user.ts b/src/stores/user.ts index 49cb51c..d1bde01 100644 --- a/src/stores/user.ts +++ b/src/stores/user.ts @@ -15,6 +15,8 @@ export const DEFAULT_USER: RootState = { showErrors: true, wordWrap: false, }, + studio: {}, + link: {}, docs: { api: 'link-only', composition: 'composition',