resetBoundary()}
+ type="error"
+ >
+
+ We encountered an unexpected error. Please try again. If the problem
+ persists, please contact your administrator.
+
+ {error.message}
+
+
+ );
+}
+
+export default function ContainerForExtensions() {
+ const [extensionUxElements, setExtensionNavigationItems] = useState<
+ UiSchemaUxElement[] | null
+ >(null);
+
+ let contentClassName = 'main-site-body-centered';
+ if (window.location.pathname.startsWith('/editor/')) {
+ contentClassName = 'no-center-stuff';
+ }
+ const { targetUris } = useUriListForPermissions();
+ const permissionRequestData: PermissionsToCheck = {
+ [targetUris.extensionListPath]: ['GET'],
+ };
+ const { ability, permissionsLoaded } = usePermissionFetcher(
+ permissionRequestData
+ );
+
+ // eslint-disable-next-line sonarjs/cognitive-complexity
+ useEffect(() => {
+ if (!permissionsLoaded) {
+ return;
+ }
+
+ const processExtensionResult = (processModels: ProcessModel[]) => {
+ const eni: UiSchemaUxElement[] = processModels
+ .map((processModel: ProcessModel) => {
+ const extensionUiSchemaFile = processModel.files.find(
+ (file: ProcessFile) => file.name === 'extension_uischema.json'
+ );
+ if (extensionUiSchemaFile && extensionUiSchemaFile.file_contents) {
+ try {
+ const extensionUiSchema: ExtensionUiSchema = JSON.parse(
+ extensionUiSchemaFile.file_contents
+ );
+ if (extensionUiSchema.ux_elements) {
+ return extensionUiSchema.ux_elements;
+ }
+ } catch (jsonParseError: any) {
+ console.error(
+ `Unable to get navigation items for ${processModel.id}`
+ );
+ }
+ }
+ return [] as UiSchemaUxElement[];
+ })
+ .flat();
+ if (eni) {
+ setExtensionNavigationItems(eni);
+ }
+ };
+
+ if (ability.can('GET', targetUris.extensionListPath)) {
+ HttpService.makeCallToBackend({
+ path: targetUris.extensionListPath,
+ successCallback: processExtensionResult,
+ });
+ }
+ }, [targetUris.extensionListPath, permissionsLoaded, ability]);
+
+ return (
+ <>
+