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

Stage-main Release candidate 10.1 #1942

Merged
merged 102 commits into from
Apr 13, 2021
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
4dfd3a8
fix the flexbox css properties to align the navigationTitle correctly
stefanhayden Dec 3, 2020
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
03031b7
WIP everything is broken and nothing works
stefanhayden Feb 17, 2021
7a9175a
Remove the yellow badge from the summary so texters do not think they…
stefanhayden 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
bd0c547
WIP. so much is broken
stefanhayden Feb 19, 2021
7694d72
clean up form.submit and GSSubmitButton
stefanhayden Feb 20, 2021
1a8bc2b
cleanup
stefanhayden Feb 20, 2021
bbd47c9
fix for uncontroled error from react
stefanhayden Feb 21, 2021
a3885c1
working on UTs
stefanhayden Feb 21, 2021
02524ee
UTs
stefanhayden Feb 21, 2021
991b5ef
UTs
stefanhayden Feb 21, 2021
dc721b8
skip this test for the moment
stefanhayden Feb 21, 2021
2316bce
CLeanup
stefanhayden Feb 21, 2021
9f3cc92
cleanup
stefanhayden Feb 21, 2021
b8139b4
wip
stefanhayden Feb 23, 2021
8bea95e
form cleanup and chartjs remove
stefanhayden Feb 23, 2021
f62797f
Clean up chart js
stefanhayden Feb 25, 2021
ed061d2
cleanup
stefanhayden Feb 25, 2021
9ec4c8f
Merge remote-tracking branch 'upstream/main' into sh/react-and-everyt…
stefanhayden Feb 25, 2021
d18ac59
fixing more form fields
stefanhayden Feb 25, 2021
711b1ae
cleanup
stefanhayden Feb 25, 2021
ed73f02
cleanup
stefanhayden Feb 25, 2021
a8da011
more <Form.Fields
stefanhayden Feb 25, 2021
fabba82
Bump Auth0 Lock to v11.28
marzvrover Feb 27, 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
dd4dba6
Upgrade uglifyjs-webpack-plugin to max 1.3.0
stefanhayden Mar 5, 2021
5b5eae8
missing GSTextField import
stefanhayden Mar 5, 2021
2167db6
trying to get cypress to pass
stefanhayden Mar 5, 2021
2ee3efc
allow data-test attr on raisedButton
stefanhayden Mar 5, 2021
24daff2
Love me cypress. I'm so nice.
stefanhayden Mar 5, 2021
772501a
click the button
stefanhayden Mar 5, 2021
0696833
but really. click the button
stefanhayden 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
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
0f73954
react upgrade: move uglify to prod deps and hot-loader just for dev
schuyler1d Mar 5, 2021
7f71559
Remove old react formal hack and fix texter manual assignment for Rea…
ibrand Mar 5, 2021
d1bcffa
Fix button
stefanhayden Mar 10, 2021
47f46ac
fix cypress tests
stefanhayden Mar 10, 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
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
96435a3
correctly use autocomplete with react-formal
stefanhayden Mar 16, 2021
be36357
action-handler mobilecommons-signup: support UMC_FIELDS for external_…
schuyler1d Mar 17, 2021
6dbc19a
remove console.log
schuyler1d Mar 17, 2021
2146886
campaign texting hours: change autocomplete=> menu fields as autocomp…
schuyler1d Mar 18, 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
a08bf7a
typo: type.object
schuyler1d Mar 19, 2021
c0e8139
Merge remote-tracking branch 'origin/campaign-contacts-results' into …
schuyler1d Mar 19, 2021
f236dfa
typo: addFormField
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
c4a46da
mobilize event shifter – fix filling in custom fields & zip
codygordon Mar 20, 2021
64c70e4
Merge branch 'main' of github.com:MoveOnOrg/Spoke into main
codygordon Mar 22, 2021
79ac765
campaign export all contacts even w/o assignment
codygordon Mar 22, 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
92184a5
implement ability to also suppress tags in msg review
codygordon Mar 28, 2021
06cd6e9
supply Apollo client singleton, because this is failing in UserEditDi…
schuyler1d Mar 30, 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
4036165
fix ActionHandler menu selection
schuyler1d Mar 31, 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
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
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
95 changes: 36 additions & 59 deletions src/components/CampaignTextingHoursForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ import * as yup from "yup";
import cloneDeep from "lodash/cloneDeep";
import isEqual from "lodash/isEqual";
import moment from "moment";
import Autocomplete from "material-ui/AutoComplete";
import { dataSourceItem } from "./utils";
import momentTz from "moment-timezone";
import SelectField from "material-ui/SelectField";
import MenuItem from "material-ui/MenuItem";

