MCPcopy Create free account
hub / github.com/bytebase/bytebase / sheetLikeItemsForView

Function sheetLikeItemsForView

frontend/src/views/sql-editor/Sheet/context.ts:645–659  ·  view source on GitHub ↗
(view: SheetViewMode)

Source from the content-addressed store, hash-verified

643};
644
645const sheetLikeItemsForView = (view: SheetViewMode): WorksheetLikeItem[] => {
646 if (view === "draft") {
647 const tabsState = getSQLEditorTabsState();
648 return tabsState.openTmpTabList
649 .map((p) => tabsState.tabsById.get(p.id))
650 .filter((tab): tab is SQLEditorTab => !!tab && !tab.worksheet)
651 .map((tab) => ({
652 name: tab.id,
653 title: tab.title,
654 folders: [],
655 type: "draft" as const,
656 }));
657 }
658 return worksheetsForView(view).map(convertToWorksheetLikeItem);
659};
660
661const rebuildTreeImpl = (view: SheetViewMode) => {
662 const filter = useSheetContextStore.getState().filter;

Callers 1

rebuildTreeImplFunction · 0.85

Calls 3

getSQLEditorTabsStateFunction · 0.90
worksheetsForViewFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected