refactor edit and edges

This commit is contained in:
2024-03-25 21:26:21 +02:00
parent e74e1e7956
commit 02224eb580
83 changed files with 3569 additions and 818 deletions
+26 -22
View File
@@ -2,18 +2,18 @@
import {getContext} from "svelte";
import Icon from "../common/Icon.svelte";
import {previewTitle} from "./Preview";
import axios from "axios";
const channel = getContext("channel");
export let schema;
export let graph;
export let record;
export let title;
export let isCreateMode;
export let activeContentTab;
function clone(e) {
e.preventDefault();
axios.post(channel.lucentUrl + "/records/clone/" + record.id).then(response => {
window.location = channel.lucentUrl + "/records/" + response.data.id;
window.location.href = channel.lucentUrl + "/records/" + response.data.id;
}).catch(error => {
});
@@ -22,25 +22,29 @@
<h3 class="header-normal mt-5 mb-0">
<a
class="text-muted d-block text-decoration-none fs-6 mb-1"
href="{channel.lucentUrl}/content/{schema.name}"
class="text-muted d-block text-decoration-none fs-6 mb-1"
href="{channel.lucentUrl}/content/{schema.name}"
>{schema.label.toUpperCase()}</a
>
<span class="text-dark d-block">
{#if !isCreateMode}
{previewTitle( record, graph)}
{#if record}
{previewTitle(record)}
{:else}
{ title}
{/if}
{:else}
New Record
{/if}
</span>
{#if !isCreateMode}
{#if !isCreateMode && !!record}
<div class="dropdown d-inline-block">
<button
class="btn btn-link btn-sm"
type="button"
data-bs-toggle="dropdown"
aria-expanded="false"
class="btn btn-link btn-sm"
type="button"
data-bs-toggle="dropdown"
aria-expanded="false"
>
<Icon icon="ellipsis"/>
</button>
@@ -48,25 +52,25 @@
<h6 class="dropdown-header">Record Actions</h6>
<a
class="dropdown-item"
href="{channel.lucentUrl}/records/new?schema={schema.name}"
class="dropdown-item"
href="{channel.lucentUrl}/records/new?schema={schema.name}"
>Create new</a
>
{#if !isCreateMode}
<a
class="dropdown-item"
on:click={clone}
href={channel.lucentUrl}
class="dropdown-item"
on:click={clone}
href={channel.lucentUrl}
>
Clone
</a>
{/if}
<a
on:click|preventDefault={(e) =>
(activeContentTab = "_info")}
class="dropdown-item"
href="{channel.lucentUrl}">Revisions</a
>
<!-- <a-->
<!-- on:click|preventDefault={(e) =>-->
<!-- (activeContentTab = "_info")}-->
<!-- class="dropdown-item"-->
<!-- href="{channel.lucentUrl}">Revisions</a-->
<!-- >-->
</div>
</div>
{/if}