Add onboarding weather and template gradients
This commit is contained in:
@@ -32,6 +32,21 @@ module.exports = function registerClientsRoutes(app, deps) {
|
||||
return compareSortValues(getComparableSortValue(leftValue), getComparableSortValue(rightValue));
|
||||
}
|
||||
|
||||
function compareClientNames(leftValue, rightValue) {
|
||||
const leftName = String(leftValue || '').trim();
|
||||
const rightName = String(rightValue || '').trim();
|
||||
if (!leftName && !rightName) {
|
||||
return 0;
|
||||
}
|
||||
if (!leftName) {
|
||||
return 1;
|
||||
}
|
||||
if (!rightName) {
|
||||
return -1;
|
||||
}
|
||||
return leftName.localeCompare(rightName, undefined, { sensitivity: 'base', numeric: true });
|
||||
}
|
||||
|
||||
const sortKeys = accessors[normalizedSortKey]
|
||||
? [normalizedSortKey]
|
||||
: ['client'];
|
||||
@@ -39,7 +54,9 @@ module.exports = function registerClientsRoutes(app, deps) {
|
||||
return (Array.isArray(clients) ? clients.slice() : []).sort(function (leftClient, rightClient) {
|
||||
for (let index = 0; index < sortKeys.length; index += 1) {
|
||||
const sortKeyName = sortKeys[index];
|
||||
const comparison = compareValues(accessors[sortKeyName](leftClient), accessors[sortKeyName](rightClient));
|
||||
const comparison = sortKeyName === 'client'
|
||||
? compareClientNames(accessors[sortKeyName](leftClient), accessors[sortKeyName](rightClient))
|
||||
: compareValues(accessors[sortKeyName](leftClient), accessors[sortKeyName](rightClient));
|
||||
|
||||
if (comparison !== 0) {
|
||||
return index === 0 && normalizedDirection === 'desc' ? comparison * -1 : comparison;
|
||||
|
||||
@@ -2,17 +2,7 @@
|
||||
|
||||
const { renderView } = require('../../../view');
|
||||
|
||||
function normalizeBaseUrl(value) {
|
||||
return String(value || '').trim().replace(/\/$/, '');
|
||||
}
|
||||
|
||||
module.exports = function renderDashboardPage(data, message, currentUser) {
|
||||
const primaryPlayerUrl = Array.isArray(data.screens)
|
||||
? String((data.screens.find(function (screen) {
|
||||
return screen && String(screen.public_base_url || '').trim();
|
||||
}) || {}).public_base_url || '').trim()
|
||||
: '';
|
||||
|
||||
return renderView('dashboard/index', {
|
||||
title: 'Dashboard',
|
||||
active: 'dashboard',
|
||||
@@ -25,7 +15,6 @@ module.exports = function renderDashboardPage(data, message, currentUser) {
|
||||
slides: data.slides || [],
|
||||
connectedClientsCount: Number(data.connectedClientsCount || 0),
|
||||
connectedPlayersCount: Number(data.connectedPlayersCount || data.connectedClientsCount || 0),
|
||||
primaryPlayerUrl: normalizeBaseUrl(primaryPlayerUrl) || null,
|
||||
scripts: ['js/dashboard/dashboard-page.js']
|
||||
});
|
||||
};
|
||||
|
||||
@@ -26,6 +26,7 @@ function buildDuplicateTemplate(template, duplicateName) {
|
||||
canvas_size_height: source.canvas_size_height,
|
||||
background_color: source.background_color,
|
||||
background_image_path: source.background_image_path,
|
||||
background_gradient: source.background_gradient,
|
||||
region_usage: [],
|
||||
regions: Array.isArray(source.regions) ? source.regions.map(cloneRegion) : []
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user