Bugfixes in sending campaigns
This commit is contained in:
parent
2d667523a1
commit
1448d9e914
34 changed files with 95 additions and 55 deletions
|
@ -599,7 +599,7 @@ async function updateMessageResponse(context, message, response, responseId) {
|
|||
});
|
||||
}
|
||||
|
||||
async function getSubscribersQueryGeneratorTx(tx, campaignId, onlyUnsent, batchSize) {
|
||||
async function getSubscribersQueryGeneratorTx(tx, campaignId, onlyUnsent) {
|
||||
/*
|
||||
This is supposed to produce queries like this:
|
||||
|
||||
|
|
|
@ -130,7 +130,7 @@ fieldTypes['checkbox-grouped'] = {
|
|||
cardinality: Cardinality.MULTIPLE,
|
||||
getHbsType: field => 'typeCheckboxGrouped',
|
||||
render: (field, value) => {
|
||||
const subItems = value.map(col => field.groupedOptions[col].name);
|
||||
const subItems = (value || []).map(col => field.groupedOptions[col].name);
|
||||
|
||||
if (field.settings.groupTemplate) {
|
||||
return render(field.settings.groupTemplate, {
|
||||
|
@ -149,7 +149,10 @@ fieldTypes['radio-grouped'] = {
|
|||
enumerated: false,
|
||||
cardinality: Cardinality.SINGLE,
|
||||
getHbsType: field => 'typeRadioGrouped',
|
||||
render: (field, value) => field.groupedOptions[value].name
|
||||
render: (field, value) => {
|
||||
const fld = field.groupedOptions[value];
|
||||
return fld ? fld.name : '';
|
||||
}
|
||||
};
|
||||
|
||||
fieldTypes['dropdown-grouped'] = {
|
||||
|
@ -159,7 +162,10 @@ fieldTypes['dropdown-grouped'] = {
|
|||
enumerated: false,
|
||||
cardinality: Cardinality.SINGLE,
|
||||
getHbsType: field => 'typeDropdownGrouped',
|
||||
render: (field, value) => field.groupedOptions[value].name
|
||||
render: (field, value) => {
|
||||
const fld = field.groupedOptions[value];
|
||||
return fld ? fld.name : '';
|
||||
}
|
||||
};
|
||||
|
||||
fieldTypes['radio-enum'] = {
|
||||
|
@ -173,7 +179,10 @@ fieldTypes['radio-enum'] = {
|
|||
enumerated: true,
|
||||
cardinality: Cardinality.SINGLE,
|
||||
getHbsType: field => 'typeRadioEnum',
|
||||
render: (field, value) => field.groupedOptions[value].name
|
||||
render: (field, value) => {
|
||||
const fld = field.groupedOptions[value];
|
||||
return fld ? fld.name : '';
|
||||
}
|
||||
};
|
||||
|
||||
fieldTypes['dropdown-enum'] = {
|
||||
|
@ -187,7 +196,10 @@ fieldTypes['dropdown-enum'] = {
|
|||
enumerated: true,
|
||||
cardinality: Cardinality.SINGLE,
|
||||
getHbsType: field => 'typeDropdownEnum',
|
||||
render: (field, value) => field.groupedOptions[value].name
|
||||
render: (field, value) => {
|
||||
const fld = field.groupedOptions[value];
|
||||
return fld ? fld.name : '';
|
||||
}
|
||||
};
|
||||
|
||||
fieldTypes.option = {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
'use strict';
|
||||
|
||||
const log = require('npmlog');
|
||||
const log = require('../lib/log');
|
||||
const knex = require('../lib/knex');
|
||||
const dtHelpers = require('../lib/dt-helpers');
|
||||
const shares = require('./shares');
|
||||
|
|
|
@ -6,7 +6,7 @@ const { enforce } = require('../lib/helpers');
|
|||
const dtHelpers = require('../lib/dt-helpers');
|
||||
const entitySettings = require('../lib/entity-settings');
|
||||
const interoperableErrors = require('../shared/interoperable-errors');
|
||||
const log = require('npmlog');
|
||||
const log = require('../lib/log');
|
||||
const {getGlobalNamespaceId} = require('../shared/namespaces');
|
||||
const {getAdminId} = require('../shared/users');
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue