MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / IndexList

Function IndexList

console/src/platform/clusters/IndexList.tsx:71–123  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

69} from "./queries";
70
71const IndexList = () => {
72 const { clusterId } = useParams<ClusterParams>();
73 assert(clusterId);
74 const maybeOrganizationId = useMaybeCurrentOrganizationId();
75 const schemaObjectFilters = useSchemaObjectFilters("indexName");
76 const { databaseFilter, schemaFilter, nameFilter } = schemaObjectFilters;
77 const organizationIdKeyPrefix = maybeOrganizationId?.data
78 ? `${maybeOrganizationId?.data ?? ""}-`
79 : "";
80 const [showSystemObjects, setShowSystemObjects] = useLocalStorage<boolean>(
81 `${organizationIdKeyPrefix}${clusterId}-show-system-objects`,
82 isSystemCluster(clusterId),
83 );
84
85 return (
86 <MainContentContainer>
87 <HStack mb="6" alignItems="center" justifyContent="space-between">
88 <Text textStyle="heading-sm">Indexes</Text>
89 <HStack>
90 <FormLabel
91 htmlFor="show-system-objects"
92 variant="inline"
93 textStyle="text-base"
94 >
95 Show introspection objects
96 </FormLabel>
97 <Switch
98 id="show-system-objects"
99 isChecked={showSystemObjects}
100 onChange={() => setShowSystemObjects((value: boolean) => !value)}
101 />
102 <DatabaseFilter {...databaseFilter} />
103 <SchemaFilter {...schemaFilter} />
104 <SearchInput
105 name="source"
106 value={nameFilter.name}
107 onChange={(e) => {
108 nameFilter.setName(e.target.value);
109 }}
110 />
111 </HStack>
112 </HStack>
113 <AppErrorBoundary message="An error has occurred loading indexes">
114 <React.Suspense fallback={<LoadingContainer />}>
115 <IndexListInner
116 {...schemaObjectFilters}
117 showSystemObjects={showSystemObjects}
118 />
119 </React.Suspense>
120 </AppErrorBoundary>
121 </MainContentContainer>
122 );
123};
124
125interface IndexListInnerProps {
126 databaseFilter: DatabaseFilterState;

Callers

nothing calls this directly

Calls 5

assertFunction · 0.90
useSchemaObjectFiltersFunction · 0.90
isSystemClusterFunction · 0.90
useLocalStorageFunction · 0.85

Tested by

no test coverage detected