diff --git a/__test__/AssignmentSummary.test.js b/__test__/AssignmentSummary.test.js index 046dfafa6..1f7aee5b5 100644 --- a/__test__/AssignmentSummary.test.js +++ b/__test__/AssignmentSummary.test.js @@ -4,7 +4,6 @@ import React from 'react' import { mount } from 'enzyme' import { StyleSheetTestUtils } from 'aphrodite' -import injectTapEventPlugin from 'react-tap-event-plugin' import each from 'jest-each' import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider' import { CardActions, CardTitle } from 'material-ui/Card' @@ -62,7 +61,6 @@ describe('AssignmentSummary text', function t() { }) describe('AssignmentSummary actions inUSA and NOT AllowSendAll', () => { - injectTapEventPlugin() // prevents warning function create(unmessaged, unreplied, badTimezone, isDynamic) { window.NOT_IN_USA = 0 window.ALLOW_SEND_ALL = false @@ -159,10 +157,7 @@ it('renders "Send later" when there is a badTimezoneCount', () => { }) describe('contacts filters', () => { - // These are an attempt to confirm that the buttons will work. - // It would be better to simulate clicking them, but I can't - // get it to work right now because of 'react-tap-event-plugin' - // some hints are here https://github.com/mui-org/material-ui/issues/4200#issuecomment-217738345 + // TODO: material-ui switch test to clicks it('filters correctly in USA', () => { window.NOT_IN_USA = 0 diff --git a/package.json b/package.json index a1f801afc..bf73c218b 100644 --- a/package.json +++ b/package.json @@ -129,7 +129,6 @@ "react-formal": "^0.28.4", "react-router": "^2.5.2", "react-router-redux": "^4.0.5", - "react-tap-event-plugin": "^2.0.0", "redis": "^2.8.0", "redux": "^3.7.2", "redux-thunk": "^2.1.0", diff --git a/src/components/App.jsx b/src/components/App.jsx index a945aaafa..b3ecf1277 100644 --- a/src/components/App.jsx +++ b/src/components/App.jsx @@ -4,16 +4,12 @@ import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider' import muiTheme from '../styles/mui-theme' import theme from '../styles/theme' import { StyleSheet, css } from 'aphrodite' -import injectTapEventPlugin from 'react-tap-event-plugin' import Form from 'react-formal' import GSTextField from './forms/GSTextField' import GSDateField from './forms/GSDateField' import GSScriptField from './forms/GSScriptField' import GSSelectField from './forms/GSSelectField' -// Needed for MaterialUI -injectTapEventPlugin() - Form.addInputTypes({ string: GSTextField, number: GSTextField, diff --git a/src/components/AssignmentSummary.jsx b/src/components/AssignmentSummary.jsx index 54f9fddbb..a5a7c52e0 100644 --- a/src/components/AssignmentSummary.jsx +++ b/src/components/AssignmentSummary.jsx @@ -67,7 +67,7 @@ export class AssignmentSummary extends Component { disabled={disabled} label={title} primary={primary && !disabled} - onTouchTap={() => this.goToTodos(contactsFilter, assignment.id)} + onClick={() => this.goToTodos(contactsFilter, assignment.id)} />) } else { return ( this.goToTodos(contactsFilter, assignment.id)} + onClick={() => this.goToTodos(contactsFilter, assignment.id)} /> ) } diff --git a/src/components/AssignmentTexter.jsx b/src/components/AssignmentTexter.jsx index 4206e8d20..cfad7ebd4 100644 --- a/src/components/AssignmentTexter.jsx +++ b/src/components/AssignmentTexter.jsx @@ -154,13 +154,13 @@ class AssignmentTexter extends React.Component { text={title} />, , diff --git a/src/components/BulkSendButton.jsx b/src/components/BulkSendButton.jsx index 84d4d4c97..6793ca7d3 100644 --- a/src/components/BulkSendButton.jsx +++ b/src/components/BulkSendButton.jsx @@ -33,7 +33,7 @@ export default class BulkSendButton extends Component { return (
this.setState({ showForm: false })} + onClick={() => this.setState({ showForm: false })} style={{ marginLeft: 5, display: 'inline-block' diff --git a/src/components/CampaignCannedResponsesForm.jsx b/src/components/CampaignCannedResponsesForm.jsx index c0240c3d1..abdb92f96 100644 --- a/src/components/CampaignCannedResponsesForm.jsx +++ b/src/components/CampaignCannedResponsesForm.jsx @@ -76,7 +76,7 @@ export default class CampaignCannedResponsesForm extends React.Component { secondary label='Add new canned response' icon={} - onTouchTap={() => this.setState({ showForm: true })} + onClick={() => this.setState({ showForm: true })} /> ) } @@ -90,7 +90,7 @@ export default class CampaignCannedResponsesForm extends React.Component { secondaryText={response.text} rightIconButton={( { + onClick={() => { const newVals = this.props.formValues.cannedResponses.map((responseToDelete) => { if (responseToDelete.id === response.id) { return null diff --git a/src/components/CampaignInteractionStepsForm.jsx b/src/components/CampaignInteractionStepsForm.jsx index 1e9d39855..fdb37e705 100644 --- a/src/components/CampaignInteractionStepsForm.jsx +++ b/src/components/CampaignInteractionStepsForm.jsx @@ -134,7 +134,7 @@ export default class CampaignInteractionStepsForm extends React.Component { fullWidth hintText='Answer to the previous question' /> : ''} - {interactionStep.parentInteractionId ? : ''} + {interactionStep.parentInteractionId ? : ''} {interactionStep.parentInteractionId && this.props.availableActions && this.props.availableActions.length ? (
: ''} @@ -213,7 +213,7 @@ export default class CampaignInteractionStepsForm extends React.Component {
) diff --git a/src/components/CampaignTextersForm.jsx b/src/components/CampaignTextersForm.jsx index ea47128b3..ee666dd5c 100644 --- a/src/components/CampaignTextersForm.jsx +++ b/src/components/CampaignTextersForm.jsx @@ -388,7 +388,7 @@ export default class CampaignTextersForm extends React.Component { : ''}
{ + onClick={async () => { const currentFormValues = this.formValues() const newFormValues = { ...currentFormValues @@ -454,7 +454,7 @@ export default class CampaignTextersForm extends React.Component {
this.addAllTexters())} + onClick={(() => this.addAllTexters())} />
diff --git a/src/components/Chip.jsx b/src/components/Chip.jsx index 10ee96bd5..de0119644 100644 --- a/src/components/Chip.jsx +++ b/src/components/Chip.jsx @@ -29,11 +29,11 @@ const styles = { } } -function Chip({ text, iconRightClass, onIconRightTouchTap, onTouchTap, style = {} }) { +function Chip({ text, iconRightClass, onIconRightTouchTap, onClick, style = {} }) { return ( -
+
{text} - {iconRightClass ? React.createElement(iconRightClass, { style: styles.icon, onTouchTap: onIconRightTouchTap }) : ''} + {iconRightClass ? React.createElement(iconRightClass, { style: styles.icon, onClick: onIconRightTouchTap }) : ''}
) } @@ -42,7 +42,7 @@ Chip.propTypes = { text: PropTypes.element, iconRightClass: PropTypes.string, onIconRightTouchTap: PropTypes.func, - onTouchTap: PropTypes.func, + onClick: PropTypes.func, style: PropTypes.object } diff --git a/src/components/ConfirmButton.jsx b/src/components/ConfirmButton.jsx index 2242ce3bc..270b59c7b 100644 --- a/src/components/ConfirmButton.jsx +++ b/src/components/ConfirmButton.jsx @@ -46,7 +46,7 @@ export default class ConfirmButton extends Component { return (
props.router.push(section.url)} + onClick={() => props.router.push(section.url)} /> ))} diff --git a/src/components/ScriptEditor.jsx b/src/components/ScriptEditor.jsx index 78b1ccf38..465336da6 100644 --- a/src/components/ScriptEditor.jsx +++ b/src/components/ScriptEditor.jsx @@ -162,7 +162,7 @@ class ScriptEditor extends React.Component { this.addCustomField(field)} + onClick={() => this.addCustomField(field)} /> ))}
diff --git a/src/components/ScriptList.jsx b/src/components/ScriptList.jsx index acfde51f5..232064f4b 100644 --- a/src/components/ScriptList.jsx +++ b/src/components/ScriptList.jsx @@ -82,12 +82,12 @@ class ScriptList extends React.Component { // targetOrigin={{horizontal: 'left', vertical: 'bottom'}} // > // this.handleEditScript(script)} + // onClick={() => this.handleEditScript(script)} // /> // { // script.isUserCreated ? ( // this.handleDeleteScript(script.id)} + // onClick={() => this.handleDeleteScript(script.id)} // /> // ) : '' // } @@ -98,7 +98,7 @@ class ScriptList extends React.Component { const listItems = scripts.map((script) => ( onSelectCannedResponse(script)} + onClick={() => onSelectCannedResponse(script)} key={script.id} primaryText={script.title} secondaryText={script.text} @@ -123,7 +123,7 @@ class ScriptList extends React.Component { } - onTouchTap={this.handleOpenDialog} + onClick={this.handleOpenDialog} /> ) : ''} @@ -133,7 +133,7 @@ class ScriptList extends React.Component { actions={[ , , ]} @@ -84,7 +84,7 @@ export default class GSScriptField extends GSFormField { { + onClick={(event) => { event.stopPropagation() }} floatingLabelText={this.floatingLabelText()} diff --git a/src/containers/AdminCampaignEdit.jsx b/src/containers/AdminCampaignEdit.jsx index 771538345..58af94401 100644 --- a/src/containers/AdminCampaignEdit.jsx +++ b/src/containers/AdminCampaignEdit.jsx @@ -450,19 +450,19 @@ class AdminCampaignEdit extends React.Component { {this.props.campaignData.campaign.isArchived ? ( await this.props.mutations.unarchiveCampaign(this.props.campaignData.campaign.id)} + onClick={async() => await this.props.mutations.unarchiveCampaign(this.props.campaignData.campaign.id)} /> ) : ( await this.props.mutations.archiveCampaign(this.props.campaignData.campaign.id)} + onClick={async() => await this.props.mutations.archiveCampaign(this.props.campaignData.campaign.id)} /> )} { + onClick={async () => { this.setState({ startingCampaign: true }) diff --git a/src/containers/AdminCampaignList.jsx b/src/containers/AdminCampaignList.jsx index 9cd69df4e..15ce43c40 100644 --- a/src/containers/AdminCampaignList.jsx +++ b/src/containers/AdminCampaignList.jsx @@ -76,7 +76,7 @@ class AdminCampaignList extends React.Component { {adminPerms ? ( diff --git a/src/containers/AdminCampaignStats.jsx b/src/containers/AdminCampaignStats.jsx index 537ba0c59..589d1c1c8 100644 --- a/src/containers/AdminCampaignStats.jsx +++ b/src/containers/AdminCampaignStats.jsx @@ -141,7 +141,7 @@ class AdminCampaignStats extends React.Component { return ( await this.props.mutations.copyCampaign(this.props.params.campaignId)} + onClick={async() => await this.props.mutations.copyCampaign(this.props.params.campaignId)} /> ) } @@ -175,7 +175,7 @@ class AdminCampaignStats extends React.Component { {!campaign.isArchived ? ( // edit this.props.router.push(`/admin/${organizationId}/campaigns/${campaignId}/edit`)} + onClick={() => this.props.router.push(`/admin/${organizationId}/campaigns/${campaignId}/edit`)} label='Edit' /> ) : null} @@ -183,7 +183,7 @@ class AdminCampaignStats extends React.Component { [ // Buttons for Admins (and not Supervolunteers) ( // export { + onClick={async () => { this.setState({ exportMessageOpen: true, disableExportButton: true @@ -201,19 +201,19 @@ class AdminCampaignStats extends React.Component { ( // unarchive campaign.isArchived ? await this.props.mutations.unarchiveCampaign(campaignId)} + onClick={async () => await this.props.mutations.unarchiveCampaign(campaignId)} label='Unarchive' /> : null), ( // archive !campaign.isArchived ? await this.props.mutations.archiveCampaign(campaignId)} + onClick={async () => await this.props.mutations.archiveCampaign(campaignId)} label='Archive' /> : null), ( // copy await this.props.mutations.copyCampaign(this.props.params.campaignId)} + onClick={async() => await this.props.mutations.copyCampaign(this.props.params.campaignId)} />) ] : null}
diff --git a/src/containers/AdminNavigation.jsx b/src/containers/AdminNavigation.jsx index 338a3f723..8a4cb5a95 100644 --- a/src/containers/AdminNavigation.jsx +++ b/src/containers/AdminNavigation.jsx @@ -21,7 +21,7 @@ class AdminNavigation extends React.Component { switchListItem={ this.props.router.push(`/app/${organizationId}/todos`)} + onClick={() => this.props.router.push(`/app/${organizationId}/todos`)} /> } /> diff --git a/src/containers/AdminPersonList.jsx b/src/containers/AdminPersonList.jsx index 3e1fa8f3f..030acdb03 100644 --- a/src/containers/AdminPersonList.jsx +++ b/src/containers/AdminPersonList.jsx @@ -104,7 +104,7 @@ class AdminPersonList extends React.Component { /> ))} - { this.editUser(person.id) }} /> + { this.editUser(person.id) }} /> ))} @@ -121,7 +121,7 @@ class AdminPersonList extends React.Component { {this.renderTexters()} @@ -143,7 +143,7 @@ class AdminPersonList extends React.Component { ]} modal={false} diff --git a/src/containers/AssignmentTexterContact.jsx b/src/containers/AssignmentTexterContact.jsx index 1d6cdc586..dc5e7d7fc 100644 --- a/src/containers/AssignmentTexterContact.jsx +++ b/src/containers/AssignmentTexterContact.jsx @@ -185,7 +185,7 @@ export class AssignmentTexterContact extends React.Component { let disabled = false let disabledText = 'Sending...' - let snackbarOnTouchTap = null + let snackbarOnClick = null let snackbarActionTitle = null let snackbarError = null @@ -193,7 +193,7 @@ export class AssignmentTexterContact extends React.Component { disabledText = '' disabled = true snackbarError = 'Your assignment has changed' - snackbarOnTouchTap = this.goBackToTodos + snackbarOnClick = this.goBackToTodos snackbarActionTitle = 'Back to Todos' } else if (contact.optOut) { disabledText = 'Skipping opt-out...' @@ -211,7 +211,7 @@ export class AssignmentTexterContact extends React.Component { questionResponses, snackbarError, snackbarActionTitle, - snackbarOnTouchTap, + snackbarOnClick, optOutMessageText: "I'm opting you out of texts immediately. Have a great day.", responsePopoverOpen: false, messageText: this.getStartingMessageText(), @@ -351,7 +351,7 @@ export class AssignmentTexterContact extends React.Component { if (e.message === 'Your assignment has changed') { newState.snackbarActionTitle = 'Back to todos' - newState.snackbarOnTouchTap = this.goBackToTodos + newState.snackbarOnClick = this.goBackToTodos this.setState(newState) } else { // opt out or send message Error @@ -580,12 +580,12 @@ export class AssignmentTexterContact extends React.Component { let button = null if (messageStatus === 'closed') { button = ( this.handleEditMessageStatus('needsResponse')} + onClick={() => this.handleEditMessageStatus('needsResponse')} label='Reopen' />) } else if (messageStatus === 'needsResponse' || messageStatus === 'messaged' || messageStatus === 'convo') { button = () } @@ -642,13 +642,13 @@ export class AssignmentTexterContact extends React.Component { {this.renderNeedsResponseToggleButton(contact)}
@@ -705,7 +705,7 @@ export class AssignmentTexterContact extends React.Component { onOptOut={this.handleNavigateNext} rightToolbarIcon={(
) diff --git a/src/containers/AssignmentTexterSurveyDropdown.jsx b/src/containers/AssignmentTexterSurveyDropdown.jsx index d01a686db..ed877c447 100644 --- a/src/containers/AssignmentTexterSurveyDropdown.jsx +++ b/src/containers/AssignmentTexterSurveyDropdown.jsx @@ -63,7 +63,7 @@ class AssignmentTexterSurveyDropdown extends Component { key='clear' value='clearResponse' primaryText='Clear response' - // onTouchTap={(event) => this.handleAnswerDelete(event, step.id)} + // onClick={(event) => this.handleAnswerDelete(event, step.id)} /> ) diff --git a/src/containers/CampaignList.jsx b/src/containers/CampaignList.jsx index 4a16a72c0..d9e58cd30 100644 --- a/src/containers/CampaignList.jsx +++ b/src/containers/CampaignList.jsx @@ -91,7 +91,7 @@ class CampaignList extends React.Component { style={listItemStyle} key={campaign.id} primaryText={primaryText} - onTouchTap={() => (!isStarted ? + onClick={() => (!isStarted ? this.props.router.push(`${campaignUrl}/edit`) : this.props.router.push(campaignUrl))} secondaryText={secondaryText} @@ -100,14 +100,14 @@ class CampaignList extends React.Component { (campaign.isArchived ? ( this.props.mutations.unarchiveCampaign(campaign.id)} + onClick={async () => this.props.mutations.unarchiveCampaign(campaign.id)} > ) : ( this.props.mutations.archiveCampaign(campaign.id)} + onClick={async () => this.props.mutations.archiveCampaign(campaign.id)} > diff --git a/src/containers/Settings.jsx b/src/containers/Settings.jsx index c9bf5423d..532754af8 100644 --- a/src/containers/Settings.jsx +++ b/src/containers/Settings.jsx @@ -98,7 +98,7 @@ class Settings extends React.Component { ) : ''} diff --git a/src/containers/UserMenu.jsx b/src/containers/UserMenu.jsx index 57219aca6..5eb7e47a6 100644 --- a/src/containers/UserMenu.jsx +++ b/src/containers/UserMenu.jsx @@ -88,7 +88,7 @@ class UserMenu extends Component { return (
{this.renderAvatar(currentUser, avatarSize)}