Merge branch 'pull/723' into development
# Conflicts: # mvis/ivis-core
This commit is contained in:
commit
3c4fbf2754
8 changed files with 21 additions and 3 deletions
|
@ -54,6 +54,7 @@ export default class CUD extends Component {
|
||||||
this.eventOptions = {
|
this.eventOptions = {
|
||||||
[Entity.SUBSCRIPTION]: [
|
[Entity.SUBSCRIPTION]: [
|
||||||
{key: SubscriptionEvent.CREATED, label: eventLabels[Entity.SUBSCRIPTION][SubscriptionEvent.CREATED]},
|
{key: SubscriptionEvent.CREATED, label: eventLabels[Entity.SUBSCRIPTION][SubscriptionEvent.CREATED]},
|
||||||
|
{key: SubscriptionEvent.UPDATED, label: eventLabels[Entity.SUBSCRIPTION][SubscriptionEvent.UPDATED]},
|
||||||
{key: SubscriptionEvent.LATEST_OPEN, label: eventLabels[Entity.SUBSCRIPTION][SubscriptionEvent.LATEST_OPEN]},
|
{key: SubscriptionEvent.LATEST_OPEN, label: eventLabels[Entity.SUBSCRIPTION][SubscriptionEvent.LATEST_OPEN]},
|
||||||
{key: SubscriptionEvent.LATEST_CLICK, label: eventLabels[Entity.SUBSCRIPTION][SubscriptionEvent.LATEST_CLICK]}
|
{key: SubscriptionEvent.LATEST_CLICK, label: eventLabels[Entity.SUBSCRIPTION][SubscriptionEvent.LATEST_CLICK]}
|
||||||
],
|
],
|
||||||
|
|
|
@ -15,6 +15,7 @@ export function getTriggerTypes(t) {
|
||||||
const eventLabels = {
|
const eventLabels = {
|
||||||
[Entity.SUBSCRIPTION]: {
|
[Entity.SUBSCRIPTION]: {
|
||||||
[SubscriptionEvent.CREATED]: t('created'),
|
[SubscriptionEvent.CREATED]: t('created'),
|
||||||
|
[SubscriptionEvent.UPDATED]: t('updated'),
|
||||||
[SubscriptionEvent.LATEST_OPEN]: t('latestOpen'),
|
[SubscriptionEvent.LATEST_OPEN]: t('latestOpen'),
|
||||||
[SubscriptionEvent.LATEST_CLICK]: t('latestClick')
|
[SubscriptionEvent.LATEST_CLICK]: t('latestClick')
|
||||||
},
|
},
|
||||||
|
|
|
@ -145,6 +145,7 @@
|
||||||
"addList": "Add list",
|
"addList": "Add list",
|
||||||
"type": "Type",
|
"type": "Type",
|
||||||
"created": "Created",
|
"created": "Created",
|
||||||
|
"updated": "Updated",
|
||||||
"override": "Override",
|
"override": "Override",
|
||||||
"fromName": "\"From\" name",
|
"fromName": "\"From\" name",
|
||||||
"fromEmailAddress": "\"From\" email address",
|
"fromEmailAddress": "\"From\" email address",
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 6300c28bb78989de35bedcd130a7c77c0bf4988b
|
Subproject commit f034b066a787aa87c5fd378fd09e5bce8f2e5618
|
|
@ -195,6 +195,7 @@ async function create(context, entity) {
|
||||||
' `latest_open` timestamp NULL DEFAULT NULL,\n' +
|
' `latest_open` timestamp NULL DEFAULT NULL,\n' +
|
||||||
' `latest_click` timestamp NULL DEFAULT NULL,\n' +
|
' `latest_click` timestamp NULL DEFAULT NULL,\n' +
|
||||||
' `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,\n' +
|
' `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,\n' +
|
||||||
|
' `updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,\n' +
|
||||||
' PRIMARY KEY (`id`),\n' +
|
' PRIMARY KEY (`id`),\n' +
|
||||||
' UNIQUE KEY `hash_email` (`hash_email`),\n' +
|
' UNIQUE KEY `hash_email` (`hash_email`),\n' +
|
||||||
' UNIQUE KEY `cid` (`cid`),\n' +
|
' UNIQUE KEY `cid` (`cid`),\n' +
|
||||||
|
@ -204,7 +205,8 @@ async function create(context, entity) {
|
||||||
' KEY `is_test` (`is_test`),\n' +
|
' KEY `is_test` (`is_test`),\n' +
|
||||||
' KEY `latest_open` (`latest_open`),\n' +
|
' KEY `latest_open` (`latest_open`),\n' +
|
||||||
' KEY `latest_click` (`latest_click`),\n' +
|
' KEY `latest_click` (`latest_click`),\n' +
|
||||||
' KEY `created` (`created`)\n' +
|
' KEY `created` (`created`),\n' +
|
||||||
|
' KEY `updated` (`updated`)\n' +
|
||||||
') ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;\n');
|
') ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;\n');
|
||||||
|
|
||||||
await shares.rebuildPermissionsTx(tx, { entityTypeId: 'list', entityId: id });
|
await shares.rebuildPermissionsTx(tx, { entityTypeId: 'list', entityId: id });
|
||||||
|
|
|
@ -616,6 +616,7 @@ async function _update(tx, listId, groupedFieldsMap, existing, filteredEntity) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (filteredEntity) {
|
if (filteredEntity) {
|
||||||
|
filteredEntity.updated = new Date();
|
||||||
await tx(getSubscriptionTableName(listId)).where('id', existing.id).update(filteredEntity);
|
await tx(getSubscriptionTableName(listId)).where('id', existing.id).update(filteredEntity);
|
||||||
|
|
||||||
if ('status' in filteredEntity) {
|
if ('status' in filteredEntity) {
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
exports.up = (knex, Promise) => (async() => {
|
||||||
|
const lists = await knex('lists');
|
||||||
|
for (const list of lists) {
|
||||||
|
await knex.schema.raw('ALTER TABLE `subscription__' + list.id + '` ADD COLUMN `updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER `created`');
|
||||||
|
await knex.schema.raw('CREATE INDEX updated ON `subscription__' + list.id + '` (`updated`)');
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
|
||||||
|
exports.down = (knex, Promise) => (async() => {
|
||||||
|
})();
|
|
@ -8,6 +8,7 @@ const Entity = {
|
||||||
const Event = {
|
const Event = {
|
||||||
[Entity.SUBSCRIPTION]: {
|
[Entity.SUBSCRIPTION]: {
|
||||||
CREATED: 'created',
|
CREATED: 'created',
|
||||||
|
UPDATED: 'updated',
|
||||||
LATEST_OPEN: 'latest_open',
|
LATEST_OPEN: 'latest_open',
|
||||||
LATEST_CLICK: 'latest_click'
|
LATEST_CLICK: 'latest_click'
|
||||||
},
|
},
|
||||||
|
@ -28,6 +29,7 @@ const EntityVals = {
|
||||||
const EventVals = {
|
const EventVals = {
|
||||||
[Entity.SUBSCRIPTION]: {
|
[Entity.SUBSCRIPTION]: {
|
||||||
created: 'CREATED',
|
created: 'CREATED',
|
||||||
|
updated: 'UPDATED',
|
||||||
latest_open: 'LATEST_OPEN',
|
latest_open: 'LATEST_OPEN',
|
||||||
latest_click: 'LATEST_CLICK'
|
latest_click: 'LATEST_CLICK'
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue