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 @@ -
No timer running.
-