From b34f0cba152d393019d74f7e2d4dd8128d61661d Mon Sep 17 00:00:00 2001 From: Danny Coulombe Date: Tue, 30 Dec 2025 10:53:07 -0500 Subject: [PATCH 1/2] do not show previews for fields that are hidden because of conditions --- src/components/FieldItem.vue | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/components/FieldItem.vue b/src/components/FieldItem.vue index 753a91d..3a6b27b 100644 --- a/src/components/FieldItem.vue +++ b/src/components/FieldItem.vue @@ -158,18 +158,21 @@ const onCollapsableHeader = (item: any, index: number) => { let thumbnail: string | false = false; for (const key in fields.value) { const fieldItem = fields.value[key]; - if (!title && ['string', 'i18n:string', 'i18n', 'date', 'i18n:date'].includes(fieldItem.type)) { - if (isFieldI18n(fieldItem)) { - title = item[key][locale]; - } else { - title = item[key]; + const path = fieldKey + `[${index}]`; + if (isFieldVisible(fieldItem, path)) { + if (!title && ['string', 'i18n:string', 'i18n', 'date', 'i18n:date'].includes(fieldItem.type)) { + if (isFieldI18n(fieldItem)) { + title = item[key][locale]; + } else { + title = item[key]; + } + } + if (fieldItem.type === 'file' && typeof item[key] === 'object' && item[key] !== null && item[key].path && item[key].meta && item[key].meta.type.startsWith('image/')) { + thumbnail = serverSettings.publicUrl + item[key].path; + } + if (thumbnail && title) { + break; } - } - if (fieldItem.type === 'file' && typeof item[key] === 'object' && item[key] !== null && item[key].path && item[key].meta && item[key].meta.type.startsWith('image/')) { - thumbnail = serverSettings.publicUrl + item[key].path; - } - if (thumbnail && title) { - break; } } From b7f80ddc1c9cdcd816e8ab991262d58f26e4209c Mon Sep 17 00:00:00 2001 From: Danny Coulombe Date: Tue, 30 Dec 2025 10:55:06 -0500 Subject: [PATCH 2/2] - do not show previews for fields that are hidden because of conditions - user avatar loading indefinitely - copy button for typescript section - show uploading bottom sheet when uploading - remove show additional infos in File Manager --- package.json | 2 +- src/components/FileFieldItem.vue | 1 + src/components/FileManager.vue | 20 ++++++--- src/components/IntroductionDialog.vue | 2 +- src/components/JSONms.vue | 36 +++++++++------- src/components/SessionPanel.vue | 45 +++++++++++--------- src/components/SitePreview.vue | 1 + src/components/StructureEditor.vue | 61 +++++++++++++++++++++++---- src/components/Toolbar.vue | 2 +- src/components/VideoPlayer.vue | 12 +++++- src/composables/shortcut.ts | 2 +- src/composables/structure.ts | 2 +- src/interfaces.ts | 9 ++++ src/stores/global.ts | 14 +++++- src/utils.ts | 24 +++++++++++ 15 files changed, 176 insertions(+), 57 deletions(-) diff --git a/package.json b/package.json index a3863e3..1f8cf64 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@json.ms/www", "private": true, "type": "module", - "version": "1.3.3", + "version": "1.3.4", "scripts": { "dev": "vite --host", "build": "run-p type-check \"build-only {@}\" --", diff --git a/src/components/FileFieldItem.vue b/src/components/FileFieldItem.vue index 1137021..24eebc4 100644 --- a/src/components/FileFieldItem.vue +++ b/src/components/FileFieldItem.vue @@ -110,6 +110,7 @@ const onRemoveFile = (file: IFile) => { { })) } } + globalStore.showBottomSheet('Uploading file(s)...', null, 'mdi-upload', true); return Promise.all(promises) .catch(globalStore.catchError) - .finally(() => uploading.value = false); + .finally(() => { + globalStore.hideBottomSheet(); + uploading.value = false + }); } const remove = () => { @@ -464,7 +468,9 @@ watch(() => globalStore.fileManager.visible, () => { @@ -568,12 +574,12 @@ watch(() => globalStore.fileManager.visible, () => { - + + + + + + { src="https://www.youtube.com/embed/QbzHaJ3GeJM?si=HsQLg2_cXyt97vv1" title="JSON.ms Youtube Presentation" frameborder="0" - allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" + allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen /> diff --git a/src/components/JSONms.vue b/src/components/JSONms.vue index 0ebb6a0..b157116 100644 --- a/src/components/JSONms.vue +++ b/src/components/JSONms.vue @@ -99,19 +99,23 @@ const showActionBar = computed((): boolean => { return ['data'].includes((tab.value || '').toString()); }); -const bottomSheetData = ref<{ - text: string, - icon?: string, - color?: string, - loading?: boolean, -}>({ - text: '', -}); const showBottomSheet = computed((): boolean => { - return downloading.value || userDataLoading.value || structureStates.value.saved; + return globalStore.bottomSheet.visible || structureStates.value.saved; +}); +watch(() => downloading.value, () => { + if (downloading.value) { + globalStore.showBottomSheet('Downloading files and generating ZIP file. Please wait...', null, null, true) + } else { + globalStore.hideBottomSheet(); + } +}); +watch(() => userDataLoading.value, () => { + if (userDataLoading.value) { + globalStore.showBottomSheet('Fetching user data. Please wait...', null, null, true) + } else { + globalStore.hideBottomSheet(); + } }); -watch(() => downloading.value, () => bottomSheetData.value = { text: 'Downloading files and generating ZIP file. Please wait...', loading: true }); -watch(() => userDataLoading.value, () => bottomSheetData.value = { text: 'Fetching user data. Please wait...', loading: true }); const showEditor = computed({ get(): boolean { @@ -168,7 +172,7 @@ const onSaveStructure = () => { if (canSaveStructure.value) { modelStore.structure.content = modelStore.temporaryContent || modelStore.structure.content; saveStructure().then(() => { - bottomSheetData.value = { text: 'Structure saved!', color: 'success', icon: 'mdi-check' }; + globalStore.showBottomSheet('Structure saved!', 'success', 'mdi-check'); syncToFolder(modelStore.structure, ['structure', 'default', 'typings', 'settings', 'index']); const newModel = modelStore.structure; globalStore.addStructure(newModel); @@ -395,7 +399,7 @@ if (globalStore.session.loggedIn) { disable-resize-watcher disable-route-watcher > - + diff --git a/src/components/SessionPanel.vue b/src/components/SessionPanel.vue index fdf4653..3117727 100644 --- a/src/components/SessionPanel.vue +++ b/src/components/SessionPanel.vue @@ -1,6 +1,6 @@