Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Upgrade material UI #1

Open
wants to merge 200 commits into
base: sh/react-and-everything-upgrade
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
200 commits
Select commit Hold shift + click to select a range
abe53c0
Remove Preview Documentation
JeremyParker Sep 1, 2020
fa4380d
Add a searchbar to the docs microsite
ibrand Sep 10, 2020
e64e1f3
Move step to run `docker-compose up` command before step to run `crea…
navinsivakumar Nov 27, 2020
4dfd3a8
fix the flexbox css properties to align the navigationTitle correctly
stefanhayden Dec 3, 2020
91c0c06
Bulk Script Update: first draft
ibrand Jan 28, 2021
a58ec65
Add a select for canned responses to be bulk edited
ibrand Feb 4, 2021
17fe894
Merge remote-tracking branch 'upstream/main' into navigationTitle-ali…
stefanhayden Feb 8, 2021
83b2b3b
When opening the script editor the cursor should be at the end of the…
stefanhayden Feb 10, 2021
7a9175a
Remove the yellow badge from the summary so texters do not think they…
stefanhayden Feb 17, 2021
8cf38e3
Merge pull request #30 from WorkingFamilies/moveon-10
codygordon Feb 17, 2021
f6b1412
Since we don't show a badge for these we don't need the styles any more
stefanhayden Feb 18, 2021
4cee486
Update UTs. Update message if variable is 0 or undefined.
stefanhayden Feb 18, 2021
c2a5117
Return a GraphQLError with generic message
lperson Feb 21, 2021
a4cc5a1
return descriptive error message
lperson Feb 22, 2021
fabba82
Bump Auth0 Lock to v11.28
marzvrover Feb 27, 2021
d69f150
Return graphql errors but don't expose too much
lperson Feb 28, 2021
09374b4
Update HOWTO-use-texter-sideboxes.md
codygordon Mar 2, 2021
fbd8f16
fix people search when text filter is ANY
schuyler1d Mar 4, 2021
d4fff4a
people search oops: not role=any should filter role
schuyler1d Mar 4, 2021
6b1cc77
Merge pull request #1834 from MoveOnOrg/search-docsite
schuyler1d Mar 5, 2021
f584c7a
more people search oops
schuyler1d Mar 5, 2021
b987bd0
Merge remote-tracking branch 'stefanhayden/sh/react-and-everything-up…
schuyler1d Mar 5, 2021
0850841
react upgrade: move uglify to prod deps and hot-loader just for dev
schuyler1d Mar 5, 2021
3c15251
Update REFERENCE-best-practices-conformance-messaging.md
Frydafly Mar 5, 2021
9237c9a
Remove old react formal hack and fix texter manual assignment for Rea…
ibrand Mar 5, 2021
8fa2e0f
Merge remote-tracking branch 'origin/sh/react-and-everything-upgrade'…
schuyler1d Mar 5, 2021
2412439
Merge remote-tracking branch 'stefanhayden/sh/react-and-everything-up…
schuyler1d Mar 5, 2021
37bdc18
Create HOWTO_setup_twilio_amazon_SQS
Frydafly Mar 8, 2021
23c42bf
Merge branch 'sh/react-and-everything-upgrade' of https://github.com/…
schuyler1d Mar 10, 2021
c77b286
Merge remote-tracking branch 'origin/sh/react-and-everything-upgrade'…
schuyler1d Mar 10, 2021
166599f
Merge branch 'sh/react-and-everything-upgrade' into stage-main-10-1
schuyler1d Mar 10, 2021
b4f7e40
Merge remote-tracking branch 'stefanhayden/stefan-scriptEditor-cursor…
schuyler1d Mar 10, 2021
e38313d
Merge remote-tracking branch 'stefanhayden/sh/no-yellow-badges' into …
schuyler1d Mar 10, 2021
c02d599
Merge pull request #1936 from WorkingFamilies/main
schuyler1d Mar 10, 2021
e423512
Merge remote-tracking branch 'marzvrover/main' into stage-main-10-1
schuyler1d Mar 10, 2021
c05031c
Merge remote-tracking branch 'stefanhayden/navigationTitle-alignment'…
schuyler1d Mar 10, 2021
d6b8c80
Merge remote-tracking branch 'origin/main' into stage-main-10-1
schuyler1d Mar 10, 2021
588210a
Update HOWTO_setup_twilio_amazon_SQS
Frydafly Mar 13, 2021
9f7584d
Rename HOWTO_setup_twilio_amazon_SQS to HOWTO_setup_twilio_amazon_SQS.md
Frydafly Mar 13, 2021
fe1d4a7
Update HOWTO_setup_twilio_amazon_SQS.md
Frydafly Mar 13, 2021
2633512
Update HOWTO_TEXTING_HOURS_ENFORCEMENT.md
Frydafly Mar 13, 2021
f915965
Update REFERENCE-best-practices-conformance-messaging.md
Frydafly Mar 13, 2021
e4512b8
wip
stefanhayden Mar 13, 2021
a43e5f8
wip
stefanhayden Mar 15, 2021
3c30731
Merge branch 'sh/react-and-everything-upgrade' into sh/material-ui
stefanhayden Mar 16, 2021
d847928
Update REFERENCE-environment_variables.md
Frydafly Mar 16, 2021
b425d22
Merge pull request #1943 from MoveOnOrg/Frydafly-patch-3
Frydafly Mar 16, 2021
8218f1c
Merge pull request #1941 from MoveOnOrg/Frydafly-patch-2
Frydafly Mar 16, 2021
24d5b55
wip
stefanhayden Mar 17, 2021
be36357
action-handler mobilecommons-signup: support UMC_FIELDS for external_…
schuyler1d Mar 17, 2021
6dbc19a
remove console.log
schuyler1d Mar 17, 2021
6a6167f
Merge pull request #1938 from MoveOnOrg/Frydafly-patch-1
Frydafly Mar 18, 2021
589074f
Merge pull request #1690 from JeremyParker/docs-update
Frydafly Mar 18, 2021
76f206b
wip
stefanhayden Mar 19, 2021
3661da1
this needs work on the autocomplete
stefanhayden Mar 19, 2021
f7b544a
campaign after start: show contact load results
schuyler1d Mar 19, 2021
360f63d
Merge branch 'react-texting-hours' into stage-main-10-1b
schuyler1d Mar 19, 2021
753e5ee
merge campaign-contacts-results into stage-main-10-1
schuyler1d Mar 19, 2021
bfdee4f
Merge remote-tracking branch 'origin/mobilecommons-extrafields' into …
schuyler1d Mar 19, 2021
dcb332a
Merge branch 'sh/react-and-everything-upgrade' into sh/material-ui
stefanhayden Mar 19, 2021
a08bf7a
typo: type.object
schuyler1d Mar 19, 2021
c0e8139
Merge remote-tracking branch 'origin/campaign-contacts-results' into …
schuyler1d Mar 19, 2021
0323438
Merge remote-tracking branch 'origin/react-texting-hours' into stage-…
schuyler1d Mar 19, 2021
466d804
allow file to be empty
schuyler1d Mar 19, 2021
626f515
Merge remote-tracking branch 'origin/campaign-contacts-results' into …
schuyler1d Mar 19, 2021
4e36e03
Update REFERENCE-environment_variables.md
Frydafly Mar 19, 2021
ba4b8c2
Update and rename HOWTO_BUY_NUMBERS_IN_TWILIO.md to HOWTO_BUY_NUMBERS…
Frydafly Mar 19, 2021
2321814
Update REFERENCE-environment_variables.md
Frydafly Mar 20, 2021
a5f52ec
Merge pull request #1893 from navinsivakumar/local-setup-docs
Frydafly Mar 20, 2021
c4a46da
mobilize event shifter – fix filling in custom fields & zip
codygordon Mar 20, 2021
6feeff9
wip
stefanhayden Mar 21, 2021
21fb425
wip
stefanhayden Mar 21, 2021
64c70e4
Merge branch 'main' of github.com:MoveOnOrg/Spoke into main
codygordon Mar 22, 2021
0e901dc
Update REFERENCE-environment_variables.md
Frydafly Mar 22, 2021
a804ba1
Update HOWTO_BUY_NUMBERS_IN_SPOKE.md
Frydafly Mar 22, 2021
79ac765
campaign export all contacts even w/o assignment
codygordon Mar 22, 2021
9328883
fix some dialogs
stefanhayden Mar 23, 2021
2568c95
message review table overflow visible for long tags / truncate tags
codygordon Mar 23, 2021
62d28de
add a "saving" dialog to feedback to hide convo navigation
codygordon Mar 24, 2021
4108ec7
actually use custom feedback config items
codygordon Mar 24, 2021
ba1a77e
infill org-level feedback config if none on campaign is entered
codygordon Mar 24, 2021
7cee881
Update package.json
Frydafly Mar 25, 2021
1caea05
Update HOWTO_DEPLOYING_AWS_LAMBDA.md
Frydafly Mar 25, 2021
1716953
pancakes, devorce, pancakes
stefanhayden Mar 26, 2021
5e40aad
Merge branch 'sh/react-and-everything-upgrade' into sh/material-ui
stefanhayden Mar 28, 2021
92184a5
implement ability to also suppress tags in msg review
codygordon Mar 28, 2021
8bebe6a
Merge remote-tracking branch 'origin/main' into stage-main-10-1
schuyler1d Mar 30, 2021
9e6067e
Merge remote-tracking branch 'origin/react-texting-hours' into stage-…
schuyler1d Mar 30, 2021
2641aa4
Merge branch 'stage-main-10-1' into stage-main-10-1b
schuyler1d Mar 30, 2021
81fa5f6
Merge remote-tracking branch 'wfp/export-all-contacts' into stage-mai…
schuyler1d Mar 30, 2021
5e1ed02
Merge remote-tracking branch 'wfp/assignment-feedback-fixes' into sta…
schuyler1d Mar 30, 2021
1505fc8
Merge remote-tracking branch 'wfp/suppress-tags' into stage-main-10-1c
schuyler1d Mar 30, 2021
1854cf8
Merge remote-tracking branch 'wfp/feedback-config' into stage-main-10-1c
schuyler1d Mar 30, 2021
aaa7730
Merge remote-tracking branch 'origin/Frydafly-patch-s3cmd-to-aws-cli'…
schuyler1d Mar 30, 2021
11aa3c4
Merge remote-tracking branch 'wfp/mobilize-shifter-fixes' into stage-…
schuyler1d Mar 30, 2021
bf7a5f7
Merge remote-tracking branch 'wfp/tag-overflow' into stage-main-10-1c
schuyler1d Mar 30, 2021
97d3365
Update _sidebar.md
Frydafly Mar 31, 2021
4036165
fix ActionHandler menu selection
schuyler1d Mar 31, 2021
0a0e698
wip on survey
stefanhayden Mar 31, 2021
3daf108
Merge branch 'sh/react-and-everything-upgrade' into sh/material-ui
stefanhayden Mar 31, 2021
359c702
wip - everything is hard now
stefanhayden Apr 3, 2021
f01b00d
wip
stefanhayden Apr 3, 2021
15b7508
Replacing SHOW/CLOSE Menu elements with IconButtons
oburbank Apr 5, 2021
2b641a2
datatables!
stefanhayden Apr 5, 2021
ce19eda
react+react-formal upgrade: AutoComplete field does not fully work wi…
schuyler1d Apr 5, 2021
9501c5a
merge after react + react-formal upgrade fix in CampaignInteractionSt…
schuyler1d Apr 5, 2021
2a06304
fix typo
schuyler1d Apr 5, 2021
61675f8
Merge remote-tracking branch 'origin/react-texting-hours' into stage-…
schuyler1d Apr 5, 2021
9b1cb6b
another datatable
stefanhayden Apr 6, 2021
77af17c
buttons
stefanhayden Apr 6, 2021
0b0c6ae
Update REFERENCE-environment_variables.md
Frydafly Apr 6, 2021
ed7a31b
react-formal upgrade: fix GSTextField import
schuyler1d Apr 7, 2021
c63e732
Merge remote-tracking branch 'origin/react-texting-hours' into stage-…
schuyler1d Apr 7, 2021
57968ac
texter todos: gather unassigned checks into a single query instead of…
schuyler1d Apr 8, 2021
89472fe
fix: memoize slow ~20ms hot-path timezone check which was called ~100…
schuyler1d Apr 8, 2021
d30ae8d
Merge remote-tracking branch 'origin/memoize-timezonedst' into stage-…
schuyler1d Apr 8, 2021
1fe295e
Merge remote-tracking branch 'origin/todos-bulkunassignedquery' into …
schuyler1d Apr 8, 2021
ab7e624
bug: campaignOffsets needs to be split/integered w/ dst; turning off …
schuyler1d Apr 9, 2021
15436cd
Merge remote-tracking branch 'origin/memoize-timezonedst' into stage-…
schuyler1d Apr 9, 2021
ed247ad
wip
stefanhayden Apr 10, 2021
25533fe
wip
stefanhayden Apr 10, 2021
ae35c81
wip
stefanhayden Apr 10, 2021
07380ec
10.1 release notes
schuyler1d Apr 12, 2021
f3d6baa
wip and a test
stefanhayden Apr 13, 2021
de34f39
working on tests
stefanhayden Apr 13, 2021
1491cf0
more test files
stefanhayden Apr 13, 2021
aa672f6
Merge pull request #1942 from MoveOnOrg/stage-main-10-1
schuyler1d Apr 13, 2021
a6aa0ad
Merge pull request #1976 from MoveOnOrg/release-notes-10-1
schuyler1d Apr 13, 2021
25d2427
Allow campaign copying on un-started campaigns when "template" is in …
schuyler1d Apr 14, 2021
e954858
prettier
schuyler1d Apr 14, 2021
5bcaf44
f=1 for fast texting if in campaign title
schuyler1d Apr 14, 2021
4662aec
dynamicassignment-batches finished-replies-tz: first try at assigning…
schuyler1d Apr 14, 2021
ce2738f
Merge remote-tracking branch 'origin/main' into bulk-script-edit
schuyler1d Apr 14, 2021
91e3a3f
BulkScriptEditor: finish up small changes
schuyler1d Apr 14, 2021
6efff80
remove unused CampaignPrefixSelector
schuyler1d Apr 14, 2021
55d4bcb
Merge branch 'post101-tweaks' into stage-main-102-a
schuyler1d Apr 14, 2021
f438e09
fix path
schuyler1d Apr 14, 2021
db0f4f8
Merge remote-tracking branch 'origin/bulk-script-edit' into stage-mai…
schuyler1d Apr 14, 2021
afec7a0
bulkUpdateScript: clear cannedResponse cache
schuyler1d Apr 15, 2021
ec32a33
Merge remote-tracking branch 'origin/bulk-script-edit' into stage-mai…
schuyler1d Apr 15, 2021
f305c57
fix Set =>Array
schuyler1d Apr 15, 2021
f354c15
Merge remote-tracking branch 'origin/bulk-script-edit' into stage-mai…
schuyler1d Apr 15, 2021
1e20c1e
Merge remote-tracking branch 'upstream/main' into sh/material-ui
stefanhayden Apr 17, 2021
c88bace
wip
stefanhayden Apr 17, 2021
f82093c
Update HOWTO_DEVELOPMENT_LOCAL_SETUP.md
Frydafly Apr 19, 2021
1977ca4
slow and steady
stefanhayden Apr 20, 2021
753dbdd
WIP
stefanhayden Apr 21, 2021
4eda7aa
wip
stefanhayden Apr 21, 2021
731106f
wip
stefanhayden Apr 22, 2021
d8492be
wip
stefanhayden Apr 22, 2021
bce6dfe
wip
stefanhayden Apr 22, 2021
597136e
Merge pull request #1982 from MoveOnOrg/Frydafly-patch-7
schuyler1d Apr 22, 2021
8ae373f
reimplement HOLD_ENTER_KEY as optional
schuyler1d Apr 22, 2021
4db4f9e
wip
stefanhayden Apr 23, 2021
948e48b
Merge branch 'main' into Frydafly-patch-5
Frydafly Apr 23, 2021
19e476d
Merge pull request #1946 from MoveOnOrg/Frydafly-patch-5
Frydafly Apr 23, 2021
e5d77c0
Merge remote-tracking branch 'origin/main' into stage-main-102-a
schuyler1d Apr 23, 2021
bee4833
Merge remote-tracking branch 'origin/stage-main-102-a' into stage-mai…
schuyler1d Apr 23, 2021
de0c386
resolve material-ui: 0.20.1 for material-ui-datatables which pins to …
schuyler1d Apr 23, 2021
d70a8c9
Merge remote-tracking branch 'lperson/graphql_error' into stage-main-…
schuyler1d Apr 23, 2021
38946ff
Merge remote-tracking branch 'oburbank/make-show-menu-focusable' into…
schuyler1d Apr 23, 2021
dc488c4
fix setting tags from url
stefanhayden Apr 23, 2021
8296514
wip
stefanhayden Apr 24, 2021
cd41f56
trying to get more tests to work
stefanhayden Apr 24, 2021
32618e8
easy fixes
stefanhayden Apr 24, 2021
cb0c16f
add old datatables have been removed
stefanhayden Apr 25, 2021
f25ee8d
turn off old interface
stefanhayden Apr 25, 2021
552d0a5
wip
stefanhayden Apr 25, 2021
dbc79d4
Campaign List updated
stefanhayden Apr 25, 2021
89a95c7
fixing sidebox cmp
stefanhayden Apr 25, 2021
d67e578
more sidebox cleanup
stefanhayden Apr 27, 2021
94aaafb
TESTS
stefanhayden Apr 28, 2021
d82a154
release notes for v10.2
schuyler1d Apr 28, 2021
91f1f33
Merge pull request #1984 from MoveOnOrg/stage-main-102-b
schuyler1d Apr 28, 2021
646d1c0
Merge pull request #1985 from MoveOnOrg/release-notes10.2
schuyler1d Apr 28, 2021
0f5bb18
Merge remote-tracking branch 'upstream/main' into sh/material-ui
stefanhayden Apr 29, 2021
a48e3b8
AssignmentTexterFeedback
stefanhayden Apr 30, 2021
78f5038
update AdminBulkScriptEditor
stefanhayden May 1, 2021
8b25691
clean up to get button groups to display correctly
stefanhayden May 1, 2021
1a80fe4
TagsSelector is working though really needs a refactor
stefanhayden May 1, 2021
6e1cf49
console.log cleanup
stefanhayden May 1, 2021
a9084fc
all old material-ui updated
stefanhayden May 1, 2021
49fd43c
TESTS\!
stefanhayden May 2, 2021
8ab4e56
all the tests now pass???
stefanhayden May 2, 2021
aceea4f
unskip the skipped
stefanhayden May 2, 2021
71fc1c7
e2e test workig
stefanhayden May 2, 2021
2cdd992
I think all cypress tests pass now
stefanhayden May 2, 2021
20346b0
force tests to run again
stefanhayden May 2, 2021
8d5fb1d
remove only
stefanhayden May 4, 2021
b906f41
remove only
stefanhayden May 4, 2021
aa167cd
pagination on datatables
stefanhayden May 6, 2021
c237423
Fixes for todos interface
stefanhayden May 11, 2021
cc7bdfe
fix for mobile
stefanhayden May 12, 2021
67571c3
use theme spacing
stefanhayden May 12, 2021
e8c42ff
Update to Texter Experience display
stefanhayden May 12, 2021
ff1c63b
AssignmentSummary button style cleanup
stefanhayden May 13, 2021
6f34ba0
get hellipse to work on message list page
stefanhayden May 13, 2021
6c3250e
add more spacing on inputs
stefanhayden May 13, 2021
5a30da2
cleanup
stefanhayden May 19, 2021
d2ac8e9
fix onDelete of chips
stefanhayden May 30, 2021
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
12 changes: 0 additions & 12 deletions docs/EXPLANATION_MESSAGE_REVIEW.md

This file was deleted.

2 changes: 1 addition & 1 deletion docs/HOWTO_TEXTING_HOURS_ENFORCEMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ The timezone in New York City is specified by the string `US/Eastern`. Other tim

If the `TZ` environment variable is not set, Spoke will infer a time zone for each contact from the contact's ZIP code.

If a contact does not have a ZIP code, Spoke will assume the contact is in New York City and use the local time there to determine if it's OK to send texts.
If a contact does not have a ZIP code, Spoke will default to a 'narrow' range for the continental US, 12pm EST/9am PST - 9pm EST/6pm PST, and use that time to determine if it's OK to send texts.

## Is it Daylight Savings Time?

Expand Down
73 changes: 73 additions & 0 deletions docs/HOWTO_setup_twilio_amazon_SQS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@

# Handling high volume inbound SMS & Webhooks with Twilio Functions & Amazon SQS

### Instead of making this the primary means of receiving messages, you can set the Twilio messaging service fallback to the SQS queue.
If your Spoke application is down/not-responding, then Spoke doesn't lose messages and they are added to the SQS queue.
In this scenario, we do NOT automate it, but when service is restored, we can manually run the trigger and load in the sqs messages from Twilio without having lost any incoming messages.
* Due to an existing bug, we DO NOT recommend scheduling the following job yet:
- recurring Lambda (technically CloudWatch) trigger enabled to reguarly look for incoming messages:
https://github.com/MoveOnOrg/Spoke/blob/main/docs/HOWTO_DEPLOYING_AWS_LAMBDA.md#setting-up-scheduled-jobs

### Instructions Below for Set Up
* Follow the instructions in this link [Instructions for Set Up on Twilio.com] (https://www.twilio.com/blog/2017/07/handling-high-volume-inbound-sms-and-webhooks-with-twilio-functions-and-amazon-sqs.html)
* TWILIO_SQS_QUEUE_URL should be the 'https://sqs.CHANGEME.amazonaws.com/CHANGEME` url (not the twilio function)
* Set up AWS creds in the app


