Add onboarding weather and template gradients
Publish Docker Image / build-and-push-existing-registry (./build/Dockerfile, web, pulse-signage-web) (push) Successful in 1m53s
Publish Docker Image / build-and-push-existing-registry (./build/Dockerfile.player, player, pulse-signage-player) (push) Successful in 34s

This commit is contained in:
2026-08-28 20:05:23 +01:00
parent aa07a78912
commit 3960931ebe
80 changed files with 12750 additions and 519 deletions
+20 -1
View File
@@ -6,7 +6,8 @@ require('../src/common');
const {
buildTemplatePayload,
extractTemplateRegions
extractTemplateRegions,
normalizeBackgroundGradient
} = require('../src/data/templates');
const renderTemplateAddPage = require('../src/web/routes/signage/templates/add');
const renderTemplateEditPage = require('../src/web/routes/signage/templates/edit');
@@ -81,6 +82,7 @@ test('buildTemplatePayload resolves canvas size and rejects duplicate region nam
canvasSizeHeight: 720,
backgroundImagePath: null,
backgroundColor: '#111111',
backgroundGradient: null,
regions: [{
region_key: 'Header',
region_type: 'text',
@@ -229,4 +231,21 @@ test('template designer warns when invalid region names block save', () => {
assert.ok(script.includes("templateForm.addEventListener('invalid'"));
assert.ok(script.includes('function notifyRegionNameValidationError(message)'));
assert.ok(script.includes('regionNameValidationToastShown = false;'));
});
test('normalizeBackgroundGradient accepts linear colors and clamps the angle', () => {
assert.equal(normalizeBackgroundGradient(JSON.stringify({
type: 'radial',
colors: ['#123456', '#abcdef', '#fedcba'],
angle: 400
})), JSON.stringify({
type: 'linear',
stops: [
{ color: '#123456', position: 0 },
{ color: '#abcdef', position: 50 },
{ color: '#fedcba', position: 100 }
],
angle: 360
}));
assert.equal(normalizeBackgroundGradient('{}'), null);
});