This commit is contained in:
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@govoplan/admin-webui",
|
"name": "@govoplan/admin-webui",
|
||||||
"version": "0.1.15",
|
"version": "0.1.16",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "webui/src/index.ts",
|
"main": "webui/src/index.ts",
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
"LICENSE"
|
"LICENSE"
|
||||||
],
|
],
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@govoplan/core-webui": "^0.1.15",
|
"@govoplan/core-webui": "^0.1.16",
|
||||||
"lucide-react": "^1.23.0",
|
"lucide-react": "^1.23.0",
|
||||||
"react": ">=19.2.7 <20",
|
"react": ">=19.2.7 <20",
|
||||||
"react-dom": ">=19.2.7 <20",
|
"react-dom": ">=19.2.7 <20",
|
||||||
|
|||||||
+3
-3
@@ -4,14 +4,14 @@ build-backend = "setuptools.build_meta"
|
|||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "govoplan-admin"
|
name = "govoplan-admin"
|
||||||
version = "0.1.15"
|
version = "0.1.16"
|
||||||
description = "GovOPlaN generic administration module."
|
description = "GovOPlaN generic administration module."
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
requires-python = ">=3.12"
|
requires-python = ">=3.12"
|
||||||
authors = [{ name = "GovOPlaN" }]
|
authors = [{ name = "GovOPlaN" }]
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"govoplan-core>=0.1.15",
|
"govoplan-core>=0.1.16",
|
||||||
"govoplan-access>=0.1.15",
|
"govoplan-access>=0.1.16",
|
||||||
]
|
]
|
||||||
|
|
||||||
[tool.setuptools.packages.find]
|
[tool.setuptools.packages.find]
|
||||||
|
|||||||
@@ -81,6 +81,7 @@ from govoplan_core.core.registry import PlatformRegistry
|
|||||||
from govoplan_core.core.runtime import get_registry
|
from govoplan_core.core.runtime import get_registry
|
||||||
from govoplan_core.db.session import get_session
|
from govoplan_core.db.session import get_session
|
||||||
from govoplan_core.i18n import (
|
from govoplan_core.i18n import (
|
||||||
|
REFERENCE_LANGUAGE_CODE,
|
||||||
i18n_settings,
|
i18n_settings,
|
||||||
normalize_enabled_language_codes,
|
normalize_enabled_language_codes,
|
||||||
normalize_language_packages,
|
normalize_language_packages,
|
||||||
@@ -1598,7 +1599,9 @@ def write_system_settings(
|
|||||||
available_languages,
|
available_languages,
|
||||||
default_locale=payload.default_locale,
|
default_locale=payload.default_locale,
|
||||||
)
|
)
|
||||||
item.default_locale = payload.default_locale.strip() or "en"
|
item.default_locale = (
|
||||||
|
payload.default_locale.strip() or REFERENCE_LANGUAGE_CODE
|
||||||
|
)
|
||||||
item.allow_tenant_custom_groups = payload.allow_tenant_custom_groups
|
item.allow_tenant_custom_groups = payload.allow_tenant_custom_groups
|
||||||
item.allow_tenant_custom_roles = payload.allow_tenant_custom_roles
|
item.allow_tenant_custom_roles = payload.allow_tenant_custom_roles
|
||||||
item.allow_tenant_api_keys = payload.allow_tenant_api_keys
|
item.allow_tenant_api_keys = payload.allow_tenant_api_keys
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ from typing import Any, Literal
|
|||||||
from pydantic import BaseModel, ConfigDict, Field
|
from pydantic import BaseModel, ConfigDict, Field
|
||||||
|
|
||||||
from govoplan_core.api.v1.schemas import DeltaDeletedItem
|
from govoplan_core.api.v1.schemas import DeltaDeletedItem
|
||||||
|
from govoplan_core.i18n import REFERENCE_LANGUAGE_CODE
|
||||||
from govoplan_core.privacy.schemas import PrivacyRetentionPolicyItem
|
from govoplan_core.privacy.schemas import PrivacyRetentionPolicyItem
|
||||||
|
|
||||||
|
|
||||||
@@ -40,7 +41,7 @@ class AdminOverviewResponse(BaseModel):
|
|||||||
|
|
||||||
|
|
||||||
class SystemSettingsItem(BaseModel):
|
class SystemSettingsItem(BaseModel):
|
||||||
default_locale: str = "en"
|
default_locale: str = REFERENCE_LANGUAGE_CODE
|
||||||
allow_tenant_custom_groups: bool = True
|
allow_tenant_custom_groups: bool = True
|
||||||
allow_tenant_custom_roles: bool = True
|
allow_tenant_custom_roles: bool = True
|
||||||
allow_tenant_api_keys: bool = True
|
allow_tenant_api_keys: bool = True
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ ADMIN_ROLE_TEMPLATES = (
|
|||||||
manifest = ModuleManifest(
|
manifest = ModuleManifest(
|
||||||
id="admin",
|
id="admin",
|
||||||
name="Admin",
|
name="Admin",
|
||||||
version="0.1.15",
|
version="0.1.16",
|
||||||
permissions=ADMIN_PERMISSIONS,
|
permissions=ADMIN_PERMISSIONS,
|
||||||
role_templates=ADMIN_ROLE_TEMPLATES,
|
role_templates=ADMIN_ROLE_TEMPLATES,
|
||||||
required_capabilities=(CAPABILITY_AUTH_PRINCIPAL_RESOLVER, CAPABILITY_AUTH_PERMISSION_EVALUATOR),
|
required_capabilities=(CAPABILITY_AUTH_PRINCIPAL_RESOLVER, CAPABILITY_AUTH_PERMISSION_EVALUATOR),
|
||||||
@@ -123,6 +123,24 @@ manifest = ModuleManifest(
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
DocumentationTopic(
|
||||||
|
id="admin.language-reference-and-packages",
|
||||||
|
title="Manage reference language and language packages",
|
||||||
|
summary="German is the reference and new-installation default while configured tenant and user language choices remain effective.",
|
||||||
|
body=(
|
||||||
|
"German is the first-class product acceptance language and the default for a new system or tenant. English remains installed as the source-code fallback. System administrators control available and enabled language packages and the system default; tenant and user choices can select only languages allowed above them. Existing explicit preferences are preserved when this baseline is introduced. Disabling a language must not discard translated content or silently rewrite a stored preference."
|
||||||
|
),
|
||||||
|
documentation_types=("admin",),
|
||||||
|
audience=("system_admin", "tenant_admin"),
|
||||||
|
related_modules=("tenancy", "access", "docs"),
|
||||||
|
metadata={
|
||||||
|
"kind": "reference",
|
||||||
|
"help_contexts": [
|
||||||
|
"admin.system-settings.locale",
|
||||||
|
"admin.system-settings.languages",
|
||||||
|
],
|
||||||
|
},
|
||||||
|
),
|
||||||
DocumentationTopic(
|
DocumentationTopic(
|
||||||
id="admin.module-lifecycle-workflow",
|
id="admin.module-lifecycle-workflow",
|
||||||
title="Plan and supervise module lifecycle changes",
|
title="Plan and supervise module lifecycle changes",
|
||||||
|
|||||||
@@ -6,9 +6,13 @@ from unittest.mock import patch
|
|||||||
from fastapi import HTTPException
|
from fastapi import HTTPException
|
||||||
|
|
||||||
from govoplan_admin.backend.api.v1.routes import _catalog_plan_item
|
from govoplan_admin.backend.api.v1.routes import _catalog_plan_item
|
||||||
|
from govoplan_admin.backend.api.v1.schemas import SystemSettingsItem
|
||||||
|
|
||||||
|
|
||||||
class CatalogPlanItemTests(unittest.TestCase):
|
class CatalogPlanItemTests(unittest.TestCase):
|
||||||
|
def test_system_settings_use_german_reference_default(self) -> None:
|
||||||
|
self.assertEqual("de", SystemSettingsItem().default_locale)
|
||||||
|
|
||||||
def test_builds_catalog_item_and_preserves_catalog_metadata(self) -> None:
|
def test_builds_catalog_item_and_preserves_catalog_metadata(self) -> None:
|
||||||
validation: dict[str, object] = {
|
validation: dict[str, object] = {
|
||||||
"valid": True,
|
"valid": True,
|
||||||
|
|||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@govoplan/admin-webui",
|
"name": "@govoplan/admin-webui",
|
||||||
"version": "0.1.15",
|
"version": "0.1.16",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
"test:interface-patterns": "node scripts/test-interface-pattern-language.mjs"
|
"test:interface-patterns": "node scripts/test-interface-pattern-language.mjs"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@govoplan/core-webui": "^0.1.15",
|
"@govoplan/core-webui": "^0.1.16",
|
||||||
"lucide-react": "^1.23.0",
|
"lucide-react": "^1.23.0",
|
||||||
"react": ">=19.2.7 <20",
|
"react": ">=19.2.7 <20",
|
||||||
"react-dom": ">=19.2.7 <20",
|
"react-dom": ">=19.2.7 <20",
|
||||||
|
|||||||
@@ -32,17 +32,17 @@ const defaultPrivacyPolicy: PrivacyRetentionPolicy = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const fallback: SystemSettingsItem = {
|
const fallback: SystemSettingsItem = {
|
||||||
default_locale: "en",
|
default_locale: "de",
|
||||||
allow_tenant_custom_groups: true,
|
allow_tenant_custom_groups: true,
|
||||||
allow_tenant_custom_roles: true,
|
allow_tenant_custom_roles: true,
|
||||||
allow_tenant_api_keys: true,
|
allow_tenant_api_keys: true,
|
||||||
privacy_retention_policy: defaultPrivacyPolicy,
|
privacy_retention_policy: defaultPrivacyPolicy,
|
||||||
maintenance_mode: { enabled: false, message: "" },
|
maintenance_mode: { enabled: false, message: "" },
|
||||||
available_languages: [
|
available_languages: [
|
||||||
{ code: "en", label: "English", native_label: "English" },
|
{ code: "de", label: "German", native_label: "Deutsch" },
|
||||||
{ code: "de", label: "German", native_label: "Deutsch" }
|
{ code: "en", label: "English", native_label: "English" }
|
||||||
],
|
],
|
||||||
enabled_language_codes: ["en", "de"],
|
enabled_language_codes: ["de", "en"],
|
||||||
settings: {}
|
settings: {}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user