diff --git a/src/models/Tabset.ts b/src/models/Tabset.ts index 960bfa21..0fd87406 100644 --- a/src/models/Tabset.ts +++ b/src/models/Tabset.ts @@ -77,6 +77,8 @@ export class Tabset { // = description page: string | undefined = undefined + headerDescription: string | undefined = undefined + window: string = 'current' color: string | undefined = undefined diff --git a/src/pages/SidePanelPage.vue b/src/pages/SidePanelPage.vue index f5e4bac5..0146b789 100644 --- a/src/pages/SidePanelPage.vue +++ b/src/pages/SidePanelPage.vue @@ -196,7 +196,7 @@ @mouseleave="hoveredTabset = undefined"> - + @@ -212,6 +212,32 @@ {{ tabset.page }} + + + + + + + + {{ tabset.headerDescription }} + + + >(new Map()) const hoveredPublicLink = ref(false) const windowLocation = ref('---') const user = ref() +const headerDescription = ref('') // https://stackoverflow.com/questions/12710905/how-do-i-dynamically-assign-properties-to-an-object-in-typescript interface SelectionObject { @@ -372,11 +401,10 @@ window.addEventListener("drop", (event) => { const selected_model = ref({}) const hoveredTabset = ref(undefined) const tabsets = ref([]) -const progress = ref(undefined) -const progressLabel = ref(undefined) const selectedTab = ref(undefined) const windowName = ref(undefined) const tsBadges = ref([]) +const editHeaderDescription = ref(false) const steps = [ { @@ -388,6 +416,8 @@ const steps = [ const wrapper = ref(null) const {start, goToStep, finish} = useVOnboarding(wrapper) +const {handleSuccess, handleError} = useNotificationHandler() + function updateOnlineStatus(e: any) { const {type} = e useUiStore().networkOnline = type === 'online' @@ -480,7 +510,7 @@ const scrollToElement = (el: any, delay: number) => { } const updateSelectedTabset = (tabsetId: string, open: boolean, index: number | undefined = undefined) => { - //console.log("updated...", tabsetId, open, Object.keys(tabsetExpanded.value)) + console.log("updated...", tabsetId, open, index, Object.keys(tabsetExpanded.value)) tabsetExpanded.value.set(tabsetId, open) if (open) { if (index) { @@ -547,10 +577,10 @@ watchEffect(() => { } }) -watchEffect(() => { - progress.value = (uiStore.progress || 0.0) / 100.0 - progressLabel.value = uiStore.progressLabel + " " + Math.round(100 * progress.value) + "%" -}) +// watchEffect(() => { +// progress.value = (uiStore.progress || 0.0) / 100.0 +// progressLabel.value = uiStore.progressLabel + " " + Math.round(100 * progress.value) + "%" +// }) const getTabsetOrder = [ @@ -1003,6 +1033,27 @@ const tabsetSectionName = (tabset: Tabset) => { return tabset.name + (activeFolder ? " - " + activeFolder.name : "") } +const toggleEditHeader = (tabset: Tabset, index: number) => { + editHeaderDescription.value = !editHeaderDescription.value + if (editHeaderDescription.value) { + updateSelectedTabset(tabset.id, true, index) + headerDescription.value = tabset.headerDescription || '' + } +} + +const saveTabsetDescription = () => { + console.log("saving tabste", headerDescription.value, useTabsStore().currentTabsetId) + const currentTs = useTabsStore().getCurrentTabset + if (currentTs) { + currentTs.headerDescription = headerDescription.value + useTabsetService().saveCurrentTabset() + editHeaderDescription.value = false + headerDescription.value = '' + handleSuccess(new ExecutionResult('saved','saved')) + } else { + handleError("could not save description") + } +}