From c273ebd7b893c0416c24ec8077437035aa75d912 Mon Sep 17 00:00:00 2001 From: abdelouahed oumoussa Date: Sat, 26 Jul 2025 21:25:38 +0100 Subject: [PATCH 1/3] feat(user): add dashboard state type for ecosystem apps --- .eslintrc-auto-import.json | 1 + src/stores/migrations.ts | 13 +++++++++++++ src/stores/user.ts | 1 + 3 files changed, 15 insertions(+) diff --git a/.eslintrc-auto-import.json b/.eslintrc-auto-import.json index b3fd2fb..04ecd53 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 1eb8d78..15e2220 100644 --- a/src/stores/migrations.ts +++ b/src/stores/migrations.ts @@ -1,4 +1,5 @@ import type { VOneSuit } from './settings' +import type { SortItem } from 'vuetify/lib/components/VDataTable/composables/sort.d.ts' export type OldRootState = { v: 2 | 3 | 4 | 5 @@ -100,10 +101,15 @@ export interface RootState { ecosystem: { bin: { wordWrap: boolean + dashboard?: DashboardState } play: { showErrors: boolean wordWrap: boolean + dashboard?: DashboardState + } + studio: { + dashboard?: DashboardState } docs: { api: 'link-only' | 'inline' @@ -153,6 +159,12 @@ export interface RootState { } } +export interface DashboardState { + [key: string]: any + sortBy: SortItem[] + itemsPerPage: number +} + const migrations = [ (d: any) => { if (!d.v) { @@ -230,6 +242,7 @@ const migrateV5ToV6 = (v5Data: any): RootState => ({ showErrors: true, wordWrap: false, }, + studio: {}, docs: { api: v5Data.api || 'link-only', composition: v5Data.composition || 'composition', diff --git a/src/stores/user.ts b/src/stores/user.ts index 49cb51c..7dd4798 100644 --- a/src/stores/user.ts +++ b/src/stores/user.ts @@ -15,6 +15,7 @@ export const DEFAULT_USER: RootState = { showErrors: true, wordWrap: false, }, + studio: {}, docs: { api: 'link-only', composition: 'composition', From b7a0a4c7cc67ad5098b94b2fe2b882393c3ed1e8 Mon Sep 17 00:00:00 2001 From: abdelouahed oumoussa Date: Sat, 26 Jul 2025 21:49:18 +0100 Subject: [PATCH 2/3] refactor(migrations): make studio property optional in RootState --- src/stores/migrations.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/stores/migrations.ts b/src/stores/migrations.ts index 15e2220..f5c9a89 100644 --- a/src/stores/migrations.ts +++ b/src/stores/migrations.ts @@ -108,7 +108,7 @@ export interface RootState { wordWrap: boolean dashboard?: DashboardState } - studio: { + studio?: { dashboard?: DashboardState } docs: { @@ -242,7 +242,6 @@ const migrateV5ToV6 = (v5Data: any): RootState => ({ showErrors: true, wordWrap: false, }, - studio: {}, docs: { api: v5Data.api || 'link-only', composition: v5Data.composition || 'composition', From ca9d0acdc59965dec1d721b985fe6e63528d88ae Mon Sep 17 00:00:00 2001 From: abdelouahed oumoussa Date: Tue, 2 Sep 2025 21:15:49 +0100 Subject: [PATCH 3/3] refactor(migrations): update DataTable sort type import --- src/stores/migrations.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/stores/migrations.ts b/src/stores/migrations.ts index f5c9a89..57379f0 100644 --- a/src/stores/migrations.ts +++ b/src/stores/migrations.ts @@ -1,5 +1,5 @@ import type { VOneSuit } from './settings' -import type { SortItem } from 'vuetify/lib/components/VDataTable/composables/sort.d.ts' +import type { DataTableSortItem } from 'vuetify' export type OldRootState = { v: 2 | 3 | 4 | 5 @@ -161,7 +161,7 @@ export interface RootState { export interface DashboardState { [key: string]: any - sortBy: SortItem[] + sortBy: DataTableSortItem[] itemsPerPage: number }