Skip to content

Commit

Permalink
Merge pull request #2478 from aflcio/downtime-no-initial
Browse files Browse the repository at this point in the history
Allow pausing of initial messages
  • Loading branch information
mau11 authored Oct 18, 2024
2 parents 0c37c46 + 494ec93 commit a1d6ce5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/REFERENCE-environment_variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
| DEV_APP_PORT | Port for development Webpack server. Required for development. |
| DOWNTIME | When enabled it will redirect users to a /downtime page. If set to a string, it will show the string as a message to users on the downtime page. Use this to take the system down for maintenance. It will NOT stop graphql requests and will NOT stop users that are already in the app. |
| DOWNTIME_NO_DB | On AWS Lambda this blocks the site from loading the app at all and swaps out a system that redirects users to /downtime. This is useful for DB maintenance. For non-Lambda environments, just run the src/server/downtime app instead of src/server/index default app |
| DOWNTIME_NO_INITIAL | When enabled, texters will see a message telling them that sending of initial messages is paused, but they will still be able to reply to any incoming responses. |
| DOWNTIME_TEXTER | Setting DOWNTIME_TEXTER to a text message (without quotes, please) will give the message as a text to texters when they arrive on the site, but the admin pages will still be accessible. This could be useful if you want to stop new texters from landing on the site and texting, while you debug things. |
| DST_REFERENCE_TIMEZONE | Timezone to use to determine whether DST is in effect. If it's DST in this timezone, we assume it's DST everywhere. _Default_: "US/Eastern". (The default will work for any campaign in the US. For example, if the campaign is in Australia, use "Australia/Sydney" or some other timezone in Australia. Note that DST is opposite in the northern and souther hemispheres.) |
| DYNAMICASSIGNMENT_BATCHES | Enables texter strategies for campaigns. Enabled by default are "finished-replies-tz", "vetted-texters", and "finished-replies". Learn more at [HOWTO-use-dynamicassignment-batches.md](https://github.com/StateVoicesNational/Spoke/blob/e217a971f0e1eed6f96d1494aee0f62ce715a771/docs/HOWTO-use-dynamicassignment-batches.md#dynamic-assignment-strategies). NOTE: "vetted-takeconversations" is experimental and does not work on its own, needing other three default strategies enabled.
Expand Down
6 changes: 6 additions & 0 deletions src/components/AssignmentTexter/Controls.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1173,6 +1173,12 @@ export class AssignmentTexterContactControls extends React.Component {

renderFirstMessage(enabledSideboxes) {
const { contact } = this.props;
if (window.DOWNTIME_NO_INITIAL) {
return [
this.renderToolbar(enabledSideboxes),
<div>Sending initial messages is currently paused. You can still reply to any incoming messages.</div>
];
}
return [
this.renderToolbar(enabledSideboxes),
<ContactToolbar
Expand Down
1 change: 1 addition & 0 deletions src/server/middleware/render-index.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ export default function renderIndex(html, css, assetMap) {
window.CAN_GOOGLE_IMPORT=${canGoogleImport}
window.DOWNTIME="${process.env.DOWNTIME || ""}"
window.DOWNTIME_TEXTER="${process.env.DOWNTIME_TEXTER || ""}"
window.DOWNTIME_NO_INITIAL="${process.env.DOWNTIME_NO_INITIAL || ""}"
window.EXPERIMENTAL_PER_CAMPAIGN_MESSAGING_LEGACY=${getConfig(
"EXPERIMENTAL_PER_CAMPAIGN_MESSAGING_LEGACY",
null,
Expand Down

0 comments on commit a1d6ce5

Please sign in to comment.