export default class CampaignTextingHoursForm extends React.Component {
state = {
Expand Down Expand Up @@ -51,7 +52,7 @@ export default class CampaignTextingHoursForm extends React.Component {
);
}

addAutocompleteFormField(
addFormField(
name,
stateName,
initialValue,
Expand All @@ -61,44 +62,15 @@ export default class CampaignTextingHoursForm extends React.Component {
) {
return (
<Form.Field
as={GSTextField}
as={SelectField}
name={name}
type={Autocomplete}
fullWidth
dataSource={choices}
filter={Autocomplete.caseInsensitiveFilter}
maxSearchResults={4}
searchText={
this.state[stateName] !== undefined
? this.state[stateName]
: initialValue
}
hintText={hint}
floatingLabelText={label}
onUpdateInput={text => {
const state = {};
state[stateName] = text;
this.setState(state);
onChange={(_, i, val) => {
this.props.onChange({ [name]: val });
}}
onNewRequest={(selection, index) => {
let selectedChoice = undefined;
if (index === -1) {
selectedChoice = choices.find(item => item.text === selection);
} else {
selectedChoice = selection;
}
if (!selectedChoice) {
return;
}
const state = {};
state[stateName] = selectedChoice.text;
this.setState(state);
this.fireOnChangeIfTheFormValuesChanged(
name,
selectedChoice.rawValue
);
}}
/>
>
{choices}
</Form.Field>
);
}

Expand Down Expand Up @@ -132,10 +104,10 @@ export default class CampaignTextingHoursForm extends React.Component {
];
const hourChoices = hours.map(hour => {
const formattedHour = formatTextingHours(hour);
return dataSourceItem(formattedHour, hour);
return <MenuItem key={hour} value={hour} primaryText={formattedHour} />;
});

const timezones = [
let timezones = [
"US/Alaska",
"US/Aleutian",
"US/Arizona",
Expand All @@ -151,15 +123,20 @@ export default class CampaignTextingHoursForm extends React.Component {
"America/Puerto_Rico",
"America/Virgin"
];
const timezoneChoices = timezones.map(timezone =>
dataSourceItem(timezone, timezone)
);

if (window.TZ && timezones.indexOf(window.TZ) === -1) {
const allTZs = momentTz.tz.names();
const tzIndex = allTZs.indexOf(window.TZ);
if (tzIndex !== -1) {
timezones = allTZs.slice(Math.max(0, tzIndex - 5), tzIndex + 5);
}
}
const timezoneChoices = timezones.map(timezone => (
<MenuItem key={timezone} value={timezone} primaryText={timezone} />
));
return (
<GSForm
schema={this.formSchema}
value={this.props.formValues}
onChange={this.props.onChange}
onSubmit={this.props.onSubmit}
>
<CampaignFormSectionHeading
Expand All @@ -180,40 +157,40 @@ export default class CampaignTextingHoursForm extends React.Component {
<div>
{this.props.formValues.textingHoursEnforced ? (
<div>
{this.addAutocompleteFormField(
{this.addFormField(
"textingHoursStart",
"textingHoursStartSearchText",
formatTextingHours(this.props.formValues.textingHoursStart),
"Start time",
"Start typing a start time",
hourChoices,
hours
"",
hourChoices
)}

{this.addAutocompleteFormField(
{this.addFormField(
"textingHoursEnd",
"textingHoursEndSearchText",
formatTextingHours(this.props.formValues.textingHoursEnd),
"End time",
"Start typing an end time",
hourChoices,
hours
"",
hourChoices
)}
</div>
) : (
""
)}
</div>
) : null}

{this.addAutocompleteFormField(
<div>
Timezone to use for contacts without ZIP code and to determine
daylight savings
</div>
{this.addFormField(
"timezone",
"timezoneSearchText",
this.props.formValues.timezone,
"Timezone to use for contacts without ZIP code and to determine daylight savings",
"Start typing a timezone",
timezoneChoices,
timezones
"Default Contact Timezone",
"",
timezoneChoices
)}

<Form.Submit
Expand Down
2 changes: 1 addition & 1 deletion src/components/PeopleList/UserEditDialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const UserEditDialog = props => (
UserEditDialog.propTypes = {
open: PropTypes.bool,
organizationId: PropTypes.string,
userId: PropTypes.number,
userId: PropTypes.string,
updateUser: PropTypes.func,
requestClose: PropTypes.func
};
Expand Down
2 changes: 1 addition & 1 deletion src/components/utils.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import { MenuItem } from "material-ui/Menu";
import MenuItem from "material-ui/MenuItem";
import pick from "lodash/pick";

export function dataSourceItem(name, key) {
Expand Down
6 changes: 3 additions & 3 deletions src/containers/PeopleList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class PeopleList extends Component {

this.state = {
open: false,
userEdit: undefined,
userEdit: null,
pageSize: INITIAL_PAGE_SIZE,
cursor: {
offset: 0,
Expand Down Expand Up @@ -122,7 +122,7 @@ export class PeopleList extends Component {

updateUser = () => {
this.setState({
userEdit: false
userEdit: null
});
this.props.users.refetch({
cursor: this.state.cursor
Expand Down Expand Up @@ -195,7 +195,7 @@ export class PeopleList extends Component {
};

requestUserEditClose = () => {
this.setState({ userEdit: false });
this.setState({ userEdit: null });
};

handlePasswordResetClose = () => {
Expand Down
10 changes: 7 additions & 3 deletions src/containers/Settings.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,17 +94,21 @@ class Settings extends React.Component {
onSubmit={this.handleSubmitTextingHoursForm}
defaultValue={{ textingHoursStart, textingHoursEnd }}
>
<div>
Enter the hour in 24-hour time, so e.g. 9am-9pm would be Start Time:
9 and End Time: 21.
</div>
<Form.Field
as={GSTextField}
label="Start time"
label="Start time (24h)"
name="textingHoursStart"
type="select"
fullWidth
choices={hourChoices}
/>
<Form.Field
as={GSTextField}
label="End time"
label="End time (24h)"
name="textingHoursEnd"
type="select"
fullWidth
Expand Down Expand Up @@ -323,7 +327,7 @@ class Settings extends React.Component {
{formatTextingHours(organization.textingHoursEnd)}
</span>
{window.TZ
? ` in your organisations local time. Timezone ${window.TZ}`
? ` in your organisation's local time. Timezone ${window.TZ}`
Copy link
Collaborator

@Frydafly Frydafly Mar 31, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if we would rather write organization's instead of organisation's, but that's just a US vs UK/Australia thing! @schuyler1d

: " in contacts local time (or 12pm-6pm EST if timezone is unknown)"}
</div>
) : (
Expand Down
8 changes: 5 additions & 3 deletions src/containers/hoc/load-data.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import { graphql, compose, withApollo } from "react-apollo";
import { graphql, compose } from "react-apollo";
import { withProps, branch, renderComponent } from "recompose";

import ApolloClientSingleton from "../../network/apollo-client-singleton";
import { Card, CardHeader, CardText } from "material-ui/Card";

// https://www.apollographql.com/docs/react/v2.5/recipes/recompose/
Expand Down Expand Up @@ -41,7 +41,9 @@ export const withQueries = (queries = {}) => {

const withMutations = (mutations = {}) =>
compose(
withApollo,
withProps(parentProps => {
return { client: ApolloClientSingleton };
}),
withProps(parentProps => {
const reducer = (propsAcc, [name, constructor]) => {
propsAcc[name] = async (...args) => {
Expand Down