simple-module-branding 0.0.41__tar.gz → 0.0.43__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/.gitignore +3 -0
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/PKG-INFO +6 -6
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/module.py +1 -1
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/shared_props.py +3 -1
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/package.json +5 -6
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/pyproject.toml +6 -6
- simple_module_branding-0.0.43/tests/test_branding_menu_permission.py +17 -0
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/README.md +0 -0
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/__init__.py +0 -0
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/components/BannerField.tsx +0 -0
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/components/BrandingPreview.tsx +0 -0
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/components/ColorField.tsx +0 -0
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/components/DesignPackField.tsx +0 -0
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/components/FooterField.tsx +0 -0
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/components/ImageDropzones.tsx +0 -0
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/components/PresetField.tsx +0 -0
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/components/PreviewSurfaces.tsx +0 -0
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/components/PreviewTabs.tsx +0 -0
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/components/dirty.ts +0 -0
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/components/hex.ts +0 -0
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/constants.py +0 -0
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/contracts/__init__.py +0 -0
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/contracts/schemas.py +0 -0
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/deps.py +0 -0
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/endpoints/__init__.py +0 -0
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/endpoints/api.py +0 -0
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/endpoints/assets.py +0 -0
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/endpoints/tenant_api.py +0 -0
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/endpoints/views.py +0 -0
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/images.py +0 -0
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/locales/de.json +0 -0
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/locales/en.json +0 -0
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/pages/Manage.tsx +0 -0
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/pages/api.generated.ts +0 -0
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/pages/api.ts +0 -0
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/presets.py +0 -0
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/py.typed +0 -0
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/reaper.py +0 -0
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/service.py +0 -0
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/services.py +0 -0
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/settings.py +0 -0
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/tenant_branding.py +0 -0
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/tenant_definitions.py +0 -0
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/tests/test_asset_lifecycle.py +0 -0
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/tests/test_banner.py +0 -0
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/tests/test_branding.py +0 -0
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/tests/test_branding_clear_route_scope.py +0 -0
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/tests/test_branding_platform_files.py +0 -0
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/tests/test_branding_reap.py +0 -0
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/tests/test_branding_reap_ordering.py +0 -0
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/tests/test_design_pack.py +0 -0
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/tests/test_footer_links.py +0 -0
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/tests/test_footer_text.py +0 -0
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/tests/test_images.py +0 -0
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/tests/test_logo_dark.py +0 -0
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/tests/test_menu_section.py +0 -0
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/tests/test_presets.py +0 -0
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/tests/test_public_assets.py +0 -0
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/tests/test_ship_review.py +0 -0
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/tests/test_tenant_branding.py +0 -0
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/tests/test_tenant_branding_assets.py +0 -0
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/tests/test_tenant_branding_cost.py +0 -0
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/tests-js/branding_ManageSave.test.tsx +0 -0
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/tests-js/color-field.test.tsx +0 -0
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/tests-js/dirty-state.test.tsx +0 -0
- {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/tsconfig.json +0 -0
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: simple_module_branding
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.43
|
|
4
4
|
Summary: Customisable application branding (name, logo, favicon, primary colour) for simple_module apps
|
|
5
5
|
Project-URL: Repository, https://github.com/antosubash/simple_module_python
|
|
6
6
|
Author-email: Anto Subash <antosubash@live.com>
|
|
7
7
|
License-Expression: MIT
|
|
8
8
|
Keywords: branding,simple-module,theming,white-label
|
|
9
9
|
Requires-Python: >=3.12
|
|
10
|
-
Requires-Dist: simple-module-core==0.0.
|
|
11
|
-
Requires-Dist: simple-module-db==0.0.
|
|
12
|
-
Requires-Dist: simple-module-file-storage==0.0.
|
|
13
|
-
Requires-Dist: simple-module-hosting==0.0.
|
|
14
|
-
Requires-Dist: simple-module-settings==0.0.
|
|
10
|
+
Requires-Dist: simple-module-core==0.0.43
|
|
11
|
+
Requires-Dist: simple-module-db==0.0.43
|
|
12
|
+
Requires-Dist: simple-module-file-storage==0.0.43
|
|
13
|
+
Requires-Dist: simple-module-hosting==0.0.43
|
|
14
|
+
Requires-Dist: simple-module-settings==0.0.43
|
|
15
15
|
Description-Content-Type: text/markdown
|
|
16
16
|
|
|
17
17
|
# simple_module_branding
|
|
@@ -9,6 +9,8 @@ from __future__ import annotations
|
|
|
9
9
|
|
|
10
10
|
from typing import TYPE_CHECKING
|
|
11
11
|
|
|
12
|
+
from simple_module_hosting.inertia_deps import INERTIA_HEADER
|
|
13
|
+
|
|
12
14
|
from branding.constants import (
|
|
13
15
|
ASSET_VERSION_QUERY_KEY,
|
|
14
16
|
FAVICON_URL,
|
|
@@ -75,7 +77,7 @@ def renders_a_page(request: Request) -> bool:
|
|
|
75
77
|
``/api/``, SM018). Elsewhere an Inertia visit, or anything a browser could
|
|
76
78
|
be navigating with (``text/html``, ``*/*``, or no ``Accept``), counts.
|
|
77
79
|
"""
|
|
78
|
-
if request.headers
|
|
80
|
+
if INERTIA_HEADER in request.headers: # presence, like is_inertia_request
|
|
79
81
|
return True
|
|
80
82
|
path = request.url.path
|
|
81
83
|
if path == "/api" or path.startswith(_NO_PAGE_PREFIXES):
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simple-module-py/branding",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.43",
|
|
4
4
|
"private": true,
|
|
5
5
|
"description": "Frontend assets for the Branding module",
|
|
6
6
|
"peerDependencies": {
|
|
7
|
+
"@inertiajs/react": "^3.9.1",
|
|
8
|
+
"@simple-module-py/ui": "*",
|
|
7
9
|
"react": "^19.0.0",
|
|
8
|
-
"react-dom": "^19.
|
|
9
|
-
"@inertiajs/react": "^3.7.0",
|
|
10
|
-
"@simple-module-py/ui": "*"
|
|
10
|
+
"react-dom": "^19.3.1"
|
|
11
11
|
},
|
|
12
12
|
"devDependencies": {
|
|
13
13
|
"@simple-module-py/tsconfig": "*"
|
|
14
|
-
}
|
|
15
|
-
"dependencies": {}
|
|
14
|
+
}
|
|
16
15
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "simple_module_branding"
|
|
3
|
-
version = "0.0.
|
|
3
|
+
version = "0.0.43"
|
|
4
4
|
description = "Customisable application branding (name, logo, favicon, primary colour) for simple_module apps"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
license = "MIT"
|
|
@@ -8,11 +8,11 @@ authors = [{ name = "Anto Subash", email = "antosubash@live.com" }]
|
|
|
8
8
|
keywords = ["simple-module", "branding", "theming", "white-label"]
|
|
9
9
|
requires-python = ">=3.12"
|
|
10
10
|
dependencies = [
|
|
11
|
-
"simple_module_core==0.0.
|
|
12
|
-
"simple_module_db==0.0.
|
|
13
|
-
"simple_module_hosting==0.0.
|
|
14
|
-
"simple_module_settings==0.0.
|
|
15
|
-
"simple_module_file_storage==0.0.
|
|
11
|
+
"simple_module_core==0.0.43",
|
|
12
|
+
"simple_module_db==0.0.43",
|
|
13
|
+
"simple_module_hosting==0.0.43",
|
|
14
|
+
"simple_module_settings==0.0.43",
|
|
15
|
+
"simple_module_file_storage==0.0.43",
|
|
16
16
|
]
|
|
17
17
|
|
|
18
18
|
[project.urls]
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"""Branding navigation follows the page guard rather than role names (#698)."""
|
|
2
|
+
|
|
3
|
+
import pytest
|
|
4
|
+
from branding.constants import MENU_URL, PERM_VIEW
|
|
5
|
+
from branding.module import BrandingModule
|
|
6
|
+
from simple_module_core.menu import MenuRegistry, MenuSection
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@pytest.mark.parametrize("granted", [False, True])
|
|
10
|
+
@pytest.mark.parametrize("role", ["admin", "designer"])
|
|
11
|
+
def test_branding_menu_follows_view_permission(granted, role):
|
|
12
|
+
registry = MenuRegistry()
|
|
13
|
+
BrandingModule().register_menu_items(registry)
|
|
14
|
+
items = registry.get_for_user(
|
|
15
|
+
is_authenticated=True, roles=[role], permissions=[PERM_VIEW] if granted else []
|
|
16
|
+
)[MenuSection.ADMIN_SIDEBAR]
|
|
17
|
+
assert any(item["url"] == MENU_URL for item in items) is granted
|
|
File without changes
|
|
File without changes
|
{simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/components/BannerField.tsx
RENAMED
|
File without changes
|
|
File without changes
|
{simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/components/ColorField.tsx
RENAMED
|
File without changes
|
|
File without changes
|
{simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/components/FooterField.tsx
RENAMED
|
File without changes
|
|
File without changes
|
{simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/components/PresetField.tsx
RENAMED
|
File without changes
|
|
File without changes
|
{simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/components/PreviewTabs.tsx
RENAMED
|
File without changes
|
{simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/components/dirty.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/contracts/__init__.py
RENAMED
|
File without changes
|
{simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/contracts/schemas.py
RENAMED
|
File without changes
|
|
File without changes
|
{simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/endpoints/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/endpoints/assets.py
RENAMED
|
File without changes
|
{simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/endpoints/tenant_api.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/pages/api.generated.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/tenant_definitions.py
RENAMED
|
File without changes
|
{simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/tests/test_asset_lifecycle.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/tests/test_branding_reap_ordering.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/tests/test_tenant_branding.py
RENAMED
|
File without changes
|
{simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/tests/test_tenant_branding_assets.py
RENAMED
|
File without changes
|
{simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/tests/test_tenant_branding_cost.py
RENAMED
|
File without changes
|
|
File without changes
|
{simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/tests-js/color-field.test.tsx
RENAMED
|
File without changes
|
{simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/tests-js/dirty-state.test.tsx
RENAMED
|
File without changes
|
|
File without changes
|