statevoicesnational / spoke Goto Github PK
View Code? Open in Web Editor NEWmass-contact text/SMS distribution tool
License: Other
mass-contact text/SMS distribution tool
License: Other
any admin-only views should be admin only.
Note: nexmo incoming messages should verify that they are from nexmo but not a priority right now to implement.
Note: Need to write backend test that catch authentication issues
Includes:
Create shareable test database that can be used to reproduce and test issues currently in the issue queue. Maybe using faker, which is already part of the project: How to Mock Data for Node.js Applications Using faker.js
Especially useful for https://github.com/MoveOnOrg/Spoke/issues/15 and https://github.com/MoveOnOrg/Spoke/issues/14
As an admin, I want to be able to reuse scripts from previous campaigns so that I can text a new group without re-creating the conversation flow each time.
Copying a campaign involves creating a new campaign with title info (from campaign table), script data and canned response data (texters and campaign contacts should not carry over).
On the campaign edit/create screen, in the texter panel.
Here's my test situation:
I have 6 contacts. I start with two texters. The Auto-split algorithm assigns three contacts to each texter. Texter A texts one contact; texter B texts no one.
All sorts of other wacky things happen if you try to edit texter assignments with Autosplit on after the campaign starts and the texters have already texted one or more contacts.
(checked means merged into master or knex
branch)
workers/(incoming-|message-sender-)*.js
: .group()....where(field, 'LIKE', '%7').orWhere..
workers/jobs.js::assignTexters(job)
: .merge with meta/sub-queriesserver/notifications.js
: .changes()workers/number-assigner.js
does-not-equal pattern in filter(). Also might want to try supporting relative ne
, gt
, etc in rethink-knex-adapterapi/schema.js::joinOrganization
: nth()
(rethink-knex candidate) @schuyler1dapi/schema.js::createOptOut
: merge(), ?forEach()? (or is that on a returned val)api/schema.js::sendMessage
: merge()api/schema.js::deleteQuestionResponses
: complex filter()api/campaign-contact.js
: innerJoin (on top of another eqJoin)api/user.js::todos
: complex filter with r.and(...)
@schuyler1dtype.object()
and type.array()
schemasAs a user, once a person has assigned me a list of people to text, I should get a text notification letting me know my list is ready and a link to the spoke app to get started.
npm run dev
takes a long time (20 seconds for some people, over a minute for others) to get to a working server, which slows down development significantly for things that require frequent restarts. Let's see if we can speed that up.
Currently, a texter still sees a send replies #
if users have replied to opt-out
message. Instead of current behavior with loading screen, exclude opted-out numbers.
Create a new RDS instance to run the spoke prod db server, and update spoke prod config to connect to it. Update prod creds in 1pass
See https://github.com/MoveOnOrg/Spoke/blob/master/src/server/notifications.js#L38
This should pull the app domain from the .env file instead.
Sign in as an admin and create a campaign, assign contacts and a texter to this campaign, and a script, and then sign in as a the texter, and send the first message. As the message recipient, send a reply to this message.
As the texter, on the texter's campaign page, the texter should see a response from the recipient, and currently does not see this.
basically twilio sends back a message to /twilio which creates a record in pending_message_part table. Then the src/works/incoming-message.....js file is supposed to convert the pending_message_part record into a Message object. but that doesn't happen
Create an admin account on spoke, and create a texter account. Sign in as the texter from one browser, then sign in as admin on another and create a campaign. In the Texters section of the newly created campaign, you should see the name of the newly created texter in the auto-populated dropdown, but currently this isn't showing up. Fix this
Users will see these based on role (texter, admin):
The Jest tests set up in /test currently use hardcoded strings for database names. These string should be loaded from env instead.
Spoke was originally a project of gearshift.co and the codebase still has a lot of references to that. Now that it's open source, let's replace those references with more relevant links and email addresses.
for Datawarehouse loading contacts in #22 and other future work, it will be valuable to move 'campaign_contacts' into organization_contacts with a join table for specific campaigns
Too early to send messages
button text bleedsThese are existing tests created while we were still on rethink/thinky - need to get them working with the new orm (knex) and db (sqlite/postgres).
What are the data structures and how do they interract with the features and users of the system.
Make login link more prominent
https://github.com/MoveOnOrg/Spoke/blob/master/CONTRIBUTING.md says new PRs should have no lint errors, but there are a lot of existing lint errors, so currently every PR shows lint errors. Let's resolve all the current errors so we can start using lint as a basic check on new PRs.
Currently the invite link is going to /invite/null because it's not getting the ID back on creation. But even if it does get the ID back, we need to use something other than the ID for the URL, because IDs in PostgreSQL are not obscure hashes like they are in RethinkDB, they're easily guessable numbers.
Development workflow would be a lot faster if we didn't have to run it through Babel between making edits and testing.
Newer versions of NodeJS support almost everything in ES2015. The main thing missing seems to be import
which can be replaced with require
pretty easily. Possibly this will be more complicated in practice, but in theory this could be a quick change that speeds up other dev.
Sign in as admin user and create a campaign. Fill out all the parts of the new campaign including assigning some contacts. Assign 6 contacts in this example and then reload the page. Now instead of seeing 6/6 contacts assigned, the displayed message is "24 / 6 contacts assigned" - fix this to display the accurate number of assigned contacts
getContacts here: https://github.com/MoveOnOrg/Spoke/blob/master/src/server/api/assignment.js#L17
is used lower down in the same file here:
https://github.com/MoveOnOrg/Spoke/blob/master/src/server/api/assignment.js#L101
Note that it has a query parameter for contactsFilter
, e.g. from:
https://github.com/MoveOnOrg/Spoke/blob/master/src/containers/AdminCampaignEdit.jsx#L32
All of the logic in if (contactsFilter) { ...
is making some subtle assumptions about how indexValues ends up used in getAll() below. This function should probably start with a knex query on top, and then add filters properly conditioned on the contactsFilter options enumerated.
This relates to #100 (it's bullet 2)
This keeps popping up in the backend error log: Deprecation warning: moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.
try grep -r Date src/server/api/*
to look for places in the code that might need to be updated.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.