refactor(config): rename and re-type footer columns

This commit is contained in:
Ali BARIN
2025-03-10 12:06:13 +00:00
parent 65f5cbc330
commit be8a967ab1
12 changed files with 87 additions and 87 deletions

View File

@@ -14,12 +14,12 @@ const configParams = (request) => {
enableFooter,
footerBackgroundColor,
footerCopyrightText,
footerDocsLink,
footerImprintLink,
footerDocsUrl,
footerImprintUrl,
footerLogoSvgData,
footerPrivacyPolicyLink,
footerPrivacyPolicyUrl,
footerTextColor,
footerTosLink,
footerTosUrl,
logoSvgData,
palettePrimaryDark,
palettePrimaryLight,
@@ -31,12 +31,12 @@ const configParams = (request) => {
enableFooter,
footerBackgroundColor,
footerCopyrightText,
footerDocsLink,
footerImprintLink,
footerDocsUrl,
footerImprintUrl,
footerLogoSvgData,
footerPrivacyPolicyLink,
footerPrivacyPolicyUrl,
footerTextColor,
footerTosLink,
footerTosUrl,
logoSvgData,
palettePrimaryDark,
palettePrimaryLight,

View File

@@ -29,10 +29,10 @@ describe('PATCH /api/v1/admin/config', () => {
const footerCopyrightText = '© AB Software GmbH';
const footerBackgroundColor = '#FFFFFF';
const footerTextColor = '#000000';
const footerDocsLink = 'https://automatisch.io/docs';
const footerTosLink = 'https://automatisch.io/terms';
const footerPrivacyPolicyLink = 'https://automatisch.io/privacy';
const footerImprintLink = 'https://automatisch.io/imprint';
const footerDocsUrl = 'https://automatisch.io/docs';
const footerTosUrl = 'https://automatisch.io/terms';
const footerPrivacyPolicyUrl = 'https://automatisch.io/privacy';
const footerImprintUrl = 'https://automatisch.io/imprint';
const footerLogoSvgData =
'<svg width="25" height="25" xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 100 100"><rect width="100%" height="100%" fill="white" /><text x="10" y="40" font-family="Arial" font-size="40" fill="black">Sample Footer Logo</text></svg>';
@@ -50,10 +50,10 @@ describe('PATCH /api/v1/admin/config', () => {
footerCopyrightText,
footerBackgroundColor,
footerTextColor,
footerDocsLink,
footerTosLink,
footerPrivacyPolicyLink,
footerImprintLink,
footerDocsUrl,
footerTosUrl,
footerPrivacyPolicyUrl,
footerImprintUrl,
footerLogoSvgData,
};

View File

@@ -33,10 +33,10 @@ describe('GET /api/v1/automatisch/config', () => {
footerCopyrightText: '© AB Software GmbH',
footerBackgroundColor: '#FFFFFF',
footerTextColor: '#000000',
footerDocsLink: 'https://automatisch.io/docs',
footerTosLink: 'https://automatisch.io/terms',
footerPrivacyPolicyLink: 'https://automatisch.io/privacy',
footerImprintLink: 'https://automatisch.io/imprint',
footerDocsUrl: 'https://automatisch.io/docs',
footerTosUrl: 'https://automatisch.io/terms',
footerPrivacyPolicyUrl: 'https://automatisch.io/privacy',
footerImprintUrl: 'https://automatisch.io/imprint',
});
const response = await request(app)
@@ -56,10 +56,10 @@ describe('GET /api/v1/automatisch/config', () => {
footerCopyrightText: '© AB Software GmbH',
footerBackgroundColor: '#FFFFFF',
footerTextColor: '#000000',
footerDocsLink: 'https://automatisch.io/docs',
footerTosLink: 'https://automatisch.io/terms',
footerPrivacyPolicyLink: 'https://automatisch.io/privacy',
footerImprintLink: 'https://automatisch.io/imprint',
footerDocsUrl: 'https://automatisch.io/docs',
footerTosUrl: 'https://automatisch.io/terms',
footerPrivacyPolicyUrl: 'https://automatisch.io/privacy',
footerImprintUrl: 'https://automatisch.io/imprint',
});
expect(response.body).toStrictEqual(expectedPayload);

View File

@@ -2,13 +2,13 @@ export async function up(knex) {
await knex.schema.table('config', (table) => {
table.boolean('enable_footer').defaultTo(false);
table.text('footer_logo_svg_data');
table.text('footer_copyright_text');
table.text('footer_background_color');
table.text('footer_text_color');
table.text('footer_docs_link');
table.text('footer_tos_link');
table.text('footer_privacy_policy_link');
table.text('footer_imprint_link');
table.string('footer_copyright_text');
table.string('footer_background_color');
table.string('footer_text_color');
table.string('footer_docs_url');
table.string('footer_tos_url');
table.string('footer_privacy_policy_url');
table.string('footer_imprint_url');
});
}
@@ -19,9 +19,9 @@ export async function down(knex) {
table.dropColumn('footer_logo_svg_data');
table.dropColumn('footer_background_color');
table.dropColumn('footer_text_color');
table.dropColumn('footer_docs_link');
table.dropColumn('footer_tos_link');
table.dropColumn('footer_privacy_policy_link');
table.dropColumn('footer_imprint_link');
table.dropColumn('footer_docs_url');
table.dropColumn('footer_tos_url');
table.dropColumn('footer_privacy_policy_url');
table.dropColumn('footer_imprint_url');
});
}

View File

@@ -27,13 +27,13 @@ exports[`Config model > jsonSchema should have correct validations 1`] = `
"null",
],
},
"footerDocsLink": {
"footerDocsUrl": {
"type": [
"string",
"null",
],
},
"footerImprintLink": {
"footerImprintUrl": {
"type": [
"string",
"null",
@@ -45,7 +45,7 @@ exports[`Config model > jsonSchema should have correct validations 1`] = `
"null",
],
},
"footerPrivacyPolicyLink": {
"footerPrivacyPolicyUrl": {
"type": [
"string",
"null",
@@ -57,7 +57,7 @@ exports[`Config model > jsonSchema should have correct validations 1`] = `
"null",
],
},
"footerTosLink": {
"footerTosUrl": {
"type": [
"string",
"null",

View File

@@ -21,10 +21,10 @@ class Config extends Base {
footerCopyrightText: { type: ['string', 'null'] },
footerBackgroundColor: { type: ['string', 'null'] },
footerTextColor: { type: ['string', 'null'] },
footerDocsLink: { type: ['string', 'null'] },
footerTosLink: { type: ['string', 'null'] },
footerPrivacyPolicyLink: { type: ['string', 'null'] },
footerImprintLink: { type: ['string', 'null'] },
footerDocsUrl: { type: ['string', 'null'] },
footerTosUrl: { type: ['string', 'null'] },
footerPrivacyPolicyUrl: { type: ['string', 'null'] },
footerImprintUrl: { type: ['string', 'null'] },
createdAt: { type: 'string' },
updatedAt: { type: 'string' },
},

View File

@@ -20,10 +20,10 @@ const configSerializer = (config) => {
footerCopyrightText: config.footerCopyrightText,
footerBackgroundColor: config.footerBackgroundColor,
footerTextColor: config.footerTextColor,
footerDocsLink: config.footerDocsLink,
footerTosLink: config.footerTosLink,
footerPrivacyPolicyLink: config.footerPrivacyPolicyLink,
footerImprintLink: config.footerImprintLink,
footerDocsUrl: config.footerDocsUrl,
footerTosUrl: config.footerTosUrl,
footerPrivacyPolicyUrl: config.footerPrivacyPolicyUrl,
footerImprintUrl: config.footerImprintUrl,
};
};

View File

@@ -27,12 +27,12 @@ describe('configSerializer', () => {
enableFooter: config.enableFooter,
footerBackgroundColor: config.footerBackgroundColor,
footerCopyrightText: config.footerCopyrightText,
footerDocsLink: config.footerDocsLink,
footerImprintLink: config.footerImprintLink,
footerDocsUrl: config.footerDocsUrl,
footerImprintUrl: config.footerImprintUrl,
footerLogoSvgData: config.footerLogoSvgData,
footerPrivacyPolicyLink: config.footerPrivacyPolicyLink,
footerPrivacyPolicyUrl: config.footerPrivacyPolicyUrl,
footerTextColor: config.footerTextColor,
footerTosLink: config.footerTosLink,
footerTosUrl: config.footerTosUrl,
createdAt: config.createdAt.getTime(),
updatedAt: config.updatedAt.getTime(),
};