Django-SupportTools 3.6.3__tar.gz → 4.0.dev3__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 (81) hide show
  1. django_supporttools-4.0.dev3/Django_SupportTools.egg-info/PKG-INFO +30 -0
  2. {Django-SupportTools-3.6.3 → django_supporttools-4.0.dev3}/Django_SupportTools.egg-info/SOURCES.txt +9 -0
  3. {Django-SupportTools-3.6.3 → django_supporttools-4.0.dev3}/Django_SupportTools.egg-info/requires.txt +1 -1
  4. django_supporttools-4.0.dev3/PKG-INFO +30 -0
  5. django_supporttools-4.0.dev3/README.md +390 -0
  6. {Django-SupportTools-3.6.3 → django_supporttools-4.0.dev3}/setup.py +3 -3
  7. django_supporttools-4.0.dev3/supporttools/VERSION +1 -0
  8. django_supporttools-4.0.dev3/supporttools/context_processors.py +228 -0
  9. django_supporttools-4.0.dev3/supporttools/static/supporttools/css/bootstrap-icons.woff +0 -0
  10. django_supporttools-4.0.dev3/supporttools/static/supporttools/css/bootstrap-icons.woff2 +0 -0
  11. {Django-SupportTools-3.6.3 → django_supporttools-4.0.dev3}/supporttools/static/supporttools/css/desktop.less +37 -23
  12. django_supporttools-4.0.dev3/supporttools/static/supporttools/css/main.css +1 -0
  13. {Django-SupportTools-3.6.3 → django_supporttools-4.0.dev3}/supporttools/static/supporttools/css/mobile.less +5 -0
  14. django_supporttools-4.0.dev3/supporttools/static/supporttools/js/main.js +1 -0
  15. Django-SupportTools-3.6.3/supporttools/static/supporttools/js/main.js → django_supporttools-4.0.dev3/supporttools/static/supporttools/js/restclients.js +29 -62
  16. django_supporttools-4.0.dev3/supporttools/templates/restclients/proxy_wrapper.html +7 -0
  17. {Django-SupportTools-3.6.3 → django_supporttools-4.0.dev3}/supporttools/templates/supporttools/base.html +59 -8
  18. django_supporttools-4.0.dev3/supporttools/templates/supporttools/spa_tool.html +17 -0
  19. {Django-SupportTools-3.6.3 → django_supporttools-4.0.dev3}/supporttools/templatetags/sidebar_links.py +3 -3
  20. django_supporttools-4.0.dev3/supporttools/templatetags/vite.py +99 -0
  21. {Django-SupportTools-3.6.3 → django_supporttools-4.0.dev3}/supporttools/tests/__init__.py +4 -3
  22. django_supporttools-4.0.dev3/supporttools/tests/test_context_processors.py +217 -0
  23. {Django-SupportTools-3.6.3 → django_supporttools-4.0.dev3}/supporttools/tests/test_sidebar_links.py +2 -2
  24. django_supporttools-4.0.dev3/supporttools/tests/test_templatetags_vite.py +165 -0
  25. django_supporttools-4.0.dev3/supporttools/tests/test_urls.py +66 -0
  26. django_supporttools-4.0.dev3/supporttools/tests/test_views.py +114 -0
  27. django_supporttools-4.0.dev3/supporttools/urls.py +66 -0
  28. django_supporttools-4.0.dev3/supporttools/views.py +37 -0
  29. Django-SupportTools-3.6.3/Django_SupportTools.egg-info/PKG-INFO +0 -17
  30. Django-SupportTools-3.6.3/PKG-INFO +0 -17
  31. Django-SupportTools-3.6.3/README.md +0 -50
  32. Django-SupportTools-3.6.3/supporttools/VERSION +0 -1
  33. Django-SupportTools-3.6.3/supporttools/context_processors.py +0 -39
  34. Django-SupportTools-3.6.3/supporttools/templates/restclients/proxy_wrapper.html +0 -2
  35. Django-SupportTools-3.6.3/supporttools/tests/test_context_processors.py +0 -89
  36. Django-SupportTools-3.6.3/supporttools/urls.py +0 -10
  37. Django-SupportTools-3.6.3/supporttools/views.py +0 -9
  38. {Django-SupportTools-3.6.3 → django_supporttools-4.0.dev3}/Django_SupportTools.egg-info/dependency_links.txt +0 -0
  39. {Django-SupportTools-3.6.3 → django_supporttools-4.0.dev3}/Django_SupportTools.egg-info/top_level.txt +0 -0
  40. {Django-SupportTools-3.6.3 → django_supporttools-4.0.dev3}/LICENSE +0 -0
  41. {Django-SupportTools-3.6.3 → django_supporttools-4.0.dev3}/MANIFEST.in +0 -0
  42. {Django-SupportTools-3.6.3 → django_supporttools-4.0.dev3}/setup.cfg +0 -0
  43. {Django-SupportTools-3.6.3 → django_supporttools-4.0.dev3}/supporttools/__init__.py +0 -0
  44. {Django-SupportTools-3.6.3 → django_supporttools-4.0.dev3}/supporttools/static/supporttools/css/.DS_Store +0 -0
  45. {Django-SupportTools-3.6.3 → django_supporttools-4.0.dev3}/supporttools/static/uw/ico/android-196x196.png +0 -0
  46. {Django-SupportTools-3.6.3 → django_supporttools-4.0.dev3}/supporttools/static/uw/ico/apple-touch-icon-114x114-precomposed.png +0 -0
  47. {Django-SupportTools-3.6.3 → django_supporttools-4.0.dev3}/supporttools/static/uw/ico/apple-touch-icon-120x120-precomposed.png +0 -0
  48. {Django-SupportTools-3.6.3 → django_supporttools-4.0.dev3}/supporttools/static/uw/ico/apple-touch-icon-144x144-precomposed.png +0 -0
  49. {Django-SupportTools-3.6.3 → django_supporttools-4.0.dev3}/supporttools/static/uw/ico/apple-touch-icon-152x152-precomposed.png +0 -0
  50. {Django-SupportTools-3.6.3 → django_supporttools-4.0.dev3}/supporttools/static/uw/ico/apple-touch-icon-180x180-precomposed.png +0 -0
  51. {Django-SupportTools-3.6.3 → django_supporttools-4.0.dev3}/supporttools/static/uw/ico/apple-touch-icon-192x192-precomposed.png +0 -0
  52. {Django-SupportTools-3.6.3 → django_supporttools-4.0.dev3}/supporttools/static/uw/ico/apple-touch-icon-57x57-precomposed.png +0 -0
  53. {Django-SupportTools-3.6.3 → django_supporttools-4.0.dev3}/supporttools/static/uw/ico/apple-touch-icon-60x60-precomposed.png +0 -0
  54. {Django-SupportTools-3.6.3 → django_supporttools-4.0.dev3}/supporttools/static/uw/ico/apple-touch-icon-72x72-precomposed.png +0 -0
  55. {Django-SupportTools-3.6.3 → django_supporttools-4.0.dev3}/supporttools/static/uw/ico/apple-touch-icon-76x76-precomposed.png +0 -0
  56. {Django-SupportTools-3.6.3 → django_supporttools-4.0.dev3}/supporttools/static/uw/ico/apple-touch-icon-precomposed.png +0 -0
  57. {Django-SupportTools-3.6.3 → django_supporttools-4.0.dev3}/supporttools/static/uw/ico/favicon.ico +0 -0
  58. {Django-SupportTools-3.6.3 → django_supporttools-4.0.dev3}/supporttools/static/uw/ico/win8-144x144.png +0 -0
  59. {Django-SupportTools-3.6.3 → django_supporttools-4.0.dev3}/supporttools/static/uw/ico/win8-150x150.png +0 -0
  60. {Django-SupportTools-3.6.3 → django_supporttools-4.0.dev3}/supporttools/static/uw/ico/win8-310x150.png +0 -0
  61. {Django-SupportTools-3.6.3 → django_supporttools-4.0.dev3}/supporttools/static/uw/ico/win8-310x310.png +0 -0
  62. {Django-SupportTools-3.6.3 → django_supporttools-4.0.dev3}/supporttools/static/uw/ico/win8-70x70.png +0 -0
  63. {Django-SupportTools-3.6.3 → django_supporttools-4.0.dev3}/supporttools/static/vendor/fonts/FontAwesome.otf +0 -0
  64. {Django-SupportTools-3.6.3 → django_supporttools-4.0.dev3}/supporttools/static/vendor/fonts/fontawesome-webfont.eot +0 -0
  65. {Django-SupportTools-3.6.3 → django_supporttools-4.0.dev3}/supporttools/static/vendor/fonts/fontawesome-webfont.svg +0 -0
  66. {Django-SupportTools-3.6.3 → django_supporttools-4.0.dev3}/supporttools/static/vendor/fonts/fontawesome-webfont.ttf +0 -0
  67. {Django-SupportTools-3.6.3 → django_supporttools-4.0.dev3}/supporttools/static/vendor/fonts/fontawesome-webfont.woff +0 -0
  68. {Django-SupportTools-3.6.3 → django_supporttools-4.0.dev3}/supporttools/static/vendor/fonts/glyphicons-halflings-regular.eot +0 -0
  69. {Django-SupportTools-3.6.3 → django_supporttools-4.0.dev3}/supporttools/static/vendor/fonts/glyphicons-halflings-regular.svg +0 -0
  70. {Django-SupportTools-3.6.3 → django_supporttools-4.0.dev3}/supporttools/static/vendor/fonts/glyphicons-halflings-regular.ttf +0 -0
  71. {Django-SupportTools-3.6.3 → django_supporttools-4.0.dev3}/supporttools/static/vendor/fonts/glyphicons-halflings-regular.woff +0 -0
  72. {Django-SupportTools-3.6.3 → django_supporttools-4.0.dev3}/supporttools/static/vendor/js/chart.min.js +0 -0
  73. {Django-SupportTools-3.6.3 → django_supporttools-4.0.dev3}/supporttools/static/vendor/js/jquery-1.10.2.min.js +0 -0
  74. {Django-SupportTools-3.6.3 → django_supporttools-4.0.dev3}/supporttools/static/vendor/js/less-1.7.0.min.js +0 -0
  75. {Django-SupportTools-3.6.3 → django_supporttools-4.0.dev3}/supporttools/templates/persistent_message/manage_wrapper.html +0 -0
  76. {Django-SupportTools-3.6.3 → django_supporttools-4.0.dev3}/supporttools/templates/status_app/status_wrapper.html +0 -0
  77. {Django-SupportTools-3.6.3 → django_supporttools-4.0.dev3}/supporttools/templates/supporttools/default_sidelinks.html +0 -0
  78. {Django-SupportTools-3.6.3 → django_supporttools-4.0.dev3}/supporttools/templates/supporttools/home.html +0 -0
  79. {Django-SupportTools-3.6.3 → django_supporttools-4.0.dev3}/supporttools/templates/userservice/user_override_wrapper.html +0 -0
  80. {Django-SupportTools-3.6.3 → django_supporttools-4.0.dev3}/supporttools/templatetags/__init__.py +0 -0
  81. {Django-SupportTools-3.6.3 → django_supporttools-4.0.dev3}/supporttools/tests/test_templates/supporttools/custom_sidebar_links.html +0 -0
