Complete permission-aware native search indexing
This commit is contained in:
+27
-1
@@ -1,5 +1,6 @@
|
||||
import { createElement, lazy } from "react";
|
||||
import type {
|
||||
AdminSectionsUiCapability,
|
||||
PlatformWebModule,
|
||||
SearchRuntimeUiCapability
|
||||
} from "@govoplan/core-webui";
|
||||
@@ -8,12 +9,29 @@ import "./styles/search.css";
|
||||
|
||||
|
||||
const SearchPage = lazy(() => import("./features/search/SearchPage"));
|
||||
const SearchAdminPanel = lazy(() => import("./features/search/SearchAdminPanel"));
|
||||
|
||||
const searchRuntime: SearchRuntimeUiCapability = {
|
||||
GlobalSearch,
|
||||
anyOf: ["search:result:read"]
|
||||
};
|
||||
|
||||
const searchAdminSections: AdminSectionsUiCapability = {
|
||||
sections: [
|
||||
{
|
||||
id: "tenant-search-index",
|
||||
moduleId: "search",
|
||||
kind: "operations",
|
||||
surfaceId: "search.admin.index",
|
||||
label: "Search index",
|
||||
group: "TENANT",
|
||||
order: 69,
|
||||
allOf: ["search:index:admin"],
|
||||
render: ({ settings }) => createElement(SearchAdminPanel, { settings })
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
export const searchModule: PlatformWebModule = {
|
||||
id: "search",
|
||||
label: "Search",
|
||||
@@ -50,10 +68,18 @@ export const searchModule: PlatformWebModule = {
|
||||
kind: "route",
|
||||
label: "Search results",
|
||||
order: 20
|
||||
},
|
||||
{
|
||||
id: "search.admin.index",
|
||||
moduleId: "search",
|
||||
kind: "section",
|
||||
label: "Search index administration",
|
||||
order: 30
|
||||
}
|
||||
],
|
||||
uiCapabilities: {
|
||||
"search.runtime": searchRuntime
|
||||
"search.runtime": searchRuntime,
|
||||
"admin.sections": searchAdminSections
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user