-
Type: Improvement
-
Status: Open
-
Priority: Minor
-
Resolution: Unresolved
-
Affects Version/s: 10.10
-
Fix Version/s: QualifiedToSchedule
-
Component/s: Web UI
Currently, the setting of the theme in the Web UI is quite static, to make it configurable based on e.g. the user's context, some JS code is needed:
<script> const app = document.querySelector('nuxeo-app'); function customThemeLogics() { const setTheme = (theme) => { if (localStorage.getItem('theme') !== theme) { localStorage.setItem('theme', theme); location.reload(); } } const groups = app.currentUser.extendedGroups; if (groups.find((group) => group.name === 'administrators')) { setTheme('kawaii'); } else { setTheme('default'); } } if (app.currentUser) { customThemeLogics(); } app.$.nxcon.addEventListener('user-changed', customThemeLogics); </script>
Make it easier to configure.