@@ -0,0 +1,30 @@
1
+ Metadata-Version: 2.4
2
+ Name: Django-SupportTools
3
+ Version: 4.0.dev3
4
+ Summary: A Django application used for theming and wrapping support tools.
5
+ Home-page: https://github.com/uw-it-aca/django-supporttools
6
+ Author: UWIT Student & Educational Technology Services
7
+ Author-email: aca-it@uw.edu
8
+ License: Apache License, Version 2.0
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: License :: OSI Approved :: Apache Software License
11
+ Classifier: Operating System :: OS Independent
12
+ Classifier: Programming Language :: Python
13
+ License-File: LICENSE
14
+ Requires-Dist: django<6,>3.2
15
+ Requires-Dist: django-userservice
16
+ Requires-Dist: django-user-agents
17
+ Requires-Dist: mock
18
+ Dynamic: author
19
+ Dynamic: author-email
20
+ Dynamic: classifier
21
+ Dynamic: description
22
+ Dynamic: home-page
23
+ Dynamic: license
24
+ Dynamic: license-file
25
+ Dynamic: requires-dist
26
+ Dynamic: summary
27
+
28
+
29
+ See the README on `GitHub
30
+ <https://github.com/uw-it-aca/django-supporttools>`_.
@@ -13,9 +13,13 @@ supporttools/context_processors.py
13
13
  supporttools/urls.py
