refactor(webui): describe function assignment action
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
import { createElement, lazy } from "react";
|
import { createElement, lazy } from "react";
|
||||||
import { Button, type OrganizationFunctionActionsUiCapability, type PlatformWebModule } from "@govoplan/core-webui";
|
import { Users } from "lucide-react";
|
||||||
|
import type { OrganizationFunctionActionsUiCapability, PlatformWebModule } from "@govoplan/core-webui";
|
||||||
import { generatedTranslations } from "./i18n/generatedTranslations";
|
import { generatedTranslations } from "./i18n/generatedTranslations";
|
||||||
import "./styles/idm.css";
|
import "./styles/idm.css";
|
||||||
|
|
||||||
@@ -20,23 +21,15 @@ const organizationFunctionActions: OrganizationFunctionActionsUiCapability = {
|
|||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
id: "idm.view-function-assignments",
|
id: "idm.view-function-assignments",
|
||||||
label: "i18n:govoplan-idm.assignments.a0d19ec5",
|
label: "i18n:govoplan-idm.view_assignments.2d40d6a5",
|
||||||
|
icon: createElement(Users, { size: 16 }),
|
||||||
anyOf: idmReadScopes,
|
anyOf: idmReadScopes,
|
||||||
order: 40,
|
order: 40,
|
||||||
render: ({ function: item }) => createElement(
|
onClick: ({ function: item }) => {
|
||||||
Button,
|
|
||||||
{
|
|
||||||
type: "button",
|
|
||||||
variant: "ghost",
|
|
||||||
title: "i18n:govoplan-idm.view_assignments.2d40d6a5",
|
|
||||||
onClick: () => {
|
|
||||||
if (typeof window !== "undefined") {
|
if (typeof window !== "undefined") {
|
||||||
window.location.href = `/idm?function_id=${encodeURIComponent(item.id)}`;
|
window.location.href = `/idm?function_id=${encodeURIComponent(item.id)}`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"i18n:govoplan-idm.assignments.a0d19ec5"
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user