()
| 40 | ]; |
| 41 | |
| 42 | export 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"], |
nothing calls this directly
no test coverage detected