14
14
  supporttools/views.py
15
15
  supporttools/static/supporttools/css/.DS_Store
16
+ supporttools/static/supporttools/css/bootstrap-icons.woff
17
+ supporttools/static/supporttools/css/bootstrap-icons.woff2
16
18
  supporttools/static/supporttools/css/desktop.less
19
+ supporttools/static/supporttools/css/main.css
17
20
  supporttools/static/supporttools/css/mobile.less
18
21
  supporttools/static/supporttools/js/main.js
22
+ supporttools/static/supporttools/js/restclients.js
19
23
  supporttools/static/uw/ico/android-196x196.png
20
24
  supporttools/static/uw/ico/apple-touch-icon-114x114-precomposed.png
21
25
  supporttools/static/uw/ico/apple-touch-icon-120x120-precomposed.png
@@ -52,10 +56,15 @@ supporttools/templates/status_app/status_wrapper.html
52
56
  supporttools/templates/supporttools/base.html
53
57
  supporttools/templates/supporttools/default_sidelinks.html
54
58
  supporttools/templates/supporttools/home.html
59
+ supporttools/templates/supporttools/spa_tool.html
55
60
  supporttools/templates/userservice/user_override_wrapper.html
56
61
  supporttools/templatetags/__init__.py
57
62
  supporttools/templatetags/sidebar_links.py
