domma-cms 1.4.0 → 1.5.0
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.
- package/admin/css/admin.css +1 -1
- package/admin/js/app.js +2 -2
- package/admin/js/lib/dashboards-arrange.js +3 -0
- package/admin/js/lib/dashboards-strip.js +1 -0
- package/admin/js/lib/sidebar-renderer.js +1 -1
- package/admin/js/templates/dashboards.html +2 -0
- package/admin/js/templates/docs/usage-dashboard.html +16 -12
- package/admin/js/views/dashboard-board.js +18 -19
- package/admin/js/views/dashboard.js +2 -2
- package/admin/js/views/dashboards.js +1 -0
- package/admin/js/views/index.js +1 -1
- package/package.json +1 -1
- package/plugins/_lib/admin/mail/compose-window.js +23 -2
- package/plugins/_lib/admin/mail/keyboard.js +14 -0
- package/plugins/_lib/admin/mail/scheduling.js +22 -0
- package/server/routes/api/auth.js +2 -2
- package/server/routes/api/sidebar.js +17 -6
- package/server/services/dashboardSettings.js +8 -4
- package/server/services/widgets.js +5 -11
- package/admin/js/templates/my-dashboard.html +0 -3
- package/admin/js/views/my-dashboard.js +0 -1
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
* @module services/widgets
|
|
33
33
|
*/
|
|
34
34
|
|
|
35
|
-
import {getRegisteredSidebarItems
|
|
35
|
+
import {getRegisteredSidebarItems} from './hooks.js';
|
|
36
36
|
|
|
37
37
|
/** Widths on the board's four-column grid. */
|
|
38
38
|
export const WIDGET_SIZES = ['s', 'm', 'l', 'xl'];
|
|
@@ -226,7 +226,6 @@ export function layoutProblems(input) {
|
|
|
226
226
|
// ---------------------------------------------------------------------------
|
|
227
227
|
|
|
228
228
|
const owners = new Set();
|
|
229
|
-
let sidebarRegistered = false;
|
|
230
229
|
|
|
231
230
|
/**
|
|
232
231
|
* A Pro Tool switches the board on (plugins.js hands it to each plugin as
|
|
@@ -239,14 +238,8 @@ let sidebarRegistered = false;
|
|
|
239
238
|
export function enableDashboardPro({owner, tier, closedSource} = {}) {
|
|
240
239
|
if (typeof owner !== 'string' || !owner.trim()) return false;
|
|
241
240
|
if (tier !== 'paid' || closedSource !== true) return false;
|
|
242
|
-
//
|
|
243
|
-
//
|
|
244
|
-
if (!sidebarRegistered) {
|
|
245
|
-
sidebarRegistered = true;
|
|
246
|
-
try {
|
|
247
|
-
registerSidebarItem({folder: 'overview', item: {source: 'Dashboard Pro', text: 'My Dashboard', url: '#/my-dashboard', icon: 'layout'}});
|
|
248
|
-
} catch { /* a sidebar without folders still has the route */ }
|
|
249
|
-
}
|
|
241
|
+
// No sidebar entry of its own: the Dashboard entry becomes Dashboards (routes/api/sidebar.js),
|
|
242
|
+
// whose first tab is the primary Dashboard and the rest the boards (admin lib/dashboards-arrange.js).
|
|
250
243
|
owners.add(owner.trim());
|
|
251
244
|
return true;
|
|
252
245
|
}
|
|
@@ -274,7 +267,8 @@ export function _resetWidgetsForTests() {
|
|
|
274
267
|
|
|
275
268
|
export const MAX_BOARDS = 12;
|
|
276
269
|
export const BOARD_NAME_MAX = 40;
|
|
277
|
-
|
|
270
|
+
// `overview` is the primary Dashboard's tab (admin lib/dashboards-arrange.js), never a board.
|
|
271
|
+
const BOARD_ID_RE = /^(?!overview$)[a-z0-9][a-z0-9-]{0,39}$/;
|
|
278
272
|
|
|
279
273
|
const boardName = (v, fallback) => String(v ?? '').replace(/[\u0000-\u001f<>]/g, '').replace(/\s+/g, ' ').trim().slice(0, BOARD_NAME_MAX) || fallback;
|
|
280
274
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{apiRequest as r}from"../api.js";import{viewLifetime as m}from"../lib/tool-kit.js";const o=/^#\/my-dashboard\/?(\?.*)?$/,a=m(o);export const myDashboardView={templateUrl:"/admin/js/templates/my-dashboard.html",async onMount(t){a.reset();const e=await r("/dashboard/pro",{method:"GET"}).catch(()=>null);if(!o.test(location.hash))return;const i=t.get(0).querySelector(".dbx")||t.get(0);if(!e?.enabled){i.innerHTML='<p class="dbp-empty">My Dashboard comes with Dashboard Pro, which is not switched on for this site. Find it in the Marketplace.</p>';return}const{mountBoard:s}=await import("./dashboard-board.js");await s(t,a,{isAdmin:e.isAdmin===!0})}};
|