This commit is contained in:
Ccjcarkbla
2026-06-30 08:46:12 -04:00
parent dfce55e179
commit 7d16b921f9
18 changed files with 437 additions and 102 deletions
@@ -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);
}
},
};
@@ -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);
}
},
};
@@ -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);
}
},
};
@@ -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');
},
};
+14
View File
@@ -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) => {
+1 -1
View File
@@ -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) {