Twilio function source here (must change the line `const INCOMING_SMS_URL = 'https://sqs.CHANGEME.amazonaws.com/CHANGEME` and maybe `region: 'us-west-1' `):
```
/* global exports, require, console, process, Twilio */
'use strict'

// Some Node.js modules are preinstalled in the system environment.
// As of this writing, the third party modules are not configureable, but
// they should be soon. For now, though, you can take advantage of
// the AWS SDK being preinstalled. Require and initialize it here with the
// IAM credentials in your system environment.
const AWS = require('aws-sdk')
AWS.config.update({
accessKeyId: process.env.AWS_KEY,
secretAccessKey: process.env.AWS_SECRET
})

// Get a handle to SQS in the AWS region you created it in
let sqs = new AWS.SQS({ region: 'us-west-1' })

// Define SQS queue URLs from your AWS account
const INCOMING_SMS_URL = 'https://sqs.CHANGEME.amazonaws.com/CHANGEME
// const STATUS_CALLBACK_URL = 'https://sqs.us-east-2.amazonaws.com/XXX/status-callbacks'

// Implement handler function for incoming messages and status callbacks
exports.handler = function(context, event, callback) {
// SQS send params - assume it's a status callback to a standard queue
let sendParameters = {
MessageBody: JSON.stringify(event)
//QueueUrl: STATUS_CALLBACK_URL
}

// If the MessageStatus parameter is not passed, this is an incoming SMS
// message - add appropriate SQS parameters and change the URL
if (!event.MessageStatus) {
sendParameters.QueueUrl = INCOMING_SMS_URL
// FIFO queues use the message group ID to return messages to consumers
// in logical groups. For an SMS app, a good group ID is the recipient
// phone number
// sendParameters.MessageGroupId = event.From.replace(/\D/g,'')


// Add the message to the appropriate SQS queue
sqs.sendMessage(sendParameters, (err, res) => {
// For now, we'll just log any errors SQS throws us
console.log(err)
console.log(res)

// Send a TwiML response with no reply message - we'll handle
// any responses from our workers
let twiml = new Twilio.twiml.MessagingResponse()
callback(null, twiml)
})
}
}
```


