From c38585f87d2a47728a11c355c2a23906eb44fc2b Mon Sep 17 00:00:00 2001 From: Niko PLP Date: Fri, 9 Aug 2024 22:02:08 +0300 Subject: [PATCH] GUI adjustments on empty JSON doc --- ng-app/src/apps/AutomergeEditor.svelte | 27 ++++++++++++++++++++---- ng-app/src/apps/SparqlQueryEditor.svelte | 2 +- ng-app/src/lib/Document.svelte | 4 ++-- ng-app/src/store.ts | 2 +- ng-app/src/zeras.ts | 1 + 5 files changed, 28 insertions(+), 8 deletions(-) diff --git a/ng-app/src/apps/AutomergeEditor.svelte b/ng-app/src/apps/AutomergeEditor.svelte index 074d2a0..14d3769 100644 --- a/ng-app/src/apps/AutomergeEditor.svelte +++ b/ng-app/src/apps/AutomergeEditor.svelte @@ -23,11 +23,13 @@ import { cur_tab_register_on_save, cur_tab_deregister_on_save, - cur_tab_branch_class + cur_tab_doc_can_edit, + set_view_or_edit } from "../tab"; import { t } from "svelte-i18n"; import wasmUrl from "@automerge/automerge/automerge.wasm?url"; import { next as A } from "@automerge/automerge/slim"; + import{ PencilSquare } from "svelte-heros-v2"; import AMap from "./automerge/AMap.svelte"; @@ -116,14 +118,31 @@ toast_error(display_error(e)); } } + + const edit = () => { + set_view_or_edit(false); + } {#if safari_error} {$t("errors.no_wasm_on_old_safari")} {:else} -
- -
+ {#if Object.keys(doc).length !== 0 || !readonly} +
+ +
+ {:else if $cur_tab_doc_can_edit} + + {:else} +

{$t("doc.empty")}

+ {/if} {/if}