From 7a622600eefabe1314744d6c151188691e3ec75a Mon Sep 17 00:00:00 2001 From: Vikas Awaghade Date: Wed, 26 Jun 2024 16:48:09 +0530 Subject: [PATCH] f-dag-app add selected elements to new group --- .storybook/preview.ts | 2 +- .../src/components/f-dag/f-dag.ts | 113 +++++++++++++++--- stories/flow-lineage/dag-config.ts | 18 +-- 3 files changed, 106 insertions(+), 27 deletions(-) diff --git a/.storybook/preview.ts b/.storybook/preview.ts index 37a4ef0a2..66a216a1a 100644 --- a/.storybook/preview.ts +++ b/.storybook/preview.ts @@ -99,7 +99,7 @@ export const decorators = [ ...AwsIconPack } }); - ConfigUtil.setConfig({ theme: "f-ollion-light" }); + ConfigUtil.setConfig({ theme: "f-ollion-dark" }); return html`
("#new-group-id")!; + const groupLabelInput = this.querySelector("#new-group-label")!; + + this.config.groups.push({ + id: groupIdInput.value as string, + label: groupLabelInput.value as string, + icon: "i-org" + }); + + this.addSelectionToGroup(groupIdInput.value as string); + } - addToGroup() { - const groupDropdown = this.querySelector(`#f-group-dropdown`)!; - const groupid = groupDropdown.value as string; + addSelectionToGroup(groupid: string) { this.selectedNodes.forEach(sn => { sn.group = groupid; }); @@ -616,6 +645,22 @@ export class FDag extends FRoot { this.addGroupButton.style.display = "none"; this.requestUpdate(); } + + addToGroup() { + const groupDropdown = this.querySelector(`#f-group-dropdown`)!; + const groupid = groupDropdown.value as string; + + this.addSelectionToGroup(groupid); + } + + switchTab(event: PointerEvent) { + const tabNodeElement = event.currentTarget as FTabNode; + + this.groupSelectionTabs.forEach(tab => { + tab.active = false; + }); + tabNodeElement.active = true; + } render() { return html`