Skip to content

Commit

Permalink
Merge pull request #633 from bitholla/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
abeikverdi authored Mar 26, 2021
2 parents 6c4d310 + 154f245 commit fe2302e
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 19 deletions.
15 changes: 15 additions & 0 deletions server/db/migrations/20210323030530-change-web_view-plugins.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
'use strict';

const TABLE = 'Plugins';
const COLUMN = 'web_view';

module.exports = {
up: (queryInterface) =>
queryInterface
.changeColumn(TABLE, COLUMN, { type: `jsonb USING '[]'::jsonb;` }),
down: () => {
return new Promise(resolve => {
resolve();
});
}
};
3 changes: 2 additions & 1 deletion server/db/models/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ module.exports = (sequelize, DataTypes) => {
type: DataTypes.TEXT
},
web_view: {
type: DataTypes.TEXT
type: DataTypes.JSONB,
defaultValue: []
}
}, {
timestamps: true,
Expand Down
15 changes: 1 addition & 14 deletions server/mail/templates/helpers/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
const {
BITHOLLA_DOMAIN,
BITHOLLA_LOGO_BLACK,
EMAIL_ICONS
} = require('../../constants');
const { DOMAIN, GET_KIT_CONFIG } = require('../../../constants');
const LOGO_IMAGE = () => GET_KIT_CONFIG().logo_image;
Expand All @@ -25,7 +24,7 @@ const footerTemplate = (language = DEFAULT_LANGUAGE(), domain = DOMAIN) => {
return `
<div style="${styles.footer}">
<div style="float: left">
<p>${FOOTER.INVITE_YOUR_FRIENDS} <a style="${styles.link_blue}" href="${domain}">${domain}</a><p>
<p><a style="${styles.link_blue}" href="${domain}">${domain}</a><p>
</div>
<div style="float: right; font-size: 8px; text-align: right;">
${
Expand Down Expand Up @@ -60,18 +59,6 @@ const LOGO_TEMPLATE = ({ domain = DOMAIN, logoPath = LOGO_IMAGE() }) => `
</div>
`;

const HEADER_TEMPLATE = ({ title, imagePath = '' }) => `
<div style="${styles.header}">
${imagePath &&
`
<div style="${styles.header_icon_wrapper}">
<img style="${styles.header_icon}" src="${imagePath}"/>
</div>
`}
<div style="${styles.header_icon_title}">${title}</div>
</div>
`;

const rtlLanguage = (lang) => (lang === 'fa' || lang === 'ar' ? RTL : '');

exports.TemplateEmail = (
Expand Down
8 changes: 4 additions & 4 deletions server/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,8 @@ checkStatus()
},
web_view: {
in: ['body'],
errorMessage: 'must be a string or null',
isString: true,
errorMessage: 'must be an array or null',
isArray: true,
optional: { options: { nullable: true } }
},
prescript: {
Expand Down Expand Up @@ -577,8 +577,8 @@ checkStatus()
},
web_view: {
in: ['body'],
errorMessage: 'must be a string or null',
isString: true,
errorMessage: 'must be an array or null',
isArray: true,
optional: { options: { nullable: true } }
},
prescript: {
Expand Down

0 comments on commit fe2302e

Please sign in to comment.