63
+ supporttools/templatetags/vite.py
58
64
  supporttools/tests/__init__.py
59
65
  supporttools/tests/test_context_processors.py
60
66
  supporttools/tests/test_sidebar_links.py
67
+ supporttools/tests/test_templatetags_vite.py
68
+ supporttools/tests/test_urls.py
69
+ supporttools/tests/test_views.py
61
70
  supporttools/tests/test_templates/supporttools/custom_sidebar_links.html
@@ -1,4 +1,4 @@
1
- Django<5,>3.2
1
+ django<6,>3.2
2
2
  django-userservice
3
3
  django-user-agents
4
4
  mock
@@ -0,0 +1,30 @@
1
+ Metadata-Version: 2.4
2
+ Name: Django-SupportTools
3
+ Version: 4.0.dev3
4
+ Summary: A Django application used for theming and wrapping support tools.
5
+ Home-page: https://github.com/uw-it-aca/django-supporttools
6
+ Author: UWIT Student & Educational Technology Services
7
+ Author-email: aca-it@uw.edu
8
+ License: Apache License, Version 2.0
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: License :: OSI Approved :: Apache Software License
11
+ Classifier: Operating System :: OS Independent
12
+ Classifier: Programming Language :: Python
13
+ License-File: LICENSE
14
+ Requires-Dist: django<6,>3.2
15
+ Requires-Dist: django-userservice
16
+ Requires-Dist: django-user-agents
17
+ Requires-Dist: mock
18
+ Dynamic: author
19
+ Dynamic: author-email
20
+ Dynamic: classifier
21
+ Dynamic: description
22
+ Dynamic: home-page
23
+ Dynamic: license
24
+ Dynamic: license-file
25
+ Dynamic: requires-dist
26
+ Dynamic: summary
27
+
28
+
29
+ See the README on `GitHub
30
+ <https://github.com/uw-it-aca/django-supporttools>`_.
@@ -0,0 +1,390 @@
1
+ # Django Support Tools
2
+
3
+ [![Build Status](https://github.com/uw-it-aca/django-supporttools/workflows/tests/badge.svg)](https://github.com/uw-it-aca/django-supporttools/actions)
4
+ [![Coverage Status](https://coveralls.io/repos/github/uw-it-aca/django-supporttools/badge.svg?branch=main)](https://coveralls.io/github/uw-it-aca/django-supporttools?branch=main)
5
+ [![PyPi Version](https://img.shields.io/pypi/v/django-supporttools.svg)](https://pypi.python.org/pypi/django-supporttools)
6
+ ![Python versions](https://img.shields.io/badge/python-3.10%20%7C%203.12-blue.svg)
7
+ ![Django versions](https://img.shields.io/badge/django-4.2%20%7C%205.2-green.svg)
8
+
9
+
10
+ A Django application used for theming and wrapping support tools.
11
+
12
+ Supported Python versions are 3.10 and 3.12. CI tests each against Django 4.2
13
+ and 5.2.
14
+
15
+ ### Installation
16
+
17
+ This should be installed as a dependency in your project. You should not install this manually.
18
+
19
+ ### Configuration
20
+
21
+ Add these values to your project's settings.py:
22
+
23
+ ```
24
+ MIDDLEWARE = [
25
+ ...
26
+ 'userservice.user.UserServiceMiddleware',
27
+ 'django_user_agents.middleware.UserAgentMiddleware',
28
+ ]
29
+
30
+ INSTALLED_APPS = [
31
+ ...
32
+ 'supporttools',
33
+ 'userservice',
34
+ 'compressor',
35
+ 'django_user_agents',
36
+ ]
37
+
38
+ TEMPLATES = [
39
+ {
40
+ 'OPTIONS': {
41
+ 'context_processors': [
42
+ ...
43
+ 'django.template.context_processors.request',
44
+ 'supporttools.context_processors.supportools_globals',
45
+ 'supporttools.context_processors.has_less_compiled',
46
+ ],
47
+ },
48
+ },
49
+ ]
50
+
51
+ # Where the back link should go, and how it's labeled.
52
+ SUPPORTTOOLS_PARENT_APP = "TestApp"
53
+ SUPPORTTOOLS_PARENT_APP_URL = "/"
54
+
55
+ # Optional: enable Vue-powered supporttools navigation shell.
56
+ # Keep False during migration to preserve legacy behavior.
57
+ SUPPORTTOOLS_VUE_ENABLED = False
58
+
59
+ # Required when this app defines SPA tools with a `vite_entry`.
60
+ # This is a filesystem path to the manifest generated by the app's Vite build,
61
+ # not a static URL. Update it for the collected-static location in production.
62
+ VITE_MANIFEST_PATH = BASE_DIR / 'myapp/static/.vite/manifest.json'
63
+
64
+ # Optional: new structured link registry (preferred over EXTRA_VIEWS
65
+ # when configured).
66
+ # Example A — simple server-rendered tool:
67
+ SUPPORTTOOLS_VIEW_REGISTRY = [
68
+ {
69
+ "id": "app-tool-1",
70
+ "section": "application",
71
+ "order": 10,
72
+ "label": "Example Tool",
73
+ "url_name": "example_tool",
74
+ "url_args": [],
75
+ "url_kwargs": {},
76
+ }
77
+ ]
78
+
79
+ # Example B — SPA tool (use one definition, not both):
80
+ # Optional: mixed navigation support for incremental migration.
81
+ # Legacy tools can stay server-rendered; converted Vue tools are SPA-only.
82
+ # mode defaults to "server" only for legacy entries.
83
+ # Entries with SPA marker fields (route/component_key/vite_entry)
84
+ # are treated as "spa" even if mode is omitted.
85
+ #
86
+ # SPA-mode fields:
87
+ # route – URL path the component is served at (must match a Django URL pattern)
88
+ # component_key – key used to look up the component in window.supporttoolsSpaComponents
89
+ # vite_entry – Vite asset path; passed to {% vite_scripts %} in the generic SPA template
90
+ # view – dotted import path to the Django view class (required unless SUPPORTTOOLS_DEFAULT_SPA_VIEW is set)
91
+ SUPPORTTOOLS_VIEW_REGISTRY = [
92
+ {
93
+ "id": "retention-admin",
94
+ "section": "application",
95
+ "order": 20,
96
+ "label": "Retention Admin",
97
+ "url_name": "retention_admin",
98
+ "mode": "spa",
99
+ "route": "/support/retention_admin/",
100
+ "component_key": "retention_admin",
101
+ "vite_entry": "myapp_vue/support/retention-admin.js",
102
+ "view": "myapp.views.support.retention.RetentionAdminView", # omit to use the default SPA view
103
+ }
104
+ ]
105
+
106
+ # Optional: default view class for auto-registered SPA tools.
107
+ # Used when a registry entry omits the "view" key.
108
+ # Typically a project-specific subclass of SpaToolView that adds authentication.
109
+ SUPPORTTOOLS_DEFAULT_SPA_VIEW = "myapp.views.support.base.MySpaToolView"
110
+ ```
111
+
112
+ ### Migrating to Vue
113
+
114
+ Apps can migrate incrementally across four phases. Each phase is independently
115
+ testable and reversible before moving to the next.
116
+
117
+ | Phase | What changes | Minimum required |
118
+ |---|---|---|
119
+ | 0 | Nothing — existing server-rendered nav keeps working | No changes required |
120
+ | 1 | Enable the Vue nav shell | One settings flag: `SUPPORTTOOLS_VUE_ENABLED = True` |
121
+ | 2 | Register tools explicitly | Add entries to `SUPPORTTOOLS_VIEW_REGISTRY` (or keep using `SUPPORTTOOLS_EXTRA_VIEWS`) |
122
+ | 3 | Set up shared SPA infrastructure | One base view class, one settings entry, one `urls.py` line, one Vite config snippet |
123
+ | 4 | Convert individual pages to Vue | One registry entry + one JS entry point + one Vue component per tool |
124
+
125
+ Phases 0–2 require no Node.js and no frontend changes. Phase 3 is a
126
+ one-time project setup. Phase 4 is per-tool and fully incremental — legacy
127
+ tools can remain server-rendered indefinitely.
128
+
129
+ ---
130
+
131
+ #### Phase 1 — Enable the Vue nav shell (zero-config)
132
+
133
+ Set the feature flag in your settings file:
134
+
135
+ ```python
136
+ SUPPORTTOOLS_VUE_ENABLED = True
137
+ ```
138
+
139
+ That is the only required change. When the flag is on, the Vue nav shell
140
+ mounts on `#supporttools-vue-nav` and automatically harvests links from the
141
+ server-rendered `{% sidebar_links %}` output already present in the DOM — so
142
+ your existing `custom_sidebar_links.html` override (if any) keeps its section
143
+ headings, link labels, ordering, and visibility rules with no changes.
144
+ Enabling the shell does not convert any tool page; tools remain server-rendered
145
+ until they are configured as SPA entries in Phase 4.
146
+
147
+ **Verify**: the sidebar renders the same links as before, the hamburger toggle
148
+ works on mobile viewports, and there are no JS errors in the browser console.
149
+
150
+ ---
151
+
152
+ #### Phase 2 — Register your tools explicitly (optional but recommended)
153
+
154
+ The rendered sidebar remains the presentation source of truth while an app is
155
+ migrating. Registering tools in settings adds navigation behavior such as SPA
156
+ routing; explicit registry entries that are not in the rendered sidebar are
157
+ also appended, so tools can be converted incrementally.
158
+
159
+ **Option A — simple dict (lowest friction first step):**
160
+
161
+ ```python
162
+ # settings.py
163
+ SUPPORTTOOLS_EXTRA_VIEWS = {
164
+ "My Tool": "my_tool_url_name",
165
+ "Another Tool": "another_tool_url_name",
166
+ }
167
+ ```
168
+
169
+ **Option B — structured registry (preferred for new work):**
170
+
171
+ ```python
172
+ # settings.py
173
+ SUPPORTTOOLS_VIEW_REGISTRY = [
174
+ {
175
+ "id": "my-tool",
176
+ "section": "application",
177
+ "order": 10,
178
+ "label": "My Tool",
179
+ "url_name": "my_tool_url_name",
180
+ },
181
+ {
182
+ "id": "another-tool",
183
+ "section": "application",
184
+ "order": 20,
185
+ "label": "Another Tool",
186
+ "url_name": "another_tool_url_name",
187
+ },
188
+ ]
189
+ ```
190
+
191
+ When `SUPPORTTOOLS_VIEW_REGISTRY` is set it takes precedence; entries from
192
+ `SUPPORTTOOLS_EXTRA_VIEWS` are merged in as a supplement. Once your tools are
193
+ registered here, a simple `custom_sidebar_links.html` override can be removed.
194
+ Keep an override that supplies custom sections, conditional links, or required
195
+ ordering until the rendered Vue navigation has been verified to preserve those
196
+ requirements.
197
+
198
+ ---
199
+
200
+ #### Phase 3 — Set up shared SPA infrastructure (once per project)
201
+
202
+ Complete this once before converting any individual tool in Phase 4.
203
+
204
+ **1. Create a project-level SPA view base** that adds your auth decorator:
205
+
206
+ ```python
207
+ # myapp/views/support/base.py
208
+ from django.conf import settings
209
+ from django.utils.decorators import method_decorator
210
+ from uw_saml.decorators import group_required
211
+ from supporttools.views import SpaToolView
212
+
213
+ @method_decorator(group_required(settings.MY_SUPPORT_GROUP), name='dispatch')
214
+ class MySpaToolView(SpaToolView):
215
+ pass
216
+ ```
217
+
218
+ **2. Add the default view and register SPA URLs**:
219
+
220
+ ```python
221
+ # settings.py
222
+ SUPPORTTOOLS_DEFAULT_SPA_VIEW = "myapp.views.support.base.MySpaToolView"
223
+ ```
224
+
225
+ If your project does not already include `supporttools.urls`, append generated
226
+ SPA routes after your application routes:
227
+
228
+ ```python
229
+ # project/urls.py
230
+ from supporttools.urls import get_registry_urlpatterns
231
+
232
+ urlpatterns += get_registry_urlpatterns()
233
+ ```
234
+
235
+ Do not add a root-level `include("supporttools.urls")` solely to enable SPA
236
+ routes: its legacy home route is a catch-all. Alternatively, keep an existing
237
+ project URL and change that URL's view to your authenticated SPA view. In either
238
+ case, each registry `route` must resolve to the URL served by that view.
239
+
240
+ **3. Auto-discover Vite entry points** by editing your existing `vite.config.js`
241
+ so new tools are picked up automatically:
242
+
243
+ Add/merge the snippet below into your current Vite config. Do not replace the
244
+ entire file.
245
+
246
+ ```javascript
247
+ // vite.config.js
248
+ import { readdirSync } from "fs";
249
+
250
+ const supportEntries = readdirSync("./myapp_vue/support")
251
+ .filter((f) => f.endsWith(".js"))
252
+ .map((f) => `./myapp_vue/support/${f}`);
253
+
254
+ export default defineConfig({
255
+ build: {
256
+ manifest: true,
257
+ rollupOptions: {
258
+ input: ["./myapp_vue/main.js", ...supportEntries],
259
+ },
260
+ },
261
+ });
262
+ ```
263
+
264
+ Each `vite_entry` must be an input in this app-owned Vite build. Build the
265
+ assets with `npm run build` before `collectstatic`, and configure
266
+ `VITE_MANIFEST_PATH` to the generated manifest's filesystem path. The generic
267
+ SPA template loads both the entry's JavaScript and its manifest-listed CSS.
268
+
269
+ ---
270
+
271
+ #### Phase 4 — Convert individual pages to Vue
272
+
273
+ Each page can be converted independently without affecting other tools.
274
+ Legacy tools can remain server-rendered while converted tools use SPA nav.
275
+
276
+ - `mode: "server"` (default for legacy entries): normal full-page navigation.
277
+ - `mode: "spa"`: client-side navigation — no full-page reload when the sidebar
278
+ link is clicked.
279
+ - Converted Vue tools are SPA-only. If `route`, `component_key`, or
280
+ `vite_entry` is present, the entry is normalized to `mode: "spa"`.
281
+
282
+ Data access is owned by the tool component. A tool can pre-load data from
283
+ the server on direct URL navigation, and fetch from API endpoints when
284
+ mounted via SPA navigation. This direct-URL bootstrap uses the SPA view
285
+ template; it is not a fallback to server-navigation mode.
286
+
287
+ ---
288
+
289
+ ##### Adding a new SPA tool
290
+
291
+ **1. Register the tool in `SUPPORTTOOLS_VIEW_REGISTRY`**
292
+
293
+ ```python
294
+ {
295
+ "id": "my-tool",
296
+ "section": "application",
297
+ "order": 10,
298
+ "label": "My Tool",
299
+ "url_name": "my_tool",
300
+ "mode": "spa",
301
+ "route": "/support/my_tool/",
302
+ "component_key": "my_tool",
303
+ "vite_entry": "myapp_vue/support/my-tool.js",
304
+ # "view": "myapp.views.support.my_tool.MyToolView" # only needed for custom server data
305
+ }
306
+ ```
307
+
308
+ The URL is registered by the Phase 3 URL handoff. No additional `urls.py` edit
309
+ is needed for this tool.
310
+
311
+ **2. Create the Vue entry point** (the entire file):
312
+
313
+ ```javascript
314
+ // myapp_vue/support/my-tool.js
315
+ window.supporttoolsRegisterSpaTool("my_tool", () => import("./MyTool.vue"));
316
+ ```
317
+
318
+ `window.supporttoolsRegisterSpaTool` is provided by the supporttools bundle
319
+ already loaded in `base.html`. It handles both SPA-nav mounting (via the
320
+ sidebar) and direct-URL mounting (via server-rendered JSON). No imports needed.
321
+
322
+ **3. Create the Vue component**
323
+
324
+ The component receives a `pageData` prop on direct-URL load (populated from
325
+ server-rendered JSON), and a `tool` prop when mounted via SPA navigation:
326
+
327
+ ```vue
328
+ <template>
329
+ <div>
330
+ <h1>My Tool</h1>
331
+ <!-- your UI -->
332
+ </div>
333
+ </template>
334
+
335
+ <script>
336
+ export default {
337
+ name: "MyTool",
338
+ props: {
339
+ pageData: { type: Object, default: () => ({}) },
340
+ tool: { type: Object, default: null },
341
+ },
342
+ async mounted() {
343
+ // When mounted via SPA nav, pageData is empty — fetch fresh data from API.
344
+ if (this.tool && this.tool.mode === "spa") {
345
+ await this.loadData();
346
+ }
347
+ },
348
+ methods: {
349
+ async loadData() { /* fetch from your API endpoint */ },
350
+ },
351
+ };
352
+ </script>
353
+ ```
354
+
355
+ **That's all that's needed for a tool with no server-side bootstrap data.**
356
+
357
+ ---
358
+
359
+ ##### Adding server-side bootstrap data (optional)
360
+
361
+ If the tool needs data pre-loaded on direct URL navigation, create a
362
+ Django view that inherits from your project's SPA view base and overrides
363
+ `get_page_data()`. The data is serialised to JSON and passed as the
364
+ `pageData` prop automatically by the generic `spa_tool.html` template.
365
+
366
+ ```python
367
+ # myapp/views/support/my_tool.py
368
+ from myapp.views.support.base import MySpaToolView
369
+
370
+ class MyToolView(MySpaToolView):
371
+ def get_page_data(self):
372
+ return {
373
+ 'items': [
374
+ {'id': obj.id, 'name': obj.name}
375
+ for obj in MyModel.objects.all()
376
+ ]
377
+ }
378
+ ```
379
+
380
+ Then add `"view": "myapp.views.support.my_tool.MyToolView"` to the registry
381
+ entry. No template file needed — `spa_tool.html` is used automatically.
382
+
383
+ ---
384
+
385
+ #### CI/CD note
386
+
387
+ The compiled bundle at `supporttools/static/supporttools/js/main.js` is built
388
+ at publish time by CI and distributed inside the PyPI wheel. Consuming apps do
389
+ not need Node.js. See `.github/workflows/cicd.yml` for the build step in the
390
+ `publish` job.
@@ -18,18 +18,18 @@ setup(
18
18
  name='Django-SupportTools',
19
19
  version=VERSION,
20
20
  packages=['supporttools'],
21
- author="UW-IT T&LS",
21
+ author="UWIT Student & Educational Technology Services",
22
22
  author_email="aca-it@uw.edu",
23
23
  include_package_data=True,
24
24
  install_requires=[
25
- 'Django>3.2,<5',
25
+ 'django>3.2,<6',
26
26
  'django-userservice',
27
27
  'django-user-agents',
28
28
  'mock',
29
29
  ],
30
30
  license='Apache License, Version 2.0',
31
31
  description=('A Django application used for theming and wrapping '
32
- 'T&LS support tools.'),
32
+ 'support tools.'),
33
33
  long_description=README,
34
34
  url=url,
35
35
  classifiers=[
@@ -0,0 +1 @@
1
+ 4.0dev3