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

Function Quickstart

frontend/src/react/components/Quickstart.tsx:61–357  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

59 * (e.g. an upgraded workspace that never bootstrapped the sample).
60 */
61export function Quickstart() {
62 const { t } = useTranslation();
63 const loadProjectIamPolicy = useAppStore(
64 (state) => state.loadProjectIamPolicy
65 );
66
67 const quickStartEnabled = useAppStore((s) => s.quickStartEnabled());
68 const hidden = useAppStore((s) => s.getIntroStateByKey("hidden"));
69
70 // Subscribe to each task's done flag so the line-through + progress
71 // bar update live.
72 const issueVisited = useAppStore((s) => s.getIntroStateByKey("issue.visit"));
73 const dataQueried = useAppStore((s) => s.getIntroStateByKey("data.query"));
74 const projectVisited = useAppStore((s) =>
75 s.getIntroStateByKey("project.visit")
76 );
77 const environmentVisited = useAppStore((s) =>
78 s.getIntroStateByKey("environment.visit")
79 );
80 const instanceVisited = useAppStore((s) =>
81 s.getIntroStateByKey("instance.visit")
82 );
83 const databaseVisited = useAppStore((s) =>
84 s.getIntroStateByKey("database.visit")
85 );
86 const memberVisited = useAppStore((s) =>
87 s.getIntroStateByKey("member.visit")
88 );
89
90 // ---- async sample fetches --------------------------------------------
91
92 const [sampleProject, setSampleProject] = useState<Project | undefined>();
93 const [sampleIssueExists, setSampleIssueExists] = useState(false);
94 const [sampleSheetExists, setSampleSheetExists] = useState(false);
95
96 useEffect(() => {
97 if (!quickStartEnabled) {
98 setSampleProject(undefined);
99 return;
100 }
101 let cancelled = false;
102 void (async () => {
103 const project = await useAppStore
104 .getState()
105 .getOrFetchProjectByName(
106 `${projectNamePrefix}${SAMPLE_PROJECT_NAME}`,
107 true /* silent */
108 );
109 if (cancelled) return;
110 if (!isValidProjectName(project.name)) {
111 setSampleProject(undefined);
112 return;
113 }
114 await loadProjectIamPolicy(project.name);
115 if (cancelled) return;
116 setSampleProject(project);
117 })();
118 return () => {

Callers

nothing calls this directly

Calls 8

isValidProjectNameFunction · 0.90
hasProjectPermissionV2Function · 0.90
cnFunction · 0.90
handleHideFunction · 0.85
isTaskActiveFunction · 0.85
useAppStoreFunction · 0.70
tFunction · 0.50

Tested by

no test coverage detected