diff --git a/webapp/.npmrc b/webapp/.npmrc index 48d79633db..7f56c3b1a7 100644 --- a/webapp/.npmrc +++ b/webapp/.npmrc @@ -1,3 +1,3 @@ save-exact=true legacy-peer-deps=true -global-style=true \ No newline at end of file +global-style=true diff --git a/webapp/boards/package.json b/webapp/boards/package.json index e1ff155b5e..bf2a0f36e2 100644 --- a/webapp/boards/package.json +++ b/webapp/boards/package.json @@ -102,12 +102,11 @@ "@types/react-router-dom": "^5.3.3", "@types/react-transition-group": "4.4.4", "@types/redux-mock-store": "1.0.3", - "@typescript-eslint/eslint-plugin": "5.16.0", - "@typescript-eslint/parser": "5.16.0", + "@typescript-eslint/eslint-plugin": "5.57.1", + "@typescript-eslint/parser": "5.57.1", "babel-eslint": "10.1.0", "cross-env": "^7.0.3", "css-loader": "6.7.1", - "eslint": "^8.11.0", "eslint-import-resolver-webpack": "0.13.2", "eslint-plugin-babel": "^5.3.1", "eslint-plugin-formatjs": "4.9.0", diff --git a/webapp/channels/.eslintrc.json b/webapp/channels/.eslintrc.json index 7a3865a6db..94df6239d0 100644 --- a/webapp/channels/.eslintrc.json +++ b/webapp/channels/.eslintrc.json @@ -5,7 +5,7 @@ "plugin:react-hooks/recommended" ], "plugins": [ - "@babel/eslint-plugin", + "@babel", "mattermost", "import", "no-only-tests", diff --git a/webapp/channels/package.json b/webapp/channels/package.json index 830cbfae08..76653897db 100644 --- a/webapp/channels/package.json +++ b/webapp/channels/package.json @@ -7,7 +7,7 @@ "private": true, "engines": { "npm": ">=7.0.0", - "node": ">=16.4.0" + "node": ">=16.10.0" }, "dependencies": { "@floating-ui/react-dom": "1.0.0", @@ -153,8 +153,8 @@ "@types/styled-components": "5.1.24", "@types/tinycolor2": "1.4.3", "@types/webpack-env": "1.18.0", - "@typescript-eslint/eslint-plugin": "5.41.0", - "@typescript-eslint/parser": "5.41.0", + "@typescript-eslint/eslint-plugin": "5.57.1", + "@typescript-eslint/parser": "5.57.1", "babel-loader": "8.2.3", "babel-plugin-lodash": "3.3.4", "babel-plugin-styled-components": "1.12.0", @@ -167,14 +167,13 @@ "enzyme": "3.11.0", "enzyme-adapter-react-17-updated": "1.0.2", "enzyme-to-json": "3.6.2", - "eslint": "7.32.0", "eslint-import-resolver-webpack": "0.13.2", - "eslint-plugin-formatjs": "4.3.4", + "eslint-plugin-formatjs": "4.9.1", "eslint-plugin-header": "3.1.1", - "eslint-plugin-import": "2.23.4", + "eslint-plugin-import": "2.27.5", "eslint-plugin-mattermost": "github:mattermost/eslint-plugin-mattermost#5b0c972eacf19286e4c66221b39113bf8728a99e", - "eslint-plugin-no-only-tests": "2.6.0", - "eslint-plugin-react": "7.31.10", + "eslint-plugin-no-only-tests": "3.1.0", + "eslint-plugin-react": "7.32.2", "eslint-plugin-react-hooks": "4.6.0", "external-remotes-plugin": "1.0.0", "file-loader": "6.2.0", diff --git a/webapp/channels/src/components/about_build_modal/about_build_modal.tsx b/webapp/channels/src/components/about_build_modal/about_build_modal.tsx index c0ecc69a9a..ff7c7bd6ab 100644 --- a/webapp/channels/src/components/about_build_modal/about_build_modal.tsx +++ b/webapp/channels/src/components/about_build_modal/about_build_modal.tsx @@ -49,7 +49,7 @@ export default class AboutBuildModal extends React.PureComponent { doHide = () => { this.setState({show: false}); - } + }; render() { const config = this.props.config; diff --git a/webapp/channels/src/components/access_history_modal/access_history_modal.tsx b/webapp/channels/src/components/access_history_modal/access_history_modal.tsx index a167c364ee..af4d30fce3 100644 --- a/webapp/channels/src/components/access_history_modal/access_history_modal.tsx +++ b/webapp/channels/src/components/access_history_modal/access_history_modal.tsx @@ -32,11 +32,11 @@ export default class AccessHistoryModal extends React.PureComponent { // public for testing this.props.actions.getUserAudits(this.props.currentUserId, 0, 200); - } + }; public onHide = () => { // public for testing this.setState({show: false}); - } + }; public componentDidMount() { this.onShow(); diff --git a/webapp/channels/src/components/accordion.tsx b/webapp/channels/src/components/accordion.tsx index 63003bf87c..ecf9bbf9b4 100644 --- a/webapp/channels/src/components/accordion.tsx +++ b/webapp/channels/src/components/accordion.tsx @@ -23,7 +23,7 @@ export default class Accordion extends React.PureComponent { setExpanded = (expandedKey: string) => { this.setState({expandedKey}); - } + }; render() { return ( diff --git a/webapp/channels/src/components/actions_menu/actions_menu.tsx b/webapp/channels/src/components/actions_menu/actions_menu.tsx index d141f1f121..2c95fb63d4 100644 --- a/webapp/channels/src/components/actions_menu/actions_menu.tsx +++ b/webapp/channels/src/components/actions_menu/actions_menu.tsx @@ -92,7 +92,7 @@ export class ActionMenuClass extends React.PureComponent { appBindings: [], location: Locations.CENTER, pluginMenuItems: [], - } + }; private buttonRef: React.RefObject; constructor(props: Props) { @@ -115,7 +115,7 @@ export class ActionMenuClass extends React.PureComponent { defaultMessage='Message actions' /> - ) + ); componentDidUpdate(prevProps: Props) { if (this.props.isMenuOpen && !prevProps.isMenuOpen) { @@ -137,7 +137,7 @@ export class ActionMenuClass extends React.PureComponent { this.setState({appBindings: data}); }); } - } + }; handleOpenMarketplace = (): void => { const openedFrom: OpenedFromType = 'actions_menu'; @@ -197,7 +197,7 @@ export class ActionMenuClass extends React.PureComponent { this.props.actions.postEphemeralCallResponseForPost(callResp, errorMessage, post); } } - } + }; visitMarketplaceTip(): React.ReactElement { return ( @@ -263,7 +263,7 @@ export class ActionMenuClass extends React.PureComponent { this.setState({ openUp: (spaceOnTop > spaceOnBottom), }); - } + }; render(): React.ReactNode { const isSystemMessage = PostUtils.isSystemMessage(this.props.post); diff --git a/webapp/channels/src/components/activity_log_modal/activity_log_modal.tsx b/webapp/channels/src/components/activity_log_modal/activity_log_modal.tsx index b1e42be01d..94ddede970 100644 --- a/webapp/channels/src/components/activity_log_modal/activity_log_modal.tsx +++ b/webapp/channels/src/components/activity_log_modal/activity_log_modal.tsx @@ -53,7 +53,7 @@ type State = { export default class ActivityLogModal extends React.PureComponent { static propTypes = { - } + }; constructor(props: Props) { super(props); @@ -73,15 +73,15 @@ export default class ActivityLogModal extends React.PureComponent this.props.actions.revokeSession(this.props.currentUserId, altId).then(() => { this.props.actions.getSessions(this.props.currentUserId); }); - } + }; onShow = () => { this.props.actions.getSessions(this.props.currentUserId); - } + }; onHide = () => { this.setState({show: false}); - } + }; componentDidMount() { this.onShow(); diff --git a/webapp/channels/src/components/activity_log_modal/components/activity_log.tsx b/webapp/channels/src/components/activity_log_modal/components/activity_log.tsx index 121bb2e4bc..2c625e0972 100644 --- a/webapp/channels/src/components/activity_log_modal/components/activity_log.tsx +++ b/webapp/channels/src/components/activity_log_modal/components/activity_log.tsx @@ -56,11 +56,11 @@ export default class ActivityLog extends React.PureComponent { handleMoreInfo = (): void => { this.setState({moreInfo: true}); - } + }; submitRevoke = (e: React.MouseEvent): void => { this.props.submitRevoke(this.props.currentSession.id, e); - } + }; isMobileSession = (session: Session): boolean => { return Boolean(session.device_id && (session.device_id.includes('apple') || session.device_id.includes('android'))); diff --git a/webapp/channels/src/components/add_groups_to_channel_modal/add_groups_to_channel_modal.tsx b/webapp/channels/src/components/add_groups_to_channel_modal/add_groups_to_channel_modal.tsx index 195a50aa5c..98db0db487 100644 --- a/webapp/channels/src/components/add_groups_to_channel_modal/add_groups_to_channel_modal.tsx +++ b/webapp/channels/src/components/add_groups_to_channel_modal/add_groups_to_channel_modal.tsx @@ -110,7 +110,7 @@ export default class AddGroupsToChannelModal extends React.PureComponent { this.props.actions.setModalSearchTerm(''); this.setState({show: false}); - } + }; handleResponse = (err?: ServerError) => { let addError = null; @@ -122,7 +122,7 @@ export default class AddGroupsToChannelModal extends React.PureComponent { const groupIDs = this.state.values.map((v) => v.id); @@ -147,7 +147,7 @@ export default class AddGroupsToChannelModal extends React.PureComponent { const values = Object.assign([], this.state.values); @@ -157,13 +157,13 @@ export default class AddGroupsToChannelModal extends React.PureComponent { this.setState({ loadingGroups: loadingState, }); - } + }; handlePageChange = (page: number, prevPage: number) => { if (page > prevPage) { @@ -172,15 +172,15 @@ export default class AddGroupsToChannelModal extends React.PureComponent { this.setState({values}); - } + }; search = (term: string) => { this.props.actions.setModalSearchTerm(term); - } + }; renderOption = (option: GroupValue, isSelected: boolean, onAdd: (value: GroupValue) => void, onMouseMove?: (value: GroupValue) => void) => { const rowSelected = isSelected ? 'more-modal__row--selected' : ''; @@ -222,7 +222,7 @@ export default class AddGroupsToChannelModal extends React.PureComponent ); - } + }; renderValue(props: { data: Partial }) { return props.data.display_name; diff --git a/webapp/channels/src/components/add_groups_to_team_modal/add_groups_to_team_modal.tsx b/webapp/channels/src/components/add_groups_to_team_modal/add_groups_to_team_modal.tsx index c27ceb05af..69b03525e7 100644 --- a/webapp/channels/src/components/add_groups_to_team_modal/add_groups_to_team_modal.tsx +++ b/webapp/channels/src/components/add_groups_to_team_modal/add_groups_to_team_modal.tsx @@ -105,12 +105,12 @@ export default class AddGroupsToTeamModal extends React.PureComponent { this.props.actions.setModalSearchTerm(''); this.setState({show: false}); - } + }; // public for tests public handleExit = (): void => { this.props.onExited(); - } + }; // public for tests public handleResponse = (err?: Error): void => { @@ -123,7 +123,7 @@ export default class AddGroupsToTeamModal extends React.PureComponent { @@ -148,7 +148,7 @@ export default class AddGroupsToTeamModal extends React.PureComponent { @@ -159,13 +159,13 @@ export default class AddGroupsToTeamModal extends React.PureComponent { this.setState({ loadingGroups: loadingState, }); - } + }; // public for tests public handlePageChange = (page: number, prevPage: number): void => { @@ -175,7 +175,7 @@ export default class AddGroupsToTeamModal extends React.PureComponent this.setState({values}); @@ -224,7 +224,7 @@ export default class AddGroupsToTeamModal extends React.PureComponent ); - } + }; // public for tests public renderValue = (props: { data: Value }): string | undefined => props.data.display_name; diff --git a/webapp/channels/src/components/add_user_to_channel_modal/add_user_to_channel_modal.tsx b/webapp/channels/src/components/add_user_to_channel_modal/add_user_to_channel_modal.tsx index 4118fb94bf..6b2027fc6d 100644 --- a/webapp/channels/src/components/add_user_to_channel_modal/add_user_to_channel_modal.tsx +++ b/webapp/channels/src/components/add_user_to_channel_modal/add_user_to_channel_modal.tsx @@ -114,7 +114,7 @@ export default class AddUserToChannelModal extends React.PureComponent { this.suggestionProviders[0].disableDispatches = false; - } + }; focusTextbox = () => { if (this.channelSearchBox == null) { @@ -126,30 +126,30 @@ export default class AddUserToChannelModal extends React.PureComponent) => { this.setState({text: e.target.value, selectedChannelId: null}); - } + }; onHide = () => { this.setState({show: false}); - } + }; onExited = () => { this.props.onExited(); - } + }; setSearchBoxRef = (input: SuggestionBoxComponent) => { this.channelSearchBox = input; this.focusTextbox(); - } + }; handleSubmitError = (error: {message: string}) => { if (error) { this.setState({submitError: error.message, saving: false}); } - } + }; didSelectChannel = (selection: {channel: Channel}) => { const channel = selection.channel; @@ -165,7 +165,7 @@ export default class AddUserToChannelModal extends React.PureComponent { this.setState({checkingForMembership: false}); }); - } + }; handleSubmit = (e: FormEvent) => { if (e && e.preventDefault) { @@ -192,7 +192,7 @@ export default class AddUserToChannelModal extends React.PureComponent { const user = this.props.user; @@ -207,7 +207,7 @@ export default class AddUserToChannelModal extends React.PureComponent void, onMouseMove: (user: UserProfileValue) => void) => { return ( @@ -241,5 +241,5 @@ export default class AddUserToGroupMultiSelect extends React.PureComponent ); - } + }; } diff --git a/webapp/channels/src/components/add_users_to_team_modal/add_users_to_team_modal.tsx b/webapp/channels/src/components/add_users_to_team_modal/add_users_to_team_modal.tsx index 2ac8d764b0..bd43881448 100644 --- a/webapp/channels/src/components/add_users_to_team_modal/add_users_to_team_modal.tsx +++ b/webapp/channels/src/components/add_users_to_team_modal/add_users_to_team_modal.tsx @@ -78,11 +78,11 @@ export default class AddUsersToTeamModal extends React.PureComponent { await this.props.actions.getProfilesNotInTeam(this.props.team.id, false, 0, USERS_PER_PAGE * 2); this.setUsersLoadingState(false); - } + }; private setUsersLoadingState = (loading: boolean) => { this.setState({loading}); - } + }; public search = async (term: string) => { this.setUsersLoadingState(true); @@ -95,17 +95,17 @@ export default class AddUsersToTeamModal extends React.PureComponent { this.setState({show: false}); - } + }; private handleExit = () => { if (this.props.onExited) { this.props.onExited(); } - } + }; private renderOption = (option: UserProfileValue, isSelected: boolean, onAdd: (user: UserProfileValue) => void, onMouseMove: (user: UserProfileValue) => void) => { let rowSelected = ''; @@ -139,15 +139,15 @@ export default class AddUsersToTeamModal extends React.PureComponent ); - } + }; private renderValue = (value: { data: UserProfileValue }): string => { return value.data?.username || ''; - } + }; private renderAriaLabel = (option: UserProfileValue): string => { return option?.username || ''; - } + }; private handleAdd = (value: UserProfileValue) => { const values: UserProfileValue[] = [...this.state.values]; @@ -155,11 +155,11 @@ export default class AddUsersToTeamModal extends React.PureComponent { this.setState({values}); - } + }; private handlePageChange = (page: number, prevPage: number) => { if (page > prevPage) { @@ -173,7 +173,7 @@ export default class AddUsersToTeamModal extends React.PureComponent { this.props.onAddCallback(this.state.values); this.handleHide(); - } + }; public render = (): JSX.Element => { const numRemainingText = ( @@ -259,5 +259,5 @@ export default class AddUsersToTeamModal extends React.PureComponent ); - } + }; } diff --git a/webapp/channels/src/components/admin_console/admin_console.tsx b/webapp/channels/src/components/admin_console/admin_console.tsx index cdddacb13e..194a37926c 100644 --- a/webapp/channels/src/components/admin_console/admin_console.tsx +++ b/webapp/channels/src/components/admin_console/admin_console.tsx @@ -93,7 +93,7 @@ export default class AdminConsole extends React.PureComponent { private onFilterChange = (filter: string) => { this.setState({filter}); - } + }; private mainRolesLoaded(roles: Record) { return ( @@ -186,7 +186,7 @@ export default class AdminConsole extends React.PureComponent { {} ); - } + }; public render(): JSX.Element | null { const { diff --git a/webapp/channels/src/components/admin_console/admin_settings.tsx b/webapp/channels/src/components/admin_console/admin_settings.tsx index 8968448c97..8146a25916 100644 --- a/webapp/channels/src/components/admin_console/admin_settings.tsx +++ b/webapp/channels/src/components/admin_console/admin_settings.tsx @@ -69,7 +69,7 @@ export default abstract class AdminSettings { this.setState({errorTooltip: false}); - } + }; private openTooltip = (e: React.MouseEvent) => { const elm: HTMLElement|null = e.currentTarget.querySelector('.control-label'); @@ -77,7 +77,7 @@ export default abstract class AdminSettings { this.setState((prevState) => ({ @@ -95,7 +95,7 @@ export default abstract class AdminSettings void) => { this.setState({ diff --git a/webapp/channels/src/components/admin_console/admin_sidebar/admin_sidebar.tsx b/webapp/channels/src/components/admin_console/admin_sidebar/admin_sidebar.tsx index 6fbc22eeed..c29a0ed061 100644 --- a/webapp/channels/src/components/admin_console/admin_sidebar/admin_sidebar.tsx +++ b/webapp/channels/src/components/admin_console/admin_sidebar/admin_sidebar.tsx @@ -57,11 +57,11 @@ const renderScrollThumbVertical = (props: Props) => ( class AdminSidebar extends React.PureComponent { searchRef: React.RefObject; - idx: Index | null + idx: Index | null; static defaultProps = { plugins: {}, - } + }; constructor(props: Props) { super(props); @@ -130,7 +130,7 @@ class AdminSidebar extends React.PureComponent { } } } - } + }; updateTitle = () => { let currentSiteName = ''; @@ -139,7 +139,7 @@ class AdminSidebar extends React.PureComponent { } document.title = localizeMessage('sidebar_right_menu.console', 'System Console') + currentSiteName; - } + }; visibleSections = () => { const {config, license, buildEnterpriseReady, consoleAccess, adminDefinition, cloud} = this.props; @@ -166,7 +166,7 @@ class AdminSidebar extends React.PureComponent { } } return result; - } + }; renderRootMenu = (definition: typeof AdminDefinition) => { const {config, license, buildEnterpriseReady, consoleAccess, cloud, subscriptionProduct} = this.props; @@ -249,11 +249,11 @@ class AdminSidebar extends React.PureComponent { return null; }); return sidebarSections; - } + }; isPluginPresentInSections = (plugin: PluginRedux) => { return this.state.sections && this.state.sections.indexOf(`plugin_${plugin.id}`) >= 0; - } + }; renderPluginsMenu = () => { const {config, plugins} = this.props; @@ -279,12 +279,12 @@ class AdminSidebar extends React.PureComponent { } return []; - } + }; handleClearFilter = () => { this.setState({sections: null, filter: ''}); this.props.onFilterChange(''); - } + }; render() { const {showTaskList} = this.props; diff --git a/webapp/channels/src/components/admin_console/bleve_settings.jsx b/webapp/channels/src/components/admin_console/bleve_settings.jsx index 57b061aa96..8961b34bd6 100644 --- a/webapp/channels/src/components/admin_console/bleve_settings.jsx +++ b/webapp/channels/src/components/admin_console/bleve_settings.jsx @@ -25,7 +25,7 @@ export default class BleveSettings extends AdminSettings { config.BleveSettings.EnableAutocomplete = this.state.enableAutocomplete; return config; - } + }; getStateFromConfig(config) { return { @@ -55,17 +55,17 @@ export default class BleveSettings extends AdminSettings { } this.handleChange(id, value); - } + }; handleSaved = () => { this.setState({ canPurgeAndIndex: this.state.enableIndexing && this.state.indexDir !== '', }); - } + }; canSave = () => { return this.state.canSave; - } + }; getExtraInfo(job) { if (job.status === JobStatuses.IN_PROGRESS) { @@ -246,5 +246,5 @@ export default class BleveSettings extends AdminSettings { /> ); - } + }; } diff --git a/webapp/channels/src/components/admin_console/boolean_setting.tsx b/webapp/channels/src/components/admin_console/boolean_setting.tsx index 39490c97de..f114962661 100644 --- a/webapp/channels/src/components/admin_console/boolean_setting.tsx +++ b/webapp/channels/src/components/admin_console/boolean_setting.tsx @@ -40,7 +40,7 @@ export default class BooleanSetting extends React.PureComponent { private handleChange = (e: React.ChangeEvent) => { this.props.onChange(this.props.id, e.target.value === 'true'); - } + }; public render() { let helpText; diff --git a/webapp/channels/src/components/admin_console/cluster_settings.jsx b/webapp/channels/src/components/admin_console/cluster_settings.jsx index 0aaa90286e..b53aa7ec9b 100644 --- a/webapp/channels/src/components/admin_console/cluster_settings.jsx +++ b/webapp/channels/src/components/admin_console/cluster_settings.jsx @@ -29,7 +29,7 @@ export default class ClusterSettings extends AdminSettings { config.ClusterSettings.GossipPort = this.parseIntNonZero(this.state.GossipPort, 8074); config.ClusterSettings.StreamingPort = this.parseIntNonZero(this.state.StreamingPort, 8075); return config; - } + }; getStateFromConfig(config) { const settings = config.ClusterSettings; @@ -62,7 +62,7 @@ export default class ClusterSettings extends AdminSettings { }); this.handleChange(id, value); - } + }; renderSettings = () => { const licenseEnabled = this.props.license.IsLicensed === 'true' && this.props.license.Cluster === 'true'; @@ -309,7 +309,7 @@ export default class ClusterSettings extends AdminSettings { /> ); - } + }; } const style = { diff --git a/webapp/channels/src/components/admin_console/cluster_table.jsx b/webapp/channels/src/components/admin_console/cluster_table.jsx index 62c7fcf27f..aba8bb7234 100644 --- a/webapp/channels/src/components/admin_console/cluster_table.jsx +++ b/webapp/channels/src/components/admin_console/cluster_table.jsx @@ -15,7 +15,7 @@ export default class ClusterTable extends React.PureComponent { static propTypes = { clusterInfos: PropTypes.array.isRequired, reload: PropTypes.func.isRequired, - } + }; render() { var versionMismatch = ( diff --git a/webapp/channels/src/components/admin_console/cluster_table_container.jsx b/webapp/channels/src/components/admin_console/cluster_table_container.jsx index 99b36e4df1..bacb039ce0 100644 --- a/webapp/channels/src/components/admin_console/cluster_table_container.jsx +++ b/webapp/channels/src/components/admin_console/cluster_table_container.jsx @@ -28,7 +28,7 @@ export default class ClusterTableContainer extends React.PureComponent { }, null, ); - } + }; componentDidMount() { this.load(); @@ -53,7 +53,7 @@ export default class ClusterTableContainer extends React.PureComponent { }); this.load(); - } + }; render() { if (this.state.clusterInfos == null) { diff --git a/webapp/channels/src/components/admin_console/color_setting.tsx b/webapp/channels/src/components/admin_console/color_setting.tsx index b2fdd92cf0..54af4466d8 100644 --- a/webapp/channels/src/components/admin_console/color_setting.tsx +++ b/webapp/channels/src/components/admin_console/color_setting.tsx @@ -21,7 +21,7 @@ export default class ColorSetting extends React.PureComponent { if (this.props.onChange) { this.props.onChange(this.props.id, color); } - } + }; public render() { return ( diff --git a/webapp/channels/src/components/admin_console/compliance_reports/compliance_reports.tsx b/webapp/channels/src/components/admin_console/compliance_reports/compliance_reports.tsx index e80b9ca06a..e85e387664 100644 --- a/webapp/channels/src/components/admin_console/compliance_reports/compliance_reports.tsx +++ b/webapp/channels/src/components/admin_console/compliance_reports/compliance_reports.tsx @@ -94,7 +94,7 @@ export default class ComplianceReports extends React.PureComponent this.props.actions.getComplianceReports().then( () => this.setState({loadingReports: false}), ); - } + }; runReport = (e: React.MouseEvent) => { e.preventDefault(); @@ -131,7 +131,7 @@ export default class ComplianceReports extends React.PureComponent this.props.actions.getComplianceReports(); }, ); - } + }; getDateTime(millis: number) { const date = new Date(millis); diff --git a/webapp/channels/src/components/admin_console/custom_terms_of_service_settings/custom_terms_of_service_settings.tsx b/webapp/channels/src/components/admin_console/custom_terms_of_service_settings/custom_terms_of_service_settings.tsx index 3b32a05e39..4342b2d7f2 100644 --- a/webapp/channels/src/components/admin_console/custom_terms_of_service_settings/custom_terms_of_service_settings.tsx +++ b/webapp/channels/src/components/admin_console/custom_terms_of_service_settings/custom_terms_of_service_settings.tsx @@ -73,7 +73,7 @@ export default class CustomTermsOfServiceSettings extends AdminSettings ); - } + }; } diff --git a/webapp/channels/src/components/admin_console/data_grid/data_grid.tsx b/webapp/channels/src/components/admin_console/data_grid/data_grid.tsx index f6f696827d..37c4665c05 100644 --- a/webapp/channels/src/components/admin_console/data_grid/data_grid.tsx +++ b/webapp/channels/src/components/admin_console/data_grid/data_grid.tsx @@ -82,7 +82,7 @@ class DataGrid extends React.PureComponent { static defaultProps = { term: '', searchPlaceholder: '', - } + }; public constructor(props: Props) { super(props); @@ -134,7 +134,7 @@ class DataGrid extends React.PureComponent { }); this.setState({visibleColumns}); - } + }; private renderRows(): JSX.Element { const {rows, rowsContainerStyles} = this.props; @@ -219,19 +219,19 @@ class DataGrid extends React.PureComponent { if (!this.props.loading) { this.props.nextPage(); } - } + }; private previousPage = () => { if (!this.props.loading) { this.props.previousPage(); } - } + }; private search = (term: string) => { if (this.props.onSearch) { this.props.onSearch(term); } - } + }; private renderFooter = (): JSX.Element | null => { const {startCount, endCount, total} = this.props; @@ -286,7 +286,7 @@ class DataGrid extends React.PureComponent { } return footer; - } + }; public render() { return ( diff --git a/webapp/channels/src/components/admin_console/data_grid/data_grid_search.tsx b/webapp/channels/src/components/admin_console/data_grid/data_grid_search.tsx index d347a7b2c1..9b514c0a6b 100644 --- a/webapp/channels/src/components/admin_console/data_grid/data_grid_search.tsx +++ b/webapp/channels/src/components/admin_console/data_grid/data_grid_search.tsx @@ -32,7 +32,7 @@ class DataGridSearch extends React.PureComponent { static defaultProps = { placeholder: '', term: '', - } + }; public constructor(props: Props) { super(props); @@ -46,7 +46,7 @@ class DataGridSearch extends React.PureComponent { const term = e.target.value; this.setState({term}); this.props.onSearch(term); - } + }; resetSearch = () => { this.props.onSearch(''); diff --git a/webapp/channels/src/components/admin_console/data_retention_settings/channel_list/channel_list.tsx b/webapp/channels/src/components/admin_console/data_retention_settings/channel_list/channel_list.tsx index 37c996dc17..0e5711134e 100644 --- a/webapp/channels/src/components/admin_console/data_retention_settings/channel_list/channel_list.tsx +++ b/webapp/channels/src/components/admin_console/data_retention_settings/channel_list/channel_list.tsx @@ -58,14 +58,14 @@ export default class ChannelList extends React.PureComponent { componentDidMount = () => { this.loadPage(0, PAGE_SIZE * 2); - } + }; private setStateLoading = (loading: boolean) => { this.setState({loading}); - } + }; private setStatePage = (page: number) => { this.setState({page}); - } + }; private loadPage = async (page: number, pageSize = PAGE_SIZE) => { if (this.props.policyId) { @@ -73,26 +73,26 @@ export default class ChannelList extends React.PureComponent { await this.props.actions.getDataRetentionCustomPolicyChannels(this.props.policyId, page, pageSize); this.setStateLoading(false); } - } + }; private nextPage = () => { const page = this.state.page + 1; this.loadPage(page + 1); this.setStatePage(page); - } + }; private previousPage = () => { const page = this.state.page - 1; this.loadPage(page + 1); this.setStatePage(page); - } + }; private getVisibleTotalCount = (): number => { const {channelsToAdd, channelsToRemove, totalCount} = this.props; const channelsToAddCount = Object.keys(channelsToAdd).length; const channelsToRemoveCount = Object.keys(channelsToRemove).length; return totalCount + (channelsToAddCount - channelsToRemoveCount); - } + }; public getPaginationProps = (): {startCount: number; endCount: number; total: number} => { const {page} = this.state; @@ -105,7 +105,7 @@ export default class ChannelList extends React.PureComponent { endCount = endCount > total ? total : endCount; return {startCount, endCount, total}; - } + }; private removeChannel = (channel: ChannelWithTeamData) => { const {channelsToRemove} = this.props; @@ -122,7 +122,7 @@ export default class ChannelList extends React.PureComponent { } this.setStatePage(page); - } + }; getColumns = (): Column[] => { const name = ( @@ -157,7 +157,7 @@ export default class ChannelList extends React.PureComponent { fixed: true, }, ]; - } + }; getRows = () => { const {page} = this.state; @@ -235,11 +235,11 @@ export default class ChannelList extends React.PureComponent { }, }; }); - } + }; onSearch = async (searchTerm: string) => { this.props.actions.setChannelListSearch(searchTerm); - } + }; public async componentDidUpdate(prevProps: Props) { const {policyId, searchTerm, filters} = this.props; const filtersModified = !isEqual(prevProps.filters, this.props.filters); @@ -284,7 +284,7 @@ export default class ChannelList extends React.PureComponent { filters.team_ids = teamIds.value as string[]; } this.props.actions.setChannelListFilters(filters); - } + }; render() { const rows: Row[] = this.getRows(); const columns: Column[] = this.getColumns(); diff --git a/webapp/channels/src/components/admin_console/data_retention_settings/custom_policy_form/custom_policy_form.tsx b/webapp/channels/src/components/admin_console/data_retention_settings/custom_policy_form/custom_policy_form.tsx index 1c296d540f..96d1f534ce 100644 --- a/webapp/channels/src/components/admin_console/data_retention_settings/custom_policy_form/custom_policy_form.tsx +++ b/webapp/channels/src/components/admin_console/data_retention_settings/custom_policy_form/custom_policy_form.tsx @@ -93,19 +93,19 @@ export default class CustomPolicyForm extends React.PureComponent openAddChannel = () => { this.setState({addChannelOpen: true}); - } + }; closeAddChannel = () => { this.setState({addChannelOpen: false}); - } + }; openAddTeam = () => { this.setState({addTeamOpen: true}); - } + }; closeAddTeam = () => { this.setState({addTeamOpen: false}); - } + }; getMessageRetentionDefaultInputValue = (): string => { if (!this.props.policy || Object.keys(this.props.policy).length === 0 || (this.props.policy && this.props.policy.post_duration === -1)) { return ''; @@ -114,7 +114,7 @@ export default class CustomPolicyForm extends React.PureComponent return (this.props.policy.post_duration / 365).toString(); } return this.props.policy.post_duration.toString(); - } + }; getMessageRetentionDefaultDropdownValue = () => { if (!this.props.policyId || (this.props.policy && this.props.policy.post_duration === -1)) { return keepForeverOption(); @@ -123,11 +123,11 @@ export default class CustomPolicyForm extends React.PureComponent return yearsOption(); } return daysOption(); - } + }; componentDidMount = async () => { this.loadPage(); - } + }; private loadPage = async () => { if (this.props.policyId) { await this.props.actions.fetchPolicy(this.props.policyId); @@ -137,7 +137,7 @@ export default class CustomPolicyForm extends React.PureComponent messageRetentionDropdownValue: this.getMessageRetentionDefaultDropdownValue(), }); } - } + }; addToNewTeams = (teams: Team[]) => { let {removedTeamsCount} = this.state; @@ -152,7 +152,7 @@ export default class CustomPolicyForm extends React.PureComponent }); this.setState({newTeams: {...newTeams}, removedTeams: {...removedTeams}, removedTeamsCount, saveNeeded: true}); this.props.actions.setNavigationBlocked(true); - } + }; addToRemovedTeams = (team: Team) => { let {removedTeamsCount} = this.state; @@ -165,7 +165,7 @@ export default class CustomPolicyForm extends React.PureComponent } this.setState({removedTeams: {...removedTeams}, newTeams: {...newTeams}, removedTeamsCount, saveNeeded: true}); this.props.actions.setNavigationBlocked(true); - } + }; addToNewChannels = (channels: ChannelWithTeamData[]) => { let {removedChannelsCount} = this.state; @@ -180,7 +180,7 @@ export default class CustomPolicyForm extends React.PureComponent }); this.setState({newChannels: {...newChannels}, removedChannels: {...removedChannels}, removedChannelsCount, saveNeeded: true}); this.props.actions.setNavigationBlocked(true); - } + }; addToRemovedChannels = (channel: ChannelWithTeamData) => { let {removedChannelsCount} = this.state; @@ -193,7 +193,7 @@ export default class CustomPolicyForm extends React.PureComponent } this.setState({removedChannels: {...removedChannels}, newChannels: {...newChannels}, removedChannelsCount, saveNeeded: true}); this.props.actions.setNavigationBlocked(true); - } + }; getTeamsToExclude = () => { const {teams} = this.props; @@ -210,7 +210,7 @@ export default class CustomPolicyForm extends React.PureComponent teamsToDisplay = [...includeTeamsList, ...teamsToDisplay]; } return teamsToDisplay; - } + }; handleSubmit = async () => { const {policyName, messageRetentionInputValue, messageRetentionDropdownValue, newTeams, removedTeams, newChannels, removedChannels} = this.state; const {policyId, policy} = this.props; @@ -302,7 +302,7 @@ export default class CustomPolicyForm extends React.PureComponent this.props.actions.setNavigationBlocked(false); getHistory().push('/admin_console/compliance/data_retention_settings'); } - } + }; render = () => { const {serverError, formErrorText} = this.state; @@ -531,5 +531,5 @@ export default class CustomPolicyForm extends React.PureComponent ); - } + }; } diff --git a/webapp/channels/src/components/admin_console/data_retention_settings/data_retention_settings.tsx b/webapp/channels/src/components/admin_console/data_retention_settings/data_retention_settings.tsx index a23b555546..468ea078aa 100644 --- a/webapp/channels/src/components/admin_console/data_retention_settings/data_retention_settings.tsx +++ b/webapp/channels/src/components/admin_console/data_retention_settings/data_retention_settings.tsx @@ -65,9 +65,9 @@ export default class DataRetentionSettings extends React.PureComponent { await this.props.actions.deleteDataRetentionCustomPolicy(id); this.loadPage(0); - } + }; - includeBoards = this.props.config.PluginSettings?.PluginStates?.focalboard?.Enable && this.props.config.FeatureFlags?.BoardsDataRetention + includeBoards = this.props.config.PluginSettings?.PluginStates?.focalboard?.Enable && this.props.config.FeatureFlags?.BoardsDataRetention; getGlobalPolicyColumns = (): Column[] => { const columns: Column[] = [ { @@ -119,7 +119,7 @@ export default class DataRetentionSettings extends React.PureComponent { const columns: Column[] = [ { @@ -156,7 +156,7 @@ export default class DataRetentionSettings extends React.PureComponent { if (!enabled) { return ( @@ -187,7 +187,7 @@ export default class DataRetentionSettings extends React.PureComponent ); - } + }; getGlobalPolicyRows = (): Row[] => { const {DataRetentionSettings} = this.props.config; return [{ @@ -240,7 +240,7 @@ export default class DataRetentionSettings extends React.PureComponent { if (policy.channel_count === 0 && policy.team_count === 0) { return ( @@ -260,7 +260,7 @@ export default class DataRetentionSettings extends React.PureComponent ); - } + }; getCustomPolicyRows = (startCount: number, endCount: number): Row[] => { let policies = Object.values(this.props.customPolicies); policies = policies.slice(startCount - 1, endCount); @@ -333,18 +333,18 @@ export default class DataRetentionSettings extends React.PureComponent { await this.loadPage(this.state.page); - } + }; private nextPage = () => { this.loadPage(this.state.page + 1); - } + }; private previousPage = () => { this.loadPage(this.state.page - 1); - } + }; public getPaginationProps = (): {startCount: number; endCount: number; total: number} => { const {page} = this.state; @@ -354,17 +354,17 @@ export default class DataRetentionSettings extends React.PureComponent total ? total : endCount; return {startCount, endCount, total}; - } + }; showEditJobTime = (value: boolean) => { this.setState({showEditJobTime: value}); - } + }; componentDidUpdate = (prevProps: Props, prevState: State) => { if (prevState.showEditJobTime !== this.state.showEditJobTime && this.state.showEditJobTime) { this.inputRef.current?.focus(); } - } + }; handleCreateJob = async (e?: React.SyntheticEvent) => { e?.preventDefault(); @@ -382,7 +382,7 @@ export default class DataRetentionSettings extends React.PureComponent { const {DataRetentionSettings} = this.props.config; @@ -417,7 +417,7 @@ export default class DataRetentionSettings extends React.PureComponent ); - } + }; getJobTimeOptions = () => { const options: OptionType[] = []; return () => { @@ -445,7 +445,7 @@ export default class DataRetentionSettings extends React.PureComponent { @@ -653,5 +653,5 @@ export default class DataRetentionSettings extends React.PureComponent ); - } + }; } diff --git a/webapp/channels/src/components/admin_console/data_retention_settings/global_policy_form/global_policy_form.tsx b/webapp/channels/src/components/admin_console/data_retention_settings/global_policy_form/global_policy_form.tsx index ac10fce6b6..596a9d965c 100644 --- a/webapp/channels/src/components/admin_console/data_retention_settings/global_policy_form/global_policy_form.tsx +++ b/webapp/channels/src/components/admin_console/data_retention_settings/global_policy_form/global_policy_form.tsx @@ -60,7 +60,7 @@ export default class GlobalPolicyForm extends React.PureComponent }; } - includeBoards = this.props.config.PluginSettings?.PluginStates?.focalboard?.Enable && this.props.config.FeatureFlags?.BoardsDataRetention + includeBoards = this.props.config.PluginSettings?.PluginStates?.focalboard?.Enable && this.props.config.FeatureFlags?.BoardsDataRetention; getDefaultInputValue = (isEnabled: boolean | undefined, days: number | undefined): string => { if (!isEnabled || days === undefined) { @@ -70,7 +70,7 @@ export default class GlobalPolicyForm extends React.PureComponent return (days / 365).toString(); } return days.toString(); - } + }; getDefaultDropdownValue = (isEnabled: boolean | undefined, days: number | undefined) => { if (!isEnabled || days === undefined) { return keepForeverOption(); @@ -79,7 +79,7 @@ export default class GlobalPolicyForm extends React.PureComponent return yearsOption(); } return daysOption(); - } + }; handleSubmit = async () => { const {messageRetentionDropdownValue, messageRetentionInputValue, fileRetentionDropdownValue, fileRetentionInputValue, boardsRetentionDropdownValue, boardsRetentionInputValue} = this.state; @@ -128,7 +128,7 @@ export default class GlobalPolicyForm extends React.PureComponent return false; } return true; - } + }; setRetentionDays = (dropdownValue: string, value: string): number => { if (dropdownValue === YEARS) { @@ -140,7 +140,7 @@ export default class GlobalPolicyForm extends React.PureComponent } return 0; - } + }; render = () => { return ( @@ -290,5 +290,5 @@ export default class GlobalPolicyForm extends React.PureComponent ); - } + }; } diff --git a/webapp/channels/src/components/admin_console/data_retention_settings/team_list/team_list.tsx b/webapp/channels/src/components/admin_console/data_retention_settings/team_list/team_list.tsx index 2aa71b7662..da7902860d 100644 --- a/webapp/channels/src/components/admin_console/data_retention_settings/team_list/team_list.tsx +++ b/webapp/channels/src/components/admin_console/data_retention_settings/team_list/team_list.tsx @@ -52,14 +52,14 @@ export default class TeamList extends React.PureComponent { componentDidMount = () => { this.loadPage(0, PAGE_SIZE * 2); - } + }; private setStateLoading = (loading: boolean) => { this.setState({loading}); - } + }; private setStatePage = (page: number) => { this.setState({page}); - } + }; private loadPage = async (page: number, pageSize = PAGE_SIZE) => { if (this.props.policyId) { @@ -67,26 +67,26 @@ export default class TeamList extends React.PureComponent { await this.props.actions.getDataRetentionCustomPolicyTeams(this.props.policyId, page, pageSize); this.setStateLoading(false); } - } + }; private nextPage = () => { const page = this.state.page + 1; this.loadPage(page + 1); this.setStatePage(page); - } + }; private previousPage = () => { const page = this.state.page - 1; this.loadPage(page + 1); this.setStatePage(page); - } + }; private getVisibleTotalCount = (): number => { const {teamsToAdd, teamsToRemove, totalCount} = this.props; const teamsToAddCount = Object.keys(teamsToAdd).length; const teamsToRemoveCount = Object.keys(teamsToRemove).length; return totalCount + (teamsToAddCount - teamsToRemoveCount); - } + }; public getPaginationProps = (): {startCount: number; endCount: number; total: number} => { const {page} = this.state; @@ -98,7 +98,7 @@ export default class TeamList extends React.PureComponent { endCount = endCount > total ? total : endCount; return {startCount, endCount, total}; - } + }; private removeTeam = (team: Team) => { const {teamsToRemove} = this.props; @@ -115,7 +115,7 @@ export default class TeamList extends React.PureComponent { } this.setStatePage(page); - } + }; getColumns = (): Column[] => { const name = ( @@ -139,7 +139,7 @@ export default class TeamList extends React.PureComponent { className: 'TeamList__actionColumn', }, ]; - } + }; getRows = () => { const {page} = this.state; @@ -203,11 +203,11 @@ export default class TeamList extends React.PureComponent { }, }; }); - } + }; onSearch = async (searchTerm: string) => { this.props.actions.setTeamListSearch(searchTerm); - } + }; public async componentDidUpdate(prevProps: Props) { const {searchTerm} = this.props; const searchTermModified = prevProps.searchTerm !== this.props.searchTerm; diff --git a/webapp/channels/src/components/admin_console/database_settings.jsx b/webapp/channels/src/components/admin_console/database_settings.jsx index 0f8433ea35..e75e100c89 100644 --- a/webapp/channels/src/components/admin_console/database_settings.jsx +++ b/webapp/channels/src/components/admin_console/database_settings.jsx @@ -32,7 +32,7 @@ export default class DatabaseSettings extends AdminSettings { config.ServiceSettings.MinimumHashtagLength = this.parseIntNonZero(this.state.minimumHashtagLength, 3, 2); return config; - } + }; getStateFromConfig(config) { return { @@ -370,5 +370,5 @@ export default class DatabaseSettings extends AdminSettings { ); - } + }; } diff --git a/webapp/channels/src/components/admin_console/dropdown_setting.jsx b/webapp/channels/src/components/admin_console/dropdown_setting.jsx index c03595dd02..0f43681563 100644 --- a/webapp/channels/src/components/admin_console/dropdown_setting.jsx +++ b/webapp/channels/src/components/admin_console/dropdown_setting.jsx @@ -16,15 +16,15 @@ export default class DropdownSetting extends React.PureComponent { disabled: PropTypes.bool, setByEnv: PropTypes.bool.isRequired, helpText: PropTypes.node, - } + }; static defaultProps = { isDisabled: false, - } + }; handleChange = (e) => { this.props.onChange(this.props.id, e.target.value); - } + }; render() { const options = []; diff --git a/webapp/channels/src/components/admin_console/elasticsearch_settings.jsx b/webapp/channels/src/components/admin_console/elasticsearch_settings.jsx index 6753aa542b..a898283b52 100644 --- a/webapp/channels/src/components/admin_console/elasticsearch_settings.jsx +++ b/webapp/channels/src/components/admin_console/elasticsearch_settings.jsx @@ -33,7 +33,7 @@ export default class ElasticsearchSettings extends AdminSettings { config.ElasticsearchSettings.EnableAutocomplete = this.state.enableAutocomplete; return config; - } + }; getStateFromConfig(config) { return { @@ -83,17 +83,17 @@ export default class ElasticsearchSettings extends AdminSettings { } this.handleChange(id, value); - } + }; handleSaved = () => { this.setState({ canPurgeAndIndex: this.state.enableIndexing, }); - } + }; canSave = () => { return this.state.canSave; - } + }; doTestConfig = (success, error) => { const config = JSON.parse(JSON.stringify(this.props.config)); @@ -116,7 +116,7 @@ export default class ElasticsearchSettings extends AdminSettings { error(err); }, ); - } + }; getExtraInfo(job) { if (job.status === JobStatuses.IN_PROGRESS) { @@ -470,5 +470,5 @@ export default class ElasticsearchSettings extends AdminSettings { /> ); - } + }; } diff --git a/webapp/channels/src/components/admin_console/feature_discovery/feature_discovery.tsx b/webapp/channels/src/components/admin_console/feature_discovery/feature_discovery.tsx index 61a675007a..e2faca2227 100644 --- a/webapp/channels/src/components/admin_console/feature_discovery/feature_discovery.tsx +++ b/webapp/channels/src/components/admin_console/feature_discovery/feature_discovery.tsx @@ -97,7 +97,7 @@ export default class FeatureDiscovery extends React.PureComponent callerCTA: 'feature_discovery_subscribe_button', }, }); - } + }; contactSalesFunc = () => { const {customer, isCloud} = this.props; @@ -107,7 +107,7 @@ export default class FeatureDiscovery extends React.PureComponent const companyName = customer?.name || ''; const utmMedium = isCloud ? 'in-product-cloud' : 'in-product'; goToMattermostContactSalesForm(firstName, lastName, companyName, customerEmail, 'mattermost', utmMedium); - } + }; renderPostTrialCta = () => { const { @@ -164,7 +164,7 @@ export default class FeatureDiscovery extends React.PureComponent ); - } + }; renderStartTrial = (learnMoreURL: string, gettingTrialError: React.ReactNode) => { const { @@ -317,7 +317,7 @@ export default class FeatureDiscovery extends React.PureComponent

} ); - } + }; render() { const { diff --git a/webapp/channels/src/components/admin_console/file_upload_setting.jsx b/webapp/channels/src/components/admin_console/file_upload_setting.jsx index 118a070bac..b0219545b0 100644 --- a/webapp/channels/src/components/admin_console/file_upload_setting.jsx +++ b/webapp/channels/src/components/admin_console/file_upload_setting.jsx @@ -39,7 +39,7 @@ export default class FileUploadSetting extends Setting { if (files && files.length > 0) { this.setState({fileSelected: true, fileName: files[0].name}); } - } + }; handleSubmit = (e) => { e.preventDefault(); @@ -51,7 +51,7 @@ export default class FileUploadSetting extends Setting { Utils.clearFileInput(this.fileInputRef.current); } }); - } + }; render() { let serverError; diff --git a/webapp/channels/src/components/admin_console/filter/filter.tsx b/webapp/channels/src/components/admin_console/filter/filter.tsx index 70a567b00c..4bfb4b37de 100644 --- a/webapp/channels/src/components/admin_console/filter/filter.tsx +++ b/webapp/channels/src/components/admin_console/filter/filter.tsx @@ -96,23 +96,23 @@ class Filter extends React.PureComponent { componentDidMount = () => { document.addEventListener('mousedown', this.handleClickOutside); - } + }; componentWillUnmount = () => { document.removeEventListener('mousedown', this.handleClickOutside); - } + }; handleClickOutside = (event: MouseEvent) => { if (this.filterRef?.current?.contains(event.target as Node)) { return; } this.hidePopover(); - } + }; hidePopover = () => { this.setState({show: false}); this.buttonRef?.current?.blur(); - } + }; togglePopover = () => { if (this.state.show) { @@ -121,7 +121,7 @@ class Filter extends React.PureComponent { } this.setState({show: true}); - } + }; updateValues = async (values: FilterValues, optionKey: string) => { const options = { @@ -134,12 +134,12 @@ class Filter extends React.PureComponent { }, }; this.setState({options, optionsModified: true}); - } + }; onFilter = () => { this.props.onFilter(this.state.options); this.setState({optionsModified: false, show: false, filterCount: this.calculateFilterCount()}); - } + }; calculateFilterCount = () => { const options = this.state.options; @@ -155,11 +155,11 @@ class Filter extends React.PureComponent { }); }); return filterCount; - } + }; resetFilters = () => { this.setState({options: {...this.props.options}}, this.onFilter); - } + }; renderFilterOptions = () => { const {keys, options} = this.state; @@ -176,7 +176,7 @@ class Filter extends React.PureComponent { /> ); }); - } + }; render() { const filters = this.renderFilterOptions(); diff --git a/webapp/channels/src/components/admin_console/filter/filter_checkbox.tsx b/webapp/channels/src/components/admin_console/filter/filter_checkbox.tsx index 47484f2ab0..32ffef2625 100644 --- a/webapp/channels/src/components/admin_console/filter/filter_checkbox.tsx +++ b/webapp/channels/src/components/admin_console/filter/filter_checkbox.tsx @@ -16,7 +16,7 @@ class FilterCheckbox extends React.PureComponent { e.stopPropagation(); const {checked, name, updateOption} = this.props; updateOption(!checked, name); - } + }; render() { const {name, checked, label} = this.props; diff --git a/webapp/channels/src/components/admin_console/filter/filter_list.tsx b/webapp/channels/src/components/admin_console/filter/filter_list.tsx index f3cbb2d02b..41e0e82b84 100644 --- a/webapp/channels/src/components/admin_console/filter/filter_list.tsx +++ b/webapp/channels/src/components/admin_console/filter/filter_list.tsx @@ -23,7 +23,7 @@ class FilterList extends React.PureComponent { }, }; await this.props.updateValues(values, this.props.optionKey); - } + }; render() { const {option} = this.props; diff --git a/webapp/channels/src/components/admin_console/filter/team_filter_dropdown/team_filter_checkbox.tsx b/webapp/channels/src/components/admin_console/filter/team_filter_dropdown/team_filter_checkbox.tsx index 5c86c46ae7..48d3a88a5c 100644 --- a/webapp/channels/src/components/admin_console/filter/team_filter_dropdown/team_filter_checkbox.tsx +++ b/webapp/channels/src/components/admin_console/filter/team_filter_dropdown/team_filter_checkbox.tsx @@ -15,7 +15,7 @@ class TeamFilterCheckbox extends React.PureComponent { toggleOption = () => { const {checked, id, updateOption} = this.props; updateOption(!checked, id); - } + }; render() { const { diff --git a/webapp/channels/src/components/admin_console/filter/team_filter_dropdown/team_filter_dropdown.tsx b/webapp/channels/src/components/admin_console/filter/team_filter_dropdown/team_filter_dropdown.tsx index b683ae5a6f..0d4121f182 100644 --- a/webapp/channels/src/components/admin_console/filter/team_filter_dropdown/team_filter_dropdown.tsx +++ b/webapp/channels/src/components/admin_console/filter/team_filter_dropdown/team_filter_dropdown.tsx @@ -100,11 +100,11 @@ class TeamFilterDropdown extends React.PureComponent { componentWillUnmount = () => { document.removeEventListener('mousedown', this.handleClickOutside); - } + }; hidePopover = () => { this.setState({show: false}); - } + }; togglePopover = (event: React.MouseEvent) => { if (this.state.show) { @@ -125,18 +125,18 @@ class TeamFilterDropdown extends React.PureComponent { this.listRef.current.scrollTop = 0; } }); - } + }; handleClickOutside = (event: MouseEvent) => { if (this.ref?.current?.contains(event.target as Node)) { return; } this.hidePopover(); - } + }; setScrollPosition = (event: React.UIEvent) => { this.scrollPosition = (event.target as HTMLDivElement).scrollTop; - } + }; hasMore = (): boolean => { if (this.state.loading) { @@ -145,7 +145,7 @@ class TeamFilterDropdown extends React.PureComponent { return this.state.searchTotal > this.state.searchResults.length; } return this.props.total > (this.state.page + 1) * TEAMS_PER_PAGE; - } + }; loadMore = async () => { const {searchTerm, loading} = this.state; @@ -165,7 +165,7 @@ class TeamFilterDropdown extends React.PureComponent { } this.setState({page, loading: false}); - } + }; searchTeams = async (term: string, page: number) => { let searchResults = []; @@ -180,7 +180,7 @@ class TeamFilterDropdown extends React.PureComponent { } this.searchRetryInterval *= 2; this.searchRetryId = window.setTimeout(this.searchTeams.bind(null, term, page), this.searchRetryInterval); - } + }; searchTeamsDebounced = debounce((page, term) => this.searchTeams(term, page), INITIAL_SEARCH_RETRY_TIMEOUT, false, () => {}); @@ -203,12 +203,12 @@ class TeamFilterDropdown extends React.PureComponent { } this.searchTeamsDebounced(0, searchTerm); - } + }; resetTeams = () => { this.setState({savedSelectedTeams: [], show: false, searchResults: [], searchTotal: 0, page: 0, searchTerm: ''}); this.props.updateValues({team_ids: {name: 'Teams', value: []}}, 'teams'); - } + }; toggleTeam = (checked: boolean, teamId: string) => { const prevSelectedTeamIds = this.props.option.values.team_ids.value as string[]; @@ -220,7 +220,7 @@ class TeamFilterDropdown extends React.PureComponent { } this.props.updateValues({team_ids: {name: 'Teams', value: selectedTeamIds}}, 'teams'); - } + }; generateButtonText = () => { const selectedTeamIds = this.props.option.values.team_ids.value as string[]; @@ -252,7 +252,7 @@ class TeamFilterDropdown extends React.PureComponent { }); return {buttonText, buttonMore}; - } + }; render() { const selectedTeamIds = this.props.option.values.team_ids.value as string[]; diff --git a/webapp/channels/src/components/admin_console/full_log_event_modal/full_log_event_modal.tsx b/webapp/channels/src/components/admin_console/full_log_event_modal/full_log_event_modal.tsx index a960637357..df5ca2f0a9 100644 --- a/webapp/channels/src/components/admin_console/full_log_event_modal/full_log_event_modal.tsx +++ b/webapp/channels/src/components/admin_console/full_log_event_modal/full_log_event_modal.tsx @@ -42,12 +42,12 @@ export default class FullLogEventModal extends React.PureComponent ); - } + }; copyLog = () => { navigator.clipboard.writeText(JSON.stringify(this.props.log, undefined, 2)); this.showCopySuccess(); - } + }; exportToCsv = () => { const file = navigator.clipboard.writeText(JSON.stringify(this.props.log, undefined, 2)); @@ -55,7 +55,7 @@ export default class FullLogEventModal extends React.PureComponent const encodedUri = encodeURI(csvContent); window.open(encodedUri); this.showExportSuccess(); - } + }; showCopySuccess = () => { this.setState({ @@ -67,7 +67,7 @@ export default class FullLogEventModal extends React.PureComponent copySuccess: false, }); }, 3000); - } + }; showExportSuccess = () => { this.setState({ @@ -79,7 +79,7 @@ export default class FullLogEventModal extends React.PureComponent exportSuccess: false, }); }, 3000); - } + }; render() { return ( diff --git a/webapp/channels/src/components/admin_console/generated_setting.tsx b/webapp/channels/src/components/admin_console/generated_setting.tsx index 6871f983c0..8f00f5c862 100644 --- a/webapp/channels/src/components/admin_console/generated_setting.tsx +++ b/webapp/channels/src/components/admin_console/generated_setting.tsx @@ -39,7 +39,7 @@ export default class GeneratedSetting extends React.PureComponent { e.preventDefault(); this.props.onChange(this.props.id, crypto.randomBytes(256).toString('base64').substring(0, 32)); - } + }; public render() { let disabledText = null; diff --git a/webapp/channels/src/components/admin_console/group_settings/groups_list/groups_list.tsx b/webapp/channels/src/components/admin_console/group_settings/groups_list/groups_list.tsx index bc3ba40028..b309efa433 100644 --- a/webapp/channels/src/components/admin_console/group_settings/groups_list/groups_list.tsx +++ b/webapp/channels/src/components/admin_console/group_settings/groups_list/groups_list.tsx @@ -88,7 +88,7 @@ export default class GroupsList extends React.PureComponent { public closeFilters = () => { this.setState({showFilters: false}); - } + }; public componentDidMount() { this.props.actions.getLdapGroups(this.state.page, LDAP_GROUPS_PAGE_SIZE).then(() => { @@ -222,7 +222,7 @@ export default class GroupsList extends React.PureComponent { ); - } + }; public renderRows(): JSX.Element | JSX.Element[] { if (this.state.loading) { @@ -437,7 +437,7 @@ export default class GroupsList extends React.PureComponent { this.props.actions.getLdapGroups(this.state.page, LDAP_GROUPS_PAGE_SIZE, {q: ''}).then(() => { this.setState({loading: false}); }); - } + }; public render(): JSX.Element { const startCount = (this.state.page * LDAP_GROUPS_PAGE_SIZE) + 1; diff --git a/webapp/channels/src/components/admin_console/jobs/table.tsx b/webapp/channels/src/components/admin_console/jobs/table.tsx index f198e1e81e..1cd72a058b 100644 --- a/webapp/channels/src/components/admin_console/jobs/table.tsx +++ b/webapp/channels/src/components/admin_console/jobs/table.tsx @@ -60,7 +60,7 @@ class JobTable extends React.PureComponent { } return ; - } + }; reload = () => { this.props.actions.getJobsByType(this.props.jobType); diff --git a/webapp/channels/src/components/admin_console/license_settings/license_settings.tsx b/webapp/channels/src/components/admin_console/license_settings/license_settings.tsx index 298c80ea5b..067292faa6 100644 --- a/webapp/channels/src/components/admin_console/license_settings/license_settings.tsx +++ b/webapp/channels/src/components/admin_console/license_settings/license_settings.tsx @@ -145,14 +145,14 @@ export default class LicenseSettings extends React.PureComponent { this.interval = setInterval(this.reloadPercentage, 2000); } this.setState({upgradingPercentage: percentage || 0, upgradeError: error as string}); - } + }; handleChange = () => { const element = this.fileInputRef.current; if (element?.files?.length) { this.setState({fileSelected: true, file: element.files[0]}); } - } + }; openEELicenseModal = async () => { this.props.actions.openModal({ @@ -183,7 +183,7 @@ export default class LicenseSettings extends React.PureComponent { this.props.actions.getPrevTrialLicense(); await this.props.actions.getLicenseConfig(); this.setState({serverError: null, removing: false}); - } + }; handleUpgrade = async (e?: React.MouseEvent) => { if (e) { @@ -200,7 +200,7 @@ export default class LicenseSettings extends React.PureComponent { trackEvent('api', 'upgrade_to_e0_failed', {error: error.message as string}); this.setState({upgradeError: error.message, upgradingPercentage: 0}); } - } + }; checkRestarted = () => { this.props.actions.ping().then(() => { @@ -208,7 +208,7 @@ export default class LicenseSettings extends React.PureComponent { }).catch(() => { setTimeout(this.checkRestarted, 1000); }); - } + }; handleRestart = async (e?: React.MouseEvent) => { if (e) { @@ -221,11 +221,11 @@ export default class LicenseSettings extends React.PureComponent { this.setState({restarting: false, restartError: err as string}); } setTimeout(this.checkRestarted, 1000); - } + }; setClickNormalUpgradeBtn = () => { this.setState({clickNormalUpgradeBtn: true}); - } + }; currentPlan = (
@@ -244,7 +244,7 @@ export default class LicenseSettings extends React.PureComponent { {text} ); - } + }; termsAndPolicy = (
@@ -400,5 +400,5 @@ export default class LicenseSettings extends React.PureComponent { ); } return null; - } + }; } diff --git a/webapp/channels/src/components/admin_console/manage_roles_modal/manage_roles_modal.tsx b/webapp/channels/src/components/admin_console/manage_roles_modal/manage_roles_modal.tsx index 6829a41273..4b10d3b5e5 100644 --- a/webapp/channels/src/components/admin_console/manage_roles_modal/manage_roles_modal.tsx +++ b/webapp/channels/src/components/admin_console/manage_roles_modal/manage_roles_modal.tsx @@ -69,7 +69,7 @@ export default class ManageRolesModal extends React.PureComponent this.setState({ error, }); - } + }; handleSystemAdminChange = (e: React.ChangeEvent) => { if (e.target.name === 'systemadmin') { @@ -115,7 +115,7 @@ export default class ManageRolesModal extends React.PureComponent } else if (!UserUtils.hasPostAllPublicRole(roles) && UserUtils.hasPostAllPublicRole(oldRoles)) { trackEvent('actions', 'remove_roles', {role: General.SYSTEM_POST_ALL_PUBLIC_ROLE}); } - } + }; handleSave = async () => { this.setState({error: null}); @@ -146,7 +146,7 @@ export default class ManageRolesModal extends React.PureComponent />, ); } - } + }; renderContents = () => { const {user} = this.props; @@ -335,7 +335,7 @@ export default class ManageRolesModal extends React.PureComponent
); - } + }; render() { return ( diff --git a/webapp/channels/src/components/admin_console/manage_tokens_modal/manage_tokens_modal.tsx b/webapp/channels/src/components/admin_console/manage_tokens_modal/manage_tokens_modal.tsx index 4c1649d7be..cbe23d3a23 100644 --- a/webapp/channels/src/components/admin_console/manage_tokens_modal/manage_tokens_modal.tsx +++ b/webapp/channels/src/components/admin_console/manage_tokens_modal/manage_tokens_modal.tsx @@ -69,7 +69,7 @@ export default class ManageTokensModal extends React.PureComponent this.setState({ error, }); - } + }; private renderContents = (): JSX.Element => { const {user, userAccessTokens} = this.props; @@ -181,7 +181,7 @@ export default class ManageTokensModal extends React.PureComponent ); - } + }; public render = (): JSX.Element => { return ( @@ -209,5 +209,5 @@ export default class ManageTokensModal extends React.PureComponent ); - } + }; } diff --git a/webapp/channels/src/components/admin_console/member_list_group/member_list_group.tsx b/webapp/channels/src/components/admin_console/member_list_group/member_list_group.tsx index 059445b1c1..96c8fb06fc 100644 --- a/webapp/channels/src/components/admin_console/member_list_group/member_list_group.tsx +++ b/webapp/channels/src/components/admin_console/member_list_group/member_list_group.tsx @@ -96,7 +96,7 @@ export default class MemberListGroup extends React.PureComponent { loadComplete = () => { this.setState({loading: false}); - } + }; private nextPage = async () => { const {actions, groupID} = this.props; @@ -104,11 +104,11 @@ export default class MemberListGroup extends React.PureComponent { this.setState({loading: true, page}); await actions.getProfilesInGroup(groupID, page, USERS_PER_PAGE * 2); this.setState({loading: false}); - } + }; private previousPage = () => { this.setState({page: this.state.page - 1}); - } + }; private getRows = (): Row[] => { const {users} = this.props; @@ -129,7 +129,7 @@ export default class MemberListGroup extends React.PureComponent { }, }; }); - } + }; private getColumns = (): Column[] => { return [ @@ -143,7 +143,7 @@ export default class MemberListGroup extends React.PureComponent { field: 'name', }, ]; - } + }; private getPaginationProps = () => { let {total} = this.props; @@ -158,7 +158,7 @@ export default class MemberListGroup extends React.PureComponent { endCount = total; } return {startCount, endCount, total}; - } + }; public render = (): JSX.Element => { const rows: Row[] = this.getRows(); @@ -190,5 +190,5 @@ export default class MemberListGroup extends React.PureComponent { /> ); - } + }; } diff --git a/webapp/channels/src/components/admin_console/message_export_settings.jsx b/webapp/channels/src/components/admin_console/message_export_settings.jsx index c58c1102d5..bf5eec4beb 100644 --- a/webapp/channels/src/components/admin_console/message_export_settings.jsx +++ b/webapp/channels/src/components/admin_console/message_export_settings.jsx @@ -36,7 +36,7 @@ export default class MessageExportSettings extends AdminSettings { }; } return config; - } + }; getStateFromConfig(config) { const state = { @@ -321,5 +321,5 @@ export default class MessageExportSettings extends AdminSettings { /> ); - } + }; } diff --git a/webapp/channels/src/components/admin_console/multiselect_settings.jsx b/webapp/channels/src/components/admin_console/multiselect_settings.jsx index 309ef4843f..e1f0df3513 100644 --- a/webapp/channels/src/components/admin_console/multiselect_settings.jsx +++ b/webapp/channels/src/components/admin_console/multiselect_settings.jsx @@ -39,7 +39,7 @@ export default class MultiSelectSetting extends React.PureComponent { this.props.onChange(this.props.id, values); this.setState({error: false}); - } + }; calculateValue = () => { return this.props.selected.reduce((values, item) => { diff --git a/webapp/channels/src/components/admin_console/openid_convert/openid_convert.tsx b/webapp/channels/src/components/admin_console/openid_convert/openid_convert.tsx index a9054ce7a5..3cba4ddb41 100644 --- a/webapp/channels/src/components/admin_console/openid_convert/openid_convert.tsx +++ b/webapp/channels/src/components/admin_console/openid_convert/openid_convert.tsx @@ -73,7 +73,7 @@ export default class OpenIdConvert extends React.PureComponent { } else { getHistory().push('/admin_console/authentication/openid'); } - } + }; render() { return ( diff --git a/webapp/channels/src/components/admin_console/password_settings.jsx b/webapp/channels/src/components/admin_console/password_settings.jsx index bacc4fa60b..7e3a76dc2a 100644 --- a/webapp/channels/src/components/admin_console/password_settings.jsx +++ b/webapp/channels/src/components/admin_console/password_settings.jsx @@ -78,7 +78,7 @@ export default class PasswordSettings extends AdminSettings { config.ServiceSettings.MaximumLoginAttempts = this.parseIntNonZero(this.state.maximumLoginAttempts, Constants.MAXIMUM_LOGIN_ATTEMPTS_DEFAULT); return config; - } + }; getStateFromConfig(config) { return { @@ -123,17 +123,17 @@ export default class PasswordSettings extends AdminSettings { }} /> ); - } + }; handlePasswordLengthChange = (id, value) => { this.handleChange(id, value); - } + }; handleCheckboxChange = (id) => { return ({target: {checked}}) => { this.handleChange(id, checked); }; - } + }; renderTitle() { return ( @@ -283,5 +283,5 @@ export default class PasswordSettings extends AdminSettings { } ); - } + }; } diff --git a/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_group.tsx b/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_group.tsx index ad8d8d3d37..135ce5c53c 100644 --- a/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_group.tsx +++ b/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_group.tsx @@ -70,21 +70,21 @@ export default class PermissionGroup extends React.PureComponent { toggleExpanded = (e: MouseEvent) => { e.stopPropagation(); this.setState({expanded: !this.state.expanded}); - } + }; toggleSelectRow = (id: string) => { if (this.props.readOnly) { return; } this.props.onChange([id]); - } + }; toggleSelectSubGroup = (ids: string[]) => { if (this.props.readOnly) { return; } this.props.onChange(ids); - } + }; toggleSelectGroup = () => { const {readOnly, permissions, role, onChange} = this.props; @@ -129,7 +129,7 @@ export default class PermissionGroup extends React.PureComponent { this.setState({prevPermissions: role.permissions || [], expanded: false}); onChange(permissionsToToggle); } - } + }; isInScope = (permission: string) => { if (this.props.scope === 'channel_scope' && PermissionsScope[permission] !== 'channel_scope') { @@ -139,7 +139,7 @@ export default class PermissionGroup extends React.PureComponent { return false; } return true; - } + }; renderPermission = (permission: string, additionalValues: AdditionalValues) => { if (!this.isInScope(permission)) { @@ -162,7 +162,7 @@ export default class PermissionGroup extends React.PureComponent { additionalValues={additionalValues} /> ); - } + }; renderGroup = (g: Permission) => { return ( @@ -183,11 +183,11 @@ export default class PermissionGroup extends React.PureComponent { root={false} /> ); - } + }; fromParent = (id: string) => { return this.props.parentRole && this.props.parentRole.permissions?.indexOf(id) !== -1; - } + }; getStatus = (permissions: Permissions) => { let anyChecked = false; @@ -219,11 +219,11 @@ export default class PermissionGroup extends React.PureComponent { return 'checked'; } return ''; - } + }; hasPermissionsOnScope = () => { return getRecursivePermissions(this.props.permissions).some((permission) => this.isInScope(permission)); - } + }; allPermissionsFromParent = (permissions: Permissions) => { for (const permission of permissions) { @@ -238,7 +238,7 @@ export default class PermissionGroup extends React.PureComponent { } } return true; - } + }; render = () => { const {id, uniqId, permissions, readOnly, combined, root, selected, additionalValues} = this.props; diff --git a/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_schemes_settings.tsx b/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_schemes_settings.tsx index 78c077a559..2225edd183 100644 --- a/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_schemes_settings.tsx +++ b/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_schemes_settings.tsx @@ -89,7 +89,7 @@ export default class PermissionSchemesSettings extends React.PureComponent this.setState({loadingMore: false, page: this.state.page + 1})); }); - } + }; // |RunJobs && !EnableCluster|(*App).IsPhase2MigrationCompleted|View | // |-------------------------|---------------------------------|-------------------------------------------------------| @@ -127,7 +127,7 @@ export default class PermissionSchemesSettings extends React.PureComponent { return ( @@ -211,7 +211,7 @@ export default class PermissionSchemesSettings extends React.PureComponent { if (this.state.loading) { diff --git a/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_system_scheme_settings/permission_system_scheme_settings.tsx b/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_system_scheme_settings/permission_system_scheme_settings.tsx index 812149275b..5077062d95 100644 --- a/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_system_scheme_settings/permission_system_scheme_settings.tsx +++ b/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_system_scheme_settings/permission_system_scheme_settings.tsx @@ -127,7 +127,7 @@ export default class PermissionSystemSchemeSettings extends React.PureComponent< return true; } return false; - } + }; selectRow = (permission: string) => { this.setState({selectedPermission: permission}); @@ -139,7 +139,7 @@ export default class PermissionSystemSchemeSettings extends React.PureComponent< setTimeout(() => { this.setState({selectedPermission: undefined}); }, 3000); - } + }; loadRolesIntoState(props: Props) { this.setState({ @@ -195,7 +195,7 @@ export default class PermissionSystemSchemeSettings extends React.PureComponent< permissions: role.permissions?.filter((p) => PermissionsScope[p] === 'run_scope'), }, }; - } + }; deriveRolesFromGuests = (role: Partial): Record> => { return { @@ -212,7 +212,7 @@ export default class PermissionSystemSchemeSettings extends React.PureComponent< permissions: role.permissions?.filter((p) => PermissionsScope[p] === 'channel_scope'), }, }; - } + }; restoreExcludedPermissions = (roles: Record>) => { for (const permission of this.props.roles.system_user.permissions) { @@ -236,7 +236,7 @@ export default class PermissionSystemSchemeSettings extends React.PureComponent< } } return roles; - } + }; restoreGuestPermissions = (roles: Record>) => { for (const permission of this.props.roles.system_guest.permissions) { @@ -255,7 +255,7 @@ export default class PermissionSystemSchemeSettings extends React.PureComponent< } } return roles; - } + }; handleSubmit = async () => { const teamAdminPromise = this.props.actions.editRole(this.state.roles.team_admin); @@ -303,13 +303,13 @@ export default class PermissionSystemSchemeSettings extends React.PureComponent< this.setState({serverError, saving: false, saveNeeded}); this.props.actions.setNavigationBlocked(saveNeeded); - } + }; toggleRole = (roleId: string) => { const newOpenRoles = {...this.state.openRoles}; newOpenRoles[roleId] = !newOpenRoles[roleId]; this.setState({openRoles: newOpenRoles}); - } + }; togglePermission = (roleId: string, permissions: Iterable) => { const roles = {...this.state.roles}; @@ -327,7 +327,7 @@ export default class PermissionSystemSchemeSettings extends React.PureComponent< this.setState({roles, saveNeeded: true}); this.props.actions.setNavigationBlocked(true); - } + }; resetDefaults = () => { const newRolesState = JSON.parse(JSON.stringify({...this.state.roles})); @@ -338,11 +338,11 @@ export default class PermissionSystemSchemeSettings extends React.PureComponent< this.setState({roles: newRolesState, saveNeeded: true}); this.props.actions.setNavigationBlocked(true); - } + }; haveGuestAccountsPermissions = () => { return this.props.license.GuestAccountsPermissions === 'true'; - } + }; render = () => { if (!this.state.loaded) { diff --git a/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_team_scheme_settings/permission_team_scheme_settings.tsx b/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_team_scheme_settings/permission_team_scheme_settings.tsx index e133d4182c..f30f687406 100644 --- a/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_team_scheme_settings/permission_team_scheme_settings.tsx +++ b/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_team_scheme_settings/permission_team_scheme_settings.tsx @@ -110,7 +110,7 @@ export default class PermissionTeamSchemeSettings extends React.PureComponent { const selected = document.querySelector('.permission-row.selected,.permission-group-row.selected'); @@ -196,7 +196,7 @@ export default class PermissionTeamSchemeSettings extends React.PureComponent { this.setState({selectedPermission: permission}); @@ -208,7 +208,7 @@ export default class PermissionTeamSchemeSettings extends React.PureComponent { this.setState({selectedPermission: undefined}); }, 3000); - } + }; getStateRoles = () => { if (this.state.roles !== null) { @@ -276,7 +276,7 @@ export default class PermissionTeamSchemeSettings extends React.PureComponent { return { @@ -289,7 +289,7 @@ export default class PermissionTeamSchemeSettings extends React.PureComponent PermissionsScope[p] === 'channel_scope'), }, }; - } + }; restoreGuestPermissions = (teamGuest: Role, channelGuest: Role, roles: RolesMap) => { for (const permission of teamGuest.permissions) { @@ -303,7 +303,7 @@ export default class PermissionTeamSchemeSettings extends React.PureComponent { return { @@ -324,7 +324,7 @@ export default class PermissionTeamSchemeSettings extends React.PureComponent PermissionsScope[p] === 'run_scope'), }, }; - } + }; restoreExcludedPermissions = (baseTeam: Role, baseChannel: Role, roles: RolesMap) => { for (const permission of baseTeam.permissions) { @@ -338,17 +338,17 @@ export default class PermissionTeamSchemeSettings extends React.PureComponent) => { this.setState({schemeName: e.target.value, saveNeeded: true}); this.props.actions.setNavigationBlocked(true); - } + }; handleDescriptionChange = (e: React.ChangeEvent) => { this.setState({schemeDescription: e.target.value, saveNeeded: true}); this.props.actions.setNavigationBlocked(true); - } + }; handleSubmit = async () => { const roles = this.getStateRoles(); @@ -495,13 +495,13 @@ export default class PermissionTeamSchemeSettings extends React.PureComponent { const newOpenRoles = {...this.state.openRoles}; newOpenRoles[roleId] = !newOpenRoles[roleId]; this.setState({openRoles: newOpenRoles}); - } + }; togglePermission = (roleId: string, permissions: string[]) => { const roles = {...this.getStateRoles()} as RolesMap; @@ -543,17 +543,17 @@ export default class PermissionTeamSchemeSettings extends React.PureComponent { this.setState({addTeamOpen: true}); - } + }; removeTeam = (teamId: string) => { const teams = (this.state.teams || this.props.teams).filter((team) => team.id !== teamId); this.setState({teams, saveNeeded: true}); this.props.actions.setNavigationBlocked(true); - } + }; addTeams = (teams: Team[]) => { const currentTeams = this.state.teams || this.props.teams || []; @@ -562,15 +562,15 @@ export default class PermissionTeamSchemeSettings extends React.PureComponent { this.setState({addTeamOpen: false}); - } + }; haveGuestAccountsPermissions = () => { return this.props.license.GuestAccountsPermissions === 'true'; - } + }; render = () => { if (!this.isLoaded(this.props)) { diff --git a/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_team_scheme_settings/team_in_list/team_in_list.tsx b/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_team_scheme_settings/team_in_list/team_in_list.tsx index 5ace78b29e..729153659d 100644 --- a/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_team_scheme_settings/team_in_list/team_in_list.tsx +++ b/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_team_scheme_settings/team_in_list/team_in_list.tsx @@ -22,7 +22,7 @@ export default class TeamInList extends React.PureComponent { return; } onRemoveTeam(team.id); - } + }; render() { const {team, isDisabled} = this.props; diff --git a/webapp/channels/src/components/admin_console/permission_schemes_settings/permissions_scheme_summary/permissions_scheme_summary.tsx b/webapp/channels/src/components/admin_console/permission_schemes_settings/permissions_scheme_summary/permissions_scheme_summary.tsx index ad639d2232..b09f1fc243 100644 --- a/webapp/channels/src/components/admin_console/permission_schemes_settings/permissions_scheme_summary/permissions_scheme_summary.tsx +++ b/webapp/channels/src/components/admin_console/permission_schemes_settings/permissions_scheme_summary/permissions_scheme_summary.tsx @@ -96,17 +96,17 @@ export default class PermissionsSchemeSummary extends React.PureComponent ); - } + }; stopPropagation = (e: React.MouseEvent): void => { e.stopPropagation(); - } + }; handleDeleteCanceled = (): void => { this.setState({ showConfirmModal: false, }); - } + }; handleDeleteConfirmed = async (): Promise => { this.setState({deleting: true, serverError: undefined}); @@ -116,7 +116,7 @@ export default class PermissionsSchemeSummary extends React.PureComponent): void => { e.stopPropagation(); @@ -124,11 +124,11 @@ export default class PermissionsSchemeSummary extends React.PureComponent { this.props.history.push('/admin_console/user_management/permissions/team_override_scheme/' + this.props.scheme.id); - } + }; render = () => { const {scheme, isDisabled} = this.props; diff --git a/webapp/channels/src/components/admin_console/permission_schemes_settings/permissions_tree/permissions_tree.tsx b/webapp/channels/src/components/admin_console/permission_schemes_settings/permissions_tree/permissions_tree.tsx index e32c82c42e..32cf4dd1dd 100644 --- a/webapp/channels/src/components/admin_console/permission_schemes_settings/permissions_tree/permissions_tree.tsx +++ b/webapp/channels/src/components/admin_console/permission_schemes_settings/permissions_tree/permissions_tree.tsx @@ -260,15 +260,15 @@ export default class PermissionsTree extends React.PureComponent { return true; }); - } + }; openPostTimeLimitModal = () => { this.setState({editTimeLimitModalIsVisible: true}); - } + }; closePostTimeLimitModal = () => { this.setState({editTimeLimitModalIsVisible: false}); - } + }; componentDidUpdate(prevProps: Props) { if (this.props.config !== prevProps.config || this.props.license !== prevProps.license) { @@ -281,7 +281,7 @@ export default class PermissionsTree extends React.PureComponent { return; } this.props.onToggle(this.props.role.name!, ids); - } + }; render = () => { return ( diff --git a/webapp/channels/src/components/admin_console/plugin_management/plugin_management.tsx b/webapp/channels/src/components/admin_console/plugin_management/plugin_management.tsx index 90e8b472b0..b5f2b35e11 100644 --- a/webapp/channels/src/components/admin_console/plugin_management/plugin_management.tsx +++ b/webapp/channels/src/components/admin_console/plugin_management/plugin_management.tsx @@ -486,7 +486,7 @@ export default class PluginManagement extends AdminSettings { } return config; - } + }; getStateFromConfig(config: Props['config']) { const state = { @@ -517,7 +517,7 @@ export default class PluginManagement extends AdminSettings { if (element.files && element.files.length > 0) { this.setState({fileSelected: true, file: element.files[0]}); } - } + }; helpSubmitUpload = async (file: File, force: boolean) => { this.setState({uploading: true}); @@ -561,7 +561,7 @@ export default class PluginManagement extends AdminSettings { uploading: false, loading: false, }); - } + }; handleSubmitUpload = (e: React.SyntheticEvent) => { e.preventDefault(); @@ -575,7 +575,7 @@ export default class PluginManagement extends AdminSettings { this.helpSubmitUpload(file, false); } Utils.clearFileInput(element); - } + }; handleOverwriteUploadPluginCancel = () => { this.setState({ @@ -586,20 +586,20 @@ export default class PluginManagement extends AdminSettings { lastMessage: null, uploading: false, }); - } + }; handleOverwriteUploadPlugin = () => { this.setState({confirmOverwriteUploadModal: false}); if (this.state.file) { this.helpSubmitUpload(this.state.file, true); } - } + }; onPluginDownloadUrlChange = (e: React.ChangeEvent) => { this.setState({ pluginDownloadUrl: e.target.value, }); - } + }; installFromUrl = async (force: boolean) => { const {pluginDownloadUrl} = this.state; @@ -644,7 +644,7 @@ export default class PluginManagement extends AdminSettings { installing: false, loading: false, }); - } + }; getMarketplaceURLHelpText = (url: string, enableUploads: boolean) => { return ( @@ -685,16 +685,16 @@ export default class PluginManagement extends AdminSettings { } ); - } + }; canSave = () => { return this.state.marketplaceUrl !== ''; - } + }; handleSubmitInstall = (e: React.SyntheticEvent) => { e.preventDefault(); return this.installFromUrl(false); - } + }; handleOverwriteInstallPluginCancel = () => { this.setState({ @@ -703,12 +703,12 @@ export default class PluginManagement extends AdminSettings { serverError: null, lastMessage: null, }); - } + }; handleOverwriteInstallPlugin = () => { this.setState({confirmOverwriteInstallModal: false}); return this.installFromUrl(true); - } + }; showRemovePluginModal = (e: React.SyntheticEvent) => { if (this.props.isDisabled) { @@ -717,16 +717,16 @@ export default class PluginManagement extends AdminSettings { e.preventDefault(); const pluginId = e.currentTarget.getAttribute('data-plugin-id'); this.setState({showRemoveModal: true, removing: pluginId}); - } + }; handleRemovePluginCancel = () => { this.setState({showRemoveModal: false, removing: null}); - } + }; handleRemovePlugin = () => { this.setState({showRemoveModal: false}); this.handleRemove(); - } + }; handleRemove = async () => { this.setState({lastMessage: null, serverError: null}); @@ -738,7 +738,7 @@ export default class PluginManagement extends AdminSettings { this.setState({serverError: error.message}); } } - } + }; handleEnable = async (e: React.KeyboardEvent) => { e.preventDefault(); @@ -755,7 +755,7 @@ export default class PluginManagement extends AdminSettings { this.setState({serverError: error.message}); } } - } + }; handleDisable = async (e: React.KeyboardEvent) => { this.setState({lastMessage: null, serverError: null}); @@ -772,7 +772,7 @@ export default class PluginManagement extends AdminSettings { this.setState({serverError: error.message}); } } - } + }; renderTitle() { return ( @@ -818,7 +818,7 @@ export default class PluginManagement extends AdminSettings { onCancel={onCancel} /> ); - } + }; renderRemovePluginModal = ( show: boolean, onConfirm: (checked: boolean) => void, onCancel: (checked: boolean) => void) => { @@ -854,7 +854,7 @@ export default class PluginManagement extends AdminSettings { onCancel={onCancel} /> ); - } + }; renderEnablePluginsSetting = () => { const hideEnablePlugins = this.props.config.ExperimentalSettings && this.props.config.ExperimentalSettings.RestrictSystemAdmin; @@ -892,7 +892,7 @@ export default class PluginManagement extends AdminSettings { ); } return null; - } + }; renderSettings = () => { const {enableUploads} = this.state; @@ -1256,5 +1256,5 @@ export default class PluginManagement extends AdminSettings { ); - } + }; } diff --git a/webapp/channels/src/components/admin_console/push_settings.jsx b/webapp/channels/src/components/admin_console/push_settings.jsx index ea550c1d75..cb6e291913 100644 --- a/webapp/channels/src/components/admin_console/push_settings.jsx +++ b/webapp/channels/src/components/admin_console/push_settings.jsx @@ -22,13 +22,13 @@ const PUSH_NOTIFICATIONS_CUSTOM = 'custom'; export default class PushSettings extends AdminSettings { canSave = () => { return this.state.pushNotificationServerType !== PUSH_NOTIFICATIONS_MHPNS || this.state.agree; - } + }; handleAgreeChange = (e) => { this.setState({ agree: e.target.checked, }); - } + }; handleDropdownChange = (id, value) => { if (id === 'pushNotificationServerType') { @@ -54,7 +54,7 @@ export default class PushSettings extends AdminSettings { } this.handleChange(id, value); - } + }; getConfigFromState = (config) => { config.EmailSettings.SendPushNotifications = this.state.pushNotificationServerType !== PUSH_NOTIFICATIONS_OFF; @@ -62,7 +62,7 @@ export default class PushSettings extends AdminSettings { config.TeamSettings.MaxNotificationsPerChannel = this.state.maxNotificationsPerChannel; return config; - } + }; getStateFromConfig(config) { let pushNotificationServerType = PUSH_NOTIFICATIONS_CUSTOM; @@ -318,5 +318,5 @@ export default class PushSettings extends AdminSettings { /> ); - } + }; } diff --git a/webapp/channels/src/components/admin_console/remove_file_setting.jsx b/webapp/channels/src/components/admin_console/remove_file_setting.jsx index ba68c3b217..0d145ade83 100644 --- a/webapp/channels/src/components/admin_console/remove_file_setting.jsx +++ b/webapp/channels/src/components/admin_console/remove_file_setting.jsx @@ -35,7 +35,7 @@ export default class RemoveFileSetting extends Setting { this.props.onSubmit(this.props.id, () => { this.setState({removing: false}); }); - } + }; render() { return ( diff --git a/webapp/channels/src/components/admin_console/reset_email_modal/reset_email_modal.tsx b/webapp/channels/src/components/admin_console/reset_email_modal/reset_email_modal.tsx index 5d3915cde9..dde3f723e8 100644 --- a/webapp/channels/src/components/admin_console/reset_email_modal/reset_email_modal.tsx +++ b/webapp/channels/src/components/admin_console/reset_email_modal/reset_email_modal.tsx @@ -59,7 +59,7 @@ export default class ResetEmailModal extends React.PureComponent { isEmailError: false, isCurrentPasswordError: false, }); - } + }; private isEmailValid = (): boolean => { if (!this.emailRef.current || !this.emailRef.current.value || !isEmail(this.emailRef.current.value)) { @@ -75,7 +75,7 @@ export default class ResetEmailModal extends React.PureComponent { this.setState({error: null, isEmailError: false}); return true; - } + }; private isCurrentPasswordValid = (): boolean => { if (!this.currentPasswordRef.current || !this.currentPasswordRef.current.value) { @@ -91,7 +91,7 @@ export default class ResetEmailModal extends React.PureComponent { } this.setState({error: null, isCurrentPasswordError: false}); return true; - } + }; private doSubmit = async (e: React.MouseEvent) => { e.preventDefault(); @@ -126,14 +126,14 @@ export default class ResetEmailModal extends React.PureComponent { } this.props.onModalSubmit(this.props.user); - } + }; private doCancel = (): void => { this.setState({ error: null, }); this.props.onModalDismissed(); - } + }; public render(): JSX.Element { const user = this.props.user; diff --git a/webapp/channels/src/components/admin_console/reset_password_modal/reset_password_modal.tsx b/webapp/channels/src/components/admin_console/reset_password_modal/reset_password_modal.tsx index e84b511de8..566fb1fed5 100644 --- a/webapp/channels/src/components/admin_console/reset_password_modal/reset_password_modal.tsx +++ b/webapp/channels/src/components/admin_console/reset_password_modal/reset_password_modal.tsx @@ -98,7 +98,7 @@ export default class ResetPasswordModal extends React.PureComponent { this.setState({ @@ -106,7 +106,7 @@ export default class ResetPasswordModal extends React.PureComponent { if (!this.props.schema) { @@ -353,7 +353,7 @@ export default class SchemaAdminSettings extends React.PureComponent { textValues={helpTextValues} /> ); - } + }; renderLabel = (setting) => { if (!this.props.schema) { @@ -364,7 +364,7 @@ export default class SchemaAdminSettings extends React.PureComponent { return setting.label; } return Utils.localizeMessage(setting.label, setting.label_default); - } + }; isDisabled = (setting) => { const enterpriseReady = this.props.config.BuildEnterpriseReady === 'true'; @@ -372,14 +372,14 @@ export default class SchemaAdminSettings extends React.PureComponent { return setting.isDisabled(this.props.config, this.state, this.props.license, enterpriseReady, this.props.consoleAccess, this.props.cloud, this.props.isCurrentUserSystemAdmin); } return Boolean(setting.isDisabled); - } + }; isHidden = (setting) => { if (typeof setting.isHidden === 'function') { return setting.isHidden(this.props.config, this.state, this.props.license); } return Boolean(setting.isHidden); - } + }; buildButtonSetting = (setting) => { const handleRequestAction = (success, error) => { @@ -437,7 +437,7 @@ export default class SchemaAdminSettings extends React.PureComponent { }} /> ); - } + }; buildTextSetting = (setting) => { let inputType = 'input'; @@ -479,7 +479,7 @@ export default class SchemaAdminSettings extends React.PureComponent { footer={footer} /> ); - } + }; buildColorSetting = (setting) => { return ( @@ -494,7 +494,7 @@ export default class SchemaAdminSettings extends React.PureComponent { onChange={this.handleChange} /> ); - } + }; buildBoolSetting = (setting) => { return ( @@ -509,7 +509,7 @@ export default class SchemaAdminSettings extends React.PureComponent { onChange={this.handleChange} /> ); - } + }; buildPermissionSetting = (setting) => { return ( @@ -524,7 +524,7 @@ export default class SchemaAdminSettings extends React.PureComponent { onChange={this.handlePermissionChange} /> ); - } + }; buildDropdownSetting = (setting) => { const enterpriseReady = this.props.config.BuildEnterpriseReady === 'true'; @@ -569,7 +569,7 @@ export default class SchemaAdminSettings extends React.PureComponent { onChange={this.handleChange} /> ); - } + }; buildLanguageSetting = (setting) => { const locales = I18n.getAllLanguages(); @@ -613,7 +613,7 @@ export default class SchemaAdminSettings extends React.PureComponent { onChange={this.handleChange} /> ); - } + }; buildRadioSetting = (setting) => { const options = setting.options || []; @@ -632,7 +632,7 @@ export default class SchemaAdminSettings extends React.PureComponent { onChange={this.handleChange} /> ); - } + }; buildBannerSetting = (setting) => { if (this.isDisabled(setting)) { @@ -651,7 +651,7 @@ export default class SchemaAdminSettings extends React.PureComponent { ); - } + }; buildGeneratedSetting = (setting) => { return ( @@ -668,11 +668,11 @@ export default class SchemaAdminSettings extends React.PureComponent { onChange={this.handleGeneratedChange} /> ); - } + }; handleGeneratedChange = (id, s) => { this.handleChange(id, s.replace('+', '-').replace('/', '_')); - } + }; handleChange = (id, value, confirm = false, doSubmit = false, warning = false) => { let saveNeeded = this.state.saveNeeded === 'permissions' ? 'both' : 'config'; @@ -702,7 +702,7 @@ export default class SchemaAdminSettings extends React.PureComponent { } this.props.setNavigationBlocked(true); - } + }; handlePermissionChange = (id, value) => { let saveNeeded = 'permissions'; @@ -715,7 +715,7 @@ export default class SchemaAdminSettings extends React.PureComponent { }); this.props.setNavigationBlocked(true); - } + }; buildUsernameSetting = (setting) => { return ( @@ -730,7 +730,7 @@ export default class SchemaAdminSettings extends React.PureComponent { onChange={this.handleChange} /> ); - } + }; buildJobsTableSetting = (setting) => { return ( @@ -753,7 +753,7 @@ export default class SchemaAdminSettings extends React.PureComponent { } /> ); - } + }; buildFileUploadSetting = (setting) => { const setData = (id, data) => { @@ -831,7 +831,7 @@ export default class SchemaAdminSettings extends React.PureComponent { setByEnv={this.isSetByEnv(setting.key)} /> ); - } + }; buildCustomSetting = (setting) => { const CustomComponent = setting.component; @@ -869,21 +869,21 @@ export default class SchemaAdminSettings extends React.PureComponent { ); } return componentInstance; - } + }; unRegisterSaveAction = (saveAction) => { const indexOfSaveAction = this.saveActions.indexOf(saveAction); this.saveActions.splice(indexOfSaveAction, 1); - } + }; registerSaveAction = (saveAction) => { this.saveActions.push(saveAction); - } + }; setSaveNeeded = () => { this.setState({saveNeeded: 'config'}); this.props.setNavigationBlocked(true); - } + }; renderSettings = () => { const schema = this.props.schema; @@ -995,17 +995,17 @@ export default class SchemaAdminSettings extends React.PureComponent { } return null; - } + }; closeTooltip = () => { this.setState({errorTooltip: false}); - } + }; openTooltip = (e) => { const elm = e.currentTarget.querySelector('.control-label'); const isElipsis = elm.offsetWidth < elm.scrollWidth; this.setState({errorTooltip: isElipsis}); - } + }; doSubmit = async (getStateFromConfig) => { // clone config so that we aren't modifying data in the stores @@ -1106,7 +1106,7 @@ export default class SchemaAdminSettings extends React.PureComponent { ); } return null; - } + }; canSave = () => { if (!this.props.schema || !this.props.schema.settings) { @@ -1143,7 +1143,7 @@ export default class SchemaAdminSettings extends React.PureComponent { } return true; - } + }; render = () => { const schema = this.props.schema; @@ -1238,5 +1238,5 @@ export default class SchemaAdminSettings extends React.PureComponent { ); - } + }; } diff --git a/webapp/channels/src/components/admin_console/server_logs/log_list.tsx b/webapp/channels/src/components/admin_console/server_logs/log_list.tsx index 2f3338198c..d73d3d4b4e 100644 --- a/webapp/channels/src/components/admin_console/server_logs/log_list.tsx +++ b/webapp/channels/src/components/admin_console/server_logs/log_list.tsx @@ -46,21 +46,21 @@ export default class LogList extends React.PureComponent { isSearching = (term: string, filters: ChannelSearchOpts) => { return term.length > 0 || Object.keys(filters).length > 0; - } + }; onSearch = (term: string) => { this.props.onSearchChange(term); - } + }; nextPage = () => { const page = this.state.page + 1; this.setState({page}); - } + }; previousPage = () => { const page = this.state.page - 1; this.setState({page}); - } + }; getPaginationProps = (): {startCount: number; endCount: number; total: number} => { const {page} = this.state; @@ -73,12 +73,12 @@ export default class LogList extends React.PureComponent { endCount = endCount > total ? total : endCount; return {startCount, endCount, total}; - } + }; handleDateSort = () => { this.setState({dateAsc: !this.state.dateAsc}); this.getColumns(this.state.dateAsc); - } + }; getColumns = (dateAsc: boolean): Column[] => { const timestamp: JSX.Element = ( @@ -155,7 +155,7 @@ export default class LogList extends React.PureComponent { width: 1, }, ]; - } + }; getRows = (): Row[] => { const {startCount, endCount} = this.getPaginationProps(); @@ -219,21 +219,21 @@ export default class LogList extends React.PureComponent { onClick: () => this.showFullLogEvent(log), }; }); - } + }; showFullLogEvent = (log: LogObject) => { this.setState({ modalLog: log, modalOpen: true, }); - } + }; hideModal = () => { this.setState({ modalLog: null, modalOpen: false, }); - } + }; onFilter = (filterOptions: FilterOptions) => { const filters = {} as unknown as LogFilter; @@ -249,17 +249,17 @@ export default class LogList extends React.PureComponent { }, []); } this.props.onFiltersChange(filters); - } + }; showErrors = () => { this.props.onFiltersChange({logLevels: ['error']} as unknown as LogFilter); - } + }; getErrorCount = (): number => { let n = 0; this.props.logs.map((log) => log.level === 'error' && ++n); return n; - } + }; render = (): JSX.Element => { const {search} = this.props; @@ -377,5 +377,5 @@ export default class LogList extends React.PureComponent { /> ); - } + }; } diff --git a/webapp/channels/src/components/admin_console/server_logs/logs.tsx b/webapp/channels/src/components/admin_console/server_logs/logs.tsx index d92b24423e..0edbb270fc 100644 --- a/webapp/channels/src/components/admin_console/server_logs/logs.tsx +++ b/webapp/channels/src/components/admin_console/server_logs/logs.tsx @@ -57,11 +57,11 @@ export default class Logs extends React.PureComponent { dateTo: this.state.dateTo, }); this.setState({loadingLogs: false}); - } + }; onSearchChange = (search: string) => { this.setState({search}, () => this.performSearch()); - } + }; performSearch = debounce(() => { const {search} = this.state; @@ -74,7 +74,7 @@ export default class Logs extends React.PureComponent { onFiltersChange = ({dateFrom, dateTo, logLevels, serverNames}: LogFilter) => { this.setState({dateFrom, dateTo, logLevels, serverNames}, () => this.reload()); - } + }; render() { return ( diff --git a/webapp/channels/src/components/admin_console/session_length_settings.jsx b/webapp/channels/src/components/admin_console/session_length_settings.jsx index caecb90965..16aa21aef4 100644 --- a/webapp/channels/src/components/admin_console/session_length_settings.jsx +++ b/webapp/channels/src/components/admin_console/session_length_settings.jsx @@ -24,7 +24,7 @@ export default class SessionLengthSettings extends AdminSettings { config.ServiceSettings.SessionIdleTimeoutInMinutes = this.parseIntZeroOrMin(this.state.sessionIdleTimeoutInMinutes, MINIMUM_IDLE_TIMEOUT); return config; - } + }; getStateFromConfig(config) { return { @@ -204,5 +204,5 @@ export default class SessionLengthSettings extends AdminSettings { {sessionTimeoutSetting} ); - } + }; } diff --git a/webapp/channels/src/components/admin_console/system_roles/system_role/add_users_to_role_modal/add_users_to_role_modal.tsx b/webapp/channels/src/components/admin_console/system_roles/system_role/add_users_to_role_modal/add_users_to_role_modal.tsx index a764e1f759..f285736bf1 100644 --- a/webapp/channels/src/components/admin_console/system_roles/system_role/add_users_to_role_modal/add_users_to_role_modal.tsx +++ b/webapp/channels/src/components/admin_console/system_roles/system_role/add_users_to_role_modal/add_users_to_role_modal.tsx @@ -76,11 +76,11 @@ export default class AddUsersToRoleModal extends React.PureComponent { await this.props.actions.getProfiles(0, USERS_PER_PAGE * 2); this.setUsersLoadingState(false); - } + }; setUsersLoadingState = (loading: boolean) => { this.setState({loading}); - } + }; search = async (term: string) => { this.setUsersLoadingState(true); @@ -93,17 +93,17 @@ export default class AddUsersToRoleModal extends React.PureComponent { this.setState({show: false}); - } + }; handleExit = () => { if (this.props.onExited) { this.props.onExited(); } - } + }; renderOption = (option: UserProfileValue, isSelected: boolean, onAdd: (user: UserProfileValue) => void, onMouseMove: (user: UserProfileValue) => void) => { let rowSelected = ''; @@ -137,15 +137,15 @@ export default class AddUsersToRoleModal extends React.PureComponent ); - } + }; renderValue = (value: { data: UserProfileValue }): string => { return value.data?.username || ''; - } + }; renderAriaLabel = (option: UserProfileValue): string => { return option?.username || ''; - } + }; handleAdd = (value: UserProfileValue) => { const values: UserProfileValue[] = [...this.state.values]; @@ -153,11 +153,11 @@ export default class AddUsersToRoleModal extends React.PureComponent { this.setState({values}); - } + }; handlePageChange = (page: number, prevPage: number) => { if (page > prevPage) { @@ -171,7 +171,7 @@ export default class AddUsersToRoleModal extends React.PureComponent { this.props.onAddCallback(this.state.values); this.handleHide(); - } + }; render = (): JSX.Element => { const numRemainingText = ( @@ -265,5 +265,5 @@ export default class AddUsersToRoleModal extends React.PureComponent ); - } + }; } diff --git a/webapp/channels/src/components/admin_console/system_roles/system_role/system_role.tsx b/webapp/channels/src/components/admin_console/system_roles/system_role/system_role.tsx index b36f29a2b9..5a897a299f 100644 --- a/webapp/channels/src/components/admin_console/system_roles/system_role/system_role.tsx +++ b/webapp/channels/src/components/admin_console/system_roles/system_role/system_role.tsx @@ -74,7 +74,7 @@ export default class SystemRole extends React.PureComponent { saveNeeded = saveNeeded || difference(updatedRolePermissions, role.permissions).length > 0 || difference(role.permissions, updatedRolePermissions).length > 0; } return saveNeeded; - } + }; addUsersToRole = (users: UserProfile[]) => { const {actions: {setNavigationBlocked}} = this.props; @@ -95,7 +95,7 @@ export default class SystemRole extends React.PureComponent { const saveNeeded = this.getSaveStateNeeded({usersToAdd, usersToRemove}); setNavigationBlocked(saveNeeded); this.setState({usersToAdd, usersToRemove, saveNeeded}); - } + }; removeUserFromRole = (user: UserProfile) => { const {actions: {setNavigationBlocked}} = this.props; @@ -114,7 +114,7 @@ export default class SystemRole extends React.PureComponent { const saveNeeded = this.getSaveStateNeeded({usersToAdd, usersToRemove}); setNavigationBlocked(saveNeeded); this.setState({usersToRemove, usersToAdd, saveNeeded}); - } + }; handleSubmit = async () => { this.setState({saving: true, saveNeeded: false}); @@ -189,7 +189,7 @@ export default class SystemRole extends React.PureComponent { usersToRemove: {}, saveKey, }); - } + }; updatePermissions = (permissions: PermissionToUpdate[]) => { const {role, actions: {setNavigationBlocked}} = this.props; @@ -235,7 +235,7 @@ export default class SystemRole extends React.PureComponent { ...nextState, saveNeeded: this.getSaveStateNeeded(nextState), }); - } + }; render() { const {usersToAdd, usersToRemove, saving, saveNeeded, serverError, permissionsToUpdate, saveKey} = this.state; diff --git a/webapp/channels/src/components/admin_console/system_roles/system_role/system_role_permission.tsx b/webapp/channels/src/components/admin_console/system_roles/system_role/system_role_permission.tsx index 219ba40279..1a47ca4a4b 100644 --- a/webapp/channels/src/components/admin_console/system_roles/system_role/system_role_permission.tsx +++ b/webapp/channels/src/components/admin_console/system_roles/system_role/system_role_permission.tsx @@ -28,7 +28,7 @@ export default class SystemRolePermission extends React.PureComponent { return visibleSections[section.name]; } return this.getAccessForSection(section, permissionsMap, permissionsToUpdate) === mixedAccess; - } + }; renderSubsectionToggle = (section: SystemSection, isSectionVisible: boolean) => { if (!section.subsections || section.subsections.length === 0) { @@ -59,7 +59,7 @@ export default class SystemRolePermission extends React.PureComponent { ); - } + }; renderSubsections = (section: SystemSection, permissionsMap: Record, permissionsToUpdate: PermissionsToUpdate, isSectionVisible: boolean) => { if (!section.subsections || section.subsections.length === 0) { @@ -74,7 +74,7 @@ export default class SystemRolePermission extends React.PureComponent { } ); - } + }; renderSectionRow = (section: SystemSection, permissionsMap: Record, permissionsToUpdate: PermissionsToUpdate, isSectionVisible: boolean) => { return ( @@ -111,7 +111,7 @@ export default class SystemRolePermission extends React.PureComponent { ); - } + }; getAccessForSection = (section: SystemSection, permissions: Record, permissionsToUpdate: Record) => { // If we have subsections then use them to determine access to show. @@ -145,7 +145,7 @@ export default class SystemRolePermission extends React.PureComponent { } } return this.getAccessForSectionByName(section.name, permissions, permissionsToUpdate); - } + }; getAccessForSectionByName = (sectionName: string, permissions: Record, permissionsToUpdate: Record) => { // Assume sysadmin has write access for everything, this is a bit of a hack but it should be left in until `user_management_read|write_system_roles` is actually a permission @@ -167,7 +167,7 @@ export default class SystemRolePermission extends React.PureComponent { } return access; - } + }; render() { const {section, permissionsMap, permissionsToUpdate, visibleSections} = this.props; diff --git a/webapp/channels/src/components/admin_console/system_roles/system_role/system_role_permission_dropdown.tsx b/webapp/channels/src/components/admin_console/system_roles/system_role/system_role_permission_dropdown.tsx index 649a7968a1..614d5d050e 100644 --- a/webapp/channels/src/components/admin_console/system_roles/system_role/system_role_permission_dropdown.tsx +++ b/webapp/channels/src/components/admin_console/system_roles/system_role/system_role_permission_dropdown.tsx @@ -37,7 +37,7 @@ export default class SystemRolePermissionDropdown extends React.PureComponent { return ( @@ -50,7 +50,7 @@ export default class SystemRolePermissionDropdown extends React.PureComponent ); - } + }; render() { const {isDisabled, section} = this.props; diff --git a/webapp/channels/src/components/admin_console/system_roles/system_role/system_role_permissions.tsx b/webapp/channels/src/components/admin_console/system_roles/system_role/system_role_permissions.tsx index abb784bada..54a3d93c7c 100644 --- a/webapp/channels/src/components/admin_console/system_roles/system_role/system_role_permissions.tsx +++ b/webapp/channels/src/components/admin_console/system_roles/system_role/system_role_permissions.tsx @@ -181,11 +181,11 @@ export default class SystemRolePermissions extends React.PureComponent -1) { sectionsList.splice(sectionIndex, 1); } - } + }; updatePermissions = (permissions: PermissionToUpdate[]) => { this.props.updatePermissions(permissions); - } + }; setSectionVisible = (name: string, visible: boolean) => { const {visibleSections} = this.state; @@ -195,7 +195,7 @@ export default class SystemRolePermissions extends React.PureComponent, permissionsToUpdate: PermissionsToUpdate, visibleSections: Record) => { const {isLicensedForCloud} = this.props; @@ -257,7 +257,7 @@ export default class SystemRolePermissions extends React.PureComponent ); }); - } + }; render() { const {role, permissionsToUpdate} = this.props; diff --git a/webapp/channels/src/components/admin_console/system_roles/system_role/system_role_users/system_role_users.tsx b/webapp/channels/src/components/admin_console/system_roles/system_role/system_role_users/system_role_users.tsx index 658320e126..64fdcfd20e 100644 --- a/webapp/channels/src/components/admin_console/system_roles/system_role/system_role_users/system_role_users.tsx +++ b/webapp/channels/src/components/admin_console/system_roles/system_role/system_role_users/system_role_users.tsx @@ -106,14 +106,14 @@ export default class SystemRoleUsers extends React.PureComponent { setStateLoading = (loading: boolean) => { this.setState({loading}); - } + }; getVisibleTotalCount = (): number => { const {usersToRemove, usersToAdd, totalCount} = this.props; const usersToAddCount = Object.keys(usersToAdd).length; const usersToRemoveCount = Object.keys(usersToRemove).length; return totalCount + (usersToAddCount - usersToRemoveCount); - } + }; getPaginationProps = (): {startCount: number; endCount: number; total: number} => { const {term, usersToRemove, usersToAdd} = this.props; @@ -138,11 +138,11 @@ export default class SystemRoleUsers extends React.PureComponent { endCount = endCount > total ? total : endCount; return {startCount, endCount, total}; - } + }; onSearch = async (term: string) => { this.props.actions.setUserGridSearch(term); - } + }; nextPage = async () => { if (this.state.loading) { @@ -152,14 +152,14 @@ export default class SystemRoleUsers extends React.PureComponent { this.setState({loading: true}); await this.props.actions.getProfiles(page, USERS_PER_PAGE, {role: this.props.role.name}); this.setState({loading: false, page}); - } + }; previousPage = async () => { if (this.state.loading || this.state.page === 0) { return; } this.setState({page: this.state.page - 1}); - } + }; getRows = () => { const {users, readOnly, usersToAdd, usersToRemove} = this.props; @@ -198,7 +198,7 @@ export default class SystemRoleUsers extends React.PureComponent { }, }; }); - } + }; getColumns = () => { const name: JSX.Element = ( @@ -228,15 +228,15 @@ export default class SystemRoleUsers extends React.PureComponent { fixed: true, }, ]; - } + }; onAddCallback = (users: UserProfile[]) => { this.props.onAddCallback(users); - } + }; onRemoveCallback = (user: UserProfile) => { this.props.onRemoveCallback(user); - } + }; render() { const {page, loading} = this.state; diff --git a/webapp/channels/src/components/admin_console/system_user_detail/system_user_detail.tsx b/webapp/channels/src/components/admin_console/system_user_detail/system_user_detail.tsx index c486c8e9d1..bd2ca80a73 100644 --- a/webapp/channels/src/components/admin_console/system_user_detail/system_user_detail.tsx +++ b/webapp/channels/src/components/admin_console/system_user_detail/system_user_detail.tsx @@ -108,11 +108,11 @@ export default class SystemUserDetail extends React.PureComponent { this.setState({addTeamOpen: true}); - } + }; addTeams = (teams: Team[]): void => { const promises = []; @@ -120,63 +120,63 @@ export default class SystemUserDetail extends React.PureComponent this.setState({refreshTeams: true})); - } + }; closeAddTeam = (): void => { this.setState({addTeamOpen: false}); - } + }; doPasswordReset = (user: UserProfile): void => { this.setState({ showPasswordModal: true, user, }); - } + }; doPasswordResetDismiss = (): void => { this.setState({ showPasswordModal: false, }); - } + }; doPasswordResetSubmit = (): void => { this.setState({ showPasswordModal: false, }); - } + }; handleMakeActive = (e: React.MouseEvent): void => { e.preventDefault(); this.props.actions.updateUserActive(this.props.user.id, true). then((data) => this.onUpdateActiveResult(data.error)); - } + }; handleShowDeactivateMemberModal = (e: React.MouseEvent): void => { e.preventDefault(); this.setState({showDeactivateMemberModal: true}); - } + }; handleDeactivateMember = (): void => { this.props.actions.updateUserActive(this.props.user.id, false). then((data) => this.onUpdateActiveResult(data.error)); this.setState({showDeactivateMemberModal: false}); - } + }; onUpdateActiveResult = (error: ServerError): void => { if (error) { this.setState({error}); } - } + }; handleDeactivateCancel = (): void => { this.setState({showDeactivateMemberModal: false}); - } + }; // TODO: add error handler function handleResetMfa = (e: React.MouseEvent): void => { e.preventDefault(); adminResetMfa(this.props.user.id, null, null); - } + }; handleEmailChange = (e: React.ChangeEvent): void => { const emailChanged = e.target.value !== this.props.user.email; @@ -187,7 +187,7 @@ export default class SystemUserDetail extends React.PureComponent): void => { e.preventDefault(); @@ -220,7 +220,7 @@ export default class SystemUserDetail extends React.PureComponent { const title = ( @@ -279,7 +279,7 @@ export default class SystemUserDetail extends React.PureComponent ); - } + }; renderActivateDeactivate = (): React.ReactNode => { if (this.props.user.delete_at > 0) { @@ -302,7 +302,7 @@ export default class SystemUserDetail extends React.PureComponent ); - } + }; renderRemoveMFA = (): React.ReactNode => { if (this.props.user.mfa_active) { @@ -317,7 +317,7 @@ export default class SystemUserDetail extends React.PureComponent { const page = this.state.page < 1 ? 0 : this.state.page - 1; this.setState({page, loading: true}); this.performSearch(); - } + }; private nextPage = async (e: React.MouseEvent): Promise => { e.preventDefault(); const page = this.state.page + 1; this.setState({page, loading: true}); this.performSearch(); - } + }; private performSearch = (): void => { const userId = this.props.userId; @@ -83,7 +83,7 @@ export default class AbstractList extends React.PureComponent { } this.setState({loading: false}); }); - } + }; private getPaging(): Paging { const startCount = (this.state.page * PAGE_SIZE) + 1; @@ -110,7 +110,7 @@ export default class AbstractList extends React.PureComponent { ); } return null; - } + }; private renderRows = (): JSX.Element | JSX.Element[] => { if (this.state.loading) { @@ -134,7 +134,7 @@ export default class AbstractList extends React.PureComponent { const pageEnd = this.state.page < 1 ? PAGE_SIZE : (this.state.page + 1) * PAGE_SIZE; // ie 10, 20, 30, etc. const pageData = this.props.data.slice(pageStart, pageEnd).map(this.props.renderRow); // ie 0-10, 10-20, etc. return pageData; - } + }; public render = (): JSX.Element => { const {startCount, endCount, total} = this.getPaging(); @@ -179,6 +179,6 @@ export default class AbstractList extends React.PureComponent { } ); - } + }; } diff --git a/webapp/channels/src/components/admin_console/system_user_detail/team_list/team_list.tsx b/webapp/channels/src/components/admin_console/system_user_detail/team_list/team_list.tsx index aef1b01dc0..0d3987bd74 100644 --- a/webapp/channels/src/components/admin_console/system_user_detail/team_list/team_list.tsx +++ b/webapp/channels/src/components/admin_console/system_user_detail/team_list/team_list.tsx @@ -71,7 +71,7 @@ export default class TeamList extends React.PureComponent { emptyListTextId: t('admin.team_settings.team_list.no_teams_found'), emptyListTextDefaultMessage: 'No teams found', refreshTeams: false, - } + }; public constructor(props: Props) { super(props); @@ -100,7 +100,7 @@ export default class TeamList extends React.PureComponent { this.setState({teamsWithMemberships}); this.props.userDetailCallback(teamsWithMemberships); }); - } + }; // check this out private mergeTeamsWithMemberships = (data: [{data: Team[]}, {data: TeamMembership[]}]): TeamWithMembership[] => { @@ -113,7 +113,7 @@ export default class TeamList extends React.PureComponent { }); teamsWithMemberships = filterAndSortTeamsByDisplayName(teamsWithMemberships, this.props.locale); return teamsWithMemberships; - } + }; private doRemoveUserFromTeam = async (teamId: string): Promise => { const {error} = await this.props.actions.removeUserFromTeam(teamId, this.props.userId); @@ -122,7 +122,7 @@ export default class TeamList extends React.PureComponent { } else { this.getTeamsAndMemberships(); } - } + }; private doMakeUserTeamAdmin = async (teamId: string) => { const {error} = await this.props.actions.updateTeamMemberSchemeRoles(teamId, this.props.userId, true, true); @@ -131,7 +131,7 @@ export default class TeamList extends React.PureComponent { } else { this.getTeamsAndMemberships(); } - } + }; private doMakeUserTeamMember = async (teamId: string) => { const {error} = await this.props.actions.updateTeamMemberSchemeRoles(teamId, this.props.userId, true, false); @@ -140,7 +140,7 @@ export default class TeamList extends React.PureComponent { } else { this.getTeamsAndMemberships(); } - } + }; public render(): JSX.Element { let serverError = null; @@ -179,5 +179,5 @@ export default class TeamList extends React.PureComponent { readOnly={this.props.readOnly} /> ); - } + }; } diff --git a/webapp/channels/src/components/admin_console/system_user_detail/team_list/team_row.tsx b/webapp/channels/src/components/admin_console/system_user_detail/team_list/team_row.tsx index 77292d03c1..d9915692e4 100644 --- a/webapp/channels/src/components/admin_console/system_user_detail/team_list/team_row.tsx +++ b/webapp/channels/src/components/admin_console/system_user_detail/team_list/team_row.tsx @@ -46,7 +46,7 @@ export default class TeamRow extends React.PureComponent { defaultMessage={'Invite only'} /> ); - } + }; private renderTeamRole = (team: TeamWithMembership) => { if (team.scheme_guest) { return ( @@ -73,7 +73,7 @@ export default class TeamRow extends React.PureComponent { ); } return null; - } + }; public render = (): JSX.Element => { const {team} = this.props; const teamIconUrl = Utils.imageURLForTeam(team); diff --git a/webapp/channels/src/components/admin_console/system_users/list/system_users_list.tsx b/webapp/channels/src/components/admin_console/system_users/list/system_users_list.tsx index 6938e0a353..4bd0fbeb02 100644 --- a/webapp/channels/src/components/admin_console/system_users/list/system_users_list.tsx +++ b/webapp/channels/src/components/admin_console/system_users/list/system_users_list.tsx @@ -103,11 +103,11 @@ export default class SystemUsersList extends React.PureComponent { this.setState({page: this.state.page + 1}); this.props.nextPage(this.state.page + 1); - } + }; previousPage = () => { this.setState({page: this.state.page - 1}); - } + }; search = (term: string) => { this.props.search(term); @@ -115,63 +115,63 @@ export default class SystemUsersList extends React.PureComponent { if (term !== '') { this.setState({page: 0}); } - } + }; doManageTeams = (user: UserProfile) => { this.setState({ showManageTeamsModal: true, user, }); - } + }; doManageRoles = (user: UserProfile) => { this.setState({ showManageRolesModal: true, user, }); - } + }; doManageTokens = (user: UserProfile) => { this.setState({ showManageTokensModal: true, user, }); - } + }; doManageTeamsDismiss = () => { this.setState({ showManageTeamsModal: false, user: undefined, }); - } + }; doManageRolesDismiss = () => { this.setState({ showManageRolesModal: false, user: undefined, }); - } + }; doManageTokensDismiss = () => { this.setState({ showManageTokensModal: false, user: undefined, }); - } + }; doPasswordReset = (user: UserProfile) => { this.setState({ showPasswordModal: true, user, }); - } + }; doPasswordResetDismiss = () => { this.setState({ showPasswordModal: false, user: undefined, }); - } + }; doPasswordResetSubmit = (user?: UserProfile) => { if (user) { @@ -182,21 +182,21 @@ export default class SystemUsersList extends React.PureComponent { showPasswordModal: false, user: undefined, }); - } + }; doEmailReset = (user: UserProfile) => { this.setState({ showEmailModal: true, user, }); - } + }; doEmailResetDismiss = () => { this.setState({ showEmailModal: false, user: undefined, }); - } + }; doEmailResetSubmit = (user?: UserProfile) => { if (user) { @@ -207,7 +207,7 @@ export default class SystemUsersList extends React.PureComponent { showEmailModal: false, user: undefined, }); - } + }; getInfoForUser(user: UserProfile) { const info = []; diff --git a/webapp/channels/src/components/admin_console/system_users/system_users.tsx b/webapp/channels/src/components/admin_console/system_users/system_users.tsx index 0b93372dcf..89c1b56d6f 100644 --- a/webapp/channels/src/components/admin_console/system_users/system_users.tsx +++ b/webapp/channels/src/components/admin_console/system_users/system_users.tsx @@ -164,23 +164,23 @@ export default class SystemUsers extends React.PureComponent { } this.setState({loading: false}); - } + }; handleTeamChange = (e: ChangeEvent) => { const teamId = e.target.value; this.loadDataForTeam(teamId, this.props.filter); this.props.actions.setSystemUsersSearch(this.props.searchTerm, teamId, this.props.filter); - } + }; handleFilterChange = (e: ChangeEvent) => { const filter = e.target.value; this.loadDataForTeam(this.props.teamId, filter); this.props.actions.setSystemUsersSearch(this.props.searchTerm, this.props.teamId, filter); - } + }; handleTermChange = (term: string) => { this.props.actions.setSystemUsersSearch(term, this.props.teamId, this.props.filter); - } + }; handleRevokeAllSessions = async () => { const {data} = await this.props.actions.revokeSessionsForAllUsers(); if (data) { @@ -188,13 +188,13 @@ export default class SystemUsers extends React.PureComponent { } else { this.props.actions.logError({type: 'critical', message: 'Can\'t revoke all sessions'}); } - } + }; handleRevokeAllSessionsCancel = () => { this.setState({showRevokeAllSessionsModal: false}); - } + }; handleShowRevokeAllSessionsModal = () => { this.setState({showRevokeAllSessionsModal: true}); - } + }; nextPage = async (page: number) => { const {teamId, filter} = this.props; @@ -216,7 +216,7 @@ export default class SystemUsers extends React.PureComponent { await loadProfilesAndTeamMembers(page + 1, USERS_PER_PAGE, teamId, options); } this.setState({loading: false}); - } + }; doSearch = debounce(async (term, teamId = this.props.teamId, filter = this.props.filter) => { if (!term) { @@ -250,7 +250,7 @@ export default class SystemUsers extends React.PureComponent { await this.props.actions.getUser(id); this.setState({loading: false}); - } + }; getUserByTokenOrId = async (id: string) => { if (this.props.enableUserAccessTokens) { @@ -264,7 +264,7 @@ export default class SystemUsers extends React.PureComponent { } this.getUserById(id); - } + }; renderRevokeAllUsersModal = () => { const title = ( @@ -302,7 +302,7 @@ export default class SystemUsers extends React.PureComponent { onCancel={this.handleRevokeAllSessionsCancel} /> ); - } + }; renderFilterRow = (doSearch: ((event: React.FormEvent) => void) | undefined) => { const teams = this.props.teams.map((team) => ( @@ -363,7 +363,7 @@ export default class SystemUsers extends React.PureComponent { ); - } + }; render() { const revokeAllUsersModal = this.renderRevokeAllUsersModal(); diff --git a/webapp/channels/src/components/admin_console/system_users/system_users_dropdown/system_users_dropdown.tsx b/webapp/channels/src/components/admin_console/system_users/system_users_dropdown/system_users_dropdown.tsx index 2d5e7af1a6..fabc10f3d3 100644 --- a/webapp/channels/src/components/admin_console/system_users/system_users_dropdown/system_users_dropdown.tsx +++ b/webapp/channels/src/components/admin_console/system_users/system_users_dropdown/system_users_dropdown.tsx @@ -86,40 +86,40 @@ export default class SystemUsersDropdown extends React.PureComponent void}) => { e.preventDefault(); this.props.doManageTeams(this.props.user); - } + }; handleManageRoles = (e: {preventDefault: () => void}) => { e.preventDefault(); this.props.doManageRoles(this.props.user); - } + }; handleManageTokens = (e: {preventDefault: () => void}) => { e.preventDefault(); this.props.doManageTokens(this.props.user); - } + }; handleResetPassword = (e: {preventDefault: () => void}) => { e.preventDefault(); this.props.doPasswordReset(this.props.user); - } + }; handleResetEmail = (e: {preventDefault: () => void}) => { e.preventDefault(); this.props.doEmailReset(this.props.user); - } + }; handleResetMfa = (e: {preventDefault: () => void}) => { e.preventDefault(); adminResetMfa(this.props.user.id, null, this.props.onError); - } + }; handleShowDeactivateMemberModal = async (e: {preventDefault: () => void}) => { e.preventDefault(); @@ -130,23 +130,23 @@ export default class SystemUsersDropdown extends React.PureComponent { this.props.actions.updateUserActive(this.props.user.id, false). then(this.onUpdateActiveResult); this.setState({showDeactivateMemberModal: false}); - } + }; onUpdateActiveResult = ({error}: {error: ServerError}) => { if (error) { this.props.onError({id: error.server_error_id, ...error}); } - } + }; handleDeactivateCancel = () => { this.setState({showDeactivateMemberModal: false}); - } + }; renderDeactivateMemberModal = () => { const user = this.props.user; @@ -273,7 +273,7 @@ export default class SystemUsersDropdown extends React.PureComponent ); - } + }; shouldDisableBotsWhenOwnerIsDeactivated() { return this.props.config && @@ -284,12 +284,12 @@ export default class SystemUsersDropdown extends React.PureComponent void}) => { e.preventDefault(); this.setState({showRevokeSessionsModal: true}); - } + }; handleShowCreateGroupSyncableMembershipsModal = (e: {preventDefault: () => void}) => { e.preventDefault(); this.setState({showCreateGroupMembershipsModal: true}); - } + }; handleCreateGroupSyncableMemberships = async () => { const {error} = await this.props.actions.createGroupTeamsAndChannels(this.props.user.id); @@ -298,11 +298,11 @@ export default class SystemUsersDropdown extends React.PureComponent { this.setState({showCreateGroupMembershipsModal: false}); - } + }; handleRevokeSessions = async () => { const me = this.props.currentUser; @@ -315,15 +315,15 @@ export default class SystemUsersDropdown extends React.PureComponent { this.setState({showRevokeSessionsModal: false}); - } + }; handlePromoteToUser = () => { this.setState({showPromoteToUserModal: true}); - } + }; handlePromoteToUserConfirm = async () => { const {error} = await this.props.actions.promoteGuestToUser(this.props.user.id); @@ -332,15 +332,15 @@ export default class SystemUsersDropdown extends React.PureComponent { this.setState({showPromoteToUserModal: false}); - } + }; handleDemoteToGuest = () => { this.setState({showDemoteToGuestModal: true}); - } + }; handleDemoteToGuestConfirm = async () => { const {error} = await this.props.actions.demoteUserToGuest(this.props.user.id); @@ -348,11 +348,11 @@ export default class SystemUsersDropdown extends React.PureComponent { this.setState({showDemoteToGuestModal: false}); - } + }; renderPromoteToUserModal = () => { const title = ( @@ -393,7 +393,7 @@ export default class SystemUsersDropdown extends React.PureComponent ); - } + }; renderDemoteToGuestModal = () => { const title = ( @@ -434,7 +434,7 @@ export default class SystemUsersDropdown extends React.PureComponent ); - } + }; renderRevokeSessionsModal = () => { const title = ( @@ -475,7 +475,7 @@ export default class SystemUsersDropdown extends React.PureComponent ); - } + }; renderCreateGroupSyncablesMembershipsModal = () => { const title = ( @@ -524,7 +524,7 @@ export default class SystemUsersDropdown extends React.PureComponent ); - } + }; renderAccessToken = () => { const userAccessTokensEnabled = this.props.enableUserAccessTokens; @@ -561,7 +561,7 @@ export default class SystemUsersDropdown extends React.PureComponent ); - } + }; render() { const {currentUser, user, isLicensed, config} = this.props; diff --git a/webapp/channels/src/components/admin_console/team_channel_settings/abstract_list.tsx b/webapp/channels/src/components/admin_console/team_channel_settings/abstract_list.tsx index 5cf79950ed..fb10bb6e43 100644 --- a/webapp/channels/src/components/admin_console/team_channel_settings/abstract_list.tsx +++ b/webapp/channels/src/components/admin_console/team_channel_settings/abstract_list.tsx @@ -62,21 +62,21 @@ export default class AbstractList extends React.PureComponent { const page = this.state.page < 1 ? 0 : this.state.page - 1; this.setState({page, loading: true}); this.performSearch(page); - } + }; nextPage = async (e: MouseEvent): Promise => { e.preventDefault(); const page = this.state.page + 1; this.setState({page, loading: true}); this.performSearch(page); - } + }; renderHeader = (): JSX.Element | null => { if (this.props.data.length > 0) { return this.props.header; } return null; - } + }; renderRows = (): JSX.Element | JSX.Element[] => { if (this.state.loading) { @@ -98,7 +98,7 @@ export default class AbstractList extends React.PureComponent { } const offset = this.state.page * PAGE_SIZE; return this.props.data.slice(offset, offset + PAGE_SIZE).map(this.props.renderRow); - } + }; performSearch = (page: number): void => { this.setState({loading: true}); @@ -109,7 +109,7 @@ export default class AbstractList extends React.PureComponent { } this.setState({loading: false}); }); - } + }; getPaging(): Paging { const startCount = (this.state.page * PAGE_SIZE) + 1; @@ -175,5 +175,5 @@ export default class AbstractList extends React.PureComponent { } ); - } + }; } diff --git a/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_details.tsx b/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_details.tsx index 6a18c461be..7f7205d121 100644 --- a/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_details.tsx +++ b/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_details.tsx @@ -272,7 +272,7 @@ export default class ChannelDetails extends React.PureComponent { const currentValueIndex = this.state.channelPermissions.findIndex((element) => element.name === name); @@ -321,7 +321,7 @@ export default class ChannelDetails extends React.PureComponent { const groups = [...this.state.groups, ...groupIDs.map((gid: string) => this.props.allGroups[gid])]; @@ -607,20 +607,20 @@ export default class ChannelDetails extends React.PureComponent { const {isLocalArchived} = this.state; const isServerArchived = this.props.channel.delete_at !== 0; return !isLocalArchived && isServerArchived; - } + }; private addRolesToUpdate = (userId: string, schemeUser: boolean, schemeAdmin: boolean) => { const {rolesToUpdate} = this.state; rolesToUpdate[userId] = {schemeUser, schemeAdmin}; this.setState({rolesToUpdate: {...rolesToUpdate}, saveNeeded: true}); this.props.actions.setNavigationBlocked(true); - } + }; private addUserToRemove = (user: UserProfile) => { let {usersToRemoveCount} = this.state; @@ -634,7 +634,7 @@ export default class ChannelDetails extends React.PureComponent { let {usersToRemoveCount} = this.state; @@ -649,7 +649,7 @@ export default class ChannelDetails extends React.PureComponent { const {isLocalArchived, serverError, previousServerError} = this.state; diff --git a/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_members/channel_members.tsx b/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_members/channel_members.tsx index 45b40c898b..57958b9c65 100644 --- a/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_members/channel_members.tsx +++ b/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_members/channel_members.tsx @@ -126,29 +126,29 @@ export default class ChannelMembers extends React.PureComponent { private setStateLoading = (loading: boolean) => { this.setState({loading}); - } + }; private loadPage = async (page: number) => { const {loadProfilesAndReloadChannelMembers} = this.props.actions; const {channelId, filters} = this.props; await loadProfilesAndReloadChannelMembers(page + 1, PROFILE_CHUNK_SIZE, channelId, '', {active: true, ...filters}); - } + }; private removeUser = (user: UserProfile) => { this.props.onRemoveCallback(user); - } + }; private onAddCallback = (users: UserProfile[]) => { this.props.onAddCallback(users); - } + }; private onSearch = async (term: string) => { this.props.actions.setUserGridSearch(term); - } + }; private updateMembership = (membership: BaseMembership) => { this.props.updateRole(membership.user_id, membership.scheme_user, membership.scheme_admin); - } + }; private onFilter = async (filterOptions: FilterOptions) => { const roles = filterOptions.role.values; @@ -181,7 +181,7 @@ export default class ChannelMembers extends React.PureComponent { } else { this.props.actions.setUserGridFilters(filters); } - } + }; render = () => { const {users, channel, channelId, usersToAdd, usersToRemove, channelMembers, totalCount, searchTerm, isDisabled} = this.props; @@ -294,5 +294,5 @@ export default class ChannelMembers extends React.PureComponent { /> ); - } + }; } diff --git a/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_moderation.tsx b/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_moderation.tsx index 80caca67ae..22b4944242 100644 --- a/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_moderation.tsx +++ b/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_moderation.tsx @@ -353,7 +353,7 @@ export default class ChannelModeration extends React.PureComponent { ); } return errorMessages; - } + }; render = (): JSX.Element => { const {channelPermissions, guestAccountsEnabled, onChannelPermissionsChanged, readOnly} = this.props; @@ -421,5 +421,5 @@ export default class ChannelModeration extends React.PureComponent { ); - } + }; } diff --git a/webapp/channels/src/components/admin_console/team_channel_settings/channel/list/channel_list.tsx b/webapp/channels/src/components/admin_console/team_channel_settings/channel/list/channel_list.tsx index 8c5e607f52..89c9d7bf34 100644 --- a/webapp/channels/src/components/admin_console/team_channel_settings/channel/list/channel_list.tsx +++ b/webapp/channels/src/components/admin_console/team_channel_settings/channel/list/channel_list.tsx @@ -69,7 +69,7 @@ export default class ChannelList extends React.PureComponent { return term.length > 0 || Object.keys(filters).length > 0; - } + }; getPaginationProps = () => { const {page, term, filters} = this.state; @@ -78,7 +78,7 @@ export default class ChannelList extends React.PureComponent total ? total : endCount; return {startCount, endCount, total}; - } + }; loadPage = async (page = 0, term = '', filters = {}) => { this.setState({loading: true, term, filters}); @@ -93,7 +93,7 @@ export default class ChannelList extends React.PureComponent { let channels = []; @@ -106,21 +106,21 @@ export default class ChannelList extends React.PureComponent this.searchChannels(page, term, filters), 300, false, () => {}); nextPage = () => { this.loadPage(this.state.page + 1, this.state.term, this.state.filters); - } + }; previousPage = () => { this.setState({page: this.state.page - 1}); - } + }; onSearch = async (term = '') => { this.loadPage(0, term, this.state.filters); - } + }; getColumns = (): Column[] => { const name: JSX.Element = ( @@ -167,7 +167,7 @@ export default class ChannelList extends React.PureComponent { const {data} = this.props; @@ -245,7 +245,7 @@ export default class ChannelList extends React.PureComponent getHistory().push(`/admin_console/user_management/channels/${channel.id}`), }; }); - } + }; onFilter = (filterOptions: FilterOptions) => { const filters: ChannelSearchOpts = {}; @@ -285,7 +285,7 @@ export default class ChannelList extends React.PureComponent { const {term, searchErrored} = this.state; @@ -414,5 +414,5 @@ export default class ChannelList extends React.PureComponent ); - } + }; } diff --git a/webapp/channels/src/components/admin_console/team_channel_settings/group/group_list.tsx b/webapp/channels/src/components/admin_console/team_channel_settings/group/group_list.tsx index 40ab2ccba3..c6b39b93ca 100644 --- a/webapp/channels/src/components/admin_console/team_channel_settings/group/group_list.tsx +++ b/webapp/channels/src/components/admin_console/team_channel_settings/group/group_list.tsx @@ -69,7 +69,7 @@ export default class GroupList extends React.PureComponent { isDisabled={this.props.isDisabled} /> ); - } + }; render(): JSX.Element { return ( diff --git a/webapp/channels/src/components/admin_console/team_channel_settings/group/group_members_modal.tsx b/webapp/channels/src/components/admin_console/team_channel_settings/group/group_members_modal.tsx index b9ded53e82..c1f9e29d44 100644 --- a/webapp/channels/src/components/admin_console/team_channel_settings/group/group_members_modal.tsx +++ b/webapp/channels/src/components/admin_console/team_channel_settings/group/group_members_modal.tsx @@ -36,11 +36,11 @@ export default class GroupMembersModal extends React.PureComponent handleHide = () => { this.setState({show: false}); - } + }; handleExit = () => { this.props.onExited(); - } + }; render() { const {group} = this.props; diff --git a/webapp/channels/src/components/admin_console/team_channel_settings/group/group_row.tsx b/webapp/channels/src/components/admin_console/team_channel_settings/group/group_row.tsx index d94d8258d6..433db20631 100644 --- a/webapp/channels/src/components/admin_console/team_channel_settings/group/group_row.tsx +++ b/webapp/channels/src/components/admin_console/team_channel_settings/group/group_row.tsx @@ -63,7 +63,7 @@ export default class GroupRow extends React.PureComponent { return teamAdmin; } return member; - } + }; displayRoleToBe = () => { const {group, type} = this.props; @@ -73,7 +73,7 @@ export default class GroupRow extends React.PureComponent { return localizeMessage('admin.team_channel_settings.group_row.teamAdmin', 'Team Admin'); } return localizeMessage('admin.team_channel_settings.group_row.member', 'Member'); - } + }; render = () => { const {group} = this.props; diff --git a/webapp/channels/src/components/admin_console/team_channel_settings/group/group_users/users_to_remove.tsx b/webapp/channels/src/components/admin_console/team_channel_settings/group/group_users/users_to_remove.tsx index d7a8874a7a..eb33177005 100644 --- a/webapp/channels/src/components/admin_console/team_channel_settings/group/group_users/users_to_remove.tsx +++ b/webapp/channels/src/components/admin_console/team_channel_settings/group/group_users/users_to_remove.tsx @@ -83,7 +83,7 @@ export default class UsersToRemove extends React.PureComponent { setStateLoading = (loading: boolean) => { this.setState({loading}); - } + }; componentWillUnmount() { this.props.actions.setModalSearchTerm(''); @@ -98,23 +98,23 @@ export default class UsersToRemove extends React.PureComponent { } else if (scope === 'team') { await loadTeamMembersForProfilesList(profiles, scopeId); } - } + }; previousPage = async () => { const page = this.state.page < 1 ? 0 : this.state.page - 1; this.setState({page}); - } + }; nextPage = async () => { const {total} = this.props; const page = (this.state.page + 1) * GROUP_MEMBERS_PAGE_SIZE >= total ? this.state.page : this.state.page + 1; this.setState({page}); - } + }; onSearch = (term: string) => { this.props.actions.setModalSearchTerm(term); this.setState({page: 0}); - } + }; private onFilter = async (filterOptions: FilterOptions) => { const roles = filterOptions.role.values; @@ -147,7 +147,7 @@ export default class UsersToRemove extends React.PureComponent { } this.props.actions.setModalFilters(filters); this.setState({page: 0}); - } + }; private getPaginationProps = () => { const {page} = this.state; @@ -161,7 +161,7 @@ export default class UsersToRemove extends React.PureComponent { const firstPage = page === 0; return {startCount, endCount, page, lastPage, firstPage, total}; - } + }; private getRows = (): Row[] => { const {members, memberships, scope} = this.props; @@ -201,7 +201,7 @@ export default class UsersToRemove extends React.PureComponent { }, }; }); - } + }; private getColumns = (): Column[] => { return [ @@ -236,7 +236,7 @@ export default class UsersToRemove extends React.PureComponent { width: 3, }, ]; - } + }; private getFilterOptions = (): FilterOptions => { const filterOptions: FilterOptions = { @@ -325,7 +325,7 @@ export default class UsersToRemove extends React.PureComponent { } return filterOptions; - } + }; public render = (): JSX.Element => { const rows: Row[] = this.getRows(); @@ -360,5 +360,5 @@ export default class UsersToRemove extends React.PureComponent { /> ); - } + }; } diff --git a/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_details.tsx b/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_details.tsx index 2a39371139..03a8314afd 100644 --- a/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_details.tsx +++ b/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_details.tsx @@ -135,7 +135,7 @@ export default class TeamDetails extends React.PureComponent { return g; }); this.processGroupsChange(groups); - } + }; handleSubmit = async () => { this.setState({showRemoveConfirmation: false, saving: true}); @@ -290,7 +290,7 @@ export default class TeamDetails extends React.PureComponent { getHistory().push('/admin_console/user_management/teams'); } }); - } + }; setToggles = (syncChecked: boolean, allAllowedChecked: boolean, allowedDomainsChecked: boolean, allowedDomains: string) => { this.setState({ @@ -301,7 +301,7 @@ export default class TeamDetails extends React.PureComponent { allowedDomains, }, () => this.processGroupsChange(this.state.groups)); this.props.actions.setNavigationBlocked(true); - } + }; async processGroupsChange(groups: Group[]) { const {teamID, actions} = this.props; @@ -348,7 +348,7 @@ export default class TeamDetails extends React.PureComponent { }); this.setState({usersToAdd: {...usersToAddCopy}, usersToRemove: {...usersToRemove}, usersToRemoveCount, saveNeeded: true}); this.props.actions.setNavigationBlocked(true); - } + }; addUserToRemove = (user: UserProfile) => { let {usersToRemoveCount} = this.state; @@ -362,26 +362,26 @@ export default class TeamDetails extends React.PureComponent { delete rolesToUpdate[user.id]; this.setState({usersToRemove: {...usersToRemove}, usersToAdd: {...usersToAdd}, rolesToUpdate: {...rolesToUpdate}, usersToRemoveCount, saveNeeded: true}); this.props.actions.setNavigationBlocked(true); - } + }; addRolesToUpdate = (userId: string, schemeUser: boolean, schemeAdmin: boolean) => { const {rolesToUpdate} = this.state; rolesToUpdate[userId] = {schemeUser, schemeAdmin}; this.setState({rolesToUpdate: {...rolesToUpdate}, saveNeeded: true}); this.props.actions.setNavigationBlocked(true); - } + }; handleGroupRemoved = (gid: string) => { const groups = this.state.groups.filter((g) => g.id !== gid); this.setState({totalGroups: this.state.totalGroups - 1}); this.processGroupsChange(groups); - } + }; handleGroupChange = (groupIDs: string[]) => { const groups = [...this.state.groups, ...groupIDs.map((gid) => this.props.allGroups[gid])]; this.setState({totalGroups: this.state.totalGroups + groupIDs.length}); this.processGroupsChange(groups); - } + }; hideRemoveUsersModal = () => this.setState({showRemoveConfirmation: false}); @@ -395,19 +395,19 @@ export default class TeamDetails extends React.PureComponent { } else { this.handleSubmit(); } - } + }; teamToBeArchived = () => { const {isLocalArchived} = this.state; const isServerArchived = this.props.team.delete_at !== 0; return isLocalArchived && !isServerArchived; - } + }; teamToBeRestored = () => { const {isLocalArchived} = this.state; const isServerArchived = this.props.team.delete_at !== 0; return !isLocalArchived && isServerArchived; - } + }; onToggleArchive = () => { const {isLocalArchived, serverError, previousServerError} = this.state; diff --git a/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_members/team_members.tsx b/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_members/team_members.tsx index deafb9e8fe..eff236e3d3 100644 --- a/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_members/team_members.tsx +++ b/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_members/team_members.tsx @@ -126,25 +126,25 @@ export default class TeamMembers extends React.PureComponent { private setStateLoading = (loading: boolean) => { this.setState({loading}); - } + }; private loadPage = async (page: number) => { const {loadProfilesAndReloadTeamMembers} = this.props.actions; const {teamId, filters} = this.props; await loadProfilesAndReloadTeamMembers(page + 1, PROFILE_CHUNK_SIZE, teamId, {active: true, ...filters}); - } + }; private removeUser = (user: UserProfile) => { this.props.onRemoveCallback(user); - } + }; private onAddCallback = (users: UserProfile[]) => { this.props.onAddCallback(users); - } + }; private onSearch = async (term: string) => { this.props.actions.setUserGridSearch(term); - } + }; private onFilter = async (filterOptions: FilterOptions) => { const roles = filterOptions.role.values; @@ -177,11 +177,11 @@ export default class TeamMembers extends React.PureComponent { } else { this.props.actions.setUserGridFilters(filters); } - } + }; private updateMembership = (membership: BaseMembership) => { this.props.updateRole(membership.user_id, membership.scheme_user, membership.scheme_admin); - } + }; public render = () => { const {users, team, usersToAdd, usersToRemove, teamMembers, totalCount, searchTerm, isDisabled} = this.props; @@ -294,5 +294,5 @@ export default class TeamMembers extends React.PureComponent { /> ); - } + }; } diff --git a/webapp/channels/src/components/admin_console/team_channel_settings/team/list/team_list.tsx b/webapp/channels/src/components/admin_console/team_channel_settings/team/list/team_list.tsx index 6fe1d7461b..459c173ceb 100644 --- a/webapp/channels/src/components/admin_console/team_channel_settings/team/list/team_list.tsx +++ b/webapp/channels/src/components/admin_console/team_channel_settings/team/list/team_list.tsx @@ -61,7 +61,7 @@ export default class TeamList extends React.PureComponent { isSearching = (term: string, filters: TeamSearchOpts) => { return (term.length + Object.keys(filters).length) > 0; - } + }; getPaginationProps = () => { const {page, term, filters} = this.state; @@ -70,7 +70,7 @@ export default class TeamList extends React.PureComponent { let endCount = (page + 1) * PAGE_SIZE; endCount = endCount > total ? total : endCount; return {startCount, endCount, total}; - } + }; loadPage = async (page = 0, term = '', filters = {}) => { this.setState({loading: true, term, filters}); @@ -86,7 +86,7 @@ export default class TeamList extends React.PureComponent { await this.props.actions.getData(page, PAGE_SIZE); this.setState({page, loading: false}); - } + }; searchTeams = async (page = 0, term = '', filters = {}) => { let teams: Team[] = []; @@ -99,17 +99,17 @@ export default class TeamList extends React.PureComponent { searchErrored = false; } this.setState({page, loading: false, teams, total, searchErrored}); - } + }; searchTeamsDebounced = debounce((page, term, filters = {}) => this.searchTeams(page, term, filters), 300, false, () => {}); nextPage = () => { this.loadPage(this.state.page + 1, this.state.term, this.state.filters); - } + }; previousPage = () => { this.setState({page: this.state.page - 1}); - } + }; onSearch = (term = '') => { this.loadPage(0, term, this.state.filters); @@ -151,7 +151,7 @@ export default class TeamList extends React.PureComponent { } this.loadPage(0, this.state.term, filters); - } + }; getColumns = (): Column[] => { const name = ( @@ -186,7 +186,7 @@ export default class TeamList extends React.PureComponent { fixed: true, }, ]; - } + }; renderManagementMethodText = (team: Team) => { if (team.group_constrained) { @@ -210,7 +210,7 @@ export default class TeamList extends React.PureComponent { defaultMessage='Invite Only' /> ); - } + }; getRows = () => { const {data} = this.props; @@ -278,7 +278,7 @@ export default class TeamList extends React.PureComponent { onClick: () => getHistory().push(`/admin_console/user_management/teams/${team.id}`), }; }); - } + }; render() { const {term, searchErrored} = this.state; diff --git a/webapp/channels/src/components/admin_console/user_grid/user_grid.tsx b/webapp/channels/src/components/admin_console/user_grid/user_grid.tsx index b85144ae7c..7abe32ff04 100644 --- a/webapp/channels/src/components/admin_console/user_grid/user_grid.tsx +++ b/webapp/channels/src/components/admin_console/user_grid/user_grid.tsx @@ -70,32 +70,32 @@ export default class UserGrid extends React.PureComponent { this.setState({loading: true}); this.props.loadPage(page); this.setState({page, loading: false}); - } + }; private nextPage = () => { this.loadPage(this.state.page + 1); - } + }; private previousPage = () => { this.loadPage(this.state.page - 1); - } + }; private onSearch = async (term: string) => { this.props.onSearch(term); this.setState({page: 0}); - } + }; private onFilter = async (filters: FilterOptions) => { this.props.filterProps?.onFilter(filters); this.setState({page: 0}); - } + }; private getVisibleTotalCount = (): number => { const {includeUsers, excludeUsers, totalCount} = this.props; const includeUsersCount = Object.keys(includeUsers).length; const excludeUsersCount = Object.keys(excludeUsers).length; return totalCount + (includeUsersCount - excludeUsersCount); - } + }; public getPaginationProps = (): {startCount: number; endCount: number; total: number} => { const {includeUsers, excludeUsers, term} = this.props; @@ -120,7 +120,7 @@ export default class UserGrid extends React.PureComponent { endCount = endCount > total ? total : endCount; return {startCount, endCount, total}; - } + }; private removeUser = (user: UserProfile) => { const {excludeUsers} = this.props; @@ -137,7 +137,7 @@ export default class UserGrid extends React.PureComponent { } this.setState({page}); - } + }; private updateMembership = (membership: BaseMembership) => { const {membershipsToUpdate} = this.state; @@ -150,7 +150,7 @@ export default class UserGrid extends React.PureComponent { this.props.updateMembership(membership); this.setState({membershipsToUpdate}, this.forceUpdate); - } + }; private newMembership = (user: UserProfile): BaseMembership => { return { @@ -158,7 +158,7 @@ export default class UserGrid extends React.PureComponent { scheme_admin: false, scheme_user: !user.roles.includes('guest'), }; - } + }; private getRows = (): Row[] => { const {page, membershipsToUpdate} = this.state; @@ -226,7 +226,7 @@ export default class UserGrid extends React.PureComponent { }, }; }); - } + }; private getColumns = (): Column[] => { const name: JSX.Element = ( @@ -268,7 +268,7 @@ export default class UserGrid extends React.PureComponent { fixed: true, }, ]; - } + }; public render = (): JSX.Element => { const rows: Row[] = this.getRows(); @@ -304,5 +304,5 @@ export default class UserGrid extends React.PureComponent { filterProps={{...this.props.filterProps, onFilter: this.onFilter}} /> ); - } + }; } diff --git a/webapp/channels/src/components/admin_console/user_grid/user_grid_name.tsx b/webapp/channels/src/components/admin_console/user_grid/user_grid_name.tsx index 4e9b38709b..e7ae48653a 100644 --- a/webapp/channels/src/components/admin_console/user_grid/user_grid_name.tsx +++ b/webapp/channels/src/components/admin_console/user_grid/user_grid_name.tsx @@ -34,5 +34,5 @@ export default class UserGridName extends React.Component { ); - } + }; } diff --git a/webapp/channels/src/components/admin_console/user_grid/user_grid_remove.tsx b/webapp/channels/src/components/admin_console/user_grid/user_grid_remove.tsx index 8036f800df..68eb2883e2 100644 --- a/webapp/channels/src/components/admin_console/user_grid/user_grid_remove.tsx +++ b/webapp/channels/src/components/admin_console/user_grid/user_grid_remove.tsx @@ -20,7 +20,7 @@ export default class UserGridRemove extends React.PureComponent { return; } this.props.removeUser(this.props.user); - } + }; public render = (): JSX.Element => { const {isDisabled} = this.props; @@ -39,5 +39,5 @@ export default class UserGridRemove extends React.PureComponent { ); - } + }; } diff --git a/webapp/channels/src/components/admin_console/user_grid/user_grid_role_dropdown.tsx b/webapp/channels/src/components/admin_console/user_grid/user_grid_role_dropdown.tsx index 21697abb18..5f9b3dbcbd 100644 --- a/webapp/channels/src/components/admin_console/user_grid/user_grid_role_dropdown.tsx +++ b/webapp/channels/src/components/admin_console/user_grid/user_grid_role_dropdown.tsx @@ -47,7 +47,7 @@ export default class UserGridRoleDropdown extends React.PureComponent { makeAdmin: Utils.localizeMessage('channel_members_dropdown.make_channel_admin', 'Make Channel Admin'), makeMember: Utils.localizeMessage('channel_members_dropdown.make_channel_member', 'Make Channel Member'), }; - } + }; private getCurrentRole = (): Role => { const {user, membership, scope} = this.props; @@ -77,7 +77,7 @@ export default class UserGridRoleDropdown extends React.PureComponent { } return 'guest'; - } + }; private getLocalizedRole = (role: Role) => { switch (role) { @@ -95,7 +95,7 @@ export default class UserGridRoleDropdown extends React.PureComponent { default: return Utils.localizeMessage('admin.user_grid.guest', 'Guest'); } - } + }; private handleMakeAdmin = () => { this.props.handleUpdateMembership({ @@ -103,7 +103,7 @@ export default class UserGridRoleDropdown extends React.PureComponent { scheme_admin: true, scheme_user: true, }); - } + }; private handleMakeUser = () => { this.props.handleUpdateMembership({ @@ -111,7 +111,7 @@ export default class UserGridRoleDropdown extends React.PureComponent { scheme_admin: false, scheme_user: true, }); - } + }; private getAriaLabel = () => { const {scope} = this.props; @@ -119,7 +119,7 @@ export default class UserGridRoleDropdown extends React.PureComponent { return Utils.localizeMessage('team_members_dropdown.menuAriaLabel', 'Change the role of a team member'); } return Utils.localizeMessage('channel_members_dropdown.menuAriaLabel', 'Change the role of channel member'); - } + }; public render = (): React.ReactNode => { if (!this.props.membership) { @@ -194,5 +194,5 @@ export default class UserGridRoleDropdown extends React.PureComponent { ); - } + }; } diff --git a/webapp/channels/src/components/advanced_create_comment/advanced_create_comment.tsx b/webapp/channels/src/components/advanced_create_comment/advanced_create_comment.tsx index 14b461b3a8..b0679ea814 100644 --- a/webapp/channels/src/components/advanced_create_comment/advanced_create_comment.tsx +++ b/webapp/channels/src/components/advanced_create_comment/advanced_create_comment.tsx @@ -220,7 +220,7 @@ class AdvancedCreateComment extends React.PureComponent { static defaultProps = { focusOnMount: true, - } + }; static getDerivedStateFromProps(props: Props, state: State) { let updatedState: Partial = { @@ -332,7 +332,7 @@ class AdvancedCreateComment extends React.PureComponent { getChannelMemberCountsByGroup(channelId, isTimezoneEnabled); } } - } + }; saveDraftOnUnmount = () => { if (!this.isDraftEdited || !this.state.draft) { @@ -346,7 +346,7 @@ class AdvancedCreateComment extends React.PureComponent { } as PostDraft; this.props.onUpdateCommentDraft(updatedDraft, true); - } + }; saveDraftWithShow = () => { this.setState((prev) => { @@ -366,7 +366,7 @@ class AdvancedCreateComment extends React.PureComponent { }, () => { this.saveDraft(true); }); - } + }; saveDraft = (save = false) => { if (this.saveDraftFrame) { @@ -374,11 +374,11 @@ class AdvancedCreateComment extends React.PureComponent { this.props.onUpdateCommentDraft(this.state.draft, save); this.saveDraftFrame = null; } - } + }; setShowPreview = (newPreviewValue: boolean) => { this.props.setShowPreview(newPreviewValue); - } + }; focusTextboxIfNecessary = (e: KeyboardEvent) => { // Should only focus if RHS is expanded or if thread view @@ -397,7 +397,7 @@ class AdvancedCreateComment extends React.PureComponent { this.focusTextbox(); this.toggleAdvanceTextEditor(); } - } + }; setCaretPosition = (newCaretPosition: number) => { const textbox = this.textboxRef.current && this.textboxRef.current.getInputBox(); @@ -407,7 +407,7 @@ class AdvancedCreateComment extends React.PureComponent { }, () => { Utils.setCaretPosition(textbox, newCaretPosition); }); - } + }; pasteHandler = (e: ClipboardEvent) => { // we need to cast the TextboxElement type onto the EventTarget here since the ClipboardEvent is not generic @@ -447,11 +447,11 @@ class AdvancedCreateComment extends React.PureComponent { this.handleDraftChange(updatedDraft); this.setState({draft: updatedDraft}); - } + }; handleNotifyAllConfirmation = () => { this.doSubmit(); - } + }; showNotifyAllModal = (mentions: string[], channelTimezoneCount: number, memberNotifyCount: number) => { this.props.openModal({ @@ -464,7 +464,7 @@ class AdvancedCreateComment extends React.PureComponent { onConfirm: () => this.handleNotifyAllConfirmation(), }, }); - } + }; toggleEmojiPicker = (e?: React.MouseEvent): void => { e?.stopPropagation(); @@ -474,7 +474,7 @@ class AdvancedCreateComment extends React.PureComponent { hideEmojiPicker = () => { this.setState({showEmojiPicker: false}); - } + }; handleEmojiClick = (emoji: Emoji) => { const emojiAlias = ('short_name' in emoji && emoji.short_name) || emoji.name; @@ -512,7 +512,7 @@ class AdvancedCreateComment extends React.PureComponent { showEmojiPicker: false, draft: modifiedDraft, }); - } + }; handleGifClick = (gif: string) => { const draft = this.state.draft!; @@ -540,11 +540,11 @@ class AdvancedCreateComment extends React.PureComponent { }); this.focusTextbox(); - } + }; handlePostError = (postError: React.ReactNode) => { this.setState({postError}); - } + }; handleSubmit = async (e: React.FormEvent | React.MouseEvent) => { e.preventDefault(); @@ -642,7 +642,7 @@ class AdvancedCreateComment extends React.PureComponent { } await this.doSubmit(e); - } + }; doSubmit = async (e?: React.FormEvent) => { if (e) { @@ -714,7 +714,7 @@ class AdvancedCreateComment extends React.PureComponent { this.isDraftSubmitting = false; this.setState({draft: {...this.props.draft, uploadsInProgress: []}}); this.draftsForPost[this.props.rootId] = null; - } + }; commentMsgKeyPress = (e: React.KeyboardEvent) => { const {ctrlSend, codeBlockOnCtrlEnter} = this.props; @@ -743,7 +743,7 @@ class AdvancedCreateComment extends React.PureComponent { } this.emitTypingEvent(); - } + }; reactToLastMessage = (e: React.KeyboardEvent) => { e.preventDefault(); @@ -753,12 +753,12 @@ class AdvancedCreateComment extends React.PureComponent { // Here we are not handling conditions such as check for modals, popups etc. as shortcut is only trigger on // textbox input focus. Since all of them will already be closed as soon as they loose focus. emitShortcutReactToLastPostFrom(Locations.RHS_ROOT); - } + }; emitTypingEvent = () => { const {channelId, rootId} = this.props; GlobalActions.emitLocalUserTypingEvent(channelId, rootId); - } + }; handleChange = (e: React.ChangeEvent) => { const message = e.target.value; @@ -780,7 +780,7 @@ class AdvancedCreateComment extends React.PureComponent { } }); this.draftsForPost[this.props.rootId] = updatedDraft; - } + }; handleDraftChange = (draft: PostDraft, rootId?: string, save = false, instant = false) => { this.isDraftEdited = true; @@ -805,17 +805,17 @@ class AdvancedCreateComment extends React.PureComponent { }, Constants.SAVE_DRAFT_TIMEOUT); } this.draftsForPost[this.props.rootId] = draft; - } + }; handleMouseUpKeyUp = (e: React.MouseEvent | React.KeyboardEvent) => { this.setState({ caretPosition: (e.target as TextboxElement).selectionStart || 0, }); - } + }; handleSelect = (e: React.SyntheticEvent) => { Utils.adjustSelection(this.textboxRef.current?.getInputBox(), e); - } + }; handleKeyDown = (e: React.KeyboardEvent) => { const ctrlOrMetaKeyPressed = e.ctrlKey || e.metaKey; @@ -976,7 +976,7 @@ class AdvancedCreateComment extends React.PureComponent { if (lastMessageReactionKeyCombo) { this.reactToLastMessage(e); } - } + }; applyMarkdown = (options: ApplyMarkdownOptions) => { if (this.props.shouldShowPreview) { @@ -999,12 +999,12 @@ class AdvancedCreateComment extends React.PureComponent { const textbox = this.textboxRef.current?.getInputBox(); Utils.setSelectionRange(textbox, res.selectionStart, res.selectionEnd); }); - } + }; handleFileUploadChange = () => { this.isDraftEdited = true; this.focusTextbox(); - } + }; handleUploadStart = (clientIds: string[]) => { const draft = this.state.draft!; @@ -1021,12 +1021,12 @@ class AdvancedCreateComment extends React.PureComponent { // this is a bit redundant with the code that sets focus when the file input is clicked, // but this also resets the focus after a drag and drop this.focusTextbox(); - } + }; handleUploadProgress = (filePreviewInfo: FilePreviewInfo) => { const uploadsProgressPercent = {...this.state.uploadsProgressPercent, [filePreviewInfo.clientId]: filePreviewInfo}; this.setState({uploadsProgressPercent}); - } + }; handleFileUploadComplete = (fileInfos: FileInfo[], clientIds: string[], _: string, rootId?: string) => { const draft = this.draftsForPost[rootId!]!; @@ -1051,7 +1051,7 @@ class AdvancedCreateComment extends React.PureComponent { if (this.props.rootId === rootId) { this.setState({draft: modifiedDraft}); } - } + }; handleUploadError = (err: string | ServerError | null, clientId: string | number = -1, _?: string, rootId = '') => { if (clientId !== -1) { @@ -1084,7 +1084,7 @@ class AdvancedCreateComment extends React.PureComponent { this.props.scrollToBottom(); } }); - } + }; removePreview = (id: string) => { const draft = this.state.draft!; @@ -1127,11 +1127,11 @@ class AdvancedCreateComment extends React.PureComponent { } this.saveDraftFrame = window.setTimeout(() => {}, Constants.SAVE_DRAFT_TIMEOUT); - } + }; getFileUploadTarget = () => { return this.textboxRef.current?.getInputBox(); - } + }; toggleAdvanceTextEditor = () => { this.setState({ @@ -1144,13 +1144,13 @@ class AdvancedCreateComment extends React.PureComponent { name: AdvancedTextEditorConst.COMMENT, value: String(!this.state.isFormattingBarHidden), }]); - } + }; focusTextbox = (keepFocus = false) => { if (this.textboxRef.current && (keepFocus || !UserAgent.isMobile())) { this.textboxRef.current.focus(); } - } + }; shouldEnableAddButton = () => { const {draft} = this.state; @@ -1163,21 +1163,21 @@ class AdvancedCreateComment extends React.PureComponent { } return isErrorInvalidSlashCommand(this.state.serverError); - } + }; showPostDeletedModal = () => { this.props.openModal({ modalId: ModalIdentifiers.POST_DELETED_MODAL, dialogType: PostDeletedModal, }); - } + }; handleBlur = () => { if (!this.isDraftSubmitting) { this.saveDraftWithShow(); } this.lastBlurAt = Date.now(); - } + }; render() { const draft = this.state.draft!; diff --git a/webapp/channels/src/components/advanced_create_post/advanced_create_post.tsx b/webapp/channels/src/components/advanced_create_post/advanced_create_post.tsx index 13923c5278..630ad71188 100644 --- a/webapp/channels/src/components/advanced_create_post/advanced_create_post.tsx +++ b/webapp/channels/src/components/advanced_create_post/advanced_create_post.tsx @@ -372,11 +372,11 @@ class AdvancedCreatePost extends React.PureComponent { actions.getChannelMemberCountsByGroup(currentChannel.id, isTimezoneEnabled); } } - } + }; unloadHandler = () => { this.saveDraftWithShow(); - } + }; saveDraftWithShow = (props = this.props) => { if (this.saveDraftFrame && props.currentChannel) { @@ -393,7 +393,7 @@ class AdvancedCreatePost extends React.PureComponent { } this.saveDraft(props, true); - } + }; saveDraft = (props = this.props, save = false) => { if (this.saveDraftFrame && props.currentChannel) { @@ -402,11 +402,11 @@ class AdvancedCreatePost extends React.PureComponent { clearTimeout(this.saveDraftFrame); this.saveDraftFrame = null; } - } + }; setShowPreview = (newPreviewValue: boolean) => { this.props.actions.setShowPreview(newPreviewValue); - } + }; setOrientationListeners = () => { if (window.screen.orientation && 'onchange' in window.screen.orientation) { @@ -448,22 +448,22 @@ class AdvancedCreatePost extends React.PureComponent { } this.lastOrientation = orientation; - } + }; handlePostError = (postError: React.ReactNode) => { if (this.state.postError !== postError) { this.setState({postError}); } - } + }; toggleEmojiPicker = (e?: React.MouseEvent): void => { e?.stopPropagation(); this.setState({showEmojiPicker: !this.state.showEmojiPicker}); - } + }; hideEmojiPicker = () => { this.handleEmojiClose(); - } + }; doSubmit = async (e?: React.FormEvent) => { const channelId = this.props.currentChannel.id; @@ -576,11 +576,11 @@ class AdvancedCreatePost extends React.PureComponent { this.isDraftSubmitting = false; this.props.actions.setDraft(StoragePrefixes.DRAFT + channelId, null, channelId); this.draftsForChannel[channelId] = null; - } + }; handleNotifyAllConfirmation = () => { this.doSubmit(); - } + }; showNotifyAllModal = (mentions: string[], channelTimezoneCount: number, memberNotifyCount: number) => { this.props.actions.openModal({ @@ -593,7 +593,7 @@ class AdvancedCreatePost extends React.PureComponent { onConfirm: () => this.handleNotifyAllConfirmation(), }, }); - } + }; getStatusFromSlashCommand = () => { const {message} = this.state; @@ -721,7 +721,7 @@ class AdvancedCreatePost extends React.PureComponent { } await this.doSubmit(e); - } + }; sendMessage = async (originalPost: Post) => { const { @@ -780,7 +780,7 @@ class AdvancedCreatePost extends React.PureComponent { this.isDraftSubmitting = false; return {data: true}; - } + }; sendReaction(isReaction: RegExpExecArray) { const channelId = this.props.currentChannel.id; @@ -807,7 +807,7 @@ class AdvancedCreatePost extends React.PureComponent { if (this.textboxRef.current && (keepFocus || !UserAgent.isMobile())) { this.textboxRef.current.focus(); } - } + }; postMsgKeyPress = (e: React.KeyboardEvent) => { const {ctrlSend, codeBlockOnCtrlEnter} = this.props; @@ -852,12 +852,12 @@ class AdvancedCreatePost extends React.PureComponent { } this.emitTypingEvent(); - } + }; emitTypingEvent = () => { const channelId = this.props.currentChannel.id; GlobalActions.emitLocalUserTypingEvent(channelId, ''); - } + }; handleChange = (e: React.ChangeEvent) => { const message = e.target.value; @@ -878,7 +878,7 @@ class AdvancedCreatePost extends React.PureComponent { }; this.handleDraftChange(draft); - } + }; handleDraftChange = (draft: PostDraft, instant = false) => { const channelId = this.props.currentChannel.id; @@ -896,7 +896,7 @@ class AdvancedCreatePost extends React.PureComponent { } this.draftsForChannel[channelId] = draft; - } + }; pasteHandler = (e: ClipboardEvent) => { /** @@ -933,7 +933,7 @@ class AdvancedCreatePost extends React.PureComponent { const newCaretPosition = formattedMessage.length - (originalSize - this.state.caretPosition); this.setMessageAndCaretPostion(formattedMessage, newCaretPosition); this.handlePostPasteDraft(formattedMessage); - } + }; handlePostPasteDraft = (message: string) => { const draft = { @@ -944,11 +944,11 @@ class AdvancedCreatePost extends React.PureComponent { const channelId = this.props.currentChannel.id; this.props.actions.setDraft(StoragePrefixes.DRAFT + channelId, draft, channelId); this.draftsForChannel[channelId] = draft; - } + }; handleFileUploadChange = () => { this.focusTextbox(); - } + }; handleUploadStart = (clientIds: string[], channelId: string) => { const uploadsInProgress = [...this.props.draft.uploadsInProgress, ...clientIds]; @@ -964,7 +964,7 @@ class AdvancedCreatePost extends React.PureComponent { // this is a bit redundant with the code that sets focus when the file input is clicked, // but this also resets the focus after a drag and drop this.focusTextbox(); - } + }; handleUploadProgress = (filePreviewInfo: FilePreviewInfo) => { const uploadsProgressPercent = { @@ -972,7 +972,7 @@ class AdvancedCreatePost extends React.PureComponent { [filePreviewInfo.clientId]: filePreviewInfo, }; this.setState({uploadsProgressPercent}); - } + }; handleFileUploadComplete = (fileInfos: FileInfo[], clientIds: string[], channelId: string) => { const draft = {...this.draftsForChannel[channelId]!}; @@ -993,7 +993,7 @@ class AdvancedCreatePost extends React.PureComponent { } this.handleDraftChange(draft, true); - } + }; handleUploadError = (err: string | ServerError, clientId?: string, channelId?: string) => { let serverError = null; @@ -1092,7 +1092,7 @@ class AdvancedCreatePost extends React.PureComponent { if (shouldFocusMainTextbox(e, document.activeElement)) { this.focusTextbox(); } - } + }; documentKeyHandler = (e: KeyboardEvent) => { const ctrlOrMetaKeyPressed = e.ctrlKey || e.metaKey; @@ -1103,11 +1103,11 @@ class AdvancedCreatePost extends React.PureComponent { } this.focusTextboxIfNecessary(e); - } + }; getFileUploadTarget = () => { return this.textboxRef.current?.getInputBox(); - } + }; fillMessageFromHistory() { const lastMessage = this.props.messageInHistoryItem; @@ -1122,11 +1122,11 @@ class AdvancedCreatePost extends React.PureComponent { this.setState({ caretPosition: (e.target as HTMLInputElement).selectionStart || 0, }); - } + }; handleSelect = (e: React.SyntheticEvent) => { Utils.adjustSelection(this.textboxRef.current?.getInputBox(), e as React.KeyboardEvent); - } + }; handleKeyDown = (e: React.KeyboardEvent) => { const messageIsEmpty = this.state.message.length === 0; @@ -1294,7 +1294,7 @@ class AdvancedCreatePost extends React.PureComponent { } else if (ctrlAltCombo && Utils.isKeyPressed(e, KeyCodes.T)) { this.toggleAdvanceTextEditor(); } - } + }; editLastPost = (e: React.KeyboardEvent) => { e.preventDefault(); @@ -1314,7 +1314,7 @@ class AdvancedCreatePost extends React.PureComponent { this.textboxRef.current.blur(); } this.props.actions.setEditingPost(lastPost.id, 'post_textbox', type); - } + }; replyToLastPost = (e: React.KeyboardEvent) => { e.preventDefault(); @@ -1326,17 +1326,17 @@ class AdvancedCreatePost extends React.PureComponent { if (latestReplyablePostId) { this.props.actions.selectPostFromRightHandSideSearchByPostId(latestReplyablePostId); } - } + }; loadPrevMessage = (e: React.KeyboardEvent) => { e.preventDefault(); this.props.actions.moveHistoryIndexBack(Posts.MESSAGE_TYPES.POST).then(() => this.fillMessageFromHistory()); - } + }; loadNextMessage = (e: React.KeyboardEvent) => { e.preventDefault(); this.props.actions.moveHistoryIndexForward(Posts.MESSAGE_TYPES.POST).then(() => this.fillMessageFromHistory()); - } + }; applyMarkdown = (params: ApplyMarkdownOptions) => { if (this.props.shouldShowPreview) { @@ -1358,7 +1358,7 @@ class AdvancedCreatePost extends React.PureComponent { this.handleDraftChange(draft); }); - } + }; reactToLastMessage = (e: KeyboardEvent) => { e.preventDefault(); @@ -1374,7 +1374,7 @@ class AdvancedCreatePost extends React.PureComponent { if (!rhsExpanded && noModalsAreOpen && noPopupsDropdownsAreOpen) { emitShortcutReactToLastPostFrom(Locations.CENTER); } - } + }; handleBlur = () => { if (!this.isDraftSubmitting) { @@ -1382,11 +1382,11 @@ class AdvancedCreatePost extends React.PureComponent { } this.lastBlurAt = Date.now(); - } + }; handleEmojiClose = () => { this.setState({showEmojiPicker: false}); - } + }; setMessageAndCaretPostion = (newMessage: string, newCaretPosition: number) => { const textbox = this.textboxRef.current?.getInputBox(); @@ -1404,7 +1404,7 @@ class AdvancedCreatePost extends React.PureComponent { this.handleDraftChange(draft); }); - } + }; prefillMessage = (message: string, shouldFocus?: boolean) => { this.setMessageAndCaretPostion(message, message.length); @@ -1417,7 +1417,7 @@ class AdvancedCreatePost extends React.PureComponent { } this.focusTextbox(true); } - } + }; handleEmojiClick = (emoji: Emoji) => { const emojiAlias = ('short_names' in emoji && emoji.short_names && emoji.short_names[0]) || emoji.name; @@ -1444,7 +1444,7 @@ class AdvancedCreatePost extends React.PureComponent { } this.handleEmojiClose(); - } + }; handleGifClick = (gif: string) => { if (this.state.message === '') { @@ -1461,7 +1461,7 @@ class AdvancedCreatePost extends React.PureComponent { this.handleDraftChange(draft); } this.handleEmojiClose(); - } + }; toggleAdvanceTextEditor = () => { this.setState({ @@ -1474,11 +1474,11 @@ class AdvancedCreatePost extends React.PureComponent { name: AdvancedTextEditorConst.POST, value: String(!this.state.isFormattingBarHidden), }]); - } + }; handleRemovePriority = () => { this.handlePostPriorityApply(); - } + }; handlePostPriorityApply = (settings?: PostPriorityMetadata) => { const updatedDraft = { @@ -1524,7 +1524,7 @@ class AdvancedCreatePost extends React.PureComponent { this.props.draft.metadata.priority.requested_ack ) ); - } + }; render() { let centerClass = ''; diff --git a/webapp/channels/src/components/analytics/doughnut_chart.tsx b/webapp/channels/src/components/analytics/doughnut_chart.tsx index 01fce5025a..9366f5d4a5 100644 --- a/webapp/channels/src/components/analytics/doughnut_chart.tsx +++ b/webapp/channels/src/components/analytics/doughnut_chart.tsx @@ -52,7 +52,7 @@ export default class DoughnutChart extends React.PureComponent { } else { this.chart = new Chart(ctx, {type: 'doughnut', data: dataCopy, options: {}}); } - } + }; public render(): JSX.Element { let content; diff --git a/webapp/channels/src/components/analytics/line_chart.tsx b/webapp/channels/src/components/analytics/line_chart.tsx index 0c38879109..8207177b64 100644 --- a/webapp/channels/src/components/analytics/line_chart.tsx +++ b/webapp/channels/src/components/analytics/line_chart.tsx @@ -18,7 +18,7 @@ type Props = { } export default class LineChart extends React.PureComponent { - private canvasRef = React.createRef() + private canvasRef = React.createRef(); public static propTypes = { /* @@ -94,7 +94,7 @@ export default class LineChart extends React.PureComponent { if (this.chart && this.canvasRef.current && this.chart.options.responsive) { this.canvasRef.current.style.width = '100%'; } - } + }; public initChart = (update?: boolean): void => { if (!this.canvasRef.current) { @@ -113,7 +113,7 @@ export default class LineChart extends React.PureComponent { } else { this.chart = new Chart(ctx, {type: 'line', data: dataCopy, options: options || {}}); } - } + }; public render(): JSX.Element { let content; diff --git a/webapp/channels/src/components/analytics/team_analytics/team_analytics.tsx b/webapp/channels/src/components/analytics/team_analytics/team_analytics.tsx index d8659cca9a..532002b35d 100644 --- a/webapp/channels/src/components/analytics/team_analytics/team_analytics.tsx +++ b/webapp/channels/src/components/analytics/team_analytics/team_analytics.tsx @@ -126,7 +126,7 @@ export default class TeamAnalytics extends React.PureComponent { recentlyActiveUsers, newUsers, }); - } + }; private handleTeamChange = (e: React.ChangeEvent): void => { const teamId = e.target.value; @@ -143,7 +143,7 @@ export default class TeamAnalytics extends React.PureComponent { }); this.props.actions.setGlobalItem(LAST_ANALYTICS_TEAM, teamId); - } + }; public render(): JSX.Element { if (this.props.teams.length === 0 || !this.state.team || !this.props.stats[this.state.team.id]) { diff --git a/webapp/channels/src/components/announcement_bar/cloud_trial_announcement_bar/cloud_trial_announcement_bar.tsx b/webapp/channels/src/components/announcement_bar/cloud_trial_announcement_bar/cloud_trial_announcement_bar.tsx index 4bf0069172..e9fcd6ba46 100644 --- a/webapp/channels/src/components/announcement_bar/cloud_trial_announcement_bar/cloud_trial_announcement_bar.tsx +++ b/webapp/channels/src/components/announcement_bar/cloud_trial_announcement_bar/cloud_trial_announcement_bar.tsx @@ -83,12 +83,12 @@ class CloudTrialAnnouncementBar extends React.PureComponent { name: CloudBanners.TRIAL, value: `${dismissValue}`, }]); - } + }; shouldShowBanner = () => { const {isFreeTrial, userIsAdmin, isCloud} = this.props; return isFreeTrial && userIsAdmin && isCloud; - } + }; isDismissable = () => { const {daysLeftOnTrial} = this.props; @@ -98,7 +98,7 @@ class CloudTrialAnnouncementBar extends React.PureComponent { dismissable = false; } return dismissable; - } + }; showModal = () => { const {daysLeftOnTrial} = this.props; @@ -117,7 +117,7 @@ class CloudTrialAnnouncementBar extends React.PureComponent { modalId: ModalIdentifiers.PRICING_MODAL, dialogType: PricingModal, }); - } + }; render() { const {daysLeftOnTrial, preferences} = this.props; diff --git a/webapp/channels/src/components/announcement_bar/default_announcement_bar/announcement_bar.tsx b/webapp/channels/src/components/announcement_bar/default_announcement_bar/announcement_bar.tsx index 0a9c4d6574..a911ad0561 100644 --- a/webapp/channels/src/components/announcement_bar/default_announcement_bar/announcement_bar.tsx +++ b/webapp/channels/src/components/announcement_bar/default_announcement_bar/announcement_bar.tsx @@ -69,7 +69,7 @@ export default class AnnouncementBar extends React.PureComponent { showLinkAsButton: false, isTallBanner: false, showCTA: true, - } + }; enableToolTipIfNeeded = () => { const elm = this.messageRef.current; @@ -82,7 +82,7 @@ export default class AnnouncementBar extends React.PureComponent { return; } this.setState({showTooltip: false}); - } + }; componentDidMount() { this.props.actions.incrementAnnouncementBarCount(); @@ -107,7 +107,7 @@ export default class AnnouncementBar extends React.PureComponent { if (this.props.handleClose) { this.props.handleClose(); } - } + }; render() { if (!this.props.message) { diff --git a/webapp/channels/src/components/announcement_bar/payment_announcement_bar/payment_announcement_bar.tsx b/webapp/channels/src/components/announcement_bar/payment_announcement_bar/payment_announcement_bar.tsx index bd052684cf..5fe7c7fa4b 100644 --- a/webapp/channels/src/components/announcement_bar/payment_announcement_bar/payment_announcement_bar.tsx +++ b/webapp/channels/src/components/announcement_bar/payment_announcement_bar/payment_announcement_bar.tsx @@ -35,7 +35,7 @@ class PaymentAnnouncementBar extends React.PureComponent { isMostRecentPaymentFailed = () => { return this.props.subscription?.last_invoice?.status === 'failed'; - } + }; shouldShowBanner = () => { const {userIsAdmin, isCloud, subscription} = this.props; @@ -62,11 +62,11 @@ class PaymentAnnouncementBar extends React.PureComponent { } return true; - } + }; updatePaymentInfo = () => { getHistory().push('/admin_console/billing/payment_info'); - } + }; render() { if (isEmpty(this.props.customer) || isEmpty(this.props.subscription)) { diff --git a/webapp/channels/src/components/announcement_bar/text_dismissable_bar.tsx b/webapp/channels/src/components/announcement_bar/text_dismissable_bar.tsx index 3a630dff06..5895aa0c1d 100644 --- a/webapp/channels/src/components/announcement_bar/text_dismissable_bar.tsx +++ b/webapp/channels/src/components/announcement_bar/text_dismissable_bar.tsx @@ -53,7 +53,7 @@ export default class TextDismissableBar extends React.PureComponent { reloadPage = () => { window.location.reload(); - } + }; render() { const {buildHashOnAppLoad} = this.state; diff --git a/webapp/channels/src/components/apps_form/apps_form_component.tsx b/webapp/channels/src/components/apps_form/apps_form_component.tsx index f6c3864982..a83eb11274 100644 --- a/webapp/channels/src/components/apps_form/apps_form_component.tsx +++ b/webapp/channels/src/components/apps_form/apps_form_component.tsx @@ -132,7 +132,7 @@ export class AppsForm extends React.PureComponent { } return hasErrors; - } + }; handleSubmit = async (e: React.FormEvent, submitName?: string, value?: string) => { e.preventDefault(); @@ -286,7 +286,7 @@ export class AppsForm extends React.PureComponent { return []; } } - } + }; onHide = () => { this.handleHide(false); diff --git a/webapp/channels/src/components/apps_form/apps_form_container.tsx b/webapp/channels/src/components/apps_form/apps_form_container.tsx index 90496775a4..2a816bb5d8 100644 --- a/webapp/channels/src/components/apps_form/apps_form_container.tsx +++ b/webapp/channels/src/components/apps_form/apps_form_container.tsx @@ -185,7 +185,7 @@ class AppsFormContainer extends React.PureComponent { creq.query = userInput; return this.props.actions.doAppLookup(creq, intl); - } + }; render() { const {form} = this.state; diff --git a/webapp/channels/src/components/apps_form/apps_form_field/apps_form_field.tsx b/webapp/channels/src/components/apps_form/apps_form_field/apps_form_field.tsx index b0497bcf80..5f6f399861 100644 --- a/webapp/channels/src/components/apps_form/apps_form_field/apps_form_field.tsx +++ b/webapp/channels/src/components/apps_form/apps_form_field/apps_form_field.tsx @@ -56,7 +56,7 @@ export default class AppsFormField extends React.PureComponent { } else { onChange(name, option); } - } + }; render() { const { diff --git a/webapp/channels/src/components/apps_form/apps_form_field/apps_form_select_field.tsx b/webapp/channels/src/components/apps_form/apps_form_field/apps_form_select_field.tsx index 8ce3684fbb..59fbe98db7 100644 --- a/webapp/channels/src/components/apps_form/apps_form_field/apps_form_select_field.tsx +++ b/webapp/channels/src/components/apps_form/apps_form_field/apps_form_select_field.tsx @@ -81,11 +81,11 @@ export default class AppsFormSelectField extends React.PureComponent { this.props.onChange(selectedOption); - } + }; loadDynamicOptions = async (userInput: string): Promise => { return this.props.performLookup(this.props.field.name, userInput); - } + }; loadDynamicUserOptions = async (userInput: string): Promise => { const usersSearchResults: UserAutocomplete = await this.props.actions.autocompleteUsers(userInput.toLowerCase()); @@ -95,7 +95,7 @@ export default class AppsFormSelectField extends React.PureComponent => { let channelsSearchResults: Channel[] = []; @@ -105,7 +105,7 @@ export default class AppsFormSelectField extends React.PureComponent {}); return channelsSearchResults.map((channel) => ({...channel, label: channel.display_name, value: channel.id})); - } + }; renderDynamicSelect() { const {field} = this.props; diff --git a/webapp/channels/src/components/at_mention/at_mention.tsx b/webapp/channels/src/components/at_mention/at_mention.tsx index d6fc9c99cd..4bb914369f 100644 --- a/webapp/channels/src/components/at_mention/at_mention.tsx +++ b/webapp/channels/src/components/at_mention/at_mention.tsx @@ -46,7 +46,7 @@ export default class AtMention extends React.PureComponent { hasMention: false, disableHighlight: false, disableGroupHighlight: false, - } + }; constructor(props: Props) { super(props); @@ -65,12 +65,12 @@ export default class AtMention extends React.PureComponent { const placement = popOverOverlayPosition(targetBounds, getViewportSize().h, getViewportSize().h - 240); this.setState({target, show: !this.state.show, placement}); } - } + }; handleClick = (e: React.MouseEvent) => { e.preventDefault(); this.showOverlay(e.target as HTMLAnchorElement); - } + }; handleKeyDown = (e: React.KeyboardEvent) => { if (isKeyPressed(e, Constants.KeyCodes.ENTER) || isKeyPressed(e, Constants.KeyCodes.SPACE)) { @@ -80,11 +80,11 @@ export default class AtMention extends React.PureComponent { e.stopPropagation(); this.showOverlay(e.target as HTMLAnchorElement); } - } + }; hideOverlay = () => { this.setState({show: false}); - } + }; render() { const user = getUserOrGroupFromMentionName(this.props.usersByUsername, this.props.mentionName) as UserProfile | ''; diff --git a/webapp/channels/src/components/audio_video_preview/audio_video_preview.tsx b/webapp/channels/src/components/audio_video_preview/audio_video_preview.tsx index 6f4eacb678..3200a0c535 100644 --- a/webapp/channels/src/components/audio_video_preview/audio_video_preview.tsx +++ b/webapp/channels/src/components/audio_video_preview/audio_video_preview.tsx @@ -58,13 +58,13 @@ export default class AudioVideoPreview extends React.PureComponent this.setState({ canPlay: true, }); - } + }; handleLoadError = () => { this.setState({ canPlay: false, }); - } + }; stop = () => { if (this.videoRef.current) { @@ -72,7 +72,7 @@ export default class AudioVideoPreview extends React.PureComponent video.pause(); video.currentTime = 0; } - } + }; render() { if (!this.state.canPlay) { diff --git a/webapp/channels/src/components/authorize/authorize.tsx b/webapp/channels/src/components/authorize/authorize.tsx index 9058b91276..0f36351340 100644 --- a/webapp/channels/src/components/authorize/authorize.tsx +++ b/webapp/channels/src/components/authorize/authorize.tsx @@ -79,7 +79,7 @@ export default class Authorize extends React.PureComponent { } }, ); - } + }; public handleDeny = (): void => { const redirectUri = (new URLSearchParams(this.props.location.search)).get('redirect_uri'); @@ -89,7 +89,7 @@ export default class Authorize extends React.PureComponent { } getHistory().replace('/error'); - } + }; public render(): ReactNode { const app = this.state.app; diff --git a/webapp/channels/src/components/autocomplete_selector.jsx b/webapp/channels/src/components/autocomplete_selector.jsx index f5d1632bd1..b14a5ece91 100644 --- a/webapp/channels/src/components/autocomplete_selector.jsx +++ b/webapp/channels/src/components/autocomplete_selector.jsx @@ -47,7 +47,7 @@ export default class AutocompleteSelector extends React.PureComponent { } this.setState({input: e.target.value}); - } + }; handleSelected = (selected) => { this.setState({input: ''}); @@ -61,11 +61,11 @@ export default class AutocompleteSelector extends React.PureComponent { this.suggestionRef.blur(); } }); - } + }; setSuggestionRef = (ref) => { this.suggestionRef = ref; - } + }; onFocus = () => { this.setState({focused: true}); @@ -73,7 +73,7 @@ export default class AutocompleteSelector extends React.PureComponent { if (this.props.toggleFocus) { this.props.toggleFocus(true); } - } + }; onBlur = () => { this.setState({focused: false}); @@ -81,7 +81,7 @@ export default class AutocompleteSelector extends React.PureComponent { if (this.props.toggleFocus) { this.props.toggleFocus(false); } - } + }; render() { const { diff --git a/webapp/channels/src/components/autosize_textarea.tsx b/webapp/channels/src/components/autosize_textarea.tsx index a8259e0cb9..83a30afb07 100644 --- a/webapp/channels/src/components/autosize_textarea.tsx +++ b/webapp/channels/src/components/autosize_textarea.tsx @@ -61,7 +61,7 @@ export class AutosizeTextarea extends React.PureComponent { this.props.onHeightChange?.(height, parseInt(style.maxHeight || '0', 10)); } - } + }; private recalculatePadding = () => { if (!this.referenceRef.current || !this.textarea) { @@ -74,7 +74,7 @@ export class AutosizeTextarea extends React.PureComponent { if (paddingRight && paddingRight !== this.referenceRef.current.style.paddingRight) { this.referenceRef.current.style.paddingRight = paddingRight; } - } + }; private recalculateWidth = () => { if (!this.measuringRef) { @@ -87,7 +87,7 @@ export class AutosizeTextarea extends React.PureComponent { this.props.onWidthChange?.(width); }); } - } + }; private setTextareaRef = (textarea: HTMLTextAreaElement) => { if (this.props.forwardedRef) { @@ -99,7 +99,7 @@ export class AutosizeTextarea extends React.PureComponent { } this.textarea = textarea; - } + }; render() { const props = {...this.props}; diff --git a/webapp/channels/src/components/channel_header/channel_header.tsx b/webapp/channels/src/components/channel_header/channel_header.tsx index 0ac89b7669..268b832655 100644 --- a/webapp/channels/src/components/channel_header/channel_header.tsx +++ b/webapp/channels/src/components/channel_header/channel_header.tsx @@ -201,7 +201,7 @@ class ChannelHeader extends React.PureComponent { removeTooltipLink = () => { // Bootstrap adds the attr dynamically, removing it to prevent a11y readout this.toggleFavoriteRef.current?.removeAttribute('aria-describedby'); - } + }; setTitleMenuOpen = (open: boolean) => this.setState({titleMenuOpen: open}); @@ -218,7 +218,7 @@ class ChannelHeader extends React.PureComponent { }; actions.openModal(modalData); - } + }; showChannelHeaderPopover = (headerText: string) => { const headerDescriptionRect = this.headerDescriptionRef.current?.getBoundingClientRect(); @@ -235,7 +235,7 @@ class ChannelHeader extends React.PureComponent { const topOffset = (announcementBarSize * this.props.announcementBarCount) + 40; this.setState({topOffset}); - } + }; toggleChannelMembersRHS = () => { if (this.props.rhsState === RHSStates.CHANNEL_MEMBERS) { @@ -249,7 +249,7 @@ class ChannelHeader extends React.PureComponent { const headerDescriptionRect = this.headerDescriptionRef.current?.getBoundingClientRect(); const ellipsisWidthAdjustment = 10; this.setState({popoverOverlayWidth: (headerDescriptionRect?.width ?? 0) + ellipsisWidthAdjustment}); - } + }; handleFormattedTextClick = (e: MouseEvent) => handleFormattedTextClick(e, this.props.currentRelativeTeamUrl); @@ -276,7 +276,7 @@ class ChannelHeader extends React.PureComponent { /> ); - } + }; render() { const { diff --git a/webapp/channels/src/components/channel_header_dropdown/menu_items/close_channel/close_channel.tsx b/webapp/channels/src/components/channel_header_dropdown/menu_items/close_channel/close_channel.tsx index 25b026de8c..1ab246786b 100644 --- a/webapp/channels/src/components/channel_header_dropdown/menu_items/close_channel/close_channel.tsx +++ b/webapp/channels/src/components/channel_header_dropdown/menu_items/close_channel/close_channel.tsx @@ -17,7 +17,7 @@ type Props = { export default class CloseChannel extends React.PureComponent { private handleClose = () => { this.props.actions.goToLastViewedChannel(); - } + }; render() { return ( diff --git a/webapp/channels/src/components/channel_header_dropdown/menu_items/close_message/close_message.tsx b/webapp/channels/src/components/channel_header_dropdown/menu_items/close_message/close_message.tsx index e76c512e2f..609140a559 100644 --- a/webapp/channels/src/components/channel_header_dropdown/menu_items/close_message/close_message.tsx +++ b/webapp/channels/src/components/channel_header_dropdown/menu_items/close_message/close_message.tsx @@ -86,7 +86,7 @@ export default class CloseMessage extends React.PureComponent { savePreferences(currentUser.id, [{user_id: currentUser.id, category, name, value: 'false'}]); getHistory().push(`/${currentTeam.name}/channels/${redirectChannel}`); - } + }; render(): React.ReactNode { const {id, channel} = this.props; diff --git a/webapp/channels/src/components/channel_header_dropdown/menu_items/leave_channel/leave_channel.tsx b/webapp/channels/src/components/channel_header_dropdown/menu_items/leave_channel/leave_channel.tsx index 020ce50197..b251c242f4 100644 --- a/webapp/channels/src/components/channel_header_dropdown/menu_items/leave_channel/leave_channel.tsx +++ b/webapp/channels/src/components/channel_header_dropdown/menu_items/leave_channel/leave_channel.tsx @@ -40,7 +40,7 @@ export default class LeaveChannel extends React.PureComponent { static defaultProps = { isDefault: true, isGuestUser: false, - } + }; handleLeave = (e: Event) => { e.preventDefault(); @@ -64,7 +64,7 @@ export default class LeaveChannel extends React.PureComponent { } else { leaveChannel(channel.id); } - } + }; render() { const {channel, isDefault, isGuestUser, id} = this.props; diff --git a/webapp/channels/src/components/channel_header_dropdown/menu_items/toggle_favorite_channel/toggle_favorite_channel.tsx b/webapp/channels/src/components/channel_header_dropdown/menu_items/toggle_favorite_channel/toggle_favorite_channel.tsx index a490c3d1ce..ebca3142d7 100644 --- a/webapp/channels/src/components/channel_header_dropdown/menu_items/toggle_favorite_channel/toggle_favorite_channel.tsx +++ b/webapp/channels/src/components/channel_header_dropdown/menu_items/toggle_favorite_channel/toggle_favorite_channel.tsx @@ -24,7 +24,7 @@ type Props = { export default class ToggleFavoriteChannel extends React.PureComponent { static defaultProps = { show: true, - } + }; toggleFavoriteChannel = (channelId: string) => { const { @@ -41,7 +41,7 @@ export default class ToggleFavoriteChannel extends React.PureComponent { handleClick = (e: React.MouseEvent): void => { e.preventDefault(); this.toggleFavoriteChannel(this.props.channel.id); - } + }; render() { let text; diff --git a/webapp/channels/src/components/channel_header_dropdown/menu_items/toggle_mute_channel/toggle_mute_channel.tsx b/webapp/channels/src/components/channel_header_dropdown/menu_items/toggle_mute_channel/toggle_mute_channel.tsx index 80a94944bb..4a33da1b15 100644 --- a/webapp/channels/src/components/channel_header_dropdown/menu_items/toggle_mute_channel/toggle_mute_channel.tsx +++ b/webapp/channels/src/components/channel_header_dropdown/menu_items/toggle_mute_channel/toggle_mute_channel.tsx @@ -58,7 +58,7 @@ export default class MenuItemToggleMuteChannel extends React.PureComponent { } else { showPinnedPosts(channel.id); } - } + }; render() { return ( diff --git a/webapp/channels/src/components/channel_header_dropdown/mobile_channel_header_dropdown.tsx b/webapp/channels/src/components/channel_header_dropdown/mobile_channel_header_dropdown.tsx index 3fc87ad70d..c2d4b8ef73 100644 --- a/webapp/channels/src/components/channel_header_dropdown/mobile_channel_header_dropdown.tsx +++ b/webapp/channels/src/components/channel_header_dropdown/mobile_channel_header_dropdown.tsx @@ -45,7 +45,7 @@ class MobileChannelHeaderDropdown extends React.PureComponent { return displayName; } return channel.display_name; - } + }; render() { const {teammateIsBot, teammateStatus} = this.props; diff --git a/webapp/channels/src/components/channel_header_mobile/channel_header_mobile.tsx b/webapp/channels/src/components/channel_header_mobile/channel_header_mobile.tsx index 42a4aa0ac9..47c6e4c345 100644 --- a/webapp/channels/src/components/channel_header_mobile/channel_header_mobile.tsx +++ b/webapp/channels/src/components/channel_header_mobile/channel_header_mobile.tsx @@ -62,7 +62,7 @@ export default class ChannelHeaderMobile extends React.PureComponent { this.props.actions.closeRhsMenu(); } } - } + }; render() { const {user, channel, isMuted, inGlobalThreads, inDrafts} = this.props; diff --git a/webapp/channels/src/components/channel_header_mobile/show_search_button/show_search_button.tsx b/webapp/channels/src/components/channel_header_mobile/show_search_button/show_search_button.tsx index 32e0138339..de2e327693 100644 --- a/webapp/channels/src/components/channel_header_mobile/show_search_button/show_search_button.tsx +++ b/webapp/channels/src/components/channel_header_mobile/show_search_button/show_search_button.tsx @@ -18,7 +18,7 @@ type Props = { export default class ShowSearchButton extends React.PureComponent { handleClick = () => { this.props.actions.openRHSSearch(); - } + }; render() { return ( diff --git a/webapp/channels/src/components/channel_header_mobile/unmute_channel_button/unmute_channel_button.tsx b/webapp/channels/src/components/channel_header_mobile/unmute_channel_button/unmute_channel_button.tsx index a5d0cc1d21..76ca31e942 100644 --- a/webapp/channels/src/components/channel_header_mobile/unmute_channel_button/unmute_channel_button.tsx +++ b/webapp/channels/src/components/channel_header_mobile/unmute_channel_button/unmute_channel_button.tsx @@ -28,7 +28,7 @@ export default class UnmuteChannelButton extends React.PureComponent { } = this.props; updateChannelNotifyProps(user.id, channel.id, {mark_unread: NotificationLevels.ALL} as ChannelNotifyProps); - } + }; render(): JSX.Element { return ( diff --git a/webapp/channels/src/components/channel_invite_modal/channel_invite_modal.tsx b/webapp/channels/src/components/channel_invite_modal/channel_invite_modal.tsx index 2ca85d0d41..a24f097c7f 100644 --- a/webapp/channels/src/components/channel_invite_modal/channel_invite_modal.tsx +++ b/webapp/channels/src/components/channel_invite_modal/channel_invite_modal.tsx @@ -231,13 +231,13 @@ export default class ChannelInviteModal extends React.PureComponent): UserProfileValue[] => { return users.filter((user) => { return user.delete_at === 0 && !excludeUserIds.has(user.id); }) as UserProfileValue[]; - } + }; renderOption = (option: UserProfileValue, isSelected: boolean, onAdd: (user: UserProfileValue) => void, onMouseMove: (user: UserProfileValue) => void) => { let rowSelected = ''; @@ -352,24 +352,21 @@ export default class ChannelInviteModal extends React.PureComponent { + const InviteModalLink = (props: {inviteAsGuest?: boolean; children: React.ReactNode}) => { return ( - {children} + {props.children} ); }; @@ -457,5 +454,5 @@ export default class ChannelInviteModal extends React.PureComponent ); - } + }; } diff --git a/webapp/channels/src/components/channel_layout/channel_identifier_router/channel_identifier_router.tsx b/webapp/channels/src/components/channel_layout/channel_identifier_router/channel_identifier_router.tsx index fd1c2add2e..4e4ed3b079 100644 --- a/webapp/channels/src/components/channel_layout/channel_identifier_router/channel_identifier_router.tsx +++ b/webapp/channels/src/components/channel_layout/channel_identifier_router/channel_identifier_router.tsx @@ -62,7 +62,7 @@ export default class ChannelIdentifierRouter extends React.PureComponent getHistory().replace(channelUrl); }, Constants.PERMALINK_FADEOUT); } - } + }; render() { return ; diff --git a/webapp/channels/src/components/channel_members_modal/channel_members_modal.tsx b/webapp/channels/src/components/channel_members_modal/channel_members_modal.tsx index f2cf842c48..d861d4ef0d 100644 --- a/webapp/channels/src/components/channel_members_modal/channel_members_modal.tsx +++ b/webapp/channels/src/components/channel_members_modal/channel_members_modal.tsx @@ -51,7 +51,7 @@ export default class ChannelMembersModal extends React.PureComponent { this.setState({show: false}); - } + }; onAddNewMembersButton = () => { const {channel, actions} = this.props; @@ -63,7 +63,7 @@ export default class ChannelMembersModal extends React.PureComponent { this.updateSection(NotificationSections.NONE); this.props.onExited(); - } + }; updateSection = (section = NotificationSections.NONE) => { this.setState({activeSection: section}); @@ -112,7 +112,7 @@ export default class ChannelNotificationsModal extends React.PureComponent) => { const { @@ -127,7 +127,7 @@ export default class ChannelNotificationsModal extends React.PureComponent { const channelNotifyProps = this.props.channelMember && this.props.channelMember.notify_props as ChannelMemberNotifyProps; @@ -144,7 +144,7 @@ export default class ChannelNotificationsModal extends React.PureComponent this.setState({desktopNotifyLevel}); @@ -161,7 +161,7 @@ export default class ChannelNotificationsModal extends React.PureComponent this.setState({markUnreadNotifyLevel}); @@ -179,7 +179,7 @@ export default class ChannelNotificationsModal extends React.PureComponent this.setState({pushNotifyLevel}); handleUpdatePushThreadsNotificationLevel = (pushThreadsNotifyLevel: UserNotifyProps['push_threads']) => this.setState({pushThreadsNotifyLevel}); @@ -196,7 +196,7 @@ export default class ChannelNotificationsModal extends React.PureComponent { this.props.onChange(e.target.value); - } + }; handleOnChangeThreads = (e) => { const value = e.target.checked ? NotificationLevels.ALL : NotificationLevels.MENTION; this.props.onChangeThreads(value); - } + }; handleExpandSection = () => { this.props.onUpdateSection(this.props.section); - } + }; handleCollapseSection = () => { this.props.onUpdateSection(NotificationSections.NONE); - } + }; render() { const { diff --git a/webapp/channels/src/components/channel_selector_modal/channel_selector_modal.tsx b/webapp/channels/src/components/channel_selector_modal/channel_selector_modal.tsx index 6e1f351ed8..1628ea64e2 100644 --- a/webapp/channels/src/components/channel_selector_modal/channel_selector_modal.tsx +++ b/webapp/channels/src/components/channel_selector_modal/channel_selector_modal.tsx @@ -44,8 +44,8 @@ type State = { const CHANNELS_PER_PAGE = 50; export default class ChannelSelectorModal extends React.PureComponent { - searchTimeoutId = 0 - selectedItemRef = React.createRef() + searchTimeoutId = 0; + selectedItemRef = React.createRef(); state: State = { values: [], @@ -89,13 +89,13 @@ export default class ChannelSelectorModal extends React.PureComponent { this.props.actions.setModalSearchTerm(''); this.setState({show: false}); - } + }; handleExit = () => { if (this.props.onModalDismissed) { this.props.onModalDismissed(); } - } + }; handleSubmit = (e: any) => { if (e) { @@ -110,7 +110,7 @@ export default class ChannelSelectorModal extends React.PureComponent { const values = [...this.state.values]; @@ -119,13 +119,13 @@ export default class ChannelSelectorModal extends React.PureComponent { this.setState({ loadingChannels: loadingState, }); - } + }; handlePageChange = (page: number, prevPage: number) => { if (page > prevPage) { @@ -142,18 +142,18 @@ export default class ChannelSelectorModal extends React.PureComponent { this.setState({values}); - } + }; search = (term: string, multiselectComponent: MultiSelect) => { if (multiselectComponent.state.page !== 0) { multiselectComponent.setState({page: 0}); } this.props.actions.setModalSearchTerm(term); - } + }; renderOption = ( option: ChannelWithTeamDataValue, @@ -192,7 +192,7 @@ export default class ChannelSelectorModal extends React.PureComponent ); - } + }; renderValue(props: {data: ChannelWithTeamDataValue}) { return props.data.display_name + ' (' + props.data.team_display_name + ')'; diff --git a/webapp/channels/src/components/channel_view/channel_view.tsx b/webapp/channels/src/components/channel_view/channel_view.tsx index c3c76625c8..54177a1f2f 100644 --- a/webapp/channels/src/components/channel_view/channel_view.tsx +++ b/webapp/channels/src/components/channel_view/channel_view.tsx @@ -37,7 +37,7 @@ export default class ChannelView extends React.PureComponent { data-a11y-order-reversed={true} />, ); - } + }; static getDerivedStateFromProps(props: Props, state: State) { let updatedState = {}; @@ -79,11 +79,11 @@ export default class ChannelView extends React.PureComponent { getChannelView = () => { return this.channelViewRef.current; - } + }; onClickCloseChannel = () => { this.props.goToLastViewedChannel(); - } + }; componentDidUpdate(prevProps: Props) { if (prevProps.channelId !== this.props.channelId || prevProps.channelIsArchived !== this.props.channelIsArchived) { diff --git a/webapp/channels/src/components/code_preview.tsx b/webapp/channels/src/components/code_preview.tsx index fe9acaac80..dfdcd6e90e 100644 --- a/webapp/channels/src/components/code_preview.tsx +++ b/webapp/channels/src/components/code_preview.tsx @@ -87,7 +87,7 @@ export default class CodePreview extends React.PureComponent { } catch (e) { this.handleReceivedError(); } - } + }; handleReceivedCode = async (data: string | Node) => { let code = data as string; @@ -102,11 +102,11 @@ export default class CodePreview extends React.PureComponent { loading: false, success: true, }); - } + }; handleReceivedError = () => { this.setState({loading: false, success: false}); - } + }; static supports(fileInfo: FileInfo | LinkInfo) { return Boolean(SyntaxHighlighting.getLanguageFromFileExtension(fileInfo.extension)); diff --git a/webapp/channels/src/components/color_input.tsx b/webapp/channels/src/components/color_input.tsx index 0ef04654a9..5c16234e2f 100644 --- a/webapp/channels/src/components/color_input.tsx +++ b/webapp/channels/src/components/color_input.tsx @@ -96,7 +96,7 @@ export default class ColorInput extends React.PureComponent { if (event.target) { event.target.setSelectionRange(1, event.target.value.length); } - } + }; private onBlur = () => { const value = this.state.value; diff --git a/webapp/channels/src/components/commercial_support_modal/commercial_support_modal.tsx b/webapp/channels/src/components/commercial_support_modal/commercial_support_modal.tsx index dd736d202f..ab763acb45 100644 --- a/webapp/channels/src/components/commercial_support_modal/commercial_support_modal.tsx +++ b/webapp/channels/src/components/commercial_support_modal/commercial_support_modal.tsx @@ -46,19 +46,19 @@ export default class CommercialSupportModal extends React.PureComponent { this.setState({show: false}); - } + }; updateBannerWarning = (showBannerWarning: boolean) => { this.setState({showBannerWarning}); - } + }; hideBannerWarning = () => { this.updateBannerWarning(false); - } + }; render() { const {showBannerWarning} = this.state; diff --git a/webapp/channels/src/components/common/chip/chip.tsx b/webapp/channels/src/components/common/chip/chip.tsx index 20805947b8..9e7a904be5 100644 --- a/webapp/channels/src/components/common/chip/chip.tsx +++ b/webapp/channels/src/components/common/chip/chip.tsx @@ -56,7 +56,7 @@ export default class Chip extends React.PureComponent { onClick = (e: React.MouseEvent) => { e.preventDefault(); this.props.onClick?.(); - } + }; render() { return ( diff --git a/webapp/channels/src/components/common/comment_icon.tsx b/webapp/channels/src/components/common/comment_icon.tsx index 0b1b7876d1..e0fdeb0b70 100644 --- a/webapp/channels/src/components/common/comment_icon.tsx +++ b/webapp/channels/src/components/common/comment_icon.tsx @@ -26,7 +26,7 @@ export default class CommentIcon extends React.PureComponent { searchStyle: '', commentCount: 0, extraClass: '', - } + }; public render(): JSX.Element { let commentCountSpan: JSX.Element | null = null; diff --git a/webapp/channels/src/components/common/infinite_scroll.tsx b/webapp/channels/src/components/common/infinite_scroll.tsx index 8fa1a97f1f..6056d62962 100644 --- a/webapp/channels/src/components/common/infinite_scroll.tsx +++ b/webapp/channels/src/components/common/infinite_scroll.tsx @@ -94,11 +94,11 @@ export default class InfiniteScroll extends React.PureComponent { return SCROLL_BUFFER; } return Math.abs(buffer); - } + }; getAmountOfPages = (total: number, freq: number): number => { return Math.ceil(total / freq); - } + }; handleScroll = (): void => { const {isFetching, isEndofData} = this.state; @@ -135,7 +135,7 @@ export default class InfiniteScroll extends React.PureComponent { } }); } - } + }; debounceHandleScroll = debounce(this.handleScroll, DEBOUNCE_WAIT_TIME); diff --git a/webapp/channels/src/components/common/site_name_and_description.tsx b/webapp/channels/src/components/common/site_name_and_description.tsx index 033b725840..5f08f02065 100644 --- a/webapp/channels/src/components/common/site_name_and_description.tsx +++ b/webapp/channels/src/components/common/site_name_and_description.tsx @@ -12,7 +12,7 @@ type Props = { export default class SiteNameAndDescription extends React.PureComponent { public static defaultProps: Partial = { siteName: 'Mattermost', - } + }; public render(): JSX.Element { const { diff --git a/webapp/channels/src/components/confirm_modal.tsx b/webapp/channels/src/components/confirm_modal.tsx index 79eb0286fc..685438b459 100644 --- a/webapp/channels/src/components/confirm_modal.tsx +++ b/webapp/channels/src/components/confirm_modal.tsx @@ -84,7 +84,7 @@ export default class ConfirmModal extends React.Component { confirmButtonClass: 'btn btn-primary', confirmButtonText: '', modalClass: '', - } + }; constructor(props: Props) { super(props); @@ -103,15 +103,15 @@ export default class ConfirmModal extends React.Component { handleCheckboxChange = (e: React.ChangeEvent) => { this.setState({checked: e.target.checked}); - } + }; handleConfirm = () => { this.props.onConfirm?.(this.state.checked); - } + }; handleCancel = () => { this.props.onCancel?.(this.state.checked); - } + }; render() { let checkbox; diff --git a/webapp/channels/src/components/convert_channel_modal/convert_channel_modal.tsx b/webapp/channels/src/components/convert_channel_modal/convert_channel_modal.tsx index 80935dd469..eb67fd62b6 100644 --- a/webapp/channels/src/components/convert_channel_modal/convert_channel_modal.tsx +++ b/webapp/channels/src/components/convert_channel_modal/convert_channel_modal.tsx @@ -45,11 +45,11 @@ export default class ConvertChannelModal extends React.PureComponent { this.setState({show: false}); - } + }; render() { const { diff --git a/webapp/channels/src/components/copy_url_context_menu/copy_url_context_menu.tsx b/webapp/channels/src/components/copy_url_context_menu/copy_url_context_menu.tsx index 597e8b2257..a3dab0944b 100644 --- a/webapp/channels/src/components/copy_url_context_menu/copy_url_context_menu.tsx +++ b/webapp/channels/src/components/copy_url_context_menu/copy_url_context_menu.tsx @@ -39,7 +39,7 @@ export default class CopyUrlContextMenu extends React.PureComponent { } this.props.actions.copyToClipboard(link); - } + }; render(): JSX.Element { const contextMenu = ( diff --git a/webapp/channels/src/components/create_team/components/display_name.tsx b/webapp/channels/src/components/create_team/components/display_name.tsx index 231d86d8c0..f4001000a0 100644 --- a/webapp/channels/src/components/create_team/components/display_name.tsx +++ b/webapp/channels/src/components/create_team/components/display_name.tsx @@ -79,16 +79,16 @@ export default class TeamSignupDisplayNamePage extends React.PureComponent): void => { e.preventDefault(); e.currentTarget.select(); - } + }; handleDisplayNameChange = (e: React.ChangeEvent): void => { this.setState({teamDisplayName: e.target.value}); - } + }; render(): React.ReactNode { let nameError = null; diff --git a/webapp/channels/src/components/create_team/components/team_url/team_url.tsx b/webapp/channels/src/components/create_team/components/team_url/team_url.tsx index 87b7e2a529..0988cb22bf 100644 --- a/webapp/channels/src/components/create_team/components/team_url/team_url.tsx +++ b/webapp/channels/src/components/create_team/components/team_url/team_url.tsx @@ -78,7 +78,7 @@ export default class TeamUrl extends React.PureComponent { const newState = this.props.state; newState.wizard = 'display_name'; this.props.updateParent(newState); - } + }; public submitNext = async (e: React.MouseEvent) => { e.preventDefault(); @@ -177,16 +177,16 @@ export default class TeamUrl extends React.PureComponent { this.setState({nameError: error.message}); this.setState({isLoading: false}); } - } + }; public handleFocus = (e: React.FocusEvent) => { e.preventDefault(); e.currentTarget.select(); - } + }; public handleTeamURLInputChange = (e: React.ChangeEvent) => { this.setState({teamURL: e.target.value}); - } + }; render() { let nameError = null; diff --git a/webapp/channels/src/components/create_user_groups_modal/create_user_groups_modal.tsx b/webapp/channels/src/components/create_user_groups_modal/create_user_groups_modal.tsx index e8adf2d9b3..f499c835cd 100644 --- a/webapp/channels/src/components/create_user_groups_modal/create_user_groups_modal.tsx +++ b/webapp/channels/src/components/create_user_groups_modal/create_user_groups_modal.tsx @@ -65,10 +65,10 @@ export default class CreateUserGroupsModal extends React.PureComponent { this.setState({show: false}); - } + }; isSaveEnabled = () => { return this.state.name.length > 0 && this.state.mention.length > 0 && this.state.usersToAdd.length > 0; - } + }; updateNameState = (e: React.ChangeEvent) => { const value = e.target.value; let mention = this.state.mention; @@ -79,12 +79,12 @@ export default class CreateUserGroupsModal extends React.PureComponent) => { const value = e.target.value; this.setState({mention: value, mentionUpdatedManually: true}); - } + }; private addUserCallback = (usersToAdd: UserProfile[]): void => { this.setState({usersToAdd}); @@ -99,7 +99,7 @@ export default class CreateUserGroupsModal extends React.PureComponent { this.setState({showUnknownError: false, mentionInputErrorText: '', nameInputErrorText: '', saving: true}); @@ -161,7 +161,7 @@ export default class CreateUserGroupsModal extends React.PureComponent { } } return this.props.actions.prefetchChannelPosts(channelId, delay); - } + }; private prefetchData = () => { const {prefetchRequestStatus, prefetchQueueObj} = this.props; @@ -93,7 +93,7 @@ export default class DataPrefetch extends React.PureComponent { } } } - } + }; render() { return null; diff --git a/webapp/channels/src/components/delete_category_modal/delete_category_modal.tsx b/webapp/channels/src/components/delete_category_modal/delete_category_modal.tsx index a322d9d4c2..5afd6bae5d 100644 --- a/webapp/channels/src/components/delete_category_modal/delete_category_modal.tsx +++ b/webapp/channels/src/components/delete_category_modal/delete_category_modal.tsx @@ -36,7 +36,7 @@ export default class DeleteCategoryModal extends React.PureComponent { this.props.actions.deleteCategory(this.props.category.id); - } + }; render() { return ( diff --git a/webapp/channels/src/components/delete_channel_modal/delete_channel_modal.tsx b/webapp/channels/src/components/delete_channel_modal/delete_channel_modal.tsx index 8ce74db444..08172a8206 100644 --- a/webapp/channels/src/components/delete_channel_modal/delete_channel_modal.tsx +++ b/webapp/channels/src/components/delete_channel_modal/delete_channel_modal.tsx @@ -42,11 +42,11 @@ export default class DeleteChannelModal extends React.PureComponent { this.setState({show: false}); - } + }; render() { const {canViewArchivedChannels} = this.props; diff --git a/webapp/channels/src/components/delete_post_modal/delete_post_modal.tsx b/webapp/channels/src/components/delete_post_modal/delete_post_modal.tsx index ebbd6ef2a5..422a416336 100644 --- a/webapp/channels/src/components/delete_post_modal/delete_post_modal.tsx +++ b/webapp/channels/src/components/delete_post_modal/delete_post_modal.tsx @@ -77,11 +77,11 @@ export default class DeletePostModal extends React.PureComponent { if (result.data) { this.onHide(); } - } + }; handleEntered = () => { this.deletePostBtn?.current?.focus(); - } + }; onHide = () => { this.setState({show: false}); @@ -97,7 +97,7 @@ export default class DeletePostModal extends React.PureComponent { element.focus(); } } - } + }; render() { let commentWarning: React.ReactNode = ''; diff --git a/webapp/channels/src/components/dnd_custom_time_picker_modal/dnd_custom_time_picker_modal.tsx b/webapp/channels/src/components/dnd_custom_time_picker_modal/dnd_custom_time_picker_modal.tsx index e0e389c3a6..f77f62b31c 100644 --- a/webapp/channels/src/components/dnd_custom_time_picker_modal/dnd_custom_time_picker_modal.tsx +++ b/webapp/channels/src/components/dnd_custom_time_picker_modal/dnd_custom_time_picker_modal.tsx @@ -87,7 +87,7 @@ export default class DndCustomTimePicker extends React.PureComponent { return DateTime.fromJSDate(date).toFormat('yyyy-MM-dd'); - } + }; getText = () => { const modalHeaderText = ( @@ -107,7 +107,7 @@ export default class DndCustomTimePicker extends React.PureComponent { if (this.state.isPopperOpen) { @@ -128,7 +128,7 @@ export default class DndCustomTimePicker extends React.PureComponent { this.setState({ @@ -168,9 +168,9 @@ export default class DndCustomTimePicker extends React.PureComponent { + handlePopperOpenState = (isOpen: boolean) => { this.setState({ isPopperOpen: isOpen, }); diff --git a/webapp/channels/src/components/dot_menu/dot_menu.tsx b/webapp/channels/src/components/dot_menu/dot_menu.tsx index df164cf18f..46067b6abe 100644 --- a/webapp/channels/src/components/dot_menu/dot_menu.tsx +++ b/webapp/channels/src/components/dot_menu/dot_menu.tsx @@ -143,7 +143,7 @@ export class DotMenuClass extends React.PureComponent { isFlagged: false, isReadOnly: false, location: Locations.CENTER, - } + }; private editDisableAction: DelayedAction; private buttonRef: React.RefObject; private canPostBeForwarded: boolean; @@ -199,7 +199,7 @@ export class DotMenuClass extends React.PureComponent { handleEditDisable = (): void => { this.setState({canEdit: false}); - } + }; handleFlagMenuItemActivated = (e: ChangeEvent): void => { if (this.props.isFlagged) { @@ -209,7 +209,7 @@ export class DotMenuClass extends React.PureComponent { trackDotMenuEvent(e, TELEMETRY_LABELS.SAVE); this.props.actions.flagPost(this.props.post.id); } - } + }; // listen to clicks/taps on add reaction menu item and pass to parent handler handleAddReactionMenuItemActivated = (e: ChangeEvent): void => { @@ -219,17 +219,17 @@ export class DotMenuClass extends React.PureComponent { if (this.props.handleAddReactionClick) { this.props.handleAddReactionClick(); } - } + }; copyLink = (e: ChangeEvent) => { trackDotMenuEvent(e, TELEMETRY_LABELS.COPY_LINK); Utils.copyToClipboard(`${this.props.teamUrl}/pl/${this.props.post.id}`); - } + }; copyText = (e: ChangeEvent) => { trackDotMenuEvent(e, TELEMETRY_LABELS.COPY_TEXT); Utils.copyToClipboard(this.props.post.message); - } + }; handlePinMenuItemActivated = (e: ChangeEvent): void => { if (this.props.post.is_pinned) { @@ -239,13 +239,13 @@ export class DotMenuClass extends React.PureComponent { trackDotMenuEvent(e, TELEMETRY_LABELS.PIN); this.props.actions.pinPost(this.props.post.id); } - } + }; handleMarkPostAsUnread = (e: ChangeEvent): void => { e.preventDefault(); trackDotMenuEvent(e, TELEMETRY_LABELS.UNREAD); this.props.actions.markPostAsUnread(this.props.post, this.props.location); - } + }; handleDeleteMenuItemActivated = (e: ChangeEvent): void => { e.preventDefault(); @@ -261,7 +261,7 @@ export class DotMenuClass extends React.PureComponent { }; this.props.actions.openModal(deletePostModalData); - } + }; handleForwardMenuItemActivated = (e: ChangeEvent): void => { if (!this.canPostBeForwarded) { @@ -282,7 +282,7 @@ export class DotMenuClass extends React.PureComponent { }; this.props.actions.openModal(forwardPostModalData); - } + }; handleEditMenuItemActivated = (e: ChangeEvent): void => { trackDotMenuEvent(e, TELEMETRY_LABELS.EDIT); @@ -293,7 +293,7 @@ export class DotMenuClass extends React.PureComponent { this.props.post.root_id ? Utils.localizeMessage('rhs_comment.comment', 'Comment') : Utils.localizeMessage('create_post.post', 'Post'), this.props.location === Locations.RHS_ROOT || this.props.location === Locations.RHS_COMMENT || this.props.location === Locations.SEARCH, ); - } + }; handleSetThreadFollow = (e: ChangeEvent) => { const {actions, teamId, threadId, userId, isFollowingThread, isMentionedInRootPost} = this.props; @@ -317,16 +317,16 @@ export class DotMenuClass extends React.PureComponent { threadId, followingThread, ); - } + }; handleCommentClick = (e: ChangeEvent) => { trackDotMenuEvent(e, TELEMETRY_LABELS.REPLY); this.props.handleCommentClick?.(e); - } + }; isKeyboardEvent = (e: React.KeyboardEvent): any => { return (e).getModifierState !== undefined; - } + }; onShortcutKeyDown = (e: React.KeyboardEvent): void => { e.preventDefault(); @@ -396,17 +396,17 @@ export class DotMenuClass extends React.PureComponent { this.handleDropdownOpened(false); break; } - } + }; handleDropdownOpened = (open: boolean) => { this.props.handleDropdownOpened?.(open); this.setState({closeMenuManually: true}); - } + }; handleMenuToggle = (open: boolean) => { this.props.handleDropdownOpened?.(open); this.setState({closeMenuManually: false}); - } + }; render(): JSX.Element { const {formatMessage} = this.props.intl; diff --git a/webapp/channels/src/components/edit_category_modal/edit_category_modal.tsx b/webapp/channels/src/components/edit_category_modal/edit_category_modal.tsx index dd5c8786bf..99c8f83381 100644 --- a/webapp/channels/src/components/edit_category_modal/edit_category_modal.tsx +++ b/webapp/channels/src/components/edit_category_modal/edit_category_modal.tsx @@ -44,15 +44,15 @@ export default class EditCategoryModal extends React.PureComponent handleClear = () => { this.setState({categoryName: ''}); - } + }; handleChange = (e: React.ChangeEvent) => { this.setState({categoryName: e.target.value}); - } + }; handleCancel = () => { this.handleClear(); - } + }; handleConfirm = () => { if (this.props.categoryId) { @@ -61,12 +61,12 @@ export default class EditCategoryModal extends React.PureComponent this.props.actions.createCategory(this.props.currentTeamId, this.state.categoryName, this.props.channelIdsToAdd); trackEvent('ui', 'ui_sidebar_created_category'); } - } + }; isConfirmDisabled = () => { return !this.state.categoryName || (Boolean(this.props.initialCategoryName) && this.props.initialCategoryName === this.state.categoryName) || this.state.categoryName.length > MAX_LENGTH; - } + }; getText = () => { let modalHeaderText; @@ -112,7 +112,7 @@ export default class EditCategoryModal extends React.PureComponent editButtonText, helpText, }; - } + }; render() { const { diff --git a/webapp/channels/src/components/edit_channel_header_modal/edit_channel_header_modal.tsx b/webapp/channels/src/components/edit_channel_header_modal/edit_channel_header_modal.tsx index c1fc225c1d..c61e3a48db 100644 --- a/webapp/channels/src/components/edit_channel_header_modal/edit_channel_header_modal.tsx +++ b/webapp/channels/src/components/edit_channel_header_modal/edit_channel_header_modal.tsx @@ -87,17 +87,17 @@ export default class EditChannelHeaderModal extends React.PureComponent { this.props.actions.setShowPreview(newState); - } + }; private handleChange = (e: React.ChangeEvent): void => { this.setState({ header: e.target.value, }); - } + }; public handleSave = async (): Promise => { const header = this.state.header?.trim() ?? ''; @@ -113,29 +113,29 @@ export default class EditChannelHeaderModal extends React.PureComponent { this.setState({ show: false, }); - } + }; private focusTextbox = (): void => { if (this.editChannelHeaderTextboxRef.current) { this.editChannelHeaderTextboxRef.current.focus(); } - } + }; private blurTextbox = (): void => { if (this.editChannelHeaderTextboxRef.current) { this.editChannelHeaderTextboxRef.current.blur(); } - } + }; private handleEntering = (): void => { this.focusTextbox(); - } + }; private handleKeyDown = (e: React.KeyboardEvent): void => { const {ctrlSend} = this.props; @@ -146,7 +146,7 @@ export default class EditChannelHeaderModal extends React.PureComponent): void => { const {ctrlSend} = this.props; @@ -157,11 +157,11 @@ export default class EditChannelHeaderModal extends React.PureComponent { this.setState({postError}); - } + }; private renderError = (): (JSX.Element | null) => { const {serverError} = this.state; @@ -192,7 +192,7 @@ export default class EditChannelHeaderModal extends React.PureComponent ); - } + }; public render(): JSX.Element { let headerTitle = null; diff --git a/webapp/channels/src/components/edit_channel_purpose_modal/edit_channel_purpose_modal.tsx b/webapp/channels/src/components/edit_channel_purpose_modal/edit_channel_purpose_modal.tsx index aace31bfb8..0f932581e0 100644 --- a/webapp/channels/src/components/edit_channel_purpose_modal/edit_channel_purpose_modal.tsx +++ b/webapp/channels/src/components/edit_channel_purpose_modal/edit_channel_purpose_modal.tsx @@ -55,11 +55,11 @@ export class EditChannelPurposeModal extends React.PureComponent { if (this.purpose.current) { Utils.placeCaretAtEnd(this.purpose.current); } - } + }; onHide = () => { this.setState({show: false}); - } + }; handleKeyDown = (e: React.KeyboardEvent) => { const {ctrlSend} = this.props; @@ -75,7 +75,7 @@ export class EditChannelPurposeModal extends React.PureComponent { e.preventDefault(); this.handleSave(); } - } + }; handleSave = async () => { const {channel, actions: {patchChannel}} = this.props; @@ -96,12 +96,12 @@ export class EditChannelPurposeModal extends React.PureComponent { if (data) { this.onHide(); } - } + }; handleChange = (e: ChangeEvent) => { e.preventDefault(); this.setState({purpose: e.target.value}); - } + }; render() { let serverError = null; diff --git a/webapp/channels/src/components/emoji/add_emoji/add_emoji.tsx b/webapp/channels/src/components/emoji/add_emoji/add_emoji.tsx index 519f94c9ea..168b3c7c1b 100644 --- a/webapp/channels/src/components/emoji/add_emoji/add_emoji.tsx +++ b/webapp/channels/src/components/emoji/add_emoji/add_emoji.tsx @@ -65,11 +65,11 @@ export default class AddEmoji extends React.PureComponent): Promise => { return this.handleSubmit(e); - } + }; handleSaveButtonClick = async (e: React.MouseEvent): Promise => { return this.handleSubmit(e); - } + }; handleSubmit = async (e: SyntheticEvent): Promise => { const {actions, emojiMap, user, team} = this.props; diff --git a/webapp/channels/src/components/emoji/emoji_list_item/emoji_list_item.tsx b/webapp/channels/src/components/emoji/emoji_list_item/emoji_list_item.tsx index f0d0b27af1..2daa92db44 100644 --- a/webapp/channels/src/components/emoji/emoji_list_item/emoji_list_item.tsx +++ b/webapp/channels/src/components/emoji/emoji_list_item/emoji_list_item.tsx @@ -29,7 +29,7 @@ export default class EmojiListItem extends React.PureComponent { emoji: {} as CustomEmoji, currentUserId: '', creatorDisplayName: '', - } + }; handleDelete = (): void => { if (this.props.onDelete) { @@ -37,7 +37,7 @@ export default class EmojiListItem extends React.PureComponent { } this.props.actions.deleteCustomEmoji(this.props.emoji.id); - } + }; render(): JSX.Element { const emoji = this.props.emoji; diff --git a/webapp/channels/src/components/emoji/emoji_page.tsx b/webapp/channels/src/components/emoji/emoji_page.tsx index dcc8291b70..cfba20e435 100644 --- a/webapp/channels/src/components/emoji/emoji_page.tsx +++ b/webapp/channels/src/components/emoji/emoji_page.tsx @@ -30,7 +30,7 @@ export default class EmojiPage extends React.PureComponent { teamName: '', teamDisplayName: '', siteName: '', - } + }; componentDidMount() { this.updateTitle(); @@ -44,7 +44,7 @@ export default class EmojiPage extends React.PureComponent { updateTitle = () => { document.title = Utils.localizeMessage('custom_emoji.header', 'Custom Emoji') + ' - ' + this.props.teamDisplayName + ' ' + this.props.siteName; - } + }; componentDidUpdate(prevProps: Props) { if (this.props.siteName !== prevProps.siteName) { diff --git a/webapp/channels/src/components/emoji_picker/components/emoji_picker_skin.tsx b/webapp/channels/src/components/emoji_picker/components/emoji_picker_skin.tsx index 8db5b3c03c..20a3f561a2 100644 --- a/webapp/channels/src/components/emoji_picker/components/emoji_picker_skin.tsx +++ b/webapp/channels/src/components/emoji_picker/components/emoji_picker_skin.tsx @@ -52,18 +52,18 @@ export class EmojiPickerSkin extends React.PureComponent { { skinName: Emoji.SkinTranslations.get(skin), }); - } + }; hideSkinTonePicker = (skin: string) => { this.setState({pickerExtended: false}); if (skin !== this.props.userSkinTone) { this.props.onSkinSelected(skin); } - } + }; showSkinTonePicker = () => { this.setState({pickerExtended: true}); - } + }; extended() { const closeButtonLabel = this.props.intl.formatMessage({ diff --git a/webapp/channels/src/components/external_image/external_image.tsx b/webapp/channels/src/components/external_image/external_image.tsx index f58bb337af..ba52ce48a3 100644 --- a/webapp/channels/src/components/external_image/external_image.tsx +++ b/webapp/channels/src/components/external_image/external_image.tsx @@ -24,12 +24,12 @@ export default class ExternalImage extends React.PureComponent { } return this.props.imageMetadata.format === 'svg'; - } + }; shouldRenderImage = () => { // Return true unless the image is an SVG and we have SVG rendering disabled return this.props.enableSVGs || !this.isSVGImage(); - } + }; render() { let src = getImageSrc(this.props.src, this.props.hasImageProxy); diff --git a/webapp/channels/src/components/favicon_title_handler/favicon_title_handler.tsx b/webapp/channels/src/components/favicon_title_handler/favicon_title_handler.tsx index bb57d2f8f5..2957eea26a 100644 --- a/webapp/channels/src/components/favicon_title_handler/favicon_title_handler.tsx +++ b/webapp/channels/src/components/favicon_title_handler/favicon_title_handler.tsx @@ -132,7 +132,7 @@ export class FaviconTitleHandlerClass extends React.PureComponent { } else { document.title = formatMessage({id: 'sidebar.team_select', defaultMessage: '{siteName} - Join a team'}, {siteName: currentSiteName || 'Mattermost'}); } - } + }; updateFavicon = (badgeStatus: BadgeStatus) => { if (!(UserAgent.isFirefox() || UserAgent.isChrome())) { @@ -177,7 +177,7 @@ export class FaviconTitleHandlerClass extends React.PureComponent { link96x96!.href = getFavicon(faviconDefault96x96); } } - } + }; render() { return null; diff --git a/webapp/channels/src/components/file_preview/file_preview.tsx b/webapp/channels/src/components/file_preview/file_preview.tsx index 31d3560540..38ca2e106a 100644 --- a/webapp/channels/src/components/file_preview/file_preview.tsx +++ b/webapp/channels/src/components/file_preview/file_preview.tsx @@ -36,7 +36,7 @@ export default class FilePreview extends React.PureComponent { handleRemove = (id: string) => { this.props.onRemove?.(id); - } + }; render() { const previews: ReactNode[] = []; diff --git a/webapp/channels/src/components/file_preview/file_progress_preview.tsx b/webapp/channels/src/components/file_preview/file_progress_preview.tsx index a84f605d34..1b4b3e5a63 100644 --- a/webapp/channels/src/components/file_preview/file_progress_preview.tsx +++ b/webapp/channels/src/components/file_preview/file_progress_preview.tsx @@ -20,7 +20,7 @@ type Props = { export default class FileProgressPreview extends React.PureComponent { handleRemove = () => { this.props.handleRemove(this.props.clientId); - } + }; render() { let percent = 0; diff --git a/webapp/channels/src/components/file_preview_modal/file_preview_modal.tsx b/webapp/channels/src/components/file_preview_modal/file_preview_modal.tsx index 69ef57c32b..eecca2d3fa 100644 --- a/webapp/channels/src/components/file_preview_modal/file_preview_modal.tsx +++ b/webapp/channels/src/components/file_preview_modal/file_preview_modal.tsx @@ -104,7 +104,7 @@ export default class FilePreviewModal extends React.PureComponent id = 0; } this.showImage(id); - } + }; handlePrev = () => { let id = this.state.imageIndex - 1; @@ -112,7 +112,7 @@ export default class FilePreviewModal extends React.PureComponent id = this.props.fileInfos.length - 1; } this.showImage(id); - } + }; handleKeyPress = (e: KeyboardEvent) => { if (Utils.isKeyPressed(e, KeyCodes.RIGHT)) { @@ -120,7 +120,7 @@ export default class FilePreviewModal extends React.PureComponent } else if (Utils.isKeyPressed(e, KeyCodes.LEFT)) { this.handlePrev(); } - } + }; componentDidMount() { document.addEventListener('keyup', this.handleKeyPress); @@ -156,7 +156,7 @@ export default class FilePreviewModal extends React.PureComponent if (!this.state.loaded[id]) { this.loadImage(id); } - } + }; loadImage = (index: number) => { const fileInfo = this.props.fileInfos[index]; @@ -184,7 +184,7 @@ export default class FilePreviewModal extends React.PureComponent // there's nothing to load for non-image files this.handleImageLoaded(index); } - } + }; handleImageLoaded = (index: number) => { this.setState((prevState) => { @@ -195,7 +195,7 @@ export default class FilePreviewModal extends React.PureComponent }, }; }); - } + }; handleImageProgress = (index: number, completedPercentage: number) => { this.setState((prevState) => { @@ -206,15 +206,15 @@ export default class FilePreviewModal extends React.PureComponent }, }; }); - } + }; onMouseEnterImage = () => { this.setState({showCloseBtn: true}); - } + }; onMouseLeaveImage = () => { this.setState({showCloseBtn: false}); - } + }; setScale = (index: number, scale: number) => { this.setState((prevState) => { @@ -225,7 +225,7 @@ export default class FilePreviewModal extends React.PureComponent }, }; }); - } + }; handleZoomIn = () => { let newScale = this.state.scale[this.state.imageIndex]; @@ -241,21 +241,21 @@ export default class FilePreviewModal extends React.PureComponent handleZoomReset = () => { this.setScale(this.state.imageIndex, ZoomSettings.DEFAULT_SCALE); - } + }; handleModalClose = () => { this.setState({show: false}); - } + }; getContent = (content: string) => { this.setState({content}); - } + }; handleBgClose = (e: React.MouseEvent) => { if (e.currentTarget === e.target) { this.handleModalClose(); } - } + }; render() { if (this.props.fileInfos.length < 1 || this.props.fileInfos.length - 1 < this.state.imageIndex) { diff --git a/webapp/channels/src/components/file_search_results/file_search_result_item.tsx b/webapp/channels/src/components/file_search_results/file_search_result_item.tsx index 4700ca3d0d..b6ee70282e 100644 --- a/webapp/channels/src/components/file_search_results/file_search_result_item.tsx +++ b/webapp/channels/src/components/file_search_results/file_search_result_item.tsx @@ -44,19 +44,19 @@ export default class FileSearchResultItem extends React.PureComponent { e.stopPropagation(); getHistory().push(`/${this.props.teamName}/pl/${this.props.fileInfo.post_id}`); - } + }; private copyLink = () => { copyToClipboard(`${getSiteURL()}/${this.props.teamName}/pl/${this.props.fileInfo.post_id}`); - } + }; private stopPropagation = (e: React.MouseEvent) => { e.stopPropagation(); - } + }; private keepOpen = (open: boolean) => { this.setState({keepOpen: open}); - } + }; private renderPluginItems = () => { const {fileInfo} = this.props; @@ -85,7 +85,7 @@ export default class FileSearchResultItem extends React.PureComponent ); - } + }; private showPreview = () => { this.props.actions.openModal({ @@ -97,7 +97,7 @@ export default class FileSearchResultItem extends React.PureComponent { } this.setState({requests}); } - } + }; fileUploadFail = (err: string | ServerError, clientId: string, channelId: string, currentRootId: string) => { this.props.onUploadError(err, clientId, channelId, currentRootId); - } + }; pluginUploadFiles = (files: File[]) => { // clear any existing errors this.props.onUploadError(''); this.uploadFiles(files); - } + }; checkPluginHooksAndUploadFiles = (files: FileList | File[]) => { // clear any existing errors @@ -248,7 +248,7 @@ export class FileUpload extends PureComponent { if (sortedFiles && sortedFiles.length) { this.uploadFiles(sortedFiles); } - } + }; uploadFiles = (sortedFiles: File[]) => { const {channelId, rootId} = this.props; @@ -318,7 +318,7 @@ export class FileUpload extends PureComponent { if (errors.length > 0) { this.props.onUploadError(errors.join(', ')); } - } + }; handleChange = (e: ChangeEvent) => { if (e.target.files && e.target.files.length > 0) { @@ -328,7 +328,7 @@ export class FileUpload extends PureComponent { } this.props.onFileUploadChange(); - } + }; handleDrop = (e: DragEvent) => { if (!this.props.canUploadFiles) { @@ -371,7 +371,7 @@ export class FileUpload extends PureComponent { } this.props.onFileUploadChange(); - } + }; registerDragEvents = (containerSelector: string, overlaySelector: string) => { const overlay = document.querySelector(overlaySelector); @@ -445,7 +445,7 @@ export class FileUpload extends PureComponent { } this.unbindDragsterEvents = dragster(containerSelector, dragsterActions); - } + }; containsEventTarget = (targetElement: HTMLInputElement | null, eventTarget: EventTarget | null) => targetElement && targetElement.contains(eventTarget as Node); @@ -513,7 +513,7 @@ export class FileUpload extends PureComponent { this.props.onFileUploadChange(); } } - } + }; keyUpload = (e: KeyboardEvent) => { if (cmdOrCtrlPressed(e) && !e.shiftKey && isKeyPressed(e, Constants.KeyCodes.U)) { @@ -531,7 +531,7 @@ export class FileUpload extends PureComponent { this.fileInput.current?.click(); } } - } + }; cancelUpload = (clientId: string) => { const requests = Object.assign({}, this.state.requests); @@ -543,7 +543,7 @@ export class FileUpload extends PureComponent { Reflect.deleteProperty(requests, clientId); this.setState({requests}); } - } + }; handleMaxUploadReached = (e: MouseEvent) => { if (e) { @@ -554,7 +554,7 @@ export class FileUpload extends PureComponent { const {formatMessage} = this.props.intl; onUploadError(formatMessage(holders.limited, {count: Constants.MAX_UPLOAD_FILES})); - } + }; handleLocalFileUploaded = (e: MouseEvent) => { const uploadsRemaining = Constants.MAX_UPLOAD_FILES - this.props.fileCount; @@ -566,13 +566,13 @@ export class FileUpload extends PureComponent { this.handleMaxUploadReached(e); } this.setState({menuOpen: false}); - } + }; simulateInputClick = (e: MouseEvent | TouchEvent) => { e.preventDefault(); e.stopPropagation(); this.fileInput.current?.click(); - } + }; render() { const {formatMessage} = this.props.intl; diff --git a/webapp/channels/src/components/form_error.tsx b/webapp/channels/src/components/form_error.tsx index 92d9b006d9..e752fa301f 100644 --- a/webapp/channels/src/components/form_error.tsx +++ b/webapp/channels/src/components/form_error.tsx @@ -17,7 +17,7 @@ export default class FormError extends React.PureComponent { public static defaultProps = { error: null, errors: [], - } + }; public render() { const {error = null, errors = [], iconClassName, margin, textClassName, type} = this.props; diff --git a/webapp/channels/src/components/get_link_modal.tsx b/webapp/channels/src/components/get_link_modal.tsx index 838441b997..10cd32e88a 100644 --- a/webapp/channels/src/components/get_link_modal.tsx +++ b/webapp/channels/src/components/get_link_modal.tsx @@ -36,7 +36,7 @@ export default class GetLinkModal extends React.PureComponent { public onHide = (): void => { this.setState({copiedLink: false}); this.props.onHide(); - } + }; public copyLink = (): void => { const textarea = this.textAreaRef.current; @@ -51,7 +51,7 @@ export default class GetLinkModal extends React.PureComponent { this.setState({copiedLink: false}); } } - } + }; public render(): JSX.Element { let helpText = null; diff --git a/webapp/channels/src/components/get_public_link_modal/get_public_link_modal.tsx b/webapp/channels/src/components/get_public_link_modal/get_public_link_modal.tsx index 0f1419f240..c098fb8fc0 100644 --- a/webapp/channels/src/components/get_public_link_modal/get_public_link_modal.tsx +++ b/webapp/channels/src/components/get_public_link_modal/get_public_link_modal.tsx @@ -39,7 +39,7 @@ export default class GetPublicLinkModal extends React.PureComponent { if (gfycats.length) { trackEvent('gfycat', 'views', {context: 'category_list', count: gfycats.length}); } - } + }; componentWillUnmount() { this.props.saveSearchScrollPosition(0); @@ -86,7 +86,7 @@ export class Categories extends PureComponent { } return ''; }) : []; - } + }; loadMore = () => this.props.requestCategoriesList(); diff --git a/webapp/channels/src/components/gif_picker/components/InfiniteScroll/index.js b/webapp/channels/src/components/gif_picker/components/InfiniteScroll/index.js index dfc61b306b..6473d8c504 100644 --- a/webapp/channels/src/components/gif_picker/components/InfiniteScroll/index.js +++ b/webapp/channels/src/components/gif_picker/components/InfiniteScroll/index.js @@ -18,7 +18,7 @@ export default class InfiniteScroll extends PureComponent { isReverse: PropTypes.bool, containerHeight: PropTypes.number, scrollPosition: PropTypes.number, - } + }; static defaultProps = { element: 'div', @@ -30,7 +30,7 @@ export default class InfiniteScroll extends PureComponent { isReverse: false, containerHeight: null, scrollPosition: null, - } + }; componentDidMount() { this.pageLoaded = this.props.pageStart; @@ -108,7 +108,7 @@ export default class InfiniteScroll extends PureComponent { this.props.loadMore(this.pageLoaded += 1); } } - } + }; attachScrollListener() { if (!this.props.hasMore) { diff --git a/webapp/channels/src/components/gif_picker/components/Search/index.tsx b/webapp/channels/src/components/gif_picker/components/Search/index.tsx index da54b1750a..ad2479bad1 100644 --- a/webapp/channels/src/components/gif_picker/components/Search/index.tsx +++ b/webapp/channels/src/components/gif_picker/components/Search/index.tsx @@ -57,7 +57,7 @@ export class Search extends PureComponent { loadMore = () => { const {searchText} = this.props; this.props.searchGfycat({searchText}); - } + }; render() { const {handleItemClick, searchText, onCategories} = this.props; diff --git a/webapp/channels/src/components/gif_picker/components/SearchBar/index.tsx b/webapp/channels/src/components/gif_picker/components/SearchBar/index.tsx index 1caf87f60a..4e109ce358 100644 --- a/webapp/channels/src/components/gif_picker/components/SearchBar/index.tsx +++ b/webapp/channels/src/components/gif_picker/components/SearchBar/index.tsx @@ -113,20 +113,20 @@ export class SearchBar extends Component { } this.props.saveSearchBarText(searchText); this.props.handleSearchTextChange(searchText); - } + }; handleSubmit = (event: FormEvent) => { event.preventDefault(); this.triggerSearch(this.searchInputRef.current?.value || ''); this.searchInputRef.current?.blur(); - } + }; triggerSearch = (searchText: string) => { const {onSearch} = this.props; this.props.searchTextUpdate(this.parseSearchText(searchText)); onSearch?.(); this.props.saveSearchScrollPosition?.(0); - } + }; handleChange = (event: ChangeEvent) => { clearTimeout(this.searchTimeout); @@ -145,7 +145,7 @@ export class SearchBar extends Component { this.triggerSearch(searchText); }, 500); } - } + }; focusInput = () => this.setState({inputFocused: true}); blurInput = () => this.setState({inputFocused: false}); @@ -166,7 +166,7 @@ export class SearchBar extends Component { }) : []; return Boolean(filteredTags.length); - } + }; clearSearchHandle = () => { const {action, onTrending, onCategories} = this.props; @@ -176,7 +176,7 @@ export class SearchBar extends Component { } else { onTrending?.(); } - } + }; shouldComponentUpdate(nextProps: Props, nextState: State) { return ((!nextProps.searchBarText && this.props.searchBarText) || diff --git a/webapp/channels/src/components/gif_picker/components/SearchGrid/SearchGrid.tsx b/webapp/channels/src/components/gif_picker/components/SearchGrid/SearchGrid.tsx index ad88295451..005a984022 100644 --- a/webapp/channels/src/components/gif_picker/components/SearchGrid/SearchGrid.tsx +++ b/webapp/channels/src/components/gif_picker/components/SearchGrid/SearchGrid.tsx @@ -99,7 +99,7 @@ export default class SearchGrid extends PureComponent { } else { this.numberOfColumns = NUMBER_OF_COLUMNS_LANDSCAPE; } - } + }; itemClickHandler = (gfyItem: GfycatAPIItem) => { const {keyword, handleItemClick} = this.props; @@ -107,19 +107,19 @@ export default class SearchGrid extends PureComponent { trackEvent('gfycat', 'shares', {gfyid: gfyItem.gfyId, keyword}); handleItemClick(gfyItem); - } + }; minHeightColumnIndex = () => { return this.columnsHeights.indexOf(Math.min(...this.columnsHeights)); - } + }; maxHeightColumnIndex = () => { return this.columnsHeights.indexOf(Math.max(...this.columnsHeights)); - } + }; maxColumnHeight = () => { return Math.max(...this.columnsHeights); - } + }; resizeHandler = () => { if (this.container && this.state.containerWidth !== this.container.offsetWidth - WEBKIT_SCROLLBAR_WIDTH) { @@ -130,11 +130,11 @@ export default class SearchGrid extends PureComponent { }); this.columnsHeights = Array(this.numberOfColumns).fill(0); } - } + }; scrollHandler = () => { this.scrollPosition = window.scrollY; - } + }; render() { const { diff --git a/webapp/channels/src/components/global_header/center_controls/user_guide_dropdown/user_guide_dropdown.tsx b/webapp/channels/src/components/global_header/center_controls/user_guide_dropdown/user_guide_dropdown.tsx index 698036c3da..1768074838 100644 --- a/webapp/channels/src/components/global_header/center_controls/user_guide_dropdown/user_guide_dropdown.tsx +++ b/webapp/channels/src/components/global_header/center_controls/user_guide_dropdown/user_guide_dropdown.tsx @@ -43,17 +43,17 @@ class UserGuideDropdown extends React.PureComponent { modalId: ModalIdentifiers.KEYBOARD_SHORTCUTS_MODAL, dialogType: KeyboardShortcutsModal, }); - } + }; buttonToggleState = (menuActive: boolean) => { this.setState({ buttonActive: menuActive, }); - } + }; askTheCommunityClick = () => { trackEvent('ui', 'help_ask_the_community'); - } + }; renderDropdownItems = (): React.ReactNode => { const { @@ -102,7 +102,7 @@ class UserGuideDropdown extends React.PureComponent { {pluginItems} ); - } + }; render() { const {intl} = this.props; diff --git a/webapp/channels/src/components/integrations/abstract_command.jsx b/webapp/channels/src/components/integrations/abstract_command.jsx index 63c8865ae1..3c9a1d84de 100644 --- a/webapp/channels/src/components/integrations/abstract_command.jsx +++ b/webapp/channels/src/components/integrations/abstract_command.jsx @@ -61,7 +61,7 @@ export default class AbstractCommand extends React.PureComponent { * The async function to run when the action button is pressed */ action: PropTypes.func.isRequired, - } + }; constructor(props) { super(props); @@ -84,7 +84,7 @@ export default class AbstractCommand extends React.PureComponent { saving: false, clientError: null, }; - } + }; handleSubmit = (e) => { e.preventDefault(); @@ -195,67 +195,67 @@ export default class AbstractCommand extends React.PureComponent { } this.props.action(command).then(() => this.setState({saving: false})); - } + }; updateDisplayName = (e) => { this.setState({ displayName: e.target.value, }); - } + }; updateDescription = (e) => { this.setState({ description: e.target.value, }); - } + }; updateTrigger = (e) => { this.setState({ trigger: e.target.value, }); - } + }; updateUrl = (e) => { this.setState({ url: e.target.value, }); - } + }; updateMethod = (e) => { this.setState({ method: e.target.value, }); - } + }; updateUsername = (e) => { this.setState({ username: e.target.value, }); - } + }; updateIconUrl = (e) => { this.setState({ iconUrl: e.target.value, }); - } + }; updateAutocomplete = (e) => { this.setState({ autocomplete: e.target.checked, }); - } + }; updateAutocompleteHint = (e) => { this.setState({ autocompleteHint: e.target.value, }); - } + }; updateAutocompleteDescription = (e) => { this.setState({ autocompleteDescription: e.target.value, }); - } + }; render() { let autocompleteHint = null; diff --git a/webapp/channels/src/components/integrations/abstract_incoming_webhook.tsx b/webapp/channels/src/components/integrations/abstract_incoming_webhook.tsx index af43262239..c3079b1f7f 100644 --- a/webapp/channels/src/components/integrations/abstract_incoming_webhook.tsx +++ b/webapp/channels/src/components/integrations/abstract_incoming_webhook.tsx @@ -92,7 +92,7 @@ export default class AbstractIncomingWebhook extends PureComponent serverError: '', clientError: null, }; - } + }; handleSubmit = (e: MouseEvent | FormEvent) => { e.preventDefault(); @@ -137,43 +137,43 @@ export default class AbstractIncomingWebhook extends PureComponent }; this.props.action(hook).then(() => this.setState({saving: false})); - } + }; updateDisplayName: ChangeEventHandler = (e) => { this.setState({ displayName: e.target.value, }); - } + }; updateDescription: ChangeEventHandler = (e) => { this.setState({ description: e.target.value, }); - } + }; updateChannelId: ChangeEventHandler = (e) => { this.setState({ channelId: e.target.value, }); - } + }; updateChannelLocked: ChangeEventHandler = (e) => { this.setState({ channelLocked: e.target.checked, }); - } + }; updateUsername: ChangeEventHandler = (e) => { this.setState({ username: e.target.value, }); - } + }; updateIconURL: ChangeEventHandler = (e) => { this.setState({ iconURL: e.target.value, }); - } + }; render() { const headerToRender = this.props.header; diff --git a/webapp/channels/src/components/integrations/abstract_oauth_app.jsx b/webapp/channels/src/components/integrations/abstract_oauth_app.jsx index ab5439fe55..10b6f201f1 100644 --- a/webapp/channels/src/components/integrations/abstract_oauth_app.jsx +++ b/webapp/channels/src/components/integrations/abstract_oauth_app.jsx @@ -57,7 +57,7 @@ export default class AbstractOAuthApp extends React.PureComponent { * The async function to run when the action button is pressed */ action: PropTypes.func.isRequired, - } + }; constructor(props) { super(props); @@ -80,14 +80,14 @@ export default class AbstractOAuthApp extends React.PureComponent { saving: false, clientError: null, }; - } + }; imageLoaded = () => { this.setState({ has_icon: true, icon_url: this.icon_url.current.value, }); - } + }; handleSubmit = (e) => { e.preventDefault(); @@ -176,31 +176,31 @@ export default class AbstractOAuthApp extends React.PureComponent { }; this.props.action(app).then(() => this.setState({saving: false})); - } + }; updateName = (e) => { this.setState({ name: e.target.value, }); - } + }; updateTrusted = (e) => { this.setState({ is_trusted: e.target.value === 'true', }); - } + }; updateDescription = (e) => { this.setState({ description: e.target.value, }); - } + }; updateHomepage = (e) => { this.setState({ homepage: e.target.value, }); - } + }; updateIconUrl = (e) => { this.setState({ @@ -208,13 +208,13 @@ export default class AbstractOAuthApp extends React.PureComponent { icon_url: e.target.value, }); this.image.src = e.target.value; - } + }; updateCallbackUrls = (e) => { this.setState({ callbackUrls: e.target.value, }); - } + }; render() { const headerToRender = this.props.header; diff --git a/webapp/channels/src/components/integrations/abstract_outgoing_webhook.jsx b/webapp/channels/src/components/integrations/abstract_outgoing_webhook.jsx index 308ec4b260..dff8215612 100644 --- a/webapp/channels/src/components/integrations/abstract_outgoing_webhook.jsx +++ b/webapp/channels/src/components/integrations/abstract_outgoing_webhook.jsx @@ -66,7 +66,7 @@ export default class AbstractOutgoingWebhook extends React.PureComponent { * Whether to allow configuration of the default post icon. */ enablePostIconOverride: PropTypes.bool.isRequired, - } + }; constructor(props) { super(props); @@ -104,7 +104,7 @@ export default class AbstractOutgoingWebhook extends React.PureComponent { username: hook.username || '', iconURL: hook.icon_url || '', }; - } + }; handleSubmit = (e) => { e.preventDefault(); @@ -180,61 +180,61 @@ export default class AbstractOutgoingWebhook extends React.PureComponent { }; this.props.action(hook).then(() => this.setState({saving: false})); - } + }; updateDisplayName = (e) => { this.setState({ displayName: e.target.value, }); - } + }; updateDescription = (e) => { this.setState({ description: e.target.value, }); - } + }; updateContentType = (e) => { this.setState({ contentType: e.target.value, }); - } + }; updateChannelId = (e) => { this.setState({ channelId: e.target.value, }); - } + }; updateTriggerWords = (e) => { this.setState({ triggerWords: e.target.value, }); - } + }; updateTriggerWhen = (e) => { this.setState({ triggerWhen: e.target.value, }); - } + }; updateCallbackUrls = (e) => { this.setState({ callbackUrls: e.target.value, }); - } + }; updateUsername = (e) => { this.setState({ username: e.target.value, }); - } + }; updateIconURL = (e) => { this.setState({ iconURL: e.target.value, }); - } + }; render() { const contentTypeOption1 = 'application/x-www-form-urlencoded'; diff --git a/webapp/channels/src/components/integrations/add_incoming_webhook/add_incoming_webhook.tsx b/webapp/channels/src/components/integrations/add_incoming_webhook/add_incoming_webhook.tsx index 06dedd3c3a..09251bb0e7 100644 --- a/webapp/channels/src/components/integrations/add_incoming_webhook/add_incoming_webhook.tsx +++ b/webapp/channels/src/components/integrations/add_incoming_webhook/add_incoming_webhook.tsx @@ -64,7 +64,7 @@ export default class AddIncomingWebhook extends React.PureComponent { this.setState({ username: e.target.value, }); - } + }; updateDisplayName = (e: ChangeEvent) => { this.setState({ displayName: e.target.value, }); - } + }; updateDescription = (e: ChangeEvent) => { this.setState({ description: e.target.value, }); - } + }; updateRole = (e: ChangeEvent) => { this.setState({ role: e.target.value, }); - } + }; updatePostAll = (e: ChangeEvent) => { this.setState({ postAll: e.target.checked, }); - } + }; updatePostChannels = (e: ChangeEvent) => { this.setState({ postChannels: e.target.checked, }); - } + }; updatePicture = (e: ChangeEvent) => { if (e.target.files && e.target.files[0]) { @@ -191,11 +191,11 @@ export default class AddBot extends React.PureComponent { } else { this.setState({pictureFile: null, image: ''}); } - } + }; setDefault = () => { this.setState({pictureFile: 'default', image: BotDefaultIcon}); - } + }; isFile(file: File | string): file is File { return (file as File).size !== undefined; @@ -218,7 +218,7 @@ export default class AddBot extends React.PureComponent { } return null; - } + }; handleSubmit = async (e: FormEvent) => { e.preventDefault(); @@ -378,7 +378,7 @@ export default class AddBot extends React.PureComponent { error: error.message, }); } - } + }; render() { let subtitle = ( diff --git a/webapp/channels/src/components/integrations/bots/bot.tsx b/webapp/channels/src/components/integrations/bots/bot.tsx index 636c2e6669..8cef34c8c8 100644 --- a/webapp/channels/src/components/integrations/bots/bot.tsx +++ b/webapp/channels/src/components/integrations/bots/bot.tsx @@ -119,32 +119,32 @@ export default class Bot extends React.PureComponent { enableBot = (): void => { this.props.actions.enableBot(this.props.bot.user_id); - } + }; disableBot = (): void => { this.props.actions.disableBot(this.props.bot.user_id); - } + }; enableUserAccessToken = (id: string): void => { this.props.actions.enableUserAccessToken(id); - } + }; disableUserAccessToken = (id: string): void => { this.props.actions.disableUserAccessToken(id); - } + }; confirmRevokeToken = (id: string): void => { this.setState({confirmingId: id}); - } + }; revokeTokenConfirmed = (): void => { this.props.actions.revokeUserAccessToken(this.state.confirmingId); this.closeConfirm(); - } + }; closeConfirm = (): void => { this.setState({confirmingId: ''}); - } + }; openCreateToken = (): void => { this.setState({ @@ -153,7 +153,7 @@ export default class Bot extends React.PureComponent { description: '', }, }); - } + }; closeCreateToken = (): void => { this.setState({ @@ -162,14 +162,14 @@ export default class Bot extends React.PureComponent { description: '', }, }); - } + }; handleUpdateDescription = (e: ChangeEvent): void => { const target = e.target as HTMLInputElement; this.setState({ token: Object.assign({}, this.state.token, {description: target.value}), }); - } + }; handleCreateToken = async (e: SyntheticEvent): Promise => { e.preventDefault(); @@ -190,7 +190,7 @@ export default class Bot extends React.PureComponent { } else if (error) { this.setState({error: error.message}); } - } + }; public render(): JSX.Element | null { const username = this.props.bot.username || ''; diff --git a/webapp/channels/src/components/integrations/bots/bots.tsx b/webapp/channels/src/components/integrations/bots/bots.tsx index 7f0fd2107a..64eb20db73 100644 --- a/webapp/channels/src/components/integrations/bots/bots.tsx +++ b/webapp/channels/src/components/integrations/bots/bots.tsx @@ -213,7 +213,7 @@ export default class Bots extends React.PureComponent { ); return [sections, enabledBots.length > 0 || disabledBots.length > 0]; - } + }; public render(): JSX.Element { return ( diff --git a/webapp/channels/src/components/integrations/edit_command/edit_command.tsx b/webapp/channels/src/components/integrations/edit_command/edit_command.tsx index d811a69b64..bf35dbb13e 100644 --- a/webapp/channels/src/components/integrations/edit_command/edit_command.tsx +++ b/webapp/channels/src/components/integrations/edit_command/edit_command.tsx @@ -100,15 +100,15 @@ export default class EditCommand extends React.PureComponent { } else { await this.submitCommand(); } - } + }; public handleConfirmModal = (): void => { this.setState({showConfirmModal: true}); - } + }; public confirmModalDismissed = (): void => { this.setState({showConfirmModal: false}); - } + }; public submitCommand = async (): Promise => { this.setState({serverError: ''}); @@ -125,7 +125,7 @@ export default class EditCommand extends React.PureComponent { if (error) { this.setState({serverError: error.message}); } - } + }; public renderExtra = (): JSX.Element => { const confirmButton = ( @@ -159,7 +159,7 @@ export default class EditCommand extends React.PureComponent { onCancel={this.confirmModalDismissed} /> ); - } + }; public render(): JSX.Element { if (!this.state.originalCommand) { diff --git a/webapp/channels/src/components/integrations/edit_oauth_app/edit_oauth_app.tsx b/webapp/channels/src/components/integrations/edit_oauth_app/edit_oauth_app.tsx index 403908d37b..98b0fa917d 100644 --- a/webapp/channels/src/components/integrations/edit_oauth_app/edit_oauth_app.tsx +++ b/webapp/channels/src/components/integrations/edit_oauth_app/edit_oauth_app.tsx @@ -69,15 +69,15 @@ export default class EditOAuthApp extends React.PureComponent { } else { await this.submitOAuthApp(); } - } + }; handleConfirmModal = () => { this.setState({showConfirmModal: true}); - } + }; confirmModalDismissed = () => { this.setState({showConfirmModal: false}); - } + }; submitOAuthApp = async () => { this.setState({serverError: ''}); @@ -95,7 +95,7 @@ export default class EditOAuthApp extends React.PureComponent { const {error: err} = res; this.setState({serverError: err.message}); } - } + }; renderExtra = () => { const confirmButton = ( @@ -129,7 +129,7 @@ export default class EditOAuthApp extends React.PureComponent { onCancel={this.confirmModalDismissed} /> ); - } + }; render() { if (!this.props.oauthApp) { diff --git a/webapp/channels/src/components/integrations/edit_outgoing_webhook/edit_outgoing_webhook.tsx b/webapp/channels/src/components/integrations/edit_outgoing_webhook/edit_outgoing_webhook.tsx index 5c38b3a67c..48ca4ef449 100644 --- a/webapp/channels/src/components/integrations/edit_outgoing_webhook/edit_outgoing_webhook.tsx +++ b/webapp/channels/src/components/integrations/edit_outgoing_webhook/edit_outgoing_webhook.tsx @@ -107,15 +107,15 @@ export default class EditOutgoingWebhook extends React.PureComponent { this.setState({showConfirmModal: true}); - } + }; confirmModalDismissed = (): void => { this.setState({showConfirmModal: false}); - } + }; submitHook = async (): Promise => { this.setState({serverError: ''}); @@ -132,7 +132,7 @@ export default class EditOutgoingWebhook extends React.PureComponent { const confirmButton = ( @@ -166,7 +166,7 @@ export default class EditOutgoingWebhook extends React.PureComponent ); - } + }; render(): JSX.Element { if (!this.props.hook) { diff --git a/webapp/channels/src/components/integrations/installed_command.tsx b/webapp/channels/src/components/integrations/installed_command.tsx index 0427bd601a..eebf5ec7af 100644 --- a/webapp/channels/src/components/integrations/installed_command.tsx +++ b/webapp/channels/src/components/integrations/installed_command.tsx @@ -66,11 +66,11 @@ export default class InstalledCommand extends React.PureComponent { e.preventDefault(); this.props.onRegenToken(this.props.command); - } + }; handleDelete = () => { this.props.onDelete(this.props.command); - } + }; render() { const command = this.props.command; diff --git a/webapp/channels/src/components/integrations/installed_commands/installed_commands.tsx b/webapp/channels/src/components/integrations/installed_commands/installed_commands.tsx index ef0a23995e..bc397cf615 100644 --- a/webapp/channels/src/components/integrations/installed_commands/installed_commands.tsx +++ b/webapp/channels/src/components/integrations/installed_commands/installed_commands.tsx @@ -40,11 +40,11 @@ type Props = { export default class InstalledCommands extends React.PureComponent { public regenCommandToken = (command: Command): void => { this.props.actions.regenCommandToken(command.id); - } + }; public deleteCommand = (command: Command): void => { this.props.actions.deleteCommand(command.id); - } + }; private commandCompare(a: Command, b: Command) { let nameA = a.display_name; diff --git a/webapp/channels/src/components/integrations/installed_incoming_webhook.tsx b/webapp/channels/src/components/integrations/installed_incoming_webhook.tsx index bfc31bf805..ed82be8ffd 100644 --- a/webapp/channels/src/components/integrations/installed_incoming_webhook.tsx +++ b/webapp/channels/src/components/integrations/installed_incoming_webhook.tsx @@ -77,7 +77,7 @@ type Props = { export default class InstalledIncomingWebhook extends React.PureComponent { handleDelete = () => { this.props.onDelete(this.props.incomingWebhook); - } + }; render() { const incomingWebhook = this.props.incomingWebhook; diff --git a/webapp/channels/src/components/integrations/installed_incoming_webhooks/installed_incoming_webhooks.tsx b/webapp/channels/src/components/integrations/installed_incoming_webhooks/installed_incoming_webhooks.tsx index 1107f74b6e..57fd5e0f5a 100644 --- a/webapp/channels/src/components/integrations/installed_incoming_webhooks/installed_incoming_webhooks.tsx +++ b/webapp/channels/src/components/integrations/installed_incoming_webhooks/installed_incoming_webhooks.tsx @@ -62,7 +62,7 @@ export default class InstalledIncomingWebhooks extends React.PureComponent { this.props.actions.removeIncomingHook(incomingWebhook.id); - } + }; incomingWebhookCompare = (a: IncomingWebhook, b: IncomingWebhook) => { let displayNameA = a.display_name; @@ -78,7 +78,7 @@ export default class InstalledIncomingWebhooks extends React.PureComponent this.props.incomingWebhooks. sort(this.incomingWebhookCompare). diff --git a/webapp/channels/src/components/integrations/installed_oauth_app/installed_oauth_app.tsx b/webapp/channels/src/components/integrations/installed_oauth_app/installed_oauth_app.tsx index 4bc6f499df..4407e6de67 100644 --- a/webapp/channels/src/components/integrations/installed_oauth_app/installed_oauth_app.tsx +++ b/webapp/channels/src/components/integrations/installed_oauth_app/installed_oauth_app.tsx @@ -79,12 +79,12 @@ export default class InstalledOAuthApp extends React.PureComponent { e.preventDefault(); this.setState({clientSecret: FAKE_SECRET}); - } + }; handleRegenerate = (e: React.MouseEvent): void => { e.preventDefault(); @@ -98,11 +98,11 @@ export default class InstalledOAuthApp extends React.PureComponent { this.props.onDelete(this.props.oauthApp); - } + }; render(): React.ReactNode { const {oauthApp, creatorName} = this.props; diff --git a/webapp/channels/src/components/integrations/installed_oauth_apps/installed_oauth_apps.tsx b/webapp/channels/src/components/integrations/installed_oauth_apps/installed_oauth_apps.tsx index 95a0c1c4a0..1a068e8366 100644 --- a/webapp/channels/src/components/integrations/installed_oauth_apps/installed_oauth_apps.tsx +++ b/webapp/channels/src/components/integrations/installed_oauth_apps/installed_oauth_apps.tsx @@ -86,7 +86,7 @@ export default class InstalledOAuthApps extends React.PureComponent e.preventDefault(); this.props.onRegenToken(this.props.outgoingWebhook); - } + }; handleDelete = () => { this.props.onDelete(this.props.outgoingWebhook); - } + }; makeDisplayName(outgoingWebhook: OutgoingWebhook, channel: Channel) { if (outgoingWebhook.display_name) { diff --git a/webapp/channels/src/components/integrations/installed_outgoing_webhooks/installed_outgoing_webhooks.tsx b/webapp/channels/src/components/integrations/installed_outgoing_webhooks/installed_outgoing_webhooks.tsx index eb943fcd4b..3764f0150a 100644 --- a/webapp/channels/src/components/integrations/installed_outgoing_webhooks/installed_outgoing_webhooks.tsx +++ b/webapp/channels/src/components/integrations/installed_outgoing_webhooks/installed_outgoing_webhooks.tsx @@ -106,11 +106,11 @@ export default class InstalledOutgoingWebhooks extends React.PureComponent { this.props.actions.regenOutgoingHookToken(outgoingWebhook.id); - } + }; removeOutgoingHook = (outgoingWebhook: OutgoingWebhook) => { this.props.actions.removeOutgoingHook(outgoingWebhook.id); - } + }; outgoingWebhookCompare = (a: OutgoingWebhook, b: OutgoingWebhook) => { let displayNameA = a.display_name; @@ -133,7 +133,7 @@ export default class InstalledOutgoingWebhooks extends React.PureComponent this.props.outgoingWebhooks. sort(this.outgoingWebhookCompare). diff --git a/webapp/channels/src/components/integrations/integrations.tsx b/webapp/channels/src/components/integrations/integrations.tsx index d3903ecb26..5445c22fa9 100644 --- a/webapp/channels/src/components/integrations/integrations.tsx +++ b/webapp/channels/src/components/integrations/integrations.tsx @@ -40,7 +40,7 @@ export default class Integrations extends React.PureComponent { updateTitle = () => { const currentSiteName = this.props.siteName || ''; document.title = Utils.localizeMessage('admin.sidebar.integrations', 'Integrations') + ' - ' + this.props.team.display_name + ' ' + currentSiteName; - } + }; render() { const options = []; diff --git a/webapp/channels/src/components/interactive_dialog/dialog_element/dialog_element.tsx b/webapp/channels/src/components/interactive_dialog/dialog_element/dialog_element.tsx index 2921238e15..8e67144eb0 100644 --- a/webapp/channels/src/components/interactive_dialog/dialog_element/dialog_element.tsx +++ b/webapp/channels/src/components/interactive_dialog/dialog_element/dialog_element.tsx @@ -102,7 +102,7 @@ export default class DialogElement extends React.PureComponent { this.props.onChange(name, selected.value); this.setState({value: selected.text}); } - } + }; public render(): JSX.Element | null { const { diff --git a/webapp/channels/src/components/intl_provider/intl_provider.tsx b/webapp/channels/src/components/intl_provider/intl_provider.tsx index dc6cefd13e..7d3f123de0 100644 --- a/webapp/channels/src/components/intl_provider/intl_provider.tsx +++ b/webapp/channels/src/components/intl_provider/intl_provider.tsx @@ -2,9 +2,7 @@ // See LICENSE.txt for license information. import React, {ReactNode} from 'react'; -import {IntlProvider as BaseIntlProvider} from 'react-intl'; - -import {MessageFormatElement} from '@formatjs/icu-messageformat-parser'; +import {IntlProvider as BaseIntlProvider, IntlConfig} from 'react-intl'; import {Client4} from 'mattermost-redux/client'; import {setLocalizeFunction} from 'mattermost-redux/utils/i18n_utils'; @@ -16,8 +14,8 @@ import {ActionFunc} from 'mattermost-redux/types/actions'; type Props = { children: ReactNode; - locale: string; - translations?: Record | Record; + locale: IntlConfig['locale']; + translations?: IntlConfig['messages']; actions: { loadTranslations: ((locale: string, url: string) => ActionFunc) | (() => void); }; @@ -41,7 +39,7 @@ export default class IntlProvider extends React.PureComponent { Client4.setAcceptLanguage(locale); this.loadTranslationsIfNecessary(locale); - } + }; loadTranslationsIfNecessary = (locale: string) => { if (this.props.translations) { @@ -55,7 +53,7 @@ export default class IntlProvider extends React.PureComponent { } this.props.actions.loadTranslations(locale, localeInfo.url); - } + }; render() { if (!this.props.translations) { diff --git a/webapp/channels/src/components/invitation_modal/invitation_modal.tsx b/webapp/channels/src/components/invitation_modal/invitation_modal.tsx index 4f4656643b..098080d2eb 100644 --- a/webapp/channels/src/components/invitation_modal/invitation_modal.tsx +++ b/webapp/channels/src/components/invitation_modal/invitation_modal.tsx @@ -118,7 +118,7 @@ export class InvitationModal extends React.PureComponent { handleHide = () => { this.setState({show: false}); - } + }; toggleCustomMessage = () => { this.setState((state) => ({ @@ -131,7 +131,7 @@ export class InvitationModal extends React.PureComponent { }, }, })); - } + }; setCustomMessage = (message: string) => { this.setState((state) => ({ @@ -144,7 +144,7 @@ export class InvitationModal extends React.PureComponent { }, }, })); - } + }; setInviteAs = (inviteType: InviteType) => { if (this.state.invite.inviteType !== inviteType) { @@ -156,7 +156,7 @@ export class InvitationModal extends React.PureComponent { }, })); } - } + }; invite = async () => { const roleForTrackFlow = getRoleForTrackFlow(); @@ -230,7 +230,7 @@ export class InvitationModal extends React.PureComponent { notSent: invites.notSent, }, })); - } + }; inviteMore = () => { this.setState((state: State) => ({ @@ -244,7 +244,7 @@ export class InvitationModal extends React.PureComponent { result: defaultResultState, termWithoutResults: null, })); - } + }; debouncedSearchChannels = debounce((term) => this.props.actions.searchChannels(this.props.currentTeam.id, term), 150); @@ -257,7 +257,7 @@ export class InvitationModal extends React.PureComponent { return this.props.invitableChannels.filter((channel) => { return channel.display_name.toLowerCase().startsWith(value.toLowerCase()) || channel.name.toLowerCase().startsWith(value.toLowerCase()); }); - } + }; onChannelsChange = (channels: Channel[]) => { this.setState((state) => ({ @@ -270,7 +270,7 @@ export class InvitationModal extends React.PureComponent { }, }, })); - } + }; onChannelsInputChange = (search: string) => { this.setState((state) => ({ @@ -283,7 +283,7 @@ export class InvitationModal extends React.PureComponent { }, }, })); - } + }; debouncedSearchProfiles = debounce((term: string, callback: (users: UserProfile[]) => void) => { this.props.actions.searchProfiles(term). @@ -323,7 +323,7 @@ export class InvitationModal extends React.PureComponent { usersEmails, }, })); - } + }; onUsersInputChange = (usersEmailsSearch: string) => { this.setState((state: State) => ({ @@ -333,7 +333,7 @@ export class InvitationModal extends React.PureComponent { usersEmailsSearch, }, })); - } + }; getBackdrop = (): Backdrop => { // 'static' means backdrop clicks do not close @@ -354,7 +354,7 @@ export class InvitationModal extends React.PureComponent { } } return true; - } + }; render() { let view = ( diff --git a/webapp/channels/src/components/leave_team_modal/leave_team_modal.tsx b/webapp/channels/src/components/leave_team_modal/leave_team_modal.tsx index 45cd745e32..27db2843a3 100644 --- a/webapp/channels/src/components/leave_team_modal/leave_team_modal.tsx +++ b/webapp/channels/src/components/leave_team_modal/leave_team_modal.tsx @@ -53,7 +53,7 @@ export default class LeaveTeamModal extends React.PureComponent { this.setState({ show: false, }); - } + }; handleKeyPress = (e: KeyboardEvent) => { if (isKeyPressed(e, Constants.KeyCodes.ENTER)) { diff --git a/webapp/channels/src/components/linking_landing_page/linking_landing_page.tsx b/webapp/channels/src/components/linking_landing_page/linking_landing_page.tsx index 46f398b7b2..f59c319a30 100644 --- a/webapp/channels/src/components/linking_landing_page/linking_landing_page.tsx +++ b/webapp/channels/src/components/linking_landing_page/linking_landing_page.tsx @@ -72,17 +72,17 @@ export default class LinkingLandingPage extends PureComponent { if (!this.state.navigating && !this.state.rememberChecked) { BrowserStore.clearLandingPreference(this.props.siteUrl); } - } + }; checkLandingPreferenceBrowser = () => { const landingPreference = BrowserStore.getLandingPreference(this.props.siteUrl); return landingPreference && landingPreference === LandingPreferenceTypes.BROWSER; - } + }; checkLandingPreferenceApp = () => { const landingPreference = BrowserStore.getLandingPreference(this.props.siteUrl); return landingPreference && landingPreference === LandingPreferenceTypes.MATTERMOSTAPP; - } + }; handleChecked = () => { // If it was checked, and now we're unchecking it, clear the preference @@ -90,7 +90,7 @@ export default class LinkingLandingPage extends PureComponent { BrowserStore.clearLandingPreference(this.props.siteUrl); } this.setState({rememberChecked: !this.state.rememberChecked}); - } + }; setPreference = (pref: string, clearIfNotChecked?: boolean) => { if (!this.state.rememberChecked) { @@ -110,18 +110,18 @@ export default class LinkingLandingPage extends PureComponent { default: break; } - } + }; openMattermostApp = () => { this.setPreference(LandingPreferenceTypes.MATTERMOSTAPP); this.setState({redirectPage: true}); window.location.href = this.state.nativeLocation; - } + }; openInBrowser = () => { this.setPreference(LandingPreferenceTypes.BROWSER); window.location.href = this.state.location; - } + }; renderSystemDialogMessage = () => { const isMobile = UserAgent.isMobile(); @@ -141,7 +141,7 @@ export default class LinkingLandingPage extends PureComponent { defaultMessage='View in Desktop App' /> ); - } + }; renderGoNativeAppMessage = () => { return ( @@ -170,7 +170,7 @@ export default class LinkingLandingPage extends PureComponent { {this.renderSystemDialogMessage()} ); - } + }; getDownloadLink = () => { if (UserAgent.isIosWeb()) { @@ -180,11 +180,11 @@ export default class LinkingLandingPage extends PureComponent { } return this.props.desktopAppLink; - } + }; handleBrandImageError = () => { this.setState({brandImageError: true}); - } + }; renderCheckboxIcon = () => { if (this.state.rememberChecked) { @@ -194,7 +194,7 @@ export default class LinkingLandingPage extends PureComponent { } return null; - } + }; renderGraphic = () => { const isMobile = UserAgent.isMobile(); @@ -208,7 +208,7 @@ export default class LinkingLandingPage extends PureComponent { return ( ); - } + }; renderDownloadLinkText = () => { const isMobile = UserAgent.isMobile(); @@ -228,7 +228,7 @@ export default class LinkingLandingPage extends PureComponent { defaultMessage={'Don\'t have the Desktop App?'} /> ); - } + }; renderDownloadLinkSection = () => { const downloadLink = this.getDownloadLink(); @@ -262,7 +262,7 @@ export default class LinkingLandingPage extends PureComponent { } return null; - } + }; renderDialogHeader = () => { const downloadLink = this.getDownloadLink(); @@ -343,7 +343,7 @@ export default class LinkingLandingPage extends PureComponent { ); - } + }; renderDialogBody = () => { if (this.state.redirectPage) { @@ -396,7 +396,7 @@ export default class LinkingLandingPage extends PureComponent { {this.renderDownloadLinkSection()} ); - } + }; renderHeader = () => { let header = ( @@ -430,7 +430,7 @@ export default class LinkingLandingPage extends PureComponent { } return header; - } + }; render() { const isMobile = UserAgent.isMobile(); diff --git a/webapp/channels/src/components/list_modal.tsx b/webapp/channels/src/components/list_modal.tsx index 6eead39958..9fc45b198e 100644 --- a/webapp/channels/src/components/list_modal.tsx +++ b/webapp/channels/src/components/list_modal.tsx @@ -116,13 +116,13 @@ export default class ListModal extends React.PureComponent { handleHide = () => { this.setState({show: false}); - } + }; handleExit = () => { if (this.props.onHide) { this.props.onHide(); } - } + }; renderRows() { if (this.state.loading) { @@ -143,18 +143,18 @@ export default class ListModal extends React.PureComponent { onNext = () => { const nextPage = this.state.page + 1; this.onPageChange(nextPage); - } + }; onPrev = () => { const prevPage = this.state.page - 1; this.onPageChange(prevPage); - } + }; onPageChange = async (page: number) => { this.setState({loading: true}); const result = await this.props.loadItems(page, this.state.searchTerm); this.setState({page, items: result.items, loading: false}); - } + }; onSearchInput = async (event: React.ChangeEvent) => { const {target} = event; @@ -163,7 +163,7 @@ export default class ListModal extends React.PureComponent { const result = await this.props.loadItems(0, searchTerm); const {items, totalCount} = result; this.setState({loading: false, items, totalCount}); - } + }; paginationRange() { let startCount = (this.state.page * this.numPerPage) + 1; diff --git a/webapp/channels/src/components/logged_in/logged_in.tsx b/webapp/channels/src/components/logged_in/logged_in.tsx index 7b6707466f..0a33a051d8 100644 --- a/webapp/channels/src/components/logged_in/logged_in.tsx +++ b/webapp/channels/src/components/logged_in/logged_in.tsx @@ -199,7 +199,7 @@ export default class LoggedIn extends React.PureComponent { break; } } - } + }; private handleBackSpace = (e: KeyboardEvent): void => { const excludedElements = ['input', 'textarea']; @@ -207,7 +207,7 @@ export default class LoggedIn extends React.PureComponent { if (e.which === BACKSPACE_CHAR && !(excludedElements.includes((e.target as HTMLElement).tagName.toLowerCase()))) { e.preventDefault(); } - } + }; private handleBeforeUnload = (): void => { // remove the event listener to prevent getting stuck in a loop @@ -216,5 +216,5 @@ export default class LoggedIn extends React.PureComponent { this.props.actions.viewChannel('', this.props.currentChannelId || ''); } WebSocketActions.close(); - } + }; } diff --git a/webapp/channels/src/components/main_menu/main_menu.tsx b/webapp/channels/src/components/main_menu/main_menu.tsx index 6dc65c10ec..6b42d9c87d 100644 --- a/webapp/channels/src/components/main_menu/main_menu.tsx +++ b/webapp/channels/src/components/main_menu/main_menu.tsx @@ -98,17 +98,17 @@ export class MainMenu extends React.PureComponent { e.preventDefault(); this.props.actions.openModal({modalId: ModalIdentifiers.USER_SETTINGS, dialogType: UserSettingsModal, dialogProps: {isContentProductSettings: true}}); } - } + }; handleEmitUserLoggedOutEvent = (): void => { GlobalActions.emitUserLoggedOutEvent(); - } + }; getFlagged = (e: Event): void => { e.preventDefault(); this.props.actions.showFlaggedPosts(); this.props.actions.closeRhsMenu(); - } + }; searchMentions = (e: Event): void => { e.preventDefault(); @@ -119,7 +119,7 @@ export class MainMenu extends React.PureComponent { this.props.actions.closeRhsMenu(); this.props.actions.showMentions(); } - } + }; render() { const { diff --git a/webapp/channels/src/components/markdown/markdown.tsx b/webapp/channels/src/components/markdown/markdown.tsx index d930376999..57f8115a3a 100644 --- a/webapp/channels/src/components/markdown/markdown.tsx +++ b/webapp/channels/src/components/markdown/markdown.tsx @@ -131,7 +131,7 @@ export default class Markdown extends React.PureComponent { imagesMetadata: {}, postId: '', // Needed to avoid proptypes console errors for cases like channel header, which doesn't have a proper value editedAt: 0, - } + }; render() { const {postId, editedAt, message, enableFormatting} = this.props; diff --git a/webapp/channels/src/components/markdown_image/markdown_image.jsx b/webapp/channels/src/components/markdown_image/markdown_image.jsx index 04b1d55e2d..2e5f570031 100644 --- a/webapp/channels/src/components/markdown_image/markdown_image.jsx +++ b/webapp/channels/src/components/markdown_image/markdown_image.jsx @@ -40,7 +40,7 @@ export default class MarkdownImage extends React.PureComponent { openModal: PropTypes.func, }).isRequired, hideUtilities: PropTypes.bool, - } + }; constructor(props) { super(props); @@ -69,7 +69,7 @@ export default class MarkdownImage extends React.PureComponent { } return parseInt(height, 10); - } + }; getFileExtensionFromUrl = (url) => { const index = url.lastIndexOf('.'); @@ -96,16 +96,16 @@ export default class MarkdownImage extends React.PureComponent { }, }); } - } + }; handleLoadFail = () => { this.setState({loadFailed: true}); - } + }; isHeaderChangeMessage = () => { return this.props.postType && this.props.postType === Constants.PostTypes.HEADER_CHANGE; - } + }; componentDidUpdate(prevProps) { this.onUpdated(prevProps.src); @@ -115,7 +115,7 @@ export default class MarkdownImage extends React.PureComponent { if (this.props.src && this.props.src !== prevSrc) { this.setState({loadFailed: false}); } - } + }; handleImageLoaded = ({height, width}) => { this.setState({ @@ -125,7 +125,7 @@ export default class MarkdownImage extends React.PureComponent { this.props.onImageLoaded({height, width}); } }); - } + }; render() { const {imageMetadata, src, alt, imageIsLink} = this.props; diff --git a/webapp/channels/src/components/member_list_channel/member_list_channel.tsx b/webapp/channels/src/components/member_list_channel/member_list_channel.tsx index ae673b82f9..cbe94dba4f 100644 --- a/webapp/channels/src/components/member_list_channel/member_list_channel.tsx +++ b/webapp/channels/src/components/member_list_channel/member_list_channel.tsx @@ -125,15 +125,15 @@ export default class MemberListChannel extends React.PureComponent loadComplete = () => { this.setState({loading: false}); - } + }; nextPage = (page: number) => { this.props.actions.loadProfilesAndTeamMembersAndChannelMembers(page + 1, USERS_PER_PAGE, undefined, undefined, {active: true}); - } + }; handleSearch = (term: string) => { this.props.actions.setModalSearchTerm(term); - } + }; render() { if (this.state.loading) { diff --git a/webapp/channels/src/components/member_list_team/member_list_team.tsx b/webapp/channels/src/components/member_list_team/member_list_team.tsx index e5b13d4a95..7121d3458e 100644 --- a/webapp/channels/src/components/member_list_team/member_list_team.tsx +++ b/webapp/channels/src/components/member_list_team/member_list_team.tsx @@ -119,7 +119,7 @@ export default class MemberListTeam extends React.PureComponent { loadComplete = () => { this.setState({loading: false}); - } + }; nextPage = async (page: number) => { this.setState({loading: true}); @@ -133,11 +133,11 @@ export default class MemberListTeam extends React.PureComponent { ), ]); this.loadComplete(); - } + }; search = (term: string) => { this.props.actions.setModalSearchTerm(term); - } + }; render() { let teamMembersDropdown; diff --git a/webapp/channels/src/components/message_submit_error.tsx b/webapp/channels/src/components/message_submit_error.tsx index 7f82659da6..1de774514c 100644 --- a/webapp/channels/src/components/message_submit_error.tsx +++ b/webapp/channels/src/components/message_submit_error.tsx @@ -41,7 +41,7 @@ class MessageSubmitError extends React.PureComponent { ); - } + }; public render(): JSX.Element | null { const error = this.props.error; diff --git a/webapp/channels/src/components/mfa/confirm.tsx b/webapp/channels/src/components/mfa/confirm.tsx index 4b0fa170c6..54932f3cc0 100644 --- a/webapp/channels/src/components/mfa/confirm.tsx +++ b/webapp/channels/src/components/mfa/confirm.tsx @@ -42,13 +42,13 @@ export default class Confirm extends React.PureComponent { submit = (e: KeyboardEvent | React.FormEvent): void => { e.preventDefault(); redirectUserToDefaultTeam(); - } + }; onKeyPress = (e: KeyboardEvent | React.FormEvent): void => { if (isKeyPressed(e as KeyboardEvent, KeyCodes.ENTER)) { this.submit(e); } - } + }; public render(): JSX.Element { return ( diff --git a/webapp/channels/src/components/mfa/mfa_controller/mfa_controller.tsx b/webapp/channels/src/components/mfa/mfa_controller/mfa_controller.tsx index 4c82ded459..379fd72739 100644 --- a/webapp/channels/src/components/mfa/mfa_controller/mfa_controller.tsx +++ b/webapp/channels/src/components/mfa/mfa_controller/mfa_controller.tsx @@ -60,7 +60,7 @@ export default class MFAController extends React.PureComponent): void => { e.preventDefault(); emitUserLoggedOutEvent('/login'); - } + }; public updateParent = (state: State): void => { this.setState(state); diff --git a/webapp/channels/src/components/mfa/setup/setup.tsx b/webapp/channels/src/components/mfa/setup/setup.tsx index ccc446f0d6..1462dc35ef 100644 --- a/webapp/channels/src/components/mfa/setup/setup.tsx +++ b/webapp/channels/src/components/mfa/setup/setup.tsx @@ -121,7 +121,7 @@ export default class Setup extends React.PureComponent { this.props.history.push('/mfa/confirm'); }); - } + }; public render(): JSX.Element { let formClass = 'form-group'; diff --git a/webapp/channels/src/components/modal_controller/modal_controller.test.tsx b/webapp/channels/src/components/modal_controller/modal_controller.test.tsx index eb20b1675d..3f2944af44 100644 --- a/webapp/channels/src/components/modal_controller/modal_controller.test.tsx +++ b/webapp/channels/src/components/modal_controller/modal_controller.test.tsx @@ -31,7 +31,7 @@ class TestModal extends React.PureComponent { hideModal = () => { this.setState({show: false}); - } + }; render() { return ( diff --git a/webapp/channels/src/components/more_channels/more_channels.tsx b/webapp/channels/src/components/more_channels/more_channels.tsx index b51606db19..de6db52c6a 100644 --- a/webapp/channels/src/components/more_channels/more_channels.tsx +++ b/webapp/channels/src/components/more_channels/more_channels.tsx @@ -86,7 +86,7 @@ export default class MoreChannels extends React.PureComponent { handleHide = () => { this.setState({show: false}); - } + }; handleNewChannel = () => { this.handleExit(); @@ -95,11 +95,11 @@ export default class MoreChannels extends React.PureComponent { modalId: ModalIdentifiers.NEW_CHANNEL_MODAL, dialogType: NewChannelModal, }); - } + }; handleExit = () => { this.props.actions.closeModal(ModalIdentifiers.MORE_CHANNELS); - } + }; closeEditRHS = () => { if (this.props.rhsOpen && this.props.rhsState === RHSStates.EDIT_HISTORY) { @@ -116,11 +116,11 @@ export default class MoreChannels extends React.PureComponent { searchedChannels: [], serverError: null, }); - } + }; nextPage = (page: number) => { this.props.actions.getChannels(this.props.teamId, page + 1, CHANNELS_PER_PAGE); - } + }; handleJoin = async (channel: Channel, done: () => void) => { const {actions, currentUserId, teamId, teamName} = this.props; @@ -137,7 +137,7 @@ export default class MoreChannels extends React.PureComponent { if (done) { done(); } - } + }; search = (term: string) => { clearTimeout(this.searchTimeoutId); @@ -171,17 +171,17 @@ export default class MoreChannels extends React.PureComponent { ); this.searchTimeoutId = searchTimeoutId; - } + }; setSearchResults = (channels: Channel[]) => { this.setState({searchedChannels: this.state.shouldShowArchivedChannels ? channels.filter((c) => c.delete_at !== 0) : channels.filter((c) => c.delete_at === 0), searching: false}); - } + }; toggleArchivedChannels = (shouldShowArchivedChannels: boolean) => { // search again when switching channels to update search results this.search(this.state.searchTerm); this.setState({shouldShowArchivedChannels}); - } + }; render() { const { diff --git a/webapp/channels/src/components/more_direct_channels/more_direct_channels.tsx b/webapp/channels/src/components/more_direct_channels/more_direct_channels.tsx index f9ae5b59a5..2b40db3919 100644 --- a/webapp/channels/src/components/more_direct_channels/more_direct_channels.tsx +++ b/webapp/channels/src/components/more_direct_channels/more_direct_channels.tsx @@ -109,7 +109,7 @@ export default class MoreDirectChannels extends React.PureComponent { this.props.actions.setModalSearchTerm(''); this.setState({show: false}); - } + }; setUsersLoadingState = (loadingState: boolean) => { this.setState({ loadingUsers: loadingState, }); - } + }; handleExit = () => { if (this.exitToChannel) { @@ -171,7 +171,7 @@ export default class MoreDirectChannels extends React.PureComponent { const {actions} = this.props; @@ -241,18 +241,18 @@ export default class MoreDirectChannels extends React.PureComponent { if (page > prevPage) { this.setUsersLoadingState(true); this.getUserProfiles(page); } - } + }; resetPaging = () => { this.multiselect.current?.resetPaging(); - } + }; search = debounce((term: string) => { this.props.actions.setModalSearchTerm(term); @@ -260,7 +260,7 @@ export default class MoreDirectChannels extends React.PureComponent { this.setState({values}); - } + }; render() { const body = ( diff --git a/webapp/channels/src/components/multiselect/multiselect.tsx b/webapp/channels/src/components/multiselect/multiselect.tsx index 1270fe2063..42c8cf3455 100644 --- a/webapp/channels/src/components/multiselect/multiselect.tsx +++ b/webapp/channels/src/components/multiselect/multiselect.tsx @@ -78,9 +78,9 @@ export type State = { const KeyCodes = Constants.KeyCodes; export default class MultiSelect extends React.PureComponent, State> { - private listRef = React.createRef>() - private reactSelectRef = React.createRef() - private selected: T | null = null + private listRef = React.createRef>(); + private reactSelectRef = React.createRef(); + private selected: T | null = null; public static defaultProps = { ariaLabelRenderer: defaultAriaLabelRenderer, @@ -88,7 +88,7 @@ export default class MultiSelect extends React.PureComponent) { super(props); @@ -130,11 +130,11 @@ export default class MultiSelect extends React.PureComponent { this.setState({a11yActive: true}); - } + }; private handleA11yDeactivateEvent = () => { this.setState({a11yActive: false}); - } + }; private nextPage = () => { if (this.props.handlePageChange) { @@ -144,7 +144,7 @@ export default class MultiSelect extends React.PureComponent { if (this.state.page === 0) { @@ -159,15 +159,15 @@ export default class MultiSelect extends React.PureComponent { this.setState({page: 0}); - } + }; private onSelect = (selected: T | null) => { this.selected = selected; - } + }; private onAdd = (value: T) => { if (this.props.maxValues && this.props.values.length >= this.props.maxValues) { @@ -194,7 +194,7 @@ export default class MultiSelect extends React.PureComponent { if (!change) { @@ -221,7 +221,7 @@ export default class MultiSelect extends React.PureComponent { switch (e.key) { @@ -229,7 +229,7 @@ export default class MultiSelect extends React.PureComponent { switch (e.key) { @@ -241,12 +241,12 @@ export default class MultiSelect extends React.PureComponent) => { e.preventDefault(); this.props.handleSubmit(); - } + }; private onChange: ReactSelect['onChange'] = (_, change) => { if (change.action !== 'remove-value' && change.action !== 'pop-value') { @@ -263,7 +263,7 @@ export default class MultiSelect extends React.PureComponent (
@@ -286,11 +286,11 @@ export default class MultiSelect extends React.PureComponent ); - } + }; valueRenderer = (props: any) => { return this.props.valueWithImage ? : this.props.valueRenderer; - } + }; public render() { const options = Object.assign([...this.props.options]); diff --git a/webapp/channels/src/components/multiselect/multiselect_list.tsx b/webapp/channels/src/components/multiselect/multiselect_list.tsx index 3f77f580dd..4ca33a2b49 100644 --- a/webapp/channels/src/components/multiselect/multiselect_list.tsx +++ b/webapp/channels/src/components/multiselect/multiselect_list.tsx @@ -46,9 +46,9 @@ export default class MultiSelectList extends React.PureComponen onAction: () => null, }; - private toSelect = -1 - private listRef = React.createRef() - private selectedItemRef = React.createRef() + private toSelect = -1; + private listRef = React.createRef(); + private selectedItemRef = React.createRef(); public constructor(props: Props) { super(props); @@ -94,7 +94,7 @@ export default class MultiSelectList extends React.PureComponen // externally by the MultiSelect component. public setSelected = (selected: number) => { this.setState({selected}); - } + }; private handleArrowPress = (e: KeyboardEvent) => { if (cmdOrCtrlPressed(e) && e.shiftKey) { @@ -129,7 +129,7 @@ export default class MultiSelectList extends React.PureComponen e.preventDefault(); this.setState({selected}); this.props.onSelect(options[selected]); - } + }; private defaultOptionRenderer = ( option: T, @@ -153,7 +153,7 @@ export default class MultiSelectList extends React.PureComponen {option.label}
); - } + }; private select = (option: T) => { const i = this.props.options.indexOf(option); @@ -162,7 +162,7 @@ export default class MultiSelectList extends React.PureComponen this.setSelected(i); } } - } + }; public render() { const {options, customNoOptionsMessage} = this.props; diff --git a/webapp/channels/src/components/payment_form/card_input.tsx b/webapp/channels/src/components/payment_form/card_input.tsx index aebcc9f327..5ec5376167 100644 --- a/webapp/channels/src/components/payment_form/card_input.tsx +++ b/webapp/channels/src/components/payment_form/card_input.tsx @@ -66,7 +66,7 @@ class CardInput extends React.PureComponent { if (onFocus) { onFocus(); } - } + }; private onBlur = () => { const {onBlur} = this.props; @@ -77,14 +77,14 @@ class CardInput extends React.PureComponent { if (onBlur) { onBlur(); } - } + }; private onChange = (event: StripeCardElementChangeEvent) => { this.setState({error: '', empty: event.empty, complete: event.complete}); if (this.props.onCardInputChange) { this.props.onCardInputChange(event); } - } + }; private validateInput = () => { const {required} = this.props; @@ -99,7 +99,7 @@ class CardInput extends React.PureComponent { } this.setState({error}); - } + }; private renderError(error: string) { if (!error) { diff --git a/webapp/channels/src/components/payment_form/payment_form.tsx b/webapp/channels/src/components/payment_form/payment_form.tsx index b70e962e5e..d64ff99953 100644 --- a/webapp/channels/src/components/payment_form/payment_form.tsx +++ b/webapp/channels/src/components/payment_form/payment_form.tsx @@ -77,7 +77,7 @@ export default class PaymentForm extends React.PureComponent { private resetState = () => { this.setState(this.getResetState()); - } + }; private getResetState = (props = this.props) => { const {initialBillingDetails, paymentMethod} = props; @@ -94,7 +94,7 @@ export default class PaymentForm extends React.PureComponent { name: billingDetails.name, changePaymentMethod: paymentMethod == null, }; - } + }; private handleInputChange = (event: React.ChangeEvent | React.ChangeEvent) => { const target = event.target; @@ -111,13 +111,13 @@ export default class PaymentForm extends React.PureComponent { if (onInputChange) { onInputChange({...this.state, ...newStateValue, card: this.cardRef.current?.getCard()} as BillingDetails); } - } + }; private handleCardInputChange = (event: StripeCardElementChangeEvent) => { if (this.props.onCardInputChange) { this.props.onCardInputChange(event); } - } + }; private handleStateChange = (stateValue: string) => { const newStateValue = { @@ -128,7 +128,7 @@ export default class PaymentForm extends React.PureComponent { if (this.props.onInputChange) { this.props.onInputChange({...this.state, ...newStateValue, card: this.cardRef.current?.getCard()} as BillingDetails); } - } + }; private handleCountryChange = (option: any) => { const newStateValue = { @@ -139,19 +139,19 @@ export default class PaymentForm extends React.PureComponent { if (this.props.onInputChange) { this.props.onInputChange({...this.state, ...newStateValue, card: this.cardRef.current?.getCard()} as BillingDetails); } - } + }; private onBlur = () => { const {onInputBlur} = this.props; if (onInputBlur) { onInputBlur({...this.state, card: this.cardRef.current?.getCard()} as BillingDetails); } - } + }; private changePaymentMethod = (event: React.MouseEvent) => { event.preventDefault(); this.setState({changePaymentMethod: true}); - } + }; public render() { const {className, paymentMethod, buttonFooter, theme} = this.props; diff --git a/webapp/channels/src/components/pdf_preview.jsx b/webapp/channels/src/components/pdf_preview.jsx index 215ea99c6d..659bd870f0 100644 --- a/webapp/channels/src/components/pdf_preview.jsx +++ b/webapp/channels/src/components/pdf_preview.jsx @@ -28,7 +28,7 @@ export default class PDFPreview extends React.PureComponent { fileUrl: PropTypes.string.isRequired, scale: PropTypes.number.isRequired, handleBgClose: PropTypes.func.isRequired, - } + }; constructor(props) { super(props); @@ -100,7 +100,7 @@ export default class PDFPreview extends React.PureComponent { const fileDownloadUrl = this.props.fileInfo.link || getFileDownloadUrl(this.props.fileInfo.id); e.preventDefault(); window.location.href = fileDownloadUrl; - } + }; isInViewport = (page) => { const bounding = page.getBoundingClientRect(); @@ -143,7 +143,7 @@ export default class PDFPreview extends React.PureComponent { await page.render(renderContext).promise; this.pdfPagesRendered[pageIndex] = true; - } + }; getPdfDocument = async () => { try { @@ -160,7 +160,7 @@ export default class PDFPreview extends React.PureComponent { } catch (err) { this.onDocumentLoadError(err); } - } + }; onDocumentLoad = (pdf) => { this.setState({pdf, numPages: pdf.numPages}); @@ -168,12 +168,12 @@ export default class PDFPreview extends React.PureComponent { this[`pdfCanvasRef-${i}`] = React.createRef(); } this.setState({loading: false, success: true}); - } + }; onDocumentLoadError = (reason) => { console.log('Unable to load PDF preview: ' + reason); //eslint-disable-line no-console this.setState({loading: false, success: false}); - } + }; loadPage = async (pdf, pageIndex) => { if (this.state.pdfPagesLoaded[pageIndex]) { @@ -190,7 +190,7 @@ export default class PDFPreview extends React.PureComponent { this.setState({pdfPages, pdfPagesLoaded}); return page; - } + }; handleScroll = debounce(() => { if (this.state.success) { diff --git a/webapp/channels/src/components/permissions_gates/any_team_permission_gate/any_team_permission_gate.tsx b/webapp/channels/src/components/permissions_gates/any_team_permission_gate/any_team_permission_gate.tsx index aba0ab3d5c..309890e06b 100644 --- a/webapp/channels/src/components/permissions_gates/any_team_permission_gate/any_team_permission_gate.tsx +++ b/webapp/channels/src/components/permissions_gates/any_team_permission_gate/any_team_permission_gate.tsx @@ -29,7 +29,7 @@ export type Props = { export default class AnyTeamPermissionGate extends React.PureComponent { static defaultProps = { invert: false, - } + }; render() { if (this.props.hasPermission !== this.props.invert) { diff --git a/webapp/channels/src/components/permissions_gates/system_permission_gate/system_permission_gate.tsx b/webapp/channels/src/components/permissions_gates/system_permission_gate/system_permission_gate.tsx index 532e777c4c..2463be40ee 100644 --- a/webapp/channels/src/components/permissions_gates/system_permission_gate/system_permission_gate.tsx +++ b/webapp/channels/src/components/permissions_gates/system_permission_gate/system_permission_gate.tsx @@ -28,7 +28,7 @@ type Props = { export default class SystemPermissionGate extends React.PureComponent { public static defaultProps = { invert: false, - } + }; render() { if (this.props.hasPermission && !this.props.invert) { diff --git a/webapp/channels/src/components/permissions_gates/team_permission_gate/team_permission_gate.tsx b/webapp/channels/src/components/permissions_gates/team_permission_gate/team_permission_gate.tsx index ecac89d500..6864666005 100644 --- a/webapp/channels/src/components/permissions_gates/team_permission_gate/team_permission_gate.tsx +++ b/webapp/channels/src/components/permissions_gates/team_permission_gate/team_permission_gate.tsx @@ -34,7 +34,7 @@ type Props = { export default class TeamPermissionGate extends React.PureComponent { public static defaultProps = { invert: false, - } + }; render() { if (this.props.hasPermission && !this.props.invert) { diff --git a/webapp/channels/src/components/plugin_marketplace/marketplace_item/marketplace_item_app/marketplace_item_app.tsx b/webapp/channels/src/components/plugin_marketplace/marketplace_item/marketplace_item_app/marketplace_item_app.tsx index 533e36796f..f1a029e8f9 100644 --- a/webapp/channels/src/components/plugin_marketplace/marketplace_item/marketplace_item_app/marketplace_item_app.tsx +++ b/webapp/channels/src/components/plugin_marketplace/marketplace_item/marketplace_item_app/marketplace_item_app.tsx @@ -44,7 +44,7 @@ export default class MarketplaceItemApp extends React.PureComponent { this.setState({showUpdateConfirmationModal: true}); - } + }; hideUpdateConfirmationModal = (): void => { this.setState({showUpdateConfirmationModal: false}); - } + }; onInstall = (): void => { this.trackEvent('ui_marketplace_download'); this.props.actions.installPlugin(this.props.id); - } + }; onConfigure = (): void => { this.trackEvent('ui_marketplace_configure', false); this.props.actions.closeMarketplaceModal(); - } + }; onUpdate = (): void => { this.trackEvent('ui_marketplace_download_update'); this.hideUpdateConfirmationModal(); this.props.actions.installPlugin(this.props.id); - } + }; getItemButton(): JSX.Element { if (this.props.installedVersion !== '' && !this.props.installing && !this.props.error) { diff --git a/webapp/channels/src/components/post_deleted_modal.tsx b/webapp/channels/src/components/post_deleted_modal.tsx index 175699b5b3..9edaa1f624 100644 --- a/webapp/channels/src/components/post_deleted_modal.tsx +++ b/webapp/channels/src/components/post_deleted_modal.tsx @@ -24,7 +24,7 @@ export default class PostDeletedModal extends React.PureComponent private handleHide = () => { this.setState({show: false}); - } + }; public render(): JSX.Element { return ( diff --git a/webapp/channels/src/components/post_markdown/post_markdown.tsx b/webapp/channels/src/components/post_markdown/post_markdown.tsx index 1ab9e53a0a..29df662f3f 100644 --- a/webapp/channels/src/components/post_markdown/post_markdown.tsx +++ b/webapp/channels/src/components/post_markdown/post_markdown.tsx @@ -84,7 +84,7 @@ export default class PostMarkdown extends React.PureComponent { mentionHighlight, editedAt, }; - }) + }); render() { let {message} = this.props; diff --git a/webapp/channels/src/components/post_view/combined_system_message/combined_system_message.tsx b/webapp/channels/src/components/post_view/combined_system_message/combined_system_message.tsx index 4b63b5406d..3a6dc6ec12 100644 --- a/webapp/channels/src/components/post_view/combined_system_message/combined_system_message.tsx +++ b/webapp/channels/src/components/post_view/combined_system_message/combined_system_message.tsx @@ -211,7 +211,7 @@ export class CombinedSystemMessage extends React.PureComponent { if (allUsernames.length > 0) { this.props.actions.getMissingProfilesByUsernames(allUsernames); } - } + }; getAllUsernames = (): {[p: string]: string} => { const { @@ -236,7 +236,7 @@ export class CombinedSystemMessage extends React.PureComponent { } return usernames; - } + }; getUsernamesByIds = (userIds: string[] = []): string[] => { const {currentUserId, currentUsername} = this.props; @@ -262,7 +262,7 @@ export class CombinedSystemMessage extends React.PureComponent { } return usernames; - } + }; renderFormattedMessage(postType: string, userIds: string[], actorId?: string): JSX.Element { const {formatMessage} = this.props.intl; diff --git a/webapp/channels/src/components/post_view/combined_system_message/last_users.tsx b/webapp/channels/src/components/post_view/combined_system_message/last_users.tsx index a7483ea9ad..5d9cf1e754 100644 --- a/webapp/channels/src/components/post_view/combined_system_message/last_users.tsx +++ b/webapp/channels/src/components/post_view/combined_system_message/last_users.tsx @@ -71,7 +71,7 @@ export class LastUsers extends React.PureComponent { e.preventDefault(); this.setState({expand: true}); - } + }; renderMessage = (formattedMessage: string): JSX.Element => { return ( @@ -80,7 +80,7 @@ export class LastUsers extends React.PureComponent { options={this.props.formatOptions} /> ); - } + }; render(): JSX.Element { const {formatMessage} = this.props.intl; diff --git a/webapp/channels/src/components/post_view/commented_on/commented_on.tsx b/webapp/channels/src/components/post_view/commented_on/commented_on.tsx index 0294b1ea35..f2ff974461 100644 --- a/webapp/channels/src/components/post_view/commented_on/commented_on.tsx +++ b/webapp/channels/src/components/post_view/commented_on/commented_on.tsx @@ -38,7 +38,7 @@ export default class CommentedOn extends PureComponent { } return message; - } + }; render() { const message = this.makeCommentedOnMessage(); diff --git a/webapp/channels/src/components/post_view/embedded_bindings/button_binding/button_binding.tsx b/webapp/channels/src/components/post_view/embedded_bindings/button_binding/button_binding.tsx index 171c950ec6..469f120b0c 100644 --- a/webapp/channels/src/components/post_view/embedded_bindings/button_binding/button_binding.tsx +++ b/webapp/channels/src/components/post_view/embedded_bindings/button_binding/button_binding.tsx @@ -99,7 +99,7 @@ export class ButtonBinding extends React.PureComponent { this.props.actions.postEphemeralCallResponseForPost(callResp, errorMessage, post); } } - } + }; render() { const {binding} = this.props; diff --git a/webapp/channels/src/components/post_view/embedded_bindings/embedded_binding/embedded_binding.tsx b/webapp/channels/src/components/post_view/embedded_bindings/embedded_binding/embedded_binding.tsx index 8a2b52c9c7..755457e990 100644 --- a/webapp/channels/src/components/post_view/embedded_bindings/embedded_binding/embedded_binding.tsx +++ b/webapp/channels/src/components/post_view/embedded_bindings/embedded_binding/embedded_binding.tsx @@ -84,7 +84,7 @@ export default class EmbeddedBinding extends React.PureComponent { const copiedBindings = JSON.parse(JSON.stringify(binding)) as AppBinding; cleanBinding(copiedBindings, AppBindingLocations.IN_POST); return copiedBindings.bindings!; - } + }; renderBindings = () => { if (!this.props.embed.app_id) { @@ -141,7 +141,7 @@ export default class EmbeddedBinding extends React.PureComponent { this.setState((prevState) => { return {checkOverflow: prevState.checkOverflow + 1}; }); - } + }; handleHeightReceived = (height: number) => { if (height > 0) { diff --git a/webapp/channels/src/components/post_view/embedded_bindings/embedded_bindings.tsx b/webapp/channels/src/components/post_view/embedded_bindings/embedded_bindings.tsx index 67b82c86f7..feb5b8c227 100644 --- a/webapp/channels/src/components/post_view/embedded_bindings/embedded_bindings.tsx +++ b/webapp/channels/src/components/post_view/embedded_bindings/embedded_bindings.tsx @@ -33,7 +33,7 @@ type Props = { export default class EmbeddedBindings extends React.PureComponent { static defaultProps = { imagesMetadata: {}, - } + }; render() { const content = [] as JSX.Element[]; diff --git a/webapp/channels/src/components/post_view/embedded_bindings/select_binding/select_binding.tsx b/webapp/channels/src/components/post_view/embedded_bindings/select_binding/select_binding.tsx index 225f7af312..ee3c3fbb68 100644 --- a/webapp/channels/src/components/post_view/embedded_bindings/select_binding/select_binding.tsx +++ b/webapp/channels/src/components/post_view/embedded_bindings/select_binding/select_binding.tsx @@ -151,7 +151,7 @@ class SelectBinding extends React.PureComponent { this.props.actions.postEphemeralCallResponseForPost(callResp, errorMessage, post); } } - } + }; render() { if (!this.nOptions) { diff --git a/webapp/channels/src/components/post_view/failed_post_options/failed_post_options.tsx b/webapp/channels/src/components/post_view/failed_post_options/failed_post_options.tsx index 2d0fbbee19..30c9796033 100644 --- a/webapp/channels/src/components/post_view/failed_post_options/failed_post_options.tsx +++ b/webapp/channels/src/components/post_view/failed_post_options/failed_post_options.tsx @@ -29,13 +29,13 @@ export default class FailedPostOptions extends React.PureComponent { const post = {...this.props.post}; Reflect.deleteProperty(post, 'id'); this.props.actions.createPost(post, []); - } + }; cancelPost = (e: MouseEvent): void => { e.preventDefault(); this.props.actions.removePost(this.props.post); - } + }; render(): JSX.Element { return ( diff --git a/webapp/channels/src/components/post_view/message_attachments/action_menu/action_menu.tsx b/webapp/channels/src/components/post_view/message_attachments/action_menu/action_menu.tsx index 7c2284d6b1..f5d48e6634 100644 --- a/webapp/channels/src/components/post_view/message_attachments/action_menu/action_menu.tsx +++ b/webapp/channels/src/components/post_view/message_attachments/action_menu/action_menu.tsx @@ -101,7 +101,7 @@ export default class ActionMenu extends React.PureComponent { this.props.postId, this.props.action.id || '', this.props.action.cookie || '', this.props.action?.data_source, text, value); this.setState({value: text}); - } + }; render() { const {action, disabled} = this.props; diff --git a/webapp/channels/src/components/post_view/message_attachments/message_attachment/message_attachment.tsx b/webapp/channels/src/components/post_view/message_attachments/message_attachment/message_attachment.tsx index d1f193fc77..e2f6dc0238 100644 --- a/webapp/channels/src/components/post_view/message_attachments/message_attachment/message_attachment.tsx +++ b/webapp/channels/src/components/post_view/message_attachments/message_attachment/message_attachment.tsx @@ -99,14 +99,14 @@ export default class MessageAttachment extends React.PureComponent if (!this.props.imagesMetadata || (this.props.imagesMetadata && !this.props.imagesMetadata[attachment.thumb_url])) { this.handleHeightReceived(height); } - } + }; handleHeightReceivedForImageUrl = ({height}: {height: number}) => { const {attachment} = this.props; if (!this.props.imagesMetadata || (this.props.imagesMetadata && !this.props.imagesMetadata[attachment.image_url])) { this.handleHeightReceived(height); } - } + }; handleHeightReceived = (height: number) => { if (!this.mounted) { @@ -125,7 +125,7 @@ export default class MessageAttachment extends React.PureComponent this.setState((prevState) => { return {checkOverflow: prevState.checkOverflow + 1}; }); - } + }; renderPostActions = () => { const actions = this.props.attachment.actions; @@ -206,7 +206,7 @@ export default class MessageAttachment extends React.PureComponent const mailtoPayload = JSON.parse(extUrlOption.value); window.location.href = 'mailto:' + mailtoPayload.mail_recipient + '?cc=' + mailtoPayload.mail_cc + '&subject=' + encodeURIComponent(mailtoPayload.mail_subject) + '&body=' + encodeURIComponent(mailtoPayload.mail_body); } - } + }; getActionOption = (actionOptions: PostActionOption[] | undefined, optionName: string) => { let opt = null; @@ -214,7 +214,7 @@ export default class MessageAttachment extends React.PureComponent opt = actionOptions.find((option) => option.text === optionName); } return opt; - } + }; getFieldsTable = () => { const fields = this.props.attachment.fields; @@ -335,7 +335,7 @@ export default class MessageAttachment extends React.PureComponent startIndex: 0, }, }); - } + }; render() { const {attachment, options} = this.props; diff --git a/webapp/channels/src/components/post_view/message_attachments/message_attachment_list.tsx b/webapp/channels/src/components/post_view/message_attachments/message_attachment_list.tsx index 910d7935b7..7d5399feb0 100644 --- a/webapp/channels/src/components/post_view/message_attachments/message_attachment_list.tsx +++ b/webapp/channels/src/components/post_view/message_attachments/message_attachment_list.tsx @@ -36,7 +36,7 @@ type Props = { export default class MessageAttachmentList extends React.PureComponent { static defaultProps = { imagesMetadata: {}, - } + }; render() { const content = [] as JSX.Element[]; diff --git a/webapp/channels/src/components/post_view/post_add_channel_member/post_add_channel_member.tsx b/webapp/channels/src/components/post_view/post_add_channel_member/post_add_channel_member.tsx index 03070bb703..e9fd18f9dc 100644 --- a/webapp/channels/src/components/post_view/post_add_channel_member/post_add_channel_member.tsx +++ b/webapp/channels/src/components/post_view/post_add_channel_member/post_add_channel_member.tsx @@ -54,11 +54,11 @@ export default class PostAddChannelMember extends React.PureComponent { this.setState({expanded: true}); - } + }; generateAtMentions(usernames = [] as string[]) { if (usernames.length === 1) { diff --git a/webapp/channels/src/components/post_view/post_body_additional_content/post_body_additional_content.tsx b/webapp/channels/src/components/post_view/post_body_additional_content/post_body_additional_content.tsx index 4796471ab4..b473afde61 100644 --- a/webapp/channels/src/components/post_view/post_body_additional_content/post_body_additional_content.tsx +++ b/webapp/channels/src/components/post_view/post_body_additional_content/post_body_additional_content.tsx @@ -36,12 +36,12 @@ export type Props = { export default class PostBodyAdditionalContent extends React.PureComponent { toggleEmbedVisibility = () => { this.props.actions.toggleEmbedVisibility(this.props.post.id); - } + }; getEmbed = () => { const {metadata} = this.props.post; return getEmbedFromMetadata(metadata); - } + }; isEmbedToggleable = (embed: PostEmbed) => { const postWillRenderEmbedComponents = this.props.pluginPostWillRenderEmbedComponents || []; @@ -52,7 +52,7 @@ export default class PostBodyAdditionalContent extends React.PureComponent { const postWillRenderEmbedComponents = this.props.pluginPostWillRenderEmbedComponents || []; @@ -135,7 +135,7 @@ export default class PostBodyAdditionalContent extends React.PureComponent { return ( @@ -147,7 +147,7 @@ export default class PostBodyAdditionalContent extends React.PureComponent ); - } + }; render() { const embed = this.getEmbed(); diff --git a/webapp/channels/src/components/post_view/post_flag_icon/post_flag_icon.tsx b/webapp/channels/src/components/post_view/post_flag_icon/post_flag_icon.tsx index 9ad7a6213d..4e9ec027f2 100644 --- a/webapp/channels/src/components/post_view/post_flag_icon/post_flag_icon.tsx +++ b/webapp/channels/src/components/post_view/post_flag_icon/post_flag_icon.tsx @@ -35,7 +35,7 @@ export default class PostFlagIcon extends React.PureComponent { location: Locations.CENTER, }; - private buttonRef: React.RefObject + private buttonRef: React.RefObject; constructor(props: Props) { super(props); @@ -80,15 +80,15 @@ export default class PostFlagIcon extends React.PureComponent { } else { actions.flagPost(postId); } - } + }; handleA11yActivateEvent = () => { this.setState({a11yActive: true}); - } + }; handleA11yDeactivateEvent = () => { this.setState({a11yActive: false}); - } + }; render() { const isFlagged = this.props.isFlagged; diff --git a/webapp/channels/src/components/post_view/post_image/post_image.tsx b/webapp/channels/src/components/post_view/post_image/post_image.tsx index 9b56306f17..3534fc51b5 100644 --- a/webapp/channels/src/components/post_view/post_image/post_image.tsx +++ b/webapp/channels/src/components/post_view/post_image/post_image.tsx @@ -40,7 +40,7 @@ export default class PostImage extends React.PureComponent { }], }, }); - } + }; render() { return ( diff --git a/webapp/channels/src/components/post_view/post_list/post_list.tsx b/webapp/channels/src/components/post_view/post_list/post_list.tsx index a4a3691424..3845733895 100644 --- a/webapp/channels/src/components/post_view/post_list/post_list.tsx +++ b/webapp/channels/src/components/post_view/post_list/post_list.tsx @@ -164,7 +164,7 @@ export default class PostList extends React.PureComponent { changeUnreadChunkTimeStamp: (lastViewedAt: number) => void; updateNewMessagesAtInChannel: typeof updateNewMessagesAtInChannel; toggleShouldStartFromBottomWhenUnread: () => void; - } + }; private mounted: boolean | undefined; // public for testing purposes only @@ -239,7 +239,7 @@ export default class PostList extends React.PureComponent { loadingNewerPosts: false, }); } - } + }; callLoadPosts = async (channelId: string, postId: string, type: CanLoadMorePosts) => { const {error} = await this.props.actions.loadPosts({ @@ -272,22 +272,22 @@ export default class PostList extends React.PureComponent { } return {error}; - } + }; markChannelAsReadAndViewed = (channelId: string) => { // Posts are marked as read from here to not cause a race when loading posts // marking channel as read and viewed after calling for posts in channel this.props.actions.markChannelAsViewed(channelId); this.props.actions.markChannelAsRead(channelId); - } + }; getOldestVisiblePostId = () => { return getOldestPostId(this.props.postListIds || []); - } + }; getLatestVisiblePostId = () => { return getLatestPostId(this.props.postListIds || []); - } + }; canLoadMorePosts = async (type: CanLoadMorePosts = PostRequestTypes.BEFORE_ID) => { if (this.props.hasInaccessiblePosts) { @@ -319,7 +319,7 @@ export default class PostList extends React.PureComponent { } this.extraPagesLoaded += 1; - } + }; getPostsBefore = async () => { if (this.state.loadingOlderPosts) { @@ -334,7 +334,7 @@ export default class PostList extends React.PureComponent { const oldestPostId = this.getOldestVisiblePostId(); this.setState({loadingOlderPosts: true}); await this.callLoadPosts(this.props.channelId, oldestPostId, PostRequestTypes.BEFORE_ID); - } + }; getPostsAfter = async () => { if (this.state.loadingNewerPosts) { @@ -349,7 +349,7 @@ export default class PostList extends React.PureComponent { const latestPostId = this.getLatestVisiblePostId(); this.setState({loadingNewerPosts: true}); await this.callLoadPosts(this.props.channelId, latestPostId, PostRequestTypes.AFTER_ID); - } + }; render() { if (!this.props.postListIds) { diff --git a/webapp/channels/src/components/post_view/post_list_virtualized/post_list_virtualized.tsx b/webapp/channels/src/components/post_view/post_list_virtualized/post_list_virtualized.tsx index c3df391615..f03a87760b 100644 --- a/webapp/channels/src/components/post_view/post_list_virtualized/post_list_virtualized.tsx +++ b/webapp/channels/src/components/post_view/post_list_virtualized/post_list_virtualized.tsx @@ -315,12 +315,12 @@ export default class PostList extends React.PureComponent { return postListIds.findIndex( (item) => item.indexOf(PostListRowListIds.START_OF_NEW_MESSAGES) === 0, ); - } + }; handleWindowResize = () => { this.props.actions.checkAndSetMobileView(); this.showSearchHintThreshold = this.getShowSearchHintThreshold(); - } + }; togglePostMenu = (opened: boolean) => { let dynamicListStyle = this.state.dynamicListStyle; @@ -341,7 +341,7 @@ export default class PostList extends React.PureComponent { this.setState({ isNewMessageLineReached: true, }); - } + }; renderRow = ({data, itemId, style}: {data: string[]; itemId: string; style: Record}) => { const index = data.indexOf(itemId); @@ -391,7 +391,7 @@ export default class PostList extends React.PureComponent { } else { this.props.actions.changeUnreadChunkTimeStamp(this.props.lastViewedAt); } - } + }; onScroll = ({ scrollDirection, @@ -463,22 +463,22 @@ export default class PostList extends React.PureComponent { showSearchHint: offsetFromBottom > this.showSearchHintThreshold, }); } - } + }; getShowSearchHintThreshold = () => { return window.screen.height * 3; - } + }; checkBottom = (scrollOffset: number, scrollHeight: number, clientHeight: number) => { this.updateAtBottom(this.isAtBottom(scrollOffset, scrollHeight, clientHeight)); - } + }; isAtBottom = (scrollOffset: number, scrollHeight: number, clientHeight: number) => { // Calculate how far the post list is from being scrolled to the bottom const offsetFromBottom = scrollHeight - clientHeight - scrollOffset; return offsetFromBottom <= BUFFER_TO_BE_CONSIDERED_BOTTOM && scrollHeight > 0; - } + }; updateAtBottom = (atBottom: boolean) => { if (atBottom !== this.state.atBottom) { @@ -494,13 +494,13 @@ export default class PostList extends React.PureComponent { lastViewedBottom, }); } - } + }; updateLastViewedBottomAt = (lastViewedBottom = Date.now()) => { this.setState({ lastViewedBottom, }); - } + }; handleScrollStop = () => { if (this.mounted) { @@ -508,14 +508,14 @@ export default class PostList extends React.PureComponent { isScrolling: false, }); } - } + }; handleSearchHintDismiss = () => { this.setState({ showSearchHint: false, isSearchHintDismissed: true, }); - } + }; updateFloatingTimestamp = (visibleTopItem: number) => { if (!this.props.isMobileView) { @@ -529,7 +529,7 @@ export default class PostList extends React.PureComponent { this.setState({ topPostId: getLatestPostId(this.props.postListIds.slice(visibleTopItem)), }); - } + }; onItemsRendered = ({visibleStartIndex, visibleStopIndex}: Pick) => { this.updateFloatingTimestamp(visibleStartIndex); @@ -542,7 +542,7 @@ export default class PostList extends React.PureComponent { ) { this.onNewMessageLineReached(); } - } + }; initScrollToIndex = () => { if (this.props.focusedPostId) { @@ -584,7 +584,7 @@ export default class PostList extends React.PureComponent { index: 0, position: 'end', }; - } + }; scrollToLatestMessages = () => { if (this.props.atLatestPost) { @@ -593,23 +593,23 @@ export default class PostList extends React.PureComponent { this.updateNewMessagesAtInChannel(); this.props.actions.changeUnreadChunkTimeStamp(0); } - } + }; scrollToUnreadMessages = () => { this.props.actions.toggleShouldStartFromBottomWhenUnread(); - } + }; scrollToBottom = () => { this.listRef.current?.scrollToItem(0, 'end'); - } + }; scrollToNewMessage = () => { this.listRef.current?.scrollToItem(getNewMessageIndex(this.state.postListIds), 'start', OFFSET_TO_SHOW_TOAST); - } + }; updateNewMessagesAtInChannel = (lastViewedAt = Date.now()) => { this.props.actions.updateNewMessagesAtInChannel(this.props.channelId, lastViewedAt); - } + }; renderToasts = (width: number) => { return ( @@ -634,7 +634,7 @@ export default class PostList extends React.PureComponent { showSearchHintToast={this.state.showSearchHint} /> ); - } + }; render() { const {channelId} = this.props; diff --git a/webapp/channels/src/components/post_view/post_message_view/post_message_view.tsx b/webapp/channels/src/components/post_view/post_message_view/post_message_view.tsx index 7d4936ad77..5341aa340b 100644 --- a/webapp/channels/src/components/post_view/post_message_view/post_message_view.tsx +++ b/webapp/channels/src/components/post_view/post_message_view/post_message_view.tsx @@ -71,7 +71,7 @@ export default class PostMessageView extends React.PureComponent { this.setState((prevState) => { return {checkOverflow: prevState.checkOverflow + 1}; }); - } + }; handleHeightReceived = (height: number) => { if (height > 0) { diff --git a/webapp/channels/src/components/post_view/post_pre_header/post_pre_header.tsx b/webapp/channels/src/components/post_view/post_pre_header/post_pre_header.tsx index b91c25aab3..886ea04c82 100644 --- a/webapp/channels/src/components/post_view/post_pre_header/post_pre_header.tsx +++ b/webapp/channels/src/components/post_view/post_pre_header/post_pre_header.tsx @@ -92,7 +92,7 @@ class PostPreHeader extends React.PureComponent { } else { this.props.actions.showFlaggedPosts(); } - } + }; render() { const {isFlagged, isPinned, skipPinned, skipFlagged, channelId} = this.props; diff --git a/webapp/channels/src/components/post_view/post_view.tsx b/webapp/channels/src/components/post_view/post_view.tsx index f7ccc22f2b..6bf78f3baa 100644 --- a/webapp/channels/src/components/post_view/post_view.tsx +++ b/webapp/channels/src/components/post_view/post_view.tsx @@ -63,7 +63,7 @@ export default class PostView extends React.PureComponent { }); }); }); - } + }; toggleShouldStartFromBottomWhenUnread = () => { this.setState((state) => ({ @@ -76,7 +76,7 @@ export default class PostView extends React.PureComponent { }); }); }); - } + }; render() { if (this.props.channelLoading || this.state.loaderForChangeOfPostsChunk) { diff --git a/webapp/channels/src/components/post_view/reaction/reaction.tsx b/webapp/channels/src/components/post_view/reaction/reaction.tsx index 5cf2f0f1d5..87fcad5990 100644 --- a/webapp/channels/src/components/post_view/reaction/reaction.tsx +++ b/webapp/channels/src/components/post_view/reaction/reaction.tsx @@ -152,7 +152,7 @@ export default class Reaction extends React.PureComponent { reactedClass: 'Reaction--reacting', }; }); - } + }; handleAnimationEnded = (): void => { const {actions, currentUserReacted, post, emojiName} = this.props; @@ -176,12 +176,12 @@ export default class Reaction extends React.PureComponent { } else { actions.addReaction(post.id, emojiName); } - } + }; loadMissingProfiles = async (): Promise => { const ids = this.props.reactions.map((reaction) => reaction.user_id); this.props.actions.getMissingProfilesByIds(ids); - } + }; render(): React.ReactNode { if (!this.props.emojiImageUrl) { diff --git a/webapp/channels/src/components/post_view/reaction_list/reaction_list.tsx b/webapp/channels/src/components/post_view/reaction_list/reaction_list.tsx index 11d828060f..65f1f533d0 100644 --- a/webapp/channels/src/components/post_view/reaction_list/reaction_list.tsx +++ b/webapp/channels/src/components/post_view/reaction_list/reaction_list.tsx @@ -84,22 +84,22 @@ export default class ReactionList extends React.PureComponent { getTarget = (): HTMLButtonElement | null => { return this.addReactionButtonRef.current; - } + }; handleEmojiClick = (emoji: Emoji): void => { this.setState({showEmojiPicker: false}); const emojiName = isSystemEmoji(emoji) ? emoji.short_names[0] : emoji.name; this.props.actions.addReaction(this.props.post.id, emojiName); - } + }; hideEmojiPicker = (): void => { this.setState({showEmojiPicker: false}); - } + }; toggleEmojiPicker = (e?: React.MouseEvent): void => { e?.stopPropagation(); this.setState({showEmojiPicker: !this.state.showEmojiPicker}); - } + }; render(): React.ReactNode { const reactionsByName = new Map(); diff --git a/webapp/channels/src/components/product_notices_modal/product_notices_modal.tsx b/webapp/channels/src/components/product_notices_modal/product_notices_modal.tsx index 3f2c02d760..0fcd4590f1 100644 --- a/webapp/channels/src/components/product_notices_modal/product_notices_modal.tsx +++ b/webapp/channels/src/components/product_notices_modal/product_notices_modal.tsx @@ -189,7 +189,7 @@ export default class ProductNoticesModal extends React.PureComponent { const presentNoticeInfo = this.state.noticesData[this.state.presentNoticeIndex]; trackEvent('ui', `notice_click_${presentNoticeInfo.id}`); - } + }; private renderActionButton(presentNoticeInfo: ProductNotice) { const noOfNotices = this.state.noticesData.length; @@ -225,7 +225,7 @@ export default class ProductNoticesModal extends React.PureComponent { if (this.state.presentNoticeIndex !== 0) { @@ -233,7 +233,7 @@ export default class ProductNoticesModal extends React.PureComponent { this.clearDataTimer = window.setTimeout(() => { @@ -242,7 +242,7 @@ export default class ProductNoticesModal extends React.PureComponent { if (this.overlay.current) { this.overlay.current.hide(); } - } + }; public render() { // profileSrc will, if possible, be the original user profile picture even if the icon diff --git a/webapp/channels/src/components/profile_popover/profile_popover.tsx b/webapp/channels/src/components/profile_popover/profile_popover.tsx index ba8419766a..44f860579f 100644 --- a/webapp/channels/src/components/profile_popover/profile_popover.tsx +++ b/webapp/channels/src/components/profile_popover/profile_popover.tsx @@ -339,7 +339,7 @@ class ProfilePopover extends React.PureComponent { progress += 1; this.setState({progress: progress > MAX_FAKE_PROGRESS ? MAX_FAKE_PROGRESS : progress}); - } + }; private savePaymentMethod = async () => { const start = new Date(); @@ -168,7 +168,7 @@ class ProcessPaymentSetup extends React.PureComponent { } this.completePayment(); - } + }; private completePayment = () => { clearInterval(this.intervalId); @@ -180,7 +180,7 @@ class ProcessPaymentSetup extends React.PureComponent { 'pageview_payment_success', ); this.setState({state: ProcessState.SUCCESS, progress: 100}); - } + }; private handleGoBack = () => { clearInterval(this.intervalId); @@ -190,7 +190,7 @@ class ProcessPaymentSetup extends React.PureComponent { state: ProcessState.PROCESSING, }); this.props.onBack(); - } + }; private successPage = () => { const {error} = this.state; @@ -330,7 +330,7 @@ class ProcessPaymentSetup extends React.PureComponent { }} /> ); - } + }; public render() { const {state, progress, error} = this.state; diff --git a/webapp/channels/src/components/purchase_modal/purchase_modal.tsx b/webapp/channels/src/components/purchase_modal/purchase_modal.tsx index 41b67d198c..62fa5fab69 100644 --- a/webapp/channels/src/components/purchase_modal/purchase_modal.tsx +++ b/webapp/channels/src/components/purchase_modal/purchase_modal.tsx @@ -424,11 +424,11 @@ class PurchaseModal extends React.PureComponent { totalOwed += invoice.total; }); return `$${totalOwed / 100}`; - } + }; onPaymentInput = (billing: BillingDetails) => { this.setState({billingDetails: billing}, this.isFormComplete); - } + }; isFormComplete = () => { let paymentInfoIsValid = areBillingDetailsValid(this.state.billingDetails) && this.state.cardInputComplete; @@ -436,7 +436,7 @@ class PurchaseModal extends React.PureComponent { paymentInfoIsValid = paymentInfoIsValid && areShippingDetailsValid(this.state.shippingAddress); } this.setState({paymentInfoIsValid}); - } + }; handleShippingSameAsBillingChange(value: boolean) { this.setState({billingSameAsShipping: value}, this.isFormComplete); @@ -444,7 +444,7 @@ class PurchaseModal extends React.PureComponent { onShippingInput = (address: Address) => { this.setState({shippingAddress: {...this.state.shippingAddress, ...address}}, this.isFormComplete); - } + }; handleCardInputChange = (event: StripeCardElementChangeEvent) => { this.setState({ @@ -452,7 +452,7 @@ class PurchaseModal extends React.PureComponent { areBillingDetailsValid(this.state.billingDetails) && event.complete, }); this.setState({cardInputComplete: event.complete}); - } + }; handleSubmitClick = async (callerInfo: string) => { const update = { @@ -462,7 +462,7 @@ class PurchaseModal extends React.PureComponent { processing: true, } as unknown as Pick; this.setState(update); - } + }; confirmSwitchToAnnual = () => { const {customer} = this.props; @@ -487,11 +487,11 @@ class PurchaseModal extends React.PureComponent { }, }, }); - } + }; setIsUpgradeFromTrialToFalse = () => { this.setState({isUpgradeFromTrial: false}); - } + }; openPricingModal = (callerInfo: string) => { this.props.actions.openModal({ @@ -534,7 +534,7 @@ class PurchaseModal extends React.PureComponent { {text} ); - } + }; learnMoreLink = () => { return ( @@ -555,7 +555,7 @@ class PurchaseModal extends React.PureComponent { /> ); - } + }; editPaymentInfoHandler = () => { this.setState((prevState: State) => { @@ -564,7 +564,7 @@ class PurchaseModal extends React.PureComponent { editPaymentInfo: !prevState.editPaymentInfo, }; }); - } + }; paymentFooterText = () => { const normalPaymentText = ( @@ -633,7 +633,7 @@ class PurchaseModal extends React.PureComponent { payment = prorratedPaymentText; } return payment; - } + }; getPlanNameFromProductName = (productName: string): string => { if (productName.length > 0) { @@ -642,7 +642,7 @@ class PurchaseModal extends React.PureComponent { } return productName; - } + }; getShippingAddressForProcessing = (): Address => { if (this.state.billingSameAsShipping) { @@ -657,7 +657,7 @@ class PurchaseModal extends React.PureComponent { } return this.state.shippingAddress as Address; - } + }; handleViewBreakdownClick = () => { this.props.actions.openModal({ @@ -667,7 +667,7 @@ class PurchaseModal extends React.PureComponent { invoices: this.props.invoices, }, }); - } + }; purchaseScreenCard = () => { if (this.props.isDelinquencyModal) { @@ -792,7 +792,7 @@ class PurchaseModal extends React.PureComponent { /> ); - } + }; purchaseScreen = () => { const title = ( @@ -916,7 +916,7 @@ class PurchaseModal extends React.PureComponent {
{this.purchaseScreenCard()}
); - } + }; render() { if (this.props.isComplianceBlocked) { diff --git a/webapp/channels/src/components/quick_input/quick_input.tsx b/webapp/channels/src/components/quick_input/quick_input.tsx index a8f2e59850..e8677d965a 100644 --- a/webapp/channels/src/components/quick_input/quick_input.tsx +++ b/webapp/channels/src/components/quick_input/quick_input.tsx @@ -120,7 +120,7 @@ export class QuickInput extends React.PureComponent { } this.input.value = this.props.value; - } + }; private setInputRef = (input: HTMLInputElement) => { if (this.props.forwardedRef) { @@ -132,7 +132,7 @@ export class QuickInput extends React.PureComponent { } this.input = input; - } + }; private onClear = (e: React.MouseEvent | React.TouchEvent) => { e.preventDefault(); @@ -143,7 +143,7 @@ export class QuickInput extends React.PureComponent { } this.input?.focus(); - } + }; render() { let clearableTooltipText = this.props.clearableTooltipText; diff --git a/webapp/channels/src/components/quick_switch_modal/quick_switch_modal.tsx b/webapp/channels/src/components/quick_switch_modal/quick_switch_modal.tsx index 1b746af20b..ebcc1544c9 100644 --- a/webapp/channels/src/components/quick_switch_modal/quick_switch_modal.tsx +++ b/webapp/channels/src/components/quick_switch_modal/quick_switch_modal.tsx @@ -151,7 +151,7 @@ export default class QuickSwitchModal extends React.PureComponent pretext: suggestions.matchedPretext, hasSuggestions: suggestions.items.length > 0, }); - } + }; public render = (): JSX.Element => { const providers: SwitchChannelProvider[] = this.channelProviders; @@ -244,5 +244,5 @@ export default class QuickSwitchModal extends React.PureComponent ); - } + }; } diff --git a/webapp/channels/src/components/removed_from_channel_modal/removed_from_channel_modal.tsx b/webapp/channels/src/components/removed_from_channel_modal/removed_from_channel_modal.tsx index 28957530d8..a988e8f7c2 100644 --- a/webapp/channels/src/components/removed_from_channel_modal/removed_from_channel_modal.tsx +++ b/webapp/channels/src/components/removed_from_channel_modal/removed_from_channel_modal.tsx @@ -25,7 +25,7 @@ export default class RemovedFromChannelModal extends React.PureComponent { this.setState({show: false}); - } + }; render() { let channelName: JSX.Element | string; diff --git a/webapp/channels/src/components/rename_channel_modal/rename_channel_modal.tsx b/webapp/channels/src/components/rename_channel_modal/rename_channel_modal.tsx index 09367fb564..a24b1c615f 100644 --- a/webapp/channels/src/components/rename_channel_modal/rename_channel_modal.tsx +++ b/webapp/channels/src/components/rename_channel_modal/rename_channel_modal.tsx @@ -105,17 +105,17 @@ export class RenameChannelModal extends React.PureComponent { setError = (err: ServerError) => { this.setState({serverError: err.message}); - } + }; unsetError = () => { this.setState({serverError: ''}); - } + }; handleEntering = () => { if (this.textbox) { Utils.placeCaretAtEnd(this.textbox); } - } + }; handleHide = (e?: MouseEvent) => { if (e) { @@ -129,7 +129,7 @@ export class RenameChannelModal extends React.PureComponent { invalid: false, show: false, }); - } + }; handleSubmit = async (e?: MouseEvent): Promise => { if (e) { @@ -186,13 +186,13 @@ export class RenameChannelModal extends React.PureComponent { } else if (error) { this.setError(error); } - } + }; onSaveSuccess = () => { this.handleHide(); this.unsetError(); getHistory().push('/' + this.props.team.name + '/channels/' + this.state.channelName); - } + }; handleCancel = (e?: MouseEvent) => { this.setState({ @@ -201,20 +201,20 @@ export class RenameChannelModal extends React.PureComponent { }); this.handleHide(e); - } + }; onNameChange = (e: ChangeEvent | {target: {value: string}}) => { const name = e.target.value.trim().replace(/[^A-Za-z0-9-_]/g, '').toLowerCase(); this.setState({channelName: name}); - } + }; onDisplayNameChange = (e: ChangeEvent) => { this.setState({displayName: e.target.value}); - } + }; getTextbox = (node: HTMLInputElement) => { this.textbox = node; - } + }; render(): JSX.Element { let displayNameError = null; diff --git a/webapp/channels/src/components/rhs_card/rhs_card.tsx b/webapp/channels/src/components/rhs_card/rhs_card.tsx index 1b219f2cbe..86806c61a6 100644 --- a/webapp/channels/src/components/rhs_card/rhs_card.tsx +++ b/webapp/channels/src/components/rhs_card/rhs_card.tsx @@ -66,7 +66,7 @@ export default class RhsCard extends React.Component { static defaultProps = { pluginPostCardTypes: {}, - } + }; constructor(props: Props) { super(props); @@ -93,13 +93,13 @@ export default class RhsCard extends React.Component { } this.scrollStopAction.fireAfter(Constants.SCROLL_DELAY); - } + }; handleScrollStop = () => { this.setState({ isScrolling: false, }); - } + }; handleClick = () => { if (this.props.isMobileView) { diff --git a/webapp/channels/src/components/rhs_card_header/rhs_card_header.tsx b/webapp/channels/src/components/rhs_card_header/rhs_card_header.tsx index 86ba5a4d5d..b1a1d7a484 100644 --- a/webapp/channels/src/components/rhs_card_header/rhs_card_header.tsx +++ b/webapp/channels/src/components/rhs_card_header/rhs_card_header.tsx @@ -52,7 +52,7 @@ export default class RhsCardHeader extends React.PureComponent { default: break; } - } + }; render(): React.ReactNode { let back; diff --git a/webapp/channels/src/components/rhs_header_post/rhs_header_post.tsx b/webapp/channels/src/components/rhs_header_post/rhs_header_post.tsx index 37a2f2a665..11968bd792 100644 --- a/webapp/channels/src/components/rhs_header_post/rhs_header_post.tsx +++ b/webapp/channels/src/components/rhs_header_post/rhs_header_post.tsx @@ -58,7 +58,7 @@ export default class RhsHeaderPost extends React.PureComponent { if (this.props.isMobileView) { @@ -68,12 +68,12 @@ export default class RhsHeaderPost extends React.PureComponent { const {currentTeamId, currentUserId, rootPostId, isFollowingThread} = this.props; this.props.setThreadFollow(currentUserId, currentTeamId, rootPostId, !isFollowingThread); - } + }; render() { let back; diff --git a/webapp/channels/src/components/root/root.tsx b/webapp/channels/src/components/root/root.tsx index dada1d57b1..eb41c2d0fe 100644 --- a/webapp/channels/src/components/root/root.tsx +++ b/webapp/channels/src/components/root/root.tsx @@ -328,7 +328,7 @@ export default class Root extends React.PureComponent { } Utils.applyTheme(this.props.theme); - } + }; componentDidUpdate(prevProps: Props) { if (!deepEqual(prevProps.theme, this.props.theme)) { @@ -423,7 +423,7 @@ export default class Root extends React.PureComponent { } this.onConfigLoaded(); - } + }; componentDidMount() { this.mounted = true; @@ -495,7 +495,7 @@ export default class Root extends React.PureComponent { } window.addEventListener('focus', reloadOnFocus); } - } + }; handleWindowResizeEvent = throttle(() => { this.props.actions.emitBrowserWindowResized(); @@ -505,7 +505,7 @@ export default class Root extends React.PureComponent { if (e.matches) { this.updateWindowSize(); } - } + }; setRootMeta = () => { const root = document.getElementById('root')!; @@ -517,7 +517,7 @@ export default class Root extends React.PureComponent { })) { root.classList.toggle(className, enabled); } - } + }; updateWindowSize = () => { switch (true) { @@ -534,7 +534,7 @@ export default class Root extends React.PureComponent { this.props.actions.emitBrowserWindowResized(WindowSizes.MOBILE_VIEW); break; } - } + }; render() { if (!this.state.configLoaded) { diff --git a/webapp/channels/src/components/root_portal.tsx b/webapp/channels/src/components/root_portal.tsx index 35ed28ad61..7220816038 100644 --- a/webapp/channels/src/components/root_portal.tsx +++ b/webapp/channels/src/components/root_portal.tsx @@ -8,7 +8,7 @@ interface Props { children: React.ReactNode | React.ReactNodeArray; } export default class RootPortal extends React.PureComponent { - private el: HTMLDivElement + private el: HTMLDivElement; constructor(props: Props) { super(props); diff --git a/webapp/channels/src/components/save_button.tsx b/webapp/channels/src/components/save_button.tsx index b98e5d9f74..5ee290ece2 100644 --- a/webapp/channels/src/components/save_button.tsx +++ b/webapp/channels/src/components/save_button.tsx @@ -34,7 +34,7 @@ export default class SaveButton extends React.PureComponent { defaultMessage='Saving' /> ), - } + }; public render() { const { diff --git a/webapp/channels/src/components/search/user_guide_dropdown/user_guide_dropdown.tsx b/webapp/channels/src/components/search/user_guide_dropdown/user_guide_dropdown.tsx index 5e38f001e3..4f298c383b 100644 --- a/webapp/channels/src/components/search/user_guide_dropdown/user_guide_dropdown.tsx +++ b/webapp/channels/src/components/search/user_guide_dropdown/user_guide_dropdown.tsx @@ -40,17 +40,17 @@ class UserGuideDropdown extends React.PureComponent { modalId: ModalIdentifiers.KEYBOARD_SHORTCUTS_MODAL, dialogType: KeyboardShortcutsModal, }); - } + }; buttonToggleState = (menuActive: boolean) => { this.setState({ buttonActive: menuActive, }); - } + }; askTheCommunityClick = () => { trackEvent('ui', 'help_ask_the_community'); - } + }; renderDropdownItems = (): React.ReactNode => { const {intl} = this.props; @@ -82,7 +82,7 @@ class UserGuideDropdown extends React.PureComponent { /> ); - } + }; render() { const {intl} = this.props; diff --git a/webapp/channels/src/components/searchable_channel_list.jsx b/webapp/channels/src/components/searchable_channel_list.jsx index edf7b57565..bd9d4f0e59 100644 --- a/webapp/channels/src/components/searchable_channel_list.jsx +++ b/webapp/channels/src/components/searchable_channel_list.jsx @@ -122,7 +122,7 @@ export default class SearchableChannelList extends React.PureComponent { ); - } + }; nextPage = (e) => { e.preventDefault(); @@ -130,13 +130,13 @@ export default class SearchableChannelList extends React.PureComponent { this.nextTimeoutId = setTimeout(() => this.setState({nextDisabled: false}), NEXT_BUTTON_TIMEOUT_MILLISECONDS); this.props.nextPage(this.state.page + 1); this.channelListScroll.current?.scrollTo({top: 0}); - } + }; previousPage = (e) => { e.preventDefault(); this.setState({page: this.state.page - 1}); this.channelListScroll.current?.scrollTo({top: 0}); - } + }; doSearch = () => { const term = this.filter.current.value; @@ -144,13 +144,13 @@ export default class SearchableChannelList extends React.PureComponent { if (term === '') { this.setState({page: 0}); } - } + }; toggleArchivedChannelsOn = () => { this.props.toggleArchivedChannels(true); - } + }; toggleArchivedChannelsOff = () => { this.props.toggleArchivedChannels(false); - } + }; render() { const channels = this.props.channels; diff --git a/webapp/channels/src/components/searchable_user_list/searchable_user_list.tsx b/webapp/channels/src/components/searchable_user_list/searchable_user_list.tsx index 56e59a9c58..f76e3e664d 100644 --- a/webapp/channels/src/components/searchable_user_list/searchable_user_list.tsx +++ b/webapp/channels/src/components/searchable_user_list/searchable_user_list.tsx @@ -120,7 +120,7 @@ class SearchableUserList extends React.PureComponent { public scrollToTop = (): void => { this.scrollbarsRef.current?.scrollToTop(); - } + }; componentDidMount() { this.focusSearchBar(); @@ -144,27 +144,27 @@ class SearchableUserList extends React.PureComponent { this.props.nextPage(); this.scrollToTop(); - } + }; previousPage = (e: React.MouseEvent) => { e.preventDefault(); this.props.previousPage(); this.scrollToTop(); - } + }; focusSearchBar = () => { if (this.props.focusOnMount && this.filterRef.current) { this.filterRef.current.focus(); } - } + }; handleInput = (e: React.FormEvent | undefined) => { if (e) { this.props.onTermChange(e.currentTarget.value); this.props.search(e.currentTarget.value); } - } + }; renderCount = (users: UserProfile[] | null | undefined) => { if (!users || !this.props.users) { @@ -225,7 +225,7 @@ class SearchableUserList extends React.PureComponent { } return null; - } + }; render() { let nextButton; diff --git a/webapp/channels/src/components/select_team/components/select_team_item.tsx b/webapp/channels/src/components/select_team/components/select_team_item.tsx index b337a53e88..5d9c8b23b7 100644 --- a/webapp/channels/src/components/select_team/components/select_team_item.tsx +++ b/webapp/channels/src/components/select_team/components/select_team_item.tsx @@ -25,7 +25,7 @@ export default class SelectTeamItem extends React.PureComponent { handleTeamClick = (e: MouseEvent): void => { e.preventDefault(); this.props.onTeamClick(this.props.team); - } + }; renderDescriptionTooltip = (): ReactNode => { const team = this.props.team; @@ -50,7 +50,7 @@ export default class SelectTeamItem extends React.PureComponent { ); - } + }; render() { const {canJoinPublicTeams, canJoinPrivateTeams, loading, team} = this.props; diff --git a/webapp/channels/src/components/select_team/select_team.tsx b/webapp/channels/src/components/select_team/select_team.tsx index 8adc6a6b9b..7d02680077 100644 --- a/webapp/channels/src/components/select_team/select_team.tsx +++ b/webapp/channels/src/components/select_team/select_team.tsx @@ -116,7 +116,7 @@ export default class SelectTeam extends React.PureComponent { ), ); } - } + }; handleTeamClick = async (team: Team) => { const {siteURL, currentUserRoles} = this.props; diff --git a/webapp/channels/src/components/setting_item_max.tsx b/webapp/channels/src/components/setting_item_max.tsx index 0edaf3f928..fb96b13bfa 100644 --- a/webapp/channels/src/components/setting_item_max.tsx +++ b/webapp/channels/src/components/setting_item_max.tsx @@ -93,7 +93,7 @@ export default class SettingItemMax extends React.PureComponent { this.settingList.current.contains(target)) { this.handleSubmit(e); } - } + }; handleSubmit = (e: React.MouseEvent | KeyboardEvent) => { e.preventDefault(); @@ -103,14 +103,14 @@ export default class SettingItemMax extends React.PureComponent { } else if (this.props.submit) { this.props.submit(); } - } + }; handleUpdateSection = (e: React.MouseEvent) => { if (this.props.updateSection) { this.props.updateSection(this.props.section); } e.preventDefault(); - } + }; render() { let clientError = null; diff --git a/webapp/channels/src/components/setting_item_min/setting_item_min.tsx b/webapp/channels/src/components/setting_item_min/setting_item_min.tsx index eb8b83faad..7e920b63d0 100644 --- a/webapp/channels/src/components/setting_item_min/setting_item_min.tsx +++ b/webapp/channels/src/components/setting_item_min/setting_item_min.tsx @@ -47,12 +47,12 @@ export default class SettingItemMin extends React.PureComponent { private getEdit = (node: HTMLButtonElement) => { this.edit = node; - } + }; handleUpdateSection = (e: React.MouseEvent) => { e.preventDefault(); this.props.updateSection(this.props.section); - } + }; render(): JSX.Element { let editButton = null; diff --git a/webapp/channels/src/components/setting_picture.tsx b/webapp/channels/src/components/setting_picture.tsx index b980634775..b1c8a93dca 100644 --- a/webapp/channels/src/components/setting_picture.tsx +++ b/webapp/channels/src/components/setting_picture.tsx @@ -95,13 +95,13 @@ export default class SettingPicture extends Component { handleCancel = (e: MouseEvent) => { this.setState({removeSrc: false, setDefaultSrc: false}); this.props.updateSection?.(e); - } + }; handleFileSelected = () => { if (this.confirmButton.current) { this.confirmButton.current.focus(); } - } + }; handleSave = (e: MouseEvent) => { e.preventDefault(); @@ -115,31 +115,31 @@ export default class SettingPicture extends Component { } else { this.props.onSubmit?.(); } - } + }; handleRemoveSrc = (e: MouseEvent) => { e.preventDefault(); this.setState({removeSrc: true}); this.focusFirstElement(); - } + }; handleSetDefaultSrc = (e: MouseEvent) => { e.preventDefault(); this.setState({setDefaultSrc: true}); this.focusFirstElement(); - } + }; handleFileChange = (e: ChangeEvent) => { this.setState({removeSrc: false, setDefaultSrc: false}); this.props.onFileChange?.(e); - } + }; handleInputFile = () => { if (this.selectInput.current) { this.selectInput.current.value = ''; this.selectInput.current.click(); } - } + }; setPicture = (file: File) => { if (file) { @@ -157,7 +157,7 @@ export default class SettingPicture extends Component { }; reader.readAsArrayBuffer(file); } - } + }; renderImg = () => { const imageContext = this.props.imageContext; @@ -255,7 +255,7 @@ export default class SettingPicture extends Component { ); } return null; - } + }; render() { const img = this.renderImg(); diff --git a/webapp/channels/src/components/settings_sidebar/settings_sidebar.tsx b/webapp/channels/src/components/settings_sidebar/settings_sidebar.tsx index 0da44955b1..df32607d70 100644 --- a/webapp/channels/src/components/settings_sidebar/settings_sidebar.tsx +++ b/webapp/channels/src/components/settings_sidebar/settings_sidebar.tsx @@ -33,7 +33,7 @@ export default class SettingsSidebar extends React.PureComponent { e.preventDefault(); this.props.updateTab(tab.name); (e.target as Element).closest('.settings-modal')?.classList.add('display--content'); - } + }; public handleKeyUp = (index: number, e: React.KeyboardEvent) => { if (isKeyPressed(e, Constants.KeyCodes.UP)) { @@ -47,7 +47,7 @@ export default class SettingsSidebar extends React.PureComponent { a11yFocus(this.buttonRefs[index + 1].current); } } - } + }; public componentDidMount() { if (UserAgent.isFirefox()) { diff --git a/webapp/channels/src/components/sidebar/channel_filter/channel_filter.tsx b/webapp/channels/src/components/sidebar/channel_filter/channel_filter.tsx index 99fc982cee..7b60be7507 100644 --- a/webapp/channels/src/components/sidebar/channel_filter/channel_filter.tsx +++ b/webapp/channels/src/components/sidebar/channel_filter/channel_filter.tsx @@ -35,7 +35,7 @@ export class ChannelFilter extends React.PureComponent { e?.preventDefault(); e?.stopPropagation(); this.toggleUnreadFilter(); - } + }; handleUnreadFilterKeyPress = (e: KeyboardEvent) => { if (Utils.cmdOrCtrlPressed(e) && e.shiftKey && Utils.isKeyPressed(e, Constants.KeyCodes.U)) { @@ -43,7 +43,7 @@ export class ChannelFilter extends React.PureComponent { e.stopPropagation(); this.toggleUnreadFilter(); } - } + }; toggleUnreadFilter = () => { const {unreadFilterEnabled} = this.props; @@ -55,7 +55,7 @@ export class ChannelFilter extends React.PureComponent { } this.props.actions.setUnreadFilterEnabled(!unreadFilterEnabled); - } + }; render() { const {intl, unreadFilterEnabled, hasMultipleTeams} = this.props; diff --git a/webapp/channels/src/components/sidebar/channel_navigator/channel_navigator.tsx b/webapp/channels/src/components/sidebar/channel_navigator/channel_navigator.tsx index 81a60d69a6..34f1f94b9e 100644 --- a/webapp/channels/src/components/sidebar/channel_navigator/channel_navigator.tsx +++ b/webapp/channels/src/components/sidebar/channel_navigator/channel_navigator.tsx @@ -59,7 +59,7 @@ export default class ChannelNavigator extends React.PureComponent { modalId: ModalIdentifiers.QUICK_SWITCH, dialogType: QuickSwitchModal, }); - } + }; handleShortcut = (e: KeyboardEvent) => { const {actions: {closeModal}} = this.props; @@ -83,7 +83,7 @@ export default class ChannelNavigator extends React.PureComponent { this.toggleQuickSwitchModal(); } } - } + }; toggleQuickSwitchModal = () => { const {isQuickSwitcherOpen, actions: {openModal, closeModal}} = this.props; @@ -96,17 +96,17 @@ export default class ChannelNavigator extends React.PureComponent { dialogType: QuickSwitchModal, }); } - } + }; goBack = () => { trackEvent('ui', 'ui_history_back'); this.props.actions.goBack(); - } + }; goForward = () => { trackEvent('ui', 'ui_history_forward'); this.props.actions.goForward(); - } + }; render() { return ( diff --git a/webapp/channels/src/components/sidebar/mobile_sidebar_header/contents/contents.tsx b/webapp/channels/src/components/sidebar/mobile_sidebar_header/contents/contents.tsx index ff87f6a42b..9fc2c34b4b 100644 --- a/webapp/channels/src/components/sidebar/mobile_sidebar_header/contents/contents.tsx +++ b/webapp/channels/src/components/sidebar/mobile_sidebar_header/contents/contents.tsx @@ -49,7 +49,7 @@ export default class Contents extends React.PureComponent { dialogType: CustomStatusModal, }; this.props.actions.openModal(customStatusInputModalData); - } + }; render() { if (!this.props.currentUser) { diff --git a/webapp/channels/src/components/sidebar/sidebar.tsx b/webapp/channels/src/components/sidebar/sidebar.tsx index aee0b1d28e..6473d9607c 100644 --- a/webapp/channels/src/components/sidebar/sidebar.tsx +++ b/webapp/channels/src/components/sidebar/sidebar.tsx @@ -95,7 +95,7 @@ export default class Sidebar extends React.PureComponent { } this.props.actions.clearChannelSelection(); - } + }; handleKeyDownEvent = (event: KeyboardEvent) => { if (Utils.isKeyPressed(event, Constants.KeyCodes.ESCAPE)) { @@ -128,16 +128,16 @@ export default class Sidebar extends React.PureComponent { }); } } - } + }; showMoreDirectChannelsModal = () => { this.setState({showDirectChannelsModal: true}); trackEvent('ui', 'ui_channels_more_direct_v2'); - } + }; hideMoreDirectChannelsModal = () => { this.setState({showDirectChannelsModal: false}); - } + }; showCreateCategoryModal = () => { this.props.actions.openModal({ @@ -145,11 +145,11 @@ export default class Sidebar extends React.PureComponent { dialogType: EditCategoryModal, }); trackEvent('ui', 'ui_sidebar_menu_createCategory'); - } + }; handleCreateCategory = (categoryName: string) => { this.props.actions.createCategory(this.props.teamId, categoryName); - } + }; showMoreChannelsModal = () => { this.props.actions.openModal({ @@ -158,7 +158,7 @@ export default class Sidebar extends React.PureComponent { dialogProps: {morePublicChannelsModalType: 'public'}, }); trackEvent('ui', 'ui_channels_more_public_v2'); - } + }; invitePeopleModal = () => { this.props.actions.openModal({ @@ -166,7 +166,7 @@ export default class Sidebar extends React.PureComponent { dialogType: InvitationModal, }); trackEvent('ui', 'ui_channels_dropdown_invite_people'); - } + }; showNewChannelModal = () => { this.props.actions.openModal({ @@ -175,7 +175,7 @@ export default class Sidebar extends React.PureComponent { }); this.closeEditRHS(); trackEvent('ui', 'ui_channels_create_channel_v2'); - } + }; showCreateUserGroupModal = () => { this.props.actions.openModal({ @@ -183,7 +183,7 @@ export default class Sidebar extends React.PureComponent { dialogType: CreateUserGroupsModal, }); trackEvent('ui', 'ui_channels_create_user_group'); - } + }; handleOpenMoreDirectChannelsModal = (e: Event) => { e.preventDefault(); @@ -193,15 +193,15 @@ export default class Sidebar extends React.PureComponent { this.showMoreDirectChannelsModal(); this.closeEditRHS(); } - } + }; onDragStart = () => { this.setState({isDragging: true}); - } + }; onDragEnd = () => { this.setState({isDragging: false}); - } + }; renderModals = () => { let moreDirectChannelsModal; @@ -219,7 +219,7 @@ export default class Sidebar extends React.PureComponent { {moreDirectChannelsModal} ); - } + }; closeEditRHS = () => { if (this.props.rhsOpen && this.props.rhsState === RHSStates.EDIT_HISTORY) { diff --git a/webapp/channels/src/components/sidebar/sidebar_category/sidebar_category.tsx b/webapp/channels/src/components/sidebar/sidebar_category/sidebar_category.tsx index c770a146f6..579341205f 100644 --- a/webapp/channels/src/components/sidebar/sidebar_category/sidebar_category.tsx +++ b/webapp/channels/src/components/sidebar/sidebar_category/sidebar_category.tsx @@ -94,19 +94,19 @@ export default class SidebarCategory extends React.PureComponent { this.categoryTitleRef.current?.addEventListener('keydown', this.handleA11yKeyDown); this.a11yKeyDownRegistered = true; - } + }; handleA11yDeactivateEvent = () => { this.categoryTitleRef.current?.removeEventListener('keydown', this.handleA11yKeyDown); this.a11yKeyDownRegistered = false; - } + }; handleA11yKeyDown = (e: KeyboardEvent['nativeEvent']) => { if (isKeyPressed(e, Constants.KeyCodes.ENTER)) { this.handleCollapse(); } - } + }; renderChannel = (channelId: string, index: number) => { const {setChannelRef, category, draggingState} = this.props; @@ -122,7 +122,7 @@ export default class SidebarCategory extends React.PureComponent { isAutoSortedCategory={category.sorting === CategorySorting.Alphabetical || category.sorting === CategorySorting.Recency} /> ); - } + }; handleCollapse = () => { const {category} = this.props; @@ -134,20 +134,20 @@ export default class SidebarCategory extends React.PureComponent { } this.props.actions.setCategoryCollapsed(category.id, !category.collapsed); - } + }; removeAnimation = () => { if (this.newDropBoxRef.current) { this.newDropBoxRef.current.classList.remove('animating'); } - } + }; handleOpenDirectMessagesModal = (event: MouseEvent | KeyboardEvent) => { event.preventDefault(); this.props.handleOpenMoreDirectChannelsModal(event.nativeEvent); trackEvent('ui', 'ui_sidebar_create_direct_message'); - } + }; isDropDisabled = () => { const {draggingState, category} = this.props; @@ -159,7 +159,7 @@ export default class SidebarCategory extends React.PureComponent { } return false; - } + }; renderNewDropBox = (isDraggingOver: boolean) => { const {draggingState, category, isNewCategory, channelIds} = this.props; @@ -210,7 +210,7 @@ export default class SidebarCategory extends React.PureComponent { ); - } + }; showPlaceholder = () => { const {channelIds, draggingState, category, isNewCategory} = this.props; @@ -227,7 +227,7 @@ export default class SidebarCategory extends React.PureComponent { } return true; - } + }; render() { const { diff --git a/webapp/channels/src/components/sidebar/sidebar_channel/sidebar_base_channel/sidebar_base_channel.tsx b/webapp/channels/src/components/sidebar/sidebar_channel/sidebar_base_channel/sidebar_base_channel.tsx index 122655c6c7..237f969092 100644 --- a/webapp/channels/src/components/sidebar/sidebar_channel/sidebar_base_channel/sidebar_base_channel.tsx +++ b/webapp/channels/src/components/sidebar/sidebar_channel/sidebar_base_channel/sidebar_base_channel.tsx @@ -25,13 +25,13 @@ export default class SidebarBaseChannel extends React.PureComponent { this.props.actions.leaveChannel(this.props.channel.id); trackEvent('ui', 'ui_public_channel_x_button_clicked'); callback(); - } + }; handleLeavePrivateChannel = (callback: () => void) => { this.props.actions.openModal({modalId: ModalIdentifiers.LEAVE_PRIVATE_CHANNEL_MODAL, dialogType: LeaveChannelModal, dialogProps: {channel: this.props.channel}}); trackEvent('ui', 'ui_private_channel_x_button_clicked'); callback(); - } + }; getChannelLeaveHandler = () => { const {channel} = this.props; @@ -43,7 +43,7 @@ export default class SidebarBaseChannel extends React.PureComponent { } return null; - } + }; getIcon = () => { const {channel} = this.props; @@ -67,7 +67,7 @@ export default class SidebarBaseChannel extends React.PureComponent { } return null; - } + }; render() { const {channel, currentTeamName} = this.props; diff --git a/webapp/channels/src/components/sidebar/sidebar_channel/sidebar_channel_link/sidebar_channel_link.tsx b/webapp/channels/src/components/sidebar/sidebar_channel/sidebar_channel_link/sidebar_channel_link.tsx index 0c8b58b8de..471d4aa329 100644 --- a/webapp/channels/src/components/sidebar/sidebar_channel/sidebar_channel_link/sidebar_channel_link.tsx +++ b/webapp/channels/src/components/sidebar/sidebar_channel/sidebar_channel_link/sidebar_channel_link.tsx @@ -109,7 +109,7 @@ export default class SidebarChannelLink extends React.PureComponent { const {label, ariaLabelPrefix, unreadMentions} = this.props; @@ -131,7 +131,7 @@ export default class SidebarChannelLink extends React.PureComponent this.gmItemRef.current?.removeAttribute?.('aria-describedby'); @@ -147,7 +147,7 @@ export default class SidebarChannelLink extends React.PureComponent { trackEvent('ui', 'ui_channel_selected_v2'); }, 0); - } + }; handleSelectChannel = (event: React.MouseEvent): void => { if (event.defaultPrevented || event.button !== 0) { @@ -166,11 +166,11 @@ export default class SidebarChannelLink extends React.PureComponent { this.setState({isMenuOpen}); - } + }; render(): JSX.Element { const { diff --git a/webapp/channels/src/components/sidebar/sidebar_channel/sidebar_direct_channel/sidebar_direct_channel.tsx b/webapp/channels/src/components/sidebar/sidebar_channel/sidebar_direct_channel/sidebar_direct_channel.tsx index 64bf839a89..aa34b429a5 100644 --- a/webapp/channels/src/components/sidebar/sidebar_channel/sidebar_direct_channel/sidebar_direct_channel.tsx +++ b/webapp/channels/src/components/sidebar/sidebar_channel/sidebar_direct_channel/sidebar_direct_channel.tsx @@ -45,7 +45,7 @@ class SidebarDirectChannel extends React.PureComponent { if (this.props.active) { getHistory().push(`/${this.props.currentTeamName}/channels/${this.props.redirectChannel}`); } - } + }; getIcon = () => { const {channel, teammate} = this.props; @@ -79,7 +79,7 @@ class SidebarDirectChannel extends React.PureComponent { statusClass={`DirectChannel__status-icon ${className}`} /> ); - } + }; render() { const {channel, teammate, currentTeamName} = this.props; diff --git a/webapp/channels/src/components/sidebar/sidebar_channel/sidebar_group_channel/sidebar_group_channel.tsx b/webapp/channels/src/components/sidebar/sidebar_channel/sidebar_group_channel/sidebar_group_channel.tsx index df23d0fe21..219968716d 100644 --- a/webapp/channels/src/components/sidebar/sidebar_channel/sidebar_group_channel/sidebar_group_channel.tsx +++ b/webapp/channels/src/components/sidebar/sidebar_channel/sidebar_group_channel/sidebar_group_channel.tsx @@ -39,13 +39,13 @@ export default class SidebarGroupChannel extends React.PureComponent { return (
{this.props.membersCount}
); - } + }; render() { const {channel, currentTeamName} = this.props; diff --git a/webapp/channels/src/components/sidebar/sidebar_list/sidebar_list.tsx b/webapp/channels/src/components/sidebar/sidebar_list/sidebar_list.tsx index 88b5fd989f..e07152ce42 100644 --- a/webapp/channels/src/components/sidebar/sidebar_list/sidebar_list.tsx +++ b/webapp/channels/src/components/sidebar/sidebar_list/sidebar_list.tsx @@ -178,11 +178,11 @@ export default class SidebarList extends React.PureComponent { getDisplayedChannelIds = () => { return this.props.displayedChannels.map((channel) => channel.id); - } + }; getDisplayedStaticPageIds = () => { return this.props.staticPages.map((item) => item.id); - } + }; setChannelRef = (channelId: string, ref: HTMLLIElement) => { if (ref) { @@ -190,26 +190,26 @@ export default class SidebarList extends React.PureComponent { } else { this.channelRefs.delete(channelId); } - } + }; getFirstUnreadChannelFromChannelIdArray = (channelIds: string[]) => { return channelIds.find((channelId) => { return channelId !== this.props.currentChannelId && this.props.unreadChannelIds.includes(channelId); }); - } + }; handleScrollAnimationUpdate = (spring: Spring) => { const val = spring.getCurrentValue(); this.scrollbar.current!.scrollTop(val); - } + }; scrollToFirstUnreadChannel = () => { this.scrollToChannel(this.getFirstUnreadChannel(), true); - } + }; scrollToLastUnreadChannel = () => { this.scrollToChannel(this.getLastUnreadChannel(), true); - } + }; scrollToChannel = (channelId: string | null | undefined, scrollingToUnread = false) => { if (!channelId) { @@ -248,14 +248,14 @@ export default class SidebarList extends React.PureComponent { this.scrollToPosition(scrollEnd); } - } + }; scrollToPosition = (scrollEnd: number) => { // Stop the current animation before scrolling this.scrollAnimation.setCurrentValue(this.scrollbar.current!.getScrollTop()).setAtRest(); this.scrollAnimation.setEndValue(scrollEnd); - } + }; updateUnreadIndicators = () => { if (this.props.draggingState.state) { @@ -295,15 +295,15 @@ export default class SidebarList extends React.PureComponent { showBottomUnread, }); } - } + }; getFirstUnreadChannel = () => { return this.getFirstUnreadChannelFromChannelIdArray(this.getDisplayedChannelIds()); - } + }; getLastUnreadChannel = () => { return this.getFirstUnreadChannelFromChannelIdArray(this.getDisplayedChannelIds().reverse()); - } + }; navigateById = (id: string) => { if (this.props.staticPages.findIndex((i) => i.id === id) === -1) { @@ -311,7 +311,7 @@ export default class SidebarList extends React.PureComponent { } else { this.props.actions.switchToLhsStaticPage(id); } - } + }; navigateChannelShortcut = (e: KeyboardEvent) => { if (e.altKey && !e.shiftKey && !e.ctrlKey && !e.metaKey && (Utils.isKeyPressed(e, Constants.KeyCodes.UP) || Utils.isKeyPressed(e, Constants.KeyCodes.DOWN))) { @@ -388,7 +388,7 @@ export default class SidebarList extends React.PureComponent { isNewCategory={this.props.newCategoryIds.includes(category.id)} /> ); - } + }; onScroll = debounce(() => { this.updateUnreadIndicators(); @@ -429,11 +429,11 @@ export default class SidebarList extends React.PureComponent { } this.props.actions.setDraggingState(draggingState); - } + }; onBeforeDragStart = () => { this.props.actions.setDraggingState({state: DraggingStates.BEFORE}); - } + }; onDragStart = (initial: DragStart) => { this.props.onDragStart(initial); @@ -443,7 +443,7 @@ export default class SidebarList extends React.PureComponent { // Re-enable scroll box resizing const droppable = [...document.querySelectorAll('[data-rbd-droppable-id*="droppable-categories"]')]; droppable[0].style.height = ''; - } + }; onDragEnd = (result: DropResult) => { this.props.onDragEnd(result); @@ -459,7 +459,7 @@ export default class SidebarList extends React.PureComponent { } this.props.actions.stopDragging(); - } + }; render() { const {categories} = this.props; diff --git a/webapp/channels/src/components/sidebar_right/sidebar_right.tsx b/webapp/channels/src/components/sidebar_right/sidebar_right.tsx index 6b25387a3c..69dbab0702 100644 --- a/webapp/channels/src/components/sidebar_right/sidebar_right.tsx +++ b/webapp/channels/src/components/sidebar_right/sidebar_right.tsx @@ -92,7 +92,7 @@ export default class SidebarRight extends React.PureComponent { selectedPostCardId: this.props.selectedPostCardId, previousRhsState: this.props.previousRhsState, }; - } + }; handleShortcut = (e: KeyboardEvent) => { const channelInfoShortcutMac = isMac() && e.shiftKey; @@ -126,7 +126,7 @@ export default class SidebarRight extends React.PureComponent { } } } - } + }; componentDidMount() { document.addEventListener('keydown', this.handleShortcut); @@ -187,16 +187,16 @@ export default class SidebarRight extends React.PureComponent { ) { this.props.actions.setRhsExpanded(false); } - } + }; handleUpdateSearchTerms = (term: string) => { this.props.actions.updateSearchTerms(term); this.focusSearchBar?.(); - } + }; getSearchBarFocus = (focusSearchBar: () => void) => { this.focusSearchBar = focusSearchBar; - } + }; render() { const { diff --git a/webapp/channels/src/components/sidebar_right_menu/sidebar_right_menu.tsx b/webapp/channels/src/components/sidebar_right_menu/sidebar_right_menu.tsx index c4e8fc2293..1081403663 100644 --- a/webapp/channels/src/components/sidebar_right_menu/sidebar_right_menu.tsx +++ b/webapp/channels/src/components/sidebar_right_menu/sidebar_right_menu.tsx @@ -28,7 +28,7 @@ const ANIMATION_DURATION = 500; export default class SidebarRightMenu extends React.PureComponent { handleEmitUserLoggedOutEvent = () => { GlobalActions.emitUserLoggedOutEvent(); - } + }; render() { let siteName = ''; diff --git a/webapp/channels/src/components/single_image_view/single_image_view.tsx b/webapp/channels/src/components/single_image_view/single_image_view.tsx index cc0127c06f..428bdf1444 100644 --- a/webapp/channels/src/components/single_image_view/single_image_view.tsx +++ b/webapp/channels/src/components/single_image_view/single_image_view.tsx @@ -80,7 +80,7 @@ export default class SingleImageView extends React.PureComponent { if (this.mounted) { this.setState({loaded: true}); } - } + }; handleImageClick = (e: React.MouseEvent) => { e.preventDefault(); @@ -94,15 +94,15 @@ export default class SingleImageView extends React.PureComponent { startIndex: 0, }, }); - } + }; toggleEmbedVisibility = () => { this.props.actions.toggleEmbedVisibility(this.props.postId); - } + }; getFilePublicLink = () => { return this.props.actions.getFilePublicLink(this.props.fileInfo.id); - } + }; render() { const {fileInfo, compactDisplay, isInPermalink} = this.props; diff --git a/webapp/channels/src/components/size_aware_image.jsx b/webapp/channels/src/components/size_aware_image.jsx index c6ff2d77a2..b4f705c5f4 100644 --- a/webapp/channels/src/components/size_aware_image.jsx +++ b/webapp/channels/src/components/size_aware_image.jsx @@ -86,7 +86,7 @@ export default class SizeAwareImage extends React.PureComponent { * Prevents display of utility buttons when image in a location that makes them inappropriate */ hideUtilities: PropTypes.bool, - } + }; constructor(props) { super(props); @@ -113,11 +113,11 @@ export default class SizeAwareImage extends React.PureComponent { dimensionsAvailable = (dimensions) => { return dimensions && dimensions.width && dimensions.height; - } + }; isSmallImage = (width, height) => { return width < MIN_IMAGE_SIZE || height < MIN_IMAGE_SIZE; - } + }; handleLoad = (event) => { if (this.mounted) { @@ -147,13 +147,13 @@ export default class SizeAwareImage extends React.PureComponent { handleImageClick = (e) => { this.props.onClick?.(e, this.props.src); - } + }; onEnterKeyDown = (e) => { if (e.key === 'Enter') { this.handleImageClick(e); } - } + }; renderImageLoaderIfNeeded = () => { if (!this.state.loaded && this.props.showLoader && !this.state.error) { @@ -166,7 +166,7 @@ export default class SizeAwareImage extends React.PureComponent { ); } return null; - } + }; renderImageWithContainerIfNeeded = () => { const { @@ -369,7 +369,7 @@ export default class SizeAwareImage extends React.PureComponent { {utilityButtonsWrapper} ); - } + }; renderImageOrFallback = () => { const { @@ -437,7 +437,7 @@ export default class SizeAwareImage extends React.PureComponent { ); - } + }; isInternalImage = (this.props.fileInfo !== undefined) && (this.props.fileInfo !== null); @@ -450,7 +450,7 @@ export default class SizeAwareImage extends React.PureComponent { this.timeout = setTimeout(() => { this.setState({linkCopiedRecently: false, linkCopyInProgress: false}); }, 1500); - } + }; copyLinkToAsset = () => { // if linkCopyInProgress is true return @@ -472,7 +472,7 @@ export default class SizeAwareImage extends React.PureComponent { this.startCopyTimer(); }); } - } + }; render() { return ( diff --git a/webapp/channels/src/components/spinner_button.tsx b/webapp/channels/src/components/spinner_button.tsx index 8d748e8c2e..46c35215a4 100644 --- a/webapp/channels/src/components/spinner_button.tsx +++ b/webapp/channels/src/components/spinner_button.tsx @@ -14,7 +14,7 @@ type Props = { export default class SpinnerButton extends PureComponent> { public static defaultProps: Partial = { spinning: false, - } + }; public render(): JSX.Element { const {spinning, spinningText, children, ...props} = this.props; diff --git a/webapp/channels/src/components/status_dropdown/status_dropdown.tsx b/webapp/channels/src/components/status_dropdown/status_dropdown.tsx index 9f5d24e93c..b361ea5c58 100644 --- a/webapp/channels/src/components/status_dropdown/status_dropdown.tsx +++ b/webapp/channels/src/components/status_dropdown/status_dropdown.tsx @@ -82,7 +82,7 @@ export class StatusDropdown extends React.PureComponent { static defaultProps = { userId: '', profilePicture: '', - } + }; constructor(props: Props) { super(props); @@ -100,7 +100,7 @@ export class StatusDropdown extends React.PureComponent { dialogType: UserSettingsModal, dialogProps: {isContentProductSettings: false}, }); - } + }; setStatus = (status: string, dndEndTime?: number): void => { this.props.actions.setStatus({ @@ -108,26 +108,26 @@ export class StatusDropdown extends React.PureComponent { status, dnd_end_time: dndEndTime, }); - } + }; isUserOutOfOffice = (): boolean => { return this.props.status === UserStatuses.OUT_OF_OFFICE; - } + }; setOnline = (event: Event): void => { event.preventDefault(); this.setStatus(UserStatuses.ONLINE); - } + }; setOffline = (event: Event): void => { event.preventDefault(); this.setStatus(UserStatuses.OFFLINE); - } + }; setAway = (event: Event): void => { event.preventDefault(); this.setStatus(UserStatuses.AWAY); - } + }; setDnd = (index: number): void => { const currentDate = getCurrentMomentForTimezone(this.props.timezone); @@ -152,7 +152,7 @@ export class StatusDropdown extends React.PureComponent { } this.setStatus(UserStatuses.DND, endTime.utc().unix()); - } + }; setCustomTimedDnd = (): void => { const dndCustomTimePicker = { @@ -164,7 +164,7 @@ export class StatusDropdown extends React.PureComponent { }; this.props.actions.openModal(dndCustomTimePicker); - } + }; showStatusChangeConfirmation = (status: string): void => { const resetStatusModalData = { @@ -187,7 +187,7 @@ export class StatusDropdown extends React.PureComponent { tabIndex={undefined} /> ); - } + }; handleClearStatus = (e: React.MouseEvent | React.MouseEvent | React.TouchEvent): void => { e.stopPropagation(); @@ -197,11 +197,11 @@ export class StatusDropdown extends React.PureComponent { handleEmitUserLoggedOutEvent = (): void => { GlobalActions.emitUserLoggedOutEvent(); - } + }; onToggle = (open: boolean): void => { this.props.actions.setStatusDropdown(open); - } + }; handleCompleteYourProfileTask = (): void => { const taskName = OnboardingTasksName.COMPLETE_YOUR_PROFILE; @@ -216,7 +216,7 @@ export class StatusDropdown extends React.PureComponent { }, ]; this.props.actions.savePreferences(currentUserId, preferences); - } + }; handleCustomStatusEmojiClick = (event: React.MouseEvent): void => { event.stopPropagation(); @@ -225,7 +225,7 @@ export class StatusDropdown extends React.PureComponent { dialogType: CustomStatusModal, }; this.props.actions.openModal(customStatusInputModalData); - } + }; renderCustomStatus = (isStatusSet: boolean | undefined): ReactNode => { if (!this.props.isCustomStatusEnabled) { @@ -338,7 +338,7 @@ export class StatusDropdown extends React.PureComponent { ); - } + }; render = (): JSX.Element => { const {intl} = this.props; @@ -604,6 +604,6 @@ export class StatusDropdown extends React.PureComponent { ); - } + }; } export default injectIntl(StatusDropdown); diff --git a/webapp/channels/src/components/suggestion/command_provider/app_command_parser/app_command_parser.ts b/webapp/channels/src/components/suggestion/command_provider/app_command_parser/app_command_parser.ts index 5202bf9b56..c91d3df07c 100644 --- a/webapp/channels/src/components/suggestion/command_provider/app_command_parser/app_command_parser.ts +++ b/webapp/channels/src/components/suggestion/command_provider/app_command_parser/app_command_parser.ts @@ -1122,7 +1122,7 @@ export class AppCommandParser { } return suggestions.map((suggestion) => this.decorateSuggestionComplete(parsed, suggestion)); - } + }; getNoMatchingSuggestion = () => { return [{ diff --git a/webapp/channels/src/components/suggestion/modal_suggestion_list.tsx b/webapp/channels/src/components/suggestion/modal_suggestion_list.tsx index 9922f8213e..cc57c0b8b8 100644 --- a/webapp/channels/src/components/suggestion/modal_suggestion_list.tsx +++ b/webapp/channels/src/components/suggestion/modal_suggestion_list.tsx @@ -76,7 +76,7 @@ export default class ModalSuggestionList extends React.PureComponent { const eventTarget = e.target as HTMLElement; @@ -84,7 +84,7 @@ export default class ModalSuggestionList extends React.PureComponent { const inputBounds = this.calculateInputRect(); @@ -148,7 +148,7 @@ export default class ModalSuggestionList extends React.PureComponent { let inputBounds = newInputBounds; @@ -173,7 +173,7 @@ export default class ModalSuggestionList extends React.PureComponent { if (!this.container.current) { @@ -188,7 +188,7 @@ export default class ModalSuggestionList extends React.PureComponent { const dayString = day.toISOString().split('T')[0]; this.props.onClick(dayString, this.props.matchedPretext); - } + }; handleKeyDown = (e: KeyboardEvent) => { if (Utils.isKeyPressed(e, Constants.KeyCodes.DOWN) && document.activeElement?.id === 'searchBox') { @@ -46,13 +46,13 @@ export default class SearchDateSuggestion extends Suggestion { return ( ); - } + }; iconRight = () => { return ( ); - } + }; render() { const locale: string = this.props.locale; diff --git a/webapp/channels/src/components/suggestion/search_suggestion_list.tsx b/webapp/channels/src/components/suggestion/search_suggestion_list.tsx index f976a35acc..c9668f466f 100644 --- a/webapp/channels/src/components/suggestion/search_suggestion_list.tsx +++ b/webapp/channels/src/components/suggestion/search_suggestion_list.tsx @@ -85,7 +85,7 @@ export default class SearchSuggestionList extends SuggestionList { getContent = () => { return this.itemsContainerRef.current?.parentNode; - } + }; renderChannelDivider(type: string) { let text; diff --git a/webapp/channels/src/components/suggestion/suggestion.jsx b/webapp/channels/src/components/suggestion/suggestion.jsx index f4c9247266..2c665d3cc3 100644 --- a/webapp/channels/src/components/suggestion/suggestion.jsx +++ b/webapp/channels/src/components/suggestion/suggestion.jsx @@ -28,11 +28,11 @@ export default class Suggestion extends React.PureComponent { e.preventDefault(); this.props.onClick(this.props.term, this.props.matchedPretext); - } + }; handleMouseMove = (e) => { e.preventDefault(); this.props.onMouseMove(this.props.term); - } + }; } diff --git a/webapp/channels/src/components/suggestion/suggestion_box/suggestion_box.jsx b/webapp/channels/src/components/suggestion/suggestion_box/suggestion_box.jsx index cf502775ea..73cc071e88 100644 --- a/webapp/channels/src/components/suggestion/suggestion_box/suggestion_box.jsx +++ b/webapp/channels/src/components/suggestion/suggestion_box/suggestion_box.jsx @@ -163,7 +163,7 @@ export default class SuggestionBox extends React.PureComponent { actions: PropTypes.shape({ addMessageIntoHistory: PropTypes.func.isRequired, }).isRequired, - } + }; static defaultProps = { listPosition: 'top', @@ -180,7 +180,7 @@ export default class SuggestionBox extends React.PureComponent { listenForMentionKeyClick: false, forceSuggestionsWhenBlur: false, alignWithTextbox: false, - } + }; constructor(props) { super(props); @@ -261,7 +261,7 @@ export default class SuggestionBox extends React.PureComponent { } this.addTextAtCaret(insertText, ''); - } + }; getTextbox = () => { if (!this.inputRef.current) { @@ -269,17 +269,17 @@ export default class SuggestionBox extends React.PureComponent { } return this.inputRef.current; - } + }; handleEmitClearSuggestions = (delay = 0) => { setTimeout(() => { this.clear(); }, delay); - } + }; preventSuggestionListClose = () => { this.preventSuggestionListCloseFlag = true; - } + }; handleFocusOut = (e) => { if (this.preventSuggestionListCloseFlag) { @@ -351,14 +351,14 @@ export default class SuggestionBox extends React.PureComponent { if (this.props.onChange) { this.props.onChange(e); } - } + }; handleCompositionStart = () => { this.composing = true; if (this.props.onComposition) { this.props.onComposition(); } - } + }; handleCompositionUpdate = (e) => { if (!e.data) { @@ -373,14 +373,14 @@ export default class SuggestionBox extends React.PureComponent { if (this.props.onComposition) { this.props.onComposition(); } - } + }; handleCompositionEnd = () => { this.composing = false; if (this.props.onComposition) { this.props.onComposition(); } - } + }; addTextAtCaret = (term, matchedPretext) => { const textbox = this.getTextbox(); @@ -428,7 +428,7 @@ export default class SuggestionBox extends React.PureComponent { Utils.setCaretPosition(textbox, prefix.length + term.length + 1); } }); - } + }; replaceText = (term) => { const textbox = this.getTextbox(); @@ -443,7 +443,7 @@ export default class SuggestionBox extends React.PureComponent { // don't call handleChange or we'll get into an event loop this.props.onChange(e); } - } + }; handleCompleteWord = (term, matchedPretext, e) => { let fixedTerm = term; @@ -517,15 +517,15 @@ export default class SuggestionBox extends React.PureComponent { } } return false; - } + }; selectNext = () => { this.setSelectionByDelta(1); - } + }; selectPrevious = () => { this.setSelectionByDelta(-1); - } + }; setSelectionByDelta = (delta) => { let selectionIndex = this.state.terms.indexOf(this.state.selection); @@ -549,7 +549,7 @@ export default class SuggestionBox extends React.PureComponent { selection: this.state.terms[selectionIndex], selectionIndex, }); - } + }; setSelection = (term) => { const selectionIndex = this.state.terms.indexOf(this.state.selection); @@ -558,7 +558,7 @@ export default class SuggestionBox extends React.PureComponent { selection: term, selectionIndex, }); - } + }; clear = () => { if (!this.state.cleared) { @@ -573,11 +573,11 @@ export default class SuggestionBox extends React.PureComponent { }); this.handlePretextChanged(''); } - } + }; hasSuggestions = () => { return this.state.items.some((item) => !item.loading); - } + }; handleKeyDown = (e) => { if ((this.props.openWhenEmpty || this.props.value) && this.hasSuggestions()) { @@ -621,13 +621,13 @@ export default class SuggestionBox extends React.PureComponent { } else if (this.props.onKeyDown) { this.props.onKeyDown(e); } - } + }; handleSelect = (e) => { if (this.props.onSelect) { this.props.onSelect(e); } - } + }; focusInputOnEscape = () => { if (this.inputRef.current) { @@ -640,7 +640,7 @@ export default class SuggestionBox extends React.PureComponent { }, )); } - } + }; handleReceivedSuggestions = (suggestions) => { let newComponents = []; @@ -680,14 +680,14 @@ export default class SuggestionBox extends React.PureComponent { }); return {selection, matchedPretext: suggestions.matchedPretext}; - } + }; handleReceivedSuggestionsAndComplete = (suggestions) => { const {selection, matchedPretext} = this.handleReceivedSuggestions(suggestions); if (selection) { this.handleCompleteWord(selection, matchedPretext); } - } + }; nonDebouncedPretextChanged = (pretext, complete = false) => { const {alignWithTextbox} = this.props; @@ -723,7 +723,7 @@ export default class SuggestionBox extends React.PureComponent { if (!handled) { this.clear(); } - } + }; debouncedPretextChanged = (pretext) => { clearTimeout(this.timeoutId); @@ -733,11 +733,11 @@ export default class SuggestionBox extends React.PureComponent { handlePretextChanged = (pretext) => { this.pretext = pretext; this.debouncedPretextChanged(pretext); - } + }; blur = () => { this.inputRef.current.blur(); - } + }; focus = () => { const input = this.inputRef.current; @@ -750,7 +750,7 @@ export default class SuggestionBox extends React.PureComponent { input.focus(); this.handleChange({target: this.inputRef.current}); - } + }; setContainerRef = (container) => { // Attach/detach event listeners that aren't supported by React @@ -774,7 +774,7 @@ export default class SuggestionBox extends React.PureComponent { } return listPosition === 'bottom' && this.state.suggestionBoxAlgn.placementShift ? 'top' : listPosition; - } + }; render() { const { diff --git a/webapp/channels/src/components/suggestion/suggestion_list.jsx b/webapp/channels/src/components/suggestion/suggestion_list.jsx index ec4e500fdb..1d62c11db1 100644 --- a/webapp/channels/src/components/suggestion/suggestion_list.jsx +++ b/webapp/channels/src/components/suggestion/suggestion_list.jsx @@ -89,7 +89,7 @@ export default class SuggestionList extends React.PureComponent { if (this.contentRef.current) { this.contentRef.current.style['max-height'] = this.maxHeight; } - } + }; announceLabel() { const suggestionReadOut = this.props.ariaLiveRef.current; @@ -129,7 +129,7 @@ export default class SuggestionList extends React.PureComponent { getContent = () => { return this.contentRef.current; - } + }; scrollToItem = (term) => { const content = this.getContent(); @@ -162,7 +162,7 @@ export default class SuggestionList extends React.PureComponent { content.scrollTop = (itemBottom - visibleContentHeight) + contentTopPadding + contentBottomPadding; } } - } + }; getComputedCssProperty(element, property) { return parseInt(getComputedStyle(element)[property], 10); diff --git a/webapp/channels/src/components/system_notice/system_notice.tsx b/webapp/channels/src/components/system_notice/system_notice.tsx index 4c9135eac1..c19be505c8 100644 --- a/webapp/channels/src/components/system_notice/system_notice.tsx +++ b/webapp/channels/src/components/system_notice/system_notice.tsx @@ -68,7 +68,7 @@ export default class SystemNotice extends React.PureComponent { return notice; } return null; - } + }; hide = (remind = false) => { const notice = this.getCurrentNotice(); @@ -86,15 +86,15 @@ export default class SystemNotice extends React.PureComponent { } this.props.actions.dismissNotice(notice.name); - } + }; hideAndRemind = () => { this.hide(true); - } + }; hideAndForget = () => { this.hide(false); - } + }; render() { const notice = this.getCurrentNotice(); diff --git a/webapp/channels/src/components/team_general_tab/team_general_tab.tsx b/webapp/channels/src/components/team_general_tab/team_general_tab.tsx index f48695a6a8..8a72f36f45 100644 --- a/webapp/channels/src/components/team_general_tab/team_general_tab.tsx +++ b/webapp/channels/src/components/team_general_tab/team_general_tab.tsx @@ -47,7 +47,7 @@ export default class GeneralTab extends React.PureComponent { updateSection = (section: string) => { this.setState(this.setupInitialState(this.props)); this.props.updateSection(section); - } + }; setupInitialState(props: Props) { const team = props.team; @@ -118,7 +118,7 @@ export default class GeneralTab extends React.PureComponent { } else { this.updateSection(''); } - } + }; handleNameSubmit = async () => { const state: Pick = {serverError: '', clientError: ''}; @@ -163,7 +163,7 @@ export default class GeneralTab extends React.PureComponent { } else { this.updateSection(''); } - } + }; handleInviteIdSubmit = async () => { const state = {serverError: '', clientError: ''}; @@ -177,7 +177,7 @@ export default class GeneralTab extends React.PureComponent { } else { this.updateSection(''); } - } + }; handleClose = () => this.updateSection(''); @@ -210,7 +210,7 @@ export default class GeneralTab extends React.PureComponent { } else { this.updateSection(''); } - } + }; handleTeamIconSubmit = async () => { if (!this.state.teamIconFile || !this.state.submitActive) { @@ -237,7 +237,7 @@ export default class GeneralTab extends React.PureComponent { }); this.updateSection(''); } - } + }; handleTeamIconRemove = async () => { this.setState({ @@ -260,7 +260,7 @@ export default class GeneralTab extends React.PureComponent { }); this.updateSection(''); } - } + }; componentDidMount() { document.getElementById('team_settings')?.addEventListener('hidden.bs.modal', this.handleClose); @@ -281,7 +281,7 @@ export default class GeneralTab extends React.PureComponent { } this.updateSection(section); - } + }; updateName = (e: ChangeEvent) => this.setState({name: e.target.value}); @@ -312,7 +312,7 @@ export default class GeneralTab extends React.PureComponent { clientError: localizeMessage('general_tab.teamIconError', 'An error occurred while selecting the image.'), }); } - } + }; updateAllowedDomains = (e: ChangeEvent) => this.setState({allowed_domains: e.target.value}); diff --git a/webapp/channels/src/components/team_members_dropdown/team_members_dropdown.tsx b/webapp/channels/src/components/team_members_dropdown/team_members_dropdown.tsx index 329035ad8a..b6388dc35e 100644 --- a/webapp/channels/src/components/team_members_dropdown/team_members_dropdown.tsx +++ b/webapp/channels/src/components/team_members_dropdown/team_members_dropdown.tsx @@ -78,14 +78,14 @@ export default class TeamMembersDropdown extends React.PureComponent { const {error} = await this.props.actions.removeUserFromTeamAndGetStats(this.props.teamMember.team_id, this.props.user.id); if (error) { this.setState({serverError: error.message}); } - } + }; private handleMakeAdmin = async () => { const me = this.props.currentUser; @@ -100,7 +100,7 @@ export default class TeamMembersDropdown extends React.PureComponent { this.setState({ @@ -109,7 +109,7 @@ export default class TeamMembersDropdown extends React.PureComponent { this.setState({ @@ -118,7 +118,7 @@ export default class TeamMembersDropdown extends React.PureComponent { const {error} = await this.props.actions.updateTeamMemberSchemeRoles(this.props.teamMember.team_id, this.props.user.id, true, false); @@ -128,7 +128,7 @@ export default class TeamMembersDropdown extends React.PureComponent handleHide = () => { this.setState({show: false}); - } + }; handleInvitePeople = () => { const {actions} = this.props; @@ -58,7 +58,7 @@ export default class TeamMembersModal extends React.PureComponent }); this.handleHide(); - } + }; render() { let teamDisplayName = ''; diff --git a/webapp/channels/src/components/team_selector_modal/team_selector_modal.tsx b/webapp/channels/src/components/team_selector_modal/team_selector_modal.tsx index 8f260fe491..ff5f5ca0cd 100644 --- a/webapp/channels/src/components/team_selector_modal/team_selector_modal.tsx +++ b/webapp/channels/src/components/team_selector_modal/team_selector_modal.tsx @@ -100,13 +100,13 @@ export default class TeamSelectorModal extends React.PureComponent handleHide = () => { this.props.actions.setModalSearchTerm(''); this.setState({show: false}); - } + }; handleExit = () => { if (this.props.onModalDismissed) { this.props.onModalDismissed(); } - } + }; handleSubmit = (e: Event | TeamValue[] | undefined) => { if (e) { @@ -119,7 +119,7 @@ export default class TeamSelectorModal extends React.PureComponent this.props.onTeamsSelected?.(this.state.values); this.handleHide(); - } + }; addValue = (value: TeamValue, confirmed = false) => { if (this.props.modalID === ModalIdentifiers.ADD_TEAMS_TO_SCHEME && value.scheme_id !== null && value.scheme_id !== '' && !confirmed) { @@ -133,13 +133,13 @@ export default class TeamSelectorModal extends React.PureComponent } this.setState({values, confirmAddModal: false, confirmAddTeam: null}); - } + }; setTeamsLoadingState = (loadingState: boolean) => { this.setState({ loadingTeams: loadingState, }); - } + }; handlePageChange = (page: number, prevPage: number) => { if (page > prevPage) { @@ -148,18 +148,18 @@ export default class TeamSelectorModal extends React.PureComponent this.setTeamsLoadingState(false); }); } - } + }; handleDelete = (values: TeamValue[]) => { this.setState({values}); - } + }; search = (term: string, multiselectComponent: { state: { page: number }; setState: (arg0: { page: number }) => void }) => { if (multiselectComponent.state.page !== 0) { multiselectComponent.setState({page: 0}); } this.props.actions.setModalSearchTerm(term); - } + }; renderOption = (option: TeamValue, isSelected: boolean, onAdd: (value: TeamValue) => void, onMouseMove: (value: TeamValue) => void) => { let rowSelected = ''; @@ -195,7 +195,7 @@ export default class TeamSelectorModal extends React.PureComponent ); - } + }; renderValue(props: { data: TeamValue }) { return props.data.display_name; diff --git a/webapp/channels/src/components/team_settings_modal/team_settings_modal.tsx b/webapp/channels/src/components/team_settings_modal/team_settings_modal.tsx index 0c7b7c6826..28c16f64b1 100644 --- a/webapp/channels/src/components/team_settings_modal/team_settings_modal.tsx +++ b/webapp/channels/src/components/team_settings_modal/team_settings_modal.tsx @@ -42,11 +42,11 @@ export default class TeamSettingsModal extends React.PureComponent activeTab: tab, activeSection: '', }); - } + }; updateSection = (section: string) => { this.setState({activeSection: section}); - } + }; collapseModal = () => { const el = ReactDOM.findDOMNode(this.modalBodyRef.current) as HTMLDivElement; @@ -57,11 +57,11 @@ export default class TeamSettingsModal extends React.PureComponent activeTab: '', activeSection: '', }); - } + }; handleHide = () => { this.setState({show: false}); - } + }; // called after the dialog is fully hidden and faded out handleHidden = () => { @@ -70,7 +70,7 @@ export default class TeamSettingsModal extends React.PureComponent activeSection: '', }); this.props.onExited(); - } + }; render() { const tabs = []; diff --git a/webapp/channels/src/components/team_sidebar/components/team_button.tsx b/webapp/channels/src/components/team_sidebar/components/team_button.tsx index 78f5289678..86b1ad941a 100644 --- a/webapp/channels/src/components/team_sidebar/components/team_button.tsx +++ b/webapp/channels/src/components/team_sidebar/components/team_button.tsx @@ -50,7 +50,7 @@ class TeamButton extends React.PureComponent { setTimeout(() => { trackEvent('ui', 'ui_team_sidebar_switch_team'); }, 0); - } + }; render() { const {teamIconUrl, displayName, btnClass, mentions, unread, isDraggable = false, teamIndex, teamId, order} = this.props; diff --git a/webapp/channels/src/components/team_sidebar/team_sidebar.tsx b/webapp/channels/src/components/team_sidebar/team_sidebar.tsx index c1d31f8a36..cbe9f90113 100644 --- a/webapp/channels/src/components/team_sidebar/team_sidebar.tsx +++ b/webapp/channels/src/components/team_sidebar/team_sidebar.tsx @@ -90,7 +90,7 @@ export default class TeamSidebar extends React.PureComponent { return true; } return false; - } + }; switchToTeamByNumber = (e: KeyboardEvent, currentTeamId: string, teams: Team[]) => { const digits = [ @@ -120,7 +120,7 @@ export default class TeamSidebar extends React.PureComponent { } } return false; - } + }; handleKeyDown = (e: KeyboardEvent) => { if ((e.ctrlKey || e.metaKey) && e.altKey) { @@ -137,13 +137,13 @@ export default class TeamSidebar extends React.PureComponent { this.setState({showOrder: true}); } - } + }; handleKeyUp = (e: KeyboardEvent) => { if (!((e.ctrlKey || e.metaKey) && e.altKey)) { this.setState({showOrder: false}); } - } + }; componentDidMount() { this.props.actions.getTeams(0, 200); @@ -190,7 +190,7 @@ export default class TeamSidebar extends React.PureComponent { ); updateTeamsOrderForUser(newTeamsOrder.map((o: Team) => o.id)); this.setState({teamsOrder: newTeamsOrder}); - } + }; render() { const root: Element | null = document.querySelector('#root'); diff --git a/webapp/channels/src/components/textbox/textbox.tsx b/webapp/channels/src/components/textbox/textbox.tsx index 1ba345a75e..8030eb5e88 100644 --- a/webapp/channels/src/components/textbox/textbox.tsx +++ b/webapp/channels/src/components/textbox/textbox.tsx @@ -133,7 +133,7 @@ export default class Textbox extends React.PureComponent { handleChange = (e: React.ChangeEvent) => { this.props.onChange(e); - } + }; updateSuggestions(prevProps: Props) { if (this.props.channelId !== prevProps.channelId || @@ -210,13 +210,13 @@ export default class Textbox extends React.PureComponent { this.props.handlePostError(null); } } - } + }; // adding in the HTMLDivElement to support event handling in preview state handleKeyDown = (e: KeyboardEvent) => { // since we do only handle the sending when in preview mode this is fine to be casted this.props.onKeyDown?.(e as KeyboardEvent); - } + }; handleSelect = (e: React.SyntheticEvent) => this.props.onSelect?.(e); @@ -228,11 +228,11 @@ export default class Textbox extends React.PureComponent { handleBlur = (e: FocusEvent) => { // since we do only handle the sending when in preview mode this is fine to be casted this.props.onBlur?.(e as FocusEvent); - } + }; getInputBox = () => { return this.message.current?.getTextbox(); - } + }; focus = () => { const textbox = this.getInputBox(); @@ -246,7 +246,7 @@ export default class Textbox extends React.PureComponent { // reset character count warning this.checkMessageLength(textbox.value); } - } + }; blur = () => { this.getInputBox()?.blur(); @@ -254,7 +254,7 @@ export default class Textbox extends React.PureComponent { getStyle = () => { return this.props.preview ? HIDDEN : VISIBLE; - } + }; render() { let preview = null; diff --git a/webapp/channels/src/components/threading/thread_viewer/thread_viewer.tsx b/webapp/channels/src/components/threading/thread_viewer/thread_viewer.tsx index 58ca6b9701..5172de8e0a 100644 --- a/webapp/channels/src/components/threading/thread_viewer/thread_viewer.tsx +++ b/webapp/channels/src/components/threading/thread_viewer/thread_viewer.tsx @@ -177,7 +177,7 @@ export default class ThreadViewer extends React.PureComponent { } this.setState({isLoading: false}); - } + }; private handleCardClick = (post: Post) => { if (!post) { @@ -185,7 +185,7 @@ export default class ThreadViewer extends React.PureComponent { } this.props.actions.selectPostCard(post); - } + }; public render(): JSX.Element { if (this.props.postIds == null || this.props.selected == null || !this.props.channel) { diff --git a/webapp/channels/src/components/threading/virtualized_thread_viewer/virtualized_thread_viewer.tsx b/webapp/channels/src/components/threading/virtualized_thread_viewer/virtualized_thread_viewer.tsx index 4cafae3823..bbd46812e9 100644 --- a/webapp/channels/src/components/threading/virtualized_thread_viewer/virtualized_thread_viewer.tsx +++ b/webapp/channels/src/components/threading/virtualized_thread_viewer/virtualized_thread_viewer.tsx @@ -163,7 +163,7 @@ class ThreadViewerVirtualized extends PureComponent { isMobile, }); } - } + }; initScrollToIndex = (): {index: number; position: string; offset?: number} => { const {highlightedPostId, replyListIds} = this.props; @@ -189,7 +189,7 @@ class ThreadViewerVirtualized extends PureComponent { index: 0, position: 'end', }; - } + }; handleScroll = ({scrollHeight, scrollUpdateWasRequested, scrollOffset, clientHeight}: OnScrollArgs) => { if (scrollHeight <= 0) { @@ -223,7 +223,7 @@ class ThreadViewerVirtualized extends PureComponent { } this.setState(updatedState as State); - } + }; updateFloatingTimestamp = (visibleTopItem: number) => { if (!this.props.replyListIds) { @@ -233,7 +233,7 @@ class ThreadViewerVirtualized extends PureComponent { this.setState({ topRhsPostId: getLatestPostId(this.props.replyListIds.slice(visibleTopItem)), }); - } + }; onItemsRendered = ({ visibleStartIndex, @@ -250,7 +250,7 @@ class ThreadViewerVirtualized extends PureComponent { overscanStartIndex, overscanStopIndex, }); - } + }; getInitialPostIndex = (): number => { let postIndex = 0; @@ -262,7 +262,7 @@ class ThreadViewerVirtualized extends PureComponent { } return postIndex === -1 ? 0 : postIndex; - } + }; handleScrollToFailed = (index: number) => { if (index < 0 || index >= this.props.replyListIds.length) { @@ -277,7 +277,7 @@ class ThreadViewerVirtualized extends PureComponent { if (overscanStopIndex != null && index > overscanStopIndex) { this.scrollToItemCorrection(index, Math.min(overscanStopIndex - 1, this.props.replyListIds.length - 1)); } - } + }; scrollToItemCorrection = (index: number, nearIndex: number) => { // stop after 10 times so we won't end up in an infinite loop @@ -294,21 +294,21 @@ class ThreadViewerVirtualized extends PureComponent { window.requestAnimationFrame(() => { this.scrollToItem(index, 'start'); }); - } + }; scrollToItem = (index: number, position: string, offset?: number) => { if (this.listRef.current) { this.listRef.current.scrollToItem(index, position, offset); } - } + }; scrollToBottom = () => { this.scrollToItem(0, 'end'); - } + }; handleToastDismiss = () => { this.setState({lastViewedBottom: Date.now()}); - } + }; handleToastClick = () => { const index = getNewMessageIndex(this.props.replyListIds); @@ -317,7 +317,7 @@ class ThreadViewerVirtualized extends PureComponent { } else { this.scrollToBottom(); } - } + }; scrollToHighlightedPost = () => { const {highlightedPostId, replyListIds} = this.props; @@ -327,13 +327,13 @@ class ThreadViewerVirtualized extends PureComponent { this.scrollToItem(replyListIds.indexOf(highlightedPostId), 'center'); }); } - } + }; handleScrollStop = () => { if (this.mounted) { this.setState({isScrolling: false}); } - } + }; handleCreateCommentHeightChange = (height: number, maxHeight: number) => { let createCommentHeight = height > maxHeight ? maxHeight : height; @@ -345,7 +345,7 @@ class ThreadViewerVirtualized extends PureComponent { this.scrollToBottom(); } } - } + }; renderRow = ({data, itemId, style}: {data: any; itemId: any; style: any}) => { const index = data.indexOf(itemId); @@ -414,7 +414,7 @@ class ThreadViewerVirtualized extends PureComponent { } return undefined; - } + }; isNewMessagesVisible = (): boolean => { const {visibleStopIndex} = this.state; @@ -423,7 +423,7 @@ class ThreadViewerVirtualized extends PureComponent { return visibleStopIndex < newMessagesSeparatorIndex; } return false; - } + }; renderToast = (width: number) => { const {visibleStopIndex, lastViewedBottom, userScrolledToBottom} = this.state; @@ -442,7 +442,7 @@ class ThreadViewerVirtualized extends PureComponent { onClick={this.handleToastClick} /> ); - } + }; render() { const {isMobile, topRhsPostId} = this.state; diff --git a/webapp/channels/src/components/timestamp/timestamp.tsx b/webapp/channels/src/components/timestamp/timestamp.tsx index 7ee19fb34b..95aca3b88c 100644 --- a/webapp/channels/src/components/timestamp/timestamp.tsx +++ b/webapp/channels/src/components/timestamp/timestamp.tsx @@ -175,7 +175,7 @@ class Timestamp extends PureComponent { second: 'numeric', hourCycle: 'h12', timeZoneName: 'short', - } + }; nextUpdate: ReturnType | null = null; mounted = false; diff --git a/webapp/channels/src/components/toast/toast.tsx b/webapp/channels/src/components/toast/toast.tsx index 5f1cba4f36..f52d1c1334 100644 --- a/webapp/channels/src/components/toast/toast.tsx +++ b/webapp/channels/src/components/toast/toast.tsx @@ -34,7 +34,7 @@ export default class Toast extends React.PureComponent { static defaultProps = { overlayPlacement: 'bottom', jumpDirection: 'down', - } + }; componentDidMount() { this.mounted = true; @@ -48,7 +48,7 @@ export default class Toast extends React.PureComponent { if (typeof this.props.onDismiss == 'function') { this.props.onDismiss(); } - } + }; render() { let toastClass = 'toast'; diff --git a/webapp/channels/src/components/toast_wrapper/toast_wrapper.tsx b/webapp/channels/src/components/toast_wrapper/toast_wrapper.tsx index 37dc19ef08..45f0033ffa 100644 --- a/webapp/channels/src/components/toast_wrapper/toast_wrapper.tsx +++ b/webapp/channels/src/components/toast_wrapper/toast_wrapper.tsx @@ -91,7 +91,7 @@ export class ToastWrapperClass extends React.PureComponent { newMessages = newMessages.filter((id) => rootPosts[id]); } return newMessages.length; - } + }; static getDerivedStateFromProps(props: Props, prevState: State) { let {showUnreadToast, showNewMessagesToast, showMessageHistoryToast, showUnreadWithBottomStartToast} = prevState; @@ -244,7 +244,7 @@ export class ToastWrapperClass extends React.PureComponent { showUnreadToast: false, }); } - } + }; hideArchiveToast = () => { if (this.state.showMessageHistoryToast) { @@ -252,7 +252,7 @@ export class ToastWrapperClass extends React.PureComponent { showMessageHistoryToast: false, }); } - } + }; hideNewMessagesToast = (updateLastViewedBottomAt = true) => { if (this.state.showNewMessagesToast) { @@ -263,13 +263,13 @@ export class ToastWrapperClass extends React.PureComponent { this.props.updateLastViewedBottomAt(); } } - } + }; hideSearchHintToast = () => { if (this.props.onSearchHintDismiss) { this.props.onSearchHintDismiss(); } - } + }; hideUnreadWithBottomStartToast = () => { if (this.state.showUnreadWithBottomStartToast) { @@ -277,7 +277,7 @@ export class ToastWrapperClass extends React.PureComponent { showUnreadWithBottomStartToast: false, }); } - } + }; newMessagesToastText = (count: number | undefined, since: number) => { if (this.props.width > TOAST_TEXT_COLLAPSE_WIDTH && typeof since !== 'undefined') { @@ -306,7 +306,7 @@ export class ToastWrapperClass extends React.PureComponent { values={{count}} /> ); - } + }; archiveToastText = () => { return ( @@ -315,7 +315,7 @@ export class ToastWrapperClass extends React.PureComponent { defaultMessage='Viewing message history' /> ); - } + }; getSearchHintToastText = () => { return ( @@ -327,7 +327,7 @@ export class ToastWrapperClass extends React.PureComponent { }} /> ); - } + }; changeUrlToRemountChannelView = () => { const {match} = this.props; @@ -335,7 +335,7 @@ export class ToastWrapperClass extends React.PureComponent { // Inorder of mount the channel view we are redirecting to /team url to load the channel again // Todo: Can be changed to dispatch if we put focussedPostId in redux state. getHistory().replace(`/${match.params.team}`); - } + }; scrollToNewMessage = () => { const {focusedPostId, atLatestPost, scrollToNewMessage, updateLastViewedBottomAt} = this.props; @@ -351,7 +351,7 @@ export class ToastWrapperClass extends React.PureComponent { scrollToNewMessage(); updateLastViewedBottomAt(); this.hideNewMessagesToast(); - } + }; scrollToLatestMessages = () => { const {focusedPostId, atLatestPost, scrollToLatestMessages} = this.props; @@ -366,12 +366,12 @@ export class ToastWrapperClass extends React.PureComponent { scrollToLatestMessages(); this.hideUnreadToast(); - } + }; scrollToUnreadMessages = () => { this.props.scrollToUnreadMessages(); this.hideUnreadWithBottomStartToast(); - } + }; getToastToRender() { const {atLatestPost, atBottom, width, lastViewedAt, showSearchHintToast} = this.props; diff --git a/webapp/channels/src/components/unarchive_channel_modal/unarchive_channel_modal.tsx b/webapp/channels/src/components/unarchive_channel_modal/unarchive_channel_modal.tsx index d74a19ad8e..91eb65073c 100644 --- a/webapp/channels/src/components/unarchive_channel_modal/unarchive_channel_modal.tsx +++ b/webapp/channels/src/components/unarchive_channel_modal/unarchive_channel_modal.tsx @@ -38,11 +38,11 @@ export default class UnarchiveChannelModal extends React.PureComponent { this.setState({show: false}); - } + }; render(): JSX.Element { return ( diff --git a/webapp/channels/src/components/user_groups_modal/user_groups_modal.tsx b/webapp/channels/src/components/user_groups_modal/user_groups_modal.tsx index a19c53f80b..766b633413 100644 --- a/webapp/channels/src/components/user_groups_modal/user_groups_modal.tsx +++ b/webapp/channels/src/components/user_groups_modal/user_groups_modal.tsx @@ -64,7 +64,7 @@ type State = { export default class UserGroupsModal extends React.PureComponent { divScrollRef: RefObject; - private searchTimeoutId: number + private searchTimeoutId: number; constructor(props: Props) { super(props); @@ -84,7 +84,7 @@ export default class UserGroupsModal extends React.PureComponent { doHide = () => { this.setState({show: false}); - } + }; async componentDidMount() { const { @@ -137,16 +137,16 @@ export default class UserGroupsModal extends React.PureComponent { startLoad = () => { this.setState({loading: true}); - } + }; loadComplete = () => { this.setState({loading: false}); - } + }; handleSearch = (e: React.ChangeEvent) => { const term = e.target.value; this.props.actions.setModalSearchTerm(term); - } + }; scrollGetGroups = debounce( async () => { @@ -186,7 +186,7 @@ export default class UserGroupsModal extends React.PureComponent { this.scrollGetMyGroups(); } } - } + }; getMyGroups = async (page: number) => { const {actions} = this.props; @@ -198,7 +198,7 @@ export default class UserGroupsModal extends React.PureComponent { } this.loadComplete(); this.setState({selectedFilter: 'my'}); - } + }; getGroups = async (page: number) => { const {actions} = this.props; @@ -210,7 +210,7 @@ export default class UserGroupsModal extends React.PureComponent { } this.loadComplete(); this.setState({selectedFilter: 'all'}); - } + }; render() { const groups = this.state.selectedFilter === 'all' ? this.props.groups : this.props.myGroups; diff --git a/webapp/channels/src/components/user_list.tsx b/webapp/channels/src/components/user_list.tsx index 779e1156bc..f363ab069e 100644 --- a/webapp/channels/src/components/user_list.tsx +++ b/webapp/channels/src/components/user_list.tsx @@ -46,7 +46,7 @@ export default class UserList extends React.PureComponent { actions: [], actionProps: {}, rowComponentType: UserListRow, - } + }; containerRef: React.RefObject; constructor(props: Props) { @@ -58,7 +58,7 @@ export default class UserList extends React.PureComponent { if (this.containerRef.current) { this.containerRef.current.scrollTop = 0; } - } + }; render() { const users = this.props.users; diff --git a/webapp/channels/src/components/user_list_row_with_error/user_list_row_with_error.tsx b/webapp/channels/src/components/user_list_row_with_error/user_list_row_with_error.tsx index 0848355885..0469ea5ed4 100644 --- a/webapp/channels/src/components/user_list_row_with_error/user_list_row_with_error.tsx +++ b/webapp/channels/src/components/user_list_row_with_error/user_list_row_with_error.tsx @@ -62,7 +62,7 @@ export default class UserListRowWithError extends React.PureComponent { overwriteImage: '', overwriteName: '', colorize: false, - } + }; hideProfilePopover = (): void => { if (this.overlay) { this.overlay.hide(); } - } + }; setOverlaynRef = (ref: BaseOverlayTrigger): void => { this.overlay = ref; - } + }; render(): React.ReactNode { const { diff --git a/webapp/channels/src/components/user_settings/advanced/join_leave_section/join_leave_section.tsx b/webapp/channels/src/components/user_settings/advanced/join_leave_section/join_leave_section.tsx index ac4a4954a0..5ddf0c6b20 100644 --- a/webapp/channels/src/components/user_settings/advanced/join_leave_section/join_leave_section.tsx +++ b/webapp/channels/src/components/user_settings/advanced/join_leave_section/join_leave_section.tsx @@ -61,7 +61,7 @@ export default class JoinLeaveSection extends React.PureComponent this.setState({joinLeaveState: value}); a11yFocus(e.currentTarget); - } + }; public handleUpdateSection = (section?: string): void => { if (!section) { @@ -69,7 +69,7 @@ export default class JoinLeaveSection extends React.PureComponent } this.props.onUpdateSection(section); - } + }; public handleSubmit = (): void => { const {actions, currentUserId, onUpdateSection} = this.props; @@ -77,7 +77,7 @@ export default class JoinLeaveSection extends React.PureComponent actions.savePreferences(currentUserId, [joinLeavePreference]); onUpdateSection(); - } + }; public render(): React.ReactNode { const {joinLeaveState} = this.state; diff --git a/webapp/channels/src/components/user_settings/advanced/user_settings_advanced.tsx b/webapp/channels/src/components/user_settings/advanced/user_settings_advanced.tsx index b999059462..660ca1e8ae 100644 --- a/webapp/channels/src/components/user_settings/advanced/user_settings_advanced.tsx +++ b/webapp/channels/src/components/user_settings/advanced/user_settings_advanced.tsx @@ -123,7 +123,7 @@ export default class AdvancedSettingsDisplay extends React.PureComponent { const settings = this.state.settings; @@ -131,7 +131,7 @@ export default class AdvancedSettingsDisplay extends React.PureComponent ({...prevState, ...settings})); a11yFocus(e?.currentTarget as HTMLElement); - } + }; toggleFeature = (feature: string, checked: boolean): void => { const {settings} = this.state; @@ -145,7 +145,7 @@ export default class AdvancedSettingsDisplay extends React.PureComponent { const features: string[] = []; @@ -156,7 +156,7 @@ export default class AdvancedSettingsDisplay extends React.PureComponent => { const preferences: PreferenceType[] = []; @@ -177,7 +177,7 @@ export default class AdvancedSettingsDisplay extends React.PureComponent => { const userId = this.props.currentUser.id; @@ -197,19 +197,19 @@ export default class AdvancedSettingsDisplay extends React.PureComponent { this.setState({ showDeactivateAccountModal: true, }); - } + }; handleHideDeactivateAccountModal = (): void => { this.setState({ showDeactivateAccountModal: false, }); - } + }; handleUpdateSection = (section?: string): void => { if (!section) { @@ -217,7 +217,7 @@ export default class AdvancedSettingsDisplay extends React.PureComponent { @@ -251,7 +251,7 @@ export default class AdvancedSettingsDisplay extends React.PureComponent ); - } + }; renderUnreadScrollPositionSection = () => { const active = this.props.activeSection === Preferences.UNREAD_SCROLL_POSITION; @@ -485,7 +485,7 @@ export default class AdvancedSettingsDisplay extends React.PureComponent ); - } + }; renderSyncDraftsSection = () => { const active = this.props.activeSection === AdvancedSections.SYNC_DRAFTS; @@ -572,7 +572,7 @@ export default class AdvancedSettingsDisplay extends React.PureComponent ); - } + }; renderFeatureLabel(feature: string): ReactNode { switch (feature) { @@ -697,7 +697,7 @@ export default class AdvancedSettingsDisplay extends React.PureComponent ); - } + }; renderPreviewFeaturesSection = () => { const serverError = this.state.serverError || null; @@ -770,7 +770,7 @@ export default class AdvancedSettingsDisplay extends React.PureComponent ); - } + }; render() { const ctrlSendSection = this.renderCtrlSendSection(); diff --git a/webapp/channels/src/components/user_settings/display/manage_timezones/manage_timezones.tsx b/webapp/channels/src/components/user_settings/display/manage_timezones/manage_timezones.tsx index 041a5fb5d6..83b61fe8ee 100644 --- a/webapp/channels/src/components/user_settings/display/manage_timezones/manage_timezones.tsx +++ b/webapp/channels/src/components/user_settings/display/manage_timezones/manage_timezones.tsx @@ -64,7 +64,7 @@ export default class ManageTimezones extends React.PureComponent { selectedOption, }); } - } + }; timezoneNotChanged = () => { const { diff --git a/webapp/channels/src/components/user_settings/display/user_settings_display.tsx b/webapp/channels/src/components/user_settings/display/user_settings_display.tsx index 948ca29dd9..045d259ccc 100644 --- a/webapp/channels/src/components/user_settings/display/user_settings_display.tsx +++ b/webapp/channels/src/components/user_settings/display/user_settings_display.tsx @@ -330,19 +330,19 @@ export default class UserSettingsDisplay extends React.PureComponent { this.setState({militaryTime}); - } + }; handleTeammateNameDisplayRadio = (teammateNameDisplay: string) => { this.setState({teammateNameDisplay}); - } + }; handleAvailabilityStatusRadio = (availabilityStatusOnPosts: string) => { this.setState({availabilityStatusOnPosts}); - } + }; handleChannelDisplayModeRadio(channelDisplayMode: string) { this.setState({channelDisplayMode}); @@ -370,11 +370,11 @@ export default class UserSettingsDisplay extends React.PureComponent { this.setState({oneClickReactionsOnPosts}); - } + }; handleClickToReplyRadio = (clickToReply: string) => { this.setState({clickToReply}); - } + }; handleOnChange(e: React.ChangeEvent, display: {[key: string]: any}) { this.setState({...display}); @@ -384,7 +384,7 @@ export default class UserSettingsDisplay extends React.PureComponent { this.updateState(); this.props.updateSection(section); - } + }; updateState = () => { const newState = getDisplayStateFromProps(this.props); @@ -393,7 +393,7 @@ export default class UserSettingsDisplay extends React.PureComponent) => e.stopPropagation(); selectTheme = () => { this.textareaRef.current?.focus(); this.textareaRef.current?.setSelectionRange(0, this.state.copyTheme.length); - } + }; toggleSidebarStyles = (e: MouseEvent) => { e.preventDefault(); this.sidebarStylesHeaderRef.current?.classList.toggle('open'); this.toggleSection(this.sidebarStylesRef.current); - } + }; toggleCenterChannelStyles = (e: MouseEvent) => { e.preventDefault(); this.centerChannelStylesHeaderRef.current?.classList.toggle('open'); this.toggleSection(this.centerChannelStylesRef.current); - } + }; toggleLinkAndButtonStyles = (e: MouseEvent) => { e.preventDefault(); this.linkAndButtonStylesHeaderRef.current?.classList.toggle('open'); this.toggleSection(this.linkAndButtonStylesRef.current); - } + }; toggleSection(node: HTMLElement | null) { if (!node) { @@ -274,13 +274,13 @@ export default class CustomThemeChooser extends React.PureComponent { this.selectTheme(); document.execCommand('copy'); this.showCopySuccess(); - } + }; showCopySuccess = () => { const copySuccess: HTMLElement | null = document.querySelector('.copy-theme-success'); @@ -290,7 +290,7 @@ export default class CustomThemeChooser extends React.PureComponent { this.setState({resendStatus: 'failure'}); } }); - } + }; createEmailResendLink = (email: string) => { return ( @@ -203,7 +203,7 @@ export class UserSettingsGeneralTab extends React.Component {
); - } + }; submitUsername = () => { const user = Object.assign({}, this.props.user); @@ -232,7 +232,7 @@ export class UserSettingsGeneralTab extends React.Component { trackEvent('settings', 'user_settings_update', {field: 'username'}); this.submitUser(user, false); - } + }; submitNickname = () => { const user = Object.assign({}, this.props.user); @@ -248,7 +248,7 @@ export class UserSettingsGeneralTab extends React.Component { trackEvent('settings', 'user_settings_update', {field: 'nickname'}); this.submitUser(user, false); - } + }; submitName = () => { const user = Object.assign({}, this.props.user); @@ -266,7 +266,7 @@ export class UserSettingsGeneralTab extends React.Component { trackEvent('settings', 'user_settings_update', {field: 'fullname'}); this.submitUser(user, false); - } + }; submitEmail = () => { const user = Object.assign({}, this.props.user); @@ -300,7 +300,7 @@ export class UserSettingsGeneralTab extends React.Component { user.password = currentPassword; trackEvent('settings', 'user_settings_update', {field: 'email'}); this.submitUser(user, true); - } + }; submitUser = (user: UserProfile, emailUpdated: boolean) => { const {formatMessage} = this.props.intl; @@ -334,7 +334,7 @@ export class UserSettingsGeneralTab extends React.Component { this.setState({serverError, emailError: '', clientError: '', sectionIsSaving: false}); } }); - } + }; setDefaultProfilePicture = async () => { try { @@ -350,7 +350,7 @@ export class UserSettingsGeneralTab extends React.Component { } this.setState({serverError, emailError: '', clientError: '', sectionIsSaving: false}); } - } + }; submitPicture = () => { if (!this.state.pictureFile) { @@ -387,7 +387,7 @@ export class UserSettingsGeneralTab extends React.Component { this.setState(state); } }); - } + }; submitPosition = () => { const user = Object.assign({}, this.props.user); @@ -403,39 +403,39 @@ export class UserSettingsGeneralTab extends React.Component { trackEvent('settings', 'user_settings_update', {field: 'position'}); this.submitUser(user, false); - } + }; updateUsername = (e: React.ChangeEvent) => { this.setState({username: e.target.value}); - } + }; updateFirstName = (e: React.ChangeEvent) => { this.setState({firstName: e.target.value}); - } + }; updateLastName = (e: React.ChangeEvent) => { this.setState({lastName: e.target.value}); - } + }; updateNickname = (e: React.ChangeEvent) => { this.setState({nickname: e.target.value}); - } + }; updatePosition = (e: React.ChangeEvent) => { this.setState({position: e.target.value}); - } + }; updateEmail = (e: React.ChangeEvent) => { this.setState({email: e.target.value}); - } + }; updateConfirmEmail = (e: React.ChangeEvent) => { this.setState({confirmEmail: e.target.value}); - } + }; updateCurrentPassword = (e: React.ChangeEvent) => { this.setState({currentPassword: e.target.value}); - } + }; updatePicture = (e: React.ChangeEvent) => { if (e.target.files && e.target.files[0]) { @@ -446,13 +446,13 @@ export class UserSettingsGeneralTab extends React.Component { } else { this.setState({pictureFile: null}); } - } + }; updateSection = (section: string) => { this.setState(Object.assign({}, this.setupInitialState(this.props), {clientError: '', serverError: '', emailError: '', sectionIsSaving: false})); this.submitActive = false; this.props.updateSection(section); - } + }; setupInitialState(props: Props) { const user = props.user; @@ -955,7 +955,7 @@ export class UserSettingsGeneralTab extends React.Component { max={max} /> ); - } + }; createNicknameSection = () => { const user = this.props.user; @@ -1067,7 +1067,7 @@ export class UserSettingsGeneralTab extends React.Component { max={max} /> ); - } + }; createUsernameSection = () => { const {formatMessage} = this.props.intl; @@ -1158,7 +1158,7 @@ export class UserSettingsGeneralTab extends React.Component { max={max} /> ); - } + }; createPositionSection = () => { const user = this.props.user; @@ -1271,7 +1271,7 @@ export class UserSettingsGeneralTab extends React.Component { max={max} /> ); - } + }; createPictureSection = () => { const user = this.props.user; @@ -1364,7 +1364,7 @@ export class UserSettingsGeneralTab extends React.Component { max={max} /> ); - } + }; render() { const {formatMessage} = this.props.intl; diff --git a/webapp/channels/src/components/user_settings/import_theme_modal.tsx b/webapp/channels/src/components/user_settings/import_theme_modal.tsx index 98f2d4f216..1b8b1218fe 100644 --- a/webapp/channels/src/components/user_settings/import_theme_modal.tsx +++ b/webapp/channels/src/components/user_settings/import_theme_modal.tsx @@ -32,7 +32,7 @@ class ImportThemeModal extends React.PureComponent { private handleOnHide = () => { this.setState({show: false}); - } + }; private handleSubmit = (e: React.MouseEvent) => { e.preventDefault(); @@ -100,7 +100,7 @@ class ImportThemeModal extends React.PureComponent { this.props.callback?.(theme as Theme); this.handleOnHide(); - } + }; private static isInputValid(text: string) { if (text.length === 0) { @@ -152,7 +152,7 @@ class ImportThemeModal extends React.PureComponent { ), }); } - } + }; render() { return ( diff --git a/webapp/channels/src/components/user_settings/modal/user_settings_modal.tsx b/webapp/channels/src/components/user_settings/modal/user_settings_modal.tsx index 33bafbd40c..1c0fc6f932 100644 --- a/webapp/channels/src/components/user_settings/modal/user_settings_modal.tsx +++ b/webapp/channels/src/components/user_settings/modal/user_settings_modal.tsx @@ -128,7 +128,7 @@ class UserSettingsModal extends React.PureComponent { this.setState({resendStatus: 'failure'}); } }); - } + }; componentDidMount() { document.addEventListener('keydown', this.handleKeyDown); @@ -150,7 +150,7 @@ class UserSettingsModal extends React.PureComponent { e.preventDefault(); this.handleHide(); } - } + }; // Called when the close button is pressed on the main modal handleHide = () => { @@ -162,7 +162,7 @@ class UserSettingsModal extends React.PureComponent { this.setState({ show: false, }); - } + }; // called after the dialog is fully hidden and faded out handleHidden = () => { @@ -171,7 +171,7 @@ class UserSettingsModal extends React.PureComponent { active_section: '', }); this.props.onExited(); - } + }; // Called to hide the settings pane when on mobile handleCollapse = () => { @@ -182,7 +182,7 @@ class UserSettingsModal extends React.PureComponent { active_tab: '', active_section: '', }); - } + }; handleConfirm = () => { this.setState({ @@ -197,7 +197,7 @@ class UserSettingsModal extends React.PureComponent { this.afterConfirm(); this.afterConfirm = null; } - } + }; handleCancelConfirmation = () => { this.setState({ @@ -206,7 +206,7 @@ class UserSettingsModal extends React.PureComponent { }); this.afterConfirm = null; - } + }; showConfirmModal = (afterConfirm: () => void) => { if (afterConfirm) { @@ -222,7 +222,7 @@ class UserSettingsModal extends React.PureComponent { showConfirmModal: true, enforceFocus: false, }); - } + }; // Called by settings tabs when their close button is pressed closeModal = () => { @@ -231,7 +231,7 @@ class UserSettingsModal extends React.PureComponent { } else { this.handleHide(); } - } + }; // Called by settings tabs when their back button is pressed collapseModal = () => { @@ -240,7 +240,7 @@ class UserSettingsModal extends React.PureComponent { } else { this.handleCollapse(); } - } + }; updateTab = (tab?: string, skipConfirm?: boolean) => { if (!skipConfirm && this.requireConfirm) { @@ -251,7 +251,7 @@ class UserSettingsModal extends React.PureComponent { active_section: '', }); } - } + }; updateSection = (section?: string, skipConfirm?: boolean) => { if (!skipConfirm && this.requireConfirm) { @@ -261,7 +261,7 @@ class UserSettingsModal extends React.PureComponent { active_section: section ?? '', }); } - } + }; render() { const {formatMessage} = this.props.intl; diff --git a/webapp/channels/src/components/user_settings/notifications/desktop_notification_setting/desktop_notification_settings.tsx b/webapp/channels/src/components/user_settings/notifications/desktop_notification_setting/desktop_notification_settings.tsx index d8d7f3a6fd..9c0d3eefa2 100644 --- a/webapp/channels/src/components/user_settings/notifications/desktop_notification_setting/desktop_notification_settings.tsx +++ b/webapp/channels/src/components/user_settings/notifications/desktop_notification_setting/desktop_notification_settings.tsx @@ -64,7 +64,7 @@ export default class DesktopNotificationSettings extends React.PureComponent { this.props.updateSection(section); this.props.cancel(); - } + }; handleMaxUpdateSection = (section: string): void => this.props.updateSection(section); @@ -75,12 +75,12 @@ export default class DesktopNotificationSettings extends React.PureComponent): void => { const value = e.target.checked ? NotificationLevels.ALL : NotificationLevels.MENTION; this.props.setParentState('desktopThreads', value); - } + }; setDesktopNotificationSound: ReactSelect['onChange'] = (selectedOption: ValueType): void => { if (selectedOption && 'value' in selectedOption) { @@ -88,7 +88,7 @@ export default class DesktopNotificationSettings extends React.PureComponent ); - } + }; buildMinimizedSetting = () => { let formattedMessageProps; @@ -395,7 +395,7 @@ export default class DesktopNotificationSettings extends React.PureComponent ); - } + }; componentDidUpdate(prevProps: Props) { this.blurDropdown(); diff --git a/webapp/channels/src/components/user_settings/notifications/email_notification_setting/email_notification_setting.tsx b/webapp/channels/src/components/user_settings/notifications/email_notification_setting/email_notification_setting.tsx index c54a46bcd3..685839ca99 100644 --- a/webapp/channels/src/components/user_settings/notifications/email_notification_setting/email_notification_setting.tsx +++ b/webapp/channels/src/components/user_settings/notifications/email_notification_setting/email_notification_setting.tsx @@ -130,12 +130,12 @@ export default class EmailNotificationSetting extends React.PureComponent) => { const value = e.target.checked ? NotificationLevels.ALL : NotificationLevels.MENTION; this.props.setParentState('emailThreads', value); - } + }; handleSubmit = async () => { const {newInterval} = this.state; @@ -155,7 +155,7 @@ export default class EmailNotificationSetting extends React.PureComponent { if (section) { @@ -169,7 +169,7 @@ export default class EmailNotificationSetting extends React.PureComponent { const { @@ -240,7 +240,7 @@ export default class EmailNotificationSetting extends React.PureComponent ); - } + }; renderMaxSettingView = () => { if (!this.props.sendEmailNotifications) { @@ -419,7 +419,7 @@ export default class EmailNotificationSetting extends React.PureComponent ); - } + }; componentDidUpdate(prevProps: Props) { if (prevProps.activeSection === 'email' && this.props.activeSection === '') { diff --git a/webapp/channels/src/components/user_settings/notifications/user_settings_notifications.tsx b/webapp/channels/src/components/user_settings/notifications/user_settings_notifications.tsx index 0465cd1ca9..5c38bf15a0 100644 --- a/webapp/channels/src/components/user_settings/notifications/user_settings_notifications.tsx +++ b/webapp/channels/src/components/user_settings/notifications/user_settings_notifications.tsx @@ -184,7 +184,7 @@ export default class NotificationsTab extends React.PureComponent static defaultProps = { activeSection: '', - } + }; constructor(props: Props) { super(props); @@ -245,7 +245,7 @@ export default class NotificationsTab extends React.PureComponent this.setState({serverError: err.message, isSaving: false}); } }); - } + }; handleCancel = (): void => this.setState(getNotificationsStateFromProps(this.props)); @@ -263,27 +263,27 @@ export default class NotificationsTab extends React.PureComponent const data: {[key: string]: string | boolean } = {}; data[key] = value; this.setState((prevState) => ({...prevState, ...data})); - } + }; handleNotifyPushThread = (e: ChangeEvent): void => { const pushThreads = e.target.checked ? NotificationLevels.ALL : NotificationLevels.MENTION; this.setState({pushThreads}); - } + }; handleNotifyCommentsRadio = (notifyCommentsLevel: UserNotifyProps['comments'], e?: React.ChangeEvent): void => { this.setState({notifyCommentsLevel}); a11yFocus(e?.currentTarget as HTMLElement); - } + }; handlePushRadio = (pushActivity: UserNotifyProps['push'], e?: React.ChangeEvent): void => { this.setState({pushActivity}); a11yFocus(e?.currentTarget as HTMLElement); - } + }; handlePushStatusRadio = (pushStatus: UserNotifyProps['push_status'], e?: React.ChangeEvent): void => { this.setState({pushStatus}); a11yFocus(e?.currentTarget as HTMLElement); - } + }; handleEmailRadio = (enableEmail: UserNotifyProps['email']): void => this.setState({enableEmail}); @@ -304,14 +304,14 @@ export default class NotificationsTab extends React.PureComponent } else { this.setState({customKeys: '', customKeysChecked: false}); } - } + }; onCustomChange = (): void => { if (this.customCheckRef.current) { this.customCheckRef.current.checked = true; } this.updateCustomMentionKeys(); - } + }; createPushNotificationSection = () => { const active = this.props.activeSection === 'push'; @@ -612,7 +612,7 @@ export default class NotificationsTab extends React.PureComponent max={max} /> ); - } + }; createKeysSection = () => { const serverError = this.state.serverError; @@ -793,7 +793,7 @@ export default class NotificationsTab extends React.PureComponent max={max} />); - } + }; createCommentsSection = () => { const serverError = this.state.serverError; @@ -924,7 +924,7 @@ export default class NotificationsTab extends React.PureComponent areAllSectionsInactive={this.props.activeSection === ''} /> ); - } + }; createAutoResponderSection = () => { if (this.props.enableAutoResponder) { @@ -972,7 +972,7 @@ export default class NotificationsTab extends React.PureComponent } return null; - } + }; render() { const autoResponderSection = this.createAutoResponderSection(); diff --git a/webapp/channels/src/components/user_settings/security/user_access_token_section/user_access_token_section.tsx b/webapp/channels/src/components/user_settings/security/user_access_token_section/user_access_token_section.tsx index aeaecbea99..8305f05080 100644 --- a/webapp/channels/src/components/user_settings/security/user_access_token_section/user_access_token_section.tsx +++ b/webapp/channels/src/components/user_settings/security/user_access_token_section/user_access_token_section.tsx @@ -132,11 +132,11 @@ export default class UserAccessTokenSection extends React.PureComponent { this.setState({tokenCreationState: TOKEN_CREATING}); - } + }; stopCreatingToken = () => { this.setState({tokenCreationState: TOKEN_NOT_CREATING, saving: false}); - } + }; handleCreateToken = async () => { this.handleCancelConfirm(); @@ -159,7 +159,7 @@ export default class UserAccessTokenSection extends React.PureComponent void) => { this.setState({ @@ -214,7 +214,7 @@ export default class UserAccessTokenSection extends React.PureComponent { this.setState({ @@ -225,7 +225,7 @@ export default class UserAccessTokenSection extends React.PureComponent { if (!UserUtils.isSystemAdmin(this.props.user!.roles)) { @@ -260,13 +260,13 @@ export default class UserAccessTokenSection extends React.PureComponent { if (Utils.isKeyPressed(e, Constants.KeyCodes.ENTER)) { this.confirmCreateToken(); } - } + }; confirmRevokeToken = (tokenId: string) => { const token = this.props.userAccessTokens[tokenId]; @@ -301,7 +301,7 @@ export default class UserAccessTokenSection extends React.PureComponent { const {error} = await this.props.actions.revokeUserAccessToken(tokenId); @@ -309,7 +309,7 @@ export default class UserAccessTokenSection extends React.PureComponent { const {error} = await this.props.actions.enableUserAccessToken(tokenId); @@ -318,7 +318,7 @@ export default class UserAccessTokenSection extends React.PureComponent { const {error} = await this.props.actions.disableUserAccessToken(tokenId); @@ -327,7 +327,7 @@ export default class UserAccessTokenSection extends React.PureComponent { this.setState({isSaving: true}); @@ -106,13 +106,13 @@ export default class LimitVisibleGMsDMs extends React.PureComponent { return ( {this.state.limit.label} ); - } + }; render() { const title = ( diff --git a/webapp/channels/src/components/user_settings/sidebar/show_unreads_category/show_unreads_category.tsx b/webapp/channels/src/components/user_settings/sidebar/show_unreads_category/show_unreads_category.tsx index 76df9b0cad..bb3ecded96 100644 --- a/webapp/channels/src/components/user_settings/sidebar/show_unreads_category/show_unreads_category.tsx +++ b/webapp/channels/src/components/user_settings/sidebar/show_unreads_category/show_unreads_category.tsx @@ -69,7 +69,7 @@ export default class ShowUnreadsCategory extends React.PureComponent { this.setState({isSaving: true}); @@ -84,7 +84,7 @@ export default class ShowUnreadsCategory extends React.PureComponent { if (this.props.showUnreadsCategory) { @@ -102,7 +102,7 @@ export default class ShowUnreadsCategory extends React.PureComponent ); - } + }; componentDidUpdate(prevProps: Props) { if (prevProps.active && !this.props.active && this.props.areAllSectionsInactive) { diff --git a/webapp/channels/src/components/view_user_group_modal/view_user_group_modal.tsx b/webapp/channels/src/components/view_user_group_modal/view_user_group_modal.tsx index 9049481a23..7f5807d71f 100644 --- a/webapp/channels/src/components/view_user_group_modal/view_user_group_modal.tsx +++ b/webapp/channels/src/components/view_user_group_modal/view_user_group_modal.tsx @@ -54,7 +54,7 @@ type State = { export default class ViewUserGroupModal extends React.PureComponent { private divScrollRef: RefObject; - private searchTimeoutId: number + private searchTimeoutId: number; constructor(props: Props) { super(props); @@ -72,15 +72,15 @@ export default class ViewUserGroupModal extends React.PureComponent { this.setState({memberCount: this.state.memberCount + 1}); - } + }; decrementMemberCount = () => { this.setState({memberCount: this.state.memberCount - 1}); - } + }; doHide = () => { this.setState({show: false}); - } + }; async componentDidMount() { const { @@ -126,20 +126,20 @@ export default class ViewUserGroupModal extends React.PureComponent { this.setState({memberCount: count}); - } + }; startLoad = () => { this.setState({loading: true}); - } + }; loadComplete = () => { this.setState({loading: false}); - } + }; handleSearch = (e: React.ChangeEvent) => { const term = e.target.value; this.props.actions.setModalSearchTerm(term); - } + }; getGroupMembers = debounce( async () => { @@ -166,7 +166,7 @@ export default class ViewUserGroupModal extends React.PureComponent= scrollHeight && this.props.group) && (this.props.users.length !== this.props.group.member_count && this.state.loading === false)) { this.getGroupMembers(); } - } + }; mentionName = () => { const {group} = this.props; @@ -188,7 +188,7 @@ export default class ViewUserGroupModal extends React.PureComponent); - } + }; render() { const {groupId, group, users, onExited} = this.props; diff --git a/webapp/channels/src/components/warn_metric_ack_modal/warn_metric_ack_modal.tsx b/webapp/channels/src/components/warn_metric_ack_modal/warn_metric_ack_modal.tsx index 8f8f33f008..54b14b649f 100644 --- a/webapp/channels/src/components/warn_metric_ack_modal/warn_metric_ack_modal.tsx +++ b/webapp/channels/src/components/warn_metric_ack_modal/warn_metric_ack_modal.tsx @@ -88,7 +88,7 @@ export default class WarnMetricAckModal extends React.PureComponent { this.setState({serverError: null, saving: false}); @@ -98,7 +98,7 @@ export default class WarnMetricAckModal extends React.PureComponent { const {serverError} = this.state; @@ -157,7 +157,7 @@ export default class WarnMetricAckModal extends React.PureComponent ); - } + }; render() { let headerTitle; diff --git a/webapp/channels/src/components/widgets/inputs/channels_input.tsx b/webapp/channels/src/components/widgets/inputs/channels_input.tsx index 33795658d5..e5c209191a 100644 --- a/webapp/channels/src/components/widgets/inputs/channels_input.tsx +++ b/webapp/channels/src/components/widgets/inputs/channels_input.tsx @@ -57,7 +57,7 @@ export default class ChannelsInput extends React.PureComponent { }; } - getOptionValue = (channel: Channel) => channel.id + getOptionValue = (channel: Channel) => channel.id; handleInputChange = (inputValue: string, action: InputActionMeta) => { if (action.action === 'input-blur' && inputValue !== '') { @@ -72,7 +72,7 @@ export default class ChannelsInput extends React.PureComponent { if (action.action !== 'input-blur' && action.action !== 'menu-close') { this.props.onInputChange(inputValue); } - } + }; optionsLoader = (_input: string, callback: (options: Channel[]) => void) => { const customCallback = (options: Channel[]) => { @@ -83,7 +83,7 @@ export default class ChannelsInput extends React.PureComponent { if (result && result.then) { result.then(customCallback); } - } + }; loadingMessage = () => { const text = ( @@ -95,7 +95,7 @@ export default class ChannelsInput extends React.PureComponent { // faking types due to longstanding mismatches in react-select & @types/react-select return ( as unknown as string); - } + }; NoOptionsMessage = (props: Record) => { const inputValue = props.selectProps.inputValue; @@ -128,14 +128,14 @@ export default class ChannelsInput extends React.PureComponent { {channel.name} ); - } + }; // eslint-disable-next-line @typescript-eslint/no-unused-vars onChange = (value: Channel[], _meta: ActionMeta) => { if (this.props.onChange) { this.props.onChange(value); } - } + }; MultiValueRemove = ({children, innerProps}: {children: React.ReactNode | React.ReactNodeArray; innerProps: Record}) => (
@@ -151,7 +151,7 @@ export default class ChannelsInput extends React.PureComponent { onFocus = () => { this.selectRef.current?.handleInputChange(this.props.inputValue, {action: 'custom'}); - } + }; render() { return ( diff --git a/webapp/channels/src/components/widgets/inputs/users_emails_input.tsx b/webapp/channels/src/components/widgets/inputs/users_emails_input.tsx index cc5631a8ef..084f8b3be6 100644 --- a/webapp/channels/src/components/widgets/inputs/users_emails_input.tsx +++ b/webapp/channels/src/components/widgets/inputs/users_emails_input.tsx @@ -103,7 +103,7 @@ export default class UsersEmailsInput extends React.PureComponent {nickname} ); - } + }; loadingMessage = (): string => { const text = ( @@ -115,14 +115,14 @@ export default class UsersEmailsInput extends React.PureComponent // faking types to satisfy the interface for the version of react-select we are on. return () as unknown as string; - } + }; getOptionValue = (obj: UserProfile | EmailInvite): string => { if (this.isUserProfile(obj)) { return obj.id; } return obj.value; - } + }; formatOptionLabel = (user: UserProfile | EmailInvite, options: FormatOptionLabelMeta) => { const profileImg = imageURLForUser((user as UserProfile).id, (user as UserProfile).last_picture_update); @@ -176,7 +176,7 @@ export default class UsersEmailsInput extends React.PureComponent {guestBadge} ); - } + }; onChange = (value: ValueType) => { if (this.props.onChange) { @@ -191,7 +191,7 @@ export default class UsersEmailsInput extends React.PureComponent this.props.onChange([]); } } - } + }; getCreateLabel = (value: string) => ( @@ -294,7 +294,7 @@ export default class UsersEmailsInput extends React.PureComponent if (action.action !== 'input-blur' && action.action !== 'menu-close') { this.props.onInputChange(inputValue); } - } + }; formatValuesForCreatable = () => { return this.props.value.map((v) => { @@ -303,7 +303,7 @@ export default class UsersEmailsInput extends React.PureComponent } return {label: v, value: v} as EmailInvite; }); - } + }; optionsLoader = (_input: string, callback: (options: UserProfile[]) => void) => { const customCallback = (options: UserProfile[]) => { @@ -318,22 +318,22 @@ export default class UsersEmailsInput extends React.PureComponent if (result && result.then) { result.then(customCallback); } - } + }; showAddEmail = (inputValue: string, value: ValueType, options: OptionsType): boolean => { return this.props.emailInvitationsEnabled && options.length === 0 && isEmail(inputValue); - } + }; onFocus = () => { this.selectRef.current?.handleInputChange(this.props.inputValue, {action: 'custom'}); - } + }; onBlur = () => { this.selectRef.current?.handleInputChange(this.props.inputValue, {action: 'input-blur'}); if (this.props.onBlur) { this.props.onBlur(); } - } + }; appendDelimitedValues = async (values: string): Promise => { const existingValues = this.formatValuesForCreatable(); @@ -418,15 +418,15 @@ export default class UsersEmailsInput extends React.PureComponent this.props.onInputChange(''); return newValues.length; - } + }; isUserProfile = (obj: UserProfile | EmailInvite): obj is UserProfile => { return (obj as UserProfile).id !== undefined; - } + }; isEmailInvite = (obj: UserProfile | EmailInvite): obj is EmailInvite => { return (obj as EmailInvite).value !== undefined; - } + }; searchByEmail = async (value: string): Promise => { let data; @@ -436,7 +436,7 @@ export default class UsersEmailsInput extends React.PureComponent return null; } return data?.delete_at === 0 ? data : null; - } + }; searchByUsername = async (value: string): Promise => { let data; @@ -446,7 +446,7 @@ export default class UsersEmailsInput extends React.PureComponent return null; } return data?.delete_at === 0 ? data : null; - } + }; render() { const values = this.formatValuesForCreatable(); diff --git a/webapp/channels/src/components/widgets/loading/loading_spinner.tsx b/webapp/channels/src/components/widgets/loading/loading_spinner.tsx index b70c00c410..8280fb7dda 100644 --- a/webapp/channels/src/components/widgets/loading/loading_spinner.tsx +++ b/webapp/channels/src/components/widgets/loading/loading_spinner.tsx @@ -15,7 +15,7 @@ type Props = { export default class LoadingSpinner extends React.PureComponent { public static defaultProps: Props = { text: null, - } + }; public render() { return ( diff --git a/webapp/channels/src/components/widgets/loading/loading_wrapper.tsx b/webapp/channels/src/components/widgets/loading/loading_wrapper.tsx index aebab338f1..a26869d08f 100644 --- a/webapp/channels/src/components/widgets/loading/loading_wrapper.tsx +++ b/webapp/channels/src/components/widgets/loading/loading_wrapper.tsx @@ -16,7 +16,7 @@ export default class LoadingWrapper extends React.PureComponent { loading: true, text: null, children: null, - } + }; public render() { const {text, loading, children} = this.props; diff --git a/webapp/channels/src/components/widgets/menu/menu.tsx b/webapp/channels/src/components/widgets/menu/menu.tsx index 3e5712ee25..3dcb659527 100644 --- a/webapp/channels/src/components/widgets/menu/menu.tsx +++ b/webapp/channels/src/components/widgets/menu/menu.tsx @@ -35,16 +35,16 @@ type Props = { * @deprecated Use the "webapp/channels/src/components/menu" instead. */ export default class Menu extends React.PureComponent { - public static Header = MenuHeader - public static Group = MenuGroup - public static ItemAction = MenuItemAction - public static ItemExternalLink = MenuItemExternalLink - public static ItemLink = MenuItemLink - public static ItemToggleModalRedux = MenuItemToggleModalRedux - public static ItemSubMenu = SubMenuItem - public static CloudTrial = MenuCloudTrial - public static StartTrial = MenuStartTrial - public static ItemCloudLimit = MenuItemCloudLimit + public static Header = MenuHeader; + public static Group = MenuGroup; + public static ItemAction = MenuItemAction; + public static ItemExternalLink = MenuItemExternalLink; + public static ItemLink = MenuItemLink; + public static ItemToggleModalRedux = MenuItemToggleModalRedux; + public static ItemSubMenu = SubMenuItem; + public static CloudTrial = MenuCloudTrial; + public static StartTrial = MenuStartTrial; + public static ItemCloudLimit = MenuItemCloudLimit; public node: React.RefObject; //Public because it is used by tests private observer: MutationObserver; @@ -89,7 +89,7 @@ export default class Menu extends React.PureComponent { } } this.observer.observe(this.node.current, {attributes: true, childList: true, subtree: true}); - } + }; public componentDidMount() { this.hideUnneededDividers(); @@ -116,7 +116,7 @@ export default class Menu extends React.PureComponent { e.preventDefault(); e.stopPropagation(); } - } + }; public render() { const {children, openUp, openLeft, id, listId, ariaLabel, customStyles} = this.props; diff --git a/webapp/channels/src/components/widgets/menu/menu_group.tsx b/webapp/channels/src/components/widgets/menu/menu_group.tsx index d0779e5661..cafbf749d7 100644 --- a/webapp/channels/src/components/widgets/menu/menu_group.tsx +++ b/webapp/channels/src/components/widgets/menu/menu_group.tsx @@ -17,7 +17,7 @@ export default class MenuGroup extends React.PureComponent { handleDividerClick = (e: React.MouseEvent): void => { e.preventDefault(); e.stopPropagation(); - } + }; public render() { const {children} = this.props; diff --git a/webapp/channels/src/components/widgets/menu/menu_items/submenu_item.tsx b/webapp/channels/src/components/widgets/menu/menu_items/submenu_item.tsx index b196de494d..3f3308aedc 100644 --- a/webapp/channels/src/components/widgets/menu/menu_items/submenu_item.tsx +++ b/webapp/channels/src/components/widgets/menu/menu_items/submenu_item.tsx @@ -84,11 +84,11 @@ export default class SubMenuItem extends React.PureComponent { show = () => { this.setState({show: true}); - } + }; hide = () => { this.setState({show: false}); - } + }; private onClick = (event: React.SyntheticEvent) => { event.preventDefault(); @@ -110,7 +110,7 @@ export default class SubMenuItem extends React.PureComponent { } else if (event.currentTarget.id === id && action) { action(postId); } - } + }; handleKeyDown = (event: React.KeyboardEvent) => { if (Utils.isKeyPressed(event, Constants.KeyCodes.ENTER)) { @@ -136,7 +136,7 @@ export default class SubMenuItem extends React.PureComponent { this.hide(); } } - } + }; public render() { const {id, postId, text, selectedValueText, subMenu, icon, filter, ariaLabel, direction, styleSelectableItem, extraText, renderSelected, rightDecorator, tabIndex} = this.props; diff --git a/webapp/channels/src/components/widgets/menu/menu_modals/submenu_modal/submenu_modal.tsx b/webapp/channels/src/components/widgets/menu/menu_modals/submenu_modal/submenu_modal.tsx index 5e49750248..4678215390 100644 --- a/webapp/channels/src/components/widgets/menu/menu_modals/submenu_modal/submenu_modal.tsx +++ b/webapp/channels/src/components/widgets/menu/menu_modals/submenu_modal/submenu_modal.tsx @@ -31,7 +31,7 @@ export default class SubMenuModal extends React.PureComponent { public onHide = () => { //public because it is used on tests this.setState({show: false}); - } + }; public render() { let SubMenuItems; diff --git a/webapp/channels/src/components/widgets/menu/menu_wrapper.tsx b/webapp/channels/src/components/widgets/menu/menu_wrapper.tsx index 003c9bb791..836127ec79 100644 --- a/webapp/channels/src/components/widgets/menu/menu_wrapper.tsx +++ b/webapp/channels/src/components/widgets/menu/menu_wrapper.tsx @@ -98,7 +98,7 @@ export default class MenuWrapper extends React.PureComponent { if (e.key === Constants.KeyCodes.TAB[0]) { this.closeOnBlur(e); } - } + }; private closeOnBlur = (e: Event) => { if (this.node && this.node.current && e.target && this.node.current.contains(e.target as Node)) { @@ -106,7 +106,7 @@ export default class MenuWrapper extends React.PureComponent { } this.close(); - } + }; public close = () => { if (this.state.open) { @@ -115,7 +115,7 @@ export default class MenuWrapper extends React.PureComponent { this.props.onToggle(false); } } - } + }; toggle = (e: React.MouseEvent) => { /** @@ -134,7 +134,7 @@ export default class MenuWrapper extends React.PureComponent { this.props.onToggle(newState); } }); - } + }; public render() { const {children} = this.props; diff --git a/webapp/channels/src/components/widgets/modals/full_screen_modal.tsx b/webapp/channels/src/components/widgets/modals/full_screen_modal.tsx index d844e868e2..64737c0517 100644 --- a/webapp/channels/src/components/widgets/modals/full_screen_modal.tsx +++ b/webapp/channels/src/components/widgets/modals/full_screen_modal.tsx @@ -46,7 +46,7 @@ class FullScreenModal extends React.PureComponent { this.modal.current.focus(); } }); - } + }; private handleKeypress = (e: KeyboardEvent) => { if (this.props.ignoreExit !== undefined && this.props.ignoreExit && e.key === 'Escape') { @@ -60,11 +60,11 @@ class FullScreenModal extends React.PureComponent { if (this.props.overrideTargetEvent && e.key === 'Escape' && this.props.show) { this.close(); } - } + }; private close = () => { this.props.onClose(); - } + }; public render() { return ( diff --git a/webapp/channels/src/components/widgets/popover/index.tsx b/webapp/channels/src/components/widgets/popover/index.tsx index e1f878dd20..500f3d7f74 100644 --- a/webapp/channels/src/components/widgets/popover/index.tsx +++ b/webapp/channels/src/components/widgets/popover/index.tsx @@ -26,7 +26,7 @@ export default class Popover extends React.PureComponent { popoverStyle: 'info', popoverSize: 'sm', - } + }; render() { const {placement, popoverSize, children, popoverStyle, title, id, onMouseOut, onMouseOver, className, style} = this.props; return ( diff --git a/webapp/channels/src/components/widgets/settings/bool_setting.tsx b/webapp/channels/src/components/widgets/settings/bool_setting.tsx index f03c984aa8..a776512245 100644 --- a/webapp/channels/src/components/widgets/settings/bool_setting.tsx +++ b/webapp/channels/src/components/widgets/settings/bool_setting.tsx @@ -26,7 +26,7 @@ export default class BoolSetting extends React.PureComponent { private handleChange: React.ChangeEventHandler = (e) => { this.props.onChange(this.props.id, e.target.checked); - } + }; public render(): JSX.Element { return ( diff --git a/webapp/channels/src/components/widgets/settings/radio_setting.tsx b/webapp/channels/src/components/widgets/settings/radio_setting.tsx index 89d5bf3fd8..9db09801e6 100644 --- a/webapp/channels/src/components/widgets/settings/radio_setting.tsx +++ b/webapp/channels/src/components/widgets/settings/radio_setting.tsx @@ -26,7 +26,7 @@ export default class RadioSetting extends React.PureComponent { private handleChange: React.ChangeEventHandler = (e) => { this.props.onChange(this.props.id, e.target.value); - } + }; public render(): JSX.Element { return ( diff --git a/webapp/channels/src/components/widgets/settings/text_setting.tsx b/webapp/channels/src/components/widgets/settings/text_setting.tsx index 26326a37e4..0310e9c3f3 100644 --- a/webapp/channels/src/components/widgets/settings/text_setting.tsx +++ b/webapp/channels/src/components/widgets/settings/text_setting.tsx @@ -44,7 +44,7 @@ export default class TextSetting extends React.PureComponent { public static defaultProps = { size: 'sm' as const, - } + }; public render() { const {content, url, size, withHover, className} = this.props; diff --git a/webapp/channels/src/components/youtube_video/youtube_video.tsx b/webapp/channels/src/components/youtube_video/youtube_video.tsx index 9de189f6f0..919ef85660 100644 --- a/webapp/channels/src/components/youtube_video/youtube_video.tsx +++ b/webapp/channels/src/components/youtube_video/youtube_video.tsx @@ -38,11 +38,11 @@ export default class YoutubeVideo extends React.PureComponent { play = () => { this.setState({playing: true}); - } + }; stop = () => { this.setState({playing: false}); - } + }; render() { const {metadata, link} = this.props; diff --git a/webapp/channels/src/packages/mattermost-redux/src/store/reducer_registry.ts b/webapp/channels/src/packages/mattermost-redux/src/store/reducer_registry.ts index c8a0caaa59..23ef9195d3 100644 --- a/webapp/channels/src/packages/mattermost-redux/src/store/reducer_registry.ts +++ b/webapp/channels/src/packages/mattermost-redux/src/store/reducer_registry.ts @@ -10,22 +10,22 @@ export class ReducerRegistry { setReducers = (reducers: Record): void => { this.reducers = reducers; - } + }; getReducers = (): Record => { return {...this.reducers}; - } + }; register = (name: string, reducer: Reducer): void => { this.reducers = {...this.reducers, [name]: reducer}; if (this.emitChange) { this.emitChange(this.getReducers()); } - } + }; setChangeListener = (listener: (reducers: Record) => void): void => { this.emitChange = listener; - } + }; } const reducerRegistry = new ReducerRegistry(); diff --git a/webapp/channels/src/packages/mattermost-redux/src/utils/delayed_action.ts b/webapp/channels/src/packages/mattermost-redux/src/utils/delayed_action.ts index 729b43a7f4..25608afbcb 100644 --- a/webapp/channels/src/packages/mattermost-redux/src/utils/delayed_action.ts +++ b/webapp/channels/src/packages/mattermost-redux/src/utils/delayed_action.ts @@ -15,7 +15,7 @@ export default class DelayedAction any> { this.action(); this.timer = null; - } + }; fireAfter = (timeout: number): void => { if (this.timer !== null) { @@ -23,11 +23,11 @@ export default class DelayedAction any> { } this.timer = setTimeout(this.fire, timeout); - } + }; cancel = (): void => { if (this.timer !== null) { clearTimeout(this.timer); } - } + }; } diff --git a/webapp/channels/src/packages/mattermost-redux/test/test_helper.ts b/webapp/channels/src/packages/mattermost-redux/test/test_helper.ts index 985ce3f922..4ca6c1cfc2 100644 --- a/webapp/channels/src/packages/mattermost-redux/test/test_helper.ts +++ b/webapp/channels/src/packages/mattermost-redux/test/test_helper.ts @@ -306,7 +306,7 @@ class TestHelper { description: '', content_type: 'application/x-www-form-urlencoded', }; - } + }; testCommand = (teamId: string): Command => { return { @@ -344,7 +344,7 @@ class TestHelper { min_server_version: '5.12.0', }, }; - } + }; fakeChannel = (teamId: string): Channel => { const name = this.generateId(); @@ -392,7 +392,7 @@ class TestHelper { getChannelMock = (override?: Partial) => { return Object.assign(this.fakeChannel(override?.team_id || ''), override); - } + }; fakeChannelWithId = (teamId: string) => { return { @@ -415,7 +415,7 @@ class TestHelper { id: this.generateId(), delete_at: 0, }; - } + }; fakeGmChannel = (...usernames: string[]) => { return { @@ -426,7 +426,7 @@ class TestHelper { id: this.generateId(), delete_at: 0, }; - } + }; fakeChannelMember = (userId: string, channelId: string): ChannelMembership => { return { @@ -455,7 +455,7 @@ class TestHelper { ignore_channel_mentions: 'default', ...override, }; - } + }; fakeUserNotifyProps = (override: Partial): UserNotifyProps => { return { @@ -471,7 +471,7 @@ class TestHelper { mention_keys: '', ...override, }; - } + }; fakePost = (channelId: string): Post => { return { @@ -528,11 +528,11 @@ class TestHelper { user_id: '', ...override, }; - } + }; getPostMock = (override?: Partial) => { return Object.assign(this.fakePost(override?.channel_id || ''), override); - } + }; fakePostWithId = (channelId: string): Post => { return { @@ -622,7 +622,7 @@ class TestHelper { delete_at: 0, description: '', }; - } + }; fakeGroup = (groupId: string, source = 'ldap'): Group => { const name = 'software-engineers'; @@ -740,7 +740,7 @@ class TestHelper { nock(clientBaseRoute). get('/users/me/preferences'). reply(200, [{user_id: this.basicUser!.id, category: 'tutorial_step', name: this.basicUser!.id, value: '999'}]); - } + }; initMockEntities = () => { this.basicUser = this.fakeUserWithId(); @@ -838,7 +838,7 @@ class TestHelper { }; this.basicScheme = this.mockSchemeWithId(); this.basicGroup = this.fakeGroupWithId(''); - } + }; initBasic = (client4 = this.createClient4()) => { client4.setUrl(DEFAULT_SERVER); @@ -866,9 +866,9 @@ class TestHelper { this.basicChannel = null; this.basicChannelMember = null; this.basicPost = null; - } + }; - wait = (time: number) => new Promise((resolve) => setTimeout(resolve, time)) + wait = (time: number) => new Promise((resolve) => setTimeout(resolve, time)); } export default new TestHelper(); diff --git a/webapp/channels/src/plugins/channel_header_plug/channel_header_plug.tsx b/webapp/channels/src/plugins/channel_header_plug/channel_header_plug.tsx index 39568e2ec9..fba88e459e 100644 --- a/webapp/channels/src/plugins/channel_header_plug/channel_header_plug.tsx +++ b/webapp/channels/src/plugins/channel_header_plug/channel_header_plug.tsx @@ -35,7 +35,7 @@ type CustomMenuProps = { class CustomMenu extends React.PureComponent { handleRootClose = () => { this.props.onClose(); - } + }; render() { const { @@ -73,7 +73,7 @@ class CustomToggle extends React.PureComponent { if (this.props.onClick) { this.props.onClick(e); } - } + }; render() { const {children} = this.props; @@ -121,7 +121,7 @@ class ChannelHeaderPlug extends React.PureComponent = { components: [], appBindings: [], - } + }; private disableButtonsClosingRHS = false; @@ -144,11 +144,11 @@ class ChannelHeaderPlug extends React.PureComponent { this.setState({dropdownOpen}); - } + }; onClose = () => { this.toggleDropdown(false); - } + }; fireAction = (action: (channel: Channel, channelMember?: ChannelMembership) => void) => { if (this.disableButtonsClosingRHS) { @@ -156,12 +156,12 @@ class ChannelHeaderPlug extends React.PureComponent void) => { action(this.props.channel, this.props.channelMember); this.onClose(); - } + }; createComponentButton = (plug: PluginComponent) => { return ( @@ -176,7 +176,7 @@ class ChannelHeaderPlug extends React.PureComponent ); - } + }; onBindingClick = async (binding: AppBinding) => { if (this.disableButtonsClosingRHS) { @@ -228,7 +228,7 @@ class ChannelHeaderPlug extends React.PureComponent { return ( @@ -248,7 +248,7 @@ class ChannelHeaderPlug extends React.PureComponent ); - } + }; createDropdown = (plugs: PluginComponent[], appBindings: AppBinding[]) => { const componentItems = plugs.filter((plug) => plug.action).map((plug) => { @@ -338,7 +338,7 @@ class ChannelHeaderPlug extends React.PureComponent
); - } + }; render() { const components = this.props.components || []; diff --git a/webapp/channels/src/plugins/mobile_channel_header_plug/mobile_channel_header_plug.tsx b/webapp/channels/src/plugins/mobile_channel_header_plug/mobile_channel_header_plug.tsx index 861cc541f9..53ac734c87 100644 --- a/webapp/channels/src/plugins/mobile_channel_header_plug/mobile_channel_header_plug.tsx +++ b/webapp/channels/src/plugins/mobile_channel_header_plug/mobile_channel_header_plug.tsx @@ -81,7 +81,7 @@ class MobileChannelHeaderPlug extends React.PureComponent { ); - } + }; createButton = (plug: PluginComponent) => { const onClick = () => this.fireAction(plug); @@ -115,7 +115,7 @@ class MobileChannelHeaderPlug extends React.PureComponent { ); - } + }; createList(plugs: PluginComponent[]) { return plugs.map(this.createButton); @@ -174,7 +174,7 @@ class MobileChannelHeaderPlug extends React.PureComponent { this.props.actions.postEphemeralCallResponseForChannel(callResp, errorMessage, channel.id); } } - } + }; render() { const components = this.props.components || []; diff --git a/webapp/channels/src/plugins/pluggable/error_boundary.tsx b/webapp/channels/src/plugins/pluggable/error_boundary.tsx index 2bcad887bc..45b93e52e9 100644 --- a/webapp/channels/src/plugins/pluggable/error_boundary.tsx +++ b/webapp/channels/src/plugins/pluggable/error_boundary.tsx @@ -49,7 +49,7 @@ export default class PluggableErrorBoundary extends React.PureComponent { this.resetInterractionStates(); - } + }; handleMouseClick = (event: Event) => { // hitting enter on a