diff --git a/V2/app/core/schemas/org.js b/V2/app/core/schemas/org.js index 408e6aa..eca0d34 100644 --- a/V2/app/core/schemas/org.js +++ b/V2/app/core/schemas/org.js @@ -18,6 +18,20 @@ const updateBranding = z.object({ workColor: hexColor.optional(), restColor: hexColor.optional(), moveColor: hexColor.optional(), + btnPrimaryBg: hexColor.optional(), + btnSecondaryBg: hexColor.optional(), + pageBg: hexColor.optional(), + popupBg: hexColor.optional(), + overlayColor: hexColor.optional(), + tabStyle: z.enum(['underline', 'pill']).optional(), + bannerBg: hexColor.optional(), + drawerBg: hexColor.optional(), + textPrimary: hexColor.optional(), + textSecondary: hexColor.optional(), + cardBg: hexColor.optional(), + inputBg: hexColor.optional(), + hoverBg: hexColor.optional(), + borderColor: hexColor.optional(), }).strict(); module.exports = { updateOrg, updateBranding }; diff --git a/V2/app/modules/org/migrations/015-branding-extended.js b/V2/app/modules/org/migrations/015-branding-extended.js new file mode 100644 index 0000000..60d87a8 --- /dev/null +++ b/V2/app/modules/org/migrations/015-branding-extended.js @@ -0,0 +1,23 @@ +'use strict'; + +module.exports = { + async up(queryInterface, Sequelize) { + const cols = [ + ['btnPrimaryBg', Sequelize.STRING], + ['btnSecondaryBg', Sequelize.STRING], + ['pageBg', Sequelize.STRING], + ['popupBg', Sequelize.STRING], + ['overlayColor', Sequelize.STRING], + ['tabStyle', Sequelize.STRING], + ]; + for (const [name, type] of cols) { + await queryInterface.addColumn('Brandings', name, { type, allowNull: true }); + } + }, + + async down(queryInterface) { + for (const name of ['btnPrimaryBg', 'btnSecondaryBg', 'pageBg', 'popupBg', 'overlayColor', 'tabStyle']) { + await queryInterface.removeColumn('Brandings', name); + } + }, +}; diff --git a/V2/app/modules/org/migrations/016-branding-layout.js b/V2/app/modules/org/migrations/016-branding-layout.js new file mode 100644 index 0000000..45e8e9a --- /dev/null +++ b/V2/app/modules/org/migrations/016-branding-layout.js @@ -0,0 +1,21 @@ +'use strict'; + +module.exports = { + async up(queryInterface, Sequelize) { + const cols = [ + ['bannerBg', Sequelize.STRING], + ['drawerBg', Sequelize.STRING], + ['textPrimary', Sequelize.STRING], + ['textSecondary', Sequelize.STRING], + ]; + for (const [name, type] of cols) { + await queryInterface.addColumn('Brandings', name, { type, allowNull: true }); + } + }, + + async down(queryInterface) { + for (const name of ['bannerBg', 'drawerBg', 'textPrimary', 'textSecondary']) { + await queryInterface.removeColumn('Brandings', name); + } + }, +}; diff --git a/V2/app/modules/org/migrations/017-branding-surfaces.js b/V2/app/modules/org/migrations/017-branding-surfaces.js new file mode 100644 index 0000000..7a2fa14 --- /dev/null +++ b/V2/app/modules/org/migrations/017-branding-surfaces.js @@ -0,0 +1,20 @@ +'use strict'; + +module.exports = { + async up(queryInterface, Sequelize) { + const cols = [ + ['cardBg', Sequelize.STRING], + ['inputBg', Sequelize.STRING], + ['borderColor', Sequelize.STRING], + ]; + for (const [name, type] of cols) { + await queryInterface.addColumn('Brandings', name, { type, allowNull: true }); + } + }, + + async down(queryInterface) { + for (const name of ['cardBg', 'inputBg', 'borderColor']) { + await queryInterface.removeColumn('Brandings', name); + } + }, +}; diff --git a/V2/app/modules/org/migrations/018-branding-hover.js b/V2/app/modules/org/migrations/018-branding-hover.js new file mode 100644 index 0000000..eae8e65 --- /dev/null +++ b/V2/app/modules/org/migrations/018-branding-hover.js @@ -0,0 +1,10 @@ +'use strict'; + +module.exports = { + async up(queryInterface, Sequelize) { + await queryInterface.addColumn('Brandings', 'hoverBg', { type: Sequelize.STRING, allowNull: true }); + }, + async down(queryInterface) { + await queryInterface.removeColumn('Brandings', 'hoverBg'); + }, +}; diff --git a/V2/app/modules/org/model.js b/V2/app/modules/org/model.js index afd174b..04af8eb 100644 --- a/V2/app/modules/org/model.js +++ b/V2/app/modules/org/model.js @@ -33,6 +33,20 @@ module.exports = (sequelize, DataTypes) => { workColor: { type: DataTypes.STRING, defaultValue: '#00FF88' }, restColor: { type: DataTypes.STRING, defaultValue: '#4488FF' }, moveColor: { type: DataTypes.STRING, defaultValue: '#FF4444' }, + btnPrimaryBg: { type: DataTypes.STRING }, + btnSecondaryBg: { type: DataTypes.STRING }, + pageBg: { type: DataTypes.STRING }, + popupBg: { type: DataTypes.STRING }, + overlayColor: { type: DataTypes.STRING }, + tabStyle: { type: DataTypes.STRING, defaultValue: 'underline' }, + bannerBg: { type: DataTypes.STRING }, + drawerBg: { type: DataTypes.STRING }, + textPrimary: { type: DataTypes.STRING }, + textSecondary: { type: DataTypes.STRING }, + cardBg: { type: DataTypes.STRING }, + inputBg: { type: DataTypes.STRING }, + hoverBg: { type: DataTypes.STRING }, + borderColor: { type: DataTypes.STRING }, }); Organization.associate = (models) => { diff --git a/V2/app/modules/org/service.js b/V2/app/modules/org/service.js index 020d1bf..8c44d81 100644 --- a/V2/app/modules/org/service.js +++ b/V2/app/modules/org/service.js @@ -50,7 +50,7 @@ async function getBranding(models, orgId) { } async function updateBranding(models, req, orgId, data) { - const colorFields = ['primaryColor', 'secondaryColor', 'workColor', 'restColor', 'moveColor']; + const colorFields = ['primaryColor', 'secondaryColor', 'workColor', 'restColor', 'moveColor', 'btnPrimaryBg', 'btnSecondaryBg']; const failures = []; for (const field of colorFields) { diff --git a/V2/app/package.json b/V2/app/package.json index d25e0d2..45287a0 100644 --- a/V2/app/package.json +++ b/V2/app/package.json @@ -7,7 +7,7 @@ "start": "node app.js", "dev": "node --watch app.js", "setup": "node scripts/setup.js", - "migrate": "node_modules/.bin/sequelize db:migrate", + "migrate": "node scripts/migrate.js", "test": "node --experimental-vm-modules node_modules/.bin/jest --runInBand", "test:unit": "jest tests/unit --runInBand", "test:integration": "jest tests/integration --runInBand", diff --git a/V2/app/public/dashboard.html b/V2/app/public/dashboard.html index 1b17f96..deefd3b 100644 --- a/V2/app/public/dashboard.html +++ b/V2/app/public/dashboard.html @@ -37,30 +37,16 @@ -
-
-
-

Active Timer

- View All -
-
-
-

No timer running.

-
-
-
- -
-
-

Quick Links

-
- + @@ -102,23 +88,6 @@ } } catch {} - // Load active timer session - try { - const res = await Api.get('/api/v1/timers/session/active'); - if (res.ok) { - const { data } = await res.json(); - if (data) { - document.getElementById('active-timer-body').innerHTML = ` -
-

${data.timerName || 'Timer'}

-

Running

-
- Display -
-
`; - } - } - } catch {} }); diff --git a/V2/app/public/js/core.js b/V2/app/public/js/core.js index 3f978e0..0de1c3e 100644 --- a/V2/app/public/js/core.js +++ b/V2/app/public/js/core.js @@ -224,11 +224,25 @@ const Branding = (() => { function apply(branding) { const root = document.documentElement.style; - if (branding.primaryColor) root.setProperty('--color-primary', branding.primaryColor); - if (branding.secondaryColor) root.setProperty('--color-secondary', branding.secondaryColor); - if (branding.workColor) root.setProperty('--color-work', branding.workColor); - if (branding.restColor) root.setProperty('--color-rest', branding.restColor); - if (branding.moveColor) root.setProperty('--color-move', branding.moveColor); + if (branding.primaryColor) root.setProperty('--color-primary', branding.primaryColor); + if (branding.secondaryColor) root.setProperty('--color-secondary', branding.secondaryColor); + if (branding.workColor) root.setProperty('--color-work', branding.workColor); + if (branding.restColor) root.setProperty('--color-rest', branding.restColor); + if (branding.moveColor) root.setProperty('--color-move', branding.moveColor); + if (branding.btnPrimaryBg) root.setProperty('--color-btn-primary-bg', branding.btnPrimaryBg); + if (branding.btnSecondaryBg) root.setProperty('--color-btn-secondary-bg', branding.btnSecondaryBg); + if (branding.pageBg) root.setProperty('--color-page-bg', branding.pageBg); + if (branding.popupBg) root.setProperty('--color-popup-bg', branding.popupBg); + if (branding.overlayColor) root.setProperty('--color-overlay', branding.overlayColor); + if (branding.bannerBg) root.setProperty('--color-banner-bg', branding.bannerBg); + if (branding.drawerBg) root.setProperty('--color-drawer-bg', branding.drawerBg); + if (branding.textPrimary) root.setProperty('--text-primary', branding.textPrimary); + if (branding.textSecondary) root.setProperty('--text-secondary', branding.textSecondary); + if (branding.cardBg) root.setProperty('--surface-card', branding.cardBg); + if (branding.inputBg) root.setProperty('--surface-raised', branding.inputBg); + if (branding.hoverBg) root.setProperty('--surface-hover', branding.hoverBg); + if (branding.borderColor) root.setProperty('--surface-border', branding.borderColor); + document.body.dataset.tabStyle = branding.tabStyle || 'underline'; } return { load, apply }; diff --git a/V2/app/public/settings.html b/V2/app/public/settings.html index 1b77aab..f7a8110 100644 --- a/V2/app/public/settings.html +++ b/V2/app/public/settings.html @@ -48,25 +48,163 @@