2 changes: 1 addition & 1 deletion docs/REFERENCE-best-practices-conformance-messaging.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,6 @@ While texters should be able to send messages they desire, administrators can ch
## Blocking inappropriate texter content
Some language should not be possible to be texted out. This includes racial and misogynistic slurs, for example. Not on by default, but we recommend to consider enabling MESSAGE_HANDLERS=profanity-tagger along with PROFANITY_TEXTER_BLOCK_SEND=1:

* PROFANITY_TEXTER_REGEX_BASE64 controls which phrases are blocked with a regular expression. You can see the default (encoded) in the [Spoke profanity-tagger code base](https://github.com/MoveOnOrg/Spoke/blob/main/src/integrations/message-handlers/profanity-tagger/index.js#L4). Take care to thoroughly test your regular expression before deploying a change.
* PROFANITY_TEXTER_REGEX_BASE64 controls which phrases are blocked with a regular expression. You can see the default (encoded) in the [Spoke profanity-tagger code base](https://github.com/MoveOnOrg/Spoke/blob/main/src/extensions/message-handlers/profanity-tagger/index.js). Take care to thoroughly test your regular expression before deploying a change.


4 changes: 0 additions & 4 deletions docs/_sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,3 @@
- [How access roles work in Spoke](REFERENCE_ROLES_DESCRIPTION.md)
- [How to scale Spoke](HOWTO-scale-spoke-plan.md)
- [How to set up Spoke with Postgresql](HOWTO_USE_POSTGRESQL.md)

- Outlines of docs we wish we had - contributors welcome!

- [MESSAGE REVIEW documentation](EXPLANATION_MESSAGE_REVIEW.md)
48 changes: 46 additions & 2 deletions src/components/CampaignContactsChoiceForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ export class CampaignContactsChoiceForm extends React.Component {
maxNumbersPerCampaign,
contactsPerPhoneNumber,
ingestMethodChoices,
pastIngestMethod
pastIngestMethod,
ensureComplete
} = this.props;
const ingestMethod = this.getCurrentMethod();
const ingestMethodName = ingestMethod && ingestMethod.name;
Expand All @@ -91,6 +92,49 @@ export class CampaignContactsChoiceForm extends React.Component {
? pastIngestMethod
: null;
const IngestComponent = components[ingestMethodName];
if (ensureComplete) {
// isStarted
return (
<div>
{this.props.contactsCount && (
<div>
<div>Ingest Method: {ingestMethod.displayName}</div>
<div>Loaded Contacts: {this.props.contactsCount}</div>
{lastResult ? (
<div>
<div>Deleted Duplicates: {lastResult.deletedDupes}</div>
<div>Deleted OptOuts: {lastResult.deletedOptouts}</div>
</div>
) : null}
</div>
)}
{this.props.jobResultMessage && (
<div>
<CampaignFormSectionHeading title="Job Outcome" />
<div>{this.props.jobResultMessage}</div>
</div>
)}

{IngestComponent && IngestComponent.prototype.renderAfterStart ? (
<IngestComponent
onChange={chg => {
this.handleChange(chg);
}}
onSubmit={this.props.onSubmit}
campaignIsStarted={ensureComplete}
icons={icons}
saveDisabled={this.props.saveDisabled}
saveLabel={this.props.saveLabel}
clientChoiceData={ingestMethod && ingestMethod.clientChoiceData}
lastResult={lastResult}
jobResultMessage={null}
contactsPerPhoneNumber={contactsPerPhoneNumber}
maxNumbersPerCampaign={maxNumbersPerCampaign}
/>
) : null}
</div>
);
}

return (
<div>
Expand Down Expand Up @@ -169,7 +213,7 @@ export class CampaignContactsChoiceForm extends React.Component {
this.handleChange(chg);
}}
onSubmit={this.props.onSubmit}
campaignIsStarted={this.props.ensureComplete}
campaignIsStarted={ensureComplete}
icons={icons}
saveDisabled={this.props.saveDisabled}
saveLabel={this.props.saveLabel}
Expand Down
2 changes: 1 addition & 1 deletion src/containers/AdminCampaignEdit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ export class AdminCampaignEdit extends React.Component {
this.props.campaignData.campaign.contactsCount > 0,
checkSaved: () => !this.state.campaignFormValues.contactData,
blocksStarting: true,
expandAfterCampaignStarts: false,
expandAfterCampaignStarts: true,
expandableBySuperVolunteers: false,
extraProps: {
contactsCount: this.props.campaignData.campaign.contactsCount,
Expand Down
13 changes: 9 additions & 4 deletions src/extensions/contact-loaders/csv-s3-upload/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,20 @@ export async function processContactLoad(job, maxContacts, organization) {
const contactsData = (await s3.getObject(params).promise()).Body.toString(
"utf-8"
);
const contacts = JSON.parse(await gunzip(Buffer.from(contactsData, "base64")))
.contacts;

const parsedData = JSON.parse(
await gunzip(Buffer.from(contactsData, "base64"))
);
const contacts = parsedData.contacts;
const contactsCount = contacts.length;

await finalizeContactLoad(
job,
contacts,
maxContacts,
job.payload,
JSON.stringify({ finalCount: contactsCount })
JSON.stringify({
finalCount: contactsCount,
filename: parsedData.name || null
})
);
}
27 changes: 25 additions & 2 deletions src/extensions/contact-loaders/csv-s3-upload/react-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,12 @@ export class CampaignContactsForm extends React.Component {
} else if (contacts.length === 0) {
this.handleUploadError("Upload at least one contact");
} else if (contacts.length > 0) {
this.handleUploadSuccess(validationStats, contacts, customFields);
this.handleUploadSuccess(
validationStats,
contacts,
customFields,
file
);
}
},
{ headerTransformer: ensureCamelCaseRequiredHeaders }
Expand All @@ -109,7 +114,7 @@ export class CampaignContactsForm extends React.Component {
});
}

handleUploadSuccess(validationStats, contacts, customFields) {
handleUploadSuccess(validationStats, contacts, customFields, file) {
this.setState({
validationStats,
customFields,
Expand All @@ -118,6 +123,7 @@ export class CampaignContactsForm extends React.Component {
contactsCount: contacts.length
});
const contactCollection = {
name: file.name || null,
contactsCount: contacts.length,
customFields,
contacts
Expand Down Expand Up @@ -259,6 +265,20 @@ export class CampaignContactsForm extends React.Component {
}

render() {
if (this.props.campaignIsStarted) {
let data;
try {
data = JSON.parse(
(this.props.lastResult && this.props.lastResult.result) || "{}"
);
} catch (err) {
return null;
}
return data && data.filename ? (
<div>Filename: {data.filename}</div>
) : null;
}

let subtitle = (
<span>
Your upload file should be in CSV format with column headings in the
Expand Down Expand Up @@ -286,6 +306,8 @@ export class CampaignContactsForm extends React.Component {
}
}

CampaignContactsForm.prototype.renderAfterStart = true;

CampaignContactsForm.propTypes = {
onChange: type.func,
onSubmit: type.func,
Expand All @@ -297,5 +319,6 @@ CampaignContactsForm.propTypes = {
saveLabel: type.string,

clientChoiceData: type.string,
lastResult: type.object,
jobResultMessage: type.string
};
15 changes: 10 additions & 5 deletions src/extensions/contact-loaders/csv-upload/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,17 @@ export async function processContactLoad(job, maxContacts, organization) {
/// * Error handling
/// * "Request of Doom" scenarios -- queries or jobs too big to complete

let contacts;
let payload;
if (job.payload[0] === "{") {
contacts = JSON.parse(job.payload).contacts;
payload = JSON.parse(job.payload);
} else {
contacts = (await unzipPayload(job)).contacts;
payload = await unzipPayload(job);
}

await finalizeContactLoad(job, contacts, maxContacts);
await finalizeContactLoad(
job,
payload.contacts,
maxContacts,
null,
JSON.stringify({ filename: payload.name || null })
);
}
27 changes: 25 additions & 2 deletions src/extensions/contact-loaders/csv-upload/react-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export class CampaignContactsForm extends React.Component {

event.preventDefault();
const file = event.target.files[0];
console.log("file upload", file);
this.setState({ uploading: true }, () => {
parseCSV(
file,
Expand All @@ -103,7 +104,12 @@ export class CampaignContactsForm extends React.Component {
).toLocaleString()} contacts max – your file contains ${contacts.length.toLocaleString()}.`
);
} else if (contacts.length > 0) {
this.handleUploadSuccess(validationStats, contacts, customFields);
this.handleUploadSuccess(
validationStats,
contacts,
customFields,
file
);
}
},
{ headerTransformer: ensureCamelCaseRequiredHeaders }
Expand All @@ -120,7 +126,7 @@ export class CampaignContactsForm extends React.Component {
});
}

handleUploadSuccess(validationStats, contacts, customFields) {
handleUploadSuccess(validationStats, contacts, customFields, file) {
this.setState({
validationStats,
customFields,
Expand All @@ -129,6 +135,7 @@ export class CampaignContactsForm extends React.Component {
contactsCount: contacts.length
});
const contactCollection = {
name: file.name || null,
contactsCount: contacts.length,
customFields,
contacts
Expand Down Expand Up @@ -270,6 +277,19 @@ export class CampaignContactsForm extends React.Component {
}

render() {
if (this.props.campaignIsStarted) {
let data;
try {
data = JSON.parse(
(this.props.lastResult && this.props.lastResult.result) || "{}"
);
} catch (err) {
return null;
}
return data && data.filename ? (
<div>Filename: {data.filename}</div>
) : null;
}
let subtitle = (
<span>
Your upload file should be in CSV format with column headings in the
Expand Down Expand Up @@ -297,6 +317,8 @@ export class CampaignContactsForm extends React.Component {
}
}

CampaignContactsForm.prototype.renderAfterStart = true;

CampaignContactsForm.propTypes = {
onChange: type.func,
onSubmit: type.func,
Expand All @@ -309,6 +331,7 @@ CampaignContactsForm.propTypes = {

clientChoiceData: type.string,
jobResultMessage: type.string,
lastResult: type.object,

maxNumbersPerCampaign: type.number,
contactsPerPhoneNumber: type.number
Expand Down
Loading