Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
136 changes: 78 additions & 58 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"@babel/runtime": "^7.27.0",
"@fortawesome/fontawesome-free": "^5.15.4",
"@tmcw/togeojson": "^5.7.0",
"@xmldom/xmldom": "^0.9.10",
"bootstrap": "^4.6.2",
"bootstrap5": "npm:bootstrap@^5.3.8",
"chroma-js": "^2.4.2",
Expand Down Expand Up @@ -64,8 +65,7 @@
"moment": "^2.29.1",
"nunjucks": "^3.2.4",
"remove": "^0.1.5",
"stopwords": "0.0.5",
"xmldom": "^0.6.0"
"stopwords": "0.0.5"
},
"devDependencies": {
"@babel/core": "^8.0.1",
Expand Down Expand Up @@ -96,5 +96,9 @@
"webpack-extension-manifest-plugin": "^0.8.0",
"webpack-merge": "^5.8.0",
"zip-webpack-plugin": "^4.0.1"
},
"overrides": {
"d3-color": "^3.1.0",
"uuid": "^11.1.1"
}
}
2 changes: 1 addition & 1 deletion src/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// separate to all other pages.

var tj = require('@tmcw/togeojson');
var DOMParser = require('xmldom').DOMParser;
var DOMParser = require('@xmldom/xmldom').DOMParser;

// Check whether new version is installed
// chrome.runtime.onInstalled.addListener(function(details){
Expand Down
12 changes: 11 additions & 1 deletion src/shared/BeaconClient/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ const data = {
JobId: jobId
};

recipients.forEach((recipient, index) => {
// Contact Groups (ContactTypeId 0) have no Detail/phone number of their own -
// Beacon resolves their membership server-side and echoes it back as a
// separate ContactGroups field, so they can't go through Recipients[i].
const contactGroups = recipients.filter(recipient => recipient.ContactTypeId === 0);
const individualContacts = recipients.filter(recipient => recipient.ContactTypeId !== 0);

individualContacts.forEach((recipient, index) => {
data[`Recipients[${index}][Recipient]`] = recipient.Detail;
data[`Recipients[${index}][Description]`] = recipient.FirstName
? `${recipient.FirstName} ${recipient.LastName}`
Expand All @@ -17,6 +23,10 @@ recipients.forEach((recipient, index) => {
data[`Recipients[${index}][ContactTypeId]`] = recipient.ContactTypeId;
});

contactGroups.forEach((group, index) => {
data[`ContactGroups[${index}]`] = group.Id;
});

$.ajax({
type: 'POST',
url: host + '/Api/v1/Messages?LighthouseFunction=SendJobMessage&userId=' + userId,
Expand Down
Loading