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.
Files changed (66) hide show
  1. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/.gitignore +3 -0
  2. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/PKG-INFO +6 -6
  3. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/module.py +1 -1
  4. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/shared_props.py +3 -1
  5. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/package.json +5 -6
  6. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/pyproject.toml +6 -6
  7. simple_module_branding-0.0.43/tests/test_branding_menu_permission.py +17 -0
  8. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/README.md +0 -0
  9. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/__init__.py +0 -0
  10. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/components/BannerField.tsx +0 -0
  11. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/components/BrandingPreview.tsx +0 -0
  12. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/components/ColorField.tsx +0 -0
  13. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/components/DesignPackField.tsx +0 -0
  14. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/components/FooterField.tsx +0 -0
  15. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/components/ImageDropzones.tsx +0 -0
  16. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/components/PresetField.tsx +0 -0
  17. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/components/PreviewSurfaces.tsx +0 -0
  18. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/components/PreviewTabs.tsx +0 -0
  19. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/components/dirty.ts +0 -0
  20. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/components/hex.ts +0 -0
  21. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/constants.py +0 -0
  22. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/contracts/__init__.py +0 -0
  23. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/contracts/schemas.py +0 -0
  24. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/deps.py +0 -0
  25. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/endpoints/__init__.py +0 -0
  26. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/endpoints/api.py +0 -0
  27. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/endpoints/assets.py +0 -0
  28. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/endpoints/tenant_api.py +0 -0
  29. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/endpoints/views.py +0 -0
  30. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/images.py +0 -0
  31. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/locales/de.json +0 -0
  32. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/locales/en.json +0 -0
  33. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/pages/Manage.tsx +0 -0
  34. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/pages/api.generated.ts +0 -0
  35. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/pages/api.ts +0 -0
  36. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/presets.py +0 -0
  37. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/py.typed +0 -0
  38. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/reaper.py +0 -0
  39. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/service.py +0 -0
  40. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/services.py +0 -0
  41. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/settings.py +0 -0
  42. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/tenant_branding.py +0 -0
  43. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/branding/tenant_definitions.py +0 -0
  44. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/tests/test_asset_lifecycle.py +0 -0
  45. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/tests/test_banner.py +0 -0
  46. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/tests/test_branding.py +0 -0
  47. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/tests/test_branding_clear_route_scope.py +0 -0
  48. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/tests/test_branding_platform_files.py +0 -0
  49. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/tests/test_branding_reap.py +0 -0
  50. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/tests/test_branding_reap_ordering.py +0 -0
  51. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/tests/test_design_pack.py +0 -0
  52. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/tests/test_footer_links.py +0 -0
  53. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/tests/test_footer_text.py +0 -0
  54. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/tests/test_images.py +0 -0
  55. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/tests/test_logo_dark.py +0 -0
  56. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/tests/test_menu_section.py +0 -0
  57. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/tests/test_presets.py +0 -0
  58. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/tests/test_public_assets.py +0 -0
  59. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/tests/test_ship_review.py +0 -0
  60. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/tests/test_tenant_branding.py +0 -0
  61. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/tests/test_tenant_branding_assets.py +0 -0
  62. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/tests/test_tenant_branding_cost.py +0 -0
  63. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/tests-js/branding_ManageSave.test.tsx +0 -0
  64. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/tests-js/color-field.test.tsx +0 -0
  65. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/tests-js/dirty-state.test.tsx +0 -0
  66. {simple_module_branding-0.0.41 → simple_module_branding-0.0.43}/tsconfig.json +0 -0
@@ -22,6 +22,9 @@ node_modules/
22
22
 
23
23
  # Database
24
24
  *.db
25
+ *.db-wal
26
+ *.db-shm
27
+ *.db-journal
25
28
  *.sqlite3
26
29
 
27
30
  # Module-managed runtime state (e.g. uploaded dataset files,
@@ -1,17 +1,17 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: simple_module_branding
3
- Version: 0.0.41
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.41
11
- Requires-Dist: simple-module-db==0.0.41
12
- Requires-Dist: simple-module-file-storage==0.0.41
13
- Requires-Dist: simple-module-hosting==0.0.41
14
- Requires-Dist: simple-module-settings==0.0.41
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
@@ -92,7 +92,7 @@ class BrandingModule(ModuleBase):
92
92
  section=MenuSection.ADMIN_SIDEBAR,
93
93
  group="Appearance",
94
94
  group_key="ui.nav_groups.appearance",
95
- roles=["admin"],
95
+ permissions=[constants.PERM_VIEW],
96
96
  )
97
97
  )
98
98
 
@@ -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.get("x-inertia"):
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.41",
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.0.0",
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.41"
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.41",
12
- "simple_module_db==0.0.41",
13
- "simple_module_hosting==0.0.41",
14
- "simple_module_settings==0.0.41",
15
- "simple_module_file_storage==0.0.41",
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