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

Function AccessPane

frontend/src/react/components/sql-editor/AccessPane.tsx:42–403  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

40];
41
42export function AccessPane() {
43 const { t } = useTranslation();
44
45 const searchMyAccessGrants = useAppStore(
46 (state) => state.searchMyAccessGrants
47 );
48 const fetchDatabases = useAppStore((state) => state.fetchDatabases);
49 const getOrFetchDatabaseByName = useAppStore(
50 (state) => state.getOrFetchDatabaseByName
51 );
52 const fetchIssueByName = useAppStore((state) => state.fetchIssueByName);
53 const highlightAccessGrantName = useSQLEditorStore(
54 (s) => s.highlightAccessGrantName
55 );
56 const setHighlightAccessGrantName = useSQLEditorStore(
57 (s) => s.setHighlightAccessGrantName
58 );
59
60 const [showDrawer, setShowDrawer] = useState(false);
61 const [loading, setLoading] = useState(false);
62 const [pendingCreate, setPendingCreate] = useState<AccessGrant | undefined>(
63 undefined
64 );
65 const [accessGrantList, setAccessGrantList] = useState<AccessGrant[]>([]);
66 const [nextPageToken, setNextPageToken] = useState("");
67 const nextPageTokenRef = useRef(nextPageToken);
68 nextPageTokenRef.current = nextPageToken;
69 const [issueByGrantName, setIssueByGrantName] = useState<Map<string, Issue>>(
70 new Map()
71 );
72 const [useSmallLayout, setUseSmallLayout] = useState(false);
73
74 const containerRef = useRef<HTMLDivElement>(null);
75
76 const [searchParams, setSearchParams] = useState<SearchParams>({
77 query: "",
78 scopes: DEFAULT_SCOPES,
79 });
80
81 const projectName = useSQLEditorEditorState((s) => s.project);
82
83 const resolvedProject = useAppProject(projectName as string);
84 const project = projectName ? resolvedProject : undefined;
85
86 const hasJITFeature = useSQLEditorFeature(PlanFeature.FEATURE_JIT);
87
88 // Build scope options for AdvancedSearch (React-compatible, no Vue renderers)
89 const scopeOptions = useMemo((): ScopeOption[] => {
90 return [
91 {
92 id: "status",
93 title: t("common.status"),
94 description: t("sql-editor.access-search.scope.status.description"),
95 allowMultiple: true,
96 options: [
97 {
98 value: AccessGrant_Status[AccessGrant_Status.ACTIVE],
99 keywords: ["active"],

Callers

nothing calls this directly

Calls 12

observeMethod · 0.95
disconnectMethod · 0.95
useSQLEditorEditorStateFunction · 0.90
useAppProjectFunction · 0.90
useSQLEditorFeatureFunction · 0.90
getDefaultPaginationFunction · 0.90
getOrFetchDatabaseByNameFunction · 0.85
useAppStoreFunction · 0.70
tFunction · 0.50
fetchDatabasesFunction · 0.50
setMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected