Sync GovOPlaN module state
This commit is contained in:
@@ -250,6 +250,8 @@ export type ModuleCatalogResponse = {
|
||||
export type ModuleInstallPlanItem = {
|
||||
module_id: string;
|
||||
action: "install" | "uninstall";
|
||||
source: "manual" | "catalog";
|
||||
catalog?: Record<string, unknown> | null;
|
||||
python_package?: string | null;
|
||||
python_ref?: string | null;
|
||||
webui_package?: string | null;
|
||||
@@ -370,6 +372,18 @@ export type ModuleInstallerRequestListResponse = {
|
||||
full?: boolean;
|
||||
};
|
||||
|
||||
export type ModuleInterfaceProviderItem = {
|
||||
name: string;
|
||||
version: string;
|
||||
};
|
||||
|
||||
export type ModuleInterfaceRequirementItem = {
|
||||
name: string;
|
||||
version_min?: string | null;
|
||||
version_max_exclusive?: string | null;
|
||||
optional: boolean;
|
||||
};
|
||||
|
||||
export type ModulePackageCatalogItem = {
|
||||
module_id: string;
|
||||
name: string;
|
||||
@@ -380,6 +394,8 @@ export type ModulePackageCatalogItem = {
|
||||
python_ref?: string | null;
|
||||
webui_package?: string | null;
|
||||
webui_ref?: string | null;
|
||||
provides_interfaces: ModuleInterfaceProviderItem[];
|
||||
requires_interfaces: ModuleInterfaceRequirementItem[];
|
||||
license_features: string[];
|
||||
license_allowed: boolean;
|
||||
license_enforced: boolean;
|
||||
|
||||
@@ -416,6 +416,8 @@ export default function ModuleManagementPanel({ settings, canWrite, canAccessMai
|
||||
{item.tags.length > 0 && <span>{item.tags.join(", ")}</span>}
|
||||
{item.license_features.length > 0 && <span>i18n:govoplan-admin.license.de13bf1a {item.license_features.join(", ")}</span>}
|
||||
{item.license_missing_features.length > 0 && <span>i18n:govoplan-admin.missing.feb2bbaa {item.license_missing_features.join(", ")}</span>}
|
||||
{item.provides_interfaces.length > 0 && <span>i18n:govoplan-admin.provides.221b70d9 {providedInterfacesLabel(item)}</span>}
|
||||
{item.requires_interfaces.length > 0 && <span>i18n:govoplan-admin.requires.a4fc9357 {requiredInterfacesLabel(item)}</span>}
|
||||
</div>
|
||||
{item.description && <p className="module-package-catalog-description">{item.description}</p>}
|
||||
{item.license_reason && <p className={`module-package-catalog-description${item.license_allowed ? "" : " alert warning"}`}>{item.license_reason}</p>}
|
||||
@@ -471,6 +473,12 @@ export default function ModuleManagementPanel({ settings, canWrite, canAccessMai
|
||||
{draftPlanItems.length === 0 && <div className="module-install-plan-empty">i18n:govoplan-admin.no_package_changes_planned.f12d8b33</div>}
|
||||
{draftPlanItems.map((item, index) =>
|
||||
<div className="module-install-plan-row" key={`${item.module_id}-${index}`}>
|
||||
<div className="module-install-plan-row-meta">
|
||||
<StatusBadge status={item.source === "catalog" ? "success" : "inactive"} label={item.source === "catalog" ? "i18n:govoplan-admin.catalog.4a88d27b" : "i18n:govoplan-admin.manual.17a486ca"} />
|
||||
{item.catalog?.channel && <StatusBadge status="inactive" label={i18nMessage("i18n:govoplan-admin.channel_value.d3894efe", { value0: String(item.catalog.channel) })} />}
|
||||
{item.catalog?.sequence !== null && item.catalog?.sequence !== undefined && <StatusBadge status="inactive" label={i18nMessage("i18n:govoplan-admin.seq_value.0ae5fa47", { value0: item.catalog.sequence })} />}
|
||||
{item.catalog?.key_id && <StatusBadge status="inactive" label={i18nMessage("i18n:govoplan-admin.key_value.847b914f", { value0: String(item.catalog.key_id) })} />}
|
||||
</div>
|
||||
<label><span>i18n:govoplan-admin.action.97c89a4d</span><select value={item.action} disabled={!canWrite || planBusy} onChange={(event) => updatePlanItem(index, { action: event.target.value as ModuleInstallPlanItem["action"] })}><option value="install">i18n:govoplan-admin.install.fd6c3ebf</option><option value="uninstall">i18n:govoplan-admin.uninstall.a735da1d</option></select></label>
|
||||
<label><span>i18n:govoplan-admin.module.b8ff0289</span><input value={item.module_id} disabled={!canWrite || planBusy} onChange={(event) => updatePlanItem(index, { module_id: event.target.value })} placeholder="files" /></label>
|
||||
<label><span>i18n:govoplan-admin.python_package.34591c71</span><input value={item.python_package ?? ""} disabled={!canWrite || planBusy} onChange={(event) => updatePlanItem(index, { python_package: event.target.value })} placeholder="govoplan-files" /></label>
|
||||
@@ -621,6 +629,21 @@ function LicenseStatus({ license }: {license: ModuleLicenseDiagnostics;}) {
|
||||
|
||||
}
|
||||
|
||||
function providedInterfacesLabel(item: ModulePackageCatalogItem): string {
|
||||
return item.provides_interfaces.map((provided) => `${provided.name}@${provided.version}`).join(", ");
|
||||
}
|
||||
|
||||
function requiredInterfacesLabel(item: ModulePackageCatalogItem): string {
|
||||
return item.requires_interfaces.map((required) => {
|
||||
const range = [
|
||||
required.version_min ? `>=${required.version_min}` : "",
|
||||
required.version_max_exclusive ? `<${required.version_max_exclusive}` : "",
|
||||
].filter(Boolean).join(" ");
|
||||
const suffix = range ? ` ${range}` : "";
|
||||
return `${required.optional ? "optional " : ""}${required.name}${suffix}`;
|
||||
}).join(", ");
|
||||
}
|
||||
|
||||
function ModuleStatus({ module, desiredEnabled }: {module: ModuleCatalogItem;desiredEnabled: boolean;}) {
|
||||
if (module.current_enabled && !desiredEnabled) return <StatusBadge status="warning" label="i18n:govoplan-admin.will_disable.14bb193a" />;
|
||||
if (!module.current_enabled && desiredEnabled) return <StatusBadge status="warning" label="i18n:govoplan-admin.will_enable.5d52d70b" />;
|
||||
@@ -640,6 +663,8 @@ function emptyPlanItem(): ModuleInstallPlanItem {
|
||||
return {
|
||||
module_id: "",
|
||||
action: "install",
|
||||
source: "manual",
|
||||
catalog: null,
|
||||
python_package: "",
|
||||
python_ref: "",
|
||||
webui_package: "",
|
||||
@@ -655,6 +680,8 @@ function normalizePlanItems(items: ModuleInstallPlanItem[]): ModuleInstallPlanIt
|
||||
map((item) => ({
|
||||
module_id: item.module_id.trim(),
|
||||
action: item.action,
|
||||
source: item.source === "catalog" ? "catalog" : "manual",
|
||||
catalog: item.source === "catalog" ? item.catalog ?? null : null,
|
||||
python_package: cleanOptional(item.python_package),
|
||||
python_ref: item.action === "install" ? cleanOptional(item.python_ref) : null,
|
||||
webui_package: cleanOptional(item.webui_package),
|
||||
|
||||
@@ -44,6 +44,7 @@ export const generatedTranslations: PlatformTranslations = {
|
||||
"i18n:govoplan-admin.case_clerk.b78a314a": "Case clerk",
|
||||
"i18n:govoplan-admin.catalog_install_entry_planned.13b23f4f": "Catalog install entry planned.",
|
||||
"i18n:govoplan-admin.catalog.4a88d27b": "Catalog",
|
||||
"i18n:govoplan-admin.manual.17a486ca": "Manual",
|
||||
"i18n:govoplan-admin.central_groups.5c9b5b66": "Central groups",
|
||||
"i18n:govoplan-admin.centrally_defined_group_identities_that_are_prov.7761fce9": "Centrally defined group identities that are provisioned into selected tenants as available or required definitions. Membership remains tenant-local.",
|
||||
"i18n:govoplan-admin.centrally_governed_tenant_roles_and_their_availa.d879d5d1": "Centrally governed tenant roles and their availability across tenants.",
|
||||
@@ -232,6 +233,7 @@ export const generatedTranslations: PlatformTranslations = {
|
||||
"i18n:govoplan-admin.preflight_finished_with_blockers.7e2ca12b": "Preflight finished with blockers.",
|
||||
"i18n:govoplan-admin.preflight_passed.c0c99055": "Preflight passed.",
|
||||
"i18n:govoplan-admin.preflight.8016a487": "Preflight",
|
||||
"i18n:govoplan-admin.provides.221b70d9": "Provides:",
|
||||
"i18n:govoplan-admin.python_package.34591c71": "Python package",
|
||||
"i18n:govoplan-admin.python_ref.1af35d0d": "Python ref",
|
||||
"i18n:govoplan-admin.queue_supervised_run.a53f248c": "Queue supervised run",
|
||||
@@ -397,6 +399,7 @@ export const generatedTranslations: PlatformTranslations = {
|
||||
"i18n:govoplan-admin.case_clerk.b78a314a": "Case clerk",
|
||||
"i18n:govoplan-admin.catalog_install_entry_planned.13b23f4f": "Catalog install entry planned.",
|
||||
"i18n:govoplan-admin.catalog.4a88d27b": "Katalog",
|
||||
"i18n:govoplan-admin.manual.17a486ca": "Manuell",
|
||||
"i18n:govoplan-admin.central_groups.5c9b5b66": "Central groups",
|
||||
"i18n:govoplan-admin.centrally_defined_group_identities_that_are_prov.7761fce9": "Centrally defined group identities that are provisioned into selected tenants as available or required definitions. Membership remains tenant-local.",
|
||||
"i18n:govoplan-admin.centrally_governed_tenant_roles_and_their_availa.d879d5d1": "Centrally governed tenant roles and their availability across tenants.",
|
||||
@@ -585,6 +588,7 @@ export const generatedTranslations: PlatformTranslations = {
|
||||
"i18n:govoplan-admin.preflight_finished_with_blockers.7e2ca12b": "Preflight finished with blockers.",
|
||||
"i18n:govoplan-admin.preflight_passed.c0c99055": "Preflight passed.",
|
||||
"i18n:govoplan-admin.preflight.8016a487": "Preflight",
|
||||
"i18n:govoplan-admin.provides.221b70d9": "Provides:",
|
||||
"i18n:govoplan-admin.python_package.34591c71": "Python-Paket",
|
||||
"i18n:govoplan-admin.python_ref.1af35d0d": "Python-Referenz",
|
||||
"i18n:govoplan-admin.queue_supervised_run.a53f248c": "Queue supervised run",
|
||||
|
||||
Reference in New Issue
Block a user