diff --git a/package.json b/package.json index 40e0ac7..e00e6f0 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@json.ms/www", "private": true, "type": "module", - "version": "1.2.13", + "version": "1.2.15", "scripts": { "dev": "vite --host", "build": "run-p type-check \"build-only {@}\" --", diff --git a/src/components/Integration.vue b/src/components/Integration.vue index fd6157f..dd76073 100644 --- a/src/components/Integration.vue +++ b/src/components/Integration.vue @@ -44,8 +44,7 @@ ${prefix}JMS_ENCRYPTED_SECRET_KEY=${modelStore.structure.server_secret}`; @@ -578,3 +652,9 @@ watch(() => globalStore.userSettings.data, () => { transition: all var(--parsing-delay) linear; } + + diff --git a/src/components/Toolbar.vue b/src/components/Toolbar.vue index 19e3daa..02e0d83 100644 --- a/src/components/Toolbar.vue +++ b/src/components/Toolbar.vue @@ -232,7 +232,9 @@ watch(() => currentRoute.params.locale, () => { type="info" icon="mdi-information-outline" > - Free and open-source, with data securely hosted on your server. +
+ Free and open-source, with data securely hosted on your server. +
diff --git a/src/composables/structure.ts b/src/composables/structure.ts index 41205cc..2020e86 100644 --- a/src/composables/structure.ts +++ b/src/composables/structure.ts @@ -424,24 +424,26 @@ export function useStructure() { structureStates.value.loadingSecretKey = true; structureStates.value.secretKeyLoaded = false; return getSecretKeySimple(endpoint.value?.uuid || '') - .then(response => secretKey.value = response) - .catch(error => globalStore.catchError(error)) - .finally(() => { - structureStates.value.loadingSecretKey = false; + .then(response => { + secretKey.value = response; structureStates.value.secretKeyLoaded = true; + return response; }) + .catch(error => globalStore.catchError(error)) + .finally(() => structureStates.value.loadingSecretKey = false) } const getCypherKey = async (): Promise => { structureStates.value.loadingCypherKey = true; structureStates.value.cypherKeyLoaded = false; return Services.get(import.meta.env.VITE_SERVER_URL + '/endpoint/cypher-key/' + endpoint.value?.uuid) - .then(response => cypherKey.value = response) - .catch(error => globalStore.catchError(error)) - .finally(() => { - structureStates.value.loadingCypherKey = false; + .then(response => { + cypherKey.value = response; structureStates.value.cypherKeyLoaded = true; + return response; }) + .catch(error => globalStore.catchError(error)) + .finally(() => structureStates.value.loadingCypherKey = false) } const createStructure = (): Promise => { @@ -504,21 +506,26 @@ export function useStructure() { setTimeout(() => structureStates.value.saved = false, 2000); } - structureStates.value.saving = true; - saveStructureSimple(structure) - .then(response => { - saveCallback(); - modelStore.setStructure(response); - modelStore.setOriginalStructure(response); - globalStore.updateStructure(response); - resolve(modelStore.structure); - }) - .catch(error => { - reject(error); - globalStore.catchError(error); - return error; - }) - .finally(() => structureStates.value.saving = false); + if (globalStore.session.loggedIn) { + structureStates.value.saving = true; + saveStructureSimple(structure) + .then(response => { + saveCallback(); + modelStore.setStructure(response); + modelStore.setOriginalStructure(response); + globalStore.updateStructure(response); + resolve(modelStore.structure); + }) + .catch(error => { + reject(error); + globalStore.catchError(error); + return error; + }) + .finally(() => structureStates.value.saving = false); + } else { + saveCallback(); + resolve(modelStore.structure); + } }) } @@ -602,8 +609,7 @@ export function useStructure() { } const canSaveStructure = computed(() => { - return globalStore.session.loggedIn - && !structureIsPristine.value + return !structureIsPristine.value && !structureHasSettingsError.value }) diff --git a/src/interfaces.ts b/src/interfaces.ts index 1241c5c..94c05a6 100644 --- a/src/interfaces.ts +++ b/src/interfaces.ts @@ -32,7 +32,7 @@ export interface IAdmin { structure: boolean, previewMode: 'mobile' | 'desktop' | null, dataTab: 'data' | 'settings' | 'docs', - editorTab: 'structure' | 'blueprints', + editorTab: 'structure' | 'blueprints' | 'settings' | 'integration', } export interface ISnack {