Various fixes.
This commit is contained in:
parent
4e4b77ca84
commit
02360be75b
20 changed files with 3137 additions and 3124 deletions
|
@ -31,7 +31,13 @@ async function ensureNoDependencies(tx, context, id, depSpecs) {
|
|||
break;
|
||||
}
|
||||
|
||||
if (await shares.checkEntityPermissionTx(tx, context, depSpec.entityTypeId, row.id, 'view')) {
|
||||
if (depSpec.viewPermission && await shares.checkEntityPermissionTx(tx, context, depSpec.viewPermission.entityTypeId, depSpec.viewPermission.entityId, depSpec.viewPermission.requiredOperations)) {
|
||||
deps.push({
|
||||
entityTypeId: depSpec.entityTypeId,
|
||||
name: row.name,
|
||||
link: entityType.clientLink(row.id)
|
||||
});
|
||||
} else if (await shares.checkEntityPermissionTx(tx, context, depSpec.entityTypeId, row.id, 'view')) {
|
||||
deps.push({
|
||||
entityTypeId: depSpec.entityTypeId,
|
||||
name: row.name,
|
||||
|
|
|
@ -219,7 +219,7 @@ async function getDefaultCustomFormValues() {
|
|||
|
||||
// TODO - this could run in the browser too - move to shared
|
||||
function checkForMjmlErrors(form) {
|
||||
let testLayout = '<mjml><mj-body><mj-container>{{{body}}}</mj-container></mj-body></mjml>';
|
||||
let testLayout = '<mjml><mj-body>{{{body}}}</mj-body></mjml>';
|
||||
|
||||
let hasMjmlError = (template, layout = testLayout) => {
|
||||
let source = layout.replace(/\{\{\{body\}\}\}/g, template);
|
||||
|
|
|
@ -226,7 +226,16 @@ async function remove(context, id) {
|
|||
await shares.enforceEntityPermissionTx(tx, context, 'namespace', id, 'delete');
|
||||
|
||||
const entityTypesWithNamespace = Object.keys(entitySettings.getEntityTypes());
|
||||
await dependencyHelpers.ensureNoDependencies(tx, context, id, entityTypesWithNamespace.map(entityTypeId => ({ entityTypeId: entityTypeId, column: 'namespace' })));
|
||||
|
||||
const depSpecs = entityTypesWithNamespace.map(entityTypeId => {
|
||||
if (entityTypeId === 'user') {
|
||||
return { entityTypeId: entityTypeId, column: 'namespace', viewPermission: {entityTypeId: 'namespace', entityId: id, requiredOperations: 'manageUsers'} };
|
||||
} else {
|
||||
return { entityTypeId: entityTypeId, column: 'namespace' };
|
||||
}
|
||||
});
|
||||
|
||||
await dependencyHelpers.ensureNoDependencies(tx, context, id, depSpecs);
|
||||
|
||||
await tx('namespaces').where('id', id).del();
|
||||
});
|
||||
|
|
2493
server/package-lock.json
generated
2493
server/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -26,13 +26,13 @@
|
|||
"node": ">=10.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-eslint": "^10.0.1",
|
||||
"babel-eslint": "^10.0.2",
|
||||
"chai": "^4.2.0",
|
||||
"eslint-config-nodemailer": "^1.2.0",
|
||||
"grunt": "^1.0.3",
|
||||
"grunt-cli": "^1.3.2",
|
||||
"grunt-eslint": "^21.0.0",
|
||||
"lodash": "^4.17.11",
|
||||
"grunt-eslint": "^21.1.0",
|
||||
"lodash": "^4.17.15",
|
||||
"mocha": "^5.2.0",
|
||||
"phantomjs-prebuilt": "^2.1.16",
|
||||
"selenium-webdriver": "^3.6.0",
|
||||
|
@ -42,31 +42,31 @@
|
|||
"posix": "^4.1.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"aws-sdk": "^2.440.0",
|
||||
"aws-sdk": "^2.497.0",
|
||||
"bcrypt-nodejs": "0.0.3",
|
||||
"bluebird": "^3.5.3",
|
||||
"body-parser": "^1.18.3",
|
||||
"bluebird": "^3.5.5",
|
||||
"body-parser": "^1.19.0",
|
||||
"bounce-handler": "7.3.2-fork.3",
|
||||
"capitalize": "^2.0.0",
|
||||
"compression": "^1.7.3",
|
||||
"config": "^3.0.1",
|
||||
"config": "^3.2.2",
|
||||
"connect-flash": "^0.1.1",
|
||||
"connect-redis": "^3.4.0",
|
||||
"connect-redis": "^3.4.2",
|
||||
"cookie-parser": "^1.4.3",
|
||||
"cors": "^2.8.5",
|
||||
"crypto": "^1.0.1",
|
||||
"csurf": "^1.9.0",
|
||||
"csv-parse": "^4.4.1",
|
||||
"csurf": "^1.10.0",
|
||||
"csv-parse": "^4.4.3",
|
||||
"csv-stringify": "^5.1.2",
|
||||
"device": "^0.3.9",
|
||||
"dompurify": "^1.0.8",
|
||||
"dompurify": "^1.0.11",
|
||||
"escape-html": "^1.0.3",
|
||||
"escape-string-regexp": "^1.0.5",
|
||||
"express": "^4.16.4",
|
||||
"express": "^4.17.1",
|
||||
"express-locale": "^1.0.5",
|
||||
"express-session": "^1.15.6",
|
||||
"express-session": "^1.16.2",
|
||||
"faker": "^4.1.0",
|
||||
"feedparser-promised": "^2.0.0",
|
||||
"feedparser-promised": "^2.0.1",
|
||||
"fs-extra": "^7.0.1",
|
||||
"fs-extra-promise": "^1.0.1",
|
||||
"geoip-ultralight": "^0.1.5",
|
||||
|
@ -82,23 +82,23 @@
|
|||
"juice": "^5.2.0",
|
||||
"klaw-sync": "^6.0.0",
|
||||
"knex": "^0.16.5",
|
||||
"libmime": "^4.0.1",
|
||||
"mailparser": "^2.4.3",
|
||||
"libmime": "^4.1.3",
|
||||
"mailparser": "^2.7.1",
|
||||
"memory-cache": "^0.2.0",
|
||||
"mjml": "^4.3.0",
|
||||
"mjml": "^4.4.0",
|
||||
"moment": "^2.23.0",
|
||||
"moment-timezone": "^0.5.25",
|
||||
"moment-timezone": "^0.5.26",
|
||||
"morgan": "^1.9.1",
|
||||
"multer": "^1.4.1",
|
||||
"multer": "^1.4.2",
|
||||
"mysql": "^2.17.1",
|
||||
"node-ipc": "^9.1.1",
|
||||
"node-mocks-http": "^1.7.3",
|
||||
"node-mocks-http": "^1.7.6",
|
||||
"node-object-hash": "^1.4.1",
|
||||
"nodeify": "^1.0.1",
|
||||
"nodemailer": "^5.0.0",
|
||||
"nodemailer-openpgp": "^1.2.0",
|
||||
"npmlog": "^4.1.2",
|
||||
"openpgp": "^4.4.3",
|
||||
"openpgp": "^4.5.5",
|
||||
"passport": "^0.4.0",
|
||||
"passport-local": "^1.0.0",
|
||||
"premailer-api": "^1.0.4",
|
||||
|
@ -108,7 +108,7 @@
|
|||
"shortid": "^2.2.14",
|
||||
"slugify": "^1.3.4",
|
||||
"smtp-server": "^3.4.7",
|
||||
"tmp-promise": "^1.0.5",
|
||||
"tmp-promise": "^1.1.0",
|
||||
"toml": "^2.3.3",
|
||||
"try-require": "^1.2.1",
|
||||
"xmldom": "^0.1.27"
|
||||
|
|
|
@ -78,7 +78,7 @@ async function migrateBase(knex) {
|
|||
// The original Mailtrain migration is executed before this one. So here we check whether the original migration
|
||||
// ended where it should have and we take it from there.
|
||||
const row = await knex('settings').where({key: 'db_schema_version'}).first('value');
|
||||
if (!row || Number(row.value) !== 33) {
|
||||
if (!row || Number(row.value) !== 34) {
|
||||
throw new Error('Unsupported DB schema version: ' + row.value);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,14 @@
|
|||
exports.up = (knex, Promise) => (async() => {
|
||||
// This is to provide upgrade path to stable to those that already have beta installed.
|
||||
await knex.schema.raw('ALTER TABLE `custom_fields` ADD COLUMN `help` text AFTER `name`');
|
||||
try {
|
||||
await knex.schema.raw('ALTER TABLE `custom_fields` ADD COLUMN `help` text AFTER `name`');
|
||||
} catch (err) {
|
||||
if (err.code === 'ER_DUP_FIELDNAME') {
|
||||
// The field is already there, so we can ignore this error
|
||||
} else {
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
})();
|
||||
|
||||
exports.down = (knex, Promise) => (async() => {
|
||||
|
|
|
@ -13,50 +13,47 @@
|
|||
<mj-class name="footer-text" font-size="12px" line-height="18px" color="#999999" />
|
||||
</mj-attributes>
|
||||
</mj-head>
|
||||
<mj-body>
|
||||
<mj-container width="560" background-color="#ffffff">
|
||||
<mj-body width="560px" background-color="#ffffff">
|
||||
<mj-raw>
|
||||
{{#if isWeb}}
|
||||
<style>
|
||||
{{{formInputStyle}}}
|
||||
.alert { max-width: 520px; font-family: Lato, Helvetica, Arial, sans-serif; }
|
||||
</style>
|
||||
{{/if}}
|
||||
</mj-raw>
|
||||
|
||||
<mj-raw>
|
||||
{{#if isWeb}}
|
||||
<style>
|
||||
{{{formInputStyle}}}
|
||||
.alert { max-width: 520px; font-family: Lato, Helvetica, Arial, sans-serif; }
|
||||
</style>
|
||||
{{/if}}
|
||||
</mj-raw>
|
||||
<mj-section padding-bottom="0">
|
||||
<mj-column>
|
||||
<mj-text mj-class="h1">
|
||||
{{title}}
|
||||
</mj-text>
|
||||
<mj-divider mj-class="hr"/>
|
||||
</mj-column>
|
||||
</mj-section>
|
||||
|
||||
<mj-section padding-bottom="0">
|
||||
<mj-column>
|
||||
<mj-text mj-class="h1">
|
||||
{{title}}
|
||||
</mj-text>
|
||||
<mj-divider mj-class="hr"/>
|
||||
</mj-column>
|
||||
</mj-section>
|
||||
<mj-raw>
|
||||
{{#if isWeb}}
|
||||
{{> subscription_flash_messages}}
|
||||
{{/if}}
|
||||
</mj-raw>
|
||||
|
||||
<mj-raw>
|
||||
{{#if isWeb}}
|
||||
{{> subscription_flash_messages}}
|
||||
{{/if}}
|
||||
</mj-raw>
|
||||
{{{body}}}
|
||||
|
||||
{{{body}}}
|
||||
<mj-section padding-top="0">
|
||||
<mj-column>
|
||||
<mj-text mj-class="small" font-style="italic">
|
||||
<!-- POST ADDRESS -->
|
||||
</mj-text>
|
||||
</mj-column>
|
||||
</mj-section>
|
||||
|
||||
<mj-section padding-top="0">
|
||||
<mj-column>
|
||||
<mj-text mj-class="small" font-style="italic">
|
||||
<!-- POST ADDRESS -->
|
||||
</mj-text>
|
||||
</mj-column>
|
||||
</mj-section>
|
||||
<mj-raw>
|
||||
{{#if isWeb}}
|
||||
<!-- fixes https://github.com/mjmlio/mjml/issues/359 -->
|
||||
{{> subscription_footer_scripts btnBgColor='#2D3E4F' btnBgColorHover='#1A242F'}}
|
||||
{{/if}}
|
||||
</mj-raw>
|
||||
|
||||
<mj-raw>
|
||||
{{#if isWeb}}
|
||||
<!-- fixes https://github.com/mjmlio/mjml/issues/359 -->
|
||||
{{> subscription_footer_scripts btnBgColor='#2D3E4F' btnBgColorHover='#1A242F'}}
|
||||
{{/if}}
|
||||
</mj-raw>
|
||||
|
||||
</mj-container>
|
||||
</mj-body>
|
||||
</mjml>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue