Skip to content

Commit

Permalink
fix: plugin titles visible on db editor (#46)
Browse files Browse the repository at this point in the history
Co-authored-by: Donal Mac An Ri <[email protected]>
RdeLange and donalmacanri authored Feb 4, 2023
1 parent d1e55d5 commit 92f3b17
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions src/domains/dashboard2/dashbard-edit-view.svelte
Original file line number Diff line number Diff line change
@@ -1,27 +1,34 @@
<script lang="ts">
import { onMount } from 'svelte'
import { CloseOutline } from '../../components/icon/nicons'
import { createEventDispatcher } from 'svelte'
import { DashboardClass } from './dashboard-class'
import { dedupArray } from '../../utils/array/array_utils'
import { Interact } from '../../store/interact'
import { Lang } from '../../store/lang'
import { TrackableStore } from '../trackable/TrackableStore'
import { widgetTypes } from './widget/widget-types'
import { getWidgetTypes , IWidgetType } from './widget/widget-types'
import Button from '../../components/button/button.svelte'
import Container from '../../components/container/container.svelte'
import Input from '../../components/input/input.svelte'
import IonIcon from '../../components/icon/ion-icon.svelte'
import SortableList2 from '../../components/sortable-list/sortable-list2.svelte'
import TrackablePill from '../trackable/trackable-pill.svelte'
import { PluginStore } from '../plugins/PluginStore'
export let dashboard: DashboardClass
const dispatch = createEventDispatcher()
let workingDashboard: DashboardClass
let allWidgetTypes: Array<IWidgetType> = []
let mounted = false
$: if (mounted && !allWidgetTypes.length) {
allWidgetTypes = getWidgetTypes($PluginStore)
}
$: if (dashboard && !workingDashboard) {
workingDashboard = new DashboardClass(dashboard)
@@ -35,6 +42,10 @@
}
workingDashboard.widgets = workingDashboard.widgets
}
onMount(() => {
mounted = true
})
</script>

<section class="max-w-full w-96 lg:w-full lg:max-w-screen-xl mx-auto">
@@ -93,8 +104,13 @@
{item.token.raw}
{/if}
<div class="text-gray-500 text-sm">
{widgetTypes.find((a) => a.id === item.type)?.label}
{#if item.type == "plugin"}
<span class="text-2xl">{allWidgetTypes.find((a) => a.data && a.data.pluginId === item.data.pluginId)?.emoji}</span>
<span> {allWidgetTypes.find((a) => a.data && a.data.pluginId === item.data.pluginId)?.label}</span>
{:else}
{allWidgetTypes.find((a) => a.id === item.type)?.label}
{item.timeRange}
{/if}
</div>
</div>
</SortableList2>

0 comments on commit 92f3b17

Please sign in to comment.