Skip to content

Commit c32c926

Browse files
Merge pull request #106 from JSON-ms/dev
Deployment of v1.3.9
2 parents ba5357f + 7a4b451 commit c32c926

5 files changed

Lines changed: 41 additions & 9 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@json.ms/www",
33
"private": true,
44
"type": "module",
5-
"version": "1.3.8",
5+
"version": "1.3.9",
66
"scripts": {
77
"dev": "vite --host",
88
"build": "run-p type-check \"build-only {@}\" --",

src/components/FileManager.vue

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ const getFilesByType = (type: string): IFile[] => {
4545
return acceptedFiles.value.filter((file: IFile) => file.meta.type?.startsWith('video'));
4646
} else if (type === 'document') {
4747
return acceptedFiles.value.filter((file: IFile) => !file.meta.type?.startsWith('image') && !file.meta.type?.startsWith('video'));
48+
} else if (type === 'local') {
49+
return acceptedFiles.value.filter((file: IFile) => file.origin === 'local');
50+
} else if (type === 'remote') {
51+
return acceptedFiles.value.filter((file: IFile) => file.origin === 'remote');
4852
}
4953
return [];
5054
}
@@ -123,6 +127,7 @@ const load = () => {
123127
if (!['data.json', 'structure.json', 'structure.yml', 'default.ts', 'index.ts', 'typings.ts', 'settings.json'].includes(item.path)) {
124128
files.value.push({
125129
path: item.path,
130+
origin: 'local',
126131
meta: {
127132
type: item.file.type,
128133
width: item.width,
@@ -136,7 +141,7 @@ const load = () => {
136141
});
137142
138143
endpointResponse.forEach((item: IFile) => {
139-
files.value.push(item);
144+
files.value.push(({ ...item, origin: 'remote' }));
140145
});
141146
142147
selectedFiles.value = [];
@@ -348,6 +353,15 @@ watch(() => globalStore.fileManager.visible, () => {
348353
<v-tab v-if="getFilesByType('document').length > 0" value="document">
349354
Document ({{ getFilesByType('document').length }})
350355
</v-tab>
356+
<template v-if="getFilesByType('remote').length > 0 && getFilesByType('local').length > 0">
357+
<v-divider inset vertical class="mx-2" />
358+
<v-tab v-if="getFilesByType('remote').length > 0" value="remote">
359+
Cloud ({{ getFilesByType('remote').length }})
360+
</v-tab>
361+
<v-tab v-if="getFilesByType('local').length > 0" value="local">
362+
Local ({{ getFilesByType('local').length }})
363+
</v-tab>
364+
</template>
351365
</v-tabs>
352366
</template>
353367
<v-card-actions>
@@ -457,7 +471,24 @@ watch(() => globalStore.fileManager.visible, () => {
457471
@click="onFileClick(item)"
458472
>
459473
<div v-if="!canSelect || globalStore.fileManager.multiple" class="position-absolute" style="top: 0; left: 0; z-index: 10">
460-
<v-checkbox :model-value="fileIsSelected(item)" color="primary" base-color="surface" hide-details @click.stop.prevent="onFileClick(item)" />
474+
<v-checkbox :model-value="fileIsSelected(item)" color="primary" hide-details @click.stop.prevent="onFileClick(item)" />
475+
</div>
476+
<div class="position-absolute" style="top: 0; right: 0; z-index: 10">
477+
<v-chip
478+
v-if="['local', 'remote'].includes(item.origin || 'unknown')"
479+
:color="fileIsSelected(item) ? 'primary' : undefined"
480+
size="x-small"
481+
variant="flat"
482+
class="px-1 ma-2"
483+
label
484+
>
485+
<template v-if="item.origin === 'local'">
486+
Local
487+
</template>
488+
<template v-else>
489+
Cloud
490+
</template>
491+
</v-chip>
461492
</div>
462493
<div class="bg-blue-grey-lighten-4">
463494
<ImgTag

src/components/StructureEditor.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -779,18 +779,18 @@ watch(() => globalStore.userSettings.data, () => {
779779
</div>
780780
</div>
781781
</v-tabs-window-item>
782-
<v-tabs-window-item v-if="globalStore.uiConfig.structure_menu_settings" value="settings" class="fill-height">
782+
<v-tabs-window-item v-if="globalStore.uiConfig.structure_menu_integration" value="integration" class="fill-height">
783783
<div class="d-flex flex-column overflow-auto h-100" style="max-height: calc(100vh - 109px)">
784-
<Settings
784+
<Endpoint
785785
v-model="structure"
786786
:demo="!globalStore.session.loggedIn"
787787
:disabled="structure.type !== 'owner'"
788788
/>
789789
</div>
790790
</v-tabs-window-item>
791-
<v-tabs-window-item v-if="globalStore.uiConfig.structure_menu_integration" value="integration" class="fill-height">
791+
<v-tabs-window-item v-if="globalStore.uiConfig.structure_menu_settings" value="settings" class="fill-height">
792792
<div class="d-flex flex-column overflow-auto h-100" style="max-height: calc(100vh - 109px)">
793-
<Endpoint
793+
<Settings
794794
v-model="structure"
795795
:demo="!globalStore.session.loggedIn"
796796
:disabled="structure.type !== 'owner'"

src/composables/user-data.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ export function useUserData() {
5858
const userDataHasChanged = computed((): boolean => objectsAreDifferent(modelStore.userData, modelStore.originalUserData));
5959

6060
const canSave = computed((): boolean => {
61+
const canSaveWithServer = globalStore.session.loggedIn && canInteractWithServer.value;
6162
return !saving.value
62-
&& globalStore.session.loggedIn
63-
&& (canInteractWithServer.value || canInteractWithSyncedFolder.value)
63+
&& (canSaveWithServer || canInteractWithSyncedFolder.value)
6464
// && !userDataHasError.value
6565
&& userDataHasChanged.value
6666
&& structureIsPristine.value;

src/interfaces.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ export interface IError {
6161

6262
export interface IFile {
6363
path: string | null,
64+
origin?: 'local' | 'remote',
6465
blob?: string | undefined,
6566
meta: {
6667
type?: string,

0 commit comments

Comments
 (0)