diff --git a/.eslintrc.json b/.eslintrc.json index 85621dc15..7f7cc510b 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -7,7 +7,8 @@ "parser": "@typescript-eslint/parser", "plugins": [ "@typescript-eslint", - "mattermost" + "mattermost", + "import" ], "settings": { "react": { @@ -48,6 +49,36 @@ "@typescript-eslint/no-var-requires": 0, "@typescript-eslint/explicit-function-return-type": 0, "@typescript-eslint/explicit-module-boundary-types": "off", + "@typescript-eslint/member-delimiter-style": 2, + "import/order": [ + 2, + { + "groups": ["builtin", "external", "parent", "sibling", "index", "type"], + "newlines-between": "always", + "pathGroups": [ + { + "pattern": "@(@react-native-community|@react-native-cookies|@react-navigation|@rudderstack|@sentry|@testing-library|@storybook)/**", + "group": "external", + "position": "before" + }, + { + "pattern": "@{**,*/**}", + "group": "external", + "position": "after" + }, + { + "pattern": "app/**", + "group": "parent", + "position": "before" + } + ], + "alphabetize": { + "order": "asc", + "caseInsensitive": true + }, + "pathGroupsExcludedImportTypes": ["type"] + } + ], "no-shadow": "off", "@typescript-eslint/no-shadow": "error" }, diff --git a/app/actions/apps.ts b/app/actions/apps.ts index 2c657a01c..f741b0044 100644 --- a/app/actions/apps.ts +++ b/app/actions/apps.ts @@ -1,22 +1,21 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import {sendEphemeralPost} from '@actions/views/post'; import {Client4} from '@client/rest'; - +import CompassIcon from '@components/compass_icon'; +import {handleGotoLocation} from '@mm-redux/actions/integrations'; +import {AppCallTypes, AppCallResponseTypes} from '@mm-redux/constants/apps'; +import {getTheme} from '@mm-redux/selectors/entities/preferences'; import {ActionFunc, DispatchFunc} from '@mm-redux/types/actions'; import {AppCallResponse, AppForm, AppCallRequest, AppCallType, AppContext} from '@mm-redux/types/apps'; +import {CommandArgs} from '@mm-redux/types/integrations'; import {Post} from '@mm-redux/types/posts'; - -import {AppCallTypes, AppCallResponseTypes} from '@mm-redux/constants/apps'; -import {handleGotoLocation} from '@mm-redux/actions/integrations'; -import {showModal} from './navigation'; import {Theme} from '@mm-redux/types/preferences'; -import CompassIcon from '@components/compass_icon'; -import {getTheme} from '@mm-redux/selectors/entities/preferences'; import EphemeralStore from '@store/ephemeral_store'; import {makeCallErrorResponse} from '@utils/apps'; -import {sendEphemeralPost} from '@actions/views/post'; -import {CommandArgs} from '@mm-redux/types/integrations'; + +import {showModal} from './navigation'; export function doAppCall(call: AppCallRequest, type: AppCallType, intl: any): ActionFunc { return async (dispatch, getState) => { diff --git a/app/actions/device/index.js b/app/actions/device/index.js index 2fe2b0114..869f6c6d8 100644 --- a/app/actions/device/index.js +++ b/app/actions/device/index.js @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {DeviceTypes} from 'app/constants'; +import {DeviceTypes} from '@constants'; export function connection(isOnline) { return async (dispatch, getState) => { diff --git a/app/actions/helpers/channels.test.js b/app/actions/helpers/channels.test.js index e1ba04b95..bfa73d685 100644 --- a/app/actions/helpers/channels.test.js +++ b/app/actions/helpers/channels.test.js @@ -4,10 +4,8 @@ /* eslint-disable no-import-assign */ import {Client4} from '@client/rest'; - -import {Preferences} from '@mm-redux/constants'; import {PreferenceTypes} from '@mm-redux/action_types'; - +import {Preferences} from '@mm-redux/constants'; import * as CommonSelectors from '@mm-redux/selectors/entities/common'; import * as PreferenceSelectors from '@mm-redux/selectors/entities/preferences'; import * as PreferenceUtils from '@mm-redux/utils/preference_utils'; diff --git a/app/actions/helpers/channels.ts b/app/actions/helpers/channels.ts index 11dd16aa8..4000ab0e3 100644 --- a/app/actions/helpers/channels.ts +++ b/app/actions/helpers/channels.ts @@ -1,23 +1,21 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {ChannelTypes, PreferenceTypes, RoleTypes, UserTypes} from '@mm-redux/action_types'; import {Client4} from '@client/rest'; +import {ChannelTypes, PreferenceTypes, RoleTypes, UserTypes} from '@mm-redux/action_types'; import {General, Preferences} from '@mm-redux/constants'; import {getCurrentChannelId, getRedirectChannelNameForTeam, getChannelsNameMapInTeam} from '@mm-redux/selectors/entities/channels'; import {getConfig} from '@mm-redux/selectors/entities/general'; import {getMyPreferences} from '@mm-redux/selectors/entities/preferences'; import {getCurrentUserId, getUsers, getUserIdsInChannels} from '@mm-redux/selectors/entities/users'; -import {getChannelByName as selectChannelByName, getUserIdFromChannelName, isAutoClosed} from '@mm-redux/utils/channel_utils'; -import {getPreferenceKey} from '@mm-redux/utils/preference_utils'; - import {ActionResult, GenericAction} from '@mm-redux/types/actions'; import {Channel, ChannelMembership} from '@mm-redux/types/channels'; import {PreferenceType} from '@mm-redux/types/preferences'; import {GlobalState} from '@mm-redux/types/store'; import {UserProfile} from '@mm-redux/types/users'; import {RelationOneToMany} from '@mm-redux/types/utilities'; - +import {getChannelByName as selectChannelByName, getUserIdFromChannelName, isAutoClosed} from '@mm-redux/utils/channel_utils'; +import {getPreferenceKey} from '@mm-redux/utils/preference_utils'; import {isDirectChannelVisible, isGroupChannelVisible} from '@utils/channels'; import {buildPreference} from '@utils/preferences'; diff --git a/app/actions/navigation/index.js b/app/actions/navigation/index.js index a00ea322b..bb39129cc 100644 --- a/app/actions/navigation/index.js +++ b/app/actions/navigation/index.js @@ -1,16 +1,15 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import merge from 'deepmerge'; import {Keyboard, Platform} from 'react-native'; import {Navigation} from 'react-native-navigation'; -import merge from 'deepmerge'; - -import {Preferences} from '@mm-redux/constants'; -import {getTheme} from '@mm-redux/selectors/entities/preferences'; -import EventEmmiter from '@mm-redux/utils/event_emitter'; import {DeviceTypes, NavigationTypes} from '@constants'; import {CHANNEL} from '@constants/screen'; +import {Preferences} from '@mm-redux/constants'; +import {getTheme} from '@mm-redux/selectors/entities/preferences'; +import EventEmmiter from '@mm-redux/utils/event_emitter'; import EphemeralStore from '@store/ephemeral_store'; import Store from '@store/store'; diff --git a/app/actions/navigation/index.test.js b/app/actions/navigation/index.test.js index 5947ea4da..60f6fe45a 100644 --- a/app/actions/navigation/index.test.js +++ b/app/actions/navigation/index.test.js @@ -1,20 +1,19 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import merge from 'deepmerge'; import {Platform} from 'react-native'; import {Navigation} from 'react-native-navigation'; import configureMockStore from 'redux-mock-store'; import thunk from 'redux-thunk'; -import merge from 'deepmerge'; - -import EventEmitter from '@mm-redux/utils/event_emitter'; import * as NavigationActions from '@actions/navigation'; +import {NavigationTypes} from '@constants'; import Preferences from '@mm-redux/constants/preferences'; +import EventEmitter from '@mm-redux/utils/event_emitter'; import EphemeralStore from '@store/ephemeral_store'; import intitialState from '@store/initial_state'; import Store from '@store/store'; -import {NavigationTypes} from '@constants'; jest.unmock('@actions/navigation'); const mockStore = configureMockStore([thunk]); diff --git a/app/actions/views/announcement.js b/app/actions/views/announcement.js index 82236e8ee..c844a89db 100644 --- a/app/actions/views/announcement.js +++ b/app/actions/views/announcement.js @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {ViewTypes} from 'app/constants'; +import {ViewTypes} from '@constants'; export function dismissBanner(text) { return { diff --git a/app/actions/views/channel.js b/app/actions/views/channel.js index 85b4ff88a..e0269c4ae 100644 --- a/app/actions/views/channel.js +++ b/app/actions/views/channel.js @@ -3,9 +3,13 @@ import {batchActions} from 'redux-batched-actions'; -import {ViewTypes} from 'app/constants'; - +import {lastChannelIdForTeam, loadSidebarDirectMessagesProfiles} from '@actions/helpers/channels'; +import {getPosts, getPostsBefore, getPostsSince, loadUnreadChannelPosts} from '@actions/views/post'; +import {Client4} from '@client/rest'; +import {ViewTypes} from '@constants'; +import {INSERT_TO_COMMENT, INSERT_TO_DRAFT} from '@constants/post_draft'; import {ChannelTypes, RoleTypes, GroupTypes} from '@mm-redux/action_types'; +import {fetchAppBindings} from '@mm-redux/actions/apps'; import { fetchMyChannelsAndMembers, getChannelByName, @@ -13,11 +17,8 @@ import { leaveChannel as serviceLeaveChannel, } from '@mm-redux/actions/channels'; import {savePreferences} from '@mm-redux/actions/preferences'; -import {getLicense} from '@mm-redux/selectors/entities/general'; import {addUserToTeam, getTeamByName, removeUserFromTeam, selectTeam} from '@mm-redux/actions/teams'; -import {Client4} from '@client/rest'; import {General, Preferences} from '@mm-redux/constants'; -import {getPostIdsInChannel} from '@mm-redux/selectors/entities/posts'; import { getCurrentChannelId, getRedirectChannelNameForTeam, @@ -25,23 +26,20 @@ import { getMyChannelMemberships, isManuallyUnread, } from '@mm-redux/selectors/entities/channels'; +import {getLicense} from '@mm-redux/selectors/entities/general'; +import {getPostIdsInChannel} from '@mm-redux/selectors/entities/posts'; import {isCollapsedThreadsEnabled} from '@mm-redux/selectors/entities/preferences'; import {getTeamByName as selectTeamByName, getCurrentTeam, getTeamMemberships} from '@mm-redux/selectors/entities/teams'; import {getCurrentUserId} from '@mm-redux/selectors/entities/users'; import {getChannelByName as selectChannelByName, getChannelsIdForTeam} from '@mm-redux/utils/channel_utils'; import EventEmitter from '@mm-redux/utils/event_emitter'; import {isMinimumServerVersion} from '@mm-redux/utils/helpers'; - -import {lastChannelIdForTeam, loadSidebarDirectMessagesProfiles} from '@actions/helpers/channels'; -import {getPosts, getPostsBefore, getPostsSince, loadUnreadChannelPosts} from '@actions/views/post'; -import {INSERT_TO_COMMENT, INSERT_TO_DRAFT} from '@constants/post_draft'; import {getChannelReachable} from '@selectors/channel'; import {getViewingGlobalThreads} from '@selectors/threads'; import telemetry, {PERF_MARKERS} from '@telemetry'; +import {appsEnabled} from '@utils/apps'; import {isDirectChannelVisible, isGroupChannelVisible, getChannelSinceValue, privateChannelJoinPrompt} from '@utils/channels'; import {isPendingPost} from '@utils/general'; -import {fetchAppBindings} from '@mm-redux/actions/apps'; -import {appsEnabled} from '@utils/apps'; import {handleNotViewingGlobalThreadsScreen} from './threads'; diff --git a/app/actions/views/channel.test.js b/app/actions/views/channel.test.js index ab09a7327..71d527182 100644 --- a/app/actions/views/channel.test.js +++ b/app/actions/views/channel.test.js @@ -4,14 +4,13 @@ import configureStore from 'redux-mock-store'; import thunk from 'redux-thunk'; -import testHelper from 'test/test_helper'; - import * as ChannelActions from '@actions/views/channel'; import {ViewTypes} from '@constants'; import {ChannelTypes} from '@mm-redux/action_types'; +import {General} from '@mm-redux/constants'; import postReducer from '@mm-redux/reducers/entities/posts'; import initialState from '@store/initial_state'; -import {General} from '@mm-redux/constants'; +import testHelper from '@test/test_helper'; const { handleSelectChannel, diff --git a/app/actions/views/command.ts b/app/actions/views/command.ts index 2448eddc1..2b4e876a4 100644 --- a/app/actions/views/command.ts +++ b/app/actions/views/command.ts @@ -3,18 +3,16 @@ import {intlShape} from 'react-intl'; +import {doAppCall, postEphemeralCallResponseForCommandArgs} from '@actions/apps'; +import {AppCommandParser} from '@components/autocomplete/slash_suggestion/app_command_parser/app_command_parser'; import {IntegrationTypes} from '@mm-redux/action_types'; import {executeCommand as executeCommandService} from '@mm-redux/actions/integrations'; -import {getCurrentTeamId} from '@mm-redux/selectors/entities/teams'; import {AppCallResponseTypes, AppCallTypes} from '@mm-redux/constants/apps'; +import {getCurrentTeamId} from '@mm-redux/selectors/entities/teams'; import {DispatchFunc, GetStateFunc, ActionFunc} from '@mm-redux/types/actions'; -import {CommandArgs} from '@mm-redux/types/integrations'; - -import {AppCommandParser} from '@components/autocomplete/slash_suggestion/app_command_parser/app_command_parser'; - -import {doAppCall, postEphemeralCallResponseForCommandArgs} from '@actions/apps'; -import {appsEnabled} from '@utils/apps'; import {AppCallResponse} from '@mm-redux/types/apps'; +import {CommandArgs} from '@mm-redux/types/integrations'; +import {appsEnabled} from '@utils/apps'; export function executeCommand(message: string, channelId: string, rootId: string, intl: typeof intlShape): ActionFunc { return async (dispatch: DispatchFunc, getState: GetStateFunc) => { diff --git a/app/actions/views/create_channel.js b/app/actions/views/create_channel.js index 12307b289..5e7143753 100644 --- a/app/actions/views/create_channel.js +++ b/app/actions/views/create_channel.js @@ -1,13 +1,14 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {handleSelectChannel, setChannelDisplayName} from './channel'; import {createChannel} from '@mm-redux/actions/channels'; import {getCurrentTeamId} from '@mm-redux/selectors/entities/teams'; import {getCurrentUserId} from '@mm-redux/selectors/entities/users'; import {cleanUpUrlable} from '@mm-redux/utils/channel_utils'; import {generateId} from '@mm-redux/utils/helpers'; +import {handleSelectChannel, setChannelDisplayName} from './channel'; + export function generateChannelNameFromDisplayName(displayName) { let name = cleanUpUrlable(displayName); diff --git a/app/actions/views/create_channel.test.js b/app/actions/views/create_channel.test.js index f449fc596..c0c974859 100644 --- a/app/actions/views/create_channel.test.js +++ b/app/actions/views/create_channel.test.js @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {generateChannelNameFromDisplayName} from 'app/actions/views/create_channel'; +import {generateChannelNameFromDisplayName} from '@actions/views/create_channel'; describe('Actions.Views.CreateChannel', () => { describe('generateChannelNameFromDisplayName', () => { diff --git a/app/actions/views/crt.ts b/app/actions/views/crt.ts index ea8742196..2aeb29c86 100644 --- a/app/actions/views/crt.ts +++ b/app/actions/views/crt.ts @@ -5,11 +5,11 @@ import {PreferenceTypes} from '@mm-redux/action_types'; import {General, Preferences} from '@mm-redux/constants'; import {getConfig} from '@mm-redux/selectors/entities/general'; import {getCollapsedThreadsPreference} from '@mm-redux/selectors/entities/preferences'; +import EventEmitter from '@mm-redux/utils/event_emitter'; + import type {ActionResult, DispatchFunc, GetStateFunc} from '@mm-redux/types/actions'; import type {PreferenceType} from '@mm-redux/types/preferences'; -import EventEmitter from '@mm-redux/utils/event_emitter'; - export function handleCRTPreferenceChange(preferences: PreferenceType[]) { return async (dispatch: DispatchFunc, getState: GetStateFunc): Promise => { const state = getState(); diff --git a/app/actions/views/custom_status.ts b/app/actions/views/custom_status.ts index c0a179e11..97f12d845 100644 --- a/app/actions/views/custom_status.ts +++ b/app/actions/views/custom_status.ts @@ -2,8 +2,8 @@ // See LICENSE.txt for license information. import {Client4} from '@client/rest'; -import {logError} from '@mm-redux/actions/errors'; import {UserTypes} from '@mm-redux/action_types'; +import {logError} from '@mm-redux/actions/errors'; import {getCurrentUser} from '@mm-redux/selectors/entities/common'; import {ActionFunc, DispatchFunc, batchActions, GetStateFunc} from '@mm-redux/types/actions'; import {UserCustomStatus} from '@mm-redux/types/users'; diff --git a/app/actions/views/edit_profile.js b/app/actions/views/edit_profile.js index 2b50a994b..15adf2fea 100644 --- a/app/actions/views/edit_profile.js +++ b/app/actions/views/edit_profile.js @@ -1,10 +1,9 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import {ViewTypes} from '@constants'; import {updateMe, setDefaultProfileImage} from '@mm-redux/actions/users'; -import {ViewTypes} from 'app/constants'; - export function updateUser(user, success, error) { return async (dispatch, getState) => { const result = await updateMe(user)(dispatch, getState); diff --git a/app/actions/views/emoji.js b/app/actions/views/emoji.js index a9296636b..37478b496 100644 --- a/app/actions/views/emoji.js +++ b/app/actions/views/emoji.js @@ -1,16 +1,15 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import emojiRegex from 'emoji-regex'; import {batchActions} from 'redux-batched-actions'; +import {Client4} from '@client/rest'; +import {ViewTypes} from '@constants'; import {EmojiTypes} from '@mm-redux/action_types'; import {addReaction as serviceAddReaction, getNeededCustomEmojis} from '@mm-redux/actions/posts'; -import {Client4} from '@client/rest'; import {getPostIdsInCurrentChannel, makeGetPostIdsForThread} from '@mm-redux/selectors/entities/posts'; - -import {ViewTypes} from 'app/constants'; import {EmojiIndicesByAlias, EmojiIndicesByUnicode, Emojis} from '@utils/emojis'; -import emojiRegex from 'emoji-regex'; const getPostIdsForThread = makeGetPostIdsForThread(); diff --git a/app/actions/views/file_upload.js b/app/actions/views/file_upload.js index 3f5dd1e48..5b9e19857 100644 --- a/app/actions/views/file_upload.js +++ b/app/actions/views/file_upload.js @@ -1,10 +1,9 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import {ViewTypes} from '@constants'; import {FileTypes} from '@mm-redux/action_types'; - -import {ViewTypes} from 'app/constants'; -import {buildFileUploadData, generateId} from 'app/utils/file'; +import {buildFileUploadData, generateId} from '@utils/file'; export function initUploadFiles(files, rootId) { return (dispatch, getState) => { diff --git a/app/actions/views/login.js b/app/actions/views/login.js index b4657c99e..5467916a1 100644 --- a/app/actions/views/login.js +++ b/app/actions/views/login.js @@ -3,20 +3,19 @@ import moment from 'moment-timezone'; -import {getDataRetentionPolicy} from '@mm-redux/actions/general'; -import {GeneralTypes} from '@mm-redux/action_types'; -import {getSessions} from '@mm-redux/actions/users'; -import {autoUpdateTimezone} from '@mm-redux/actions/timezone'; +import {loadConfigAndLicense} from '@actions/views/root'; import {Client4} from '@client/rest'; +import {setAppCredentials} from '@init/credentials'; +import PushNotifications from '@init/push_notifications'; +import {GeneralTypes} from '@mm-redux/action_types'; +import {getDataRetentionPolicy} from '@mm-redux/actions/general'; +import {autoUpdateTimezone} from '@mm-redux/actions/timezone'; +import {getSessions} from '@mm-redux/actions/users'; import {getConfig, getLicense} from '@mm-redux/selectors/entities/general'; import {isTimezoneEnabled} from '@mm-redux/selectors/entities/timezone'; import {getCurrentUserId} from '@mm-redux/selectors/entities/users'; - -import {setAppCredentials} from 'app/init/credentials'; -import PushNotifications from '@init/push_notifications'; -import {getDeviceTimezone} from 'app/utils/timezone'; -import {setCSRFFromCookie} from 'app/utils/security'; -import {loadConfigAndLicense} from 'app/actions/views/root'; +import {setCSRFFromCookie} from '@utils/security'; +import {getDeviceTimezone} from '@utils/timezone'; export function handleSuccessfulLogin() { return async (dispatch, getState) => { diff --git a/app/actions/views/login.test.js b/app/actions/views/login.test.js index 307458db6..584b37375 100644 --- a/app/actions/views/login.test.js +++ b/app/actions/views/login.test.js @@ -4,10 +4,9 @@ import configureStore from 'redux-mock-store'; import thunk from 'redux-thunk'; +import {handleSuccessfulLogin} from '@actions/views/login'; import {Client4} from '@client/rest'; -import {handleSuccessfulLogin} from 'app/actions/views/login'; - jest.mock('app/init/credentials', () => ({ setAppCredentials: () => jest.fn(), })); diff --git a/app/actions/views/more_dms.js b/app/actions/views/more_dms.js index 250345a98..63ab38d38 100644 --- a/app/actions/views/more_dms.js +++ b/app/actions/views/more_dms.js @@ -1,10 +1,10 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {getDirectChannelName} from '@mm-redux/utils/channel_utils'; +import {handleSelectChannel, toggleDMChannel, toggleGMChannel} from '@actions/views/channel'; import {createDirectChannel, createGroupChannel} from '@mm-redux/actions/channels'; import {getProfilesByIds, getStatusesByIds} from '@mm-redux/actions/users'; -import {handleSelectChannel, toggleDMChannel, toggleGMChannel} from 'app/actions/views/channel'; +import {getDirectChannelName} from '@mm-redux/utils/channel_utils'; export function makeDirectChannel(otherUserId, switchToChannel = true) { return async (dispatch, getState) => { diff --git a/app/actions/views/post.js b/app/actions/views/post.js index 9d39faadb..de527891c 100644 --- a/app/actions/views/post.js +++ b/app/actions/views/post.js @@ -3,6 +3,8 @@ import {batchActions} from 'redux-batched-actions'; +import {Client4} from '@client/rest'; +import {ViewTypes} from '@constants'; import {UserTypes} from '@mm-redux/action_types'; import { doPostAction, @@ -15,17 +17,14 @@ import { receivedPostsSince, receivedPostsInThread, } from '@mm-redux/actions/posts'; -import {Client4} from '@client/rest'; import {Posts} from '@mm-redux/constants'; -import {getPost as selectPost, getPostIdsInChannel} from '@mm-redux/selectors/entities/posts'; import {getCurrentChannelId} from '@mm-redux/selectors/entities/channels'; +import {getPost as selectPost, getPostIdsInChannel} from '@mm-redux/selectors/entities/posts'; import {isCollapsedThreadsEnabled} from '@mm-redux/selectors/entities/preferences'; -import {removeUserFromList} from '@mm-redux/utils/user_utils'; import {isUnreadChannel, isArchivedChannel} from '@mm-redux/utils/channel_utils'; - -import {ViewTypes} from '@constants'; -import {generateId} from '@utils/file'; +import {removeUserFromList} from '@mm-redux/utils/user_utils'; import {getChannelSinceValue} from '@utils/channels'; +import {generateId} from '@utils/file'; import {getEmojisInPosts} from './emoji'; diff --git a/app/actions/views/post.test.js b/app/actions/views/post.test.js index c9961cfbe..b3628d8ba 100644 --- a/app/actions/views/post.test.js +++ b/app/actions/views/post.test.js @@ -6,17 +6,14 @@ import configureStore from 'redux-mock-store'; import thunk from 'redux-thunk'; +import {loadUnreadChannelPosts} from '@actions/views/post'; import {Client4} from '@client/rest'; +import {ViewTypes} from '@constants'; import {PostTypes, UserTypes} from '@mm-redux/action_types'; - import * as PostSelectors from '@mm-redux/selectors/entities/posts'; import * as ChannelUtils from '@mm-redux/utils/channel_utils'; - -import {ViewTypes} from '@constants'; import initialState from '@store/initial_state'; -import {loadUnreadChannelPosts} from '@actions/views/post'; - describe('Actions.Views.Post', () => { const mockStore = configureStore([thunk]); diff --git a/app/actions/views/root.js b/app/actions/views/root.js index 124966bd3..e9c72eb64 100644 --- a/app/actions/views/root.js +++ b/app/actions/views/root.js @@ -3,13 +3,13 @@ import {batchActions} from 'redux-batched-actions'; +import {Client4} from '@client/rest'; import {NavigationTypes, ViewTypes} from '@constants'; import {ChannelTypes, GeneralTypes, TeamTypes} from '@mm-redux/action_types'; import {fetchMyChannelsAndMembers, getChannelAndMyMember} from '@mm-redux/actions/channels'; import {getDataRetentionPolicy} from '@mm-redux/actions/general'; import {receivedNewPost} from '@mm-redux/actions/posts'; import {getMyTeams, getMyTeamMembers} from '@mm-redux/actions/teams'; -import {Client4} from '@client/rest'; import {General} from '@mm-redux/constants'; import {isCollapsedThreadsEnabled} from '@mm-redux/selectors/entities/preferences'; import EventEmitter from '@mm-redux/utils/event_emitter'; diff --git a/app/actions/views/search.js b/app/actions/views/search.js index 93af1e4da..b6a6f69be 100644 --- a/app/actions/views/search.js +++ b/app/actions/views/search.js @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {ViewTypes} from 'app/constants'; +import {ViewTypes} from '@constants'; export function handleSearchDraftChanged(text) { return { diff --git a/app/actions/views/select_server.js b/app/actions/views/select_server.js index e7142a3b1..0ea6e22c9 100644 --- a/app/actions/views/select_server.js +++ b/app/actions/views/select_server.js @@ -2,9 +2,9 @@ // See LICENSE.txt for license information. import {batchActions} from 'redux-batched-actions'; -import {GeneralTypes} from '@mm-redux/action_types'; -import {ViewTypes} from 'app/constants'; +import {ViewTypes} from '@constants'; +import {GeneralTypes} from '@mm-redux/action_types'; export function handleServerUrlChanged(serverUrl) { return batchActions([ diff --git a/app/actions/views/select_server.test.js b/app/actions/views/select_server.test.js index 84afe3e56..0f406e1d4 100644 --- a/app/actions/views/select_server.test.js +++ b/app/actions/views/select_server.test.js @@ -5,12 +5,10 @@ import {batchActions} from 'redux-batched-actions'; import configureStore from 'redux-mock-store'; import thunk from 'redux-thunk'; +import {handleServerUrlChanged} from '@actions/views/select_server'; +import {ViewTypes} from '@constants'; import {GeneralTypes} from '@mm-redux/action_types'; -import {ViewTypes} from 'app/constants'; - -import {handleServerUrlChanged} from 'app/actions/views/select_server'; - const mockStore = configureStore([thunk]); describe('Actions.Views.SelectServer', () => { diff --git a/app/actions/views/select_team.js b/app/actions/views/select_team.js index 76047fb99..e4ca2a01f 100644 --- a/app/actions/views/select_team.js +++ b/app/actions/views/select_team.js @@ -10,8 +10,8 @@ import {getMyTeams} from '@mm-redux/actions/teams'; import {Preferences, RequestStatus} from '@mm-redux/constants'; import {getConfig} from '@mm-redux/selectors/entities/general'; import {get as getPreference} from '@mm-redux/selectors/entities/preferences'; -import {getCurrentLocale} from 'app/selectors/i18n'; import EventEmitter from '@mm-redux/utils/event_emitter'; +import {getCurrentLocale} from '@selectors/i18n'; import {selectFirstAvailableTeam} from '@utils/teams'; export function handleTeamChange(teamId) { diff --git a/app/actions/views/session.js b/app/actions/views/session.js index 91c62c688..01c84d817 100644 --- a/app/actions/views/session.js +++ b/app/actions/views/session.js @@ -3,13 +3,12 @@ import moment from 'moment-timezone'; -import {getSessions} from '@mm-redux/actions/users'; import {Client4} from '@client/rest'; +import PushNotifications from '@init/push_notifications'; +import {getSessions} from '@mm-redux/actions/users'; import {getConfig} from '@mm-redux/selectors/entities/general'; import {isMinimumServerVersion} from '@mm-redux/utils/helpers'; -import PushNotifications from '@init/push_notifications'; - const sortByNewest = (a, b) => { if (a.create_at > b.create_at) { return -1; diff --git a/app/actions/views/thread.js b/app/actions/views/thread.js index de6240e5c..9e3db028d 100644 --- a/app/actions/views/thread.js +++ b/app/actions/views/thread.js @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {ViewTypes} from 'app/constants'; +import {ViewTypes} from '@constants'; export function handleCommentDraftChanged(rootId, draft) { return (dispatch, getState) => { diff --git a/app/actions/views/thread.test.js b/app/actions/views/thread.test.js index 6ae47a62a..b181a03fe 100644 --- a/app/actions/views/thread.test.js +++ b/app/actions/views/thread.test.js @@ -4,12 +4,11 @@ import configureStore from 'redux-mock-store'; import thunk from 'redux-thunk'; -import {ViewTypes} from 'app/constants'; - import { handleCommentDraftChanged, handleCommentDraftSelectionChanged, -} from 'app/actions/views/thread'; +} from '@actions/views/thread'; +import {ViewTypes} from '@constants'; const mockStore = configureStore([thunk]); diff --git a/app/actions/views/user.js b/app/actions/views/user.js index 1165c45f7..3fa07c6fb 100644 --- a/app/actions/views/user.js +++ b/app/actions/views/user.js @@ -3,23 +3,22 @@ import {batchActions} from 'redux-batched-actions'; -import {NavigationTypes} from 'app/constants'; import {handleCRTPreferenceChange} from '@actions/views/crt'; +import {Client4} from '@client/rest'; +import {NavigationTypes} from '@constants'; +import {analytics} from '@init/analytics.ts'; +import {setAppCredentials} from '@init/credentials'; import {GeneralTypes, RoleTypes, UserTypes} from '@mm-redux/action_types'; import {getDataRetentionPolicy} from '@mm-redux/actions/general'; import * as HelperActions from '@mm-redux/actions/helpers'; import {autoUpdateTimezone} from '@mm-redux/actions/timezone'; -import {Client4} from '@client/rest'; import {General} from '@mm-redux/constants'; -import EventEmitter from '@mm-redux/utils/event_emitter'; import {getLicense} from '@mm-redux/selectors/entities/general'; import {isTimezoneEnabled} from '@mm-redux/selectors/entities/timezone'; import {getCurrentUserId, getStatusForUserId} from '@mm-redux/selectors/entities/users'; - -import {setAppCredentials} from 'app/init/credentials'; +import EventEmitter from '@mm-redux/utils/event_emitter'; import {setCSRFFromCookie} from '@utils/security'; import {getDeviceTimezone} from '@utils/timezone'; -import {analytics} from '@init/analytics.ts'; const HTTP_UNAUTHORIZED = 401; diff --git a/app/actions/views/user.test.js b/app/actions/views/user.test.js index c4bc4f313..299e5e49f 100644 --- a/app/actions/views/user.test.js +++ b/app/actions/views/user.test.js @@ -4,11 +4,10 @@ import configureStore from 'redux-mock-store'; import thunk from 'redux-thunk'; +import {setCurrentUserStatusOffline} from '@actions/views/user'; import {UserTypes} from '@mm-redux/action_types'; import {General} from '@mm-redux/constants'; -import {setCurrentUserStatusOffline} from 'app/actions/views/user'; - const mockStore = configureStore([thunk]); jest.mock('@mm-redux/actions/users', () => ({ diff --git a/app/actions/websocket/channels.test.js b/app/actions/websocket/channels.test.js index 79badc58a..956b5c8e5 100644 --- a/app/actions/websocket/channels.test.js +++ b/app/actions/websocket/channels.test.js @@ -4,23 +4,22 @@ /* eslint-disable no-import-assign */ import assert from 'assert'; -import nock from 'nock'; -import {Server, WebSocket as MockWebSocket} from 'mock-socket'; -import thunk from 'redux-thunk'; -import configureMockStore from 'redux-mock-store'; +import {Server, WebSocket as MockWebSocket} from 'mock-socket'; +import nock from 'nock'; +import configureMockStore from 'redux-mock-store'; +import thunk from 'redux-thunk'; + +import * as Actions from '@actions/websocket'; +import {Client4} from '@client/rest'; +import {WebsocketEvents} from '@constants'; import {ChannelTypes, RoleTypes} from '@mm-redux/action_types'; import * as ChannelActions from '@mm-redux/actions/channels'; import * as TeamActions from '@mm-redux/actions/teams'; -import {Client4} from '@client/rest'; import {General} from '@mm-redux/constants'; - -import * as Actions from '@actions/websocket'; -import {WebsocketEvents} from '@constants'; import globalInitialState from '@store/initial_state'; - -import TestHelper from 'test/test_helper'; -import configureStore from 'test/test_store'; +import TestHelper from '@test/test_helper'; +import configureStore from '@test/test_store'; global.WebSocket = MockWebSocket; diff --git a/app/actions/websocket/channels.ts b/app/actions/websocket/channels.ts index 399cce0d1..29c617208 100644 --- a/app/actions/websocket/channels.ts +++ b/app/actions/websocket/channels.ts @@ -3,10 +3,10 @@ import {fetchChannelAndMyMember} from '@actions/helpers/channels'; import {loadChannelsForTeam} from '@actions/views/channel'; -import {WebsocketEvents} from '@constants'; -import {markChannelAsRead} from '@mm-redux/actions/channels'; import {Client4} from '@client/rest'; +import {WebsocketEvents} from '@constants'; import {ChannelTypes, TeamTypes, RoleTypes} from '@mm-redux/action_types'; +import {markChannelAsRead} from '@mm-redux/actions/channels'; import {General} from '@mm-redux/constants'; import { getAllChannels, diff --git a/app/actions/websocket/general.test.js b/app/actions/websocket/general.test.js index b99517706..f946d945b 100644 --- a/app/actions/websocket/general.test.js +++ b/app/actions/websocket/general.test.js @@ -4,14 +4,14 @@ /* eslint-disable no-import-assign */ import assert from 'assert'; + import {Server, WebSocket as MockWebSocket} from 'mock-socket'; -import {Client4} from '@client/rest'; import * as Actions from '@actions/websocket'; +import {Client4} from '@client/rest'; import {WebsocketEvents} from '@constants'; - -import TestHelper from 'test/test_helper'; -import configureStore from 'test/test_store'; +import TestHelper from '@test/test_helper'; +import configureStore from '@test/test_store'; global.WebSocket = MockWebSocket; diff --git a/app/actions/websocket/general.ts b/app/actions/websocket/general.ts index d0777ab92..caacafd9a 100644 --- a/app/actions/websocket/general.ts +++ b/app/actions/websocket/general.ts @@ -3,9 +3,9 @@ import {GeneralTypes} from '@mm-redux/action_types'; import {General} from '@mm-redux/constants'; -import EventEmitter from '@mm-redux/utils/event_emitter'; import {GenericAction} from '@mm-redux/types/actions'; import {WebSocketMessage} from '@mm-redux/types/websocket'; +import EventEmitter from '@mm-redux/utils/event_emitter'; export function handleConfigChangedEvent(msg: WebSocketMessage): GenericAction { const data = msg.data.config; diff --git a/app/actions/websocket/index.ts b/app/actions/websocket/index.ts index e5b68e280..ae7a79686 100644 --- a/app/actions/websocket/index.ts +++ b/app/actions/websocket/index.ts @@ -4,11 +4,11 @@ import {loadChannelsForTeam, setChannelRetryFailed} from '@actions/views/channel'; import {getPostsSince} from '@actions/views/post'; import {loadMe} from '@actions/views/user'; +import {Client4} from '@client/rest'; import {WebsocketEvents} from '@constants'; import {ChannelTypes, GeneralTypes, PreferenceTypes, TeamTypes, UserTypes, RoleTypes} from '@mm-redux/action_types'; -import {getProfilesByIds, getStatusesByIds} from '@mm-redux/actions/users'; -import {Client4} from '@client/rest'; import {getThreads} from '@mm-redux/actions/threads'; +import {getProfilesByIds, getStatusesByIds} from '@mm-redux/actions/users'; import {General} from '@mm-redux/constants'; import {getCurrentChannelId, getCurrentChannelStats} from '@mm-redux/selectors/entities/channels'; import {getConfig} from '@mm-redux/selectors/entities/general'; @@ -24,8 +24,10 @@ import {WebSocketMessage} from '@mm-redux/types/websocket'; import EventEmitter from '@mm-redux/utils/event_emitter'; import {isMinimumServerVersion} from '@mm-redux/utils/helpers'; import {removeUserFromList} from '@mm-redux/utils/user_utils'; +import {getChannelSinceValue} from '@utils/channels'; import websocketClient from '@websocket'; +import {handleRefreshAppsBindings} from './apps'; import { handleChannelConvertedEvent, handleChannelCreatedEvent, @@ -48,8 +50,6 @@ import {handleRoleAddedEvent, handleRoleRemovedEvent, handleRoleUpdatedEvent} fr import {handleLeaveTeamEvent, handleUpdateTeamEvent, handleTeamAddedEvent} from './teams'; import {handleThreadUpdated, handleThreadReadChanged, handleThreadFollowChanged} from './threads'; import {handleStatusChangedEvent, handleUserAddedEvent, handleUserRemovedEvent, handleUserRoleUpdated, handleUserUpdatedEvent} from './users'; -import {getChannelSinceValue} from '@utils/channels'; -import {handleRefreshAppsBindings} from './apps'; export function init(additionalOptions: any = {}) { return async (dispatch: DispatchFunc, getState: GetStateFunc) => { diff --git a/app/actions/websocket/integrations.test.js b/app/actions/websocket/integrations.test.js index 243a025d0..e93830707 100644 --- a/app/actions/websocket/integrations.test.js +++ b/app/actions/websocket/integrations.test.js @@ -2,14 +2,14 @@ // See LICENSE.txt for license information. import assert from 'assert'; + import {Server, WebSocket as MockWebSocket} from 'mock-socket'; -import {Client4} from '@client/rest'; import * as Actions from '@actions/websocket'; +import {Client4} from '@client/rest'; import {WebsocketEvents} from '@constants'; - -import TestHelper from 'test/test_helper'; -import configureStore from 'test/test_store'; +import TestHelper from '@test/test_helper'; +import configureStore from '@test/test_store'; global.WebSocket = MockWebSocket; diff --git a/app/actions/websocket/posts.test.js b/app/actions/websocket/posts.test.js index 5b9504811..14f155525 100644 --- a/app/actions/websocket/posts.test.js +++ b/app/actions/websocket/posts.test.js @@ -4,21 +4,20 @@ /* eslint-disable no-import-assign */ import assert from 'assert'; -import nock from 'nock'; -import {Server, WebSocket as MockWebSocket} from 'mock-socket'; +import {Server, WebSocket as MockWebSocket} from 'mock-socket'; +import nock from 'nock'; + +import * as Actions from '@actions/websocket'; +import {Client4} from '@client/rest'; +import {WebsocketEvents} from '@constants'; import * as ChannelActions from '@mm-redux/actions/channels'; import * as PostActions from '@mm-redux/actions/posts'; -import {Client4} from '@client/rest'; import {General, Posts} from '@mm-redux/constants'; import * as PostSelectors from '@mm-redux/selectors/entities/posts'; import EventEmitter from '@mm-redux/utils/event_emitter'; - -import * as Actions from '@actions/websocket'; -import {WebsocketEvents} from '@constants'; - -import TestHelper from 'test/test_helper'; -import configureStore from 'test/test_store'; +import TestHelper from '@test/test_helper'; +import configureStore from '@test/test_store'; global.WebSocket = MockWebSocket; diff --git a/app/actions/websocket/posts.ts b/app/actions/websocket/posts.ts index b6fb84982..266e8cfdd 100644 --- a/app/actions/websocket/posts.ts +++ b/app/actions/websocket/posts.ts @@ -23,10 +23,10 @@ import { import {getPost as selectPost} from '@mm-redux/selectors/entities/posts'; import {isCollapsedThreadsEnabled} from '@mm-redux/selectors/entities/preferences'; import {getCurrentUserId} from '@mm-redux/selectors/entities/users'; -import EventEmitter from '@mm-redux/utils/event_emitter'; import {ActionResult, DispatchFunc, GenericAction, GetStateFunc, batchActions} from '@mm-redux/types/actions'; import {WebSocketMessage} from '@mm-redux/types/websocket'; import {getUserIdFromChannelName} from '@mm-redux/utils/channel_utils'; +import EventEmitter from '@mm-redux/utils/event_emitter'; import {isFromWebhook, isSystemMessage, shouldIgnorePost} from '@mm-redux/utils/post_utils'; import {getViewingGlobalThreads} from '@selectors/threads'; diff --git a/app/actions/websocket/preferences.ts b/app/actions/websocket/preferences.ts index a356a8af7..0cbeeec72 100644 --- a/app/actions/websocket/preferences.ts +++ b/app/actions/websocket/preferences.ts @@ -3,7 +3,6 @@ import {getAddedDmUsersIfNecessary} from '@actions/helpers/channels'; import {handleCRTPreferenceChange} from '@actions/views/crt'; - import {getPost} from '@actions/views/post'; import {PreferenceTypes} from '@mm-redux/action_types'; import {Preferences} from '@mm-redux/constants'; diff --git a/app/actions/websocket/reactions.test.js b/app/actions/websocket/reactions.test.js index 7ea1eea6b..694f0e122 100644 --- a/app/actions/websocket/reactions.test.js +++ b/app/actions/websocket/reactions.test.js @@ -2,15 +2,14 @@ // See LICENSE.txt for license information. import assert from 'assert'; + import {Server, WebSocket as MockWebSocket} from 'mock-socket'; -import {Client4} from '@client/rest'; - import * as Actions from '@actions/websocket'; +import {Client4} from '@client/rest'; import {WebsocketEvents} from '@constants'; - -import TestHelper from 'test/test_helper'; -import configureStore from 'test/test_store'; +import TestHelper from '@test/test_helper'; +import configureStore from '@test/test_store'; global.WebSocket = MockWebSocket; diff --git a/app/actions/websocket/teams.test.js b/app/actions/websocket/teams.test.js index eb290c8d9..c9efb3bc1 100644 --- a/app/actions/websocket/teams.test.js +++ b/app/actions/websocket/teams.test.js @@ -2,18 +2,17 @@ // See LICENSE.txt for license information. import assert from 'assert'; -import nock from 'nock'; + import {Server, WebSocket as MockWebSocket} from 'mock-socket'; +import nock from 'nock'; import {batchActions} from 'redux-batched-actions'; -import {TeamTypes, UserTypes} from '@mm-redux/action_types'; -import {Client4} from '@client/rest'; - import * as Actions from '@actions/websocket'; +import {Client4} from '@client/rest'; import {WebsocketEvents} from '@constants'; - -import TestHelper from 'test/test_helper'; -import configureStore from 'test/test_store'; +import {TeamTypes, UserTypes} from '@mm-redux/action_types'; +import TestHelper from '@test/test_helper'; +import configureStore from '@test/test_store'; global.WebSocket = MockWebSocket; diff --git a/app/actions/websocket/teams.ts b/app/actions/websocket/teams.ts index ecef00607..11cbc2965 100644 --- a/app/actions/websocket/teams.ts +++ b/app/actions/websocket/teams.ts @@ -1,9 +1,9 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import {Client4} from '@client/rest'; import {RoleTypes, TeamTypes} from '@mm-redux/action_types'; import {notVisibleUsersActions} from '@mm-redux/actions/helpers'; -import {Client4} from '@client/rest'; import {getCurrentTeamId, getTeams as getTeamsSelector} from '@mm-redux/selectors/entities/teams'; import {getCurrentUser} from '@mm-redux/selectors/entities/users'; import {ActionResult, DispatchFunc, GenericAction, GetStateFunc, batchActions} from '@mm-redux/types/actions'; diff --git a/app/actions/websocket/users.test.js b/app/actions/websocket/users.test.js index 8b1b564d8..abc48dc4d 100644 --- a/app/actions/websocket/users.test.js +++ b/app/actions/websocket/users.test.js @@ -2,16 +2,16 @@ // See LICENSE.txt for license information. import assert from 'assert'; + import {Server, WebSocket as MockWebSocket} from 'mock-socket'; import {batchActions} from 'redux-batched-actions'; -import {TeamTypes, UserTypes} from '@mm-redux/action_types'; -import {Client4} from '@client/rest'; import * as Actions from '@actions/websocket'; +import {Client4} from '@client/rest'; import {WebsocketEvents} from '@constants'; - -import TestHelper from 'test/test_helper'; -import configureStore from 'test/test_store'; +import {TeamTypes, UserTypes} from '@mm-redux/action_types'; +import TestHelper from '@test/test_helper'; +import configureStore from '@test/test_store'; global.WebSocket = MockWebSocket; diff --git a/app/actions/websocket/users.ts b/app/actions/websocket/users.ts index 3120d54f9..c230ded77 100644 --- a/app/actions/websocket/users.ts +++ b/app/actions/websocket/users.ts @@ -4,16 +4,16 @@ import {fetchChannelAndMyMember} from '@actions/helpers/channels'; import {loadChannelsForTeam} from '@actions/views/channel'; import {getMe} from '@actions/views/user'; +import {Client4} from '@client/rest'; import {ChannelTypes, TeamTypes, UserTypes, RoleTypes} from '@mm-redux/action_types'; import {notVisibleUsersActions} from '@mm-redux/actions/helpers'; -import {Client4} from '@client/rest'; import {General} from '@mm-redux/constants'; import {getAllChannels, getCurrentChannelId, getChannelMembersInChannels} from '@mm-redux/selectors/entities/channels'; import {getCurrentTeamId} from '@mm-redux/selectors/entities/teams'; import {getCurrentUser, getCurrentUserId} from '@mm-redux/selectors/entities/users'; -import EventEmitter from '@mm-redux/utils/event_emitter'; import {ActionResult, DispatchFunc, GenericAction, GetStateFunc, batchActions} from '@mm-redux/types/actions'; import {WebSocketMessage} from '@mm-redux/types/websocket'; +import EventEmitter from '@mm-redux/utils/event_emitter'; import {isGuest} from '@mm-redux/utils/user_utils'; export function handleStatusChangedEvent(msg: WebSocketMessage): GenericAction { diff --git a/app/actions/websocket/websocket.test.js b/app/actions/websocket/websocket.test.js index 2d6f5c603..fedb30b3a 100644 --- a/app/actions/websocket/websocket.test.js +++ b/app/actions/websocket/websocket.test.js @@ -4,21 +4,20 @@ /* eslint-disable no-import-assign */ import assert from 'assert'; -import nock from 'nock'; -import {Server, WebSocket as MockWebSocket} from 'mock-socket'; -import thunk from 'redux-thunk'; -import configureMockStore from 'redux-mock-store'; -import {UserTypes} from '@mm-redux/action_types'; -import {notVisibleUsersActions} from '@mm-redux/actions/helpers'; -import {Client4} from '@client/rest'; -import {General, Posts, RequestStatus} from '@mm-redux/constants'; +import {Server, WebSocket as MockWebSocket} from 'mock-socket'; +import nock from 'nock'; +import configureMockStore from 'redux-mock-store'; +import thunk from 'redux-thunk'; import * as Actions from '@actions/websocket'; +import {Client4} from '@client/rest'; import {WebsocketEvents} from '@constants'; - -import TestHelper from 'test/test_helper'; -import configureStore from 'test/test_store'; +import {UserTypes} from '@mm-redux/action_types'; +import {notVisibleUsersActions} from '@mm-redux/actions/helpers'; +import {General, Posts, RequestStatus} from '@mm-redux/constants'; +import TestHelper from '@test/test_helper'; +import configureStore from '@test/test_store'; global.WebSocket = MockWebSocket; diff --git a/app/client/rest/apps.ts b/app/client/rest/apps.ts index ab11a2774..38b52295a 100644 --- a/app/client/rest/apps.ts +++ b/app/client/rest/apps.ts @@ -1,9 +1,10 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import type {AppBinding, AppCallRequest, AppCallResponse, AppCallType} from '@mm-redux/types/apps'; import {buildQueryString} from '@mm-redux/utils/helpers'; +import type {AppBinding, AppCallRequest, AppCallResponse, AppCallType} from '@mm-redux/types/apps'; + export interface ClientAppsMix { executeAppCall: (call: AppCallRequest, type: AppCallType) => Promise; getAppsBindings: (userID: string, channelID: string, teamID: string) => Promise; diff --git a/app/client/rest/channels.ts b/app/client/rest/channels.ts index 1b8762b01..0f90c5935 100644 --- a/app/client/rest/channels.ts +++ b/app/client/rest/channels.ts @@ -18,7 +18,7 @@ export interface ClientChannelsMix { convertChannelToPrivate: (channelId: string) => Promise; updateChannelPrivacy: (channelId: string, privacy: any) => Promise; patchChannel: (channelId: string, channelPatch: Partial) => Promise; - updateChannelNotifyProps: (props: ChannelNotifyProps & {channel_id: string, user_id: string}) => Promise; + updateChannelNotifyProps: (props: ChannelNotifyProps & {channel_id: string; user_id: string}) => Promise; getChannel: (channelId: string) => Promise; getChannelByName: (teamId: string, channelName: string, includeDeleted?: boolean) => Promise; getChannelByNameAndTeamName: (teamName: string, channelName: string, includeDeleted?: boolean) => Promise; @@ -138,7 +138,7 @@ const ClientChannels = (superclass: any) => class extends superclass { ); }; - updateChannelNotifyProps = async (props: ChannelNotifyProps & {channel_id: string, user_id: string}) => { + updateChannelNotifyProps = async (props: ChannelNotifyProps & {channel_id: string; user_id: string}) => { analytics.trackAPI('api_users_update_channel_notifications', {channel_id: props.channel_id}); return this.doFetch( diff --git a/app/client/rest/index.test.js b/app/client/rest/index.test.js index e585f3371..956e9a0aa 100644 --- a/app/client/rest/index.test.js +++ b/app/client/rest/index.test.js @@ -2,12 +2,13 @@ // See LICENSE.txt for license information. import assert from 'assert'; + import nock from 'nock'; import {HEADER_X_VERSION_ID} from '@client/rest/constants'; import ClientError from '@client/rest/error'; -import TestHelper from 'test/test_helper'; import {isMinimumServerVersion} from '@mm-redux/utils/helpers'; +import TestHelper from '@test/test_helper'; describe('Client4', () => { beforeAll(() => { diff --git a/app/client/rest/index.ts b/app/client/rest/index.ts index 7cebb0369..d78413699 100644 --- a/app/client/rest/index.ts +++ b/app/client/rest/index.ts @@ -3,11 +3,11 @@ import mix from '@utils/mix'; -import {DEFAULT_LIMIT_AFTER, DEFAULT_LIMIT_BEFORE, HEADER_X_VERSION_ID} from './constants'; import ClientApps, {ClientAppsMix} from './apps'; import ClientBase from './base'; import ClientBots, {ClientBotsMix} from './bots'; import ClientChannels, {ClientChannelsMix} from './channels'; +import {DEFAULT_LIMIT_AFTER, DEFAULT_LIMIT_BEFORE, HEADER_X_VERSION_ID} from './constants'; import ClientEmojis, {ClientEmojisMix} from './emojis'; import ClientFiles, {ClientFilesMix} from './files'; import ClientGeneral, {ClientGeneralMix} from './general'; diff --git a/app/client/rest/users.ts b/app/client/rest/users.ts index c5ded531a..44371f2e7 100644 --- a/app/client/rest/users.ts +++ b/app/client/rest/users.ts @@ -35,7 +35,7 @@ export interface ClientUsersMix { getUserByEmail: (email: string) => Promise; getProfilePictureUrl: (userId: string, lastPictureUpdate: number) => string; getDefaultProfilePictureUrl: (userId: string) => string; - autocompleteUsers: (name: string, teamId: string, channelId: string, options?: Record) => Promise<{users: UserProfile[], out_of_channel?: UserProfile[]}>; + autocompleteUsers: (name: string, teamId: string, channelId: string, options?: Record) => Promise<{users: UserProfile[]; out_of_channel?: UserProfile[]}>; getSessions: (userId: string) => Promise; checkUserMfa: (loginId: string) => Promise<{mfa_required: boolean}>; attachDevice: (deviceId: string) => Promise; diff --git a/app/components/announcement_banner/announcement_banner.js b/app/components/announcement_banner/announcement_banner.js index 932876626..0fcae0d06 100644 --- a/app/components/announcement_banner/announcement_banner.js +++ b/app/components/announcement_banner/announcement_banner.js @@ -1,15 +1,15 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {useEffect, useRef, useState} from 'react'; import PropTypes from 'prop-types'; +import React, {useEffect, useRef, useState} from 'react'; +import {injectIntl} from 'react-intl'; import { Animated, StyleSheet, Text, TouchableOpacity, } from 'react-native'; -import {injectIntl} from 'react-intl'; import {useSafeAreaInsets} from 'react-native-safe-area-context'; import {goToScreen} from '@actions/navigation'; diff --git a/app/components/announcement_banner/announcement_banner.test.js b/app/components/announcement_banner/announcement_banner.test.js index cd9c529bf..802ae6fd8 100644 --- a/app/components/announcement_banner/announcement_banner.test.js +++ b/app/components/announcement_banner/announcement_banner.test.js @@ -2,9 +2,9 @@ // See LICENSE.txt for license information. import React from 'react'; -import {shallowWithIntl} from 'test/intl-test-helper'; import Preferences from '@mm-redux/constants/preferences'; +import {shallowWithIntl} from '@test/intl-test-helper'; import AnnouncementBanner from './announcement_banner.js'; diff --git a/app/components/announcement_banner/index.js b/app/components/announcement_banner/index.js index 245628431..cba056146 100644 --- a/app/components/announcement_banner/index.js +++ b/app/components/announcement_banner/index.js @@ -4,8 +4,7 @@ import {connect} from 'react-redux'; import {getConfig, getLicense} from '@mm-redux/selectors/entities/general'; - -import {isLandscape} from 'app/selectors/device'; +import {isLandscape} from '@selectors/device'; import AnnouncementBanner from './announcement_banner'; diff --git a/app/components/at_mention/at_mention.js b/app/components/at_mention/at_mention.js index e6bbf0c4c..31c2944e8 100644 --- a/app/components/at_mention/at_mention.js +++ b/app/components/at_mention/at_mention.js @@ -1,17 +1,18 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; -import PropTypes from 'prop-types'; -import {StyleSheet, Text} from 'react-native'; import Clipboard from '@react-native-community/clipboard'; + +import PropTypes from 'prop-types'; +import React from 'react'; import {intlShape} from 'react-intl'; -import {displayUsername} from '@mm-redux/utils/user_utils'; +import {StyleSheet, Text} from 'react-native'; import {showModal} from '@actions/navigation'; import CompassIcon from '@components/compass_icon'; +import mattermostManaged from '@mattermost-managed'; +import {displayUsername} from '@mm-redux/utils/user_utils'; import BottomSheet from '@utils/bottom_sheet'; -import mattermostManaged from 'app/mattermost_managed'; export default class AtMention extends React.PureComponent { static propTypes = { diff --git a/app/components/at_mention/at_mention.test.js b/app/components/at_mention/at_mention.test.js index c996b1aeb..dd57e376d 100644 --- a/app/components/at_mention/at_mention.test.js +++ b/app/components/at_mention/at_mention.test.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import {Preferences} from '@mm-redux/constants'; diff --git a/app/components/attachment_button/index.js b/app/components/attachment_button/index.js index 0066b1792..37bb83067 100644 --- a/app/components/attachment_button/index.js +++ b/app/components/attachment_button/index.js @@ -1,7 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; + import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import {intlShape} from 'react-intl'; import { Alert, @@ -10,13 +11,12 @@ import { StyleSheet, StatusBar, } from 'react-native'; -import RNFetchBlob from 'rn-fetch-blob'; -import DeviceInfo from 'react-native-device-info'; import AndroidOpenSettings from 'react-native-android-open-settings'; - +import DeviceInfo from 'react-native-device-info'; import DocumentPicker from 'react-native-document-picker'; import {launchImageLibrary, launchCamera} from 'react-native-image-picker'; import Permissions from 'react-native-permissions'; +import RNFetchBlob from 'rn-fetch-blob'; import {showModalOverCurrentContext} from '@actions/navigation'; import CompassIcon from '@components/compass_icon'; diff --git a/app/components/attachment_button/index.test.js b/app/components/attachment_button/index.test.js index 19442ab19..dc8d115e1 100644 --- a/app/components/attachment_button/index.test.js +++ b/app/components/attachment_button/index.test.js @@ -7,7 +7,7 @@ import Permissions from 'react-native-permissions'; import Preferences from '@mm-redux/constants/preferences'; import {VALID_MIME_TYPES} from '@screens/edit_profile/edit_profile'; -import {shallowWithIntl} from 'test/intl-test-helper'; +import {shallowWithIntl} from '@test/intl-test-helper'; import AttachmentButton from './index'; diff --git a/app/components/autocomplete/at_mention/at_mention.js b/app/components/autocomplete/at_mention/at_mention.js index 9355b6fe9..f69ac7a2a 100644 --- a/app/components/autocomplete/at_mention/at_mention.js +++ b/app/components/autocomplete/at_mention/at_mention.js @@ -1,19 +1,19 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import {Platform, SectionList} from 'react-native'; -import {AT_MENTION_REGEX, AT_MENTION_SEARCH_REGEX} from '@constants/autocomplete'; +import GroupMentionItem from '@components/autocomplete/at_mention_group/at_mention_group'; import AtMentionItem from '@components/autocomplete/at_mention_item'; import AutocompleteSectionHeader from '@components/autocomplete/autocomplete_section_header'; import SpecialMentionItem from '@components/autocomplete/special_mention_item'; -import GroupMentionItem from '@components/autocomplete/at_mention_group/at_mention_group'; -import {RequestStatus} from '@mm-redux/constants'; +import {AT_MENTION_REGEX, AT_MENTION_SEARCH_REGEX} from '@constants/autocomplete'; import {debounce} from '@mm-redux/actions/helpers'; -import {makeStyleSheetFromTheme} from '@utils/theme'; +import {RequestStatus} from '@mm-redux/constants'; import {t} from '@utils/i18n'; +import {makeStyleSheetFromTheme} from '@utils/theme'; export default class AtMention extends PureComponent { static propTypes = { diff --git a/app/components/autocomplete/at_mention/index.js b/app/components/autocomplete/at_mention/index.js index e83f35572..561f4d2d8 100644 --- a/app/components/autocomplete/at_mention/index.js +++ b/app/components/autocomplete/at_mention/index.js @@ -1,26 +1,24 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; -import {isMinimumServerVersion} from '@mm-redux/utils/helpers'; import {autocompleteUsers} from '@mm-redux/actions/users'; -import {getLicense} from '@mm-redux/selectors/entities/general'; +import {Permissions} from '@mm-redux/constants'; import {getCurrentChannelId, getDefaultChannel} from '@mm-redux/selectors/entities/channels'; +import {getLicense} from '@mm-redux/selectors/entities/general'; import {getAssociatedGroupsForReference, searchAssociatedGroupsForReferenceLocal} from '@mm-redux/selectors/entities/groups'; +import {getTheme} from '@mm-redux/selectors/entities/preferences'; +import {haveIChannelPermission} from '@mm-redux/selectors/entities/roles'; import {getCurrentTeamId} from '@mm-redux/selectors/entities/teams'; - +import {isMinimumServerVersion} from '@mm-redux/utils/helpers'; import { filterMembersInChannel, filterMembersNotInChannel, filterMembersInCurrentTeam, getMatchTermForAtMention, -} from 'app/selectors/autocomplete'; -import {getTheme} from '@mm-redux/selectors/entities/preferences'; - -import {haveIChannelPermission} from '@mm-redux/selectors/entities/roles'; -import {Permissions} from '@mm-redux/constants'; +} from '@selectors/autocomplete'; import AtMention from './at_mention'; diff --git a/app/components/autocomplete/at_mention_group/at_mention_group.js b/app/components/autocomplete/at_mention_group/at_mention_group.js index b26200606..3d2ca1b7b 100644 --- a/app/components/autocomplete/at_mention_group/at_mention_group.js +++ b/app/components/autocomplete/at_mention_group/at_mention_group.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import PropTypes from 'prop-types'; +import React from 'react'; import { Text, View, diff --git a/app/components/autocomplete/autocomplete.js b/app/components/autocomplete/autocomplete.js index 33f01f485..fd2fe9ad7 100644 --- a/app/components/autocomplete/autocomplete.js +++ b/app/components/autocomplete/autocomplete.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import { Keyboard, Platform, @@ -11,15 +11,15 @@ import { } from 'react-native'; import {DeviceTypes} from '@constants'; -import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; -import {emptyFunction} from '@utils/general'; import EventEmitter from '@mm-redux/utils/event_emitter'; +import {emptyFunction} from '@utils/general'; +import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; import AtMention from './at_mention'; import ChannelMention from './channel_mention'; +import DateSuggestion from './date_suggestion'; import EmojiSuggestion from './emoji_suggestion'; import SlashSuggestion from './slash_suggestion'; -import DateSuggestion from './date_suggestion'; export default class Autocomplete extends PureComponent { static propTypes = { diff --git a/app/components/autocomplete/autocomplete_section_header.js b/app/components/autocomplete/autocomplete_section_header.js index 3e8473ade..446da695a 100644 --- a/app/components/autocomplete/autocomplete_section_header.js +++ b/app/components/autocomplete/autocomplete_section_header.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import PropTypes from 'prop-types'; +import React from 'react'; import {ActivityIndicator, View} from 'react-native'; import {useSafeAreaInsets} from 'react-native-safe-area-context'; diff --git a/app/components/autocomplete/channel_mention/channel_mention.js b/app/components/autocomplete/channel_mention/channel_mention.js index 275f2aaea..0f77b47ad 100644 --- a/app/components/autocomplete/channel_mention/channel_mention.js +++ b/app/components/autocomplete/channel_mention/channel_mention.js @@ -1,18 +1,17 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import {Platform, SectionList} from 'react-native'; -import {RequestStatus} from '@mm-redux/constants'; +import AutocompleteSectionHeader from '@components/autocomplete/autocomplete_section_header'; +import ChannelMentionItem from '@components/autocomplete/channel_mention_item'; +import {CHANNEL_MENTION_REGEX, CHANNEL_MENTION_SEARCH_REGEX} from '@constants/autocomplete'; import {debounce} from '@mm-redux/actions/helpers'; - -import {CHANNEL_MENTION_REGEX, CHANNEL_MENTION_SEARCH_REGEX} from 'app/constants/autocomplete'; -import AutocompleteSectionHeader from 'app/components/autocomplete/autocomplete_section_header'; -import ChannelMentionItem from 'app/components/autocomplete/channel_mention_item'; -import {makeStyleSheetFromTheme} from 'app/utils/theme'; -import {t} from 'app/utils/i18n'; +import {RequestStatus} from '@mm-redux/constants'; +import {t} from '@utils/i18n'; +import {makeStyleSheetFromTheme} from '@utils/theme'; export default class ChannelMention extends PureComponent { static propTypes = { diff --git a/app/components/autocomplete/channel_mention/index.js b/app/components/autocomplete/channel_mention/index.js index 9ffc7f8bd..0c76151e8 100644 --- a/app/components/autocomplete/channel_mention/index.js +++ b/app/components/autocomplete/channel_mention/index.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; import {autocompleteChannelsForSearch} from '@mm-redux/actions/channels'; import {getMyChannelMemberships} from '@mm-redux/selectors/entities/channels'; diff --git a/app/components/autocomplete/channel_mention_item/channel_mention_item.js b/app/components/autocomplete/channel_mention_item/channel_mention_item.js index 3af63eadc..d995f3877 100644 --- a/app/components/autocomplete/channel_mention_item/channel_mention_item.js +++ b/app/components/autocomplete/channel_mention_item/channel_mention_item.js @@ -1,15 +1,15 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import PropTypes from 'prop-types'; +import React from 'react'; import {Text, View} from 'react-native'; import {useSafeAreaInsets} from 'react-native-safe-area-context'; -import {General} from '@mm-redux/constants'; import CompassIcon from '@components/compass_icon'; import {BotTag, GuestTag} from '@components/tag'; import TouchableWithFeedback from '@components/touchable_with_feedback'; +import {General} from '@mm-redux/constants'; import {makeStyleSheetFromTheme, changeOpacity} from '@utils/theme'; const getStyleFromTheme = makeStyleSheetFromTheme((theme) => { diff --git a/app/components/autocomplete/date_suggestion/date_suggestion.js b/app/components/autocomplete/date_suggestion/date_suggestion.js index 279eac8e3..ed74bab5a 100644 --- a/app/components/autocomplete/date_suggestion/date_suggestion.js +++ b/app/components/autocomplete/date_suggestion/date_suggestion.js @@ -1,15 +1,14 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; -import {Dimensions, Platform, View} from 'react-native'; import PropTypes from 'prop-types'; -import {CalendarList, LocaleConfig} from 'react-native-calendars'; +import React, {PureComponent} from 'react'; import {intlShape} from 'react-intl'; +import {Dimensions, Platform, View} from 'react-native'; +import {CalendarList, LocaleConfig} from 'react-native-calendars'; +import {DATE_MENTION_SEARCH_REGEX, ALL_SEARCH_FLAGS_REGEX} from '@constants/autocomplete'; import {memoizeResult} from '@mm-redux/utils/helpers'; - -import {DATE_MENTION_SEARCH_REGEX, ALL_SEARCH_FLAGS_REGEX} from 'app/constants/autocomplete'; import {makeStyleSheetFromTheme, changeOpacity} from '@utils/theme'; export default class DateSuggestion extends PureComponent { diff --git a/app/components/autocomplete/date_suggestion/index.js b/app/components/autocomplete/date_suggestion/index.js index 54674ee87..854d4e16c 100644 --- a/app/components/autocomplete/date_suggestion/index.js +++ b/app/components/autocomplete/date_suggestion/index.js @@ -4,9 +4,8 @@ import {connect} from 'react-redux'; import {getTheme} from '@mm-redux/selectors/entities/preferences'; - -import {makeGetMatchTermForDateMention} from 'app/selectors/autocomplete'; -import {getCurrentLocale} from 'app/selectors/i18n'; +import {makeGetMatchTermForDateMention} from '@selectors/autocomplete'; +import {getCurrentLocale} from '@selectors/i18n'; import DateSuggestion from './date_suggestion'; diff --git a/app/components/autocomplete/emoji_suggestion/emoji_suggestion.js b/app/components/autocomplete/emoji_suggestion/emoji_suggestion.js index b14ac7d78..e89411a90 100644 --- a/app/components/autocomplete/emoji_suggestion/emoji_suggestion.js +++ b/app/components/autocomplete/emoji_suggestion/emoji_suggestion.js @@ -1,15 +1,15 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; +import Fuse from 'fuse.js'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import { FlatList, Platform, Text, View, } from 'react-native'; -import Fuse from 'fuse.js'; import Emoji from '@components/emoji'; import TouchableWithFeedback from '@components/touchable_with_feedback'; diff --git a/app/components/autocomplete/emoji_suggestion/emoji_suggestion.test.js b/app/components/autocomplete/emoji_suggestion/emoji_suggestion.test.js index c93065303..4030fe87b 100644 --- a/app/components/autocomplete/emoji_suggestion/emoji_suggestion.test.js +++ b/app/components/autocomplete/emoji_suggestion/emoji_suggestion.test.js @@ -6,7 +6,7 @@ import React from 'react'; import Preferences from '@mm-redux/constants/preferences'; import {selectEmojisByName} from '@selectors/emojis'; import initialState from '@store/initial_state'; -import {shallowWithIntl} from 'test/intl-test-helper'; +import {shallowWithIntl} from '@test/intl-test-helper'; import EmojiSuggestion from './emoji_suggestion'; diff --git a/app/components/autocomplete/index.js b/app/components/autocomplete/index.js index 31a4d15ad..e40242bc7 100644 --- a/app/components/autocomplete/index.js +++ b/app/components/autocomplete/index.js @@ -4,8 +4,7 @@ import {connect} from 'react-redux'; import {getTheme} from '@mm-redux/selectors/entities/preferences'; - -import {getDimensions} from 'app/selectors/device'; +import {getDimensions} from '@selectors/device'; import Autocomplete from './autocomplete'; diff --git a/app/components/autocomplete/slash_suggestion/app_command_parser/app_command_parser.test.ts b/app/components/autocomplete/slash_suggestion/app_command_parser/app_command_parser.test.ts index 3ac4cba8c..b20834db3 100644 --- a/app/components/autocomplete/slash_suggestion/app_command_parser/app_command_parser.test.ts +++ b/app/components/autocomplete/slash_suggestion/app_command_parser/app_command_parser.test.ts @@ -3,6 +3,20 @@ /* eslint-disable max-lines */ +import { + AppCommandParser, + ParseState, + ParsedCommand, +} from './app_command_parser'; +import { + AppCallResponseTypes, + AppCallTypes, + AutocompleteSuggestion, +} from './app_command_parser_dependencies'; +import { + reduxTestState, + testBindings, +} from './tests/app_command_parser_test_data'; import { thunk, configureStore, @@ -11,23 +25,6 @@ import { checkForExecuteSuggestion, } from './tests/app_command_parser_test_dependencies'; -import { - AppCallResponseTypes, - AppCallTypes, - AutocompleteSuggestion, -} from './app_command_parser_dependencies'; - -import { - AppCommandParser, - ParseState, - ParsedCommand, -} from './app_command_parser'; - -import { - reduxTestState, - testBindings, -} from './tests/app_command_parser_test_data'; - const mockStore = configureStore([thunk]); describe('AppCommandParser', () => { @@ -45,7 +42,7 @@ describe('AppCommandParser', () => { }; const intl = { - formatMessage: (message: {id: string, defaultMessage: string}) => { + formatMessage: (message: {id: string; defaultMessage: string}) => { return message.defaultMessage; }, }; diff --git a/app/components/autocomplete/slash_suggestion/app_command_parser/app_command_parser.ts b/app/components/autocomplete/slash_suggestion/app_command_parser/app_command_parser.ts index 4745b31bf..0128235dd 100644 --- a/app/components/autocomplete/slash_suggestion/app_command_parser/app_command_parser.ts +++ b/app/components/autocomplete/slash_suggestion/app_command_parser/app_command_parser.ts @@ -69,7 +69,7 @@ export const ParseState = keyMirror({ }); interface FormsCache { - getForm: (location: string, binding: AppBinding) => Promise<{form?: AppForm, error?: string} | undefined>; + getForm: (location: string, binding: AppBinding) => Promise<{form?: AppForm; error?: string} | undefined>; } interface Intl { @@ -549,7 +549,7 @@ export class AppCommandParser { } // composeCallFromCommand creates the form submission call - public composeCallFromCommand = async (command: string): Promise<{call: AppCallRequest | null, errorMessage?: string}> => { + public composeCallFromCommand = async (command: string): Promise<{call: AppCallRequest | null; errorMessage?: string}> => { let parsed = new ParsedCommand(command, this, this.intl); const commandBindings = this.getCommandBindings(); @@ -750,7 +750,7 @@ export class AppCommandParser { } // composeCallFromParsed creates the form submission call - composeCallFromParsed = async (parsed: ParsedCommand): Promise<{call: AppCallRequest | null, errorMessage?: string}> => { + composeCallFromParsed = async (parsed: ParsedCommand): Promise<{call: AppCallRequest | null; errorMessage?: string}> => { if (!parsed.binding) { return {call: null, errorMessage: this.intl.formatMessage({ @@ -947,7 +947,7 @@ export class AppCommandParser { } // fetchForm unconditionaly retrieves the form for the given binding (subcommand) - fetchForm = async (binding: AppBinding): Promise<{form?: AppForm, error?: string} | undefined> => { + fetchForm = async (binding: AppBinding): Promise<{form?: AppForm; error?: string} | undefined> => { if (!binding.call) { return undefined; } @@ -990,7 +990,7 @@ export class AppCommandParser { return {form: callResponse.form}; } - getForm = async (location: string, binding: AppBinding): Promise<{form?: AppForm, error?: string} | undefined> => { + getForm = async (location: string, binding: AppBinding): Promise<{form?: AppForm; error?: string} | undefined> => { const form = this.forms[location]; if (form) { return {form}; diff --git a/app/components/autocomplete/slash_suggestion/app_command_parser/app_command_parser_dependencies.ts b/app/components/autocomplete/slash_suggestion/app_command_parser/app_command_parser_dependencies.ts index 7318d47a7..1fc45f3aa 100644 --- a/app/components/autocomplete/slash_suggestion/app_command_parser/app_command_parser_dependencies.ts +++ b/app/components/autocomplete/slash_suggestion/app_command_parser/app_command_parser_dependencies.ts @@ -1,6 +1,15 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import {intlShape} from 'react-intl'; +import {Alert} from 'react-native'; + +import keyMirror from '@mm-redux/utils/key_mirror'; +import Store from '@store/store'; + +import type {ParsedCommand} from './app_command_parser'; +import type {AutocompleteSuggestion} from '@mm-redux/types/integrations'; + export type { AppCallRequest, AppBinding, @@ -17,9 +26,6 @@ export type { AutocompleteChannelSelect, } from '@mm-redux/types/apps'; -import type { - AutocompleteSuggestion, -} from '@mm-redux/types/integrations'; export type {AutocompleteSuggestion}; export type { @@ -53,21 +59,16 @@ export {getChannelByNameAndTeamName, getChannel} from '@mm-redux/actions/channel export {doAppCall} from '@actions/apps'; export {createCallRequest} from '@utils/apps'; -import Store from '@store/store'; export const getStore = () => Store.redux; -import keyMirror from '@mm-redux/utils/key_mirror'; export {keyMirror}; export const EXECUTE_CURRENT_COMMAND_ITEM_ID = '_execute_current_command'; -import type {ParsedCommand} from './app_command_parser'; export const getExecuteSuggestion = (_: ParsedCommand): AutocompleteSuggestion | null => { // eslint-disable-line @typescript-eslint/no-unused-vars return null; }; -import {Alert} from 'react-native'; -import {intlShape} from 'react-intl'; export const displayError = (intl: typeof intlShape, body: string) => { const title = intl.formatMessage({ id: 'mobile.general.error.title', diff --git a/app/components/autocomplete/slash_suggestion/index.ts b/app/components/autocomplete/slash_suggestion/index.ts index 0dbd70454..9cf1d6df4 100644 --- a/app/components/autocomplete/slash_suggestion/index.ts +++ b/app/components/autocomplete/slash_suggestion/index.ts @@ -1,16 +1,15 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators, Dispatch} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators, Dispatch} from 'redux'; import {createSelector} from 'reselect'; -import {GlobalState} from '@mm-redux/types/store'; import {getAutocompleteCommands, getCommandAutocompleteSuggestions} from '@mm-redux/actions/integrations'; import {getAutocompleteCommandsList, getCommandAutocompleteSuggestionsList} from '@mm-redux/selectors/entities/integrations'; import {getTheme} from '@mm-redux/selectors/entities/preferences'; import {getCurrentTeamId} from '@mm-redux/selectors/entities/teams'; - +import {GlobalState} from '@mm-redux/types/store'; import {appsEnabled} from '@utils/apps'; import SlashSuggestion from './slash_suggestion'; diff --git a/app/components/autocomplete/slash_suggestion/slash_suggestion.test.tsx b/app/components/autocomplete/slash_suggestion/slash_suggestion.test.tsx index 85be7ab26..5bfd74eda 100644 --- a/app/components/autocomplete/slash_suggestion/slash_suggestion.test.tsx +++ b/app/components/autocomplete/slash_suggestion/slash_suggestion.test.tsx @@ -1,25 +1,25 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import Preferences from '@mm-redux/constants/preferences'; import {Command, AutocompleteSuggestion} from '@mm-redux/types/integrations'; import Store from '@store/store'; -import {intl} from 'test/intl-test-helper'; +import {intl} from '@test/intl-test-helper'; +import { + reduxTestState, + testBindings, +} from './app_command_parser/tests/app_command_parser_test_data'; import { thunk, configureStore, Client4, AppBinding, } from './app_command_parser/tests/app_command_parser_test_dependencies'; - -import { - reduxTestState, - testBindings, -} from './app_command_parser/tests/app_command_parser_test_data'; +import SlashSuggestion, {Props} from './slash_suggestion'; const mockStore = configureStore([thunk]); @@ -36,8 +36,6 @@ const makeStore = async (bindings: AppBinding[]) => { return testStore; }; -import SlashSuggestion, {Props} from './slash_suggestion'; - describe('components/autocomplete/slash_suggestion', () => { const sampleCommand = { trigger: 'jitsi', diff --git a/app/components/autocomplete/slash_suggestion/slash_suggestion.tsx b/app/components/autocomplete/slash_suggestion/slash_suggestion.tsx index 8c3a86f13..ef08458ff 100644 --- a/app/components/autocomplete/slash_suggestion/slash_suggestion.tsx +++ b/app/components/autocomplete/slash_suggestion/slash_suggestion.tsx @@ -1,22 +1,22 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {intlShape} from 'react-intl'; import React, {PureComponent} from 'react'; +import {intlShape} from 'react-intl'; import { FlatList, Platform, } from 'react-native'; -import {analytics} from '@init/analytics'; import {Client4} from '@client/rest'; -import {isMinimumServerVersion} from '@mm-redux/utils/helpers'; +import {analytics} from '@init/analytics'; import {Command, AutocompleteSuggestion, CommandArgs} from '@mm-redux/types/integrations'; import {Theme} from '@mm-redux/types/preferences'; +import {isMinimumServerVersion} from '@mm-redux/utils/helpers'; import {makeStyleSheetFromTheme} from '@utils/theme'; -import SlashSuggestionItem from './slash_suggestion_item'; import {AppCommandParser} from './app_command_parser/app_command_parser'; +import SlashSuggestionItem from './slash_suggestion_item'; const TIME_BEFORE_NEXT_COMMAND_REQUEST = 1000 * 60 * 5; diff --git a/app/components/autocomplete/slash_suggestion/slash_suggestion_item.tsx b/app/components/autocomplete/slash_suggestion/slash_suggestion_item.tsx index 2ad88cda4..854da0a3b 100644 --- a/app/components/autocomplete/slash_suggestion/slash_suggestion_item.tsx +++ b/app/components/autocomplete/slash_suggestion/slash_suggestion_item.tsx @@ -1,17 +1,16 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import base64 from 'base-64'; import React from 'react'; import {Image, Text, View} from 'react-native'; +import FastImage from 'react-native-fast-image'; import {useSafeAreaInsets} from 'react-native-safe-area-context'; - -import {Theme} from '@mm-redux/types/preferences'; +import {SvgXml} from 'react-native-svg'; import TouchableWithFeedback from '@components/touchable_with_feedback'; +import {Theme} from '@mm-redux/types/preferences'; import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; -import FastImage from 'react-native-fast-image'; -import {SvgXml} from 'react-native-svg'; -import base64 from 'base-64'; const slashIcon = require('@assets/images/autocomplete/slash_command.png'); const bangIcon = require('@assets/images/autocomplete/slash_command_error.png'); diff --git a/app/components/autocomplete/special_mention_item.js b/app/components/autocomplete/special_mention_item.js index f1d9fd279..e4efb27f5 100644 --- a/app/components/autocomplete/special_mention_item.js +++ b/app/components/autocomplete/special_mention_item.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import { Text, View, diff --git a/app/components/autocomplete_selector/autocomplete_selector.js b/app/components/autocomplete_selector/autocomplete_selector.js index 4cfd716aa..e3831efa3 100644 --- a/app/components/autocomplete_selector/autocomplete_selector.js +++ b/app/components/autocomplete_selector/autocomplete_selector.js @@ -1,22 +1,21 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; -import {Text, View} from 'react-native'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import {intlShape} from 'react-intl'; +import {Text, View} from 'react-native'; -import {displayUsername} from '@mm-redux/utils/user_utils'; - +import {goToScreen} from '@actions/navigation'; import CompassIcon from '@components/compass_icon'; import FormattedText from '@components/formatted_text'; import Markdown from '@components/markdown'; import TouchableWithFeedback from '@components/touchable_with_feedback'; +import {ViewTypes} from '@constants'; +import {displayUsername} from '@mm-redux/utils/user_utils'; import {getMarkdownBlockStyles, getMarkdownTextStyles} from '@utils/markdown'; import {preventDoubleTap} from '@utils/tap'; import {makeStyleSheetFromTheme, changeOpacity} from '@utils/theme'; -import {ViewTypes} from '@constants'; -import {goToScreen} from '@actions/navigation'; export default class AutocompleteSelector extends PureComponent { static propTypes = { diff --git a/app/components/autocomplete_selector/index.js b/app/components/autocomplete_selector/index.js index dc3f4fe16..719e09dcc 100644 --- a/app/components/autocomplete_selector/index.js +++ b/app/components/autocomplete_selector/index.js @@ -1,13 +1,12 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; +import {setAutocompleteSelector} from '@actions/views/post'; import {getTeammateNameDisplaySetting, getTheme} from '@mm-redux/selectors/entities/preferences'; -import {setAutocompleteSelector} from 'app/actions/views/post'; - import AutocompleteSelector from './autocomplete_selector'; function mapStateToProps(state) { diff --git a/app/components/avatars/avatars.stories.tsx b/app/components/avatars/avatars.stories.tsx index 0c3f3c2ec..13c8cd850 100644 --- a/app/components/avatars/avatars.stories.tsx +++ b/app/components/avatars/avatars.stories.tsx @@ -1,12 +1,14 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; -import {storiesOf} from '@storybook/react-native'; + import {withKnobs, number, select} from '@storybook/addon-knobs'; +import {storiesOf} from '@storybook/react-native'; + +import React from 'react'; import {Preferences} from '@mm-redux/constants'; -import {UserProfile} from '@mm-redux/types/users'; import {getProfiles} from '@mm-redux/selectors/entities/users'; +import {UserProfile} from '@mm-redux/types/users'; import Store from '@store/store'; import Avatars from './avatars'; diff --git a/app/components/avatars/avatars.test.tsx b/app/components/avatars/avatars.test.tsx index cb274443a..53ea9faa7 100644 --- a/app/components/avatars/avatars.test.tsx +++ b/app/components/avatars/avatars.test.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import Preferences from '@mm-redux/constants/preferences'; diff --git a/app/components/avatars/avatars.tsx b/app/components/avatars/avatars.tsx index 5825058b7..8eaed830d 100644 --- a/app/components/avatars/avatars.tsx +++ b/app/components/avatars/avatars.tsx @@ -1,15 +1,17 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. + import React, {PureComponent} from 'react'; import {Platform, StyleProp, Text, View, ViewStyle} from 'react-native'; +import {showModalOverCurrentContext} from '@actions/navigation'; import ProfilePicture from '@components/profile_picture'; import TouchableWithFeedback from '@components/touchable_with_feedback'; -import type {Theme} from '@mm-redux/types/preferences'; -import {showModalOverCurrentContext} from '@actions/navigation'; import {ViewTypes} from '@constants'; import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; +import type {Theme} from '@mm-redux/types/preferences'; + const getStyleSheet = makeStyleSheetFromTheme((theme: Theme) => { const size = ViewTypes.AVATAR_LIST_PICTURE_SIZE; diff --git a/app/components/avatars/index.ts b/app/components/avatars/index.ts index 9409827f4..20108951b 100644 --- a/app/components/avatars/index.ts +++ b/app/components/avatars/index.ts @@ -1,9 +1,11 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. import {connect} from 'react-redux'; + import {getTheme} from '@mm-redux/selectors/entities/preferences'; import Avatars from './avatars'; + import type {GlobalState} from '@mm-redux/types/store'; function mapStateToProps(state: GlobalState) { diff --git a/app/components/badge.js b/app/components/badge.js index 5b39f6c41..824ca6b9c 100644 --- a/app/components/badge.js +++ b/app/components/badge.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import { PanResponder, StyleSheet, @@ -11,6 +11,7 @@ import { View, ViewPropTypes, } from 'react-native'; + import {CHANNEL_ITEM_LARGE_BADGE_MAX_WIDTH, CHANNEL_ITEM_SMALL_BADGE_MAX_WIDTH, LARGE_BADGE_MAX_WIDTH, SMALL_BADGE_MAX_WIDTH} from '@constants/view'; export default class Badge extends PureComponent { diff --git a/app/components/badge.test.js b/app/components/badge.test.js index 1d8830ccc..b50b7a839 100644 --- a/app/components/badge.test.js +++ b/app/components/badge.test.js @@ -1,9 +1,9 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import {shallow} from 'enzyme'; import React from 'react'; import {Text, TouchableWithoutFeedback} from 'react-native'; -import {shallow} from 'enzyme'; import Badge from './badge'; diff --git a/app/components/channel_intro/channel_intro.js b/app/components/channel_intro/channel_intro.js index 2a853a989..62330fbb3 100644 --- a/app/components/channel_intro/channel_intro.js +++ b/app/components/channel_intro/channel_intro.js @@ -1,23 +1,26 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; -import {Platform, Text, View} from 'react-native'; +import React, {PureComponent} from 'react'; import {injectIntl, intlShape} from 'react-intl'; - -import {displayUsername} from '@mm-redux/utils/user_utils'; -import {General} from '@mm-redux/constants'; +import { + Platform, + Text, + View, +} from 'react-native'; import {showModal} from '@actions/navigation'; import CompassIcon from '@components/compass_icon'; import ProfilePicture from '@components/profile_picture'; import {BotTag, GuestTag} from '@components/tag'; import TouchableWithFeedback from '@components/touchable_with_feedback'; +import {General} from '@mm-redux/constants'; +import {displayUsername} from '@mm-redux/utils/user_utils'; import telemetry, {PERF_MARKERS} from '@telemetry'; +import {t} from '@utils/i18n'; import {preventDoubleTap} from '@utils/tap'; import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; -import {t} from '@utils/i18n'; import {isGuest} from '@utils/users'; class ChannelIntro extends PureComponent { diff --git a/app/components/channel_intro/index.js b/app/components/channel_intro/index.js index c05b85dff..5f84e359b 100644 --- a/app/components/channel_intro/index.js +++ b/app/components/channel_intro/index.js @@ -6,10 +6,9 @@ import {createSelector} from 'reselect'; import {General} from '@mm-redux/constants'; import {makeGetChannel} from '@mm-redux/selectors/entities/channels'; -import {getCurrentUserId, getUser, makeGetProfilesInChannel} from '@mm-redux/selectors/entities/users'; - import {getTeammateNameDisplaySetting, getTheme} from '@mm-redux/selectors/entities/preferences'; -import {getChannelMembersForDm} from 'app/selectors/channel'; +import {getCurrentUserId, getUser, makeGetProfilesInChannel} from '@mm-redux/selectors/entities/users'; +import {getChannelMembersForDm} from '@selectors/channel'; import ChannelIntro from './channel_intro'; diff --git a/app/components/channel_link/channel_link.js b/app/components/channel_link/channel_link.js index 1580f4297..e986120b9 100644 --- a/app/components/channel_link/channel_link.js +++ b/app/components/channel_link/channel_link.js @@ -1,14 +1,14 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import PropTypes from 'prop-types'; -import {Text} from 'react-native'; +import React from 'react'; import {intlShape} from 'react-intl'; +import {Text} from 'react-native'; import {popToRoot, dismissAllModals} from '@actions/navigation'; -import {t} from '@utils/i18n'; import {alertErrorWithFallback} from '@utils/general'; +import {t} from '@utils/i18n'; import {getChannelFromChannelName} from './channel_link_utils'; diff --git a/app/components/channel_link/channel_link.test.js b/app/components/channel_link/channel_link.test.js index 2db3495e7..424bf99bf 100644 --- a/app/components/channel_link/channel_link.test.js +++ b/app/components/channel_link/channel_link.test.js @@ -4,8 +4,8 @@ import React from 'react'; import {Text} from 'react-native'; +import {shallowWithIntl} from '@test/intl-test-helper'; import {alertErrorWithFallback} from '@utils/general'; -import {shallowWithIntl} from 'test/intl-test-helper'; import ChannelLink from './channel_link'; diff --git a/app/components/channel_link/index.js b/app/components/channel_link/index.js index 195cb1781..f81b8c0bb 100644 --- a/app/components/channel_link/index.js +++ b/app/components/channel_link/index.js @@ -5,13 +5,12 @@ import {connect} from 'react-redux'; import {bindActionCreators} from 'redux'; import {createSelector} from 'reselect'; +import {handleSelectChannel} from '@actions/views/channel'; import {joinChannel} from '@mm-redux/actions/channels'; import {getChannelsNameMapInCurrentTeam} from '@mm-redux/selectors/entities/channels'; import {getCurrentTeamId} from '@mm-redux/selectors/entities/teams'; import {getCurrentUserId} from '@mm-redux/selectors/entities/users'; -import {handleSelectChannel} from 'app/actions/views/channel'; - import ChannelLink from './channel_link'; function makeGetChannelNamesMap() { diff --git a/app/components/channel_loader/channel_loader.js b/app/components/channel_loader/channel_loader.js index 33f74704c..34debc085 100644 --- a/app/components/channel_loader/channel_loader.js +++ b/app/components/channel_loader/channel_loader.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import { ActivityIndicator, Animated, @@ -10,8 +10,8 @@ import { Platform, View, } from 'react-native'; -import * as RNPlaceholder from 'rn-placeholder'; import {SafeAreaView} from 'react-native-safe-area-context'; +import * as RNPlaceholder from 'rn-placeholder'; import FormattedText from '@components/formatted_text'; import {INDICATOR_BAR_HEIGHT} from '@constants/view'; diff --git a/app/components/channel_loader/channel_loader.test.js b/app/components/channel_loader/channel_loader.test.js index f2b864868..7d7396194 100644 --- a/app/components/channel_loader/channel_loader.test.js +++ b/app/components/channel_loader/channel_loader.test.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import Preferences from '@mm-redux/constants/preferences'; diff --git a/app/components/compass_icon/index.js b/app/components/compass_icon/index.js index 8661335c5..fe63c6a66 100644 --- a/app/components/compass_icon/index.js +++ b/app/components/compass_icon/index.js @@ -2,6 +2,7 @@ // See LICENSE.txt for license information. import {createIconSetFromFontello} from 'react-native-vector-icons'; + import fontelloConfig from '@assets/compass-icons.json'; export default createIconSetFromFontello(fontelloConfig, 'compass-icons', 'compass-icons.ttf'); diff --git a/app/components/custom_list/channel_list_row/channel_list_row.js b/app/components/custom_list/channel_list_row/channel_list_row.js index cae0503f6..6f98c5fa3 100644 --- a/app/components/custom_list/channel_list_row/channel_list_row.js +++ b/app/components/custom_list/channel_list_row/channel_list_row.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import PropTypes from 'prop-types'; +import React from 'react'; import { Text, View, diff --git a/app/components/custom_list/channel_list_row/index.js b/app/components/custom_list/channel_list_row/index.js index a4054a965..4a24ef1ff 100644 --- a/app/components/custom_list/channel_list_row/index.js +++ b/app/components/custom_list/channel_list_row/index.js @@ -3,9 +3,9 @@ import {connect} from 'react-redux'; +import {makeGetChannel} from '@mm-redux/selectors/entities/channels'; import {getTheme} from '@mm-redux/selectors/entities/preferences'; -import {makeGetChannel} from '@mm-redux/selectors/entities/channels'; import ChannelListRow from './channel_list_row'; function makeMapStateToProps() { diff --git a/app/components/custom_list/index.js b/app/components/custom_list/index.js index b178da73a..ed53f041a 100644 --- a/app/components/custom_list/index.js +++ b/app/components/custom_list/index.js @@ -1,12 +1,12 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import {FlatList, Keyboard, Platform, RefreshControl, SectionList, Text, View} from 'react-native'; -import {ListTypes} from 'app/constants'; -import {makeStyleSheetFromTheme, changeOpacity} from 'app/utils/theme'; +import {ListTypes} from '@constants'; +import {makeStyleSheetFromTheme, changeOpacity} from '@utils/theme'; export const FLATLIST = 'flat'; export const SECTIONLIST = 'section'; diff --git a/app/components/custom_list/index.test.js b/app/components/custom_list/index.test.js index 68e6477d2..5f428f160 100644 --- a/app/components/custom_list/index.test.js +++ b/app/components/custom_list/index.test.js @@ -1,9 +1,9 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import {shallow} from 'enzyme'; import React from 'react'; import {View} from 'react-native'; -import {shallow} from 'enzyme'; import Preferences from '@mm-redux/constants/preferences'; diff --git a/app/components/custom_list/option_list_row/index.js b/app/components/custom_list/option_list_row/index.js index 184006f8e..3d429ca23 100644 --- a/app/components/custom_list/option_list_row/index.js +++ b/app/components/custom_list/option_list_row/index.js @@ -4,6 +4,7 @@ import {connect} from 'react-redux'; import {getTheme} from '@mm-redux/selectors/entities/preferences'; + import OptionListRow from './option_list_row'; function mapStateToProps(state) { diff --git a/app/components/custom_list/option_list_row/option_list_row.js b/app/components/custom_list/option_list_row/option_list_row.js index 680b7424b..3056b48ad 100644 --- a/app/components/custom_list/option_list_row/option_list_row.js +++ b/app/components/custom_list/option_list_row/option_list_row.js @@ -1,16 +1,16 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import PropTypes from 'prop-types'; +import React from 'react'; import {intlShape} from 'react-intl'; import { Text, View, } from 'react-native'; -import {makeStyleSheetFromTheme} from 'app/utils/theme'; -import CustomListRow from 'app/components/custom_list/custom_list_row'; +import CustomListRow from '@components/custom_list/custom_list_row'; +import {makeStyleSheetFromTheme} from '@utils/theme'; export default class OptionListRow extends React.PureComponent { static propTypes = { diff --git a/app/components/custom_list/user_list_row/index.js b/app/components/custom_list/user_list_row/index.js index 914e40fb3..1d37f74af 100644 --- a/app/components/custom_list/user_list_row/index.js +++ b/app/components/custom_list/user_list_row/index.js @@ -5,6 +5,7 @@ import {connect} from 'react-redux'; import {getTeammateNameDisplaySetting, getTheme} from '@mm-redux/selectors/entities/preferences'; import {getCurrentUserId, getUser} from '@mm-redux/selectors/entities/users'; + import UserListRow from './user_list_row'; function mapStateToProps(state, ownProps) { diff --git a/app/components/custom_list/user_list_row/user_list_row.js b/app/components/custom_list/user_list_row/user_list_row.js index f83bcae4d..2130a793a 100644 --- a/app/components/custom_list/user_list_row/user_list_row.js +++ b/app/components/custom_list/user_list_row/user_list_row.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import PropTypes from 'prop-types'; +import React from 'react'; import {intlShape} from 'react-intl'; import { Text, @@ -10,14 +10,13 @@ import { } from 'react-native'; import ChannelIcon from '@components/channel_icon'; +import CustomListRow from '@components/custom_list/custom_list_row'; +import ProfilePicture from '@components/profile_picture'; +import {BotTag, GuestTag} from '@components/tag'; import {General} from '@mm-redux/constants'; import {displayUsername, isShared} from '@mm-redux/utils/user_utils'; - -import CustomListRow from 'app/components/custom_list/custom_list_row'; -import ProfilePicture from 'app/components/profile_picture'; -import {BotTag, GuestTag} from 'app/components/tag'; -import {makeStyleSheetFromTheme, changeOpacity} from 'app/utils/theme'; -import {isGuest} from 'app/utils/users'; +import {makeStyleSheetFromTheme, changeOpacity} from '@utils/theme'; +import {isGuest} from '@utils/users'; export default class UserListRow extends React.PureComponent { static propTypes = { diff --git a/app/components/custom_list/user_list_row/user_list_test.test.js b/app/components/custom_list/user_list_row/user_list_test.test.js index 407de8f47..7004821fc 100644 --- a/app/components/custom_list/user_list_row/user_list_test.test.js +++ b/app/components/custom_list/user_list_row/user_list_test.test.js @@ -4,7 +4,7 @@ import React from 'react'; import Preferences from '@mm-redux/constants/preferences'; -import {shallowWithIntl} from 'test/intl-test-helper'; +import {shallowWithIntl} from '@test/intl-test-helper'; import UserListRow from './user_list_row'; diff --git a/app/components/custom_status/clear_button.tsx b/app/components/custom_status/clear_button.tsx index 354cb5bec..0719ce7eb 100644 --- a/app/components/custom_status/clear_button.tsx +++ b/app/components/custom_status/clear_button.tsx @@ -15,7 +15,7 @@ interface Props { containerSize?: number; theme: Theme; testID?: string; - iconName: string, + iconName: string; } const ClearButton = ({handlePress, iconName, size, containerSize, theme, testID}: Props) => { diff --git a/app/components/custom_status/custom_status_emoji.test.tsx b/app/components/custom_status/custom_status_emoji.test.tsx index 3951137b4..1038f2e68 100644 --- a/app/components/custom_status/custom_status_emoji.test.tsx +++ b/app/components/custom_status/custom_status_emoji.test.tsx @@ -4,9 +4,9 @@ import React from 'react'; import CustomStatusEmoji from '@components/custom_status/custom_status_emoji'; -import * as CustomStatusSelectors from '@selectors/custom_status'; -import {renderWithRedux} from 'test/testing_library'; import {CustomStatusDuration} from '@mm-redux/types/users'; +import * as CustomStatusSelectors from '@selectors/custom_status'; +import {renderWithRedux} from '@test/testing_library'; jest.mock('@selectors/custom_status'); diff --git a/app/components/custom_status/custom_status_expiry.test.tsx b/app/components/custom_status/custom_status_expiry.test.tsx index 830cb952c..12f7d3702 100644 --- a/app/components/custom_status/custom_status_expiry.test.tsx +++ b/app/components/custom_status/custom_status_expiry.test.tsx @@ -1,11 +1,12 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import moment from 'moment-timezone'; +import React from 'react'; import Preferences from '@mm-redux/constants/preferences'; -import {renderWithReduxIntl} from 'test/testing_library'; +import {renderWithReduxIntl} from '@test/testing_library'; + import CustomStatusExpiry from './custom_status_expiry'; jest.mock('@mm-redux/selectors/entities/preferences'); diff --git a/app/components/custom_status/custom_status_expiry.tsx b/app/components/custom_status/custom_status_expiry.tsx index 1d5465772..f2a38596f 100644 --- a/app/components/custom_status/custom_status_expiry.tsx +++ b/app/components/custom_status/custom_status_expiry.tsx @@ -12,11 +12,10 @@ import FormattedTime from '@components/formatted_time'; import Preferences from '@mm-redux/constants/preferences'; import {getBool} from '@mm-redux/selectors/entities/preferences'; import {getCurrentUserTimezone} from '@mm-redux/selectors/entities/timezone'; -import {makeStyleSheetFromTheme} from '@utils/theme'; -import {getCurrentMomentForTimezone} from '@utils/timezone'; - import {Theme} from '@mm-redux/types/preferences'; import {GlobalState} from '@mm-redux/types/store'; +import {makeStyleSheetFromTheme} from '@utils/theme'; +import {getCurrentMomentForTimezone} from '@utils/timezone'; type Props = { theme: Theme; diff --git a/app/components/custom_status/custom_status_text.tsx b/app/components/custom_status/custom_status_text.tsx index eb868a5a6..eb21a56d0 100644 --- a/app/components/custom_status/custom_status_text.tsx +++ b/app/components/custom_status/custom_status_text.tsx @@ -4,8 +4,9 @@ import React from 'react'; import {Text, TextStyle} from 'react-native'; -import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; import FormattedText from '@components/formatted_text'; +import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; + import type {Theme} from '@mm-redux/types/preferences'; interface ComponentProps { diff --git a/app/components/deleted_post.js b/app/components/deleted_post.js index 9c0ffe5dd..5a2f8adae 100644 --- a/app/components/deleted_post.js +++ b/app/components/deleted_post.js @@ -1,14 +1,14 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import PropTypes from 'prop-types'; import React, {PureComponent} from 'react'; import {View} from 'react-native'; -import PropTypes from 'prop-types'; import CompassIcon from '@components/compass_icon'; import FormattedText from '@components/formatted_text'; -import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; import {ViewTypes} from '@constants'; +import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; class DeletedPost extends PureComponent { static propTypes = { diff --git a/app/components/edit_channel_info/edit_channel_info.test.js b/app/components/edit_channel_info/edit_channel_info.test.js index 070192594..cd530aca8 100644 --- a/app/components/edit_channel_info/edit_channel_info.test.js +++ b/app/components/edit_channel_info/edit_channel_info.test.js @@ -1,12 +1,12 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; +import Autocomplete from '@components/autocomplete'; import Preferences from '@mm-redux/constants/preferences'; -import Autocomplete from 'app/components/autocomplete'; import EditChannelInfo from './index'; describe('EditChannelInfo', () => { diff --git a/app/components/edit_channel_info/index.js b/app/components/edit_channel_info/index.js index 0760d6300..d84c7615d 100644 --- a/app/components/edit_channel_info/index.js +++ b/app/components/edit_channel_info/index.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import { Platform, TouchableWithoutFeedback, @@ -11,24 +11,21 @@ import { import {KeyboardAwareScrollView} from 'react-native-keyboard-aware-scrollview'; import {SafeAreaView} from 'react-native-safe-area-context'; -import {General} from '@mm-redux/constants'; - -import Autocomplete from 'app/components/autocomplete'; -import ErrorText from 'app/components/error_text'; +import {popTopScreen, dismissModal} from '@actions/navigation'; +import Autocomplete from '@components/autocomplete'; +import ErrorText from '@components/error_text'; import FormattedText from '@components/formatted_text'; -import Loading from 'app/components/loading'; -import StatusBar from 'app/components/status_bar'; -import TextInputWithLocalizedPlaceholder from 'app/components/text_input_with_localized_placeholder'; +import Loading from '@components/loading'; +import StatusBar from '@components/status_bar'; +import TextInputWithLocalizedPlaceholder from '@components/text_input_with_localized_placeholder'; import DEVICE from '@constants/device'; - +import {General} from '@mm-redux/constants'; +import {t} from '@utils/i18n'; import { changeOpacity, makeStyleSheetFromTheme, getKeyboardAppearanceFromTheme, -} from 'app/utils/theme'; - -import {t} from 'app/utils/i18n'; -import {popTopScreen, dismissModal} from 'app/actions/navigation'; +} from '@utils/theme'; export default class EditChannelInfo extends PureComponent { static propTypes = { diff --git a/app/components/emoji/index.ts b/app/components/emoji/index.ts index 860c34299..6d218665c 100644 --- a/app/components/emoji/index.ts +++ b/app/components/emoji/index.ts @@ -3,13 +3,12 @@ import {connect} from 'react-redux'; -import {getCustomEmojisByName} from '@mm-redux/selectors/entities/emojis'; -import {getCurrentUserId} from '@mm-redux/selectors/entities/users'; -import {getConfig} from '@mm-redux/selectors/entities/general'; import {Client4} from '@client/rest'; -import {isMinimumServerVersion} from '@mm-redux/utils/helpers'; +import {getCustomEmojisByName} from '@mm-redux/selectors/entities/emojis'; +import {getConfig} from '@mm-redux/selectors/entities/general'; +import {getCurrentUserId} from '@mm-redux/selectors/entities/users'; import {GlobalState} from '@mm-redux/types/store'; - +import {isMinimumServerVersion} from '@mm-redux/utils/helpers'; import {EmojiIndicesByAlias, Emojis} from '@utils/emojis'; import Emoji from './emoji'; diff --git a/app/components/emoji_picker/emoji_picker.android.js b/app/components/emoji_picker/emoji_picker.android.js index b1f95d39e..28850d5e5 100644 --- a/app/components/emoji_picker/emoji_picker.android.js +++ b/app/components/emoji_picker/emoji_picker.android.js @@ -4,8 +4,8 @@ import React from 'react'; import {View} from 'react-native'; -import SearchBar from 'app/components/search_bar'; -import {changeOpacity, getKeyboardAppearanceFromTheme} from 'app/utils/theme'; +import SearchBar from '@components/search_bar'; +import {changeOpacity, getKeyboardAppearanceFromTheme} from '@utils/theme'; import EmojiPickerBase, {getStyleSheetFromTheme} from './emoji_picker_base'; diff --git a/app/components/emoji_picker/emoji_picker.test.js b/app/components/emoji_picker/emoji_picker.test.js index 1696e62ee..144b1f5a8 100644 --- a/app/components/emoji_picker/emoji_picker.test.js +++ b/app/components/emoji_picker/emoji_picker.test.js @@ -1,16 +1,16 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import Fuse from 'fuse.js'; +import React from 'react'; import Preferences from '@mm-redux/constants/preferences'; import {selectEmojisByName, selectEmojisBySection} from '@selectors/emojis'; import initialState from '@store/initial_state'; -import {shallowWithIntl} from 'test/intl-test-helper'; +import {shallowWithIntl} from '@test/intl-test-helper'; -import {filterEmojiSearchInput} from './emoji_picker_base'; import EmojiPicker from './emoji_picker.ios'; +import {filterEmojiSearchInput} from './emoji_picker_base'; jest.useFakeTimers(); diff --git a/app/components/emoji_picker/emoji_picker_base.js b/app/components/emoji_picker/emoji_picker_base.js index c700c1b84..a1cee0564 100644 --- a/app/components/emoji_picker/emoji_picker_base.js +++ b/app/components/emoji_picker/emoji_picker_base.js @@ -2,8 +2,8 @@ // See LICENSE.txt for license information. /* eslint-disable max-lines */ -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import {intlShape} from 'react-intl'; import { ActivityIndicator, @@ -14,19 +14,19 @@ import { TouchableOpacity, View, } from 'react-native'; - import sectionListGetItemLayout from 'react-native-section-list-get-item-layout'; import CompassIcon from '@components/compass_icon'; import Emoji from '@components/emoji'; import FormattedText from '@components/formatted_text'; import {DeviceTypes} from '@constants'; +import {compareEmojis} from '@utils/emoji_utils'; import {emptyFunction} from '@utils/general'; import { makeStyleSheetFromTheme, changeOpacity, } from '@utils/theme'; -import {compareEmojis} from '@utils/emoji_utils'; + import EmojiPickerRow from './emoji_picker_row'; const EMOJI_SIZE = 30; diff --git a/app/components/emoji_picker/emoji_picker_row.js b/app/components/emoji_picker/emoji_picker_row.js index 0742d6230..043658ddb 100644 --- a/app/components/emoji_picker/emoji_picker_row.js +++ b/app/components/emoji_picker/emoji_picker_row.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {Component} from 'react'; import PropTypes from 'prop-types'; +import React, {Component} from 'react'; import { StyleSheet, TouchableOpacity, diff --git a/app/components/emoji_picker/index.js b/app/components/emoji_picker/index.js index fb87c55ed..e3e502651 100644 --- a/app/components/emoji_picker/index.js +++ b/app/components/emoji_picker/index.js @@ -1,14 +1,14 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import Fuse from 'fuse.js'; import {connect} from 'react-redux'; import {bindActionCreators} from 'redux'; -import Fuse from 'fuse.js'; import {incrementEmojiPickerPage} from '@actions/views/emoji'; import {getCustomEmojis} from '@mm-redux/actions/emojis'; -import {getTheme} from '@mm-redux/selectors/entities/preferences'; import {getConfig} from '@mm-redux/selectors/entities/general'; +import {getTheme} from '@mm-redux/selectors/entities/preferences'; import {isLandscape} from '@selectors/device'; import {selectEmojisByName, selectEmojisBySection} from '@selectors/emojis'; diff --git a/app/components/error_list/error_list.js b/app/components/error_list/error_list.js index 72cd3e080..5bebafc3d 100644 --- a/app/components/error_list/error_list.js +++ b/app/components/error_list/error_list.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import { Dimensions, StyleSheet, @@ -11,8 +11,8 @@ import { } from 'react-native'; import Config from '@assets/config.json'; -import FormattedText from '@components/formatted_text'; import CompassIcon from '@components/compass_icon'; +import FormattedText from '@components/formatted_text'; import GeneralError from './general_error'; diff --git a/app/components/error_list/general_error.js b/app/components/error_list/general_error.js index f6ef8aaac..50a15e289 100644 --- a/app/components/error_list/general_error.js +++ b/app/components/error_list/general_error.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import PropTypes from 'prop-types'; +import React from 'react'; import { StyleSheet, View, diff --git a/app/components/error_list/index.js b/app/components/error_list/index.js index 74a0f23c4..7d93e700c 100644 --- a/app/components/error_list/index.js +++ b/app/components/error_list/index.js @@ -1,11 +1,11 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; -import {getDisplayableErrors} from '@mm-redux/selectors/errors'; import {dismissError, clearErrors} from '@mm-redux/actions/errors'; +import {getDisplayableErrors} from '@mm-redux/selectors/errors'; import ErrorList from './error_list'; diff --git a/app/components/error_text/error_text.js b/app/components/error_text/error_text.js index e28267c2c..96f351ddd 100644 --- a/app/components/error_text/error_text.js +++ b/app/components/error_text/error_text.js @@ -1,13 +1,14 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import {Text} from 'react-native'; import FormattedText from '@components/formatted_text'; +import {makeStyleSheetFromTheme} from '@utils/theme'; + import {GlobalStyles} from 'app/styles'; -import {makeStyleSheetFromTheme} from 'app/utils/theme'; export default class ErrorText extends PureComponent { static propTypes = { diff --git a/app/components/error_text/error_text.test.js b/app/components/error_text/error_text.test.js index 75fc44017..7266b4f0c 100644 --- a/app/components/error_text/error_text.test.js +++ b/app/components/error_text/error_text.test.js @@ -1,8 +1,9 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; + import Preferences from '@mm-redux/constants/preferences'; import ErrorText from './error_text.js'; diff --git a/app/components/error_text/index.js b/app/components/error_text/index.js index 82379ce23..17a06e3c8 100644 --- a/app/components/error_text/index.js +++ b/app/components/error_text/index.js @@ -2,6 +2,7 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; + import {getTheme} from '@mm-redux/selectors/entities/preferences'; import ErrorText from './error_text.js'; diff --git a/app/components/fade.js b/app/components/fade.js index 14d8c5101..8103bb1b3 100644 --- a/app/components/fade.js +++ b/app/components/fade.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import {Animated} from 'react-native'; export const FADE_DURATION = 100; diff --git a/app/components/fade.test.js b/app/components/fade.test.js index f6f89c456..76361510d 100644 --- a/app/components/fade.test.js +++ b/app/components/fade.test.js @@ -1,9 +1,9 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import {shallow} from 'enzyme'; import React from 'react'; import {Animated, Text} from 'react-native'; -import {shallow} from 'enzyme'; import Fade from './fade'; diff --git a/app/components/failed_network_action/cloud.js b/app/components/failed_network_action/cloud.js index 49cbbcad5..c02c62ff8 100644 --- a/app/components/failed_network_action/cloud.js +++ b/app/components/failed_network_action/cloud.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import {View} from 'react-native'; import Svg, {Path} from 'react-native-svg'; diff --git a/app/components/failed_network_action/failed_network_action.js b/app/components/failed_network_action/failed_network_action.js index 23b235fa7..bfb78b92f 100644 --- a/app/components/failed_network_action/failed_network_action.js +++ b/app/components/failed_network_action/failed_network_action.js @@ -1,10 +1,10 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; -import {Text, View} from 'react-native'; +import React, {PureComponent} from 'react'; import {intlShape} from 'react-intl'; +import {Text, View} from 'react-native'; import Button from 'react-native-button'; import {INDICATOR_BAR_HEIGHT} from '@constants/view'; diff --git a/app/components/failed_network_action/failed_network_action.test.js b/app/components/failed_network_action/failed_network_action.test.js index b476b5b33..b55fee09e 100644 --- a/app/components/failed_network_action/failed_network_action.test.js +++ b/app/components/failed_network_action/failed_network_action.test.js @@ -1,11 +1,14 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. + +import {waitFor} from '@testing-library/react-native'; + import React from 'react'; -import FailedNetworkAction from './failed_network_action'; -import {renderWithReduxIntl} from 'test/testing_library'; import Preferences from '@mm-redux/constants/preferences'; -import {waitFor} from '@testing-library/react-native'; +import {renderWithReduxIntl} from '@test/testing_library'; + +import FailedNetworkAction from './failed_network_action'; describe('FailedNetworkAction', () => { const baseProps = { diff --git a/app/components/failed_network_action/index.js b/app/components/failed_network_action/index.js index 7f249edf1..c3f976e7d 100644 --- a/app/components/failed_network_action/index.js +++ b/app/components/failed_network_action/index.js @@ -3,7 +3,7 @@ import {connect} from 'react-redux'; -import {isLandscape} from 'app/selectors/device'; +import {isLandscape} from '@selectors/device'; import FailedNetworkAction from './failed_network_action'; diff --git a/app/components/formatted_markdown_text.js b/app/components/formatted_markdown_text.js index a5f95aef4..c44d3c223 100644 --- a/app/components/formatted_markdown_text.js +++ b/app/components/formatted_markdown_text.js @@ -1,18 +1,17 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; -import {Text} from 'react-native'; -import PropTypes from 'prop-types'; -import Renderer from 'commonmark-react-renderer'; import {Parser} from 'commonmark'; +import Renderer from 'commonmark-react-renderer'; +import PropTypes from 'prop-types'; +import React from 'react'; import {injectIntl, intlShape} from 'react-intl'; +import {Text} from 'react-native'; -import {concatStyles, changeOpacity, makeStyleSheetFromTheme} from 'app/utils/theme'; -import {getMarkdownTextStyles} from 'app/utils/markdown'; - -import AtMention from 'app/components/at_mention'; -import MarkdownLink from 'app/components/markdown/markdown_link'; +import AtMention from '@components/at_mention'; +import MarkdownLink from '@components/markdown/markdown_link'; +import {getMarkdownTextStyles} from '@utils/markdown'; +import {concatStyles, changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; const TARGET_BLANK_URL_PREFIX = '!'; diff --git a/app/components/formatted_text.tsx b/app/components/formatted_text.tsx index 4b7fc394d..d2394d147 100644 --- a/app/components/formatted_text.tsx +++ b/app/components/formatted_text.tsx @@ -2,8 +2,8 @@ // See LICENSE.txt for license information. import React, {createElement, isValidElement} from 'react'; -import {Text, TextProps} from 'react-native'; import {injectIntl, intlShape} from 'react-intl'; +import {Text, TextProps} from 'react-native'; type FormattedTextProps = TextProps & { id: string; diff --git a/app/components/formatted_time.test.js b/app/components/formatted_time.test.js index dc47d2939..704764b53 100644 --- a/app/components/formatted_time.test.js +++ b/app/components/formatted_time.test.js @@ -1,10 +1,10 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import moment from 'moment-timezone'; +import React from 'react'; -import {renderWithIntl} from 'test/testing_library'; +import {renderWithIntl} from '@test/testing_library'; import FormattedTime from './formatted_time'; diff --git a/app/components/friendly_date/friendly_date.test.tsx b/app/components/friendly_date/friendly_date.test.tsx index 92a794024..aa13fd73c 100644 --- a/app/components/friendly_date/friendly_date.test.tsx +++ b/app/components/friendly_date/friendly_date.test.tsx @@ -2,7 +2,8 @@ // See LICENSE.txt for license information. import React from 'react'; -import {renderWithIntl} from 'test/testing_library'; + +import {renderWithIntl} from '@test/testing_library'; import FriendlyDate from './index'; diff --git a/app/components/friendly_date/index.tsx b/app/components/friendly_date/index.tsx index 15763bfc9..f66c0a783 100644 --- a/app/components/friendly_date/index.tsx +++ b/app/components/friendly_date/index.tsx @@ -2,8 +2,8 @@ // See LICENSE.txt for license information. import React from 'react'; -import {StyleProp, Text, ViewStyle} from 'react-native'; import {injectIntl, intlShape} from 'react-intl'; +import {StyleProp, Text, ViewStyle} from 'react-native'; import {DateTypes} from '@constants'; import {isYesterday} from '@utils/datetime'; diff --git a/app/components/global_threads/empty_state.tsx b/app/components/global_threads/empty_state.tsx index bb0799e9c..857ad272e 100644 --- a/app/components/global_threads/empty_state.tsx +++ b/app/components/global_threads/empty_state.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. import React from 'react'; -import {Text, View} from 'react-native'; import {intlShape} from 'react-intl'; +import {Text, View} from 'react-native'; import Svg, { Ellipse, G, @@ -13,8 +13,9 @@ import Svg, { } from 'react-native-svg'; import {useSelector} from 'react-redux'; -import {makeStyleSheetFromTheme} from 'app/utils/theme'; import {getTheme} from '@mm-redux/selectors/entities/preferences'; +import {makeStyleSheetFromTheme} from '@utils/theme'; + import type {Theme} from '@mm-redux/types/preferences'; import type {GlobalState} from '@mm-redux/types/store'; diff --git a/app/components/global_threads/global_threads.tsx b/app/components/global_threads/global_threads.tsx index fc7aa7379..d8391bd07 100644 --- a/app/components/global_threads/global_threads.tsx +++ b/app/components/global_threads/global_threads.tsx @@ -5,14 +5,14 @@ import React from 'react'; import {injectIntl, intlShape} from 'react-intl'; import {Alert, FlatList} from 'react-native'; +import ThreadList from './thread_list'; + import type {ActionResult} from '@mm-redux/types/actions'; import type {Theme} from '@mm-redux/types/preferences'; import type {Team} from '@mm-redux/types/teams'; +import type {ThreadsState, UserThread} from '@mm-redux/types/threads'; import type {UserProfile} from '@mm-redux/types/users'; import type {$ID} from '@mm-redux/types/utilities'; -import type {ThreadsState, UserThread} from '@mm-redux/types/threads'; - -import ThreadList from './thread_list'; type Props = { actions: { @@ -20,7 +20,7 @@ type Props = { handleViewingGlobalThreadsAll: () => void; handleViewingGlobalThreadsUnreads: () => void; markAllThreadsInTeamRead: (userId: $ID, teamId: $ID) => void; - }, + }; allThreadIds: $ID[]; intl: typeof intlShape; teamId: $ID; diff --git a/app/components/global_threads/index.ts b/app/components/global_threads/index.ts index ff6d288a6..c5a953b1f 100644 --- a/app/components/global_threads/index.ts +++ b/app/components/global_threads/index.ts @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators, Dispatch} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators, Dispatch} from 'redux'; import {handleViewingGlobalThreadsAll, handleViewingGlobalThreadsUnreads} from '@actions/views/threads'; import {getThreads, markAllThreadsInTeamRead} from '@mm-redux/actions/threads'; @@ -10,11 +10,12 @@ import {getCurrentUserId} from '@mm-redux/selectors/entities/common'; import {getTheme} from '@mm-redux/selectors/entities/preferences'; import {getCurrentTeamId} from '@mm-redux/selectors/entities/teams'; import {getTeamThreadCounts, getThreadOrderInCurrentTeam, getUnreadThreadOrderInCurrentTeam} from '@mm-redux/selectors/entities/threads'; -import type {GlobalState} from '@mm-redux/types/store'; import {getViewingGlobalThreadsUnread} from '@selectors/threads'; import GlobalThreads from './global_threads'; +import type {GlobalState} from '@mm-redux/types/store'; + function mapStateToProps(state: GlobalState) { const teamId = getCurrentTeamId(state); return { diff --git a/app/components/global_threads/thread_footer/index.ts b/app/components/global_threads/thread_footer/index.ts index a1e322bd2..821e0a437 100644 --- a/app/components/global_threads/thread_footer/index.ts +++ b/app/components/global_threads/thread_footer/index.ts @@ -1,15 +1,16 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators, Dispatch} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators, Dispatch} from 'redux'; import {setThreadFollow} from '@mm-redux/actions/threads'; import {getCurrentUserId} from '@mm-redux/selectors/entities/common'; -import type {GlobalState} from '@mm-redux/types/store'; import ThreadFooter, {StateProps, DispatchProps, OwnProps} from './thread_footer'; +import type {GlobalState} from '@mm-redux/types/store'; + function mapStateToProps(state: GlobalState) { return { currentUserId: getCurrentUserId(state), diff --git a/app/components/global_threads/thread_footer/thread_footer.test.tsx b/app/components/global_threads/thread_footer/thread_footer.test.tsx index eff5756db..3029a353e 100644 --- a/app/components/global_threads/thread_footer/thread_footer.test.tsx +++ b/app/components/global_threads/thread_footer/thread_footer.test.tsx @@ -1,13 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import {Preferences} from '@mm-redux/constants'; -import {UserProfile} from '@mm-redux/types/users'; import {UserThread} from '@mm-redux/types/threads'; -import {intl} from 'test/intl-test-helper'; +import {UserProfile} from '@mm-redux/types/users'; +import {intl} from '@test/intl-test-helper'; import {ThreadFooter} from './thread_footer'; diff --git a/app/components/global_threads/thread_footer/thread_footer.tsx b/app/components/global_threads/thread_footer/thread_footer.tsx index d304f8813..5e455397b 100644 --- a/app/components/global_threads/thread_footer/thread_footer.tsx +++ b/app/components/global_threads/thread_footer/thread_footer.tsx @@ -2,19 +2,20 @@ // See LICENSE.txt for license information. import React from 'react'; -import {Text, TouchableOpacity, View} from 'react-native'; import {injectIntl, intlShape} from 'react-intl'; +import {Text, TouchableOpacity, View} from 'react-native'; import Avatars from '@components/avatars'; import CompassIcon from '@components/compass_icon'; import {GLOBAL_THREADS, CHANNEL} from '@constants/screen'; -import type {Theme} from '@mm-redux/types/preferences'; import {UserThread} from '@mm-redux/types/threads'; import {UserProfile} from '@mm-redux/types/users'; import {$ID} from '@mm-redux/types/utilities'; import {preventDoubleTap} from '@utils/tap'; import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; +import type {Theme} from '@mm-redux/types/preferences'; + export type DispatchProps = { actions: { setThreadFollow: (currentUserId: $ID, threadId: $ID, newState: boolean) => void; diff --git a/app/components/global_threads/thread_item/index.ts b/app/components/global_threads/thread_item/index.ts index cacdbe90d..1ed67a3c7 100644 --- a/app/components/global_threads/thread_item/index.ts +++ b/app/components/global_threads/thread_item/index.ts @@ -1,19 +1,20 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators, Dispatch} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators, Dispatch} from 'redux'; -import {selectPost} from '@mm-redux/actions/posts'; import {getPost, getPostThread} from '@actions/views/post'; +import {selectPost} from '@mm-redux/actions/posts'; import {getChannel} from '@mm-redux/selectors/entities/channels'; import {getPost as getPostSelector} from '@mm-redux/selectors/entities/posts'; import {getThread} from '@mm-redux/selectors/entities/threads'; import {getUser} from '@mm-redux/selectors/entities/users'; -import type {GlobalState} from '@mm-redux/types/store'; import ThreadItem, {DispatchProps, OwnProps, StateProps} from './thread_item'; +import type {GlobalState} from '@mm-redux/types/store'; + function mapStateToProps(state: GlobalState, props: OwnProps) { const {threadId} = props; const post = getPostSelector(state, threadId); diff --git a/app/components/global_threads/thread_item/thread_item.test.tsx b/app/components/global_threads/thread_item/thread_item.test.tsx index ecbbb8607..510c9f75d 100644 --- a/app/components/global_threads/thread_item/thread_item.test.tsx +++ b/app/components/global_threads/thread_item/thread_item.test.tsx @@ -1,9 +1,9 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import {shallow} from 'enzyme'; import React from 'react'; import {Text} from 'react-native'; -import {shallow} from 'enzyme'; import * as navigationActions from '@actions/navigation'; import {THREAD} from '@constants/screen'; @@ -12,7 +12,7 @@ import {Channel} from '@mm-redux/types/channels'; import {Post} from '@mm-redux/types/posts'; import {UserThread} from '@mm-redux/types/threads'; import {UserProfile} from '@mm-redux/types/users'; -import {intl} from 'test/intl-test-helper'; +import {intl} from '@test/intl-test-helper'; import {ThreadItem} from './thread_item'; diff --git a/app/components/global_threads/thread_item/thread_item.tsx b/app/components/global_threads/thread_item/thread_item.tsx index 7dd743d13..d172f9c57 100644 --- a/app/components/global_threads/thread_item/thread_item.tsx +++ b/app/components/global_threads/thread_item/thread_item.tsx @@ -2,25 +2,25 @@ // See LICENSE.txt for license information. import React from 'react'; -import {View, Text, TouchableHighlight} from 'react-native'; import {injectIntl, intlShape} from 'react-intl'; +import {View, Text, TouchableHighlight} from 'react-native'; import {goToScreen} from '@actions/navigation'; -import RemoveMarkdown from '@components/remove_markdown'; import FriendlyDate from '@components/friendly_date'; +import RemoveMarkdown from '@components/remove_markdown'; import {GLOBAL_THREADS, THREAD} from '@constants/screen'; import {Posts, Preferences} from '@mm-redux/constants'; - import {Channel} from '@mm-redux/types/channels'; import {Post} from '@mm-redux/types/posts'; -import type {Theme} from '@mm-redux/types/preferences'; import {UserThread} from '@mm-redux/types/threads'; -import {displayUsername} from '@mm-redux/utils/user_utils'; import {UserProfile} from '@mm-redux/types/users'; +import {displayUsername} from '@mm-redux/utils/user_utils'; import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; import ThreadFooter from '../thread_footer'; +import type {Theme} from '@mm-redux/types/preferences'; + export type DispatchProps = { actions: { getPost: (postId: string) => void; diff --git a/app/components/global_threads/thread_list/index.test.tsx b/app/components/global_threads/thread_list/index.test.tsx index 8ecca07db..b3c74b79f 100644 --- a/app/components/global_threads/thread_list/index.test.tsx +++ b/app/components/global_threads/thread_list/index.test.tsx @@ -1,12 +1,12 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import {shallow} from 'enzyme'; import React from 'react'; import {FlatList} from 'react-native'; -import {shallow} from 'enzyme'; import {Preferences} from '@mm-redux/constants'; -import {intl} from 'test/intl-test-helper'; +import {intl} from '@test/intl-test-helper'; import {ThreadList} from './index'; diff --git a/app/components/global_threads/thread_list/index.tsx b/app/components/global_threads/thread_list/index.tsx index 03b005220..6824e5f14 100644 --- a/app/components/global_threads/thread_list/index.tsx +++ b/app/components/global_threads/thread_list/index.tsx @@ -1,21 +1,22 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. import React from 'react'; -import {FlatList, Platform, View} from 'react-native'; import {injectIntl, intlShape} from 'react-intl'; +import {FlatList, Platform, View} from 'react-native'; import EmptyState from '@components/global_threads/empty_state'; import ThreadItem from '@components/global_threads/thread_item'; import Loading from '@components/loading'; import {INITIAL_BATCH_TO_RENDER} from '@components/post_list/post_list_config'; import {ViewTypes} from '@constants'; -import type {Theme} from '@mm-redux/types/preferences'; -import type {UserThread} from '@mm-redux/types/threads'; -import type {$ID} from '@mm-redux/types/utilities'; import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; import ThreadListHeader from './thread_list_header'; +import type {Theme} from '@mm-redux/types/preferences'; +import type {UserThread} from '@mm-redux/types/threads'; +import type {$ID} from '@mm-redux/types/utilities'; + export type Props = { haveUnreads: boolean; intl: typeof intlShape; diff --git a/app/components/global_threads/thread_list/thread_list_header/index.test.tsx b/app/components/global_threads/thread_list/thread_list_header/index.test.tsx index a3cced8d9..106c9228a 100644 --- a/app/components/global_threads/thread_list/thread_list_header/index.test.tsx +++ b/app/components/global_threads/thread_list/thread_list_header/index.test.tsx @@ -1,10 +1,10 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; -import {intl} from 'test/intl-test-helper'; +import {intl} from '@test/intl-test-helper'; import {ThreadListHeader} from './index'; diff --git a/app/components/global_threads/thread_list/thread_list_header/index.tsx b/app/components/global_threads/thread_list/thread_list_header/index.tsx index aa4319f6b..fecee49b3 100644 --- a/app/components/global_threads/thread_list/thread_list_header/index.tsx +++ b/app/components/global_threads/thread_list/thread_list_header/index.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. import React from 'react'; -import {StyleProp, Text, TextStyle, TouchableOpacity, View, ViewStyle} from 'react-native'; import {injectIntl, intlShape} from 'react-intl'; +import {StyleProp, Text, TextStyle, TouchableOpacity, View, ViewStyle} from 'react-native'; import CompassIcon from '@components/compass_icon'; diff --git a/app/components/image_viewport.tsx b/app/components/image_viewport.tsx index 1427059f7..e5c43ae2c 100644 --- a/app/components/image_viewport.tsx +++ b/app/components/image_viewport.tsx @@ -2,14 +2,14 @@ // See LICENSE.txt for license information. import AsyncStorage from '@react-native-community/async-storage'; + import {PureComponent} from 'react'; import {Dimensions} from 'react-native'; import {DeviceTypes} from '@constants'; +import mattermostManaged from '@mattermost-managed'; import EventEmitter from '@mm-redux/utils/event_emitter'; -import mattermostManaged from 'app/mattermost_managed'; - // TODO: Use permanentSidebar and splitView hooks instead export default class ImageViewPort extends PureComponent { mounted = false; diff --git a/app/components/interactive_dialog_controller/index.js b/app/components/interactive_dialog_controller/index.js index 590ecc2cd..efafadb0e 100644 --- a/app/components/interactive_dialog_controller/index.js +++ b/app/components/interactive_dialog_controller/index.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; import {submitInteractiveDialog} from '@mm-redux/actions/integrations'; diff --git a/app/components/interactive_dialog_controller/interactive_dialog_controller.js b/app/components/interactive_dialog_controller/interactive_dialog_controller.js index d365948b8..10b139fc9 100644 --- a/app/components/interactive_dialog_controller/interactive_dialog_controller.js +++ b/app/components/interactive_dialog_controller/interactive_dialog_controller.js @@ -1,10 +1,10 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {PureComponent} from 'react'; import PropTypes from 'prop-types'; -import {Alert} from 'react-native'; +import {PureComponent} from 'react'; import {intlShape} from 'react-intl'; +import {Alert} from 'react-native'; import {showModal} from '@actions/navigation'; import CompassIcon from '@components/compass_icon'; diff --git a/app/components/interactive_dialog_controller/interactive_dialog_controller.test.js b/app/components/interactive_dialog_controller/interactive_dialog_controller.test.js index dbb519a91..a8bb5bccf 100644 --- a/app/components/interactive_dialog_controller/interactive_dialog_controller.test.js +++ b/app/components/interactive_dialog_controller/interactive_dialog_controller.test.js @@ -3,7 +3,7 @@ import React from 'react'; -import {shallowWithIntl} from 'test/intl-test-helper'; +import {shallowWithIntl} from '@test/intl-test-helper'; import InteractiveDialogController from './interactive_dialog_controller'; diff --git a/app/components/layout/keyboard_layout/index.js b/app/components/layout/keyboard_layout/index.js index af82ae0ba..880b38d41 100644 --- a/app/components/layout/keyboard_layout/index.js +++ b/app/components/layout/keyboard_layout/index.js @@ -3,7 +3,7 @@ import {connect} from 'react-redux'; -import {isLandscape} from 'app/selectors/device'; +import {isLandscape} from '@selectors/device'; import KeyboardLayout from './keyboard_layout'; diff --git a/app/components/layout/keyboard_layout/keyboard_layout.js b/app/components/layout/keyboard_layout/keyboard_layout.js index f38af5aac..f9048e719 100644 --- a/app/components/layout/keyboard_layout/keyboard_layout.js +++ b/app/components/layout/keyboard_layout/keyboard_layout.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import { Keyboard, Platform, diff --git a/app/components/load_more_posts/load_more_posts.js b/app/components/load_more_posts/load_more_posts.js index d96a31ea1..326d08ae2 100644 --- a/app/components/load_more_posts/load_more_posts.js +++ b/app/components/load_more_posts/load_more_posts.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import { ActivityIndicator, View, @@ -10,9 +10,9 @@ import { } from 'react-native'; import FormattedText from '@components/formatted_text'; -import TouchableWithFeedback from 'app/components/touchable_with_feedback'; -import {makeStyleSheetFromTheme} from 'app/utils/theme'; -import {t} from 'app/utils/i18n'; +import TouchableWithFeedback from '@components/touchable_with_feedback'; +import {t} from '@utils/i18n'; +import {makeStyleSheetFromTheme} from '@utils/theme'; export default class LoadMorePosts extends PureComponent { static propTypes = { diff --git a/app/components/loading.js b/app/components/loading.js index 0badae57f..81f757fb4 100644 --- a/app/components/loading.js +++ b/app/components/loading.js @@ -1,9 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; - +import React, {PureComponent} from 'react'; import { ActivityIndicator, StyleSheet, diff --git a/app/components/loading.stories.tsx b/app/components/loading.stories.tsx index c1a3df449..0ea6c6212 100644 --- a/app/components/loading.stories.tsx +++ b/app/components/loading.stories.tsx @@ -1,9 +1,10 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; -import {storiesOf} from '@storybook/react-native'; import {withKnobs, select} from '@storybook/addon-knobs'; +import {storiesOf} from '@storybook/react-native'; + +import React from 'react'; import Loading from './loading'; diff --git a/app/components/markdown/hashtag/index.test.js b/app/components/markdown/hashtag/index.test.js index 1123f94e8..adb7be0c8 100644 --- a/app/components/markdown/hashtag/index.test.js +++ b/app/components/markdown/hashtag/index.test.js @@ -4,7 +4,7 @@ import {shallow} from 'enzyme'; import React from 'react'; -import * as NavigationActions from 'app/actions/navigation'; +import * as NavigationActions from '@actions/navigation'; import Hashtag from './index'; diff --git a/app/components/markdown/markdown.js b/app/components/markdown/markdown.js index eb7808afa..9dc30406a 100644 --- a/app/components/markdown/markdown.js +++ b/app/components/markdown/markdown.js @@ -3,8 +3,8 @@ import {Parser, Node} from 'commonmark'; import Renderer from 'commonmark-react-renderer'; -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import { Platform, Text, @@ -26,9 +26,9 @@ import MarkdownLink from './markdown_link'; import MarkdownList from './markdown_list'; import MarkdownListItem from './markdown_list_item'; import MarkdownTable from './markdown_table'; +import MarkdownTableCell from './markdown_table_cell'; import MarkdownTableImage from './markdown_table_image'; import MarkdownTableRow from './markdown_table_row'; -import MarkdownTableCell from './markdown_table_cell'; import { addListItemIndices, combineTextNodes, diff --git a/app/components/markdown/markdown.test.js b/app/components/markdown/markdown.test.js index 760fa4185..110055016 100644 --- a/app/components/markdown/markdown.test.js +++ b/app/components/markdown/markdown.test.js @@ -1,8 +1,9 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; + import Markdown from './markdown.js'; describe('Markdown', () => { diff --git a/app/components/markdown/markdown_block_quote.js b/app/components/markdown/markdown_block_quote.js index 681954623..6b64b0668 100644 --- a/app/components/markdown/markdown_block_quote.js +++ b/app/components/markdown/markdown_block_quote.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import { StyleSheet, View, diff --git a/app/components/markdown/markdown_code_block/markdown_code_block.js b/app/components/markdown/markdown_code_block/markdown_code_block.js index 12dd457a6..87bc02f65 100644 --- a/app/components/markdown/markdown_code_block/markdown_code_block.js +++ b/app/components/markdown/markdown_code_block/markdown_code_block.js @@ -1,11 +1,12 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import Clipboard from '@react-native-community/clipboard'; + +import {PropTypes} from 'prop-types'; import React from 'react'; import {intlShape} from 'react-intl'; import {Keyboard, StyleSheet, Text, View} from 'react-native'; -import Clipboard from '@react-native-community/clipboard'; -import {PropTypes} from 'prop-types'; import {goToScreen} from '@actions/navigation'; import FormattedText from '@components/formatted_text'; diff --git a/app/components/markdown/markdown_emoji/markdown_emoji.js b/app/components/markdown/markdown_emoji/markdown_emoji.js index 7fae0381d..391f0fb15 100644 --- a/app/components/markdown/markdown_emoji/markdown_emoji.js +++ b/app/components/markdown/markdown_emoji/markdown_emoji.js @@ -3,9 +3,9 @@ import {Node, Parser} from 'commonmark'; import Renderer from 'commonmark-react-renderer'; +import PropTypes from 'prop-types'; import React, {PureComponent} from 'react'; import {Platform, Text, View} from 'react-native'; -import PropTypes from 'prop-types'; import Emoji from '@components/emoji'; import FormattedText from '@components/formatted_text'; diff --git a/app/components/markdown/markdown_emoji/markdown_emoji.test.js b/app/components/markdown/markdown_emoji/markdown_emoji.test.js index 666dc9020..798002023 100644 --- a/app/components/markdown/markdown_emoji/markdown_emoji.test.js +++ b/app/components/markdown/markdown_emoji/markdown_emoji.test.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import Preferences from '@mm-redux/constants/preferences'; diff --git a/app/components/markdown/markdown_image/markdown_image.js b/app/components/markdown/markdown_image/markdown_image.js index cfa45495b..4b1034aa6 100644 --- a/app/components/markdown/markdown_image/markdown_image.js +++ b/app/components/markdown/markdown_image/markdown_image.js @@ -1,6 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import Clipboard from '@react-native-community/clipboard'; + import PropTypes from 'prop-types'; import React from 'react'; import {intlShape} from 'react-intl'; @@ -11,23 +13,21 @@ import { Text, View, } from 'react-native'; -import Clipboard from '@react-native-community/clipboard'; import parseUrl from 'url-parse'; import CompassIcon from '@components/compass_icon'; +import FormattedText from '@components/formatted_text'; import ImageViewPort from '@components/image_viewport'; import ProgressiveImage from '@components/progressive_image'; -import FormattedText from '@components/formatted_text'; import TouchableWithFeedback from '@components/touchable_with_feedback'; +import mattermostManaged from '@mattermost-managed'; import EphemeralStore from '@store/ephemeral_store'; import BottomSheet from '@utils/bottom_sheet'; import {generateId} from '@utils/file'; -import {calculateDimensions, getViewPortWidth, isGifTooLarge} from '@utils/images'; import {openGalleryAtIndex} from '@utils/gallery'; +import {calculateDimensions, getViewPortWidth, isGifTooLarge} from '@utils/images'; import {normalizeProtocol, tryOpenURL} from '@utils/url'; -import mattermostManaged from 'app/mattermost_managed'; - const ANDROID_MAX_HEIGHT = 4096; const ANDROID_MAX_WIDTH = 4096; diff --git a/app/components/markdown/markdown_link/index.js b/app/components/markdown/markdown_link/index.js index 686cb6d52..c2b7b7be1 100644 --- a/app/components/markdown/markdown_link/index.js +++ b/app/components/markdown/markdown_link/index.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; import {handleSelectChannelByName} from '@actions/views/channel'; import {showPermalink} from '@actions/views/permalink'; diff --git a/app/components/markdown/markdown_link/markdown_link.js b/app/components/markdown/markdown_link/markdown_link.js index 200ab059e..0d21eaa31 100644 --- a/app/components/markdown/markdown_link/markdown_link.js +++ b/app/components/markdown/markdown_link/markdown_link.js @@ -1,24 +1,24 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {Children, PureComponent} from 'react'; -import PropTypes from 'prop-types'; -import {Alert, Text} from 'react-native'; import Clipboard from '@react-native-community/clipboard'; + +import PropTypes from 'prop-types'; +import React, {Children, PureComponent} from 'react'; import {intlShape} from 'react-intl'; +import {Alert, Text} from 'react-native'; import urlParse from 'url-parse'; import {dismissAllModals, popToRoot} from '@actions/navigation'; import Config from '@assets/config'; import {DeepLinkTypes} from '@constants'; import {getCurrentServerUrl} from '@init/credentials'; +import mattermostManaged from '@mattermost-managed'; import BottomSheet from '@utils/bottom_sheet'; import {errorBadChannel} from '@utils/draft'; import {preventDoubleTap} from '@utils/tap'; import {matchDeepLink, normalizeProtocol, tryOpenURL, PERMALINK_GENERIC_TEAM_NAME_REDIRECT} from '@utils/url'; -import mattermostManaged from 'app/mattermost_managed'; - export default class MarkdownLink extends PureComponent { static propTypes = { actions: PropTypes.shape({ diff --git a/app/components/markdown/markdown_list_item.js b/app/components/markdown/markdown_list_item.js index 629b5cc8b..b831418ce 100644 --- a/app/components/markdown/markdown_list_item.js +++ b/app/components/markdown/markdown_list_item.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import { StyleSheet, Text, diff --git a/app/components/markdown/markdown_table/markdown_table.js b/app/components/markdown/markdown_table/markdown_table.js index 7e8e64fd8..649a90a0f 100644 --- a/app/components/markdown/markdown_table/markdown_table.js +++ b/app/components/markdown/markdown_table/markdown_table.js @@ -12,13 +12,13 @@ import { } from 'react-native'; import LinearGradient from 'react-native-linear-gradient'; +import {goToScreen} from '@actions/navigation'; import CompassIcon from '@components/compass_icon'; import {CELL_MAX_WIDTH, CELL_MIN_WIDTH} from '@components/markdown/markdown_table_cell/markdown_table_cell'; import TouchableWithFeedback from '@components/touchable_with_feedback'; +import {DeviceTypes} from '@constants'; import {preventDoubleTap} from '@utils/tap'; import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; -import {goToScreen} from '@actions/navigation'; -import {DeviceTypes} from '@constants'; const MAX_HEIGHT = 300; const MAX_PREVIEW_COLUMNS = 5; diff --git a/app/components/markdown/markdown_table/markdown_table.test.js b/app/components/markdown/markdown_table/markdown_table.test.js index d17bbeca5..4ce39f5f1 100644 --- a/app/components/markdown/markdown_table/markdown_table.test.js +++ b/app/components/markdown/markdown_table/markdown_table.test.js @@ -2,9 +2,9 @@ // See LICENSE.txt for license information. import React from 'react'; -import {shallowWithIntl} from 'test/intl-test-helper'; import Preferences from '@mm-redux/constants/preferences'; +import {shallowWithIntl} from '@test/intl-test-helper'; import MarkdownTable from './markdown_table'; diff --git a/app/components/markdown/markdown_table_cell/markdown_table_cell.js b/app/components/markdown/markdown_table_cell/markdown_table_cell.js index 51ab89e6f..59ca27a1e 100644 --- a/app/components/markdown/markdown_table_cell/markdown_table_cell.js +++ b/app/components/markdown/markdown_table_cell/markdown_table_cell.js @@ -5,7 +5,7 @@ import PropTypes from 'prop-types'; import React from 'react'; import {View} from 'react-native'; -import {changeOpacity, makeStyleSheetFromTheme} from 'app/utils/theme'; +import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; export const CELL_MIN_WIDTH = 96; export const CELL_MAX_WIDTH = 192; diff --git a/app/components/markdown/markdown_table_image/markdown_table_image.tsx b/app/components/markdown/markdown_table_image/markdown_table_image.tsx index e5c7192e9..68e226de9 100644 --- a/app/components/markdown/markdown_table_image/markdown_table_image.tsx +++ b/app/components/markdown/markdown_table_image/markdown_table_image.tsx @@ -8,13 +8,13 @@ import parseUrl from 'url-parse'; import CompassIcon from '@components/compass_icon'; import ProgressiveImage from '@components/progressive_image'; import TouchableWithFeedback from '@components/touchable_with_feedback'; +import {FileInfo} from '@mm-redux/types/files'; import EphemeralStore from '@store/ephemeral_store'; -import {calculateDimensions, isGifTooLarge} from '@utils/images'; -import {openGalleryAtIndex} from '@utils/gallery'; import {generateId} from '@utils/file'; +import {openGalleryAtIndex} from '@utils/gallery'; +import {calculateDimensions, isGifTooLarge} from '@utils/images'; import type {PostImage} from '@mm-redux/types/posts'; -import {FileInfo} from '@mm-redux/types/files'; type MarkdownTableImageProps = { disable: boolean; diff --git a/app/components/markdown/markdown_table_row/markdown_table_row.js b/app/components/markdown/markdown_table_row/markdown_table_row.js index ca4a38afa..b53c07619 100644 --- a/app/components/markdown/markdown_table_row/markdown_table_row.js +++ b/app/components/markdown/markdown_table_row/markdown_table_row.js @@ -5,7 +5,7 @@ import PropTypes from 'prop-types'; import React from 'react'; import {View} from 'react-native'; -import {changeOpacity, makeStyleSheetFromTheme} from 'app/utils/theme'; +import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; export default class MarkdownTableRow extends React.PureComponent { static propTypes = { diff --git a/app/components/markdown/transform.js b/app/components/markdown/transform.js index 7a5643c04..a82f464e9 100644 --- a/app/components/markdown/transform.js +++ b/app/components/markdown/transform.js @@ -3,7 +3,7 @@ import {Node} from 'commonmark'; -import {escapeRegex} from 'app/utils/markdown'; +import {escapeRegex} from '@utils/markdown'; /* eslint-disable no-underscore-dangle */ diff --git a/app/components/markdown/transform.test.js b/app/components/markdown/transform.test.js index 93e07ca89..e0d966a1f 100644 --- a/app/components/markdown/transform.test.js +++ b/app/components/markdown/transform.test.js @@ -2,6 +2,7 @@ // See LICENSE.txt for license information. import assert from 'assert'; + import {Node, Parser} from 'commonmark'; import { @@ -11,7 +12,7 @@ import { highlightMentions, highlightTextNode, pullOutImages, -} from 'app/components/markdown/transform'; +} from '@components/markdown/transform'; /* eslint-disable no-console, no-underscore-dangle */ diff --git a/app/components/network_indicator/index.ts b/app/components/network_indicator/index.ts index 35ab54923..6062e11cf 100644 --- a/app/components/network_indicator/index.ts +++ b/app/components/network_indicator/index.ts @@ -3,17 +3,16 @@ import {connect} from 'react-redux'; -import {stopPeriodicStatusUpdates, startPeriodicStatusUpdates} from '@mm-redux/actions/users'; +import {markChannelViewedAndReadOnReconnect} from '@actions/views/channel'; +import {setCurrentUserStatusOffline} from '@actions/views/user'; import {init as initWebSocket, close as closeWebSocket} from '@actions/websocket'; +import {stopPeriodicStatusUpdates, startPeriodicStatusUpdates} from '@mm-redux/actions/users'; import {getCurrentChannelId} from '@mm-redux/selectors/entities/channels'; -import {markChannelViewedAndReadOnReconnect} from 'app/actions/views/channel'; -import {setCurrentUserStatusOffline} from 'app/actions/views/user'; +import NetworkIndicator from './network'; import type {GlobalState} from '@mm-redux/types/store'; -import NetworkIndicator from './network'; - function mapStateToProps(state: GlobalState) { const {websocket} = state.requests.general; diff --git a/app/components/network_indicator/network.tsx b/app/components/network_indicator/network.tsx index d68b39502..23df1c485 100644 --- a/app/components/network_indicator/network.tsx +++ b/app/components/network_indicator/network.tsx @@ -2,6 +2,7 @@ // See LICENSE.txt for license information. import {useNetInfo} from '@react-native-community/netinfo'; + import React, {useEffect, useRef, useState} from 'react'; import {ActivityIndicator, AppState, AppStateStatus, Platform, StyleSheet, View} from 'react-native'; import Animated, {Easing, interpolateColor, runOnJS, useAnimatedStyle, useSharedValue, withTiming} from 'react-native-reanimated'; @@ -33,7 +34,7 @@ type AppStateCallBack = (appState: AppStateStatus) => Promise; type ConnectionChangedEvent = { hasInternet: boolean; - serverReachable: boolean + serverReachable: boolean; }; const MAX_WEBSOCKET_RETRIES = 3; diff --git a/app/components/no_results.js b/app/components/no_results.js index 8b0927f6e..79864a5bd 100644 --- a/app/components/no_results.js +++ b/app/components/no_results.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import {Text, View} from 'react-native'; import CompassIcon from '@components/compass_icon'; diff --git a/app/components/pasteable_text_input/index.js b/app/components/pasteable_text_input/index.js index 0b492e92c..63de6fbf3 100644 --- a/app/components/pasteable_text_input/index.js +++ b/app/components/pasteable_text_input/index.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import PropTypes from 'prop-types'; +import React from 'react'; import {NativeEventEmitter, NativeModules, Platform, TextInput} from 'react-native'; import {PASTE_FILES} from '@constants/post_draft'; diff --git a/app/components/pasteable_text_input/index.test.js b/app/components/pasteable_text_input/index.test.js index 237077854..c81d04b70 100644 --- a/app/components/pasteable_text_input/index.test.js +++ b/app/components/pasteable_text_input/index.test.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import {shallow} from 'enzyme'; import React from 'react'; import {NativeEventEmitter} from 'react-native'; -import {shallow} from 'enzyme'; import {PASTE_FILES} from '@constants/post_draft'; import EventEmitter from '@mm-redux/utils/event_emitter'; diff --git a/app/components/post_draft/archived/archived.js b/app/components/post_draft/archived/archived.js index c221ba579..d9d963311 100644 --- a/app/components/post_draft/archived/archived.js +++ b/app/components/post_draft/archived/archived.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import {View} from 'react-native'; import Button from 'react-native-button'; diff --git a/app/components/post_draft/archived/archived.test.js b/app/components/post_draft/archived/archived.test.js index f6cd880e1..ad2669fd6 100644 --- a/app/components/post_draft/archived/archived.test.js +++ b/app/components/post_draft/archived/archived.test.js @@ -4,8 +4,8 @@ import React from 'react'; import Preferences from '@mm-redux/constants/preferences'; +import {shallowWithIntl} from '@test/intl-test-helper'; -import {shallowWithIntl} from 'test/intl-test-helper'; import Archived from './index'; describe('PostDraft Archived', () => { diff --git a/app/components/post_draft/draft_input/draft_input.js b/app/components/post_draft/draft_input/draft_input.js index dd464b3a9..5aa919aba 100644 --- a/app/components/post_draft/draft_input/draft_input.js +++ b/app/components/post_draft/draft_input/draft_input.js @@ -1,10 +1,10 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; -import {Platform, ScrollView, View} from 'react-native'; +import React, {PureComponent} from 'react'; import {intlShape} from 'react-intl'; +import {Platform, ScrollView, View} from 'react-native'; import HWKeyboardEvent from 'react-native-hw-keyboard-event'; import {SafeAreaView} from 'react-native-safe-area-context'; diff --git a/app/components/post_draft/draft_input/draft_input.test.js b/app/components/post_draft/draft_input/draft_input.test.js index 7b962bc77..f01d0ffb1 100644 --- a/app/components/post_draft/draft_input/draft_input.test.js +++ b/app/components/post_draft/draft_input/draft_input.test.js @@ -3,9 +3,10 @@ import React from 'react'; import {Alert} from 'react-native'; -import {shallowWithIntl} from 'test/intl-test-helper'; import Preferences from '@mm-redux/constants/preferences'; +import {shallowWithIntl} from '@test/intl-test-helper'; + import DraftInput from './draft_input'; jest.useFakeTimers(); diff --git a/app/components/post_draft/index.js b/app/components/post_draft/index.js index ab04bbc7c..33dad5fae 100644 --- a/app/components/post_draft/index.js +++ b/app/components/post_draft/index.js @@ -3,12 +3,12 @@ import {connect} from 'react-redux'; -import {isMinimumServerVersion} from '@mm-redux/utils/helpers'; import {General, Permissions} from '@mm-redux/constants'; import {getCurrentChannel, getChannel, isChannelReadOnlyById} from '@mm-redux/selectors/entities/channels'; -import {haveIChannelPermission} from '@mm-redux/selectors/entities/roles'; import {getTheme} from '@mm-redux/selectors/entities/preferences'; +import {haveIChannelPermission} from '@mm-redux/selectors/entities/roles'; import {getCurrentUserId} from '@mm-redux/selectors/entities/users'; +import {isMinimumServerVersion} from '@mm-redux/utils/helpers'; import {getChannelMembersForDm} from '@selectors/channel'; import PostDraft from './post_draft'; diff --git a/app/components/post_draft/index.test.js b/app/components/post_draft/index.test.js index 1e4cba5da..263c11d11 100644 --- a/app/components/post_draft/index.test.js +++ b/app/components/post_draft/index.test.js @@ -7,7 +7,6 @@ import {Permissions} from '@mm-redux/constants'; import * as channelSelectors from '@mm-redux/selectors/entities/channels'; import * as preferenceSelectors from '@mm-redux/selectors/entities/preferences'; import * as roleSelectors from '@mm-redux/selectors/entities/roles'; - import {isMinimumServerVersion} from '@mm-redux/utils/helpers'; import {mapStateToProps} from './index'; diff --git a/app/components/post_draft/post_draft.js b/app/components/post_draft/post_draft.js index 3ac029698..036b2cf94 100644 --- a/app/components/post_draft/post_draft.js +++ b/app/components/post_draft/post_draft.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import {Platform} from 'react-native'; import {KeyboardTrackingView} from 'react-native-keyboard-tracking-view'; diff --git a/app/components/post_draft/post_draft.test.js b/app/components/post_draft/post_draft.test.js index 9a099eef7..79fef2d70 100644 --- a/app/components/post_draft/post_draft.test.js +++ b/app/components/post_draft/post_draft.test.js @@ -7,7 +7,7 @@ import thunk from 'redux-thunk'; import Preferences from '@mm-redux/constants/preferences'; import intitialState from '@store/initial_state'; -import {renderWithReduxIntl} from 'test/testing_library'; +import {renderWithReduxIntl} from '@test/testing_library'; import PostDraft from './post_draft'; diff --git a/app/components/post_draft/post_input/post_input.js b/app/components/post_draft/post_input/post_input.js index 6e9ad5240..6912528e9 100644 --- a/app/components/post_draft/post_input/post_input.js +++ b/app/components/post_draft/post_input/post_input.js @@ -1,10 +1,10 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; -import {Alert, AppState, findNodeHandle, Keyboard, NativeModules, Platform} from 'react-native'; +import React, {PureComponent} from 'react'; import {intlShape} from 'react-intl'; +import {Alert, AppState, findNodeHandle, Keyboard, NativeModules, Platform} from 'react-native'; import PasteableTextInput from '@components/pasteable_text_input'; import {NavigationTypes} from '@constants'; diff --git a/app/components/post_draft/post_input/post_input.test.js b/app/components/post_draft/post_input/post_input.test.js index 025bb6c19..b434177c0 100644 --- a/app/components/post_draft/post_input/post_input.test.js +++ b/app/components/post_draft/post_input/post_input.test.js @@ -3,11 +3,11 @@ import React from 'react'; import {Alert} from 'react-native'; -import {shallowWithIntl} from 'test/intl-test-helper'; -import TestHelper from 'test/test_helper'; import Device from '@constants/device'; import Preferences from '@mm-redux/constants/preferences'; +import {shallowWithIntl} from '@test/intl-test-helper'; +import TestHelper from '@test/test_helper'; import PostInput from './post_input'; diff --git a/app/components/post_draft/quick_actions/camera_quick_action/camera_quick_action.test.js b/app/components/post_draft/quick_actions/camera_quick_action/camera_quick_action.test.js index dc271fa85..c9f83cb67 100644 --- a/app/components/post_draft/quick_actions/camera_quick_action/camera_quick_action.test.js +++ b/app/components/post_draft/quick_actions/camera_quick_action/camera_quick_action.test.js @@ -2,13 +2,14 @@ // See LICENSE.txt for license information. import {fireEvent} from '@testing-library/react-native'; + import React from 'react'; import {Alert} from 'react-native'; import Permissions from 'react-native-permissions'; import * as Navigation from '@actions/navigation'; import Preferences from '@mm-redux/constants/preferences'; -import {renderWithIntl} from 'test/testing_library'; +import {renderWithIntl} from '@test/testing_library'; import CameraQuickAction from './index'; diff --git a/app/components/post_draft/quick_actions/camera_quick_action/index.tsx b/app/components/post_draft/quick_actions/camera_quick_action/index.tsx index c14b25ffa..8126e3eb9 100644 --- a/app/components/post_draft/quick_actions/camera_quick_action/index.tsx +++ b/app/components/post_draft/quick_actions/camera_quick_action/index.tsx @@ -15,10 +15,10 @@ import EventEmitter from '@mm-redux/utils/event_emitter'; import {hasCameraPermission} from '@utils/permission'; import {changeOpacity} from '@utils/theme'; -import type {QuickActionAttachmentProps} from '@typings/components/post_draft_quick_action'; - import CameraType from './camera_type'; +import type {QuickActionAttachmentProps} from '@typings/components/post_draft_quick_action'; + const style = StyleSheet.create({ icon: { alignItems: 'center', diff --git a/app/components/post_draft/quick_actions/file_quick_action/file_quick_action.test.js b/app/components/post_draft/quick_actions/file_quick_action/file_quick_action.test.js index 6c17019fb..e343bb8ec 100644 --- a/app/components/post_draft/quick_actions/file_quick_action/file_quick_action.test.js +++ b/app/components/post_draft/quick_actions/file_quick_action/file_quick_action.test.js @@ -2,12 +2,13 @@ // See LICENSE.txt for license information. import {fireEvent} from '@testing-library/react-native'; + import React from 'react'; import {Alert, Platform} from 'react-native'; import Permissions from 'react-native-permissions'; import Preferences from '@mm-redux/constants/preferences'; -import {renderWithIntl} from 'test/testing_library'; +import {renderWithIntl} from '@test/testing_library'; import FileQuickAction from './index'; diff --git a/app/components/post_draft/quick_actions/file_quick_action/index.tsx b/app/components/post_draft/quick_actions/file_quick_action/index.tsx index c5b36fdad..6051a8d49 100644 --- a/app/components/post_draft/quick_actions/file_quick_action/index.tsx +++ b/app/components/post_draft/quick_actions/file_quick_action/index.tsx @@ -1,5 +1,6 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. + import React, {useCallback} from 'react'; import {injectIntl} from 'react-intl'; import {NativeModules, Platform, StyleSheet} from 'react-native'; diff --git a/app/components/post_draft/quick_actions/image_quick_action/image_quick_action.test.js b/app/components/post_draft/quick_actions/image_quick_action/image_quick_action.test.js index 63aaf1b3e..39b90b08a 100644 --- a/app/components/post_draft/quick_actions/image_quick_action/image_quick_action.test.js +++ b/app/components/post_draft/quick_actions/image_quick_action/image_quick_action.test.js @@ -1,14 +1,15 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import {fireEvent} from '@testing-library/react-native'; + import React from 'react'; import {Alert, Platform, StatusBar} from 'react-native'; import Permissions from 'react-native-permissions'; -import {fireEvent} from '@testing-library/react-native'; import Preferences from '@mm-redux/constants/preferences'; +import {renderWithIntl} from '@test/testing_library'; import * as PermissionUtils from '@utils/permission'; -import {renderWithIntl} from 'test/testing_library'; import ImageQuickAction from './index'; diff --git a/app/components/post_draft/quick_actions/image_quick_action/index.tsx b/app/components/post_draft/quick_actions/image_quick_action/index.tsx index ca7a6db45..356dcf175 100644 --- a/app/components/post_draft/quick_actions/image_quick_action/index.tsx +++ b/app/components/post_draft/quick_actions/image_quick_action/index.tsx @@ -9,8 +9,8 @@ import {launchImageLibrary, ImageLibraryOptions} from 'react-native-image-picker import CompassIcon from '@components/compass_icon'; import TouchableWithFeedback from '@components/touchable_with_feedback'; import {NavigationTypes} from '@constants'; -import EventEmitter from '@mm-redux/utils/event_emitter'; import {ICON_SIZE, MAX_FILE_COUNT, MAX_FILE_COUNT_WARNING} from '@constants/post_draft'; +import EventEmitter from '@mm-redux/utils/event_emitter'; import {lookupMimeType} from '@utils/file'; import {hasPhotoPermission} from '@utils/permission'; import {changeOpacity} from '@utils/theme'; diff --git a/app/components/post_draft/quick_actions/input_quick_action/index.js b/app/components/post_draft/quick_actions/input_quick_action/index.js index 398c9a479..a3736b8d5 100644 --- a/app/components/post_draft/quick_actions/input_quick_action/index.js +++ b/app/components/post_draft/quick_actions/input_quick_action/index.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import CompassIcon from '@components/compass_icon'; import TouchableWithFeedback from '@components/touchable_with_feedback'; diff --git a/app/components/post_draft/quick_actions/input_quick_action/input_quick_action.test.js b/app/components/post_draft/quick_actions/input_quick_action/input_quick_action.test.js index 08b0649c9..f88c69baa 100644 --- a/app/components/post_draft/quick_actions/input_quick_action/input_quick_action.test.js +++ b/app/components/post_draft/quick_actions/input_quick_action/input_quick_action.test.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import Preferences from '@mm-redux/constants/preferences'; diff --git a/app/components/post_draft/quick_actions/quick_actions.js b/app/components/post_draft/quick_actions/quick_actions.js index 2096a66db..7c0c2b1df 100644 --- a/app/components/post_draft/quick_actions/quick_actions.js +++ b/app/components/post_draft/quick_actions/quick_actions.js @@ -1,16 +1,16 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import {Platform, StyleSheet, View} from 'react-native'; import {MAX_FILE_COUNT, UPLOAD_FILES} from '@constants/post_draft'; import EventEmitter from '@mm-redux/utils/event_emitter'; import CameraAction from './camera_quick_action'; -import ImageAction from './image_quick_action'; import FileAction from './file_quick_action'; +import ImageAction from './image_quick_action'; import InputAction from './input_quick_action'; export default class QuickActions extends PureComponent { diff --git a/app/components/post_draft/quick_actions/quick_actions.test.js b/app/components/post_draft/quick_actions/quick_actions.test.js index 64fe29375..fb4e6e49b 100644 --- a/app/components/post_draft/quick_actions/quick_actions.test.js +++ b/app/components/post_draft/quick_actions/quick_actions.test.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import Preferences from '@mm-redux/constants/preferences'; diff --git a/app/components/post_draft/read_only/index.tsx b/app/components/post_draft/read_only/index.tsx index 7b2e7453c..543912d7c 100644 --- a/app/components/post_draft/read_only/index.tsx +++ b/app/components/post_draft/read_only/index.tsx @@ -7,9 +7,10 @@ import {SafeAreaView} from 'react-native-safe-area-context'; import CompassIcon from '@components/compass_icon'; import FormattedText from '@components/formatted_text'; -import type {Theme} from '@mm-redux/types/preferences'; import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; +import type {Theme} from '@mm-redux/types/preferences'; + interface ReadOnlyProps { testID?: string; theme: Theme; diff --git a/app/components/post_draft/read_only/read_only.test.js b/app/components/post_draft/read_only/read_only.test.js index 045064242..9d313dff3 100644 --- a/app/components/post_draft/read_only/read_only.test.js +++ b/app/components/post_draft/read_only/read_only.test.js @@ -4,8 +4,8 @@ import React from 'react'; import Preferences from '@mm-redux/constants/preferences'; +import {shallowWithIntl} from '@test/intl-test-helper'; -import {shallowWithIntl} from 'test/intl-test-helper'; import ReadOnly from './index'; describe('PostDraft ReadOnly', () => { diff --git a/app/components/post_draft/send_action/index.js b/app/components/post_draft/send_action/index.js index 00c66d626..c43109be0 100644 --- a/app/components/post_draft/send_action/index.js +++ b/app/components/post_draft/send_action/index.js @@ -1,9 +1,9 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import PropTypes from 'prop-types'; import React, {memo} from 'react'; import {View} from 'react-native'; -import PropTypes from 'prop-types'; import CompassIcon from '@components/compass_icon'; import TouchableWithFeedback from '@components/touchable_with_feedback'; diff --git a/app/components/post_draft/send_action/send.test.js b/app/components/post_draft/send_action/send.test.js index 7b95d6052..94dc848a2 100644 --- a/app/components/post_draft/send_action/send.test.js +++ b/app/components/post_draft/send_action/send.test.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import Preferences from '@mm-redux/constants/preferences'; import {changeOpacity} from '@utils/theme'; diff --git a/app/components/post_draft/typing/typing.js b/app/components/post_draft/typing/typing.js index dad39f9e7..15f2b93d4 100644 --- a/app/components/post_draft/typing/typing.js +++ b/app/components/post_draft/typing/typing.js @@ -1,18 +1,17 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import { Animated, Platform, Text, } from 'react-native'; -import EventEmitter from '@mm-redux/utils/event_emitter'; - import FormattedText from '@components/formatted_text'; -import {makeStyleSheetFromTheme} from '@utils/theme'; import {TYPING_VISIBLE, TYPING_HEIGHT} from '@constants/post_draft'; +import EventEmitter from '@mm-redux/utils/event_emitter'; +import {makeStyleSheetFromTheme} from '@utils/theme'; export default class Typing extends PureComponent { static propTypes = { diff --git a/app/components/post_draft/typing/typing.test.js b/app/components/post_draft/typing/typing.test.js index 4c6a0bcfb..923937c97 100644 --- a/app/components/post_draft/typing/typing.test.js +++ b/app/components/post_draft/typing/typing.test.js @@ -1,12 +1,11 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import {Animated} from 'react-native'; -import EventEmitter from '@mm-redux/utils/event_emitter'; - import {TYPING_VISIBLE} from '@constants/post_draft'; +import EventEmitter from '@mm-redux/utils/event_emitter'; import Typing from './typing'; diff --git a/app/components/post_draft/uploads/upload_item/index.js b/app/components/post_draft/uploads/upload_item/index.js index ed027d78f..7b4146500 100644 --- a/app/components/post_draft/uploads/upload_item/index.js +++ b/app/components/post_draft/uploads/upload_item/index.js @@ -3,7 +3,7 @@ import {connect} from 'react-redux'; -import {handleRemoveFile, retryFileUpload, uploadComplete, uploadFailed} from 'app/actions/views/file_upload'; +import {handleRemoveFile, retryFileUpload, uploadComplete, uploadFailed} from '@actions/views/file_upload'; import UploadItem from './upload_item'; diff --git a/app/components/post_draft/uploads/upload_item/upload_item.js b/app/components/post_draft/uploads/upload_item/upload_item.js index 49e644a57..3d2e4dac1 100644 --- a/app/components/post_draft/uploads/upload_item/upload_item.js +++ b/app/components/post_draft/uploads/upload_item/upload_item.js @@ -1,25 +1,25 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import {StyleSheet, TouchableOpacity, View} from 'react-native'; import RNFetchBlob from 'rn-fetch-blob'; import {Client4} from '@client/rest'; - -import mattermostBucket from 'app/mattermost_bucket'; -import ImageFile from '@components/post_list/post/body/files/image_file'; import FileIcon from '@components//post_list/post/body/files/file_icon'; +import ImageFile from '@components/post_list/post/body/files/image_file'; import ProgressBar from '@components/progress_bar'; +import {analytics} from '@init/analytics.ts'; import {buildFileUploadData, encodeHeaderURIStringToUTF8, isImage} from '@utils/file'; import {emptyFunction} from '@utils/general'; import ImageCacheManager from '@utils/image_cache_manager'; import {changeOpacity} from '@utils/theme'; +import mattermostBucket from 'app/mattermost_bucket'; + import UploadRemove from './upload_remove'; import UploadRetry from './upload_retry'; -import {analytics} from '@init/analytics.ts'; export default class UploadItem extends PureComponent { static propTypes = { diff --git a/app/components/post_draft/uploads/upload_item/upload_item.test.js b/app/components/post_draft/uploads/upload_item/upload_item.test.js index 833ff9f96..e19c41ada 100644 --- a/app/components/post_draft/uploads/upload_item/upload_item.test.js +++ b/app/components/post_draft/uploads/upload_item/upload_item.test.js @@ -1,12 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; -import {shallowWithIntl} from 'test/intl-test-helper'; +import React from 'react'; import {Preferences} from '@mm-redux/constants'; +import {shallowWithIntl} from '@test/intl-test-helper'; import ImageCacheManager from '@utils/image_cache_manager'; + import UploadItem from './upload_item'; describe('UploadItem', () => { diff --git a/app/components/post_draft/uploads/upload_item/upload_remove.js b/app/components/post_draft/uploads/upload_item/upload_remove.js index 5839d6e0b..8b94ab0d7 100644 --- a/app/components/post_draft/uploads/upload_item/upload_remove.js +++ b/app/components/post_draft/uploads/upload_item/upload_remove.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import {View, Platform} from 'react-native'; import CompassIcon from '@components/compass_icon'; diff --git a/app/components/post_draft/uploads/upload_item/upload_remove.test.js b/app/components/post_draft/uploads/upload_item/upload_remove.test.js index 6d6a2cc81..87366cfa3 100644 --- a/app/components/post_draft/uploads/upload_item/upload_remove.test.js +++ b/app/components/post_draft/uploads/upload_item/upload_remove.test.js @@ -2,9 +2,10 @@ // See LICENSE.txt for license information. import React from 'react'; -import {shallowWithIntl} from 'test/intl-test-helper'; import {Preferences} from '@mm-redux/constants'; +import {shallowWithIntl} from '@test/intl-test-helper'; + import UploadRemove from './upload_remove'; describe('UploadRemove', () => { diff --git a/app/components/post_draft/uploads/upload_item/upload_retry.js b/app/components/post_draft/uploads/upload_item/upload_retry.js index 94578a484..e97690370 100644 --- a/app/components/post_draft/uploads/upload_item/upload_retry.js +++ b/app/components/post_draft/uploads/upload_item/upload_retry.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import {StyleSheet} from 'react-native'; import CompassIcon from '@components/compass_icon'; diff --git a/app/components/post_draft/uploads/uploads.js b/app/components/post_draft/uploads/uploads.js index 17482dd09..28909098c 100644 --- a/app/components/post_draft/uploads/uploads.js +++ b/app/components/post_draft/uploads/uploads.js @@ -1,8 +1,9 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; +import {intlShape} from 'react-intl'; import { Alert, BackHandler, @@ -12,7 +13,6 @@ import { Platform, } from 'react-native'; import * as Animatable from 'react-native-animatable'; -import {intlShape} from 'react-intl'; import RNFetchBlob from 'rn-fetch-blob'; import FormattedText from '@components/formatted_text'; diff --git a/app/components/post_draft/uploads/uploads.test.js b/app/components/post_draft/uploads/uploads.test.js index ec4db78f4..72f268114 100644 --- a/app/components/post_draft/uploads/uploads.test.js +++ b/app/components/post_draft/uploads/uploads.test.js @@ -1,11 +1,12 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; + import {shallow} from 'enzyme'; +import React from 'react'; import Preferences from '@mm-redux/constants/preferences'; - import EphemeralStore from '@store/ephemeral_store'; + import Uploads from './uploads'; describe('Uploads', () => { diff --git a/app/components/post_list/combined_user_activity/combined_user_activity.tsx b/app/components/post_list/combined_user_activity/combined_user_activity.tsx index c4c2aee95..60ae408a1 100644 --- a/app/components/post_list/combined_user_activity/combined_user_activity.tsx +++ b/app/components/post_list/combined_user_activity/combined_user_activity.tsx @@ -15,12 +15,12 @@ import {emptyFunction} from '@utils/general'; import {getMarkdownTextStyles} from '@utils/markdown'; import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; -import type {Post} from '@mm-redux/types/posts'; -import type {Theme} from '@mm-redux/types/preferences'; - import LastUsers from './last_users'; import {postTypeMessages} from './messages'; +import type {Post} from '@mm-redux/types/posts'; +import type {Theme} from '@mm-redux/types/preferences'; + type Props = { canDelete: boolean; currentUserId?: string; diff --git a/app/components/post_list/combined_user_activity/index.ts b/app/components/post_list/combined_user_activity/index.ts index 78ddb5e8a..9e490e594 100644 --- a/app/components/post_list/combined_user_activity/index.ts +++ b/app/components/post_list/combined_user_activity/index.ts @@ -6,17 +6,17 @@ import {connect} from 'react-redux'; import {getMissingProfilesByIds, getMissingProfilesByUsernames} from '@mm-redux/actions/users'; import {Preferences} from '@mm-redux/constants'; import {getChannel} from '@mm-redux/selectors/entities/channels'; -import {getCurrentUser, getUsernamesByUserId} from '@mm-redux/selectors/entities/users'; import {getBool} from '@mm-redux/selectors/entities/preferences'; import {getCurrentTeamId} from '@mm-redux/selectors/entities/teams'; +import {getCurrentUser, getUsernamesByUserId} from '@mm-redux/selectors/entities/users'; import {makeGenerateCombinedPost} from '@mm-redux/utils/post_list'; import {canDeletePost} from '@selectors/permissions'; +import CombinedUserActivity from './combined_user_activity'; + import type {GlobalState} from '@mm-redux/types/store'; import type {UserProfile} from '@mm-redux/types/users'; -import CombinedUserActivity from './combined_user_activity'; - type OwnProps = { postId: string; }; diff --git a/app/components/post_list/combined_user_activity/last_users.tsx b/app/components/post_list/combined_user_activity/last_users.tsx index 2b982d6d4..4e0d260e3 100644 --- a/app/components/post_list/combined_user_activity/last_users.tsx +++ b/app/components/post_list/combined_user_activity/last_users.tsx @@ -11,16 +11,16 @@ import Markdown from '@components/markdown'; import {getMarkdownTextStyles} from '@utils/markdown'; import {makeStyleSheetFromTheme} from '@utils/theme'; -import type {Theme} from '@mm-redux/types/preferences'; - import {postTypeMessages, systemMessages} from './messages'; +import type {Theme} from '@mm-redux/types/preferences'; + type LastUsersProps = { actor: string; intl: typeof intlShape; postType: string; usernames: string[]; - theme: Theme + theme: Theme; } const getStyleSheet = makeStyleSheetFromTheme((theme: Theme) => { diff --git a/app/components/post_list/date_separator/date_separator.test.js b/app/components/post_list/date_separator/date_separator.test.js index 6f575a4d6..ec6763a70 100644 --- a/app/components/post_list/date_separator/date_separator.test.js +++ b/app/components/post_list/date_separator/date_separator.test.js @@ -6,7 +6,7 @@ import React from 'react'; import Preferences from '@mm-redux/constants/preferences'; -import {shallowWithIntl} from 'test/intl-test-helper'; +import {shallowWithIntl} from '@test/intl-test-helper'; import DateSeparator from './date_separator'; diff --git a/app/components/post_list/date_separator/date_separator.tsx b/app/components/post_list/date_separator/date_separator.tsx index e7239f432..3e94531ef 100644 --- a/app/components/post_list/date_separator/date_separator.tsx +++ b/app/components/post_list/date_separator/date_separator.tsx @@ -4,8 +4,8 @@ import React from 'react'; import {StyleProp, View, ViewStyle} from 'react-native'; -import FormattedText from '@components/formatted_text'; import FormattedDate from '@components/formatted_date'; +import FormattedText from '@components/formatted_text'; import {makeStyleSheetFromTheme} from '@utils/theme'; import type {Theme} from '@mm-redux/types/preferences'; diff --git a/app/components/post_list/date_separator/index.ts b/app/components/post_list/date_separator/index.ts index a2fc99af7..4282d31b3 100644 --- a/app/components/post_list/date_separator/index.ts +++ b/app/components/post_list/date_separator/index.ts @@ -3,14 +3,14 @@ import {connect} from 'react-redux'; -import {getCurrentUser} from '@mm-redux/selectors/entities/users'; import {isTimezoneEnabled} from '@mm-redux/selectors/entities/timezone'; +import {getCurrentUser} from '@mm-redux/selectors/entities/users'; import {getUserCurrentTimezone} from '@mm-redux/utils/timezone_utils'; -import type {GlobalState} from '@mm-redux/types/store'; - import DateSeparator from './date_separator'; +import type {GlobalState} from '@mm-redux/types/store'; + function mapStateToProps(state: GlobalState) { const enableTimezone = isTimezoneEnabled(state); diff --git a/app/components/post_list/index.ts b/app/components/post_list/index.ts index 0e09ae430..b4baf24d3 100644 --- a/app/components/post_list/index.ts +++ b/app/components/post_list/index.ts @@ -9,13 +9,13 @@ import {getPostThread} from '@actions/views/post'; import {setDeepLinkURL} from '@actions/views/root'; import {getConfig, getCurrentUrl} from '@mm-redux/selectors/entities/general'; import {getTheme} from '@mm-redux/selectors/entities/preferences'; -import {makePreparePostIdsForPostList, START_OF_NEW_MESSAGES} from '@mm-redux/utils/post_list'; import {getCurrentTeam} from '@mm-redux/selectors/entities/teams'; - -import type {GlobalState} from '@mm-redux/types/store'; +import {makePreparePostIdsForPostList, START_OF_NEW_MESSAGES} from '@mm-redux/utils/post_list'; import PostList from './post_list'; +import type {GlobalState} from '@mm-redux/types/store'; + type PostListOwnProps = { highlightPostId?: string; indicateNewMessages: boolean; diff --git a/app/components/post_list/more_messages_button/index.ts b/app/components/post_list/more_messages_button/index.ts index 2cb43ff3e..d7df54a74 100644 --- a/app/components/post_list/more_messages_button/index.ts +++ b/app/components/post_list/more_messages_button/index.ts @@ -5,10 +5,10 @@ import {connect} from 'react-redux'; import {resetUnreadMessageCount} from '@actions/views/channel'; -import type {GlobalState} from '@mm-redux/types/store'; - import MoreMessagesButton from './more_messages_button'; +import type {GlobalState} from '@mm-redux/types/store'; + type MoreMessagesButtonOwnProps = { channelId?: string; } diff --git a/app/components/post_list/more_messages_button/more_messages_button.test.js b/app/components/post_list/more_messages_button/more_messages_button.test.js index 530729674..4ffec39dc 100644 --- a/app/components/post_list/more_messages_button/more_messages_button.test.js +++ b/app/components/post_list/more_messages_button/more_messages_button.test.js @@ -3,13 +3,12 @@ import React from 'react'; import {Animated, AppState} from 'react-native'; -import {shallowWithIntl} from 'test/intl-test-helper'; +import ViewTypes from '@constants/view'; import Preferences from '@mm-redux/constants/preferences'; import EventEmitter from '@mm-redux/utils/event_emitter'; import * as PostListUtils from '@mm-redux/utils/post_list'; - -import ViewTypes from '@constants/view'; +import {shallowWithIntl} from '@test/intl-test-helper'; import MoreMessagesButton, { MIN_INPUT, diff --git a/app/components/post_list/more_messages_button/more_messages_button.tsx b/app/components/post_list/more_messages_button/more_messages_button.tsx index 851e7e939..d3b1692dd 100644 --- a/app/components/post_list/more_messages_button/more_messages_button.tsx +++ b/app/components/post_list/more_messages_button/more_messages_button.tsx @@ -2,16 +2,16 @@ // See LICENSE.txt for license information. import React from 'react'; -import {ActivityIndicator, Animated, AppState, AppStateStatus, Text, View, ViewToken} from 'react-native'; import {intlShape} from 'react-intl'; +import {ActivityIndicator, Animated, AppState, AppStateStatus, Text, View, ViewToken} from 'react-native'; -import TouchableWithFeedback from '@components/touchable_with_feedback'; import CompassIcon from '@components/compass_icon'; +import TouchableWithFeedback from '@components/touchable_with_feedback'; import ViewTypes, {INDICATOR_BAR_HEIGHT} from '@constants/view'; import EventEmitter from '@mm-redux/utils/event_emitter'; import {messageCount} from '@mm-redux/utils/post_list'; -import {makeStyleSheetFromTheme, hexToHue} from '@utils/theme'; import {t} from '@utils/i18n'; +import {makeStyleSheetFromTheme, hexToHue} from '@utils/theme'; import type {Theme} from '@mm-redux/types/preferences'; diff --git a/app/components/post_list/post/avatar/avatar.tsx b/app/components/post_list/post/avatar/avatar.tsx index 32f9bde9b..197eacc0e 100644 --- a/app/components/post_list/post/avatar/avatar.tsx +++ b/app/components/post_list/post/avatar/avatar.tsx @@ -12,16 +12,16 @@ import FastImage from 'react-native-fast-image'; import {showModal} from '@actions/navigation'; import {Client4} from '@client/rest'; import CompassIcon from '@components/compass_icon'; -import ProfilePicture from '@components/profile_picture'; import SystemAvatar from '@components/post_list/system_avatar'; +import ProfilePicture from '@components/profile_picture'; import TouchableWithFeedback from '@components/touchable_with_feedback'; import {ViewTypes} from '@constants'; import {fromAutoResponder, isSystemMessage} from '@mm-redux/utils/post_utils'; import {preventDoubleTap} from '@utils/tap'; -import type {ImageSource} from 'react-native-vector-icons/Icon'; import type {Post} from '@mm-redux/types/posts'; import type {Theme} from '@mm-redux/types/preferences'; +import type {ImageSource} from 'react-native-vector-icons/Icon'; type AvatarProps = { enablePostIconOverride?: boolean; diff --git a/app/components/post_list/post/avatar/index.ts b/app/components/post_list/post/avatar/index.ts index 5b464f463..7b43df777 100644 --- a/app/components/post_list/post/avatar/index.ts +++ b/app/components/post_list/post/avatar/index.ts @@ -7,12 +7,12 @@ import {connect} from 'react-redux'; import {getConfig} from '@mm-redux/selectors/entities/general'; import {getUser} from '@mm-redux/selectors/entities/users'; +import Avatar from './avatar'; + import type {Post} from '@mm-redux/types/posts'; import type {Theme} from '@mm-redux/types/preferences'; import type {GlobalState} from '@mm-redux/types/store'; -import Avatar from './avatar'; - type OwnProps = { pendingPostStyle?: StyleProp; post: Post; diff --git a/app/components/post_list/post/body/add_members/add_members.tsx b/app/components/post_list/post/body/add_members/add_members.tsx index 41e7cfe78..33526fcf7 100644 --- a/app/components/post_list/post/body/add_members/add_members.tsx +++ b/app/components/post_list/post/body/add_members/add_members.tsx @@ -13,8 +13,8 @@ import {getMarkdownTextStyles} from '@utils/markdown'; import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; import type {Post} from '@mm-redux/types/posts'; -import type {UserProfile} from '@mm-redux/types/users'; import type {Theme} from '@mm-redux/types/preferences'; +import type {UserProfile} from '@mm-redux/types/users'; type AddMembersProps = { addChannelMember: (channelId: string, userId: string, postRootId?: string) => void; diff --git a/app/components/post_list/post/body/add_members/index.ts b/app/components/post_list/post/body/add_members/index.ts index c287f0671..abaf9852b 100644 --- a/app/components/post_list/post/body/add_members/index.ts +++ b/app/components/post_list/post/body/add_members/index.ts @@ -9,11 +9,11 @@ import {removePost} from '@mm-redux/actions/posts'; import {getChannel} from '@mm-redux/selectors/entities/channels'; import {getCurrentUser} from '@mm-redux/selectors/entities/users'; -import type {GlobalState} from '@mm-redux/types/store'; +import AddMembers from './add_members'; + import type {Post} from '@mm-redux/types/posts'; import type {Theme} from '@mm-redux/types/preferences'; - -import AddMembers from './add_members'; +import type {GlobalState} from '@mm-redux/types/store'; type OwnProps = { post: Post; diff --git a/app/components/post_list/post/body/body.tsx b/app/components/post_list/post/body/body.tsx index 5fcc70677..66ee787fc 100644 --- a/app/components/post_list/post/body/body.tsx +++ b/app/components/post_list/post/body/body.tsx @@ -7,20 +7,19 @@ import {StyleProp, View, ViewStyle} from 'react-native'; import FormattedText from '@components/formatted_text'; import MarkdownEmoji from '@components/markdown/markdown_emoji'; import {THREAD} from '@constants/screen'; -import {isEdited, isPostEphemeral} from '@mm-redux/utils/post_utils'; import {Posts} from '@mm-redux/constants'; - -import type {Post} from '@mm-redux/types/posts'; -import type {Theme} from '@mm-redux/types/preferences'; +import {isEdited, isPostEphemeral} from '@mm-redux/utils/post_utils'; import {makeStyleSheetFromTheme} from '@utils/theme'; import AddMembers from './add_members'; import Content from './content'; import Failed from './failed'; +import Files from './files'; import Message from './message'; import Reactions from './reactions'; -import Files from './files'; +import type {Post} from '@mm-redux/types/posts'; +import type {Theme} from '@mm-redux/types/preferences'; type BodyProps = { appsEnabled: boolean; diff --git a/app/components/post_list/post/body/content/embedded_bindings/button_binding/button_binding.tsx b/app/components/post_list/post/body/content/embedded_bindings/button_binding/button_binding.tsx index 922ce07ff..35e1320b4 100644 --- a/app/components/post_list/post/body/content/embedded_bindings/button_binding/button_binding.tsx +++ b/app/components/post_list/post/body/content/embedded_bindings/button_binding/button_binding.tsx @@ -5,16 +5,17 @@ import React, {useCallback, useRef} from 'react'; import {intlShape, injectIntl} from 'react-intl'; import Button from 'react-native-button'; -import {preventDoubleTap} from 'app/utils/tap'; -import {makeStyleSheetFromTheme, changeOpacity} from 'app/utils/theme'; -import {getStatusColors} from '@utils/message_attachment_colors'; -import ButtonBindingText from './button_binding_text'; -import {Theme} from '@mm-redux/types/preferences'; +import {AppExpandLevels, AppBindingLocations, AppCallTypes, AppCallResponseTypes} from '@mm-redux/constants/apps'; import {AppBinding} from '@mm-redux/types/apps'; import {Post} from '@mm-redux/types/posts'; -import {DoAppCall, PostEphemeralCallResponseForPost} from 'types/actions/apps'; -import {AppExpandLevels, AppBindingLocations, AppCallTypes, AppCallResponseTypes} from '@mm-redux/constants/apps'; +import {Theme} from '@mm-redux/types/preferences'; +import {DoAppCall, PostEphemeralCallResponseForPost} from '@mm-types/actions/apps'; import {createCallContext, createCallRequest} from '@utils/apps'; +import {getStatusColors} from '@utils/message_attachment_colors'; +import {preventDoubleTap} from '@utils/tap'; +import {makeStyleSheetFromTheme, changeOpacity} from '@utils/theme'; + +import ButtonBindingText from './button_binding_text'; type Props = { binding: AppBinding; diff --git a/app/components/post_list/post/body/content/embedded_bindings/button_binding/button_binding_text.test.tsx b/app/components/post_list/post/body/content/embedded_bindings/button_binding/button_binding_text.test.tsx index f05cab7c3..482a43285 100644 --- a/app/components/post_list/post/body/content/embedded_bindings/button_binding/button_binding_text.test.tsx +++ b/app/components/post_list/post/body/content/embedded_bindings/button_binding/button_binding_text.test.tsx @@ -1,8 +1,9 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; + import ButtonBindingText from './button_binding_text'; describe('ButtonBinding emojis', () => { diff --git a/app/components/post_list/post/body/content/embedded_bindings/button_binding/index.ts b/app/components/post_list/post/body/content/embedded_bindings/button_binding/index.ts index 74c4a227c..fa6c7b73e 100644 --- a/app/components/post_list/post/body/content/embedded_bindings/button_binding/index.ts +++ b/app/components/post_list/post/body/content/embedded_bindings/button_binding/index.ts @@ -4,16 +4,16 @@ import {connect} from 'react-redux'; import {doAppCall, postEphemeralCallResponseForPost} from '@actions/apps'; -import {getPost} from '@mm-redux/selectors/entities/posts'; import {getChannel} from '@mm-redux/selectors/entities/channels'; +import {getPost} from '@mm-redux/selectors/entities/posts'; import {getCurrentTeamId} from '@mm-redux/selectors/entities/teams'; -import type {AppBinding} from '@mm-redux/types/apps'; -import type {GlobalState} from '@mm-redux/types/store'; -import type {Theme} from '@mm-redux/types/preferences'; - import ButtonBinding from './button_binding'; +import type {AppBinding} from '@mm-redux/types/apps'; +import type {Theme} from '@mm-redux/types/preferences'; +import type {GlobalState} from '@mm-redux/types/store'; + type OwnProps = { binding: AppBinding; postId: string; diff --git a/app/components/post_list/post/body/content/embedded_bindings/embed_text.tsx b/app/components/post_list/post/body/content/embedded_bindings/embed_text.tsx index 9a1a3b7d4..0f89eaad9 100644 --- a/app/components/post_list/post/body/content/embedded_bindings/embed_text.tsx +++ b/app/components/post_list/post/body/content/embedded_bindings/embed_text.tsx @@ -14,8 +14,8 @@ import {makeStyleSheetFromTheme} from '@utils/theme'; import type {Theme} from '@mm-redux/types/preferences'; type Props = { - theme: Theme, - value: string, + theme: Theme; + value: string; } const SHOW_MORE_HEIGHT = 54; diff --git a/app/components/post_list/post/body/content/embedded_bindings/embedded_binding.tsx b/app/components/post_list/post/body/content/embedded_bindings/embedded_binding.tsx index 5a3dd9b88..664aed54d 100644 --- a/app/components/post_list/post/body/content/embedded_bindings/embedded_binding.tsx +++ b/app/components/post_list/post/body/content/embedded_bindings/embedded_binding.tsx @@ -5,19 +5,19 @@ import React from 'react'; import {View} from 'react-native'; import {copyAndFillBindings} from '@utils/apps'; -import {changeOpacity, makeStyleSheetFromTheme} from 'app/utils/theme'; +import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; + +import EmbedText from './embed_text'; +import EmbedTitle from './embed_title'; +import EmbedSubBindings from './embedded_sub_bindings'; import type {AppBinding} from '@mm-redux/types/apps'; import type {Theme} from '@mm-redux/types/preferences'; -import EmbedSubBindings from './embedded_sub_bindings'; -import EmbedText from './embed_text'; -import EmbedTitle from './embed_title'; - type Props = { - embed: AppBinding, - postId: string, - theme: Theme, + embed: AppBinding; + postId: string; + theme: Theme; } const getStyleSheet = makeStyleSheetFromTheme((theme:Theme) => { diff --git a/app/components/post_list/post/body/content/embedded_bindings/embedded_sub_bindings.tsx b/app/components/post_list/post/body/content/embedded_bindings/embedded_sub_bindings.tsx index a1a47ce0a..6b83d65d2 100644 --- a/app/components/post_list/post/body/content/embedded_bindings/embedded_sub_bindings.tsx +++ b/app/components/post_list/post/body/content/embedded_bindings/embedded_sub_bindings.tsx @@ -3,8 +3,8 @@ import React from 'react'; -import BindingMenu from './menu_binding'; import ButtonBinding from './button_binding'; +import BindingMenu from './menu_binding'; import type {AppBinding} from '@mm-redux/types/apps'; import type {Theme} from '@mm-redux/types/preferences'; diff --git a/app/components/post_list/post/body/content/embedded_bindings/index.tsx b/app/components/post_list/post/body/content/embedded_bindings/index.tsx index bc81bd262..dbdc283d8 100644 --- a/app/components/post_list/post/body/content/embedded_bindings/index.tsx +++ b/app/components/post_list/post/body/content/embedded_bindings/index.tsx @@ -4,15 +4,15 @@ import React from 'react'; import {View} from 'react-native'; +import EmbeddedBinding from './embedded_binding'; + import type {AppBinding} from '@mm-redux/types/apps'; import type {Theme} from '@mm-redux/types/preferences'; -import EmbeddedBinding from './embedded_binding'; - type Props = { - embeds: AppBinding[], - postId: string, - theme: Theme, + embeds: AppBinding[]; + postId: string; + theme: Theme; } const EmbeddedBindings = ({embeds, postId, theme}: Props) => { diff --git a/app/components/post_list/post/body/content/embedded_bindings/menu_binding/index.ts b/app/components/post_list/post/body/content/embedded_bindings/menu_binding/index.ts index 8afe5a3a4..a6ca45548 100644 --- a/app/components/post_list/post/body/content/embedded_bindings/menu_binding/index.ts +++ b/app/components/post_list/post/body/content/embedded_bindings/menu_binding/index.ts @@ -8,11 +8,11 @@ import {getChannel} from '@mm-redux/selectors/entities/channels'; import {getPost} from '@mm-redux/selectors/entities/posts'; import {getCurrentTeamId} from '@mm-redux/selectors/entities/teams'; +import MenuBinding from './menu_binding'; + import type {AppBinding} from '@mm-redux/types/apps'; import type {GlobalState} from '@mm-redux/types/store'; -import MenuBinding from './menu_binding'; - type OwnProps = { binding: AppBinding; postId: string; diff --git a/app/components/post_list/post/body/content/embedded_bindings/menu_binding/menu_binding.tsx b/app/components/post_list/post/body/content/embedded_bindings/menu_binding/menu_binding.tsx index 4f366762d..b3f0201db 100644 --- a/app/components/post_list/post/body/content/embedded_bindings/menu_binding/menu_binding.tsx +++ b/app/components/post_list/post/body/content/embedded_bindings/menu_binding/menu_binding.tsx @@ -11,7 +11,7 @@ import {createCallContext, createCallRequest} from '@utils/apps'; import type {AppBinding} from '@mm-redux/types/apps'; import type {PostActionOption} from '@mm-redux/types/integration_actions'; import type {Post} from '@mm-redux/types/posts'; -import type {DoAppCall, PostEphemeralCallResponseForPost} from 'types/actions/apps'; +import type {DoAppCall, PostEphemeralCallResponseForPost} from '@mm-types/actions/apps'; type Props = { binding: AppBinding; diff --git a/app/components/post_list/post/body/content/image_preview/image_preview.tsx b/app/components/post_list/post/body/content/image_preview/image_preview.tsx index 72f748181..cf0a9df40 100644 --- a/app/components/post_list/post/body/content/image_preview/image_preview.tsx +++ b/app/components/post_list/post/body/content/image_preview/image_preview.tsx @@ -9,10 +9,10 @@ import ProgressiveImage from '@components/progressive_image'; import TouchableWithFeedback from '@components/touchable_with_feedback'; import {useDidUpdate} from '@hooks'; import {usePermanentSidebar, useSplitView} from '@hooks/permanent_sidebar'; -import {openGallerWithMockFile} from '@utils/gallery'; -import {calculateDimensions, getViewPortWidth, isGifTooLarge} from '@utils/images'; import {changeOpacity} from '@mm-redux/utils/theme_utils'; import {generateId} from '@utils/file'; +import {openGallerWithMockFile} from '@utils/gallery'; +import {calculateDimensions, getViewPortWidth, isGifTooLarge} from '@utils/images'; import {isImageLink, isValidUrl} from '@utils/url'; import type {Post} from '@mm-redux/types/posts'; diff --git a/app/components/post_list/post/body/content/image_preview/index.ts b/app/components/post_list/post/body/content/image_preview/index.ts index 04b4442f6..adfe60e26 100644 --- a/app/components/post_list/post/body/content/image_preview/index.ts +++ b/app/components/post_list/post/body/content/image_preview/index.ts @@ -6,11 +6,11 @@ import {connect} from 'react-redux'; import {getRedirectLocation} from '@mm-redux/actions/general'; import {getExpandedLink} from '@mm-redux/selectors/entities/posts'; -import type {GlobalState} from '@mm-redux/types/store'; -import type {Post} from '@mm-redux/types/posts'; - import ImagePreview from './image_preview'; +import type {Post} from '@mm-redux/types/posts'; +import type {GlobalState} from '@mm-redux/types/store'; + type OwnProps = { post: Post; } diff --git a/app/components/post_list/post/body/content/index.tsx b/app/components/post_list/post/body/content/index.tsx index 56aface6f..42bd16343 100644 --- a/app/components/post_list/post/body/content/index.tsx +++ b/app/components/post_list/post/body/content/index.tsx @@ -5,15 +5,15 @@ import React from 'react'; import {isYoutubeLink} from '@utils/url'; -import type {Post} from '@mm-redux/types/posts'; -import type {Theme} from '@mm-redux/types/preferences'; - import EmbeddedBindings from './embedded_bindings'; import ImagePreview from './image_preview'; import MessageAttachments from './message_attachments'; import Opengraph from './opengraph'; import YouTube from './youtube'; +import type {Post} from '@mm-redux/types/posts'; +import type {Theme} from '@mm-redux/types/preferences'; + type ContentProps = { isReplyPost: boolean; post: Post; diff --git a/app/components/post_list/post/body/content/message_attachments/action_button/action_button.test.tsx b/app/components/post_list/post/body/content/message_attachments/action_button/action_button.test.tsx index b458737d1..4cdfd6957 100644 --- a/app/components/post_list/post/body/content/message_attachments/action_button/action_button.test.tsx +++ b/app/components/post_list/post/body/content/message_attachments/action_button/action_button.test.tsx @@ -1,15 +1,14 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; - -import ActionButton from './action_button'; - -import {changeOpacity} from '@utils/theme'; -import {getStatusColors} from '@utils/message_attachment_colors'; +import React from 'react'; import Preferences from '@mm-redux/constants/preferences'; +import {getStatusColors} from '@utils/message_attachment_colors'; +import {changeOpacity} from '@utils/theme'; + +import ActionButton from './action_button'; describe('ActionButton', () => { test('correct styles when from global theme', () => { diff --git a/app/components/post_list/post/body/content/message_attachments/action_button/action_button.tsx b/app/components/post_list/post/body/content/message_attachments/action_button/action_button.tsx index 69e605426..cdc2bc24a 100644 --- a/app/components/post_list/post/body/content/message_attachments/action_button/action_button.tsx +++ b/app/components/post_list/post/body/content/message_attachments/action_button/action_button.tsx @@ -4,14 +4,13 @@ import React, {useCallback, useRef} from 'react'; import Button from 'react-native-button'; -import ActionButtonText from './action_button_text'; - +import {ActionResult} from '@mm-redux/types/actions'; +import {Theme} from '@mm-redux/types/preferences'; +import {getStatusColors} from '@utils/message_attachment_colors'; import {preventDoubleTap} from '@utils/tap'; import {makeStyleSheetFromTheme, changeOpacity} from '@utils/theme'; -import {getStatusColors} from '@utils/message_attachment_colors'; -import {Theme} from '@mm-redux/types/preferences'; -import {ActionResult} from '@mm-redux/types/actions'; +import ActionButtonText from './action_button_text'; type Props = { buttonColor?: string; diff --git a/app/components/post_list/post/body/content/message_attachments/action_button/action_button_text.test.tsx b/app/components/post_list/post/body/content/message_attachments/action_button/action_button_text.test.tsx index 3ef5e263a..df66ef4d1 100644 --- a/app/components/post_list/post/body/content/message_attachments/action_button/action_button_text.test.tsx +++ b/app/components/post_list/post/body/content/message_attachments/action_button/action_button_text.test.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import ActionButtonText from './action_button_text'; diff --git a/app/components/post_list/post/body/content/message_attachments/action_button/index.ts b/app/components/post_list/post/body/content/message_attachments/action_button/index.ts index 6637e339b..11c9d8c2c 100644 --- a/app/components/post_list/post/body/content/message_attachments/action_button/index.ts +++ b/app/components/post_list/post/body/content/message_attachments/action_button/index.ts @@ -3,10 +3,10 @@ import {connect} from 'react-redux'; -import ActionButton from './action_button'; - import {doPostActionWithCookie} from '@mm-redux/actions/posts'; +import ActionButton from './action_button'; + const mapDispatchToProps = { doPostActionWithCookie, }; diff --git a/app/components/post_list/post/body/content/message_attachments/action_menu/index.ts b/app/components/post_list/post/body/content/message_attachments/action_menu/index.ts index d4a9d437b..b80fcc679 100644 --- a/app/components/post_list/post/body/content/message_attachments/action_menu/index.ts +++ b/app/components/post_list/post/body/content/message_attachments/action_menu/index.ts @@ -3,9 +3,8 @@ import {connect} from 'react-redux'; -import {GlobalState} from '@mm-redux/types/store'; - import {selectAttachmentMenuAction} from '@actions/views/post'; +import {GlobalState} from '@mm-redux/types/store'; import ActionMenu from './action_menu'; diff --git a/app/components/post_list/post/body/content/message_attachments/attachment_actions.tsx b/app/components/post_list/post/body/content/message_attachments/attachment_actions.tsx index bb877233c..7b740e809 100644 --- a/app/components/post_list/post/body/content/message_attachments/attachment_actions.tsx +++ b/app/components/post_list/post/body/content/message_attachments/attachment_actions.tsx @@ -5,10 +5,10 @@ import React from 'react'; import {PostAction} from '@mm-redux/types/integration_actions'; -import type {Theme} from '@mm-redux/types/preferences'; - -import ActionMenu from './action_menu'; import ActionButton from './action_button'; +import ActionMenu from './action_menu'; + +import type {Theme} from '@mm-redux/types/preferences'; type Props = { actions: PostAction[]; diff --git a/app/components/post_list/post/body/content/message_attachments/attachment_author.tsx b/app/components/post_list/post/body/content/message_attachments/attachment_author.tsx index d2f86e031..e5cc06970 100644 --- a/app/components/post_list/post/body/content/message_attachments/attachment_author.tsx +++ b/app/components/post_list/post/body/content/message_attachments/attachment_author.tsx @@ -6,9 +6,9 @@ import {intlShape, injectIntl} from 'react-intl'; import {Alert, Text, View} from 'react-native'; import FastImage from 'react-native-fast-image'; +import {Theme} from '@mm-redux/types/preferences'; import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; import {tryOpenURL} from '@utils/url'; -import {Theme} from '@mm-redux/types/preferences'; type Props = { icon?: string; diff --git a/app/components/post_list/post/body/content/message_attachments/attachment_fields.tsx b/app/components/post_list/post/body/content/message_attachments/attachment_fields.tsx index 88183eb61..480cc9041 100644 --- a/app/components/post_list/post/body/content/message_attachments/attachment_fields.tsx +++ b/app/components/post_list/post/body/content/message_attachments/attachment_fields.tsx @@ -5,19 +5,18 @@ import React from 'react'; import {StyleProp, Text, TextStyle, View, ViewStyle} from 'react-native'; import Markdown from '@components/markdown'; -import {makeStyleSheetFromTheme} from '@utils/theme'; - -import {Theme} from '@mm-redux/types/preferences'; import {MessageAttachmentField} from '@mm-redux/types/message_attachments'; import {PostMetadata} from '@mm-redux/types/posts'; +import {Theme} from '@mm-redux/types/preferences'; +import {makeStyleSheetFromTheme} from '@utils/theme'; type Props = { - baseTextStyle: StyleProp, - blockStyles?: StyleProp[], - fields: MessageAttachmentField[], - metadata?: PostMetadata, - textStyles?: StyleProp[], - theme: Theme, + baseTextStyle: StyleProp; + blockStyles?: StyleProp[]; + fields: MessageAttachmentField[]; + metadata?: PostMetadata; + textStyles?: StyleProp[]; + theme: Theme; } const getStyleSheet = makeStyleSheetFromTheme((theme: Theme) => { diff --git a/app/components/post_list/post/body/content/message_attachments/attachment_footer.test.tsx b/app/components/post_list/post/body/content/message_attachments/attachment_footer.test.tsx index b9fd696b4..80cd8b03c 100644 --- a/app/components/post_list/post/body/content/message_attachments/attachment_footer.test.tsx +++ b/app/components/post_list/post/body/content/message_attachments/attachment_footer.test.tsx @@ -1,13 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; - -import AttachmentFooter from './attachment_footer'; +import React from 'react'; import Preferences from '@mm-redux/constants/preferences'; +import AttachmentFooter from './attachment_footer'; + describe('AttachmentFooter', () => { const baseProps = { text: 'This is the footer!', diff --git a/app/components/post_list/post/body/content/message_attachments/attachment_image/index.tsx b/app/components/post_list/post/body/content/message_attachments/attachment_image/index.tsx index aa9e1e4c7..a1e830f82 100644 --- a/app/components/post_list/post/body/content/message_attachments/attachment_image/index.tsx +++ b/app/components/post_list/post/body/content/message_attachments/attachment_image/index.tsx @@ -9,13 +9,13 @@ import ProgressiveImage from '@components/progressive_image'; import TouchableWithFeedback from '@components/touchable_with_feedback'; import {usePermanentSidebar, useSplitView} from '@hooks/permanent_sidebar'; import {generateId} from '@utils/file'; -import {isGifTooLarge, calculateDimensions, getViewPortWidth} from '@utils/images'; import {openGallerWithMockFile} from '@utils/gallery'; +import {isGifTooLarge, calculateDimensions, getViewPortWidth} from '@utils/images'; import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; import {isValidUrl} from '@utils/url'; -import type {Theme} from '@mm-redux/types/preferences'; import type {PostImage} from '@mm-redux/types/posts'; +import type {Theme} from '@mm-redux/types/preferences'; const getStyleSheet = makeStyleSheetFromTheme((theme: Theme) => { return { diff --git a/app/components/post_list/post/body/content/message_attachments/attachment_pretext.tsx b/app/components/post_list/post/body/content/message_attachments/attachment_pretext.tsx index 025955405..8e39832a0 100644 --- a/app/components/post_list/post/body/content/message_attachments/attachment_pretext.tsx +++ b/app/components/post_list/post/body/content/message_attachments/attachment_pretext.tsx @@ -5,7 +5,6 @@ import React from 'react'; import {StyleProp, StyleSheet, TextStyle, View, ViewStyle} from 'react-native'; import Markdown from '@components/markdown'; - import {PostMetadata} from '@mm-redux/types/posts'; type Props = { diff --git a/app/components/post_list/post/body/content/message_attachments/attachment_text.tsx b/app/components/post_list/post/body/content/message_attachments/attachment_text.tsx index a770f5e71..ce2d2b2c1 100644 --- a/app/components/post_list/post/body/content/message_attachments/attachment_text.tsx +++ b/app/components/post_list/post/body/content/message_attachments/attachment_text.tsx @@ -8,18 +8,17 @@ import Animated from 'react-native-reanimated'; import Markdown from '@components/markdown'; import ShowMoreButton from '@components/post_list/post/body/message/show_more_button'; import {useShowMoreAnimatedStyle} from '@hooks/show_more'; - import {PostMetadata} from '@mm-redux/types/posts'; import {Theme} from '@mm-redux/types/preferences'; type Props = { - baseTextStyle: StyleProp, - blockStyles?: StyleProp[], - hasThumbnail?: boolean, - metadata?: PostMetadata, - textStyles?: StyleProp[], - theme: Theme, - value?: string, + baseTextStyle: StyleProp; + blockStyles?: StyleProp[]; + hasThumbnail?: boolean; + metadata?: PostMetadata; + textStyles?: StyleProp[]; + theme: Theme; + value?: string; } const SHOW_MORE_HEIGHT = 54; diff --git a/app/components/post_list/post/body/content/message_attachments/attachment_title.tsx b/app/components/post_list/post/body/content/message_attachments/attachment_title.tsx index 7e3714ca1..6acc441fe 100644 --- a/app/components/post_list/post/body/content/message_attachments/attachment_title.tsx +++ b/app/components/post_list/post/body/content/message_attachments/attachment_title.tsx @@ -6,11 +6,10 @@ import {intlShape, injectIntl} from 'react-intl'; import {Alert, Text, View} from 'react-native'; import Markdown from '@components/markdown'; +import {Theme} from '@mm-redux/types/preferences'; import {makeStyleSheetFromTheme} from '@utils/theme'; import {tryOpenURL} from '@utils/url'; -import {Theme} from '@mm-redux/types/preferences'; - type Props = { intl: typeof intlShape; link?: string; diff --git a/app/components/post_list/post/body/content/message_attachments/index.tsx b/app/components/post_list/post/body/content/message_attachments/index.tsx index 8cb1605d1..bda021a2e 100644 --- a/app/components/post_list/post/body/content/message_attachments/index.tsx +++ b/app/components/post_list/post/body/content/message_attachments/index.tsx @@ -11,10 +11,10 @@ import {Theme} from '@mm-redux/types/preferences'; import MessageAttachment from './message_attachment'; type Props = { - attachments: MessageAttachmentType[], - postId: string, - metadata?: PostMetadata, - theme: Theme, + attachments: MessageAttachmentType[]; + postId: string; + metadata?: PostMetadata; + theme: Theme; } const styles = StyleSheet.create({ diff --git a/app/components/post_list/post/body/content/message_attachments/message_attachment.tsx b/app/components/post_list/post/body/content/message_attachments/message_attachment.tsx index d9e726612..6d718f2d5 100644 --- a/app/components/post_list/post/body/content/message_attachments/message_attachment.tsx +++ b/app/components/post_list/post/body/content/message_attachments/message_attachment.tsx @@ -9,25 +9,25 @@ import {getStatusColors} from '@utils/message_attachment_colors'; import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; import {isValidUrl} from '@utils/url'; -import type {MessageAttachment as MessageAttachmentType} from '@mm-redux/types/message_attachments'; -import type {PostMetadata} from '@mm-redux/types/posts'; -import type {Theme} from '@mm-redux/types/preferences'; - import AttachmentActions from './attachment_actions'; import AttachmentAuthor from './attachment_author'; import AttachmentFields from './attachment_fields'; +import AttachmentFooter from './attachment_footer'; import AttachmentImage from './attachment_image'; import AttachmentPreText from './attachment_pretext'; import AttachmentText from './attachment_text'; import AttachmentThumbnail from './attachment_thumbnail'; import AttachmentTitle from './attachment_title'; -import AttachmentFooter from './attachment_footer'; + +import type {MessageAttachment as MessageAttachmentType} from '@mm-redux/types/message_attachments'; +import type {PostMetadata} from '@mm-redux/types/posts'; +import type {Theme} from '@mm-redux/types/preferences'; type Props = { - attachment: MessageAttachmentType, - metadata?: PostMetadata, - postId: string, - theme: Theme, + attachment: MessageAttachmentType; + metadata?: PostMetadata; + postId: string; + theme: Theme; } const getStyleSheet = makeStyleSheetFromTheme((theme: Theme) => { diff --git a/app/components/post_list/post/body/content/opengraph/index.ts b/app/components/post_list/post/body/content/opengraph/index.ts index d19ff66ea..b823a110e 100644 --- a/app/components/post_list/post/body/content/opengraph/index.ts +++ b/app/components/post_list/post/body/content/opengraph/index.ts @@ -8,12 +8,12 @@ import {getConfig} from '@mm-redux/selectors/entities/general'; import {getOpenGraphMetadataForUrl as selectOpenGraphMetadataForUrl} from '@mm-redux/selectors/entities/posts'; import {getBool} from '@mm-redux/selectors/entities/preferences'; -import type {Post, PostMetadata} from '@mm-redux/types/posts'; -import type {GlobalState} from '@mm-redux/types/store'; -import type {Theme} from '@mm-redux/types/preferences'; - import Opengraph from './opengraph'; +import type {Post, PostMetadata} from '@mm-redux/types/posts'; +import type {Theme} from '@mm-redux/types/preferences'; +import type {GlobalState} from '@mm-redux/types/store'; + type OwnProps = { isReplyPost: boolean; post: Post; diff --git a/app/components/post_list/post/body/content/opengraph/opengraph.tsx b/app/components/post_list/post/body/content/opengraph/opengraph.tsx index 7757ff45f..cf4c3d57a 100644 --- a/app/components/post_list/post/body/content/opengraph/opengraph.tsx +++ b/app/components/post_list/post/body/content/opengraph/opengraph.tsx @@ -2,18 +2,18 @@ // See LICENSE.txt for license information. import React from 'react'; -import {Alert, Text, View} from 'react-native'; import {intlShape, injectIntl} from 'react-intl'; +import {Alert, Text, View} from 'react-native'; import TouchableWithFeedback from '@components/touchable_with_feedback'; import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; import {tryOpenURL} from '@utils/url'; +import OpengraphImage from './opengraph_image'; + import type {Post} from '@mm-redux/types/posts'; import type {Theme} from '@mm-redux/types/preferences'; -import OpengraphImage from './opengraph_image'; - type OpengraphProps = { intl: typeof intlShape; isReplyPost: boolean; diff --git a/app/components/post_list/post/body/content/youtube/index.ts b/app/components/post_list/post/body/content/youtube/index.ts index 27d359987..ecebb0b07 100644 --- a/app/components/post_list/post/body/content/youtube/index.ts +++ b/app/components/post_list/post/body/content/youtube/index.ts @@ -2,13 +2,14 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; + import {getConfig} from '@mm-redux/selectors/entities/general'; -import type {GlobalState} from '@mm-redux/types/store'; -import type {Post} from '@mm-redux/types/posts'; - import YouTube from './youtube'; +import type {Post} from '@mm-redux/types/posts'; +import type {GlobalState} from '@mm-redux/types/store'; + type OwnProps = { googleDeveloperKey?: string; isReplyPost: boolean; diff --git a/app/components/post_list/post/body/files/document_file.tsx b/app/components/post_list/post/body/files/document_file.tsx index 3484672ab..8e3533f78 100644 --- a/app/components/post_list/post/body/files/document_file.tsx +++ b/app/components/post_list/post/body/files/document_file.tsx @@ -15,11 +15,11 @@ import {getFileUrl} from '@mm-redux/utils/file_utils'; import {alertDownloadDocumentDisabled, alertDownloadFailed, alertFailedToOpenDocument} from '@utils/document'; import {getLocalFilePathFromFile} from '@utils/file'; +import FileIcon from './file_icon'; + import type {FileInfo} from '@mm-redux/types/files'; import type {Theme} from '@mm-redux/types/preferences'; -import FileIcon from './file_icon'; - type DocumentFileRef = { handlePreviewPress: () => void; } diff --git a/app/components/post_list/post/body/files/file.tsx b/app/components/post_list/post/body/files/file.tsx index dec234009..03e0c7cd7 100644 --- a/app/components/post_list/post/body/files/file.tsx +++ b/app/components/post_list/post/body/files/file.tsx @@ -8,14 +8,14 @@ import TouchableWithFeedback from '@components/touchable_with_feedback'; import {isDocument, isImage} from '@utils/file'; import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; -import type {FileInfo as FileInfoType} from '@mm-redux/types/files'; -import type {Theme} from '@mm-redux/types/preferences'; - import DocumentFile from './document_file'; -import ImageFile from './image_file'; -import ImageFileOverlay from './image_file_overlay'; import FileIcon from './file_icon'; import FileInfo from './file_info'; +import ImageFile from './image_file'; +import ImageFileOverlay from './image_file_overlay'; + +import type {FileInfo as FileInfoType} from '@mm-redux/types/files'; +import type {Theme} from '@mm-redux/types/preferences'; type FileProps = { canDownloadFiles: boolean; diff --git a/app/components/post_list/post/body/files/file_info.tsx b/app/components/post_list/post/body/files/file_info.tsx index 00a64734e..fec58517d 100644 --- a/app/components/post_list/post/body/files/file_info.tsx +++ b/app/components/post_list/post/body/files/file_info.tsx @@ -8,8 +8,8 @@ import TouchableWithFeedback from '@components/touchable_with_feedback'; import {getFormattedFileSize} from '@mm-redux/utils/file_utils'; import {makeStyleSheetFromTheme} from '@utils/theme'; -import type {Theme} from '@mm-redux/types/preferences'; import type {FileInfo as FileInfoType} from '@mm-redux/types/files'; +import type {Theme} from '@mm-redux/types/preferences'; type FileInfoProps = { file: FileInfoType; diff --git a/app/components/post_list/post/body/files/image_file.tsx b/app/components/post_list/post/body/files/image_file.tsx index 102b1bc6b..a72eb30df 100644 --- a/app/components/post_list/post/body/files/image_file.tsx +++ b/app/components/post_list/post/body/files/image_file.tsx @@ -4,16 +4,16 @@ import React, {useState} from 'react'; import {StyleProp, StyleSheet, useWindowDimensions, View, ViewStyle} from 'react-native'; -import ProgressiveImage from '@components/progressive_image'; import {Client4} from '@client/rest'; +import ProgressiveImage from '@components/progressive_image'; import {calculateDimensions} from '@utils/images'; import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; +import FileIcon from './file_icon'; + import type {FileInfo} from '@mm-redux/types/files'; import type {Theme} from '@mm-redux/types/preferences'; -import FileIcon from './file_icon'; - type ImageFileProps = { backgroundColor?: string; file: FileInfo; diff --git a/app/components/post_list/post/body/files/index.ts b/app/components/post_list/post/body/files/index.ts index 861536bed..c1371836d 100644 --- a/app/components/post_list/post/body/files/index.ts +++ b/app/components/post_list/post/body/files/index.ts @@ -3,14 +3,14 @@ import {connect} from 'react-redux'; -import {canDownloadFilesOnMobile} from '@mm-redux/selectors/entities/general'; import {makeGetFilesForPost} from '@mm-redux/selectors/entities/files'; - -import type {GlobalState} from '@mm-redux/types/store'; -import type {Theme} from '@mm-redux/types/preferences'; +import {canDownloadFilesOnMobile} from '@mm-redux/selectors/entities/general'; import Files from './files'; +import type {Theme} from '@mm-redux/types/preferences'; +import type {GlobalState} from '@mm-redux/types/store'; + type OwnProps = { fileIds: string[]; failed?: boolean; diff --git a/app/components/post_list/post/body/index.ts b/app/components/post_list/post/body/index.ts index 30953aaad..7ee12776a 100644 --- a/app/components/post_list/post/body/index.ts +++ b/app/components/post_list/post/body/index.ts @@ -12,11 +12,11 @@ import {isPostEphemeral} from '@mm-redux/utils/post_utils'; import {appsEnabled} from '@utils/apps'; import {hasEmojisOnly} from '@utils/emoji_utils'; -import type {GlobalState} from '@mm-redux/types/store'; +import Body from './body'; + import type {Post} from '@mm-redux/types/posts'; import type {Theme} from '@mm-redux/types/preferences'; - -import Body from './body'; +import type {GlobalState} from '@mm-redux/types/store'; type OwnProps = { highlight: boolean; diff --git a/app/components/post_list/post/body/message/index.ts b/app/components/post_list/post/body/message/index.ts index a38d9884f..73fcd0f14 100644 --- a/app/components/post_list/post/body/message/index.ts +++ b/app/components/post_list/post/body/message/index.ts @@ -6,12 +6,12 @@ import {connect} from 'react-redux'; import {getChannel} from '@mm-redux/selectors/entities/channels'; import {makeGetMentionKeysForPost} from '@mm-redux/selectors/entities/search'; +import Message from './message'; + import type {Post as PostType} from '@mm-redux/types/posts'; import type {Theme} from '@mm-redux/types/preferences'; import type {GlobalState} from '@mm-redux/types/store'; -import Message from './message'; - type OwnProps = { post: PostType; theme: Theme; diff --git a/app/components/post_list/post/body/message/message.tsx b/app/components/post_list/post/body/message/message.tsx index 97d2e65e6..818513ef1 100644 --- a/app/components/post_list/post/body/message/message.tsx +++ b/app/components/post_list/post/body/message/message.tsx @@ -12,12 +12,12 @@ import {isEdited, isPostPendingOrFailed} from '@mm-redux/utils/post_utils'; import {getMarkdownTextStyles, getMarkdownBlockStyles} from '@utils/markdown'; import {makeStyleSheetFromTheme} from '@utils/theme'; +import ShowMoreButton from './show_more_button'; + import type {UserMentionKey} from '@mm-redux/selectors/entities/users'; import type {Post} from '@mm-redux/types/posts'; import type {Theme} from '@mm-redux/types/preferences'; -import ShowMoreButton from './show_more_button'; - type MessageProps = { highlight: boolean; isReplyPost: boolean; diff --git a/app/components/post_list/post/body/reactions/index.ts b/app/components/post_list/post/body/reactions/index.ts index 96f699861..50530f0bd 100644 --- a/app/components/post_list/post/body/reactions/index.ts +++ b/app/components/post_list/post/body/reactions/index.ts @@ -6,18 +6,18 @@ import {connect} from 'react-redux'; import {addReaction} from '@actions/views/emoji'; import {MAX_ALLOWED_REACTIONS} from '@constants/emoji'; import {removeReaction} from '@mm-redux/actions/posts'; +import Permissions from '@mm-redux/constants/permissions'; +import {getChannel, isChannelReadOnlyById} from '@mm-redux/selectors/entities/channels'; import {makeGetReactionsForPost} from '@mm-redux/selectors/entities/posts'; import {haveIChannelPermission} from '@mm-redux/selectors/entities/roles'; -import Permissions from '@mm-redux/constants/permissions'; import {getCurrentUserId} from '@mm-redux/selectors/entities/users'; -import {getChannel, isChannelReadOnlyById} from '@mm-redux/selectors/entities/channels'; import {selectEmojisCountFromReactions} from '@selectors/emojis'; -import type{GlobalState} from '@mm-redux/types/store'; +import Reactions from './reactions'; + import type {Post} from '@mm-redux/types/posts'; import type {Theme} from '@mm-redux/types/preferences'; - -import Reactions from './reactions'; +import type{GlobalState} from '@mm-redux/types/store'; type OwnProps = { post: Post; diff --git a/app/components/post_list/post/body/reactions/reactions.tsx b/app/components/post_list/post/body/reactions/reactions.tsx index e45784ccd..8d3511cfa 100644 --- a/app/components/post_list/post/body/reactions/reactions.tsx +++ b/app/components/post_list/post/body/reactions/reactions.tsx @@ -2,8 +2,8 @@ // See LICENSE.txt for license information. import React, {useRef} from 'react'; -import {View} from 'react-native'; import {intlShape, injectIntl} from 'react-intl'; +import {View} from 'react-native'; import {showModal, showModalOverCurrentContext} from '@actions/navigation'; import CompassIcon from '@components/compass_icon'; @@ -11,11 +11,11 @@ import TouchableWithFeedback from '@components/touchable_with_feedback'; import {preventDoubleTap} from '@utils/tap'; import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; +import Reaction from './reaction'; + import type {Theme} from '@mm-redux/types/preferences'; import type {Reaction as ReactionType} from '@mm-redux/types/reactions'; -import Reaction from './reaction'; - type ReactionsProps = { addReaction: (postId: string, emojiName: string) => void; canAddMoreReactions: boolean; diff --git a/app/components/post_list/post/header/display_name/index.tsx b/app/components/post_list/post/header/display_name/index.tsx index 2898417c8..d412f2d53 100644 --- a/app/components/post_list/post/header/display_name/index.tsx +++ b/app/components/post_list/post/header/display_name/index.tsx @@ -12,8 +12,8 @@ import TouchableWithFeedback from '@components/touchable_with_feedback'; import {preventDoubleTap} from '@utils/tap'; import {makeStyleSheetFromTheme} from '@utils/theme'; -import type {ImageSource} from 'react-native-vector-icons/Icon'; import type {Theme} from '@mm-redux/types/preferences'; +import type {ImageSource} from 'react-native-vector-icons/Icon'; type HeaderDisplayNameProps = { commentCount: number; diff --git a/app/components/post_list/post/header/header.tsx b/app/components/post_list/post/header/header.tsx index 28221d72a..3774cab58 100644 --- a/app/components/post_list/post/header/header.tsx +++ b/app/components/post_list/post/header/header.tsx @@ -11,14 +11,14 @@ import {Posts} from '@mm-redux/constants'; import {fromAutoResponder, isFromWebhook, isPostEphemeral, isPostPendingOrFailed, isSystemMessage} from '@mm-redux/utils/post_utils'; import {makeStyleSheetFromTheme} from '@utils/theme'; -import type {Post} from '@mm-redux/types/posts'; -import type {Theme} from '@mm-redux/types/preferences'; - import HeaderCommentedOn from './commented_on'; import HeaderDisplayName from './display_name'; import HeaderReply from './reply'; import HeaderTag from './tag'; +import type {Post} from '@mm-redux/types/posts'; +import type {Theme} from '@mm-redux/types/preferences'; + type HeaderProps = { commentCount: number; collapsedThreadsEnabled: boolean; diff --git a/app/components/post_list/post/header/index.ts b/app/components/post_list/post/header/index.ts index 628f3b5e6..d96b36ff7 100644 --- a/app/components/post_list/post/header/index.ts +++ b/app/components/post_list/post/header/index.ts @@ -13,11 +13,11 @@ import {isCustomStatusEnabled} from '@selectors/custom_status'; import {postUserDisplayName} from '@utils/post'; import {isGuest} from '@utils/users'; -import type {GlobalState} from '@mm-redux/types/store'; -import type {Post} from '@mm-redux/types/posts'; - import Header from './header'; +import type {Post} from '@mm-redux/types/posts'; +import type {GlobalState} from '@mm-redux/types/store'; + type OwnProps = { enablePostUsernameOverride: boolean; location: string; diff --git a/app/components/post_list/post/header/reply/index.tsx b/app/components/post_list/post/header/reply/index.tsx index c03aabdcf..d6622eb89 100644 --- a/app/components/post_list/post/header/reply/index.tsx +++ b/app/components/post_list/post/header/reply/index.tsx @@ -11,8 +11,8 @@ import EventEmitter from '@mm-redux/utils/event_emitter'; import {preventDoubleTap} from '@utils/tap'; import {makeStyleSheetFromTheme} from '@utils/theme'; -import type {Theme} from '@mm-redux/types/preferences'; import type {Post} from '@mm-redux/types/posts'; +import type {Theme} from '@mm-redux/types/preferences'; type HeaderReplyProps = { commentCount: number; diff --git a/app/components/post_list/post/index.ts b/app/components/post_list/post/index.ts index 3bc785560..0b94e9e85 100644 --- a/app/components/post_list/post/index.ts +++ b/app/components/post_list/post/index.ts @@ -18,12 +18,12 @@ import {isPostFlagged, isSystemMessage} from '@mm-redux/utils/post_utils'; import {canDeletePost} from '@selectors/permissions'; import {areConsecutivePosts, postUserDisplayName} from '@utils/post'; -import type {StyleProp, ViewStyle} from 'react-native'; +import Post from './post'; + import type {Post as PostType} from '@mm-redux/types/posts'; import type {Theme} from '@mm-redux/types/preferences'; import type {GlobalState} from '@mm-redux/types/store'; - -import Post from './post'; +import type {StyleProp, ViewStyle} from 'react-native'; type OwnProps = { location: string; diff --git a/app/components/post_list/post/post.tsx b/app/components/post_list/post/post.tsx index fbc7ed84c..80bf021ce 100644 --- a/app/components/post_list/post/post.tsx +++ b/app/components/post_list/post/post.tsx @@ -2,25 +2,22 @@ // See LICENSE.txt for license information. import React, {ReactNode, useRef} from 'react'; -import {Keyboard, StyleProp, View, ViewStyle} from 'react-native'; import {injectIntl, intlShape} from 'react-intl'; +import {Keyboard, StyleProp, View, ViewStyle} from 'react-native'; import {showModalOverCurrentContext} from '@actions/navigation'; import ThreadFooter from '@components/global_threads/thread_footer'; +import SystemAvatar from '@components/post_list/system_avatar'; import SystemHeader from '@components/post_list/system_header'; import TouchableWithFeedback from '@components/touchable_with_feedback'; -import SystemAvatar from '@components/post_list/system_avatar'; import * as Screens from '@constants/screen'; import {Posts} from '@mm-redux/constants'; -import {UserProfile} from '@mm-redux/types/users'; import {UserThread} from '@mm-redux/types/threads'; +import {UserProfile} from '@mm-redux/types/users'; import EventEmitter from '@mm-redux/utils/event_emitter'; import {fromAutoResponder, isPostEphemeral, isPostPendingOrFailed, isSystemMessage} from '@mm-redux/utils/post_utils'; -import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; import {preventDoubleTap} from '@utils/tap'; - -import type {Post as PostType} from '@mm-redux/types/posts'; -import type {Theme} from '@mm-redux/types/preferences'; +import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; import Avatar from './avatar'; import Body from './body'; @@ -28,6 +25,9 @@ import Header from './header'; import PreHeader from './pre_header'; import SystemMessage from './system_message'; +import type {Post as PostType} from '@mm-redux/types/posts'; +import type {Theme} from '@mm-redux/types/preferences'; + type PostProps = { canDelete: boolean; collapsedThreadsEnabled: boolean; @@ -51,7 +51,7 @@ type PostProps = { style?: StyleProp; teammateNameDisplay: string; testID?: string; - theme: Theme + theme: Theme; thread: UserThread; threadStarter: UserProfile; }; diff --git a/app/components/post_list/post/system_message/index.ts b/app/components/post_list/post/system_message/index.ts index e06b0e5aa..f585a3f61 100644 --- a/app/components/post_list/post/system_message/index.ts +++ b/app/components/post_list/post/system_message/index.ts @@ -5,11 +5,11 @@ import {connect} from 'react-redux'; import {getUser} from '@mm-redux/selectors/entities/users'; -import type {GlobalState} from '@mm-redux/types/store'; +import SystemMessage from './system_message'; + import type {Post} from '@mm-redux/types/posts'; import type {Theme} from '@mm-redux/types/preferences'; - -import SystemMessage from './system_message'; +import type {GlobalState} from '@mm-redux/types/store'; type OwnProps = { post: Post; diff --git a/app/components/post_list/post/system_message/system_message_helpers.test.js b/app/components/post_list/post/system_message/system_message_helpers.test.js index fe38f7b61..91d829369 100644 --- a/app/components/post_list/post/system_message/system_message_helpers.test.js +++ b/app/components/post_list/post/system_message/system_message_helpers.test.js @@ -2,9 +2,9 @@ // See LICENSE.txt for license information. import React from 'react'; -import {renderWithReduxIntl} from 'test/testing_library'; import {Posts, Preferences} from '@mm-redux/constants'; +import {renderWithReduxIntl} from '@test/testing_library'; import SystemMessage from './system_message'; diff --git a/app/components/post_list/post_list.test.js b/app/components/post_list/post_list.test.js index b7550e281..6d0f3a89f 100644 --- a/app/components/post_list/post_list.test.js +++ b/app/components/post_list/post_list.test.js @@ -4,7 +4,7 @@ import React from 'react'; import Preferences from '@mm-redux/constants/preferences'; -import {shallowWithIntl} from 'test/intl-test-helper'; +import {shallowWithIntl} from '@test/intl-test-helper'; import PostList from './post_list'; diff --git a/app/components/post_list/post_list.tsx b/app/components/post_list/post_list.tsx index 940f2ca9b..a2a06e522 100644 --- a/app/components/post_list/post_list.tsx +++ b/app/components/post_list/post_list.tsx @@ -11,24 +11,23 @@ import {useResetNativeScrollView} from '@hooks'; import {Posts} from '@mm-redux/constants'; import EventEmitter from '@mm-redux/utils/event_emitter'; import {getDateForDateLine, isCombinedUserActivityPost, isDateLine, isStartOfNewMessages} from '@mm-redux/utils/post_list'; +import telemetry, {PERF_MARKERS} from '@telemetry'; import {badDeepLink, errorBadChannel} from '@utils/draft'; import {emptyFunction} from '@utils/general'; import {makeExtraData} from '@utils/list_view'; import {matchDeepLink, PERMALINK_GENERIC_TEAM_NAME_REDIRECT} from '@utils/url'; -import telemetry, {PERF_MARKERS} from '@telemetry'; - -import {INITIAL_BATCH_TO_RENDER, SCROLL_POSITION_CONFIG, VIEWABILITY_CONFIG} from './post_list_config'; - -import type {ActionResult} from '@mm-redux/types/actions'; -import type {Theme} from '@mm-redux/types/preferences'; import CombinedUserActivity from './combined_user_activity'; import DateSeparator from './date_separator'; import MoreMessagesButton from './more_messages_button'; import NewMessagesLine from './new_message_line'; import Post from './post'; +import {INITIAL_BATCH_TO_RENDER, SCROLL_POSITION_CONFIG, VIEWABILITY_CONFIG} from './post_list_config'; import PostListRefreshControl from './post_list_refresh_control'; +import type {ActionResult} from '@mm-redux/types/actions'; +import type {Theme} from '@mm-redux/types/preferences'; + type PostListProps = { channelId?: string; closePermalink: () => Promise; @@ -56,7 +55,7 @@ type PostListProps = { setDeepLinkURL: (url?: string) => void; showPermalink: (intl: typeof intlShape, teamName: string, postId: string, openAsPermalink?: boolean) => Promise<{}>; testID?: string; - theme: Theme + theme: Theme; } type ViewableItemsChanged = { diff --git a/app/components/post_list/system_header/index.ts b/app/components/post_list/system_header/index.ts index a22167635..f9a26a35e 100644 --- a/app/components/post_list/system_header/index.ts +++ b/app/components/post_list/system_header/index.ts @@ -4,16 +4,16 @@ import {connect} from 'react-redux'; import {Preferences} from '@mm-redux/constants'; -import {getCurrentUser} from '@mm-redux/selectors/entities/users'; import {getBool} from '@mm-redux/selectors/entities/preferences'; import {isTimezoneEnabled} from '@mm-redux/selectors/entities/timezone'; +import {getCurrentUser} from '@mm-redux/selectors/entities/users'; import {getUserCurrentTimezone} from '@mm-redux/utils/timezone_utils'; +import SystemHeader from './system_header'; + import type {GlobalState} from '@mm-redux/types/store'; import type {UserProfile} from '@mm-redux/types/users'; -import SystemHeader from './system_header'; - export function mapStateToProps(state: GlobalState) { const currentUser: UserProfile | undefined = getCurrentUser(state); const isMilitaryTime = getBool(state, Preferences.CATEGORY_DISPLAY_SETTINGS, 'use_military_time'); diff --git a/app/components/post_list/system_header/system_header.tsx b/app/components/post_list/system_header/system_header.tsx index 044bc99fd..90c722ea2 100644 --- a/app/components/post_list/system_header/system_header.tsx +++ b/app/components/post_list/system_header/system_header.tsx @@ -4,8 +4,8 @@ import React from 'react'; import {View} from 'react-native'; -import FormattedTime from '@components/formatted_time'; import FormattedText from '@components/formatted_text'; +import FormattedTime from '@components/formatted_time'; import {makeStyleSheetFromTheme} from '@utils/theme'; import type {Theme} from '@mm-redux/types/preferences'; @@ -15,7 +15,7 @@ type Props = { createAt: number | string | Date; isMilitaryTime: boolean; theme: Theme; - userTimezone: UserTimezone | string | null | undefined + userTimezone: UserTimezone | string | null | undefined; } const getStyleSheet = makeStyleSheetFromTheme((theme: Theme) => { diff --git a/app/components/post_list_retry.js b/app/components/post_list_retry.js index 1c5e51c35..c5e2c14cb 100644 --- a/app/components/post_list_retry.js +++ b/app/components/post_list_retry.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import { Platform, View, diff --git a/app/components/post_separator.js b/app/components/post_separator.js index 0cc37340c..286330fde 100644 --- a/app/components/post_separator.js +++ b/app/components/post_separator.js @@ -1,11 +1,11 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import {View} from 'react-native'; -import {changeOpacity, makeStyleSheetFromTheme} from 'app/utils/theme'; +import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; const SEPARATOR_HEIGHT = 3; diff --git a/app/components/profile_picture/index.js b/app/components/profile_picture/index.js index c9223ad51..6974f1660 100644 --- a/app/components/profile_picture/index.js +++ b/app/components/profile_picture/index.js @@ -1,15 +1,14 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; -import {getTheme} from '@mm-redux/selectors/entities/preferences'; +import {setProfileImageUri} from '@actions/views/edit_profile'; import {getStatusesByIdsBatchedDebounced} from '@mm-redux/actions/users'; +import {getTheme} from '@mm-redux/selectors/entities/preferences'; import {getCurrentUserId, getStatusForUserId, getUser} from '@mm-redux/selectors/entities/users'; - -import {setProfileImageUri} from 'app/actions/views/edit_profile'; -import {getProfileImageUri} from 'app/selectors/views'; +import {getProfileImageUri} from '@selectors/views'; import ProfilePicture from './profile_picture'; diff --git a/app/components/profile_picture_button.js b/app/components/profile_picture_button.js index da1e6284d..9fdf45ed1 100644 --- a/app/components/profile_picture_button.js +++ b/app/components/profile_picture_button.js @@ -1,14 +1,12 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import {Client4} from '@client/rest'; - -import {t} from 'app/utils/i18n'; - -import AttachmentButton from 'app/components/attachment_button'; +import AttachmentButton from '@components/attachment_button'; +import {t} from '@utils/i18n'; export default class ProfilePictureButton extends PureComponent { static propTypes = { diff --git a/app/components/profile_picture_button.test.js b/app/components/profile_picture_button.test.js index 828f2b454..04fa578ba 100644 --- a/app/components/profile_picture_button.test.js +++ b/app/components/profile_picture_button.test.js @@ -1,14 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; +import {Client4} from '@client/rest'; import Preferences from '@mm-redux/constants/preferences'; import ProfilePictureButton from './profile_picture_button.js'; -import {Client4} from '@client/rest'; - describe('profile_picture_button', () => { const baseProps = { theme: Preferences.THEMES.default, diff --git a/app/components/progressive_image/progressive_image.js b/app/components/progressive_image/progressive_image.js index 73bc5b65f..da4d0831c 100644 --- a/app/components/progressive_image/progressive_image.js +++ b/app/components/progressive_image/progressive_image.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import {Animated, ImageBackground, Image, Platform, View, StyleSheet} from 'react-native'; import thumb from '@assets/images/thumb.png'; diff --git a/app/components/progressive_image/progressive_image.test.js b/app/components/progressive_image/progressive_image.test.js index 9dae1408d..dbd2c7775 100644 --- a/app/components/progressive_image/progressive_image.test.js +++ b/app/components/progressive_image/progressive_image.test.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import Preferences from '@mm-redux/constants/preferences'; diff --git a/app/components/radio_button/radio_button.js b/app/components/radio_button/radio_button.js index 4d350c568..618ec6dde 100644 --- a/app/components/radio_button/radio_button.js +++ b/app/components/radio_button/radio_button.js @@ -1,10 +1,10 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {connect} from 'react-redux'; -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import {Animated, Text, View} from 'react-native'; +import {connect} from 'react-redux'; import CompassIcon from '@components/compass_icon'; import {getTheme} from '@mm-redux/selectors/entities/preferences'; diff --git a/app/components/radio_button/radio_button_group.js b/app/components/radio_button/radio_button_group.js index 1c421e18f..815d8d8b7 100644 --- a/app/components/radio_button/radio_button_group.js +++ b/app/components/radio_button/radio_button_group.js @@ -1,9 +1,10 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import {View} from 'react-native'; + import RadioButton from './radio_button'; export default class RadioButtonGroup extends PureComponent { diff --git a/app/components/radio_button/radio_button_group.test.js b/app/components/radio_button/radio_button_group.test.js index ad6d8a736..39a6647d2 100644 --- a/app/components/radio_button/radio_button_group.test.js +++ b/app/components/radio_button/radio_button_group.test.js @@ -2,9 +2,9 @@ // See LICENSE.txt for license information. import React from 'react'; -import {shallowWithIntl} from 'test/intl-test-helper'; import Preferences from '@mm-redux/constants/preferences'; +import {shallowWithIntl} from '@test/intl-test-helper'; import RadioButtonGroup from './radio_button_group'; diff --git a/app/components/reaction_picker/index.js b/app/components/reaction_picker/index.js index 47e992092..2093af323 100644 --- a/app/components/reaction_picker/index.js +++ b/app/components/reaction_picker/index.js @@ -2,7 +2,9 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; + import {getTheme} from '@mm-redux/selectors/entities/preferences'; + import ReactionPicker from './reaction_picker'; function mapStateToProps(state) { diff --git a/app/components/reaction_picker/reaction_button.js b/app/components/reaction_picker/reaction_button.js index fd265f8c1..44fa964a9 100644 --- a/app/components/reaction_picker/reaction_button.js +++ b/app/components/reaction_picker/reaction_button.js @@ -1,20 +1,20 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import { View, TouchableWithoutFeedback, } from 'react-native'; import Emoji from '@components/emoji'; -import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; -import {hapticFeedback} from '@utils/general'; import { LARGE_CONTAINER_SIZE, LARGE_ICON_SIZE, } from '@constants/reaction_picker'; +import {hapticFeedback} from '@utils/general'; +import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; export default class ReactionButton extends PureComponent { static propTypes = { diff --git a/app/components/reaction_picker/reaction_picker.js b/app/components/reaction_picker/reaction_picker.js index 2aff0abcf..c6acf2a69 100644 --- a/app/components/reaction_picker/reaction_picker.js +++ b/app/components/reaction_picker/reaction_picker.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import PropTypes from 'prop-types'; +import React from 'react'; import {View, TouchableWithoutFeedback, useWindowDimensions} from 'react-native'; import CompassIcon from '@components/compass_icon'; @@ -15,10 +15,10 @@ import { SMALL_ICON_SIZE, LARGE_ICON_SIZE, } from '@constants/reaction_picker'; +import {EmojiIndicesByAlias} from '@utils/emojis'; import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; import ReactionButton from './reaction_button'; -import {EmojiIndicesByAlias} from '@utils/emojis'; const ReactionPicker = (props) => { const {theme} = props; diff --git a/app/components/reaction_picker/reaction_picker.test.js b/app/components/reaction_picker/reaction_picker.test.js index edd61a682..e5684b2b4 100644 --- a/app/components/reaction_picker/reaction_picker.test.js +++ b/app/components/reaction_picker/reaction_picker.test.js @@ -1,13 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; - -import ReactionPicker from './reaction_picker'; +import React from 'react'; import Preferences from '@mm-redux/constants/preferences'; +import ReactionPicker from './reaction_picker'; + describe('Reactions', () => { const baseProps = { addReaction: jest.fn(), diff --git a/app/components/refresh_list/index.js b/app/components/refresh_list/index.js index 7ed80de97..311385e7b 100644 --- a/app/components/refresh_list/index.js +++ b/app/components/refresh_list/index.js @@ -3,7 +3,7 @@ import {connect} from 'react-redux'; -import {getConnection} from 'app/selectors/device'; +import {getConnection} from '@selectors/device'; import RefreshList from './refresh_list'; diff --git a/app/components/retriable_fast_image/index.tsx b/app/components/retriable_fast_image/index.tsx index a07027aab..8f23ae91f 100644 --- a/app/components/retriable_fast_image/index.tsx +++ b/app/components/retriable_fast_image/index.tsx @@ -7,11 +7,11 @@ import FastImage, {FastImageProps} from 'react-native-fast-image'; export const FAST_IMAGE_MAX_RETRIES = 3; type RetriableFastImageProps = FastImageProps & { - id: string + id: string; } type RetriableFastImageState = { - retry: number + retry: number; } export default class RetriableFastImage extends PureComponent { diff --git a/app/components/retriable_fast_image/retriable_fast_image.test.js b/app/components/retriable_fast_image/retriable_fast_image.test.js index 56154931c..256dd40b1 100644 --- a/app/components/retriable_fast_image/retriable_fast_image.test.js +++ b/app/components/retriable_fast_image/retriable_fast_image.test.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import FastImage from 'react-native-fast-image'; import RetriableFastImage, {FAST_IMAGE_MAX_RETRIES} from './index'; diff --git a/app/components/retry_bar_indicator/index.ts b/app/components/retry_bar_indicator/index.ts index 0f4b71070..cba9dc872 100644 --- a/app/components/retry_bar_indicator/index.ts +++ b/app/components/retry_bar_indicator/index.ts @@ -6,10 +6,11 @@ import {connect} from 'react-redux'; import {refreshChannelWithRetry} from '@actions/views/channel'; import {RequestStatus} from '@mm-redux/constants'; import {getCurrentChannelId} from '@mm-redux/selectors/entities/channels'; -import type {GlobalState} from '@mm-redux/types/store'; import RetryBarIndicator from './retry_bar_indicator'; +import type {GlobalState} from '@mm-redux/types/store'; + function mapStateToProps(state: GlobalState) { const {websocket: websocketRequest} = state.requests.general; const channelId = getCurrentChannelId(state); diff --git a/app/components/retry_bar_indicator/retry_bar_indicator.tsx b/app/components/retry_bar_indicator/retry_bar_indicator.tsx index eab02bd55..634f820d5 100644 --- a/app/components/retry_bar_indicator/retry_bar_indicator.tsx +++ b/app/components/retry_bar_indicator/retry_bar_indicator.tsx @@ -3,12 +3,10 @@ import React, {useEffect, useRef} from 'react'; import {Animated, StyleSheet, TouchableWithoutFeedback} from 'react-native'; -import EventEmitter from '@mm-redux/utils/event_emitter'; - +import FormattedText from '@components/formatted_text'; import {ViewTypes} from '@constants'; import {INDICATOR_BAR_HEIGHT} from '@constants/view'; - -import FormattedText from '@components/formatted_text'; +import EventEmitter from '@mm-redux/utils/event_emitter'; type Props = { channelId?: string; diff --git a/app/components/root/index.js b/app/components/root/index.js index a2050816f..f68f53cc8 100644 --- a/app/components/root/index.js +++ b/app/components/root/index.js @@ -5,9 +5,8 @@ import {connect} from 'react-redux'; import {getCurrentUrl} from '@mm-redux/selectors/entities/general'; import {getTheme} from '@mm-redux/selectors/entities/preferences'; - -import {getCurrentLocale} from 'app/selectors/i18n'; -import {removeProtocol} from 'app/utils/url'; +import {getCurrentLocale} from '@selectors/i18n'; +import {removeProtocol} from '@utils/url'; import Root from './root'; diff --git a/app/components/root/root.js b/app/components/root/root.js index 5426051e3..93805bb50 100644 --- a/app/components/root/root.js +++ b/app/components/root/root.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import {IntlProvider} from 'react-intl'; import {Platform} from 'react-native'; diff --git a/app/components/search_bar/index.js b/app/components/search_bar/index.js index 0f04112b6..ab9d653ef 100644 --- a/app/components/search_bar/index.js +++ b/app/components/search_bar/index.js @@ -1,8 +1,9 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; +import {intlShape} from 'react-intl'; import { Animated, InteractionManager, @@ -12,13 +13,10 @@ import { View, Platform, } from 'react-native'; -import {intlShape} from 'react-intl'; - import {SearchBar} from 'react-native-elements'; -import {memoizeResult} from '@mm-redux/utils/helpers'; - import CompassIcon from '@components/compass_icon'; +import {memoizeResult} from '@mm-redux/utils/helpers'; const LEFT_COMPONENT_INITIAL_POSITION = Platform.OS === 'ios' ? 7 : 0; diff --git a/app/components/search_bar/search_bar.test.js b/app/components/search_bar/search_bar.test.js index 182e62410..6f389c52c 100644 --- a/app/components/search_bar/search_bar.test.js +++ b/app/components/search_bar/search_bar.test.js @@ -3,7 +3,7 @@ import React from 'react'; -import {shallowWithIntl} from 'test/intl-test-helper'; +import {shallowWithIntl} from '@test/intl-test-helper'; import SearchBar from './index'; diff --git a/app/components/sidebars/main/channels_list/channel_item/channel_item.js b/app/components/sidebars/main/channels_list/channel_item/channel_item.js index b59910f32..ef703cf99 100644 --- a/app/components/sidebars/main/channels_list/channel_item/channel_item.js +++ b/app/components/sidebars/main/channels_list/channel_item/channel_item.js @@ -1,15 +1,15 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; +import {intlShape} from 'react-intl'; import { TouchableHighlight, Text, View, Platform, } from 'react-native'; -import {intlShape} from 'react-intl'; import Badge from '@components/badge'; import ChannelIcon from '@components/channel_icon'; diff --git a/app/components/sidebars/main/channels_list/channel_item/channel_item.test.js b/app/components/sidebars/main/channels_list/channel_item/channel_item.test.js index 1d51c7ab1..8d78b6a8a 100644 --- a/app/components/sidebars/main/channels_list/channel_item/channel_item.test.js +++ b/app/components/sidebars/main/channels_list/channel_item/channel_item.test.js @@ -5,7 +5,7 @@ import React from 'react'; import {TouchableHighlight} from 'react-native'; import Preferences from '@mm-redux/constants/preferences'; -import {shallowWithIntl} from 'test/intl-test-helper'; +import {shallowWithIntl} from '@test/intl-test-helper'; import ChannelItem from './channel_item'; diff --git a/app/components/sidebars/main/channels_list/channel_item/index.js b/app/components/sidebars/main/channels_list/channel_item/index.js index 2d23813fc..a035fd9c9 100644 --- a/app/components/sidebars/main/channels_list/channel_item/index.js +++ b/app/components/sidebars/main/channels_list/channel_item/index.js @@ -12,11 +12,11 @@ import { shouldHideDefaultChannel, } from '@mm-redux/selectors/entities/channels'; import {getTheme, getTeammateNameDisplaySetting, isCollapsedThreadsEnabled} from '@mm-redux/selectors/entities/preferences'; -import {getViewingGlobalThreads} from '@selectors/threads'; import {getCurrentUserId, getUser} from '@mm-redux/selectors/entities/users'; import {getMsgCountInChannel, getUserIdFromChannelName, isChannelMuted} from '@mm-redux/utils/channel_utils'; import {displayUsername} from '@mm-redux/utils/user_utils'; import {isCustomStatusEnabled} from '@selectors/custom_status'; +import {getViewingGlobalThreads} from '@selectors/threads'; import {getDraftForChannel} from '@selectors/views'; import {isGuest as isGuestUser} from '@utils/users'; diff --git a/app/components/sidebars/main/channels_list/channels_list.js b/app/components/sidebars/main/channels_list/channels_list.js index d0c0dcac5..3bf1ee0a4 100644 --- a/app/components/sidebars/main/channels_list/channels_list.js +++ b/app/components/sidebars/main/channels_list/channels_list.js @@ -1,13 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; +import {intlShape} from 'react-intl'; import { Platform, View, } from 'react-native'; -import {intlShape} from 'react-intl'; import {SafeAreaView} from 'react-native-safe-area-context'; import CompassIcon from '@components/compass_icon'; diff --git a/app/components/sidebars/main/channels_list/filtered_list/filtered_list.js b/app/components/sidebars/main/channels_list/filtered_list/filtered_list.js index 81cb37e47..a0b303011 100644 --- a/app/components/sidebars/main/channels_list/filtered_list/filtered_list.js +++ b/app/components/sidebars/main/channels_list/filtered_list/filtered_list.js @@ -2,8 +2,10 @@ // See LICENSE.txt for license information. import deepEqual from 'deep-equal'; -import React, {Component} from 'react'; +import memoize from 'memoize-one'; import PropTypes from 'prop-types'; +import React, {Component} from 'react'; +import {injectIntl, intlShape} from 'react-intl'; import { Keyboard, Platform, @@ -11,7 +13,6 @@ import { Text, View, } from 'react-native'; -import {injectIntl, intlShape} from 'react-intl'; import ChannelItem from '@components/sidebars/main/channels_list/channel_item'; import {ListTypes} from '@constants'; @@ -19,7 +20,6 @@ import {General} from '@mm-redux/constants'; import {sortChannelsByDisplayName} from '@mm-redux/utils/channel_utils'; import {displayUsername} from '@mm-redux/utils/user_utils'; import {t} from '@utils/i18n'; -import memoize from 'memoize-one'; const VIEWABILITY_CONFIG = ListTypes.VISIBILITY_CONFIG_DEFAULTS; diff --git a/app/components/sidebars/main/channels_list/filtered_list/filtered_list.test.js b/app/components/sidebars/main/channels_list/filtered_list/filtered_list.test.js index d55a3c38e..aa35c9a65 100644 --- a/app/components/sidebars/main/channels_list/filtered_list/filtered_list.test.js +++ b/app/components/sidebars/main/channels_list/filtered_list/filtered_list.test.js @@ -2,9 +2,9 @@ // See LICENSE.txt for license information. import React from 'react'; -import {shallowWithIntl} from 'test/intl-test-helper'; import Preferences from '@mm-redux/constants/preferences'; +import {shallowWithIntl} from '@test/intl-test-helper'; import FilteredList from './filtered_list'; diff --git a/app/components/sidebars/main/channels_list/filtered_list/index.js b/app/components/sidebars/main/channels_list/filtered_list/index.js index 1ab906731..ddfb10f3d 100644 --- a/app/components/sidebars/main/channels_list/filtered_list/index.js +++ b/app/components/sidebars/main/channels_list/filtered_list/index.js @@ -1,14 +1,14 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; import {createSelector} from 'reselect'; import Config from '@assets/config'; import {searchChannels} from '@mm-redux/actions/channels'; -import {getProfilesInTeam, searchProfiles} from '@mm-redux/actions/users'; import {makeGroupMessageVisibleIfNecessary} from '@mm-redux/actions/preferences'; +import {getProfilesInTeam, searchProfiles} from '@mm-redux/actions/users'; import {General} from '@mm-redux/constants'; import { getChannelsWithUnreadSection, @@ -18,9 +18,9 @@ import { getOtherChannels, } from '@mm-redux/selectors/entities/channels'; import {getConfig} from '@mm-redux/selectors/entities/general'; +import {getDirectShowPreferences, getTeammateNameDisplaySetting, getTheme} from '@mm-redux/selectors/entities/preferences'; import {getCurrentTeam} from '@mm-redux/selectors/entities/teams'; import {getCurrentUserId, getProfilesInCurrentTeam, getUsers, getUserIdsInChannels, getUserStatuses} from '@mm-redux/selectors/entities/users'; -import {getDirectShowPreferences, getTeammateNameDisplaySetting, getTheme} from '@mm-redux/selectors/entities/preferences'; import FilteredList from './filtered_list'; diff --git a/app/components/sidebars/main/channels_list/index.js b/app/components/sidebars/main/channels_list/index.js index 07dd98be7..e8c1e73b8 100644 --- a/app/components/sidebars/main/channels_list/index.js +++ b/app/components/sidebars/main/channels_list/index.js @@ -4,6 +4,7 @@ import {connect} from 'react-redux'; import {getTheme} from '@mm-redux/selectors/entities/preferences'; + import ChannelsList from './channels_list'; function mapStateToProps(state) { diff --git a/app/components/sidebars/main/channels_list/list/index.js b/app/components/sidebars/main/channels_list/list/index.js index c27210a44..6d97869a8 100644 --- a/app/components/sidebars/main/channels_list/list/index.js +++ b/app/components/sidebars/main/channels_list/list/index.js @@ -5,20 +5,20 @@ import {connect} from 'react-redux'; import {DeviceTypes, ViewTypes} from '@constants'; import {General} from '@mm-redux/constants'; +import Permissions from '@mm-redux/constants/permissions'; import { getSortedFavoriteChannelIds, getSortedUnreadChannelIds, getOrderedChannelIds, } from '@mm-redux/selectors/entities/channels'; -import {getCurrentUserId, getCurrentUserRoles} from '@mm-redux/selectors/entities/users'; -import {getCurrentTeamId} from '@mm-redux/selectors/entities/teams'; +import {getConfig, getLicense, hasNewPermissions} from '@mm-redux/selectors/entities/general'; import {getTheme, getFavoritesPreferences, getSidebarPreferences, isCollapsedThreadsEnabled} from '@mm-redux/selectors/entities/preferences'; +import {haveITeamPermission} from '@mm-redux/selectors/entities/roles'; +import {getCurrentTeamId} from '@mm-redux/selectors/entities/teams'; +import {getCurrentUserId, getCurrentUserRoles} from '@mm-redux/selectors/entities/users'; import {showCreateOption} from '@mm-redux/utils/channel_utils'; import {memoizeResult} from '@mm-redux/utils/helpers'; import {isAdmin as checkIsAdmin, isSystemAdmin as checkIsSystemAdmin} from '@mm-redux/utils/user_utils'; -import {getConfig, getLicense, hasNewPermissions} from '@mm-redux/selectors/entities/general'; -import {haveITeamPermission} from '@mm-redux/selectors/entities/roles'; -import Permissions from '@mm-redux/constants/permissions'; import List from './list'; diff --git a/app/components/sidebars/main/channels_list/list/list.js b/app/components/sidebars/main/channels_list/list/list.js index ba763528a..888d8d490 100644 --- a/app/components/sidebars/main/channels_list/list/list.js +++ b/app/components/sidebars/main/channels_list/list/list.js @@ -1,8 +1,9 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; +import {intlShape} from 'react-intl'; import { Dimensions, findNodeHandle, @@ -13,22 +14,19 @@ import { TouchableHighlight, View, } from 'react-native'; -import {intlShape} from 'react-intl'; - -import EventEmitter from '@mm-redux/utils/event_emitter'; -import {General} from '@mm-redux/constants'; -import {debounce} from '@mm-redux/actions/helpers'; +import {showModal} from '@actions/navigation'; import CompassIcon from '@components/compass_icon'; import ChannelItem from '@components/sidebars/main/channels_list/channel_item'; import ThreadsSidebarEntry from '@components/sidebars/main/threads_entry'; import {DeviceTypes, ListTypes, NavigationTypes} from '@constants'; import {SidebarSectionTypes} from '@constants/view'; - +import {debounce} from '@mm-redux/actions/helpers'; +import {General} from '@mm-redux/constants'; +import EventEmitter from '@mm-redux/utils/event_emitter'; import BottomSheet from '@utils/bottom_sheet'; import {t} from '@utils/i18n'; import {preventDoubleTap} from '@utils/tap'; -import {showModal} from '@actions/navigation'; const VIEWABILITY_CONFIG = { ...ListTypes.VISIBILITY_CONFIG_DEFAULTS, diff --git a/app/components/sidebars/main/channels_list/list/list.test.js b/app/components/sidebars/main/channels_list/list/list.test.js index 395c169c1..96a266153 100644 --- a/app/components/sidebars/main/channels_list/list/list.test.js +++ b/app/components/sidebars/main/channels_list/list/list.test.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import Preferences from '@mm-redux/constants/preferences'; diff --git a/app/components/sidebars/main/channels_list/switch_teams_button/switch_teams_button.js b/app/components/sidebars/main/channels_list/switch_teams_button/switch_teams_button.js index 3dbfcfa86..6c7b643bf 100644 --- a/app/components/sidebars/main/channels_list/switch_teams_button/switch_teams_button.js +++ b/app/components/sidebars/main/channels_list/switch_teams_button/switch_teams_button.js @@ -10,7 +10,7 @@ import { import Badge from '@components/badge'; import CompassIcon from '@components/compass_icon'; -import TeamIcon from 'app/components/team_icon'; +import TeamIcon from '@components/team_icon'; import {preventDoubleTap} from '@utils/tap'; import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; diff --git a/app/components/sidebars/main/channels_list/switch_teams_button/switch_teams_button.test.js b/app/components/sidebars/main/channels_list/switch_teams_button/switch_teams_button.test.js index 6aa7ff8fe..7e4e817c4 100644 --- a/app/components/sidebars/main/channels_list/switch_teams_button/switch_teams_button.test.js +++ b/app/components/sidebars/main/channels_list/switch_teams_button/switch_teams_button.test.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import Preferences from '@mm-redux/constants/preferences'; diff --git a/app/components/sidebars/main/channels_list/unread_indicator/unread_indicator.base.js b/app/components/sidebars/main/channels_list/unread_indicator/unread_indicator.base.js index c37f5a2eb..1264c8339 100644 --- a/app/components/sidebars/main/channels_list/unread_indicator/unread_indicator.base.js +++ b/app/components/sidebars/main/channels_list/unread_indicator/unread_indicator.base.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import { Platform, TouchableWithoutFeedback, diff --git a/app/components/sidebars/main/channels_list/unread_indicator/unread_indicator.ios.js b/app/components/sidebars/main/channels_list/unread_indicator/unread_indicator.ios.js index 273923f6e..f43e39c03 100644 --- a/app/components/sidebars/main/channels_list/unread_indicator/unread_indicator.ios.js +++ b/app/components/sidebars/main/channels_list/unread_indicator/unread_indicator.ios.js @@ -3,7 +3,7 @@ import React from 'react'; -import Fade from 'app/components/fade'; +import Fade from '@components/fade'; import UnreadIndicatorBase, {getStyleSheet} from './unread_indicator.base'; diff --git a/app/components/sidebars/main/drawer_swiper/drawer_swiper.js b/app/components/sidebars/main/drawer_swiper/drawer_swiper.js index 4be4a0b41..a2d915e2e 100644 --- a/app/components/sidebars/main/drawer_swiper/drawer_swiper.js +++ b/app/components/sidebars/main/drawer_swiper/drawer_swiper.js @@ -1,12 +1,11 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {Component} from 'react'; import PropTypes from 'prop-types'; +import React, {Component} from 'react'; -import {changeOpacity} from 'app/utils/theme'; - -import Swiper from 'app/components/swiper'; +import Swiper from '@components/swiper'; +import {changeOpacity} from '@utils/theme'; export default class DrawerSwiper extends Component { static propTypes = { diff --git a/app/components/sidebars/main/index.js b/app/components/sidebars/main/index.js index 4a79830f5..2274961b9 100644 --- a/app/components/sidebars/main/index.js +++ b/app/components/sidebars/main/index.js @@ -1,21 +1,20 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; +import {setChannelDisplayName, handleSelectChannel} from '@actions/views/channel'; +import {makeDirectChannel} from '@actions/views/more_dms'; +import {handleNotViewingGlobalThreadsScreen} from '@actions/views/threads'; import {joinChannel} from '@mm-redux/actions/channels'; import {getTeams} from '@mm-redux/actions/teams'; import {getTheme} from '@mm-redux/selectors/entities/preferences'; import {getCurrentTeamId, getMyTeamsCount} from '@mm-redux/selectors/entities/teams'; import {getCurrentUser} from '@mm-redux/selectors/entities/users'; - -import {setChannelDisplayName, handleSelectChannel} from 'app/actions/views/channel'; -import {makeDirectChannel} from 'app/actions/views/more_dms'; -import {handleNotViewingGlobalThreadsScreen} from '@actions/views/threads'; +import {getViewingGlobalThreads} from '@selectors/threads'; import MainSidebar from './main_sidebar'; -import {getViewingGlobalThreads} from '@selectors/threads'; function mapStateToProps(state) { const currentUser = getCurrentUser(state); diff --git a/app/components/sidebars/main/main_sidebar.android.js b/app/components/sidebars/main/main_sidebar.android.js index 37b3eb154..a1d4093df 100644 --- a/app/components/sidebars/main/main_sidebar.android.js +++ b/app/components/sidebars/main/main_sidebar.android.js @@ -2,15 +2,14 @@ // See LICENSE.txt for license information. import React from 'react'; -import {Dimensions, Keyboard} from 'react-native'; import {IntlProvider} from 'react-intl'; +import {Dimensions, Keyboard} from 'react-native'; +import {closeMainSideMenu, enableMainSideMenu} from '@actions/navigation'; +import {NavigationTypes} from '@constants'; +import {getTranslations} from '@i18n'; import EventEmitter from '@mm-redux/utils/event_emitter'; -import {closeMainSideMenu, enableMainSideMenu} from 'app/actions/navigation'; -import {NavigationTypes} from 'app/constants'; -import {getTranslations} from 'app/i18n'; - import MainSidebarBase from './main_sidebar_base'; export default class MainSidebarAndroid extends MainSidebarBase { diff --git a/app/components/sidebars/main/main_sidebar.ios.js b/app/components/sidebars/main/main_sidebar.ios.js index e2e5dad7c..9ce6c4a11 100644 --- a/app/components/sidebars/main/main_sidebar.ios.js +++ b/app/components/sidebars/main/main_sidebar.ios.js @@ -1,15 +1,16 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; -import {Dimensions, Keyboard} from 'react-native'; -import {intlShape} from 'react-intl'; import AsyncStorage from '@react-native-community/async-storage'; +import React from 'react'; +import {intlShape} from 'react-intl'; +import {Dimensions, Keyboard} from 'react-native'; + import DrawerLayout, {DRAWER_INITIAL_OFFSET, TABLET_WIDTH} from '@components/sidebars/drawer_layout/index.tsx'; import {DeviceTypes, NavigationTypes} from '@constants'; +import mattermostManaged from '@mattermost-managed'; import EventEmitter from '@mm-redux/utils/event_emitter'; -import mattermostManaged from 'app/mattermost_managed'; import MainSidebarBase from './main_sidebar_base'; diff --git a/app/components/sidebars/main/main_sidebar.test.js b/app/components/sidebars/main/main_sidebar.test.js index daef12cc0..4b9c7e526 100644 --- a/app/components/sidebars/main/main_sidebar.test.js +++ b/app/components/sidebars/main/main_sidebar.test.js @@ -5,7 +5,7 @@ import React from 'react'; import {DeviceTypes} from '@constants'; import Preferences from '@mm-redux/constants/preferences'; -import {shallowWithIntl} from 'test/intl-test-helper'; +import {shallowWithIntl} from '@test/intl-test-helper'; import MainSidebar from './main_sidebar.ios'; diff --git a/app/components/sidebars/main/main_sidebar_base.js b/app/components/sidebars/main/main_sidebar_base.js index 083288c47..fac158675 100644 --- a/app/components/sidebars/main/main_sidebar_base.js +++ b/app/components/sidebars/main/main_sidebar_base.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {Component} from 'react'; import PropTypes from 'prop-types'; +import React, {Component} from 'react'; import { Dimensions, Platform, diff --git a/app/components/sidebars/main/teams_list/index.js b/app/components/sidebars/main/teams_list/index.js index c28f647e1..1b21268c7 100644 --- a/app/components/sidebars/main/teams_list/index.js +++ b/app/components/sidebars/main/teams_list/index.js @@ -1,14 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; -import {getCurrentTeamId, getMySortedTeamIds, getJoinableTeamIds} from '@mm-redux/selectors/entities/teams'; +import {handleTeamChange} from '@actions/views/select_team'; import {getTheme} from '@mm-redux/selectors/entities/preferences'; - -import {handleTeamChange} from 'app/actions/views/select_team'; -import {getCurrentLocale} from 'app/selectors/i18n'; +import {getCurrentTeamId, getMySortedTeamIds, getJoinableTeamIds} from '@mm-redux/selectors/entities/teams'; +import {getCurrentLocale} from '@selectors/i18n'; import TeamsList from './teams_list'; diff --git a/app/components/sidebars/main/teams_list/teams_list.js b/app/components/sidebars/main/teams_list/teams_list.js index e607949f4..54970e0c4 100644 --- a/app/components/sidebars/main/teams_list/teams_list.js +++ b/app/components/sidebars/main/teams_list/teams_list.js @@ -1,8 +1,9 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; +import {intlShape} from 'react-intl'; import { Dimensions, FlatList, @@ -12,7 +13,6 @@ import { TouchableHighlight, View, } from 'react-native'; -import {intlShape} from 'react-intl'; import {SafeAreaView} from 'react-native-safe-area-context'; import {showModal} from '@actions/navigation'; diff --git a/app/components/sidebars/main/teams_list/teams_list_item/teams_list_item.js b/app/components/sidebars/main/teams_list/teams_list_item/teams_list_item.js index 3adae01f7..e16ef25ab 100644 --- a/app/components/sidebars/main/teams_list/teams_list_item/teams_list_item.js +++ b/app/components/sidebars/main/teams_list/teams_list_item/teams_list_item.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import PropTypes from 'prop-types'; +import React from 'react'; import { Text, TouchableHighlight, diff --git a/app/components/sidebars/main/teams_list/teams_list_item/teams_list_item.test.js b/app/components/sidebars/main/teams_list/teams_list_item/teams_list_item.test.js index 3a46b00b1..91582f20b 100644 --- a/app/components/sidebars/main/teams_list/teams_list_item/teams_list_item.test.js +++ b/app/components/sidebars/main/teams_list/teams_list_item/teams_list_item.test.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import Preferences from '@mm-redux/constants/preferences'; diff --git a/app/components/sidebars/main/threads_entry/index.tsx b/app/components/sidebars/main/threads_entry/index.tsx index 5c2df8a92..c10bf4ddc 100644 --- a/app/components/sidebars/main/threads_entry/index.tsx +++ b/app/components/sidebars/main/threads_entry/index.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators, Dispatch} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators, Dispatch} from 'redux'; import {handleViewingGlobalThreadsScreen} from '@actions/views/threads'; import {getThreads} from '@mm-redux/actions/threads'; @@ -10,11 +10,12 @@ import {getTheme} from '@mm-redux/selectors/entities/preferences'; import {getCurrentTeamId} from '@mm-redux/selectors/entities/teams'; import {getTeamThreadCounts} from '@mm-redux/selectors/entities/threads'; import {getCurrentUserId} from '@mm-redux/selectors/entities/users'; -import type {GlobalState} from '@mm-redux/types/store'; import {getViewingGlobalThreads, getViewingGlobalThreadsUnread} from '@selectors/threads'; import ThreadsEntry from './threads_entry'; +import type {GlobalState} from '@mm-redux/types/store'; + function mapStateToProps(state: GlobalState) { const currentTeamId = getCurrentTeamId(state); return { diff --git a/app/components/sidebars/main/threads_entry/threads_entry.tsx b/app/components/sidebars/main/threads_entry/threads_entry.tsx index 073d8b296..b7b675ff0 100644 --- a/app/components/sidebars/main/threads_entry/threads_entry.tsx +++ b/app/components/sidebars/main/threads_entry/threads_entry.tsx @@ -2,22 +2,23 @@ // See LICENSE.txt for license information. import React, {useEffect} from 'react'; -import {TouchableHighlight, Text, View} from 'react-native'; import {injectIntl, intlShape} from 'react-intl'; +import {TouchableHighlight, Text, View} from 'react-native'; import Badge from '@components/badge'; import CompassIcon from '@components/compass_icon'; import {getStyleSheet} from '@components/sidebars/main/channels_list/channel_item/channel_item'; import {NavigationTypes} from '@constants'; +import EventEmitter from '@mm-redux/utils/event_emitter'; +import {makeStyleFromTheme} from '@mm-redux/utils/theme_utils'; +import {preventDoubleTap} from '@utils/tap'; +import {changeOpacity} from '@utils/theme'; + import type {Theme} from '@mm-redux/types/preferences'; import type {Team} from '@mm-redux/types/teams'; import type {ThreadsState} from '@mm-redux/types/threads'; import type {UserProfile} from '@mm-redux/types/users'; import type {$ID} from '@mm-redux/types/utilities'; -import EventEmitter from '@mm-redux/utils/event_emitter'; -import {makeStyleFromTheme} from '@mm-redux/utils/theme_utils'; -import {preventDoubleTap} from '@utils/tap'; -import {changeOpacity} from '@utils/theme'; type Props = { actions: { diff --git a/app/components/sidebars/settings/drawer_item.js b/app/components/sidebars/settings/drawer_item.js index ca1ab2b5c..b53bec716 100644 --- a/app/components/sidebars/settings/drawer_item.js +++ b/app/components/sidebars/settings/drawer_item.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import {TouchableOpacity, View} from 'react-native'; import CompassIcon from '@components/compass_icon'; diff --git a/app/components/sidebars/settings/drawer_item.test.js b/app/components/sidebars/settings/drawer_item.test.js index 6288a5ec1..05c70fbba 100644 --- a/app/components/sidebars/settings/drawer_item.test.js +++ b/app/components/sidebars/settings/drawer_item.test.js @@ -2,9 +2,9 @@ // See LICENSE.txt for license information. import React from 'react'; -import {shallowWithIntl} from 'test/intl-test-helper'; import Preferences from '@mm-redux/constants/preferences'; +import {shallowWithIntl} from '@test/intl-test-helper'; import DrawerItem from './drawer_item'; diff --git a/app/components/sidebars/settings/index.js b/app/components/sidebars/settings/index.js index 413520e16..65bd8fa17 100644 --- a/app/components/sidebars/settings/index.js +++ b/app/components/sidebars/settings/index.js @@ -1,17 +1,16 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; import {unsetCustomStatus} from '@actions/views/custom_status'; +import {logout} from '@actions/views/user'; import {setStatus} from '@mm-redux/actions/users'; import {getTheme} from '@mm-redux/selectors/entities/preferences'; import {getCurrentUser, getStatusForUserId} from '@mm-redux/selectors/entities/users'; import {isCustomStatusEnabled, isCustomStatusExpired, isCustomStatusExpirySupported, makeGetCustomStatus} from '@selectors/custom_status'; -import {logout} from 'app/actions/views/user'; - import SettingsSidebar from './settings_sidebar'; function makeMapStateToProps() { diff --git a/app/components/sidebars/settings/settings_sidebar.android.js b/app/components/sidebars/settings/settings_sidebar.android.js index dbc95f4aa..2f0561fe3 100644 --- a/app/components/sidebars/settings/settings_sidebar.android.js +++ b/app/components/sidebars/settings/settings_sidebar.android.js @@ -5,10 +5,10 @@ import React from 'react'; import {IntlProvider} from 'react-intl'; import {View} from 'react-native'; -import {closeSettingsSideMenu} from 'app/actions/navigation'; -import {getTranslations} from 'app/i18n'; -import {preventDoubleTap} from 'app/utils/tap'; -import {changeOpacity, makeStyleSheetFromTheme} from 'app/utils/theme'; +import {closeSettingsSideMenu} from '@actions/navigation'; +import {getTranslations} from '@i18n'; +import {preventDoubleTap} from '@utils/tap'; +import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; import SettingsSidebarBase from './settings_sidebar_base'; diff --git a/app/components/sidebars/settings/settings_sidebar.ios.js b/app/components/sidebars/settings/settings_sidebar.ios.js index 37f2532ee..7e23318f4 100644 --- a/app/components/sidebars/settings/settings_sidebar.ios.js +++ b/app/components/sidebars/settings/settings_sidebar.ios.js @@ -5,11 +5,10 @@ import React from 'react'; import {intlShape} from 'react-intl'; import {Dimensions, Keyboard, View} from 'react-native'; -import EventEmitter from '@mm-redux/utils/event_emitter'; - import SafeAreaView from '@components/safe_area_view'; import DrawerLayout, {DRAWER_INITIAL_OFFSET, TABLET_WIDTH} from '@components/sidebars/drawer_layout/index.tsx'; import {DeviceTypes, NavigationTypes} from '@constants'; +import EventEmitter from '@mm-redux/utils/event_emitter'; import {preventDoubleTap} from '@utils/tap'; import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; diff --git a/app/components/sidebars/settings/settings_sidebar.test.js b/app/components/sidebars/settings/settings_sidebar.test.js index 34caa7837..eaa210d32 100644 --- a/app/components/sidebars/settings/settings_sidebar.test.js +++ b/app/components/sidebars/settings/settings_sidebar.test.js @@ -2,12 +2,12 @@ // See LICENSE.txt for license information. import React from 'react'; -import {shallowWithIntl} from 'test/intl-test-helper'; import Preferences from '@mm-redux/constants/preferences'; +import {CustomStatusDuration} from '@mm-redux/types/users'; +import {shallowWithIntl} from '@test/intl-test-helper'; import SettingsSidebar from './settings_sidebar.ios'; -import {CustomStatusDuration} from '@mm-redux/types/users'; describe('SettingsSidebar', () => { const customStatus = { diff --git a/app/components/sidebars/settings/settings_sidebar_base.js b/app/components/sidebars/settings/settings_sidebar_base.js index d7c26719f..4212ad3c4 100644 --- a/app/components/sidebars/settings/settings_sidebar_base.js +++ b/app/components/sidebars/settings/settings_sidebar_base.js @@ -1,30 +1,29 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import {ScrollView, View} from 'react-native'; -import {General} from '@mm-redux/constants'; -import EventEmitter from '@mm-redux/utils/event_emitter'; - import {showModal, showModalOverCurrentContext, dismissModal} from '@actions/navigation'; import CompassIcon from '@components/compass_icon'; +import ClearButton from '@components/custom_status/clear_button'; import CustomStatusExpiry from '@components/custom_status/custom_status_expiry'; import CustomStatusText from '@components/custom_status/custom_status_text'; -import ClearButton from '@components/custom_status/clear_button'; import Emoji from '@components/emoji'; import FormattedText from '@components/formatted_text'; import UserStatus from '@components/user_status'; import {NavigationTypes, CustomStatus} from '@constants'; +import {General} from '@mm-redux/constants'; +import EventEmitter from '@mm-redux/utils/event_emitter'; import {t} from '@utils/i18n'; import {confirmOutOfOfficeDisabled} from '@utils/status'; import {preventDoubleTap} from '@utils/tap'; import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; import DrawerItem from './drawer_item'; -import UserInfo from './user_info'; import StatusLabel from './status_label'; +import UserInfo from './user_info'; export default class SettingsSidebarBase extends PureComponent { static propTypes = { diff --git a/app/components/sidebars/settings/status_label/status_label.js b/app/components/sidebars/settings/status_label/status_label.js index afe3b462d..51aed20aa 100644 --- a/app/components/sidebars/settings/status_label/status_label.js +++ b/app/components/sidebars/settings/status_label/status_label.js @@ -1,14 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; - -import {General} from '@mm-redux/constants'; +import React, {PureComponent} from 'react'; import FormattedText from '@components/formatted_text'; -import {changeOpacity, makeStyleSheetFromTheme} from 'app/utils/theme'; -import {t} from 'app/utils/i18n'; +import {General} from '@mm-redux/constants'; +import {t} from '@utils/i18n'; +import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; export default class UserInfo extends PureComponent { static propTypes = { diff --git a/app/components/sidebars/settings/user_info/user_info.js b/app/components/sidebars/settings/user_info/user_info.js index 20388bf7e..98d9e2d78 100644 --- a/app/components/sidebars/settings/user_info/user_info.js +++ b/app/components/sidebars/settings/user_info/user_info.js @@ -1,14 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import {Text, TouchableOpacity, View} from 'react-native'; -import {emptyFunction} from 'app/utils/general'; -import {changeOpacity, makeStyleSheetFromTheme} from 'app/utils/theme'; - -import ProfilePicture from 'app/components/profile_picture'; +import ProfilePicture from '@components/profile_picture'; +import {emptyFunction} from '@utils/general'; +import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; export default class UserInfo extends PureComponent { static propTypes = { diff --git a/app/components/slide_up_panel/index.js b/app/components/slide_up_panel/index.js index 1b035b12e..eeb8b0d02 100644 --- a/app/components/slide_up_panel/index.js +++ b/app/components/slide_up_panel/index.js @@ -3,7 +3,7 @@ import {connect} from 'react-redux'; -import {getDimensions} from 'app/selectors/device'; +import {getDimensions} from '@selectors/device'; import SlideUpPanel from './slide_up_panel'; diff --git a/app/components/slide_up_panel/slide_up_panel.js b/app/components/slide_up_panel/slide_up_panel.js index da935dbd2..fc7a66a24 100644 --- a/app/components/slide_up_panel/slide_up_panel.js +++ b/app/components/slide_up_panel/slide_up_panel.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import {Animated, Platform, StyleSheet, View, Easing} from 'react-native'; import { PanGestureHandler, @@ -11,10 +11,10 @@ import { TapGestureHandler, } from 'react-native-gesture-handler'; -import {DeviceTypes} from 'app/constants'; -import mattermostManaged from 'app/mattermost_managed'; -import {hapticFeedback} from 'app/utils/general'; -import {makeStyleSheetFromTheme} from 'app/utils/theme'; +import {DeviceTypes} from '@constants'; +import mattermostManaged from '@mattermost-managed'; +import {hapticFeedback} from '@utils/general'; +import {makeStyleSheetFromTheme} from '@utils/theme'; import SlideUpPanelIndicator from './slide_up_panel_indicator'; diff --git a/app/components/slide_up_panel/slide_up_panel_indicator.test.js b/app/components/slide_up_panel/slide_up_panel_indicator.test.js index 29f7ce1e0..cf410f256 100644 --- a/app/components/slide_up_panel/slide_up_panel_indicator.test.js +++ b/app/components/slide_up_panel/slide_up_panel_indicator.test.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import SlideUpPanelIndicator from './slide_up_panel_indicator'; diff --git a/app/components/status_bar/status_bar.js b/app/components/status_bar/status_bar.js index e06f0a6cf..d6153b0cb 100644 --- a/app/components/status_bar/status_bar.js +++ b/app/components/status_bar/status_bar.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import { Platform, StatusBar as NativeStatusBar, diff --git a/app/components/swiper.js b/app/components/swiper.js index 57cef0d5a..e2e4909fc 100644 --- a/app/components/swiper.js +++ b/app/components/swiper.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import { Dimensions, InteractionManager, @@ -12,8 +12,8 @@ import { View, } from 'react-native'; -import {DeviceTypes, ViewTypes} from 'app/constants'; -import mattermostManaged from 'app/mattermost_managed'; +import {DeviceTypes, ViewTypes} from '@constants'; +import mattermostManaged from '@mattermost-managed'; export default class Swiper extends PureComponent { static propTypes = { diff --git a/app/components/swiper.test.js b/app/components/swiper.test.js index 0e44baa9b..910729388 100644 --- a/app/components/swiper.test.js +++ b/app/components/swiper.test.js @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import Swiper from './swiper.js'; diff --git a/app/components/tag.js b/app/components/tag.js index 84b2edf77..b48739263 100644 --- a/app/components/tag.js +++ b/app/components/tag.js @@ -1,13 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import PropTypes from 'prop-types'; import React, {PureComponent} from 'react'; import {View, ViewPropTypes} from 'react-native'; -import PropTypes from 'prop-types'; import FormattedText from '@components/formatted_text'; -import {changeOpacity, makeStyleSheetFromTheme} from 'app/utils/theme'; -import {t} from 'app/utils/i18n'; +import {t} from '@utils/i18n'; +import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; export function BotTag(props) { const id = t('post_info.bot'); diff --git a/app/components/team_icon/index.js b/app/components/team_icon/index.js index 3fe01c1f5..a49f5ffa0 100644 --- a/app/components/team_icon/index.js +++ b/app/components/team_icon/index.js @@ -3,8 +3,8 @@ import {connect} from 'react-redux'; -import {getTeam} from '@mm-redux/selectors/entities/teams'; import {getTheme} from '@mm-redux/selectors/entities/preferences'; +import {getTeam} from '@mm-redux/selectors/entities/teams'; import TeamIcon from './team_icon'; diff --git a/app/components/team_icon/team_icon.js b/app/components/team_icon/team_icon.js index 569ec1497..b86ecefa1 100644 --- a/app/components/team_icon/team_icon.js +++ b/app/components/team_icon/team_icon.js @@ -1,14 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import PropTypes from 'prop-types'; +import React from 'react'; import {Text, View} from 'react-native'; import FastImage from 'react-native-fast-image'; import {Client4} from '@client/rest'; - -import {makeStyleSheetFromTheme} from 'app/utils/theme'; +import {makeStyleSheetFromTheme} from '@utils/theme'; export default class TeamIcon extends React.PureComponent { static propTypes = { diff --git a/app/components/team_icon/team_icon.test.js b/app/components/team_icon/team_icon.test.js index 4c93fffae..ca564ec56 100644 --- a/app/components/team_icon/team_icon.test.js +++ b/app/components/team_icon/team_icon.test.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import Preferences from '@mm-redux/constants/preferences'; diff --git a/app/components/text_input_with_localized_placeholder.js b/app/components/text_input_with_localized_placeholder.js index 20835da06..6a760ae5c 100644 --- a/app/components/text_input_with_localized_placeholder.js +++ b/app/components/text_input_with_localized_placeholder.js @@ -1,12 +1,12 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import {intlShape} from 'react-intl'; import {TextInput} from 'react-native'; -import {changeOpacity} from 'app/utils/theme'; +import {changeOpacity} from '@utils/theme'; export default class TextInputWithLocalizedPlaceholder extends PureComponent { static propTypes = { diff --git a/app/components/touchable_with_feedback/touchable_with_feedback.android.js b/app/components/touchable_with_feedback/touchable_with_feedback.android.js index 0532ea27c..540dde7ee 100644 --- a/app/components/touchable_with_feedback/touchable_with_feedback.android.js +++ b/app/components/touchable_with_feedback/touchable_with_feedback.android.js @@ -3,9 +3,9 @@ /* eslint-disable new-cap */ +import PropTypes from 'prop-types'; import React, {PureComponent} from 'react'; import {TouchableNativeFeedback, TouchableOpacity, TouchableWithoutFeedback, View} from 'react-native'; -import PropTypes from 'prop-types'; export default class TouchableWithFeedbackAndroid extends PureComponent { static propTypes = { diff --git a/app/components/touchable_with_feedback/touchable_with_feedback.ios.js b/app/components/touchable_with_feedback/touchable_with_feedback.ios.js index fb1f1f1cd..54076df2e 100644 --- a/app/components/touchable_with_feedback/touchable_with_feedback.ios.js +++ b/app/components/touchable_with_feedback/touchable_with_feedback.ios.js @@ -1,9 +1,9 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import PropTypes from 'prop-types'; import React, {PureComponent} from 'react'; import {PanResponder, TouchableHighlight, TouchableOpacity, TouchableWithoutFeedback, View} from 'react-native'; -import PropTypes from 'prop-types'; export default class TouchableWithFeedbackIOS extends PureComponent { static propTypes = { diff --git a/app/components/user_status/user_status.test.js b/app/components/user_status/user_status.test.js index 7bb8fdcba..5de12e3ff 100644 --- a/app/components/user_status/user_status.test.js +++ b/app/components/user_status/user_status.test.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import {General} from '@mm-redux/constants'; import Preferences from '@mm-redux/constants/preferences'; diff --git a/app/components/widgets/settings/bool_setting.test.tsx b/app/components/widgets/settings/bool_setting.test.tsx index 54f184ea3..3df234b79 100644 --- a/app/components/widgets/settings/bool_setting.test.tsx +++ b/app/components/widgets/settings/bool_setting.test.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import {shallow} from 'enzyme'; import React from 'react'; import {Switch} from 'react-native'; -import {shallow} from 'enzyme'; import Preferences from '@mm-redux/constants/preferences'; diff --git a/app/components/widgets/settings/bool_setting.tsx b/app/components/widgets/settings/bool_setting.tsx index 937428994..d19115e6b 100644 --- a/app/components/widgets/settings/bool_setting.tsx +++ b/app/components/widgets/settings/bool_setting.tsx @@ -10,16 +10,16 @@ import { import FormattedText from '@components/formatted_text'; import Markdown from '@components/markdown'; +import {Theme} from '@mm-redux/types/preferences'; import {getMarkdownBlockStyles, getMarkdownTextStyles} from '@utils/markdown'; import { changeOpacity, makeStyleSheetFromTheme, } from '@utils/theme'; -import {Theme} from '@mm-redux/types/preferences'; type Props = { id: string; - label?: string | {id: string, defaultMessage: string}; + label?: string | {id: string; defaultMessage: string}; value: boolean; placeholder?: string; helpText?: string; diff --git a/app/components/widgets/settings/radio_setting.js b/app/components/widgets/settings/radio_setting.js index 0a04d5d29..b81d9a2f9 100644 --- a/app/components/widgets/settings/radio_setting.js +++ b/app/components/widgets/settings/radio_setting.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import {Text, TouchableOpacity, View} from 'react-native'; import CompassIcon from '@components/compass_icon'; diff --git a/app/components/widgets/settings/radio_setting.test.js b/app/components/widgets/settings/radio_setting.test.js index f59426236..edda95efb 100644 --- a/app/components/widgets/settings/radio_setting.test.js +++ b/app/components/widgets/settings/radio_setting.test.js @@ -1,12 +1,12 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import {shallow} from 'enzyme'; import React from 'react'; import {TouchableOpacity} from 'react-native'; -import {shallow} from 'enzyme'; - -import Preferences from '@mm-redux/constants/preferences'; import CompassIcon from '@components/compass_icon'; +import Preferences from '@mm-redux/constants/preferences'; + import RadioSetting from './radio_setting.js'; describe('components/widgets/settings/RadioSetting', () => { diff --git a/app/components/widgets/settings/text_setting.js b/app/components/widgets/settings/text_setting.js index 228e8780c..e0fb72575 100644 --- a/app/components/widgets/settings/text_setting.js +++ b/app/components/widgets/settings/text_setting.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import { View, Text, diff --git a/app/components/widgets/settings/text_setting.test.js b/app/components/widgets/settings/text_setting.test.js index dac702911..fdf3a5d67 100644 --- a/app/components/widgets/settings/text_setting.test.js +++ b/app/components/widgets/settings/text_setting.test.js @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import Preferences from '@mm-redux/constants/preferences'; diff --git a/app/constants/device.js b/app/constants/device.js index 31e58b66c..37831ad0a 100644 --- a/app/constants/device.js +++ b/app/constants/device.js @@ -4,6 +4,7 @@ import {Platform} from 'react-native'; import DeviceInfo from 'react-native-device-info'; import RNFetchBlobFS from 'rn-fetch-blob/fs'; + import keyMirror from '@mm-redux/utils/key_mirror'; const deviceTypes = keyMirror({ diff --git a/app/hooks/permanent_sidebar.ts b/app/hooks/permanent_sidebar.ts index 564b1c3d3..95653db38 100644 --- a/app/hooks/permanent_sidebar.ts +++ b/app/hooks/permanent_sidebar.ts @@ -2,12 +2,13 @@ // See LICENSE.txt for license information. import AsyncStorage from '@react-native-community/async-storage'; + import {useEffect, useState} from 'react'; import {useWindowDimensions} from 'react-native'; import {DeviceTypes} from '@constants'; +import mattermostManaged from '@mattermost-managed'; import EventEmitter from '@mm-redux/utils/event_emitter'; -import mattermostManaged from 'app/mattermost_managed'; export function usePermanentSidebar() { const [permanentSidebar, setPermanentSidebar] = useState(DeviceTypes.IS_TABLET); diff --git a/app/hooks/reset_native_scrollview.ts b/app/hooks/reset_native_scrollview.ts index eb1ec0ae8..9c359cdbe 100644 --- a/app/hooks/reset_native_scrollview.ts +++ b/app/hooks/reset_native_scrollview.ts @@ -2,6 +2,7 @@ // See LICENSE.txt for license information. import {useEffect, useRef} from 'react'; + import {UPDATE_NATIVE_SCROLLVIEW} from '@constants/post_draft'; import EventEmitter from '@mm-redux/utils/event_emitter'; diff --git a/app/i18n/index.js b/app/i18n/index.js index a8dc98435..34e9177fa 100644 --- a/app/i18n/index.js +++ b/app/i18n/index.js @@ -2,9 +2,9 @@ // See LICENSE.txt for license information. import 'intl'; +import moment from 'moment'; import {addLocaleData} from 'react-intl'; import enLocaleData from 'react-intl/locale-data/en'; -import moment from 'moment'; import en from '@assets/i18n/en.json'; diff --git a/app/init/analytics.ts b/app/init/analytics.ts index 065d23959..202bc24aa 100644 --- a/app/init/analytics.ts +++ b/app/init/analytics.ts @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import DeviceInfo from 'react-native-device-info'; import {Dimensions} from 'react-native'; +import DeviceInfo from 'react-native-device-info'; import LocalConfig from '@assets/config.json'; import {Config} from '@mm-redux/types/config'; diff --git a/app/init/credentials.js b/app/init/credentials.js index 493488d81..bbdc0d0c6 100644 --- a/app/init/credentials.js +++ b/app/init/credentials.js @@ -2,14 +2,14 @@ // See LICENSE.txt for license information. import AsyncStorage from '@react-native-community/async-storage'; + import * as KeyChain from 'react-native-keychain'; import {Client4} from '@client/rest'; - -import mattermostManaged from 'app/mattermost_managed'; -import EphemeralStore from 'app/store/ephemeral_store'; -import {setCSRFFromCookie} from 'app/utils/security'; import {analytics} from '@init/analytics.ts'; +import mattermostManaged from '@mattermost-managed'; +import EphemeralStore from '@store/ephemeral_store'; +import {setCSRFFromCookie} from '@utils/security'; const CURRENT_SERVER = '@currentServerUrl'; diff --git a/app/init/device.ts b/app/init/device.ts index d08d9c3e6..9c410ced8 100644 --- a/app/init/device.ts +++ b/app/init/device.ts @@ -2,7 +2,8 @@ // See LICENSE.txt for license information. import AsyncStorage from '@react-native-community/async-storage'; -import {DeviceTypes} from 'app/constants'; + +import {DeviceTypes} from '@constants'; export async function setupPermanentSidebar() { if (DeviceTypes.IS_TABLET) { diff --git a/app/init/emm_provider.js b/app/init/emm_provider.js index 569798775..089693885 100644 --- a/app/init/emm_provider.js +++ b/app/init/emm_provider.js @@ -6,12 +6,12 @@ import {Alert, Platform} from 'react-native'; import {setServerUrl} from '@actions/views/select_server'; import LocalConfig from '@assets/config'; import {getTranslations} from '@i18n'; +import mattermostManaged from '@mattermost-managed'; import {getCurrentLocale} from '@selectors/i18n'; import Store from '@store/store'; import {t} from '@utils/i18n'; import mattermostBucket from 'app/mattermost_bucket'; -import mattermostManaged from 'app/mattermost_managed'; import {getAppCredentials} from './credentials'; diff --git a/app/init/fetch.js b/app/init/fetch.js index 822d8daeb..adbe9ba3a 100644 --- a/app/init/fetch.js +++ b/app/init/fetch.js @@ -10,12 +10,12 @@ import LocalConfig from '@assets/config'; import {Client4} from '@client/rest'; import {HEADER_TOKEN, HEADER_X_CLUSTER_ID, HEADER_X_VERSION_ID} from '@client/rest/constants'; import ClientError from '@client/rest/error'; -import EventEmitter from '@mm-redux/utils/event_emitter'; +import mattermostManaged from '@mattermost-managed'; import {General} from '@mm-redux/constants'; +import EventEmitter from '@mm-redux/utils/event_emitter'; import {t} from '@utils/i18n'; import mattermostBucket from 'app/mattermost_bucket'; -import mattermostManaged from 'app/mattermost_managed'; /* eslint-disable no-throw-literal */ diff --git a/app/init/fetch.test.js b/app/init/fetch.test.js index 0f26e460b..8991cbe16 100644 --- a/app/init/fetch.test.js +++ b/app/init/fetch.test.js @@ -4,8 +4,8 @@ import '@init/fetch'; import {Client4} from '@client/rest'; import {HEADER_X_CLUSTER_ID, HEADER_X_VERSION_ID, HEADER_TOKEN} from '@client/rest/constants'; -import EventEmitter from '@mm-redux/utils/event_emitter'; import {General} from '@mm-redux/constants'; +import EventEmitter from '@mm-redux/utils/event_emitter'; describe('Fetch', () => { beforeAll(() => { diff --git a/app/init/global_event_handler.js b/app/init/global_event_handler.js index dbae03307..9dff47f5f 100644 --- a/app/init/global_event_handler.js +++ b/app/init/global_event_handler.js @@ -1,9 +1,10 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {AppState, Dimensions, Keyboard, Linking, Platform} from 'react-native'; import AsyncStorage from '@react-native-community/async-storage'; import CookieManager from '@react-native-cookies/cookies'; + +import {AppState, Dimensions, Keyboard, Linking, Platform} from 'react-native'; import DeviceInfo from 'react-native-device-info'; import {getLocales} from 'react-native-localize'; @@ -12,35 +13,35 @@ import {dismissAllModals, popToRoot, showOverlay} from '@actions/navigation'; import {selectDefaultChannel} from '@actions/views/channel'; import {loadConfigAndLicense, purgeOfflineStore, setDeepLinkURL, startDataCleanup} from '@actions/views/root'; import {loadMe, logout} from '@actions/views/user'; +import {close as closeWebSocket} from '@actions/websocket'; import LocalConfig from '@assets/config'; +import {Client4} from '@client/rest'; import {NavigationTypes, ViewTypes} from '@constants'; import {resetMomentLocale} from '@i18n'; +import {analytics} from '@init/analytics.ts'; import {setupPermanentSidebar} from '@init/device'; import PushNotifications from '@init/push_notifications'; +import mattermostManaged from '@mattermost-managed'; import {setAppState, setServerVersion} from '@mm-redux/actions/general'; import {getTeams} from '@mm-redux/actions/teams'; import {autoUpdateTimezone} from '@mm-redux/actions/timezone'; -import {close as closeWebSocket} from '@actions/websocket'; -import {Client4} from '@client/rest'; import {General} from '@mm-redux/constants'; -import {getConfig} from '@mm-redux/selectors/entities/general'; import {getCurrentChannelId} from '@mm-redux/selectors/entities/channels'; -import {getCurrentUser, getUser} from '@mm-redux/selectors/entities/users'; +import {getConfig} from '@mm-redux/selectors/entities/general'; import {isTimezoneEnabled} from '@mm-redux/selectors/entities/timezone'; +import {getCurrentUser, getUser} from '@mm-redux/selectors/entities/users'; import EventEmitter from '@mm-redux/utils/event_emitter'; import {isMinimumServerVersion} from '@mm-redux/utils/helpers'; -import initialState from '@store/initial_state'; import EphemeralStore from '@store/ephemeral_store'; +import initialState from '@store/initial_state'; import Store from '@store/store'; import {deleteFileCache} from '@utils/file'; import {getDeviceTimezone} from '@utils/timezone'; import mattermostBucket from 'app/mattermost_bucket'; -import mattermostManaged from 'app/mattermost_managed'; import {getAppCredentials, removeAppCredentials} from './credentials'; import emmProvider from './emm_provider'; -import {analytics} from '@init/analytics.ts'; const PROMPT_IN_APP_PIN_CODE_AFTER = 5 * 1000; diff --git a/app/init/global_event_handler.test.js b/app/init/global_event_handler.test.js index ebde1b77d..746cdf993 100644 --- a/app/init/global_event_handler.test.js +++ b/app/init/global_event_handler.test.js @@ -8,8 +8,8 @@ import semver from 'semver/preload'; import * as I18n from '@i18n'; import PushNotification from '@init/push_notifications'; import EventEmitter from '@mm-redux/utils/event_emitter'; -import Store from '@store/store'; import intitialState from '@store/initial_state'; +import Store from '@store/store'; import mattermostBucket from 'app/mattermost_bucket'; diff --git a/app/mattermost.js b/app/mattermost.js index bc53b35e8..84bcc05de 100644 --- a/app/mattermost.js +++ b/app/mattermost.js @@ -5,18 +5,17 @@ import {Linking} from 'react-native'; import {Navigation} from 'react-native-navigation'; import {Provider} from 'react-redux'; -import EventEmitter from '@mm-redux/utils/event_emitter'; - import {resetToChannel, resetToSelectServer} from '@actions/navigation'; import {setDeepLinkURL} from '@actions/views/root'; import {loadMe, logout} from '@actions/views/user'; import {NavigationTypes} from '@constants'; import {CHANNEL, THREAD} from '@constants/screen'; import {getAppCredentials} from '@init/credentials'; -import emmProvider from '@init/emm_provider'; import {setupPermanentSidebar} from '@init/device'; +import emmProvider from '@init/emm_provider'; import '@init/fetch'; import globalEventHandler from '@init/global_event_handler'; +import EventEmitter from '@mm-redux/utils/event_emitter'; import {registerScreens} from '@screens'; import configureStore from '@store'; import EphemeralStore from '@store/ephemeral_store'; diff --git a/app/mattermost.test.js b/app/mattermost.test.js index 604df3c60..f03fa2344 100644 --- a/app/mattermost.test.js +++ b/app/mattermost.test.js @@ -1,10 +1,9 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import EventEmitter from '@mm-redux/utils/event_emitter'; - -import EphemeralStore from '@store/ephemeral_store'; import {NavigationTypes} from '@constants'; +import EventEmitter from '@mm-redux/utils/event_emitter'; +import EphemeralStore from '@store/ephemeral_store'; import { componentDidAppearListener, diff --git a/app/mattermost_managed/mattermost-managed.android.js b/app/mattermost_managed/mattermost-managed.android.js index acc5fcca2..5aeda7fac 100644 --- a/app/mattermost_managed/mattermost-managed.android.js +++ b/app/mattermost_managed/mattermost-managed.android.js @@ -3,7 +3,7 @@ import {NativeModules, DeviceEventEmitter} from 'react-native'; -import {emptyFunction} from 'app/utils/general'; +import {emptyFunction} from '@utils/general'; const {MattermostManaged} = NativeModules; diff --git a/app/mattermost_managed/mattermost-managed.ios.js b/app/mattermost_managed/mattermost-managed.ios.js index b27fea6da..25e0108cd 100644 --- a/app/mattermost_managed/mattermost-managed.ios.js +++ b/app/mattermost_managed/mattermost-managed.ios.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import JailMonkey from 'jail-monkey'; import {NativeModules, NativeEventEmitter} from 'react-native'; import LocalAuth from 'react-native-local-auth'; -import JailMonkey from 'jail-monkey'; const {BlurAppScreen, MattermostManaged} = NativeModules; const mattermostManagedEmitter = new NativeEventEmitter(MattermostManaged); diff --git a/app/mm-redux/action_types/index.ts b/app/mm-redux/action_types/index.ts index c5e304203..3e5856ceb 100644 --- a/app/mm-redux/action_types/index.ts +++ b/app/mm-redux/action_types/index.ts @@ -1,26 +1,26 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import ChannelTypes from './channels'; -import ErrorTypes from './errors'; -import GeneralTypes from './general'; -import UserTypes from './users'; -import TeamTypes from './teams'; -import PostTypes from './posts'; -import FileTypes from './files'; -import PreferenceTypes from './preferences'; -import IntegrationTypes from './integrations'; -import EmojiTypes from './emojis'; -import GifTypes from './gifs'; -import SearchTypes from './search'; -import RoleTypes from './roles'; -import GroupTypes from './groups'; -import BotTypes from './bots'; -import PluginTypes from './plugins'; -import ChannelCategoryTypes from './channel_categories'; -import ThreadTypes from './threads'; -import RemoteClusterTypes from './remote_cluster'; import AppsTypes from './apps'; +import BotTypes from './bots'; +import ChannelCategoryTypes from './channel_categories'; +import ChannelTypes from './channels'; +import EmojiTypes from './emojis'; +import ErrorTypes from './errors'; +import FileTypes from './files'; +import GeneralTypes from './general'; +import GifTypes from './gifs'; +import GroupTypes from './groups'; +import IntegrationTypes from './integrations'; +import PluginTypes from './plugins'; +import PostTypes from './posts'; +import PreferenceTypes from './preferences'; +import RemoteClusterTypes from './remote_cluster'; +import RoleTypes from './roles'; +import SearchTypes from './search'; +import TeamTypes from './teams'; +import ThreadTypes from './threads'; +import UserTypes from './users'; export { ErrorTypes, diff --git a/app/mm-redux/actions/apps.ts b/app/mm-redux/actions/apps.ts index 6bda27950..adedb5006 100644 --- a/app/mm-redux/actions/apps.ts +++ b/app/mm-redux/actions/apps.ts @@ -1,11 +1,10 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {AppsTypes} from '@mm-redux/action_types'; import {Client4} from '@client/rest'; - -import {ActionFunc, DispatchFunc, GetStateFunc} from '@mm-redux/types/actions'; +import {AppsTypes} from '@mm-redux/action_types'; import {getChannel} from '@mm-redux/selectors/entities/channels'; +import {ActionFunc, DispatchFunc, GetStateFunc} from '@mm-redux/types/actions'; import {bindClientFunc} from './helpers'; diff --git a/app/mm-redux/actions/bots.test.js b/app/mm-redux/actions/bots.test.js index d672a4357..3c757d2a6 100644 --- a/app/mm-redux/actions/bots.test.js +++ b/app/mm-redux/actions/bots.test.js @@ -2,13 +2,13 @@ // See LICENSE.txt for license information. import assert from 'assert'; + import nock from 'nock'; -import * as BotActions from '@mm-redux/actions/bots'; import {Client4} from '@client/rest'; - -import TestHelper from 'test/test_helper'; -import configureStore from 'test/test_store'; +import * as BotActions from '@mm-redux/actions/bots'; +import TestHelper from '@test/test_helper'; +import configureStore from '@test/test_store'; describe('Actions.Bots', () => { let store; diff --git a/app/mm-redux/actions/bots.ts b/app/mm-redux/actions/bots.ts index 673b875b1..9fdb55df9 100644 --- a/app/mm-redux/actions/bots.ts +++ b/app/mm-redux/actions/bots.ts @@ -3,10 +3,10 @@ import {Client4} from '@client/rest'; import {BotTypes} from '@mm-redux/action_types'; -import {bindClientFunc} from './helpers'; - import {ActionFunc} from '@mm-redux/types/actions'; +import {bindClientFunc} from './helpers'; + const BOTS_PER_PAGE_DEFAULT = 20; export function loadBot(botUserId: string): ActionFunc { diff --git a/app/mm-redux/actions/channels.test.js b/app/mm-redux/actions/channels.test.js index 244268e7a..f46c4daf6 100644 --- a/app/mm-redux/actions/channels.test.js +++ b/app/mm-redux/actions/channels.test.js @@ -2,15 +2,17 @@ // See LICENSE.txt for license information. import assert from 'assert'; + import nock from 'nock'; +import {Client4} from '@client/rest'; import * as Actions from '@mm-redux/actions/channels'; import {getProfilesByIds, login} from '@mm-redux/actions/users'; -import {Client4} from '@client/rest'; -import {General, RequestStatus, Preferences} from '../constants'; import {getPreferenceKey} from '@mm-redux/utils/preference_utils'; -import TestHelper from 'test/test_helper'; -import configureStore from 'test/test_store'; +import TestHelper from '@test/test_helper'; +import configureStore from '@test/test_store'; + +import {General, RequestStatus, Preferences} from '../constants'; const OK_RESPONSE = {status: 'OK'}; diff --git a/app/mm-redux/actions/channels.ts b/app/mm-redux/actions/channels.ts index 662181aa5..c1abce177 100644 --- a/app/mm-redux/actions/channels.ts +++ b/app/mm-redux/actions/channels.ts @@ -1,28 +1,29 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. import {Client4} from '@client/rest'; -import {General, Preferences} from '../constants'; +import {analytics} from '@init/analytics'; import {ChannelTypes, PreferenceTypes, TeamTypes, UserTypes} from '@mm-redux/action_types'; -import {savePreferences, deletePreferences} from './preferences'; -import {compareNotifyProps, getChannelsIdForTeam, getChannelByName as selectChannelByName} from '@mm-redux/utils/channel_utils'; import { getChannelsNameMapInTeam, getMyChannelMember as getMyChannelMemberSelector, getRedirectChannelNameForTeam, isManuallyUnread, } from '@mm-redux/selectors/entities/channels'; -import {getCurrentTeamId} from '@mm-redux/selectors/entities/teams'; import {getConfig} from '@mm-redux/selectors/entities/general'; +import {getCurrentTeamId} from '@mm-redux/selectors/entities/teams'; import {Action, ActionFunc, batchActions, DispatchFunc, GetStateFunc} from '@mm-redux/types/actions'; import {Channel, ChannelNotifyProps, ChannelMembership} from '@mm-redux/types/channels'; import {PreferenceType} from '@mm-redux/types/preferences'; import {Dictionary} from '@mm-redux/types/utilities'; +import {compareNotifyProps, getChannelsIdForTeam, getChannelByName as selectChannelByName} from '@mm-redux/utils/channel_utils'; + +import {General, Preferences} from '../constants'; import {logError} from './errors'; import {bindClientFunc, forceLogoutIfNecessary} from './helpers'; -import {getMissingProfilesByIds} from './users'; +import {savePreferences, deletePreferences} from './preferences'; import {loadRolesIfNeeded} from './roles'; -import {analytics} from '@init/analytics'; +import {getMissingProfilesByIds} from './users'; export function selectChannel(channelId: string) { return { diff --git a/app/mm-redux/actions/emojis.test.js b/app/mm-redux/actions/emojis.test.js index 27646ae56..77a0a5747 100644 --- a/app/mm-redux/actions/emojis.test.js +++ b/app/mm-redux/actions/emojis.test.js @@ -1,16 +1,16 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import fs from 'fs'; import assert from 'assert'; +import fs from 'fs'; + import nock from 'nock'; -import * as Actions from '@mm-redux/actions/emojis'; import {Client4} from '@client/rest'; - import {GeneralTypes} from '@mm-redux/action_types'; -import TestHelper from 'test/test_helper'; -import configureStore from 'test/test_store'; +import * as Actions from '@mm-redux/actions/emojis'; +import TestHelper from '@test/test_helper'; +import configureStore from '@test/test_store'; const OK_RESPONSE = {status: 'OK'}; diff --git a/app/mm-redux/actions/emojis.ts b/app/mm-redux/actions/emojis.ts index aa2f81d1a..f15aaf046 100644 --- a/app/mm-redux/actions/emojis.ts +++ b/app/mm-redux/actions/emojis.ts @@ -2,17 +2,17 @@ // See LICENSE.txt for license information. import {Client4} from '@client/rest'; import {EmojiTypes} from '@mm-redux/action_types'; -import {General, Emoji} from '../constants'; -import {getProfilesByIds} from './users'; import {getCustomEmojisByName as selectCustomEmojisByName} from '@mm-redux/selectors/entities/emojis'; +import {GetStateFunc, DispatchFunc, ActionFunc, ActionResult} from '@mm-redux/types/actions'; +import {CustomEmoji} from '@mm-redux/types/emojis'; +import {Dictionary} from '@mm-redux/types/utilities'; import {parseNeededCustomEmojisFromText} from '@mm-redux/utils/emoji_utils'; -import {GetStateFunc, DispatchFunc, ActionFunc, ActionResult} from '@mm-redux/types/actions'; +import {General, Emoji} from '../constants'; import {logError} from './errors'; import {bindClientFunc, forceLogoutIfNecessary} from './helpers'; -import {CustomEmoji} from '@mm-redux/types/emojis'; -import {Dictionary} from '@mm-redux/types/utilities'; +import {getProfilesByIds} from './users'; export function createCustomEmoji(emoji: any, image: any): ActionFunc { return bindClientFunc({ diff --git a/app/mm-redux/actions/errors.test.js b/app/mm-redux/actions/errors.test.js index 6613d0c29..b64daa7ce 100644 --- a/app/mm-redux/actions/errors.test.js +++ b/app/mm-redux/actions/errors.test.js @@ -2,13 +2,13 @@ // See LICENSE.txt for license information. import assert from 'assert'; + import nock from 'nock'; -import {logError} from '@mm-redux/actions/errors'; import {Client4} from '@client/rest'; - -import TestHelper from 'test/test_helper'; -import configureStore from 'test/test_store'; +import {logError} from '@mm-redux/actions/errors'; +import TestHelper from '@test/test_helper'; +import configureStore from '@test/test_store'; describe('Actions.Errors', () => { let store; diff --git a/app/mm-redux/actions/errors.ts b/app/mm-redux/actions/errors.ts index 714415956..430c8e6b2 100644 --- a/app/mm-redux/actions/errors.ts +++ b/app/mm-redux/actions/errors.ts @@ -1,11 +1,12 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {ErrorTypes} from '@mm-redux/action_types'; import {serializeError, ErrorObject} from 'serialize-error'; + import {Client4} from '@client/rest'; -import EventEmitter from '@mm-redux/utils/event_emitter'; +import {ErrorTypes} from '@mm-redux/action_types'; import {DispatchFunc, ActionFunc} from '@mm-redux/types/actions'; import {Error} from '@mm-redux/types/errors'; +import EventEmitter from '@mm-redux/utils/event_emitter'; export function dismissErrorObject(index: number) { return { type: ErrorTypes.DISMISS_ERROR, diff --git a/app/mm-redux/actions/files.test.js b/app/mm-redux/actions/files.test.js index bc2ac0085..a73c4d993 100644 --- a/app/mm-redux/actions/files.test.js +++ b/app/mm-redux/actions/files.test.js @@ -2,12 +2,13 @@ // See LICENSE.txt for license information. import assert from 'assert'; + import nock from 'nock'; -import * as Actions from '@mm-redux/actions/files'; import {Client4} from '@client/rest'; -import TestHelper from 'test/test_helper'; -import configureStore from 'test/test_store'; +import * as Actions from '@mm-redux/actions/files'; +import TestHelper from '@test/test_helper'; +import configureStore from '@test/test_store'; describe('Actions.Files', () => { let store; diff --git a/app/mm-redux/actions/files.ts b/app/mm-redux/actions/files.ts index 14d2d12f5..f0942da7e 100644 --- a/app/mm-redux/actions/files.ts +++ b/app/mm-redux/actions/files.ts @@ -2,7 +2,6 @@ // See LICENSE.txt for license information. import {Client4} from '@client/rest'; import {FileTypes} from '@mm-redux/action_types'; - import {DispatchFunc, GetStateFunc, ActionFunc} from '@mm-redux/types/actions'; import {logError} from './errors'; diff --git a/app/mm-redux/actions/general.test.js b/app/mm-redux/actions/general.test.js index c5be5b769..558e85697 100644 --- a/app/mm-redux/actions/general.test.js +++ b/app/mm-redux/actions/general.test.js @@ -2,16 +2,17 @@ // See LICENSE.txt for license information. import assert from 'assert'; + import nock from 'nock'; -import {FormattedError} from './helpers.ts'; -import {GeneralTypes} from '@mm-redux/action_types'; -import * as Actions from '@mm-redux/actions/general'; import {Client4} from '@client/rest'; import {PER_PAGE_DEFAULT} from '@client/rest/constants'; +import {GeneralTypes} from '@mm-redux/action_types'; +import * as Actions from '@mm-redux/actions/general'; +import TestHelper from '@test/test_helper'; +import configureStore from '@test/test_store'; -import TestHelper from 'test/test_helper'; -import configureStore from 'test/test_store'; +import {FormattedError} from './helpers.ts'; describe('Actions.General', () => { let store; diff --git a/app/mm-redux/actions/general.ts b/app/mm-redux/actions/general.ts index 082e39139..fa920adf0 100644 --- a/app/mm-redux/actions/general.ts +++ b/app/mm-redux/actions/general.ts @@ -1,20 +1,18 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. import {Client4} from '@client/rest'; - import {GeneralTypes} from '@mm-redux/action_types'; - import {getCurrentUserId} from '@mm-redux/selectors/entities/common'; import {getServerVersion} from '@mm-redux/selectors/entities/general'; -import {isMinimumServerVersion} from '@mm-redux/utils/helpers'; +import {GetStateFunc, DispatchFunc, ActionFunc, batchActions} from '@mm-redux/types/actions'; +import {logLevel} from '@mm-redux/types/client4'; import {TeamDataRetentionPolicy, ChannelDataRetentionPolicy} from '@mm-redux/types/data_retention'; import {GeneralState} from '@mm-redux/types/general'; -import {logLevel} from '@mm-redux/types/client4'; -import {GetStateFunc, DispatchFunc, ActionFunc, batchActions} from '@mm-redux/types/actions'; +import {isMinimumServerVersion} from '@mm-redux/utils/helpers'; import {logError} from './errors'; -import {loadRolesIfNeeded} from './roles'; import {bindClientFunc, forceLogoutIfNecessary, FormattedError} from './helpers'; +import {loadRolesIfNeeded} from './roles'; export function getPing(): ActionFunc { return async () => { diff --git a/app/mm-redux/actions/gifs.ts b/app/mm-redux/actions/gifs.ts index 8e40100c5..65d734e60 100644 --- a/app/mm-redux/actions/gifs.ts +++ b/app/mm-redux/actions/gifs.ts @@ -1,10 +1,10 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import {analytics} from '@init/analytics'; import {GifTypes} from '@mm-redux/action_types'; -import gfycatSdk from '@mm-redux/utils/gfycat_sdk'; import {DispatchFunc, GetStateFunc} from '@mm-redux/types/actions'; import {GlobalState} from '@mm-redux/types/store'; -import {analytics} from '@init/analytics'; +import gfycatSdk from '@mm-redux/utils/gfycat_sdk'; // APP PROPS diff --git a/app/mm-redux/actions/helpers.test.js b/app/mm-redux/actions/helpers.test.js index bc978a60a..2dbf90342 100644 --- a/app/mm-redux/actions/helpers.test.js +++ b/app/mm-redux/actions/helpers.test.js @@ -3,10 +3,10 @@ import assert from 'assert'; -import {forceLogoutIfNecessary} from '@mm-redux/actions/helpers'; import {Client4} from '@client/rest'; import ClientError from '@client/rest/error'; -import configureStore, {mockDispatch} from 'test/test_store'; +import {forceLogoutIfNecessary} from '@mm-redux/actions/helpers'; +import configureStore, {mockDispatch} from '@test/test_store'; describe('Actions.Helpers', () => { describe('forceLogoutIfNecessary', () => { diff --git a/app/mm-redux/actions/helpers.ts b/app/mm-redux/actions/helpers.ts index 514623122..cd48f0df0 100644 --- a/app/mm-redux/actions/helpers.ts +++ b/app/mm-redux/actions/helpers.ts @@ -2,11 +2,11 @@ // See LICENSE.txt for license information. import {logout} from '@actions/views/user'; -import {UserTypes} from '@mm-redux/action_types'; import {Client4} from '@client/rest'; -import {Client4Error} from '@mm-redux/types/client4'; +import {UserTypes} from '@mm-redux/action_types'; import {getCurrentUserId, getUsers} from '@mm-redux/selectors/entities/users'; import {batchActions, Action, ActionFunc, GenericAction, DispatchFunc, GetStateFunc} from '@mm-redux/types/actions'; +import {Client4Error} from '@mm-redux/types/client4'; import {GlobalState} from '@mm-redux/types/store'; import {isMinimumServerVersion} from '@mm-redux/utils/helpers'; diff --git a/app/mm-redux/actions/index.ts b/app/mm-redux/actions/index.ts index f62d99f42..d878a1103 100644 --- a/app/mm-redux/actions/index.ts +++ b/app/mm-redux/actions/index.ts @@ -3,8 +3,8 @@ import * as bots from './bots'; import * as channels from './channels'; -import * as errors from './errors'; import * as emojis from './emojis'; +import * as errors from './errors'; import * as files from './files'; import * as general from './general'; import * as gifs from './gifs'; @@ -12,12 +12,12 @@ import * as helpers from './helpers'; import * as integrations from './integrations'; import * as posts from './posts'; import * as preferences from './preferences'; +import * as remoteCluster from './remote_cluster'; import * as roles from './roles'; import * as search from './search'; import * as teams from './teams'; import * as timezone from './timezone'; import * as users from './users'; -import * as remoteCluster from './remote_cluster'; export { bots, diff --git a/app/mm-redux/actions/integrations.test.js b/app/mm-redux/actions/integrations.test.js index f5a092049..9c725e694 100644 --- a/app/mm-redux/actions/integrations.test.js +++ b/app/mm-redux/actions/integrations.test.js @@ -2,14 +2,14 @@ // See LICENSE.txt for license information. import assert from 'assert'; + import nock from 'nock'; +import {Client4} from '@client/rest'; import * as Actions from '@mm-redux/actions/integrations'; import * as TeamsActions from '@mm-redux/actions/teams'; -import {Client4} from '@client/rest'; - -import TestHelper from 'test/test_helper'; -import configureStore from 'test/test_store'; +import TestHelper from '@test/test_helper'; +import configureStore from '@test/test_store'; describe('Actions.Integrations', () => { let store; diff --git a/app/mm-redux/actions/integrations.ts b/app/mm-redux/actions/integrations.ts index 4abb59337..161d8b36e 100644 --- a/app/mm-redux/actions/integrations.ts +++ b/app/mm-redux/actions/integrations.ts @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {Alert} from 'react-native'; import {intlShape} from 'react-intl'; +import {Alert} from 'react-native'; import {handleSelectChannel, handleSelectChannelByName, loadChannelsByTeamName} from '@actions/views/channel'; import {makeDirectChannel} from '@actions/views/more_dms'; @@ -10,19 +10,18 @@ import {showPermalink} from '@actions/views/permalink'; import {Client4} from '@client/rest'; import {DeepLinkTypes} from '@constants'; import {analytics} from '@init/analytics'; -import {getUserByUsername} from '@mm-redux/actions/users'; import {IntegrationTypes} from '@mm-redux/action_types'; +import {getUserByUsername} from '@mm-redux/actions/users'; import {General} from '@mm-redux/constants'; import {getCurrentChannelId} from '@mm-redux/selectors/entities/channels'; import {getConfig, getCurrentUrl} from '@mm-redux/selectors/entities/general'; import {getCurrentTeamId} from '@mm-redux/selectors/entities/teams'; +import {batchActions, DispatchFunc, GetStateFunc, ActionFunc} from '@mm-redux/types/actions'; +import {Command, CommandArgs, DialogSubmission} from '@mm-redux/types/integrations'; import * as DraftUtils from '@utils/draft'; import {permalinkBadTeam} from '@utils/general'; import {getURLAndMatch, tryOpenURL} from '@utils/url'; -import {batchActions, DispatchFunc, GetStateFunc, ActionFunc} from '@mm-redux/types/actions'; -import {Command, CommandArgs, DialogSubmission} from '@mm-redux/types/integrations'; - import {logError} from './errors'; import {bindClientFunc, forceLogoutIfNecessary, requestSuccess, requestFailure} from './helpers'; import {makeGroupMessageVisibleIfNecessary} from './preferences'; diff --git a/app/mm-redux/actions/posts.test.js b/app/mm-redux/actions/posts.test.js index b4942f0af..27d03005a 100644 --- a/app/mm-redux/actions/posts.test.js +++ b/app/mm-redux/actions/posts.test.js @@ -2,20 +2,22 @@ // See LICENSE.txt for license information. /* eslint-disable max-lines */ -import fs from 'fs'; import assert from 'assert'; +import fs from 'fs'; + import nock from 'nock'; -import * as Actions from '@mm-redux/actions/posts'; -import {getChannelStats} from '@mm-redux/actions/channels'; -import {login} from '@mm-redux/actions/users'; -import {createCustomEmoji} from '@mm-redux/actions/emojis'; import {Client4} from '@client/rest'; -import {Preferences, Posts, RequestStatus} from '../constants'; import {ChannelTypes, PostTypes} from '@mm-redux/action_types'; -import TestHelper from 'test/test_helper'; -import configureStore from 'test/test_store'; +import {getChannelStats} from '@mm-redux/actions/channels'; +import {createCustomEmoji} from '@mm-redux/actions/emojis'; +import * as Actions from '@mm-redux/actions/posts'; +import {login} from '@mm-redux/actions/users'; import {getPreferenceKey} from '@mm-redux/utils/preference_utils'; +import TestHelper from '@test/test_helper'; +import configureStore from '@test/test_store'; + +import {Preferences, Posts, RequestStatus} from '../constants'; const OK_RESPONSE = {status: 'OK'}; diff --git a/app/mm-redux/actions/posts.ts b/app/mm-redux/actions/posts.ts index d26848da1..1430a1717 100644 --- a/app/mm-redux/actions/posts.ts +++ b/app/mm-redux/actions/posts.ts @@ -3,30 +3,36 @@ /* eslint-disable max-lines */ import {Client4} from '@client/rest'; -import {General, Preferences, Posts} from '@mm-redux/constants'; import {WebsocketEvents} from '@constants'; import {THREAD} from '@constants/screen'; -import {handleFollowChanged, updateThreadRead} from '@mm-redux/actions/threads'; +import {analytics} from '@init/analytics'; import {PostTypes, ChannelTypes, FileTypes, IntegrationTypes} from '@mm-redux/action_types'; - +import {handleFollowChanged, updateThreadRead} from '@mm-redux/actions/threads'; +import {General, Preferences, Posts} from '@mm-redux/constants'; import {getCurrentChannelId, getMyChannelMember as getMyChannelMemberSelector, isManuallyUnread} from '@mm-redux/selectors/entities/channels'; import {getCustomEmojisByName as selectCustomEmojisByName} from '@mm-redux/selectors/entities/emojis'; import {getConfig} from '@mm-redux/selectors/entities/general'; import * as Selectors from '@mm-redux/selectors/entities/posts'; +import {isCollapsedThreadsEnabled} from '@mm-redux/selectors/entities/preferences'; import {getThreadTeamId} from '@mm-redux/selectors/entities/threads'; import {getCurrentUserId, getUsersByUsername} from '@mm-redux/selectors/entities/users'; - +import {Action, ActionResult, batchActions, DispatchFunc, GetStateFunc, GenericAction} from '@mm-redux/types/actions'; +import {ChannelUnread} from '@mm-redux/types/channels'; +import {CustomEmoji} from '@mm-redux/types/emojis'; +import {Post} from '@mm-redux/types/posts'; +import {Reaction} from '@mm-redux/types/reactions'; +import {GlobalState} from '@mm-redux/types/store'; +import {UserProfile} from '@mm-redux/types/users'; +import {Dictionary} from '@mm-redux/types/utilities'; import {getUserIdFromChannelName} from '@mm-redux/utils/channel_utils'; import {parseNeededCustomEmojisFromText} from '@mm-redux/utils/emoji_utils'; -import {isFromWebhook, isSystemMessage, shouldIgnorePost} from '@mm-redux/utils/post_utils'; import {isCombinedUserActivityPost} from '@mm-redux/utils/post_list'; +import {isFromWebhook, isSystemMessage, shouldIgnorePost} from '@mm-redux/utils/post_utils'; import {getMyChannelMember, markChannelAsUnread, markChannelAsRead, markChannelAsViewed} from './channels'; import {getCustomEmojiByName, getCustomEmojisByName} from './emojis'; import {logError} from './errors'; import {forceLogoutIfNecessary} from './helpers'; -import {analytics} from '@init/analytics'; - import { deletePreferences, makeDirectChannelVisibleIfNecessary, @@ -34,15 +40,6 @@ import { savePreferences, } from './preferences'; import {getProfilesByIds, getProfilesByUsernames, getStatusesByIds} from './users'; -import {isCollapsedThreadsEnabled} from '@mm-redux/selectors/entities/preferences'; -import {Action, ActionResult, batchActions, DispatchFunc, GetStateFunc, GenericAction} from '@mm-redux/types/actions'; -import {ChannelUnread} from '@mm-redux/types/channels'; -import {GlobalState} from '@mm-redux/types/store'; -import {Post} from '@mm-redux/types/posts'; -import {Reaction} from '@mm-redux/types/reactions'; -import {UserProfile} from '@mm-redux/types/users'; -import {Dictionary} from '@mm-redux/types/utilities'; -import {CustomEmoji} from '@mm-redux/types/emojis'; // receivedPost should be dispatched after a single post from the server. This typically happens when an existing post // is updated. diff --git a/app/mm-redux/actions/preferences.test.js b/app/mm-redux/actions/preferences.test.js index cee88fd8e..e9f10b07f 100644 --- a/app/mm-redux/actions/preferences.test.js +++ b/app/mm-redux/actions/preferences.test.js @@ -2,15 +2,16 @@ // See LICENSE.txt for license information. import assert from 'assert'; + import nock from 'nock'; +import {Client4} from '@client/rest'; import * as Actions from '@mm-redux/actions/preferences'; import {login} from '@mm-redux/actions/users'; -import {Client4} from '@client/rest'; -import {Preferences} from '../constants'; +import TestHelper from '@test/test_helper'; +import configureStore from '@test/test_store'; -import TestHelper from 'test/test_helper'; -import configureStore from 'test/test_store'; +import {Preferences} from '../constants'; const OK_RESPONSE = {status: 'OK'}; diff --git a/app/mm-redux/actions/preferences.ts b/app/mm-redux/actions/preferences.ts index 464d9485b..3d5999cb2 100644 --- a/app/mm-redux/actions/preferences.ts +++ b/app/mm-redux/actions/preferences.ts @@ -1,19 +1,18 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. import {Client4} from '@client/rest'; -import {Preferences} from '../constants'; import {PreferenceTypes} from '@mm-redux/action_types'; import {getMyPreferences as getMyPreferencesSelector, makeGetCategory} from '@mm-redux/selectors/entities/preferences'; import {getCurrentUserId} from '@mm-redux/selectors/entities/users'; +import {GetStateFunc, DispatchFunc, ActionFunc} from '@mm-redux/types/actions'; +import {PreferenceType} from '@mm-redux/types/preferences'; import {getPreferenceKey} from '@mm-redux/utils/preference_utils'; -import {GetStateFunc, DispatchFunc, ActionFunc} from '@mm-redux/types/actions'; - -import {PreferenceType} from '@mm-redux/types/preferences'; +import {Preferences} from '../constants'; +import {getChannelAndMyMember, getMyChannelMember} from './channels'; import {bindClientFunc} from './helpers'; import {getProfilesByIds, getProfilesInChannel} from './users'; -import {getChannelAndMyMember, getMyChannelMember} from './channels'; export function deletePreferences(userId: string, preferences: Array): ActionFunc { return async (dispatch: DispatchFunc, getState: GetStateFunc) => { diff --git a/app/mm-redux/actions/roles.test.js b/app/mm-redux/actions/roles.test.js index 9d1f2ac0a..c0c45aced 100644 --- a/app/mm-redux/actions/roles.test.js +++ b/app/mm-redux/actions/roles.test.js @@ -2,14 +2,15 @@ // See LICENSE.txt for license information. import assert from 'assert'; + import nock from 'nock'; -import * as Actions from '@mm-redux/actions/roles'; import {Client4} from '@client/rest'; -import {RequestStatus} from '../constants'; +import * as Actions from '@mm-redux/actions/roles'; +import TestHelper from '@test/test_helper'; +import configureStore from '@test/test_store'; -import TestHelper from 'test/test_helper'; -import configureStore from 'test/test_store'; +import {RequestStatus} from '../constants'; describe('Actions.Roles', () => { let store; diff --git a/app/mm-redux/actions/roles.ts b/app/mm-redux/actions/roles.ts index 75a8d5fda..93bfa0386 100644 --- a/app/mm-redux/actions/roles.ts +++ b/app/mm-redux/actions/roles.ts @@ -3,7 +3,6 @@ import {Client4} from '@client/rest'; import {RoleTypes} from '@mm-redux/action_types'; import {getRoles} from '@mm-redux/selectors/entities/roles_helpers'; - import {DispatchFunc, GetStateFunc, ActionFunc} from '@mm-redux/types/actions'; import {bindClientFunc} from './helpers'; diff --git a/app/mm-redux/actions/search.test.js b/app/mm-redux/actions/search.test.js index 6598b5a0e..727ed0e3c 100644 --- a/app/mm-redux/actions/search.test.js +++ b/app/mm-redux/actions/search.test.js @@ -2,13 +2,13 @@ // See LICENSE.txt for license information. import assert from 'assert'; + import nock from 'nock'; -import * as Actions from '@mm-redux/actions/search'; import {Client4} from '@client/rest'; - -import TestHelper from 'test/test_helper'; -import configureStore from 'test/test_store'; +import * as Actions from '@mm-redux/actions/search'; +import TestHelper from '@test/test_helper'; +import configureStore from '@test/test_store'; describe('Actions.Search', () => { let store; diff --git a/app/mm-redux/actions/search.ts b/app/mm-redux/actions/search.ts index 41f838f4e..ecf905c01 100644 --- a/app/mm-redux/actions/search.ts +++ b/app/mm-redux/actions/search.ts @@ -1,19 +1,19 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. import {Client4} from '@client/rest'; +import {analytics} from '@init/analytics'; import {SearchTypes} from '@mm-redux/action_types'; import {getCurrentTeamId} from '@mm-redux/selectors/entities/teams'; import {getCurrentUserId, getCurrentUserMentionKeys} from '@mm-redux/selectors/entities/users'; - -import {getChannelAndMyMember, getChannelMembers} from './channels'; -import {forceLogoutIfNecessary} from './helpers'; -import {logError} from './errors'; -import {getProfilesAndStatusesForPosts, receivedPosts} from './posts'; import {ActionResult, batchActions, DispatchFunc, GetStateFunc, ActionFunc} from '@mm-redux/types/actions'; -import {RelationOneToOne} from '@mm-redux/types/utilities'; import {Post} from '@mm-redux/types/posts'; import {SearchParameter} from '@mm-redux/types/search'; -import {analytics} from '@init/analytics'; +import {RelationOneToOne} from '@mm-redux/types/utilities'; + +import {getChannelAndMyMember, getChannelMembers} from './channels'; +import {logError} from './errors'; +import {forceLogoutIfNecessary} from './helpers'; +import {getProfilesAndStatusesForPosts, receivedPosts} from './posts'; const WEBAPP_SEARCH_PER_PAGE = 20; export function getMissingChannelsFromPosts(posts: RelationOneToOne): ActionFunc { diff --git a/app/mm-redux/actions/teams.test.js b/app/mm-redux/actions/teams.test.js index 572103c2e..c77e4bb8f 100644 --- a/app/mm-redux/actions/teams.test.js +++ b/app/mm-redux/actions/teams.test.js @@ -2,15 +2,17 @@ // See LICENSE.txt for license information. import assert from 'assert'; + import nock from 'nock'; +import {Client4} from '@client/rest'; +import {GeneralTypes} from '@mm-redux/action_types'; import * as Actions from '@mm-redux/actions/teams'; import {login} from '@mm-redux/actions/users'; -import {Client4} from '@client/rest'; +import TestHelper from '@test/test_helper'; +import configureStore from '@test/test_store'; + import {RequestStatus} from '../constants'; -import {GeneralTypes} from '@mm-redux/action_types'; -import TestHelper from 'test/test_helper'; -import configureStore from 'test/test_store'; const OK_RESPONSE = {status: 'OK'}; diff --git a/app/mm-redux/actions/teams.ts b/app/mm-redux/actions/teams.ts index 0066b4c7b..9bebd0ab2 100644 --- a/app/mm-redux/actions/teams.ts +++ b/app/mm-redux/actions/teams.ts @@ -1,24 +1,22 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. import {Client4} from '@client/rest'; -import {General} from '../constants'; import {ChannelTypes, RoleTypes, TeamTypes, UserTypes} from '@mm-redux/action_types'; -import EventEmitter from '@mm-redux/utils/event_emitter'; - import {isCompatibleWithJoinViewTeamPermissions} from '@mm-redux/selectors/entities/general'; import {getRoles} from '@mm-redux/selectors/entities/roles_helpers'; import {getCurrentTeamId} from '@mm-redux/selectors/entities/teams'; import {getCurrentUserId} from '@mm-redux/selectors/entities/users'; - import {GetStateFunc, DispatchFunc, ActionFunc, ActionResult, batchActions, Action} from '@mm-redux/types/actions'; - import {Team} from '@mm-redux/types/teams'; +import EventEmitter from '@mm-redux/utils/event_emitter'; + +import {General} from '../constants'; import {selectChannel} from './channels'; import {logError} from './errors'; import {bindClientFunc, forceLogoutIfNecessary} from './helpers'; -import {getProfilesByIds, getStatusesByIds} from './users'; import {loadRolesIfNeeded} from './roles'; +import {getProfilesByIds, getStatusesByIds} from './users'; async function getProfilesAndStatusesForMembers(userIds: string[], dispatch: DispatchFunc, getState: GetStateFunc) { const { diff --git a/app/mm-redux/actions/threads.test.js b/app/mm-redux/actions/threads.test.js index 6bb03d3f2..c20bc9648 100644 --- a/app/mm-redux/actions/threads.test.js +++ b/app/mm-redux/actions/threads.test.js @@ -3,11 +3,11 @@ import nock from 'nock'; +import {Client4} from '@client/rest'; import {getThread as fetchThread, getThreads as fetchThreads} from '@mm-redux/actions/threads'; import {getThread, getThreadsInCurrentTeam} from '@mm-redux/selectors/entities/threads'; -import {Client4} from '@client/rest'; -import TestHelper from 'test/test_helper'; -import configureStore from 'test/test_store'; +import TestHelper from '@test/test_helper'; +import configureStore from '@test/test_store'; /** * Returns a mock thread with 2 participants and 5 replies. diff --git a/app/mm-redux/actions/threads.ts b/app/mm-redux/actions/threads.ts index 56b453dec..3cd687927 100644 --- a/app/mm-redux/actions/threads.ts +++ b/app/mm-redux/actions/threads.ts @@ -1,21 +1,21 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {ViewTypes} from '@constants'; - import {Client4} from '@client/rest'; +import {ViewTypes} from '@constants'; import {ThreadTypes, PostTypes, UserTypes} from '@mm-redux/action_types'; import {getCurrentUserId} from '@mm-redux/selectors/entities/common'; import {getCurrentTeamId} from '@mm-redux/selectors/entities/teams'; import {getThread as getThreadSelector, getThreadTeamId} from '@mm-redux/selectors/entities/threads'; import {ActionResult, batchActions, DispatchFunc, GenericAction, GetStateFunc} from '@mm-redux/types/actions'; -import type {Post} from '@mm-redux/types/posts'; -import type {UserThread, UserThreadList} from '@mm-redux/types/threads'; import {logError} from './errors'; import {forceLogoutIfNecessary} from './helpers'; import {getMissingProfilesByIds} from './users'; +import type {Post} from '@mm-redux/types/posts'; +import type {UserThread, UserThreadList} from '@mm-redux/types/threads'; + export function getThreads(userId: string, teamId: string, before = '', after = '', perPage = ViewTypes.CRT_CHUNK_SIZE, deleted = false, unread = true, since = 0) { return async (dispatch: DispatchFunc, getState: GetStateFunc) => { let userThreadList: UserThreadList; diff --git a/app/mm-redux/actions/timezone.ts b/app/mm-redux/actions/timezone.ts index e48d93d4f..a1d8300e9 100644 --- a/app/mm-redux/actions/timezone.ts +++ b/app/mm-redux/actions/timezone.ts @@ -1,9 +1,10 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {getCurrentUser} from '@mm-redux/selectors/entities/users'; import {getUserTimezone} from '@mm-redux/selectors/entities/timezone'; -import {updateMe} from './users'; +import {getCurrentUser} from '@mm-redux/selectors/entities/users'; import {DispatchFunc, GetStateFunc} from '@mm-redux/types/actions'; + +import {updateMe} from './users'; export function autoUpdateTimezone(deviceTimezone: string) { return async (dispatch: DispatchFunc, getState: GetStateFunc) => { const currentUer = getCurrentUser(getState()); diff --git a/app/mm-redux/actions/users.test.js b/app/mm-redux/actions/users.test.js index 6f2f1ebfe..f741eeffd 100644 --- a/app/mm-redux/actions/users.test.js +++ b/app/mm-redux/actions/users.test.js @@ -2,19 +2,20 @@ // See LICENSE.txt for license information. import assert from 'assert'; + import nock from 'nock'; -import {NavigationTypes} from '@constants'; import {logout} from '@actions/views/user'; -import * as Actions from '@mm-redux/actions/users'; import {Client4} from '@client/rest'; -import {RequestStatus} from '../constants'; -import TestHelper from 'test/test_helper'; -import configureStore from 'test/test_store'; +import {NavigationTypes} from '@constants'; +import * as Actions from '@mm-redux/actions/users'; import deepFreeze from '@mm-redux/utils/deep_freeze'; import EventEmitter from '@mm-redux/utils/event_emitter'; - import initialState from '@store/initial_state'; +import TestHelper from '@test/test_helper'; +import configureStore from '@test/test_store'; + +import {RequestStatus} from '../constants'; const OK_RESPONSE = {status: 'OK'}; diff --git a/app/mm-redux/actions/users.ts b/app/mm-redux/actions/users.ts index 4d58749e2..799b79908 100644 --- a/app/mm-redux/actions/users.ts +++ b/app/mm-redux/actions/users.ts @@ -1,28 +1,27 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {Action, ActionFunc, ActionResult, batchActions, DispatchFunc, GetStateFunc} from '@mm-redux/types/actions'; -import {UserProfile, UserStatus} from '@mm-redux/types/users'; -import {TeamMembership} from '@mm-redux/types/teams'; import {Client4} from '@client/rest'; -import {General} from '../constants'; +import {analytics} from '@init/analytics'; import {UserTypes, TeamTypes} from '@mm-redux/action_types'; -import {getAllCustomEmojis} from './emojis'; -import {getClientConfig, setServerVersion} from './general'; -import {getMyTeams} from './teams'; -import {loadRolesIfNeeded} from './roles'; -import {getUserIdFromChannelName, isDirectChannel, isDirectChannelVisible, isGroupChannel, isGroupChannelVisible} from '@mm-redux/utils/channel_utils'; -import {removeUserFromList} from '@mm-redux/utils/user_utils'; -import {isMinimumServerVersion} from '@mm-redux/utils/helpers'; - import {getConfig, getServerVersion} from '@mm-redux/selectors/entities/general'; - import {getCurrentUserId, getUsers} from '@mm-redux/selectors/entities/users'; +import {Action, ActionFunc, ActionResult, batchActions, DispatchFunc, GetStateFunc} from '@mm-redux/types/actions'; +import {TeamMembership} from '@mm-redux/types/teams'; +import {UserProfile, UserStatus} from '@mm-redux/types/users'; +import {Dictionary} from '@mm-redux/types/utilities'; +import {getUserIdFromChannelName, isDirectChannel, isDirectChannelVisible, isGroupChannel, isGroupChannelVisible} from '@mm-redux/utils/channel_utils'; +import {isMinimumServerVersion} from '@mm-redux/utils/helpers'; +import {removeUserFromList} from '@mm-redux/utils/user_utils'; +import {General} from '../constants'; + +import {getAllCustomEmojis} from './emojis'; import {logError} from './errors'; +import {getClientConfig, setServerVersion} from './general'; import {bindClientFunc, forceLogoutIfNecessary, debounce} from './helpers'; import {getMyPreferences, makeDirectChannelVisibleIfNecessary, makeGroupMessageVisibleIfNecessary} from './preferences'; -import {Dictionary} from '@mm-redux/types/utilities'; -import {analytics} from '@init/analytics'; +import {loadRolesIfNeeded} from './roles'; +import {getMyTeams} from './teams'; export function checkMfa(loginId: string): ActionFunc { return async (dispatch: DispatchFunc) => { diff --git a/app/mm-redux/constants/index.ts b/app/mm-redux/constants/index.ts index 841adbd85..9f3cf39b3 100644 --- a/app/mm-redux/constants/index.ts +++ b/app/mm-redux/constants/index.ts @@ -1,17 +1,17 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import General from './general'; -import RequestStatus from './request_status'; -import Preferences from './preferences'; -import Posts from './posts'; -import Files from './files'; -import Teams from './teams'; -import Stats from './stats'; -import Permissions from './permissions'; import Emoji from './emoji'; -import Plugins from './plugins'; +import Files from './files'; +import General from './general'; import Groups from './groups'; -import Users from './users'; +import Permissions from './permissions'; +import Plugins from './plugins'; +import Posts from './posts'; +import Preferences from './preferences'; +import RequestStatus from './request_status'; import Roles from './roles'; +import Stats from './stats'; +import Teams from './teams'; +import Users from './users'; export {General, Preferences, Posts, Files, RequestStatus, Teams, Stats, Permissions, Emoji, Plugins, Groups, Users, Roles}; diff --git a/app/mm-redux/reducers/entities/apps.test.js b/app/mm-redux/reducers/entities/apps.test.js index 45df0b53a..fd40eaac4 100644 --- a/app/mm-redux/reducers/entities/apps.test.js +++ b/app/mm-redux/reducers/entities/apps.test.js @@ -2,6 +2,7 @@ // See LICENSE.txt for license information. import {AppsTypes} from '@mm-redux/action_types'; + import * as Reducers from './apps'; describe('bindings', () => { diff --git a/app/mm-redux/reducers/entities/apps.ts b/app/mm-redux/reducers/entities/apps.ts index c8a7dc109..2a0360804 100644 --- a/app/mm-redux/reducers/entities/apps.ts +++ b/app/mm-redux/reducers/entities/apps.ts @@ -1,10 +1,11 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. + import {combineReducers} from 'redux'; import {AppsTypes} from '@mm-redux/action_types'; -import {AppBinding, AppsState} from '@mm-redux/types/apps'; import {GenericAction} from '@mm-redux/types/actions'; +import {AppBinding, AppsState} from '@mm-redux/types/apps'; import {validateBindings} from '@utils/apps'; export function bindings(state: AppBinding[] = [], action: GenericAction): AppBinding[] { diff --git a/app/mm-redux/reducers/entities/bots.ts b/app/mm-redux/reducers/entities/bots.ts index 2dab6547b..0bcfbe846 100644 --- a/app/mm-redux/reducers/entities/bots.ts +++ b/app/mm-redux/reducers/entities/bots.ts @@ -1,10 +1,11 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. import {combineReducers} from 'redux'; + import {BotTypes} from '@mm-redux/action_types'; import {GenericAction} from '@mm-redux/types/actions'; -import {Dictionary} from '@mm-redux/types/utilities'; import {Bot} from '@mm-redux/types/bots'; +import {Dictionary} from '@mm-redux/types/utilities'; function accounts(state: Dictionary = {}, action: GenericAction) { switch (action.type) { diff --git a/app/mm-redux/reducers/entities/channel_categories.test.js b/app/mm-redux/reducers/entities/channel_categories.test.js index a1d894d2c..d25b37469 100644 --- a/app/mm-redux/reducers/entities/channel_categories.test.js +++ b/app/mm-redux/reducers/entities/channel_categories.test.js @@ -1,10 +1,10 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {CategoryTypes} from '../../constants/channel_categories'; - import {TeamTypes} from '@mm-redux/action_types'; +import {CategoryTypes} from '../../constants/channel_categories'; + import * as Reducers from './channel_categories'; describe('byId', () => { diff --git a/app/mm-redux/reducers/entities/channel_categories.ts b/app/mm-redux/reducers/entities/channel_categories.ts index 344be2456..37f716f88 100644 --- a/app/mm-redux/reducers/entities/channel_categories.ts +++ b/app/mm-redux/reducers/entities/channel_categories.ts @@ -3,15 +3,14 @@ import {combineReducers} from 'redux'; -import {CategoryTypes} from '../../constants/channel_categories'; - import {TeamTypes} from '@mm-redux/action_types'; - import {GenericAction} from '@mm-redux/types/actions'; import {ChannelCategory} from '@mm-redux/types/channel_categories'; import {Team, TeamMembership} from '@mm-redux/types/teams'; import {$ID, IDMappedObjects, RelationOneToOne} from '@mm-redux/types/utilities'; +import {CategoryTypes} from '../../constants/channel_categories'; + export function byId(state: IDMappedObjects = {}, action: GenericAction) { switch (action.type) { case TeamTypes.RECEIVED_MY_TEAM_MEMBER: { diff --git a/app/mm-redux/reducers/entities/channels.ts b/app/mm-redux/reducers/entities/channels.ts index 6a891f172..246d1e205 100644 --- a/app/mm-redux/reducers/entities/channels.ts +++ b/app/mm-redux/reducers/entities/channels.ts @@ -1,12 +1,14 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. import {combineReducers} from 'redux'; + import {ChannelTypes, UserTypes, GroupTypes} from '@mm-redux/action_types'; -import {General} from '../../constants'; import {GenericAction} from '@mm-redux/types/actions'; import {Channel, ChannelMembership, ChannelStats, ChannelMemberCountByGroup, ChannelMemberCountsByGroup} from '@mm-redux/types/channels'; -import {RelationOneToMany, RelationOneToOne, IDMappedObjects, UserIDMappedObjects} from '@mm-redux/types/utilities'; import {Team} from '@mm-redux/types/teams'; +import {RelationOneToMany, RelationOneToOne, IDMappedObjects, UserIDMappedObjects} from '@mm-redux/types/utilities'; + +import {General} from '../../constants'; function removeMemberFromChannels(state: RelationOneToOne>, action: GenericAction) { const nextState = {...state}; diff --git a/app/mm-redux/reducers/entities/emojis.ts b/app/mm-redux/reducers/entities/emojis.ts index f4b965553..cee052472 100644 --- a/app/mm-redux/reducers/entities/emojis.ts +++ b/app/mm-redux/reducers/entities/emojis.ts @@ -1,9 +1,10 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. import {combineReducers} from 'redux'; + import {EmojiTypes, PostTypes} from '@mm-redux/action_types'; -import {EmojisState, CustomEmoji} from '@mm-redux/types/emojis'; import * as types from '@mm-redux/types'; +import {EmojisState, CustomEmoji} from '@mm-redux/types/emojis'; export function customEmoji(state: types.utilities.IDMappedObjects = {}, action: types.actions.GenericAction): types.utilities.IDMappedObjects { switch (action.type) { diff --git a/app/mm-redux/reducers/entities/files.ts b/app/mm-redux/reducers/entities/files.ts index 9fd739362..1a97e7362 100644 --- a/app/mm-redux/reducers/entities/files.ts +++ b/app/mm-redux/reducers/entities/files.ts @@ -2,10 +2,11 @@ // See LICENSE.txt for license information. import {combineReducers} from 'redux'; + import {FileTypes, PostTypes} from '@mm-redux/action_types'; import {GenericAction} from '@mm-redux/types/actions'; -import {Post} from '@mm-redux/types/posts'; import {FileInfo} from '@mm-redux/types/files'; +import {Post} from '@mm-redux/types/posts'; import {Dictionary} from '@mm-redux/types/utilities'; export function files(state: Dictionary = {}, action: GenericAction) { diff --git a/app/mm-redux/reducers/entities/general.ts b/app/mm-redux/reducers/entities/general.ts index fda52f9bc..99f0fdcc6 100644 --- a/app/mm-redux/reducers/entities/general.ts +++ b/app/mm-redux/reducers/entities/general.ts @@ -2,6 +2,7 @@ // See LICENSE.txt for license information. import {combineReducers} from 'redux'; + import {GeneralTypes, UserTypes} from '@mm-redux/action_types'; import {GenericAction} from '@mm-redux/types/actions'; import {Config} from '@mm-redux/types/config'; diff --git a/app/mm-redux/reducers/entities/gifs.ts b/app/mm-redux/reducers/entities/gifs.ts index 28d971d42..0eb65b199 100644 --- a/app/mm-redux/reducers/entities/gifs.ts +++ b/app/mm-redux/reducers/entities/gifs.ts @@ -2,6 +2,7 @@ // See LICENSE.txt for license information. import {combineReducers} from 'redux'; + import {GifTypes} from '@mm-redux/action_types'; import {GenericAction} from '@mm-redux/types/actions'; import {Dictionary} from '@mm-redux/types/utilities'; diff --git a/app/mm-redux/reducers/entities/groups.ts b/app/mm-redux/reducers/entities/groups.ts index 50d4e84c9..f07439e43 100644 --- a/app/mm-redux/reducers/entities/groups.ts +++ b/app/mm-redux/reducers/entities/groups.ts @@ -1,9 +1,10 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. import {combineReducers} from 'redux'; + import {GroupTypes} from '@mm-redux/action_types'; -import {GroupChannel, GroupSyncables, GroupTeam, Group} from '@mm-redux/types/groups'; import {GenericAction} from '@mm-redux/types/actions'; +import {GroupChannel, GroupSyncables, GroupTeam, Group} from '@mm-redux/types/groups'; import {Dictionary} from '@mm-redux/types/utilities'; function syncables(state: Dictionary = {}, action: GenericAction) { diff --git a/app/mm-redux/reducers/entities/index.ts b/app/mm-redux/reducers/entities/index.ts index bb65204b9..d8e659bda 100644 --- a/app/mm-redux/reducers/entities/index.ts +++ b/app/mm-redux/reducers/entities/index.ts @@ -3,25 +3,25 @@ import {combineReducers} from 'redux'; -import channels from './channels'; -import general from './general'; -import users from './users'; -import teams from './teams'; -import posts from './posts'; -import files from './files'; -import preferences from './preferences'; -import typing from './typing'; -import integrations from './integrations'; -import emojis from './emojis'; -import gifs from './gifs'; -import search from './search'; -import roles from './roles'; -import groups from './groups'; +import apps from './apps'; import bots from './bots'; import channelCategories from './channel_categories'; -import threads from './threads'; +import channels from './channels'; +import emojis from './emojis'; +import files from './files'; +import general from './general'; +import gifs from './gifs'; +import groups from './groups'; +import integrations from './integrations'; +import posts from './posts'; +import preferences from './preferences'; import remoteCluster from './remote_cluster'; -import apps from './apps'; +import roles from './roles'; +import search from './search'; +import teams from './teams'; +import threads from './threads'; +import typing from './typing'; +import users from './users'; export default combineReducers({ general, diff --git a/app/mm-redux/reducers/entities/integrations.ts b/app/mm-redux/reducers/entities/integrations.ts index 85f80366c..6bae6d87a 100644 --- a/app/mm-redux/reducers/entities/integrations.ts +++ b/app/mm-redux/reducers/entities/integrations.ts @@ -2,6 +2,7 @@ // See LICENSE.txt for license information. import {combineReducers} from 'redux'; + import {IntegrationTypes} from '@mm-redux/action_types'; import {GenericAction} from '@mm-redux/types/actions'; import {Command, AutocompleteSuggestion} from '@mm-redux/types/integrations'; diff --git a/app/mm-redux/reducers/entities/posts.test.js b/app/mm-redux/reducers/entities/posts.test.js index 0bdf31fbe..d8a015532 100644 --- a/app/mm-redux/reducers/entities/posts.test.js +++ b/app/mm-redux/reducers/entities/posts.test.js @@ -2,6 +2,7 @@ // See LICENSE.txt for license information. import assert from 'assert'; + import expect from 'expect'; import { @@ -9,10 +10,11 @@ import { GeneralTypes, PostTypes, } from '@mm-redux/action_types'; -import {Posts} from '../../constants'; import * as reducers from '@mm-redux/reducers/entities/posts'; import deepFreeze from '@mm-redux/utils/deep_freeze'; +import {Posts} from '../../constants'; + describe('posts', () => { for (const actionType of [ PostTypes.RECEIVED_POST, diff --git a/app/mm-redux/reducers/entities/posts.ts b/app/mm-redux/reducers/entities/posts.ts index cc049f31f..3a2129fde 100644 --- a/app/mm-redux/reducers/entities/posts.ts +++ b/app/mm-redux/reducers/entities/posts.ts @@ -1,13 +1,14 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. import {ChannelTypes, GeneralTypes, PostTypes, ThreadTypes} from '@mm-redux/action_types'; -import {Posts} from '../../constants'; -import {comparePosts} from '@mm-redux/utils/post_utils'; -import {Post, PostsState, PostOrderBlock, MessageHistory} from '@mm-redux/types/posts'; -import {RelationOneToOne, Dictionary, IDMappedObjects, RelationOneToMany} from '@mm-redux/types/utilities'; import {GenericAction} from '@mm-redux/types/actions'; +import {Post, PostsState, PostOrderBlock, MessageHistory} from '@mm-redux/types/posts'; import {Reaction} from '@mm-redux/types/reactions'; import {UserProfile} from '@mm-redux/types/users'; +import {RelationOneToOne, Dictionary, IDMappedObjects, RelationOneToMany} from '@mm-redux/types/utilities'; +import {comparePosts} from '@mm-redux/utils/post_utils'; + +import {Posts} from '../../constants'; export function removeUnneededMetadata(post: Post) { if (!post.metadata) { diff --git a/app/mm-redux/reducers/entities/preferences.ts b/app/mm-redux/reducers/entities/preferences.ts index b78afdb4b..379eaa6b1 100644 --- a/app/mm-redux/reducers/entities/preferences.ts +++ b/app/mm-redux/reducers/entities/preferences.ts @@ -2,6 +2,7 @@ // See LICENSE.txt for license information. import {combineReducers} from 'redux'; + import {PreferenceTypes, UserTypes} from '@mm-redux/action_types'; import {GenericAction} from '@mm-redux/types/actions'; import {PreferenceType} from '@mm-redux/types/preferences'; diff --git a/app/mm-redux/reducers/entities/remote_cluster.ts b/app/mm-redux/reducers/entities/remote_cluster.ts index 4e7402d27..f074bb6a6 100644 --- a/app/mm-redux/reducers/entities/remote_cluster.ts +++ b/app/mm-redux/reducers/entities/remote_cluster.ts @@ -2,10 +2,11 @@ // See LICENSE.txt for license information. import {combineReducers} from 'redux'; + import {RemoteClusterTypes} from '@mm-redux/action_types'; import {GenericAction} from '@mm-redux/types/actions'; -import {Dictionary} from '@mm-redux/types/utilities'; import {RemoteCluster} from '@mm-redux/types/remote_cluster'; +import {Dictionary} from '@mm-redux/types/utilities'; function info(state: Dictionary = {}, action: GenericAction) { switch (action.type) { diff --git a/app/mm-redux/reducers/entities/roles.ts b/app/mm-redux/reducers/entities/roles.ts index 80482e658..9f838ae57 100644 --- a/app/mm-redux/reducers/entities/roles.ts +++ b/app/mm-redux/reducers/entities/roles.ts @@ -2,10 +2,11 @@ // See LICENSE.txt for license information. import {combineReducers} from 'redux'; + import {RoleTypes} from '@mm-redux/action_types'; import {GenericAction} from '@mm-redux/types/actions'; -import {Dictionary} from '@mm-redux/types/utilities'; import {Role} from '@mm-redux/types/roles'; +import {Dictionary} from '@mm-redux/types/utilities'; function pending(state: Set = new Set(), action: GenericAction) { switch (action.type) { diff --git a/app/mm-redux/reducers/entities/search.ts b/app/mm-redux/reducers/entities/search.ts index f70227937..2a5ffe964 100644 --- a/app/mm-redux/reducers/entities/search.ts +++ b/app/mm-redux/reducers/entities/search.ts @@ -1,13 +1,15 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. import {combineReducers} from 'redux'; + import {PostTypes, PreferenceTypes, SearchTypes} from '@mm-redux/action_types'; -import {Preferences} from '../../constants'; -import {PreferenceType} from '@mm-redux/types/preferences'; import {GenericAction} from '@mm-redux/types/actions'; import {Post} from '@mm-redux/types/posts'; -import {Dictionary} from '@mm-redux/types/utilities'; +import {PreferenceType} from '@mm-redux/types/preferences'; import {Search} from '@mm-redux/types/search'; +import {Dictionary} from '@mm-redux/types/utilities'; + +import {Preferences} from '../../constants'; function results(state: Array = [], action: GenericAction) { switch (action.type) { diff --git a/app/mm-redux/reducers/entities/teams.ts b/app/mm-redux/reducers/entities/teams.ts index 42155e778..5f22081b6 100644 --- a/app/mm-redux/reducers/entities/teams.ts +++ b/app/mm-redux/reducers/entities/teams.ts @@ -1,12 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. import {combineReducers} from 'redux'; + import {ChannelTypes, TeamTypes, UserTypes, GroupTypes} from '@mm-redux/action_types'; -import {teamListToMap} from '@mm-redux/utils/team_utils'; +import {GenericAction} from '@mm-redux/types/actions'; import {Team, TeamMembership, TeamUnread} from '@mm-redux/types/teams'; import {UserProfile} from '@mm-redux/types/users'; import {RelationOneToOne, IDMappedObjects} from '@mm-redux/types/utilities'; -import {GenericAction} from '@mm-redux/types/actions'; +import {teamListToMap} from '@mm-redux/utils/team_utils'; function currentTeamId(state = '', action: GenericAction) { switch (action.type) { diff --git a/app/mm-redux/reducers/entities/threads.test.js b/app/mm-redux/reducers/entities/threads.test.js index 4c0fef52e..6927d01b5 100644 --- a/app/mm-redux/reducers/entities/threads.test.js +++ b/app/mm-redux/reducers/entities/threads.test.js @@ -1,9 +1,9 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import deepFreeze from '@mm-redux/utils/deep_freeze'; import {PostTypes, TeamTypes, ThreadTypes} from '@mm-redux/action_types'; import threadsReducer from '@mm-redux/reducers/entities/threads'; +import deepFreeze from '@mm-redux/utils/deep_freeze'; describe('threads', () => { test('RECEIVED_THREADS should update the state', () => { diff --git a/app/mm-redux/reducers/entities/typing.test.js b/app/mm-redux/reducers/entities/typing.test.js index 5505c32e1..5bb5a4cad 100644 --- a/app/mm-redux/reducers/entities/typing.test.js +++ b/app/mm-redux/reducers/entities/typing.test.js @@ -4,10 +4,8 @@ import assert from 'assert'; import {WebsocketEvents} from '@constants'; - import typingReducer from '@mm-redux/reducers/entities/typing'; - -import TestHelper from 'test/test_helper'; +import TestHelper from '@test/test_helper'; describe('Reducers.Typing', () => { it('initial state', async () => { diff --git a/app/mm-redux/reducers/entities/typing.ts b/app/mm-redux/reducers/entities/typing.ts index 06cf10b38..ac0a13104 100644 --- a/app/mm-redux/reducers/entities/typing.ts +++ b/app/mm-redux/reducers/entities/typing.ts @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. import {WebsocketEvents} from '@constants'; -import {Typing} from '@mm-redux/types/typing'; import {GenericAction} from '@mm-redux/types/actions'; +import {Typing} from '@mm-redux/types/typing'; export default function typing(state: Typing = {}, action: GenericAction): Typing { const { data, diff --git a/app/mm-redux/reducers/entities/users.ts b/app/mm-redux/reducers/entities/users.ts index 0a04e2eab..8af1db4af 100644 --- a/app/mm-redux/reducers/entities/users.ts +++ b/app/mm-redux/reducers/entities/users.ts @@ -2,13 +2,14 @@ // See LICENSE.txt for license information. import {combineReducers} from 'redux'; + import {UserTypes, ChannelTypes} from '@mm-redux/action_types'; -import {profileListToMap} from '@mm-redux/utils/user_utils'; import {GenericAction} from '@mm-redux/types/actions'; +import {Channel} from '@mm-redux/types/channels'; +import {Team} from '@mm-redux/types/teams'; import {UserProfile, UserStatus} from '@mm-redux/types/users'; import {RelationOneToMany, IDMappedObjects, RelationOneToOne} from '@mm-redux/types/utilities'; -import {Team} from '@mm-redux/types/teams'; -import {Channel} from '@mm-redux/types/channels'; +import {profileListToMap} from '@mm-redux/utils/user_utils'; function profilesToSet(state: RelationOneToMany, action: GenericAction) { const id = action.id; diff --git a/app/mm-redux/reducers/requests/channels.ts b/app/mm-redux/reducers/requests/channels.ts index d4ef27a1e..332476ad7 100644 --- a/app/mm-redux/reducers/requests/channels.ts +++ b/app/mm-redux/reducers/requests/channels.ts @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. import {combineReducers} from 'redux'; -import {ChannelTypes} from '@mm-redux/action_types'; +import {ChannelTypes} from '@mm-redux/action_types'; import {GenericAction} from '@mm-redux/types/actions'; import {ChannelsRequestsStatuses, RequestStatusType} from '@mm-redux/types/requests'; diff --git a/app/mm-redux/reducers/requests/files.ts b/app/mm-redux/reducers/requests/files.ts index 664e76bd4..daf242ac2 100644 --- a/app/mm-redux/reducers/requests/files.ts +++ b/app/mm-redux/reducers/requests/files.ts @@ -1,12 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. import {combineReducers} from 'redux'; -import {FileTypes} from '@mm-redux/action_types'; -import {RequestStatus} from '../../constants'; +import {FileTypes} from '@mm-redux/action_types'; import {GenericAction} from '@mm-redux/types/actions'; import {FilesRequestsStatuses, RequestStatusType} from '@mm-redux/types/requests'; +import {RequestStatus} from '../../constants'; + import {initialRequestState} from './helpers'; export function handleUploadFilesRequest( diff --git a/app/mm-redux/reducers/requests/general.ts b/app/mm-redux/reducers/requests/general.ts index 1d2dde733..2824df8c1 100644 --- a/app/mm-redux/reducers/requests/general.ts +++ b/app/mm-redux/reducers/requests/general.ts @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. import {combineReducers} from 'redux'; -import {GeneralTypes} from '@mm-redux/action_types'; +import {GeneralTypes} from '@mm-redux/action_types'; import {GenericAction} from '@mm-redux/types/actions'; import {GeneralRequestsStatuses, RequestStatusType} from '@mm-redux/types/requests'; diff --git a/app/mm-redux/reducers/requests/helpers.ts b/app/mm-redux/reducers/requests/helpers.ts index 914ff5933..f4a1ff146 100644 --- a/app/mm-redux/reducers/requests/helpers.ts +++ b/app/mm-redux/reducers/requests/helpers.ts @@ -1,8 +1,9 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {RequestStatus} from '../../constants'; import {GenericAction} from '@mm-redux/types/actions'; import {RequestStatusType} from '@mm-redux/types/requests'; + +import {RequestStatus} from '../../constants'; export function initialRequestState(): RequestStatusType { return { status: RequestStatus.NOT_STARTED, diff --git a/app/mm-redux/reducers/requests/index.ts b/app/mm-redux/reducers/requests/index.ts index ffcc2896c..fbce3d55c 100644 --- a/app/mm-redux/reducers/requests/index.ts +++ b/app/mm-redux/reducers/requests/index.ts @@ -7,10 +7,10 @@ import channels from './channels'; import files from './files'; import general from './general'; import posts from './posts'; +import roles from './roles'; +import search from './search'; import teams from './teams'; import users from './users'; -import search from './search'; -import roles from './roles'; export default combineReducers({ channels, diff --git a/app/mm-redux/reducers/requests/posts.ts b/app/mm-redux/reducers/requests/posts.ts index 2dc39bddf..06b37f433 100644 --- a/app/mm-redux/reducers/requests/posts.ts +++ b/app/mm-redux/reducers/requests/posts.ts @@ -1,11 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. import {combineReducers} from 'redux'; + import {PostTypes} from '@mm-redux/action_types'; -import {handleRequest, initialRequestState} from './helpers'; import {GenericAction} from '@mm-redux/types/actions'; import {PostsRequestsStatuses, RequestStatusType} from '@mm-redux/types/requests'; +import {handleRequest, initialRequestState} from './helpers'; + function createPost(state: RequestStatusType = initialRequestState(), action: GenericAction): RequestStatusType { if (action.type === PostTypes.CREATE_POST_RESET_REQUEST) { return initialRequestState(); diff --git a/app/mm-redux/reducers/requests/roles.ts b/app/mm-redux/reducers/requests/roles.ts index 52066c28b..76545e417 100644 --- a/app/mm-redux/reducers/requests/roles.ts +++ b/app/mm-redux/reducers/requests/roles.ts @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. import {combineReducers} from 'redux'; -import {RoleTypes} from '@mm-redux/action_types'; +import {RoleTypes} from '@mm-redux/action_types'; import {GenericAction} from '@mm-redux/types/actions'; import {RolesRequestsStatuses, RequestStatusType} from '@mm-redux/types/requests'; diff --git a/app/mm-redux/reducers/requests/search.ts b/app/mm-redux/reducers/requests/search.ts index 32e0d4de9..fa4ee2c85 100644 --- a/app/mm-redux/reducers/requests/search.ts +++ b/app/mm-redux/reducers/requests/search.ts @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. import {combineReducers} from 'redux'; -import {SearchTypes} from '@mm-redux/action_types'; +import {SearchTypes} from '@mm-redux/action_types'; import {GenericAction} from '@mm-redux/types/actions'; import {SearchRequestsStatuses, RequestStatusType} from '@mm-redux/types/requests'; diff --git a/app/mm-redux/reducers/requests/teams.ts b/app/mm-redux/reducers/requests/teams.ts index 964af4165..c644f95e4 100644 --- a/app/mm-redux/reducers/requests/teams.ts +++ b/app/mm-redux/reducers/requests/teams.ts @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. import {combineReducers} from 'redux'; -import {TeamTypes} from '@mm-redux/action_types'; +import {TeamTypes} from '@mm-redux/action_types'; import {GenericAction} from '@mm-redux/types/actions'; import {TeamsRequestsStatuses, RequestStatusType} from '@mm-redux/types/requests'; diff --git a/app/mm-redux/reducers/requests/users.ts b/app/mm-redux/reducers/requests/users.ts index 1d08e694c..d6f6a3939 100644 --- a/app/mm-redux/reducers/requests/users.ts +++ b/app/mm-redux/reducers/requests/users.ts @@ -1,12 +1,14 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {combineReducers} from 'redux'; -import {RequestStatus} from '../../constants'; -import {UserTypes} from '@mm-redux/action_types'; +import {combineReducers} from 'redux'; + +import {UserTypes} from '@mm-redux/action_types'; import {GenericAction} from '@mm-redux/types/actions'; import {UsersRequestsStatuses, RequestStatusType} from '@mm-redux/types/requests'; +import {RequestStatus} from '../../constants'; + import {handleRequest, initialRequestState} from './helpers'; function checkMfa(state: RequestStatusType = initialRequestState(), action: GenericAction): RequestStatusType { diff --git a/app/mm-redux/selectors/entities/apps.ts b/app/mm-redux/selectors/entities/apps.ts index 85673bb98..9f22598ba 100644 --- a/app/mm-redux/selectors/entities/apps.ts +++ b/app/mm-redux/selectors/entities/apps.ts @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {GlobalState} from '@mm-redux/types/store'; import {AppBinding} from '@mm-redux/types/apps'; +import {GlobalState} from '@mm-redux/types/store'; export function getAppsBindings(state: GlobalState, location?: string): AppBinding[] { if (!state.entities.apps.bindings) { diff --git a/app/mm-redux/selectors/entities/channel_categories.test.js b/app/mm-redux/selectors/entities/channel_categories.test.js index a7d1f75cb..fdd3ace3b 100644 --- a/app/mm-redux/selectors/entities/channel_categories.test.js +++ b/app/mm-redux/selectors/entities/channel_categories.test.js @@ -1,19 +1,17 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {General, Preferences} from '../../constants'; -import {CategoryTypes} from '../../constants/channel_categories'; - import {getCurrentChannelId, getMyChannelMemberships} from '@mm-redux/selectors/entities/channels'; import {getConfig} from '@mm-redux/selectors/entities/general'; import {getLastPostPerChannel} from '@mm-redux/selectors/entities/posts'; import {getMyPreferences} from '@mm-redux/selectors/entities/preferences'; import {getCurrentUserId} from '@mm-redux/selectors/entities/users'; - import {isGroupOrDirectChannelVisible} from '@mm-redux/utils/channel_utils'; import {getPreferenceKey} from '@mm-redux/utils/preference_utils'; +import mergeObjects from '@test/merge_objects'; -import mergeObjects from 'test/merge_objects'; +import {General, Preferences} from '../../constants'; +import {CategoryTypes} from '../../constants/channel_categories'; import * as Selectors from './channel_categories'; diff --git a/app/mm-redux/selectors/entities/channel_categories.ts b/app/mm-redux/selectors/entities/channel_categories.ts index 3f0851040..b40f1c8c5 100644 --- a/app/mm-redux/selectors/entities/channel_categories.ts +++ b/app/mm-redux/selectors/entities/channel_categories.ts @@ -4,25 +4,23 @@ import {createSelector} from 'reselect'; import shallowEquals from 'shallow-equals'; -import {General, Preferences} from '../../constants'; -import {CategoryTypes} from '../../constants/channel_categories'; - import {getCurrentChannelId, getMyChannelMemberships} from '@mm-redux/selectors/entities/channels'; import {getCurrentUserLocale} from '@mm-redux/selectors/entities/i18n'; import {getLastPostPerChannel} from '@mm-redux/selectors/entities/posts'; import {getMyPreferences, getTeammateNameDisplaySetting, isCollapsedThreadsEnabled, shouldAutocloseDMs} from '@mm-redux/selectors/entities/preferences'; import {getCurrentUserId} from '@mm-redux/selectors/entities/users'; - -import {Channel, ChannelMembership} from '@mm-redux/types/channels'; import {ChannelCategory} from '@mm-redux/types/channel_categories'; +import {Channel, ChannelMembership} from '@mm-redux/types/channels'; import {GlobalState} from '@mm-redux/types/store'; import {UserProfile} from '@mm-redux/types/users'; import {IDMappedObjects, RelationOneToOne} from '@mm-redux/types/utilities'; - import {getUserIdFromChannelName, isFavoriteChannel, isUnreadChannel} from '@mm-redux/utils/channel_utils'; import {getPreferenceKey} from '@mm-redux/utils/preference_utils'; import {displayUsername} from '@mm-redux/utils/user_utils'; +import {General, Preferences} from '../../constants'; +import {CategoryTypes} from '../../constants/channel_categories'; + export function getCategoryIdsForTeam(state: GlobalState, teamId: string): string[] | undefined { return state.entities.channelCategories.orderByTeam[teamId]; } diff --git a/app/mm-redux/selectors/entities/channels.test.js b/app/mm-redux/selectors/entities/channels.test.js index a0e5c8e34..c5908ac7e 100644 --- a/app/mm-redux/selectors/entities/channels.test.js +++ b/app/mm-redux/selectors/entities/channels.test.js @@ -3,10 +3,11 @@ import assert from 'assert'; -import deepFreezeAndThrowOnMutation from '@mm-redux/utils/deep_freeze'; -import TestHelper from 'test/test_helper'; -import {sortChannelsByDisplayName, getDirectChannelName} from '@mm-redux/utils/channel_utils'; import * as Selectors from '@mm-redux/selectors/entities/channels'; +import {sortChannelsByDisplayName, getDirectChannelName} from '@mm-redux/utils/channel_utils'; +import deepFreezeAndThrowOnMutation from '@mm-redux/utils/deep_freeze'; +import TestHelper from '@test/test_helper'; + import {General, Preferences} from '../../constants'; const sortUsernames = (a, b) => a.localeCompare(b, General.DEFAULT_LOCALE, {numeric: true}); diff --git a/app/mm-redux/selectors/entities/channels.ts b/app/mm-redux/selectors/entities/channels.ts index e283115d7..a344d4fdd 100644 --- a/app/mm-redux/selectors/entities/channels.ts +++ b/app/mm-redux/selectors/entities/channels.ts @@ -1,31 +1,33 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. import {createSelector} from 'reselect'; -import {General, Permissions} from '../../constants'; + import {getCurrentChannelId, getCurrentUser, getUsers, getMyChannelMemberships, getMyCurrentChannelMembership} from '@mm-redux/selectors/entities/common'; import {getConfig, getLicense, hasNewPermissions} from '@mm-redux/selectors/entities/general'; -import {getFavoritesPreferences, getMyPreferences, getTeammateNameDisplaySetting, getVisibleTeammate, getVisibleGroupIds, isCollapsedThreadsEnabled} from '@mm-redux/selectors/entities/preferences'; import {getLastPostPerChannel, getAllPosts} from '@mm-redux/selectors/entities/posts'; -import {getCurrentTeamId, getCurrentTeamMembership, getMyTeams, getTeamMemberships} from '@mm-redux/selectors/entities/teams'; +import {getFavoritesPreferences, getMyPreferences, getTeammateNameDisplaySetting, getVisibleTeammate, getVisibleGroupIds, isCollapsedThreadsEnabled} from '@mm-redux/selectors/entities/preferences'; import {haveICurrentChannelPermission, haveIChannelPermission, haveITeamPermission} from '@mm-redux/selectors/entities/roles'; +import {getCurrentTeamId, getCurrentTeamMembership, getMyTeams, getTeamMemberships} from '@mm-redux/selectors/entities/teams'; import {isCurrentUserSystemAdmin, getCurrentUserId} from '@mm-redux/selectors/entities/users'; +import {Channel, ChannelStats, ChannelMembership, ChannelMemberCountsByGroup} from '@mm-redux/types/channels'; +import {Config} from '@mm-redux/types/config'; +import {Post} from '@mm-redux/types/posts'; +import {PreferenceType} from '@mm-redux/types/preferences'; +import {GlobalState} from '@mm-redux/types/store'; +import {TeamMembership, Team} from '@mm-redux/types/teams'; +import {ThreadsState} from '@mm-redux/types/threads'; +import {UsersState, UserProfile} from '@mm-redux/types/users'; +import {NameMappedObjects, UserIDMappedObjects, IDMappedObjects, RelationOneToOne, RelationOneToMany} from '@mm-redux/types/utilities'; import {buildDisplayableChannelListWithUnreadSection, canManageMembersOldPermissions, completeDirectChannelInfo, completeDirectChannelDisplayName, getUserIdFromChannelName, getChannelByName as getChannelByNameHelper, isChannelMuted, getDirectChannelName, isAutoClosed, isDirectChannelVisible, isGroupChannelVisible, isGroupOrDirectChannelVisible, sortChannelsByDisplayName, isFavoriteChannel, isDefault, sortChannelsByRecency, getMsgCountInChannel} from '@mm-redux/utils/channel_utils'; import {createIdsSelector} from '@mm-redux/utils/helpers'; -export {getCurrentChannelId, getMyChannelMemberships, getMyCurrentChannelMembership}; -import {Config} from '@mm-redux/types/config'; -import {GlobalState} from '@mm-redux/types/store'; -import {ThreadsState} from '@mm-redux/types/threads'; -import {Channel, ChannelStats, ChannelMembership, ChannelMemberCountsByGroup} from '@mm-redux/types/channels'; -import {UsersState, UserProfile} from '@mm-redux/types/users'; -import {PreferenceType} from '@mm-redux/types/preferences'; -import {Post} from '@mm-redux/types/posts'; -import {TeamMembership, Team} from '@mm-redux/types/teams'; -import {NameMappedObjects, UserIDMappedObjects, IDMappedObjects, RelationOneToOne, RelationOneToMany} from '@mm-redux/types/utilities'; +import {General, Permissions} from '../../constants'; import {getThreadCounts} from './threads'; import {getUserIdsInChannels} from './users'; +export {getCurrentChannelId, getMyChannelMemberships, getMyCurrentChannelMembership}; + type SortingType = 'recent' | 'alpha'; export function getAllChannels(state: GlobalState): IDMappedObjects { diff --git a/app/mm-redux/selectors/entities/common.ts b/app/mm-redux/selectors/entities/common.ts index 0846bc2de..cca856b59 100644 --- a/app/mm-redux/selectors/entities/common.ts +++ b/app/mm-redux/selectors/entities/common.ts @@ -1,12 +1,12 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import {createSelector} from 'reselect'; + +import {ChannelMembership, Channel} from '@mm-redux/types/channels'; import {GlobalState} from '@mm-redux/types/store'; import {UserProfile} from '@mm-redux/types/users'; -import {ChannelMembership, Channel} from '@mm-redux/types/channels'; import {RelationOneToOne, IDMappedObjects} from '@mm-redux/types/utilities'; -import {createSelector} from 'reselect'; - // Channels export function getCurrentChannelId(state: GlobalState): string { diff --git a/app/mm-redux/selectors/entities/emojis.test.js b/app/mm-redux/selectors/entities/emojis.test.js index 35d7b1109..eba24e5f8 100644 --- a/app/mm-redux/selectors/entities/emojis.test.js +++ b/app/mm-redux/selectors/entities/emojis.test.js @@ -2,10 +2,10 @@ // See LICENSE.txt for license information. import assert from 'assert'; -import TestHelper from 'test/test_helper'; -import deepFreezeAndThrowOnMutation from '@mm-redux/utils/deep_freeze'; import {getCustomEmojiIdsSortedByName} from '@mm-redux/selectors/entities/emojis'; +import deepFreezeAndThrowOnMutation from '@mm-redux/utils/deep_freeze'; +import TestHelper from '@test/test_helper'; describe('Selectors.Integrations', () => { TestHelper.initBasic(); diff --git a/app/mm-redux/selectors/entities/emojis.ts b/app/mm-redux/selectors/entities/emojis.ts index 52bad00dd..effa297ab 100644 --- a/app/mm-redux/selectors/entities/emojis.ts +++ b/app/mm-redux/selectors/entities/emojis.ts @@ -1,10 +1,11 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. import {createSelector} from 'reselect'; -import {createIdsSelector} from '@mm-redux/utils/helpers'; -import {GlobalState} from '@mm-redux/types/store'; + import {CustomEmoji} from '@mm-redux/types/emojis'; +import {GlobalState} from '@mm-redux/types/store'; import {IDMappedObjects} from '@mm-redux/types/utilities'; +import {createIdsSelector} from '@mm-redux/utils/helpers'; export function getCustomEmojis(state: GlobalState): IDMappedObjects { if (state.entities.general.config.EnableCustomEmoji !== 'true') { return {}; diff --git a/app/mm-redux/selectors/entities/files.ts b/app/mm-redux/selectors/entities/files.ts index 82535c633..a4120fe08 100644 --- a/app/mm-redux/selectors/entities/files.ts +++ b/app/mm-redux/selectors/entities/files.ts @@ -4,11 +4,9 @@ import * as reselect from 'reselect'; import {getCurrentUserLocale} from '@mm-redux/selectors/entities/i18n'; - -import {sortFileInfos} from '@mm-redux/utils/file_utils'; - import * as types from '@mm-redux/types'; import {GlobalState} from '@mm-redux/types/store'; +import {sortFileInfos} from '@mm-redux/utils/file_utils'; function getAllFiles(state: types.store.GlobalState) { return state.entities.files.files; diff --git a/app/mm-redux/selectors/entities/general.test.js b/app/mm-redux/selectors/entities/general.test.js index 6e1df4e22..273f6b786 100644 --- a/app/mm-redux/selectors/entities/general.test.js +++ b/app/mm-redux/selectors/entities/general.test.js @@ -3,10 +3,10 @@ import assert from 'assert'; -import {General} from '../../constants'; - import * as Selectors from '@mm-redux/selectors/entities/general'; +import {General} from '../../constants'; + describe('Selectors.General', () => { it('canUploadFilesOnMobile', () => { assert.equal(Selectors.canUploadFilesOnMobile({ diff --git a/app/mm-redux/selectors/entities/general.ts b/app/mm-redux/selectors/entities/general.ts index e5a060af4..97d738119 100644 --- a/app/mm-redux/selectors/entities/general.ts +++ b/app/mm-redux/selectors/entities/general.ts @@ -1,10 +1,12 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. import {createSelector} from 'reselect'; -import {isMinimumServerVersion} from '@mm-redux/utils/helpers'; -import {General} from '../../constants'; -import {GlobalState} from '@mm-redux/types/store'; + import {Config, FeatureFlags} from '@mm-redux/types/config'; +import {GlobalState} from '@mm-redux/types/store'; +import {isMinimumServerVersion} from '@mm-redux/utils/helpers'; + +import {General} from '../../constants'; export function getConfig(state: GlobalState): Partial { return state.entities.general.config; diff --git a/app/mm-redux/selectors/entities/groups.test.js b/app/mm-redux/selectors/entities/groups.test.js index bfdd1b8cc..67e74db5c 100644 --- a/app/mm-redux/selectors/entities/groups.test.js +++ b/app/mm-redux/selectors/entities/groups.test.js @@ -3,8 +3,8 @@ import assert from 'assert'; -import deepFreezeAndThrowOnMutation from '@mm-redux/utils/deep_freeze'; import * as Selectors from '@mm-redux/selectors/entities/groups'; +import deepFreezeAndThrowOnMutation from '@mm-redux/utils/deep_freeze'; describe('Selectors.Groups', () => { const teamID = 'c6ubwm63apgftbjs71enbjjpsh'; diff --git a/app/mm-redux/selectors/entities/groups.ts b/app/mm-redux/selectors/entities/groups.ts index 9de8f5770..036e418be 100644 --- a/app/mm-redux/selectors/entities/groups.ts +++ b/app/mm-redux/selectors/entities/groups.ts @@ -1,14 +1,15 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. import * as reselect from 'reselect'; + +import {getChannel} from '@mm-redux/selectors/entities/channels'; +import {getCurrentUserLocale} from '@mm-redux/selectors/entities/i18n'; +import {getTeam} from '@mm-redux/selectors/entities/teams'; +import {UserMentionKey} from '@mm-redux/selectors/entities/users'; +import {Group} from '@mm-redux/types/groups'; import {GlobalState} from '@mm-redux/types/store'; import {Dictionary, NameMappedObjects} from '@mm-redux/types/utilities'; -import {Group} from '@mm-redux/types/groups'; import {filterGroupsMatchingTerm} from '@mm-redux/utils/group_utils'; -import {getCurrentUserLocale} from '@mm-redux/selectors/entities/i18n'; -import {getChannel} from '@mm-redux/selectors/entities/channels'; -import {UserMentionKey} from '@mm-redux/selectors/entities/users'; -import {getTeam} from '@mm-redux/selectors/entities/teams'; const emptyList: any[] = []; const emptySyncables = { diff --git a/app/mm-redux/selectors/entities/i18n.test.js b/app/mm-redux/selectors/entities/i18n.test.js index c5ec4827f..abb69b153 100644 --- a/app/mm-redux/selectors/entities/i18n.test.js +++ b/app/mm-redux/selectors/entities/i18n.test.js @@ -3,8 +3,8 @@ import assert from 'assert'; -import TestHelper from 'test/test_helper'; import * as Selectors from '@mm-redux/selectors/entities/i18n'; +import TestHelper from '@test/test_helper'; describe('Selectors.I18n', () => { describe('getCurrentUserLocale', () => { diff --git a/app/mm-redux/selectors/entities/i18n.ts b/app/mm-redux/selectors/entities/i18n.ts index 68a70b811..381e31b3d 100644 --- a/app/mm-redux/selectors/entities/i18n.ts +++ b/app/mm-redux/selectors/entities/i18n.ts @@ -1,8 +1,9 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. import {getCurrentUser} from '@mm-redux/selectors/entities/common'; -import {General} from '../../constants'; import {GlobalState} from '@mm-redux/types/store'; + +import {General} from '../../constants'; export function getCurrentUserLocale(state: GlobalState, defaultLocale = General.DEFAULT_LOCALE) { const currentUser = getCurrentUser(state); diff --git a/app/mm-redux/selectors/entities/integrations.test.js b/app/mm-redux/selectors/entities/integrations.test.js index a766856b0..8e27dbbb9 100644 --- a/app/mm-redux/selectors/entities/integrations.test.js +++ b/app/mm-redux/selectors/entities/integrations.test.js @@ -2,8 +2,9 @@ // See LICENSE.txt for license information. import assert from 'assert'; -import TestHelper from 'test/test_helper'; + import deepFreezeAndThrowOnMutation from '@mm-redux/utils/deep_freeze'; +import TestHelper from '@test/test_helper'; import {getAllCommands, getAutocompleteCommandsList, getOutgoingHooksInCurrentTeam} from './integrations'; diff --git a/app/mm-redux/selectors/entities/posts.test.js b/app/mm-redux/selectors/entities/posts.test.js index fef8ce5ae..b5bf9ab27 100644 --- a/app/mm-redux/selectors/entities/posts.test.js +++ b/app/mm-redux/selectors/entities/posts.test.js @@ -3,14 +3,12 @@ import assert from 'assert'; -import {Posts, Preferences} from '../../constants'; - import * as Selectors from '@mm-redux/selectors/entities/posts'; import {makeGetProfilesForReactions} from '@mm-redux/selectors/entities/users'; - -import TestHelper from 'test/test_helper'; - import deepFreezeAndThrowOnMutation from '@mm-redux/utils/deep_freeze'; +import TestHelper from '@test/test_helper'; + +import {Posts, Preferences} from '../../constants'; describe('Selectors.Posts', () => { const user1 = TestHelper.fakeUserWithId(); diff --git a/app/mm-redux/selectors/entities/posts.ts b/app/mm-redux/selectors/entities/posts.ts index 6b975d071..2781997f2 100644 --- a/app/mm-redux/selectors/entities/posts.ts +++ b/app/mm-redux/selectors/entities/posts.ts @@ -1,18 +1,20 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. import {createSelector} from 'reselect'; + import {getCurrentUser} from '@mm-redux/selectors/entities/common'; import {getMyPreferences} from '@mm-redux/selectors/entities/preferences'; -import {createIdsSelector} from '@mm-redux/utils/helpers'; -import {Posts, Preferences} from '../../constants'; -import {isPostEphemeral, isSystemMessage, shouldFilterJoinLeavePost, comparePosts, isPostPendingOrFailed, isPostCommentMention} from '@mm-redux/utils/post_utils'; -import {getPreferenceKey} from '@mm-redux/utils/preference_utils'; -import {GlobalState} from '@mm-redux/types/store'; +import {Channel} from '@mm-redux/types/channels'; import {Post, PostWithFormatData, MessageHistory, PostOrderBlock} from '@mm-redux/types/posts'; import {Reaction} from '@mm-redux/types/reactions'; +import {GlobalState} from '@mm-redux/types/store'; import {UserProfile} from '@mm-redux/types/users'; -import {Channel} from '@mm-redux/types/channels'; import {$ID, IDMappedObjects, RelationOneToOne, RelationOneToMany, Dictionary} from '@mm-redux/types/utilities'; +import {createIdsSelector} from '@mm-redux/utils/helpers'; +import {isPostEphemeral, isSystemMessage, shouldFilterJoinLeavePost, comparePosts, isPostPendingOrFailed, isPostCommentMention} from '@mm-redux/utils/post_utils'; +import {getPreferenceKey} from '@mm-redux/utils/preference_utils'; + +import {Posts, Preferences} from '../../constants'; export function getAllPosts(state: GlobalState) { return state.entities.posts.posts; } diff --git a/app/mm-redux/selectors/entities/preferences.test.js b/app/mm-redux/selectors/entities/preferences.test.js index 246958a37..1ee61ef0b 100644 --- a/app/mm-redux/selectors/entities/preferences.test.js +++ b/app/mm-redux/selectors/entities/preferences.test.js @@ -3,13 +3,12 @@ import assert from 'assert'; -import {General, Preferences} from '../../constants'; - import * as Selectors from '@mm-redux/selectors/entities/preferences'; - import deepFreezeAndThrowOnMutation from '@mm-redux/utils/deep_freeze'; import {getPreferenceKey} from '@mm-redux/utils/preference_utils'; +import {General, Preferences} from '../../constants'; + describe('Selectors.Preferences', () => { const category1 = 'testcategory1'; const category2 = 'testcategory2'; diff --git a/app/mm-redux/selectors/entities/preferences.ts b/app/mm-redux/selectors/entities/preferences.ts index 211888aca..a84dd9628 100644 --- a/app/mm-redux/selectors/entities/preferences.ts +++ b/app/mm-redux/selectors/entities/preferences.ts @@ -2,13 +2,15 @@ // See LICENSE.txt for license information. import * as reselect from 'reselect'; -import {General, Preferences} from '../../constants'; + import {getConfig, getFeatureFlagValue, getLicense} from '@mm-redux/selectors/entities/general'; import {getCurrentTeamId} from '@mm-redux/selectors/entities/teams'; +import {PreferenceType} from '@mm-redux/types/preferences'; +import {GlobalState} from '@mm-redux/types/store'; import {createShallowSelector} from '@mm-redux/utils/helpers'; import {getPreferenceKey} from '@mm-redux/utils/preference_utils'; -import {GlobalState} from '@mm-redux/types/store'; -import {PreferenceType} from '@mm-redux/types/preferences'; + +import {General, Preferences} from '../../constants'; export function getMyPreferences(state: GlobalState) { return state.entities.preferences.myPreferences; diff --git a/app/mm-redux/selectors/entities/roles.test.js b/app/mm-redux/selectors/entities/roles.test.js index 309e661ac..f3ae7e47e 100644 --- a/app/mm-redux/selectors/entities/roles.test.js +++ b/app/mm-redux/selectors/entities/roles.test.js @@ -3,11 +3,12 @@ import assert from 'assert'; -import deepFreezeAndThrowOnMutation from '@mm-redux/utils/deep_freeze'; -import TestHelper from 'test/test_helper'; import * as Selectors from '@mm-redux/selectors/entities/roles'; -import {General} from '../../constants'; import {getMySystemPermissions, getMySystemRoles, getRoles} from '@mm-redux/selectors/entities/roles_helpers'; +import deepFreezeAndThrowOnMutation from '@mm-redux/utils/deep_freeze'; +import TestHelper from '@test/test_helper'; + +import {General} from '../../constants'; describe('Selectors.Roles', () => { const team1 = TestHelper.fakeTeamWithId(); diff --git a/app/mm-redux/selectors/entities/roles.ts b/app/mm-redux/selectors/entities/roles.ts index 78e7ba2f5..1c5379ef1 100644 --- a/app/mm-redux/selectors/entities/roles.ts +++ b/app/mm-redux/selectors/entities/roles.ts @@ -1,13 +1,15 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. import * as reselect from 'reselect'; + import {getCurrentChannelId} from '@mm-redux/selectors/entities/common'; -import {getTeamMemberships, getCurrentTeamId} from './teams'; -import * as types from '@mm-redux/types'; import {getMySystemPermissions, getMySystemRoles, getRoles, PermissionsOptions} from '@mm-redux/selectors/entities/roles_helpers'; +import * as types from '@mm-redux/types'; +import {Role} from '@mm-redux/types/roles'; import {GlobalState} from '@mm-redux/types/store'; import {Dictionary} from '@mm-redux/types/utilities'; -import {Role} from '@mm-redux/types/roles'; + +import {getTeamMemberships, getCurrentTeamId} from './teams'; export {getMySystemPermissions, getMySystemRoles, getRoles}; diff --git a/app/mm-redux/selectors/entities/roles_helpers.ts b/app/mm-redux/selectors/entities/roles_helpers.ts index 4f4ffcfbc..162e21b1f 100644 --- a/app/mm-redux/selectors/entities/roles_helpers.ts +++ b/app/mm-redux/selectors/entities/roles_helpers.ts @@ -1,9 +1,10 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. import * as reselect from 'reselect'; -import {GlobalState} from '@mm-redux/types/store'; + import {getCurrentUser} from '@mm-redux/selectors/entities/common'; import * as types from '@mm-redux/types'; +import {GlobalState} from '@mm-redux/types/store'; export type PermissionsOptions = { channel?: string; diff --git a/app/mm-redux/selectors/entities/search.test.js b/app/mm-redux/selectors/entities/search.test.js index 5dfcc6280..8475d2722 100644 --- a/app/mm-redux/selectors/entities/search.test.js +++ b/app/mm-redux/selectors/entities/search.test.js @@ -3,9 +3,9 @@ import assert from 'assert'; -import deepFreezeAndThrowOnMutation from '@mm-redux/utils/deep_freeze'; -import TestHelper from 'test/test_helper'; import * as Selectors from '@mm-redux/selectors/entities/search'; +import deepFreezeAndThrowOnMutation from '@mm-redux/utils/deep_freeze'; +import TestHelper from '@test/test_helper'; describe('Selectors.Search', () => { const team1 = TestHelper.fakeTeamWithId(); diff --git a/app/mm-redux/selectors/entities/search.ts b/app/mm-redux/selectors/entities/search.ts index 48ae82811..58896fb4f 100644 --- a/app/mm-redux/selectors/entities/search.ts +++ b/app/mm-redux/selectors/entities/search.ts @@ -2,13 +2,14 @@ // See LICENSE.txt for license information. import * as reselect from 'reselect'; -import {GlobalState} from '@mm-redux/types/store'; -import {Channel} from '@mm-redux/types/channels'; -import {UserMentionKey} from './users'; -import {getCurrentUserMentionKeys} from '@mm-redux/selectors/entities/users'; -import {getMyGroupMentionKeys, getMyGroupMentionKeysForChannel} from '@mm-redux/selectors/entities/groups'; +import {getMyGroupMentionKeys, getMyGroupMentionKeysForChannel} from '@mm-redux/selectors/entities/groups'; import {getCurrentTeamId} from '@mm-redux/selectors/entities/teams'; +import {getCurrentUserMentionKeys} from '@mm-redux/selectors/entities/users'; +import {Channel} from '@mm-redux/types/channels'; +import {GlobalState} from '@mm-redux/types/store'; + +import {UserMentionKey} from './users'; export const getCurrentSearchForCurrentTeam = reselect.createSelector( (state: GlobalState) => state.entities.search.current, diff --git a/app/mm-redux/selectors/entities/teams.test.js b/app/mm-redux/selectors/entities/teams.test.js index 64e85e807..fa70268bd 100644 --- a/app/mm-redux/selectors/entities/teams.test.js +++ b/app/mm-redux/selectors/entities/teams.test.js @@ -3,11 +3,11 @@ import assert from 'assert'; -import deepFreezeAndThrowOnMutation from '@mm-redux/utils/deep_freeze'; -import TestHelper from 'test/test_helper'; -import * as Selectors from '@mm-redux/selectors/entities/teams'; -import {getPreferenceKey} from '@mm-redux/utils/preference_utils'; import {General, Preferences} from '@mm-redux/constants'; +import * as Selectors from '@mm-redux/selectors/entities/teams'; +import deepFreezeAndThrowOnMutation from '@mm-redux/utils/deep_freeze'; +import {getPreferenceKey} from '@mm-redux/utils/preference_utils'; +import TestHelper from '@test/test_helper'; describe('Selectors.Teams', () => { TestHelper.initMockEntities(); diff --git a/app/mm-redux/selectors/entities/teams.ts b/app/mm-redux/selectors/entities/teams.ts index 47d981af6..1b961e4dd 100644 --- a/app/mm-redux/selectors/entities/teams.ts +++ b/app/mm-redux/selectors/entities/teams.ts @@ -1,16 +1,17 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. import * as reselect from 'reselect'; + import {Permissions, Preferences} from '@mm-redux/constants'; import {getConfig, getCurrentUrl, isCompatibleWithJoinViewTeamPermissions} from '@mm-redux/selectors/entities/general'; import {get as getPreference} from '@mm-redux/selectors/entities/preferences'; import {haveISystemPermission} from '@mm-redux/selectors/entities/roles_helpers'; -import {createIdsSelector} from '@mm-redux/utils/helpers'; -import {isTeamAdmin} from '@mm-redux/utils/user_utils'; -import {sortTeamsByUserPreference, sortTeamsWithLocale} from '@mm-redux/utils/team_utils'; +import {GlobalState} from '@mm-redux/types/store'; import {Team, TeamMembership} from '@mm-redux/types/teams'; import {IDMappedObjects} from '@mm-redux/types/utilities'; -import {GlobalState} from '@mm-redux/types/store'; +import {createIdsSelector} from '@mm-redux/utils/helpers'; +import {sortTeamsByUserPreference, sortTeamsWithLocale} from '@mm-redux/utils/team_utils'; +import {isTeamAdmin} from '@mm-redux/utils/user_utils'; import {isCollapsedThreadsEnabled} from './preferences'; diff --git a/app/mm-redux/selectors/entities/threads.test.js b/app/mm-redux/selectors/entities/threads.test.js index 9518443ae..c8d9154f1 100644 --- a/app/mm-redux/selectors/entities/threads.test.js +++ b/app/mm-redux/selectors/entities/threads.test.js @@ -3,9 +3,9 @@ import assert from 'assert'; -import deepFreezeAndThrowOnMutation from '@mm-redux/utils/deep_freeze'; -import TestHelper from 'test/test_helper'; import * as Selectors from '@mm-redux/selectors/entities/threads'; +import deepFreezeAndThrowOnMutation from '@mm-redux/utils/deep_freeze'; +import TestHelper from '@test/test_helper'; describe('Selectors.Threads.getThreadOrderInCurrentTeam', () => { const team1 = TestHelper.fakeTeamWithId(); diff --git a/app/mm-redux/selectors/entities/threads.ts b/app/mm-redux/selectors/entities/threads.ts index f0128621f..8a7d6885e 100644 --- a/app/mm-redux/selectors/entities/threads.ts +++ b/app/mm-redux/selectors/entities/threads.ts @@ -2,6 +2,7 @@ // See LICENSE.txt for license information. import {createSelector} from 'reselect'; + import {getChannel} from '@mm-redux/selectors/entities/channels'; import {getPost} from '@mm-redux/selectors/entities/posts'; import {getCurrentTeamId} from '@mm-redux/selectors/entities/teams'; diff --git a/app/mm-redux/selectors/entities/timezone.ts b/app/mm-redux/selectors/entities/timezone.ts index 7b439d40b..131a4b1ac 100644 --- a/app/mm-redux/selectors/entities/timezone.ts +++ b/app/mm-redux/selectors/entities/timezone.ts @@ -4,7 +4,6 @@ import {createSelector} from 'reselect'; import {getCurrentUser} from '@mm-redux/selectors/entities/common'; - import {GlobalState} from '@mm-redux/types/store'; import {UserProfile} from '@mm-redux/types/users'; diff --git a/app/mm-redux/selectors/entities/typing.ts b/app/mm-redux/selectors/entities/typing.ts index 35ea53fce..0de50d41a 100644 --- a/app/mm-redux/selectors/entities/typing.ts +++ b/app/mm-redux/selectors/entities/typing.ts @@ -1,13 +1,14 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. import {createSelector} from 'reselect'; + import {getCurrentChannelId, getUsers} from '@mm-redux/selectors/entities/common'; import {getTeammateNameDisplaySetting} from '@mm-redux/selectors/entities/preferences'; -import {displayUsername} from '@mm-redux/utils/user_utils'; +import {GlobalState} from '@mm-redux/types/store'; import {Typing} from '@mm-redux/types/typing'; import {UserProfile} from '@mm-redux/types/users'; -import {GlobalState} from '@mm-redux/types/store'; import {IDMappedObjects} from '@mm-redux/types/utilities'; +import {displayUsername} from '@mm-redux/utils/user_utils'; const getUsersTypingImpl = (profiles: IDMappedObjects, teammateNameDisplay: string, channelId: string, parentPostId: string, typing: Typing): Array => { const id = channelId + parentPostId; diff --git a/app/mm-redux/selectors/entities/users.test.js b/app/mm-redux/selectors/entities/users.test.js index aff25ba08..b4a9b5ebb 100644 --- a/app/mm-redux/selectors/entities/users.test.js +++ b/app/mm-redux/selectors/entities/users.test.js @@ -3,11 +3,12 @@ import assert from 'assert'; -import {General, Preferences} from '../../constants'; +import * as Selectors from '@mm-redux/selectors/entities/users'; import deepFreezeAndThrowOnMutation from '@mm-redux/utils/deep_freeze'; import {sortByUsername} from '@mm-redux/utils/user_utils'; -import TestHelper from 'test/test_helper'; -import * as Selectors from '@mm-redux/selectors/entities/users'; +import TestHelper from '@test/test_helper'; + +import {General, Preferences} from '../../constants'; describe('Selectors.Users', () => { const team1 = TestHelper.fakeTeamWithId(); diff --git a/app/mm-redux/selectors/entities/users.ts b/app/mm-redux/selectors/entities/users.ts index 28234ddca..2e9336f61 100644 --- a/app/mm-redux/selectors/entities/users.ts +++ b/app/mm-redux/selectors/entities/users.ts @@ -1,17 +1,18 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. import {createSelector} from 'reselect'; + import {getCurrentChannelId, getCurrentUser, getCurrentUserId, getMyCurrentChannelMembership, getUsers} from '@mm-redux/selectors/entities/common'; import {getConfig, getLicense} from '@mm-redux/selectors/entities/general'; import {getDirectShowPreferences, getTeammateNameDisplaySetting} from '@mm-redux/selectors/entities/preferences'; -import {displayUsername, filterProfilesMatchingTerm, sortByUsername, isSystemAdmin, profileListToMap} from '@mm-redux/utils/user_utils'; export {getCurrentUserId, getCurrentUser, getUsers}; -import {GlobalState} from '@mm-redux/types/store'; -import {UserProfile} from '@mm-redux/types/users'; -import {Reaction} from '@mm-redux/types/reactions'; -import {Team} from '@mm-redux/types/teams'; import {Channel} from '@mm-redux/types/channels'; +import {Reaction} from '@mm-redux/types/reactions'; +import {GlobalState} from '@mm-redux/types/store'; +import {Team} from '@mm-redux/types/teams'; +import {UserProfile} from '@mm-redux/types/users'; import {RelationOneToOne, RelationOneToMany, IDMappedObjects, UsernameMappedObjects, EmailMappedObjects, $ID, $Username, $Email, Dictionary} from '@mm-redux/types/utilities'; +import {displayUsername, filterProfilesMatchingTerm, sortByUsername, isSystemAdmin, profileListToMap} from '@mm-redux/utils/user_utils'; type Filters = { role?: string; inactive?: boolean; diff --git a/app/mm-redux/types/channel_categories.ts b/app/mm-redux/types/channel_categories.ts index 2aa50d10e..0d1c7a382 100644 --- a/app/mm-redux/types/channel_categories.ts +++ b/app/mm-redux/types/channel_categories.ts @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {$ID, IDMappedObjects, RelationOneToOne} from './utilities'; import {Team} from './teams'; +import {$ID, IDMappedObjects, RelationOneToOne} from './utilities'; export type ChannelCategoryType = 'favorites' | 'public' | 'private' | 'direct_messages' | 'custom'; diff --git a/app/mm-redux/types/channels.ts b/app/mm-redux/types/channels.ts index 54adee04d..5655ff9f5 100644 --- a/app/mm-redux/types/channels.ts +++ b/app/mm-redux/types/channels.ts @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {IDMappedObjects, UserIDMappedObjects, RelationOneToMany, RelationOneToOne} from './utilities'; import {Team} from './teams'; +import {IDMappedObjects, UserIDMappedObjects, RelationOneToMany, RelationOneToOne} from './utilities'; export type ChannelType = 'O' | 'P' | 'D' | 'G'; export type ChannelStats = { channel_id: string; diff --git a/app/mm-redux/types/index.ts b/app/mm-redux/types/index.ts index cdfc28814..8add318ea 100644 --- a/app/mm-redux/types/index.ts +++ b/app/mm-redux/types/index.ts @@ -2,14 +2,17 @@ // See LICENSE.txt for license information. import * as actions from './actions'; +import * as bots from './bots'; import * as channels from './channels'; import * as client4 from './client4'; -import * as errors from './errors'; +import * as config from './config'; import * as emojis from './emojis'; +import * as errors from './errors'; import * as files from './files'; import * as general from './general'; import * as groups from './groups'; import * as integrations from './integrations'; +import * as plugins from './plugins'; import * as posts from './posts'; import * as preferences from './preferences'; import * as reactions from './reactions'; @@ -18,13 +21,10 @@ import * as roles from './roles'; import * as search from './search'; import * as store from './store'; import * as teams from './teams'; -import * as typing from './typing'; -import * as utilities from './utilities'; -import * as users from './users'; -import * as bots from './bots'; -import * as plugins from './plugins'; -import * as config from './config'; import * as threads from './threads'; +import * as typing from './typing'; +import * as users from './users'; +import * as utilities from './utilities'; export { config, diff --git a/app/mm-redux/types/store.ts b/app/mm-redux/types/store.ts index 49da68063..052bbdc5c 100644 --- a/app/mm-redux/types/store.ts +++ b/app/mm-redux/types/store.ts @@ -1,26 +1,26 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {GeneralState} from './general'; -import {UsersState} from './users'; -import {TeamsState} from './teams'; -import {ChannelsState} from './channels'; -import {PostsState} from './posts'; -import {SearchState} from './search'; -import {IntegrationsState} from './integrations'; -import {FilesState} from './files'; -import {EmojisState} from './emojis'; -import {Typing} from './typing'; -import {GroupsState} from './groups'; -import {ChannelsRequestsStatuses, GeneralRequestsStatuses, PostsRequestsStatuses, TeamsRequestsStatuses, UsersRequestsStatuses, FilesRequestsStatuses, RolesRequestsStatuses} from './requests'; -import {Role} from './roles'; -import {PreferenceType} from './preferences'; +import {AppsState} from './apps'; import {Bot} from './bots'; import {ChannelCategoriesState} from './channel_categories'; +import {ChannelsState} from './channels'; +import {EmojisState} from './emojis'; +import {FilesState} from './files'; +import {GeneralState} from './general'; +import {GroupsState} from './groups'; +import {IntegrationsState} from './integrations'; +import {PostsState} from './posts'; +import {PreferenceType} from './preferences'; import {RemoteCluster} from './remote_cluster'; -import {Dictionary} from './utilities'; +import {ChannelsRequestsStatuses, GeneralRequestsStatuses, PostsRequestsStatuses, TeamsRequestsStatuses, UsersRequestsStatuses, FilesRequestsStatuses, RolesRequestsStatuses} from './requests'; +import {Role} from './roles'; +import {SearchState} from './search'; +import {TeamsState} from './teams'; import {ThreadsState} from './threads'; -import {AppsState} from './apps'; +import {Typing} from './typing'; +import {UsersState} from './users'; +import {Dictionary} from './utilities'; export type GlobalState = { entities: { diff --git a/app/mm-redux/types/teams.ts b/app/mm-redux/types/teams.ts index 18c619428..11e5aea54 100644 --- a/app/mm-redux/types/teams.ts +++ b/app/mm-redux/types/teams.ts @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {Dictionary} from './utilities'; import {Error} from './errors'; +import {Dictionary} from './utilities'; export type TeamMembership = { mention_count: number; diff --git a/app/mm-redux/types/users.ts b/app/mm-redux/types/users.ts index f6c671a5d..e828d5b49 100644 --- a/app/mm-redux/types/users.ts +++ b/app/mm-redux/types/users.ts @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. import {Channel} from './channels'; -import {Team} from './teams'; import {PostType} from './posts'; +import {Team} from './teams'; import {$ID, IDMappedObjects, RelationOneToMany, RelationOneToOne, Dictionary} from './utilities'; export type UserNotifyProps = { auto_responder_active?: 'true' | 'false'; diff --git a/app/mm-redux/utils/channel_utils.test.js b/app/mm-redux/utils/channel_utils.test.js index 809b0da2a..4df121ac1 100644 --- a/app/mm-redux/utils/channel_utils.test.js +++ b/app/mm-redux/utils/channel_utils.test.js @@ -3,9 +3,6 @@ import assert from 'assert'; -import {General, Users} from '../constants'; -import TestHelper from 'test/test_helper'; - import { areChannelMentionsIgnored, canManageMembersOldPermissions, @@ -16,6 +13,9 @@ import { sortChannelsByRecency, sortChannelsByDisplayName, } from '@mm-redux/utils/channel_utils'; +import TestHelper from '@test/test_helper'; + +import {General, Users} from '../constants'; describe('ChannelUtils', () => { it('canManageMembersOldPermissions', () => { diff --git a/app/mm-redux/utils/channel_utils.ts b/app/mm-redux/utils/channel_utils.ts index d8e32b570..2b011f1e6 100644 --- a/app/mm-redux/utils/channel_utils.ts +++ b/app/mm-redux/utils/channel_utils.ts @@ -1,18 +1,18 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {General, Preferences, Permissions, Users} from '../constants'; - import {hasNewPermissions} from '@mm-redux/selectors/entities/general'; import {haveITeamPermission, haveIChannelPermission} from '@mm-redux/selectors/entities/roles'; import {Channel, ChannelMembership, ChannelType, ChannelNotifyProps} from '@mm-redux/types/channels'; import {Post} from '@mm-redux/types/posts'; -import {UserProfile, UsersState, UserNotifyProps} from '@mm-redux/types/users'; +import {PreferenceType} from '@mm-redux/types/preferences'; import {GlobalState} from '@mm-redux/types/store'; import {TeamMembership} from '@mm-redux/types/teams'; -import {PreferenceType} from '@mm-redux/types/preferences'; +import {UserProfile, UsersState, UserNotifyProps} from '@mm-redux/types/users'; import {RelationOneToOne, IDMappedObjects} from '@mm-redux/types/utilities'; +import {General, Preferences, Permissions, Users} from '../constants'; + import {getPreferenceKey, getPreferencesByCategory} from './preference_utils'; import {displayUsername} from './user_utils'; diff --git a/app/mm-redux/utils/file_utils.test.js b/app/mm-redux/utils/file_utils.test.js index 717761294..09e305d53 100644 --- a/app/mm-redux/utils/file_utils.test.js +++ b/app/mm-redux/utils/file_utils.test.js @@ -2,8 +2,8 @@ // See LICENSE.txt for license information. import assert from 'assert'; -import {Client4} from '@client/rest'; +import {Client4} from '@client/rest'; import * as FileUtils from '@mm-redux/utils/file_utils'; describe('FileUtils', () => { diff --git a/app/mm-redux/utils/file_utils.ts b/app/mm-redux/utils/file_utils.ts index e8c8867db..c7278b31b 100644 --- a/app/mm-redux/utils/file_utils.ts +++ b/app/mm-redux/utils/file_utils.ts @@ -1,10 +1,11 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {Files, General} from '../constants'; import {Client4} from '@client/rest'; import {FileInfo} from '@mm-redux/types/files'; import {Dictionary} from '@mm-redux/types/utilities'; +import {Files, General} from '../constants'; + const mimeDB = require('mime-db'); export function getFormattedFileSize(file: FileInfo): string { diff --git a/app/mm-redux/utils/group_utils.ts b/app/mm-redux/utils/group_utils.ts index f881a6840..f758c0fa6 100644 --- a/app/mm-redux/utils/group_utils.ts +++ b/app/mm-redux/utils/group_utils.ts @@ -1,7 +1,9 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {General} from '../constants'; import {Group} from '@mm-redux/types/groups'; + +import {General} from '../constants'; + import {getSuggestionsSplitByMultiple} from './user_utils'; export function filterGroupsMatchingTerm(groups: Array, term: string): Array { diff --git a/app/mm-redux/utils/helpers.ts b/app/mm-redux/utils/helpers.ts index da6d53a97..dfa313208 100644 --- a/app/mm-redux/utils/helpers.ts +++ b/app/mm-redux/utils/helpers.ts @@ -2,6 +2,7 @@ // See LICENSE.txt for license information. import * as reselect from 'reselect'; import shallowEqual from 'shallow-equals'; + import {Dictionary} from '@mm-redux/types/utilities'; export function memoizeResult(func: F): any { let lastArgs: IArguments|null = null; diff --git a/app/mm-redux/utils/i18n_utils.test.js b/app/mm-redux/utils/i18n_utils.test.js index 3fbae6b2b..aff76ec4e 100644 --- a/app/mm-redux/utils/i18n_utils.test.js +++ b/app/mm-redux/utils/i18n_utils.test.js @@ -4,6 +4,7 @@ import assert from 'assert'; import {setLocalizeFunction, localizeMessage} from '@mm-redux/utils/i18n_utils'; + const en = require('@assets/i18n/en.json'); const [testKey, testValue] = Object.entries(en)[0]; diff --git a/app/mm-redux/utils/integration_utils.test.js b/app/mm-redux/utils/integration_utils.test.js index 580f27a8c..d27c468a6 100644 --- a/app/mm-redux/utils/integration_utils.test.js +++ b/app/mm-redux/utils/integration_utils.test.js @@ -2,6 +2,7 @@ // See LICENSE.txt for license information. import assert from 'assert'; + import {checkDialogElementForError, checkIfErrorsMatchElements} from '@mm-redux/utils/integration_utils'; describe('integration utils', () => { diff --git a/app/mm-redux/utils/notify_props.test.js b/app/mm-redux/utils/notify_props.test.js index 5d629f7dc..7b35b2a4d 100644 --- a/app/mm-redux/utils/notify_props.test.js +++ b/app/mm-redux/utils/notify_props.test.js @@ -3,9 +3,10 @@ import assert from 'assert'; -import {Preferences} from '../constants'; import {getEmailInterval} from '@mm-redux/utils/notify_props'; +import {Preferences} from '../constants'; + describe('user utils', () => { it('getEmailInterval should return correct interval', () => { const testCases = [ diff --git a/app/mm-redux/utils/post_list.test.js b/app/mm-redux/utils/post_list.test.js index 294208094..dda8e8a39 100644 --- a/app/mm-redux/utils/post_list.test.js +++ b/app/mm-redux/utils/post_list.test.js @@ -3,11 +3,11 @@ import assert from 'assert'; -import {Posts, Preferences} from '../constants'; import deepFreeze from '@mm-redux/utils/deep_freeze'; import {getPreferenceKey} from '@mm-redux/utils/preference_utils'; +import TestHelper from '@test/test_helper'; -import TestHelper from 'test/test_helper'; +import {Posts, Preferences} from '../constants'; import { combineUserActivitySystemPost, diff --git a/app/mm-redux/utils/post_list.ts b/app/mm-redux/utils/post_list.ts index 6dbebcdc0..5372388b4 100644 --- a/app/mm-redux/utils/post_list.ts +++ b/app/mm-redux/utils/post_list.ts @@ -1,23 +1,25 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import * as reselect from 'reselect'; import moment from 'moment-timezone'; -import {Posts, Preferences} from '../constants'; +import * as reselect from 'reselect'; + import {makeGetPostsForIds} from '@mm-redux/selectors/entities/posts'; import {getBool} from '@mm-redux/selectors/entities/preferences'; import {isTimezoneEnabled} from '@mm-redux/selectors/entities/timezone'; import {getCurrentUser} from '@mm-redux/selectors/entities/users'; +import * as types from '@mm-redux/types'; +import {GlobalState} from '@mm-redux/types/store'; import {createIdsSelector, memoizeResult} from '@mm-redux/utils/helpers'; import {isUserActivityPost, shouldFilterJoinLeavePost} from '@mm-redux/utils/post_utils'; import {getUserCurrentTimezone} from '@mm-redux/utils/timezone_utils'; -import * as types from '@mm-redux/types'; + +import {Posts, Preferences} from '../constants'; + export const COMBINED_USER_ACTIVITY = 'user-activity-'; export const DATE_LINE = 'date-'; export const START_OF_NEW_MESSAGES = 'start-of-new-messages'; export const MAX_COMBINED_SYSTEM_POSTS = 100; -import {GlobalState} from '@mm-redux/types/store'; - function shouldShowJoinLeaveMessages(state: GlobalState) { // This setting is true or not set if join/leave messages are to be displayed return getBool(state, Preferences.CATEGORY_ADVANCED_SETTINGS, Preferences.ADVANCED_FILTER_JOIN_LEAVE, true); diff --git a/app/mm-redux/utils/post_utils.test.js b/app/mm-redux/utils/post_utils.test.js index 99c87409f..e6e1c64af 100644 --- a/app/mm-redux/utils/post_utils.test.js +++ b/app/mm-redux/utils/post_utils.test.js @@ -4,8 +4,6 @@ import assert from 'assert'; import {PostTypes} from '@mm-redux/constants/posts'; -import {Permissions} from '../constants'; - import { canEditPost, isSystemMessage, @@ -16,6 +14,8 @@ import { getEmbedFromMetadata, } from '@mm-redux/utils/post_utils'; +import {Permissions} from '../constants'; + describe('PostUtils', () => { describe('shouldFilterJoinLeavePost', () => { it('show join/leave posts', () => { diff --git a/app/mm-redux/utils/post_utils.ts b/app/mm-redux/utils/post_utils.ts index 0623147b5..d07031ac3 100644 --- a/app/mm-redux/utils/post_utils.ts +++ b/app/mm-redux/utils/post_utils.ts @@ -1,18 +1,18 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {General, Posts, Preferences, Permissions} from '../constants'; import {hasNewPermissions} from '@mm-redux/selectors/entities/general'; import {haveIChannelPermission} from '@mm-redux/selectors/entities/roles'; - -import {GlobalState} from '@mm-redux/types/store'; -import {PreferenceType} from '@mm-redux/types/preferences'; -import {Post, PostType, PostMetadata, PostEmbed} from '@mm-redux/types/posts'; -import {UserProfile} from '@mm-redux/types/users'; -import {Team} from '@mm-redux/types/teams'; import {Channel} from '@mm-redux/types/channels'; +import {Post, PostType, PostMetadata, PostEmbed} from '@mm-redux/types/posts'; +import {PreferenceType} from '@mm-redux/types/preferences'; +import {GlobalState} from '@mm-redux/types/store'; +import {Team} from '@mm-redux/types/teams'; +import {UserProfile} from '@mm-redux/types/users'; import {$ID} from '@mm-redux/types/utilities'; import {isMinimumServerVersion} from '@mm-redux/utils/helpers'; +import {General, Posts, Preferences, Permissions} from '../constants'; + import {getPreferenceKey} from './preference_utils'; export function isPostFlagged(postId: $ID, myPreferences: { diff --git a/app/mm-redux/utils/preference_utils.ts b/app/mm-redux/utils/preference_utils.ts index cbf2b7a21..26ed8a635 100644 --- a/app/mm-redux/utils/preference_utils.ts +++ b/app/mm-redux/utils/preference_utils.ts @@ -1,10 +1,10 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {Preferences} from '../constants'; - import {PreferencesType} from '@mm-redux/types/preferences'; +import {Preferences} from '../constants'; + export function getPreferenceKey(category: string, name: string): string { return `${category}--${name}`; } diff --git a/app/mm-redux/utils/sentry.test.js b/app/mm-redux/utils/sentry.test.js index 98fc386d0..8fc30cac8 100644 --- a/app/mm-redux/utils/sentry.test.js +++ b/app/mm-redux/utils/sentry.test.js @@ -4,7 +4,6 @@ import assert from 'assert'; import {Client} from '@client/rest'; - import {cleanUrlForLogging} from '@mm-redux/utils/sentry'; describe('utils/sentry', () => { diff --git a/app/mm-redux/utils/team_utils.test.js b/app/mm-redux/utils/team_utils.test.js index d130604aa..d7d08d747 100644 --- a/app/mm-redux/utils/team_utils.test.js +++ b/app/mm-redux/utils/team_utils.test.js @@ -4,7 +4,6 @@ import assert from 'assert'; import {General} from '@mm-redux/constants'; - import {sortTeamsByUserPreference} from '@mm-redux/utils/team_utils'; describe('TeamUtils', () => { diff --git a/app/mm-redux/utils/team_utils.ts b/app/mm-redux/utils/team_utils.ts index 86be88cad..27772a47f 100644 --- a/app/mm-redux/utils/team_utils.ts +++ b/app/mm-redux/utils/team_utils.ts @@ -2,6 +2,7 @@ // See LICENSE.txt for license information. import {Team} from '@mm-redux/types/teams'; import {IDMappedObjects, Dictionary} from '@mm-redux/types/utilities'; + import {General} from '../constants'; export function teamListToMap(teamList: Array): IDMappedObjects { diff --git a/app/mm-redux/utils/theme_utils.test.js b/app/mm-redux/utils/theme_utils.test.js index f6a473e2f..f4cdec4b2 100644 --- a/app/mm-redux/utils/theme_utils.test.js +++ b/app/mm-redux/utils/theme_utils.test.js @@ -3,9 +3,10 @@ import assert from 'assert'; -import {Preferences} from '../constants'; import * as ThemeUtils from '@mm-redux/utils/theme_utils'; +import {Preferences} from '../constants'; + describe('ThemeUtils', () => { describe('getComponents', () => { it('hex color', () => { diff --git a/app/mm-redux/utils/theme_utils.ts b/app/mm-redux/utils/theme_utils.ts index 98115177f..9092a22d3 100644 --- a/app/mm-redux/utils/theme_utils.ts +++ b/app/mm-redux/utils/theme_utils.ts @@ -2,6 +2,7 @@ // See LICENSE.txt for license information. import {Theme} from '@mm-redux/types/preferences'; + import {Preferences} from '../constants'; export function makeStyleFromTheme(getStyleFromTheme: (a: any) => any): (a: any) => any { diff --git a/app/mm-redux/utils/user_utils.test.js b/app/mm-redux/utils/user_utils.test.js index a07c4e118..3dd3de0ce 100644 --- a/app/mm-redux/utils/user_utils.test.js +++ b/app/mm-redux/utils/user_utils.test.js @@ -3,7 +3,6 @@ import assert from 'assert'; -import {Preferences} from '../constants'; import { displayUsername, filterProfilesMatchingTerm, @@ -11,6 +10,8 @@ import { getSuggestionsSplitByMultiple, } from '@mm-redux/utils/user_utils'; +import {Preferences} from '../constants'; + describe('user utils', () => { describe('displayUsername', () => { const userObj = { diff --git a/app/mm-redux/utils/user_utils.ts b/app/mm-redux/utils/user_utils.ts index 1726163c3..c5e1754f8 100644 --- a/app/mm-redux/utils/user_utils.ts +++ b/app/mm-redux/utils/user_utils.ts @@ -1,9 +1,10 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {General, Preferences} from '../constants'; -import {localizeMessage} from '@mm-redux/utils/i18n_utils'; import {UserProfile} from '@mm-redux/types/users'; import {IDMappedObjects, $ID, Dictionary} from '@mm-redux/types/utilities'; +import {localizeMessage} from '@mm-redux/utils/i18n_utils'; + +import {General, Preferences} from '../constants'; export function getFullName(user: UserProfile): string { if (user.first_name && user.last_name) { return user.first_name + ' ' + user.last_name; diff --git a/app/reducers/app/index.js b/app/reducers/app/index.js index 86b019788..a09f48205 100644 --- a/app/reducers/app/index.js +++ b/app/reducers/app/index.js @@ -4,8 +4,8 @@ import {combineReducers} from 'redux'; import build from './build'; -import version from './version'; import previousVersion from './previousVersion'; +import version from './version'; export default combineReducers({ build, diff --git a/app/reducers/device/is_tablet.js b/app/reducers/device/is_tablet.js index f780d7f95..7d7e78ef4 100644 --- a/app/reducers/device/is_tablet.js +++ b/app/reducers/device/is_tablet.js @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {DeviceTypes} from 'app/constants'; +import {DeviceTypes} from '@constants'; export default function isTablet(state = false, action) { switch (action.type) { diff --git a/app/reducers/device/orientation.js b/app/reducers/device/orientation.js index 2a119f105..a1b9a4ce5 100644 --- a/app/reducers/device/orientation.js +++ b/app/reducers/device/orientation.js @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {DeviceTypes} from 'app/constants'; +import {DeviceTypes} from '@constants'; export default function orientation(state = 'PORTRAIT', action) { switch (action.type) { diff --git a/app/reducers/device/status_bar.js b/app/reducers/device/status_bar.js index e4a662f51..490ac8387 100644 --- a/app/reducers/device/status_bar.js +++ b/app/reducers/device/status_bar.js @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {DeviceTypes} from 'app/constants'; +import {DeviceTypes} from '@constants'; export default function height(state = 0, action) { switch (action.type) { diff --git a/app/reducers/views/channel.test.js b/app/reducers/views/channel.test.js index c3cd93480..2f63834d7 100644 --- a/app/reducers/views/channel.test.js +++ b/app/reducers/views/channel.test.js @@ -1,9 +1,10 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import channelReducer, {handleSetTempUploadFilesForPostDraft} from './channel'; import {ViewTypes} from '@constants'; +import channelReducer, {handleSetTempUploadFilesForPostDraft} from './channel'; + describe('Reducers.channel', () => { test('Initial state', () => { const initialState = { diff --git a/app/reducers/views/i18n.js b/app/reducers/views/i18n.js index 56111a636..06401f724 100644 --- a/app/reducers/views/i18n.js +++ b/app/reducers/views/i18n.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {combineReducers} from 'redux'; import {getLocales} from 'react-native-localize'; +import {combineReducers} from 'redux'; import {UserTypes} from '@mm-redux/action_types'; diff --git a/app/reducers/views/index.js b/app/reducers/views/index.js index 99a9a665f..5b4386cbe 100644 --- a/app/reducers/views/index.js +++ b/app/reducers/views/index.js @@ -5,7 +5,9 @@ import {combineReducers} from 'redux'; import announcement from './announcement'; import channel from './channel'; +import emoji from './emoji'; import i18n from './i18n'; +import post from './post'; import recentEmojis from './recent_emojis'; import root from './root'; import search from './search'; @@ -14,8 +16,6 @@ import team from './team'; import thread from './thread'; import threads from './threads'; import user from './user'; -import emoji from './emoji'; -import post from './post'; export default combineReducers({ announcement, diff --git a/app/reducers/views/post.js b/app/reducers/views/post.js index ade8b8212..23468d090 100644 --- a/app/reducers/views/post.js +++ b/app/reducers/views/post.js @@ -3,7 +3,7 @@ import {combineReducers} from 'redux'; -import {ViewTypes} from 'app/constants'; +import {ViewTypes} from '@constants'; function selectedMenuAction(state = {}, action) { switch (action.type) { diff --git a/app/reducers/views/recent_emojis.js b/app/reducers/views/recent_emojis.js index ef1e8d542..5e06ed491 100644 --- a/app/reducers/views/recent_emojis.js +++ b/app/reducers/views/recent_emojis.js @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {ViewTypes} from 'app/constants'; +import {ViewTypes} from '@constants'; const MAXIMUM_RECENT_EMOJI = 27; diff --git a/app/reducers/views/root.js b/app/reducers/views/root.js index 185532725..c4e5f80a1 100644 --- a/app/reducers/views/root.js +++ b/app/reducers/views/root.js @@ -3,10 +3,9 @@ import {combineReducers} from 'redux'; +import {ViewTypes} from '@constants'; import {General} from '@mm-redux/constants'; -import {ViewTypes} from 'app/constants'; - function deepLinkURL(state = '', action) { switch (action.type) { case ViewTypes.SET_DEEP_LINK_URL: { diff --git a/app/reducers/views/select_server.js b/app/reducers/views/select_server.js index 04233d981..885030dfc 100644 --- a/app/reducers/views/select_server.js +++ b/app/reducers/views/select_server.js @@ -4,8 +4,7 @@ import {combineReducers} from 'redux'; import Config from '@assets/config.json'; - -import {ViewTypes} from 'app/constants'; +import {ViewTypes} from '@constants'; function serverUrl(state = Config.DefaultServerUrl, action) { switch (action.type) { diff --git a/app/reducers/views/team.js b/app/reducers/views/team.js index a1c95d026..a402fec0e 100644 --- a/app/reducers/views/team.js +++ b/app/reducers/views/team.js @@ -2,9 +2,9 @@ // See LICENSE.txt for license information. import {combineReducers} from 'redux'; -import {ChannelTypes, TeamTypes} from '@mm-redux/action_types'; -import {ViewTypes} from 'app/constants'; +import {ViewTypes} from '@constants'; +import {ChannelTypes, TeamTypes} from '@mm-redux/action_types'; function lastTeamId(state = '', action) { switch (action.type) { diff --git a/app/reducers/views/thread.js b/app/reducers/views/thread.js index a1bc1fed2..e06951587 100644 --- a/app/reducers/views/thread.js +++ b/app/reducers/views/thread.js @@ -2,9 +2,9 @@ // See LICENSE.txt for license information. import {combineReducers} from 'redux'; -import {FileTypes, PostTypes} from '@mm-redux/action_types'; -import {ViewTypes} from 'app/constants'; +import {ViewTypes} from '@constants'; +import {FileTypes, PostTypes} from '@mm-redux/action_types'; function handleCommentDraftChanged(state, action) { if (!action.rootId) { diff --git a/app/reducers/views/thread.test.js b/app/reducers/views/thread.test.js index 68d0e1d3e..7d9b748dc 100644 --- a/app/reducers/views/thread.test.js +++ b/app/reducers/views/thread.test.js @@ -1,9 +1,10 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import channelReducer, {handleSetTempUploadFilesForPostDraft} from './thread'; import {ViewTypes} from '@constants'; +import channelReducer, {handleSetTempUploadFilesForPostDraft} from './thread'; + describe('Reducers.thread', () => { test('Initial state', () => { const initialState = { diff --git a/app/reducers/views/threads.ts b/app/reducers/views/threads.ts index 24ae219f3..fd1678c56 100644 --- a/app/reducers/views/threads.ts +++ b/app/reducers/views/threads.ts @@ -2,8 +2,8 @@ // See LICENSE.txt for license information. import {combineReducers} from 'redux'; -import {GenericAction} from '@mm-redux/types/actions'; import {ViewTypes} from '@constants'; +import {GenericAction} from '@mm-redux/types/actions'; const viewingGlobalThreads = (state = false, action: GenericAction) => { switch (action.type) { diff --git a/app/reducers/views/user.js b/app/reducers/views/user.js index 9fc492f33..fe8d73e95 100644 --- a/app/reducers/views/user.js +++ b/app/reducers/views/user.js @@ -3,7 +3,7 @@ import {combineReducers} from 'redux'; -import {ViewTypes} from 'app/constants'; +import {ViewTypes} from '@constants'; function profileImageUri(state = '', action) { switch (action.type) { diff --git a/app/screens/about/about.js b/app/screens/about/about.js index 5a5793c68..8c5ef3ab3 100644 --- a/app/screens/about/about.js +++ b/app/screens/about/about.js @@ -1,8 +1,9 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; +import {intlShape} from 'react-intl'; import { Alert, ScrollView, @@ -12,7 +13,6 @@ import { } from 'react-native'; import DeviceInfo from 'react-native-device-info'; import {SafeAreaView} from 'react-native-safe-area-context'; -import {intlShape} from 'react-intl'; import Config from '@assets/config'; import CompassIcon from '@components/compass_icon'; diff --git a/app/screens/about/index.js b/app/screens/about/index.js index 3987e7877..e4a4b242a 100644 --- a/app/screens/about/index.js +++ b/app/screens/about/index.js @@ -3,8 +3,8 @@ import {connect} from 'react-redux'; -import {getTheme} from '@mm-redux/selectors/entities/preferences'; import {getConfig, getLicense} from '@mm-redux/selectors/entities/general'; +import {getTheme} from '@mm-redux/selectors/entities/preferences'; import About from './about'; diff --git a/app/screens/add_reaction/add_reaction.test.js b/app/screens/add_reaction/add_reaction.test.js index 937571867..85fa11a73 100644 --- a/app/screens/add_reaction/add_reaction.test.js +++ b/app/screens/add_reaction/add_reaction.test.js @@ -2,7 +2,8 @@ // See LICENSE.txt for license information. import React from 'react'; -import {shallowWithIntl} from 'test/intl-test-helper'; + +import {shallowWithIntl} from '@test/intl-test-helper'; import AddReaction from './index'; diff --git a/app/screens/add_reaction/index.js b/app/screens/add_reaction/index.js index 5d451d01e..e4ca20eef 100644 --- a/app/screens/add_reaction/index.js +++ b/app/screens/add_reaction/index.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {useEffect} from 'react'; import PropTypes from 'prop-types'; +import React, {useEffect} from 'react'; import { Keyboard, StyleSheet, @@ -11,9 +11,9 @@ import { } from 'react-native'; import {Navigation} from 'react-native-navigation'; -import EmojiPicker from 'app/components/emoji_picker'; -import {emptyFunction} from 'app/utils/general'; -import {dismissModal, setButtons} from 'app/actions/navigation'; +import {dismissModal, setButtons} from '@actions/navigation'; +import EmojiPicker from '@components/emoji_picker'; +import {emptyFunction} from '@utils/general'; const leftButton = { id: 'close-add-reaction', diff --git a/app/screens/apps_form/apps_form_component.tsx b/app/screens/apps_form/apps_form_component.tsx index 82aa668f1..3edde4fa7 100644 --- a/app/screens/apps_form/apps_form_component.tsx +++ b/app/screens/apps_form/apps_form_component.tsx @@ -1,27 +1,26 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {intlShape} from 'react-intl'; import React, {PureComponent} from 'react'; +import {intlShape} from 'react-intl'; import {ScrollView, Text, View} from 'react-native'; +import Button from 'react-native-button'; import {EventSubscription, Navigation} from 'react-native-navigation'; import {SafeAreaView} from 'react-native-safe-area-context'; -import Button from 'react-native-button'; +import {dismissModal} from '@actions/navigation'; +import Markdown from '@components/markdown'; +import StatusBar from '@components/status_bar'; import {AppCallResponseTypes} from '@mm-redux/constants/apps'; import {AppCallRequest, AppField, AppForm, AppFormValue, AppFormValues, AppLookupResponse, AppSelectOption, FormResponseData} from '@mm-redux/types/apps'; import {DialogElement} from '@mm-redux/types/integrations'; import {Theme} from '@mm-redux/types/preferences'; import {checkDialogElementForError, checkIfErrorsMatchElements} from '@mm-redux/utils/integration_utils'; - -import StatusBar from '@components/status_bar'; -import Markdown from '@components/markdown'; - -import {dismissModal} from '@actions/navigation'; +import {DoAppCallResult} from '@mm-types/actions/apps'; import {getMarkdownBlockStyles, getMarkdownTextStyles} from '@utils/markdown'; import {preventDoubleTap} from '@utils/tap'; import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; -import {DoAppCallResult} from 'types/actions/apps'; + import {GlobalStyles} from 'app/styles'; import AppsFormField from './apps_form_field'; diff --git a/app/screens/apps_form/apps_form_container.tsx b/app/screens/apps_form/apps_form_container.tsx index e85fec0df..a32953f26 100644 --- a/app/screens/apps_form/apps_form_container.tsx +++ b/app/screens/apps_form/apps_form_container.tsx @@ -4,12 +4,13 @@ import React, {PureComponent} from 'react'; import {intlShape} from 'react-intl'; -import {Theme} from '@mm-redux/types/preferences'; -import {AppCallResponse, AppCallRequest, AppField, AppForm, AppFormValues, FormResponseData, AppLookupResponse} from '@mm-redux/types/apps'; import {AppCallResponseTypes, AppCallTypes} from '@mm-redux/constants/apps'; -import AppsFormComponent from './apps_form_component'; +import {AppCallResponse, AppCallRequest, AppField, AppForm, AppFormValues, FormResponseData, AppLookupResponse} from '@mm-redux/types/apps'; +import {Theme} from '@mm-redux/types/preferences'; +import {DoAppCall, DoAppCallResult, PostEphemeralCallResponseForContext} from '@mm-types/actions/apps'; import {makeCallErrorResponse} from '@utils/apps'; -import {DoAppCall, DoAppCallResult, PostEphemeralCallResponseForContext} from 'types/actions/apps'; + +import AppsFormComponent from './apps_form_component'; export type Props = { form?: AppForm; @@ -36,7 +37,7 @@ export default class AppsFormContainer extends PureComponent { this.state = {form: props.form}; } - handleSubmit = async (submission: {values: AppFormValues}): Promise<{data?: AppCallResponse, error?: AppCallResponse}> => { + handleSubmit = async (submission: {values: AppFormValues}): Promise<{data?: AppCallResponse; error?: AppCallResponse}> => { const intl = this.context.intl; const makeErrorMsg = (msg: string) => { return intl.formatMessage( diff --git a/app/screens/apps_form/apps_form_field.tsx b/app/screens/apps_form/apps_form_field.tsx index 213f0ac15..598194b27 100644 --- a/app/screens/apps_form/apps_form_field.tsx +++ b/app/screens/apps_form/apps_form_field.tsx @@ -4,17 +4,15 @@ import React from 'react'; import {View} from 'react-native'; -import {Theme} from '@mm-redux/types/preferences'; -import {AppField, AppFormValue, AppSelectOption} from '@mm-redux/types/apps'; -import {AppFieldTypes} from '@mm-redux/constants/apps'; -import {DialogOption} from '@mm-redux/types/integrations'; - -import {ViewTypes} from '@constants/index'; - -import BoolSetting from '@components/widgets/settings/bool_setting'; -import TextSetting from '@components/widgets/settings/text_setting'; import AutocompleteSelector from '@components/autocomplete_selector'; import Markdown from '@components/markdown/markdown'; +import BoolSetting from '@components/widgets/settings/bool_setting'; +import TextSetting from '@components/widgets/settings/text_setting'; +import {ViewTypes} from '@constants/index'; +import {AppFieldTypes} from '@mm-redux/constants/apps'; +import {AppField, AppFormValue, AppSelectOption} from '@mm-redux/types/apps'; +import {DialogOption} from '@mm-redux/types/integrations'; +import {Theme} from '@mm-redux/types/preferences'; import {getMarkdownBlockStyles, getMarkdownTextStyles} from '@utils/markdown'; import {makeStyleSheetFromTheme} from '@utils/theme'; diff --git a/app/screens/apps_form/dialog_introduction_text.test.tsx b/app/screens/apps_form/dialog_introduction_text.test.tsx index 8549d18f9..5c3af6285 100644 --- a/app/screens/apps_form/dialog_introduction_text.test.tsx +++ b/app/screens/apps_form/dialog_introduction_text.test.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import Preferences from '@mm-redux/constants/preferences'; diff --git a/app/screens/apps_form/dialog_introduction_text.tsx b/app/screens/apps_form/dialog_introduction_text.tsx index 4f352e8cd..805987a37 100644 --- a/app/screens/apps_form/dialog_introduction_text.tsx +++ b/app/screens/apps_form/dialog_introduction_text.tsx @@ -4,9 +4,9 @@ import React, {PureComponent} from 'react'; import {View} from 'react-native'; +import Markdown from '@components/markdown'; import {Theme} from '@mm-redux/types/preferences'; import {getMarkdownBlockStyles, getMarkdownTextStyles} from '@utils/markdown'; -import Markdown from '@components/markdown'; import {makeStyleSheetFromTheme} from '@utils/theme'; type Props = { diff --git a/app/screens/apps_form/index.ts b/app/screens/apps_form/index.ts index 84ae177cf..e83236f55 100644 --- a/app/screens/apps_form/index.ts +++ b/app/screens/apps_form/index.ts @@ -1,17 +1,16 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {ActionCreatorsMapObject, bindActionCreators, Dispatch} from 'redux'; import {connect} from 'react-redux'; +import {ActionCreatorsMapObject, bindActionCreators, Dispatch} from 'redux'; -import {getTheme} from '@mm-redux/selectors/entities/preferences'; import {doAppCall, postEphemeralCallResponseForContext} from '@actions/apps'; - -import {GlobalState} from '@mm-redux/types/store'; +import {getTheme} from '@mm-redux/selectors/entities/preferences'; import {ActionFunc, GenericAction} from '@mm-redux/types/actions'; +import {GlobalState} from '@mm-redux/types/store'; +import {DoAppCall, PostEphemeralCallResponseForContext} from '@mm-types/actions/apps'; import AppsFormContainer from './apps_form_container'; -import {DoAppCall, PostEphemeralCallResponseForContext} from 'types/actions/apps'; type Actions = { doAppCall: DoAppCall; diff --git a/app/screens/channel/channel.android.js b/app/screens/channel/channel.android.js index e96ab481b..195de1c80 100644 --- a/app/screens/channel/channel.android.js +++ b/app/screens/channel/channel.android.js @@ -5,20 +5,19 @@ import React from 'react'; import {StyleSheet, View, BackHandler, ToastAndroid} from 'react-native'; import {openMainSideMenu, openSettingsSideMenu} from '@actions/navigation'; -import AnnouncementBanner from 'app/components/announcement_banner'; +import AnnouncementBanner from '@components/announcement_banner'; import GlobalThreadsList from '@components/global_threads'; -import KeyboardLayout from '@components/layout/keyboard_layout'; import InteractiveDialogController from '@components/interactive_dialog_controller'; +import KeyboardLayout from '@components/layout/keyboard_layout'; import NetworkIndicator from '@components/network_indicator'; import PostDraft from '@components/post_draft'; import {NavigationTypes} from '@constants'; -import EphemeralStore from '@store/ephemeral_store'; import EventEmitter from '@mm-redux/utils/event_emitter'; - -import ChannelNavBar from './channel_nav_bar'; -import ChannelPostList from './channel_post_list'; +import EphemeralStore from '@store/ephemeral_store'; import ChannelBase from './channel_base'; +import ChannelNavBar from './channel_nav_bar'; +import ChannelPostList from './channel_post_list'; let backPressedCount = 0; diff --git a/app/screens/channel/channel.ios.js b/app/screens/channel/channel.ios.js index d183039c9..e36d33f2b 100644 --- a/app/screens/channel/channel.ios.js +++ b/app/screens/channel/channel.ios.js @@ -5,7 +5,7 @@ import React from 'react'; import {View} from 'react-native'; import {SafeAreaView} from 'react-native-safe-area-context'; -import AnnouncementBanner from 'app/components/announcement_banner'; +import AnnouncementBanner from '@components/announcement_banner'; import Autocomplete from '@components/autocomplete'; import GlobalThreadsList from '@components/global_threads'; import InteractiveDialogController from '@components/interactive_dialog_controller'; diff --git a/app/screens/channel/channel_base.js b/app/screens/channel/channel_base.js index 90be91326..a56b573f6 100644 --- a/app/screens/channel/channel_base.js +++ b/app/screens/channel/channel_base.js @@ -1,18 +1,17 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import {intlShape} from 'react-intl'; import {Alert, Animated, Keyboard, StyleSheet} from 'react-native'; +import {showModal, showModalOverCurrentContext} from '@actions/navigation'; +import CompassIcon from '@components/compass_icon'; +import {TYPING_VISIBLE} from '@constants/post_draft'; +import PushNotifications from '@init/push_notifications'; import {General} from '@mm-redux/constants'; import EventEmitter from '@mm-redux/utils/event_emitter'; - -import {showModal, showModalOverCurrentContext} from '@actions/navigation'; -import {TYPING_VISIBLE} from '@constants/post_draft'; -import CompassIcon from '@components/compass_icon'; -import PushNotifications from '@init/push_notifications'; import EphemeralStore from '@store/ephemeral_store'; import telemetry, {PERF_MARKERS} from '@telemetry'; import {unsupportedServer} from '@utils/supported_server'; diff --git a/app/screens/channel/channel_base.test.js b/app/screens/channel/channel_base.test.js index 7a28926ba..08ff3a8ac 100644 --- a/app/screens/channel/channel_base.test.js +++ b/app/screens/channel/channel_base.test.js @@ -8,8 +8,8 @@ import * as NavigationActions from '@actions/navigation'; import {General, Preferences} from '@mm-redux/constants'; import EventEmitter from '@mm-redux/utils/event_emitter'; import EphemeralStore from '@store/ephemeral_store'; +import {shallowWithIntl} from '@test/intl-test-helper'; import {emptyFunction} from '@utils/general'; -import {shallowWithIntl} from 'test/intl-test-helper'; import ChannelBase from './channel_base'; diff --git a/app/screens/channel/channel_nav_bar/channel_nav_bar.js b/app/screens/channel/channel_nav_bar/channel_nav_bar.js index 909b97c61..218ae39ae 100644 --- a/app/screens/channel/channel_nav_bar/channel_nav_bar.js +++ b/app/screens/channel/channel_nav_bar/channel_nav_bar.js @@ -1,22 +1,23 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {useEffect, useState} from 'react'; -import PropTypes from 'prop-types'; -import {Dimensions, Platform, View, Text} from 'react-native'; import AsyncStorage from '@react-native-community/async-storage'; + +import PropTypes from 'prop-types'; +import React, {useEffect, useState} from 'react'; +import {Dimensions, Platform, View, Text} from 'react-native'; import {useSafeAreaInsets} from 'react-native-safe-area-context'; +import FormattedText from '@components/formatted_text'; import {DeviceTypes, ViewTypes} from '@constants'; +import mattermostManaged from '@mattermost-managed'; import EventEmitter from '@mm-redux/utils/event_emitter'; import {makeStyleSheetFromTheme} from '@utils/theme'; -import mattermostManaged from 'app/mattermost_managed'; -import MainSidebarDrawerButton from './main_sidebar_drawer_button'; import ChannelSearchButton from './channel_search_button'; import ChannelTitle from './channel_title'; +import MainSidebarDrawerButton from './main_sidebar_drawer_button'; import SettingsSidebarDrawerButton from './settings_sidebar_drawer_button'; -import FormattedText from '@components/formatted_text'; const { ANDROID_TOP_LANDSCAPE, diff --git a/app/screens/channel/channel_nav_bar/channel_nav_bar.test.js b/app/screens/channel/channel_nav_bar/channel_nav_bar.test.js index e6545e535..c96fac76d 100644 --- a/app/screens/channel/channel_nav_bar/channel_nav_bar.test.js +++ b/app/screens/channel/channel_nav_bar/channel_nav_bar.test.js @@ -5,7 +5,7 @@ import React from 'react'; import {SafeAreaProvider} from 'react-native-safe-area-context'; import Preferences from '@mm-redux/constants/preferences'; -import {shallowWithIntl} from 'test/intl-test-helper'; +import {shallowWithIntl} from '@test/intl-test-helper'; import ChannelNavBar from './channel_nav_bar'; diff --git a/app/screens/channel/channel_nav_bar/channel_search_button/channel_search_button.js b/app/screens/channel/channel_nav_bar/channel_search_button/channel_search_button.js index dec426e8d..6ba2baf71 100644 --- a/app/screens/channel/channel_nav_bar/channel_search_button/channel_search_button.js +++ b/app/screens/channel/channel_nav_bar/channel_search_button/channel_search_button.js @@ -1,20 +1,20 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; +import {intlShape} from 'react-intl'; import { Keyboard, TouchableOpacity, View, } from 'react-native'; -import {intlShape} from 'react-intl'; import {showSearchModal} from '@actions/navigation'; import CompassIcon from '@components/compass_icon'; +import {t} from '@utils/i18n'; import {preventDoubleTap} from '@utils/tap'; import {makeStyleSheetFromTheme} from '@utils/theme'; -import {t} from '@utils/i18n'; export default class ChannelSearchButton extends PureComponent { static propTypes = { diff --git a/app/screens/channel/channel_nav_bar/channel_search_button/channel_search_button.test.js b/app/screens/channel/channel_nav_bar/channel_search_button/channel_search_button.test.js index 253cb87a9..42fd14c78 100644 --- a/app/screens/channel/channel_nav_bar/channel_search_button/channel_search_button.test.js +++ b/app/screens/channel/channel_nav_bar/channel_search_button/channel_search_button.test.js @@ -5,9 +5,9 @@ import React from 'react'; import {TouchableOpacity} from 'react-native'; import Preferences from '@mm-redux/constants/preferences'; -import ChannelSearchButton from './channel_search_button'; +import {shallowWithIntl} from '@test/intl-test-helper'; -import {shallowWithIntl} from 'test/intl-test-helper'; +import ChannelSearchButton from './channel_search_button'; describe('ChannelSearchButton', () => { const baseProps = { diff --git a/app/screens/channel/channel_nav_bar/channel_search_button/index.js b/app/screens/channel/channel_nav_bar/channel_search_button/index.js index c7eacae89..763d4692b 100644 --- a/app/screens/channel/channel_nav_bar/channel_search_button/index.js +++ b/app/screens/channel/channel_nav_bar/channel_search_button/index.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; import {clearSearch} from '@mm-redux/actions/search'; diff --git a/app/screens/channel/channel_nav_bar/channel_title/channel_title.js b/app/screens/channel/channel_nav_bar/channel_title/channel_title.js index 5be9a108a..5a2757dab 100644 --- a/app/screens/channel/channel_nav_bar/channel_title/channel_title.js +++ b/app/screens/channel/channel_nav_bar/channel_title/channel_title.js @@ -1,21 +1,19 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; - +import React, {PureComponent} from 'react'; import { Text, TouchableOpacity, View, } from 'react-native'; -import {General} from '@mm-redux/constants'; - import ChannelIcon from '@components/channel_icon'; import CompassIcon from '@components/compass_icon'; import CustomStatusEmoji from '@components/custom_status/custom_status_emoji'; import FormattedText from '@components/formatted_text'; +import {General} from '@mm-redux/constants'; import {t} from '@utils/i18n'; import {makeStyleSheetFromTheme} from '@utils/theme'; diff --git a/app/screens/channel/channel_nav_bar/channel_title/channel_title.test.js b/app/screens/channel/channel_nav_bar/channel_title/channel_title.test.js index 3844e7ac6..0fa84ae39 100644 --- a/app/screens/channel/channel_nav_bar/channel_title/channel_title.test.js +++ b/app/screens/channel/channel_nav_bar/channel_title/channel_title.test.js @@ -4,7 +4,7 @@ import React from 'react'; import {General} from '@mm-redux/constants'; -import {shallowWithIntl} from 'test/intl-test-helper'; +import {shallowWithIntl} from '@test/intl-test-helper'; import ChannelTitle from './channel_title'; diff --git a/app/screens/channel/channel_nav_bar/channel_title/index.js b/app/screens/channel/channel_nav_bar/channel_title/index.js index ea43f1c0b..0c69e87fa 100644 --- a/app/screens/channel/channel_nav_bar/channel_title/index.js +++ b/app/screens/channel/channel_nav_bar/channel_title/index.js @@ -9,8 +9,7 @@ import {getTheme} from '@mm-redux/selectors/entities/preferences'; import {getCurrentUserId, getUser} from '@mm-redux/selectors/entities/users'; import {getUserIdFromChannelName, isChannelMuted} from '@mm-redux/utils/channel_utils'; import {isCustomStatusEnabled} from '@selectors/custom_status'; - -import {isGuest} from 'app/utils/users'; +import {isGuest} from '@utils/users'; import ChannelTitle from './channel_title'; diff --git a/app/screens/channel/channel_nav_bar/index.js b/app/screens/channel/channel_nav_bar/index.js index 427c8e6aa..04ae79d28 100644 --- a/app/screens/channel/channel_nav_bar/index.js +++ b/app/screens/channel/channel_nav_bar/index.js @@ -3,8 +3,8 @@ import {connect} from 'react-redux'; -import {isLandscape} from 'app/selectors/device'; import {getTheme} from '@mm-redux/selectors/entities/preferences'; +import {isLandscape} from '@selectors/device'; import ChannelNavBar from './channel_nav_bar'; diff --git a/app/screens/channel/channel_nav_bar/main_sidebar_drawer_button/index.js b/app/screens/channel/channel_nav_bar/main_sidebar_drawer_button/index.js index 1219f4b07..7db1b9f81 100644 --- a/app/screens/channel/channel_nav_bar/main_sidebar_drawer_button/index.js +++ b/app/screens/channel/channel_nav_bar/main_sidebar_drawer_button/index.js @@ -4,8 +4,8 @@ import {connect} from 'react-redux'; import {getTheme} from '@mm-redux/selectors/entities/preferences'; +import {getBadgeCount} from '@selectors/views'; -import {getBadgeCount} from 'app/selectors/views'; import MainSidebarDrawerButton from './main_sidebar_drawer_button'; function mapStateToProps(state) { diff --git a/app/screens/channel/channel_nav_bar/main_sidebar_drawer_button/main_sidebar_drawer_button.js b/app/screens/channel/channel_nav_bar/main_sidebar_drawer_button/main_sidebar_drawer_button.js index 53e98e0c4..c31a399ce 100644 --- a/app/screens/channel/channel_nav_bar/main_sidebar_drawer_button/main_sidebar_drawer_button.js +++ b/app/screens/channel/channel_nav_bar/main_sidebar_drawer_button/main_sidebar_drawer_button.js @@ -1,21 +1,20 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; +import {intlShape} from 'react-intl'; import { TouchableOpacity, View, } from 'react-native'; -import {intlShape} from 'react-intl'; import Badge from '@components/badge'; import CompassIcon from '@components/compass_icon'; +import {LARGE_BADGE_RIGHT_POSITION, SMALL_BADGE_RIGHT_POSITION, MAX_BADGE_RIGHT_POSITION} from '@constants/view'; +import {t} from '@utils/i18n'; import {preventDoubleTap} from '@utils/tap'; import {makeStyleSheetFromTheme} from '@utils/theme'; -import {t} from '@utils/i18n'; - -import {LARGE_BADGE_RIGHT_POSITION, SMALL_BADGE_RIGHT_POSITION, MAX_BADGE_RIGHT_POSITION} from '@constants/view'; export default class MainSidebarDrawerButton extends PureComponent { static propTypes = { diff --git a/app/screens/channel/channel_nav_bar/main_sidebar_drawer_button/main_sidebar_drawer_button.test.js b/app/screens/channel/channel_nav_bar/main_sidebar_drawer_button/main_sidebar_drawer_button.test.js index 67bb38ee6..77596c8e7 100644 --- a/app/screens/channel/channel_nav_bar/main_sidebar_drawer_button/main_sidebar_drawer_button.test.js +++ b/app/screens/channel/channel_nav_bar/main_sidebar_drawer_button/main_sidebar_drawer_button.test.js @@ -5,7 +5,7 @@ import React from 'react'; import Badge from '@components/badge'; import Preferences from '@mm-redux/constants/preferences'; -import {shallowWithIntl} from 'test/intl-test-helper'; +import {shallowWithIntl} from '@test/intl-test-helper'; import MainSidebarDrawerButton from './main_sidebar_drawer_button'; diff --git a/app/screens/channel/channel_nav_bar/settings_sidebar_drawer_button.js b/app/screens/channel/channel_nav_bar/settings_sidebar_drawer_button.js index 1e4582a3d..2afe6b7d3 100644 --- a/app/screens/channel/channel_nav_bar/settings_sidebar_drawer_button.js +++ b/app/screens/channel/channel_nav_bar/settings_sidebar_drawer_button.js @@ -1,21 +1,20 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; -import {connect} from 'react-redux'; +import React, {PureComponent} from 'react'; +import {intlShape} from 'react-intl'; import { TouchableOpacity, View, } from 'react-native'; -import {intlShape} from 'react-intl'; - -import {getTheme} from '@mm-redux/selectors/entities/preferences'; +import {connect} from 'react-redux'; import CompassIcon from '@components/compass_icon'; +import {getTheme} from '@mm-redux/selectors/entities/preferences'; +import {t} from '@utils/i18n'; import {preventDoubleTap} from '@utils/tap'; import {makeStyleSheetFromTheme} from '@utils/theme'; -import {t} from '@utils/i18n'; export class SettingsSidebarDrawerButton extends PureComponent { static propTypes = { diff --git a/app/screens/channel/channel_nav_bar/settings_sidebar_drawer_button.test.js b/app/screens/channel/channel_nav_bar/settings_sidebar_drawer_button.test.js index decbd0190..7990889b4 100644 --- a/app/screens/channel/channel_nav_bar/settings_sidebar_drawer_button.test.js +++ b/app/screens/channel/channel_nav_bar/settings_sidebar_drawer_button.test.js @@ -4,9 +4,9 @@ import React from 'react'; import Preferences from '@mm-redux/constants/preferences'; -import {SettingsSidebarDrawerButton} from './settings_sidebar_drawer_button'; +import {shallowWithIntl} from '@test/intl-test-helper'; -import {shallowWithIntl} from 'test/intl-test-helper'; +import {SettingsSidebarDrawerButton} from './settings_sidebar_drawer_button'; describe('SettingsSidebarDrawerButton', () => { const baseProps = { diff --git a/app/screens/channel/channel_post_list/channel_post_list.js b/app/screens/channel/channel_post_list/channel_post_list.js index 764faea0d..02e792052 100644 --- a/app/screens/channel/channel_post_list/channel_post_list.js +++ b/app/screens/channel/channel_post_list/channel_post_list.js @@ -9,9 +9,9 @@ import {goToScreen} from '@actions/navigation'; import PostList from '@components/post_list'; import RetryBarIndicator from '@components/retry_bar_indicator'; import {TYPING_HEIGHT} from '@constants/post_draft'; +import {CHANNEL, THREAD} from '@constants/screen'; import EventEmitter from '@mm-redux/utils/event_emitter'; import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; -import {CHANNEL, THREAD} from '@constants/screen'; let ChannelIntro = null; let LoadMorePosts = null; diff --git a/app/screens/channel/channel_post_list/channel_post_list.test.js b/app/screens/channel/channel_post_list/channel_post_list.test.js index 65b23a441..4ed63ac73 100644 --- a/app/screens/channel/channel_post_list/channel_post_list.test.js +++ b/app/screens/channel/channel_post_list/channel_post_list.test.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import Preferences from '@mm-redux/constants/preferences'; diff --git a/app/screens/channel/channel_post_list/index.js b/app/screens/channel/channel_post_list/index.js index 756f3f446..6a1888f3a 100644 --- a/app/screens/channel/channel_post_list/index.js +++ b/app/screens/channel/channel_post_list/index.js @@ -1,17 +1,17 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; import {loadPostsIfNecessaryWithRetry, increasePostVisibility} from '@actions/views/channel'; import {getPostThread} from '@actions/views/post'; import {Types} from '@constants'; import {selectPost} from '@mm-redux/actions/posts'; -import {getPostIdsInCurrentChannel} from '@mm-redux/selectors/entities/posts'; import {getCurrentChannelId} from '@mm-redux/selectors/entities/channels'; -import {getCurrentUserId} from '@mm-redux/selectors/entities/users'; +import {getPostIdsInCurrentChannel} from '@mm-redux/selectors/entities/posts'; import {getTheme} from '@mm-redux/selectors/entities/preferences'; +import {getCurrentUserId} from '@mm-redux/selectors/entities/users'; import {isLandscape} from '@selectors/device'; import ChannelPostList from './channel_post_list'; diff --git a/app/screens/channel/index.js b/app/screens/channel/index.js index 4bd536c93..6966f9586 100644 --- a/app/screens/channel/index.js +++ b/app/screens/channel/index.js @@ -1,14 +1,14 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; import {loadChannelsForTeam, selectInitialChannel} from '@actions/views/channel'; import {selectDefaultTeam} from '@actions/views/select_team'; +import {Client4} from '@client/rest'; import {ViewTypes} from '@constants'; import {getChannelStats} from '@mm-redux/actions/channels'; -import {Client4} from '@client/rest'; import {getCurrentChannelId} from '@mm-redux/selectors/entities/channels'; import {getServerVersion} from '@mm-redux/selectors/entities/general'; import {getTheme, isCollapsedThreadsEnabled} from '@mm-redux/selectors/entities/preferences'; @@ -16,9 +16,9 @@ import {getCurrentTeam} from '@mm-redux/selectors/entities/teams'; import {getCurrentUserId, getCurrentUserRoles, shouldShowTermsOfService} from '@mm-redux/selectors/entities/users'; import {isMinimumServerVersion} from '@mm-redux/utils/helpers'; import {isSystemAdmin as checkIsSystemAdmin} from '@mm-redux/utils/user_utils'; +import {getViewingGlobalThreads} from '@selectors/threads'; import Channel from './channel'; -import {getViewingGlobalThreads} from '@selectors/threads'; function mapStateToProps(state) { const currentTeam = getCurrentTeam(state); diff --git a/app/screens/channel_add_members/channel_add_members.js b/app/screens/channel_add_members/channel_add_members.js index c0bb24675..c97d92309 100644 --- a/app/screens/channel_add_members/channel_add_members.js +++ b/app/screens/channel_add_members/channel_add_members.js @@ -1,19 +1,19 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import {intlShape} from 'react-intl'; import {Alert, View} from 'react-native'; import {Navigation} from 'react-native-navigation'; import {SafeAreaView} from 'react-native-safe-area-context'; import {popTopScreen, setButtons} from '@actions/navigation'; -import Loading from '@components/loading'; import CustomList, {FLATLIST, SECTIONLIST} from '@components/custom_list'; import UserListRow from '@components/custom_list/user_list_row'; import FormattedText from '@components/formatted_text'; import KeyboardLayout from '@components/layout/keyboard_layout'; +import Loading from '@components/loading'; import SearchBar from '@components/search_bar'; import StatusBar from '@components/status_bar'; import {debounce} from '@mm-redux/actions/helpers'; diff --git a/app/screens/channel_add_members/channel_add_members.test.js b/app/screens/channel_add_members/channel_add_members.test.js index 9133d8ebc..0112137e6 100644 --- a/app/screens/channel_add_members/channel_add_members.test.js +++ b/app/screens/channel_add_members/channel_add_members.test.js @@ -3,10 +3,9 @@ import React from 'react'; +import * as NavigationActions from '@actions/navigation'; import {Preferences} from '@mm-redux/constants'; - -import * as NavigationActions from 'app/actions/navigation'; -import {shallowWithIntl} from 'test/intl-test-helper'; +import {shallowWithIntl} from '@test/intl-test-helper'; import ChannelAddMembers from './channel_add_members'; diff --git a/app/screens/channel_add_members/index.js b/app/screens/channel_add_members/index.js index 742026a07..a702ab3b3 100644 --- a/app/screens/channel_add_members/index.js +++ b/app/screens/channel_add_members/index.js @@ -1,9 +1,10 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; +import {handleAddChannelMembers} from '@actions/views/channel_add_members'; import {getTeamStats} from '@mm-redux/actions/teams'; import {getProfilesNotInChannel, searchProfiles} from '@mm-redux/actions/users'; import {getCurrentChannel} from '@mm-redux/selectors/entities/channels'; @@ -11,7 +12,6 @@ import {getTheme} from '@mm-redux/selectors/entities/preferences'; import {getCurrentTeamId} from '@mm-redux/selectors/entities/teams'; import {getCurrentUserId, getProfilesNotInCurrentChannel} from '@mm-redux/selectors/entities/users'; -import {handleAddChannelMembers} from 'app/actions/views/channel_add_members'; import ChannelAddMembers from './channel_add_members'; function mapStateToProps(state) { diff --git a/app/screens/channel_info/add_members/add_members.test.js b/app/screens/channel_info/add_members/add_members.test.js index c44dd0490..a6d9d2732 100644 --- a/app/screens/channel_info/add_members/add_members.test.js +++ b/app/screens/channel_info/add_members/add_members.test.js @@ -2,9 +2,9 @@ // See LICENSE.txt for license information. import React from 'react'; -import {shallowWithIntl} from 'test/intl-test-helper'; import Preferences from '@mm-redux/constants/preferences'; +import {shallowWithIntl} from '@test/intl-test-helper'; import AddMembers from './add_members'; diff --git a/app/screens/channel_info/add_members/index.js b/app/screens/channel_info/add_members/index.js index 5b40e5022..c5848c788 100644 --- a/app/screens/channel_info/add_members/index.js +++ b/app/screens/channel_info/add_members/index.js @@ -4,6 +4,7 @@ import {connect} from 'react-redux'; import {canManageChannelMembers, getCurrentChannel} from '@mm-redux/selectors/entities/channels'; + import AddMembers from './add_members'; function mapStateToProps(state) { diff --git a/app/screens/channel_info/archive/archive.test.js b/app/screens/channel_info/archive/archive.test.js index 3e7b9c602..ad2aba92a 100644 --- a/app/screens/channel_info/archive/archive.test.js +++ b/app/screens/channel_info/archive/archive.test.js @@ -2,9 +2,9 @@ // See LICENSE.txt for license information. import React from 'react'; -import {shallowWithIntl} from 'test/intl-test-helper'; import Preferences from '@mm-redux/constants/preferences'; +import {shallowWithIntl} from '@test/intl-test-helper'; import Archive from './archive'; diff --git a/app/screens/channel_info/archive/archive.tsx b/app/screens/channel_info/archive/archive.tsx index 885078393..968b0b370 100644 --- a/app/screens/channel_info/archive/archive.tsx +++ b/app/screens/channel_info/archive/archive.tsx @@ -2,8 +2,8 @@ // See LICENSE.txt for license information. import React, {PureComponent} from 'react'; -import {Alert} from 'react-native'; import {intlShape} from 'react-intl'; +import {Alert} from 'react-native'; import {ActionResult} from '@mm-redux/types/actions'; import {FormattedMsg} from '@mm-redux/types/general'; diff --git a/app/screens/channel_info/bindings/bindings.tsx b/app/screens/channel_info/bindings/bindings.tsx index 6d30f464c..bd5fb3bd5 100644 --- a/app/screens/channel_info/bindings/bindings.tsx +++ b/app/screens/channel_info/bindings/bindings.tsx @@ -2,19 +2,19 @@ // See LICENSE.txt for license information. import React from 'react'; -import {Alert} from 'react-native'; import {intlShape, injectIntl} from 'react-intl'; +import {Alert} from 'react-native'; +import {dismissModal} from '@actions/navigation'; +import {AppCallResponseTypes, AppCallTypes} from '@mm-redux/constants/apps'; +import {AppBinding} from '@mm-redux/types/apps'; +import {Channel} from '@mm-redux/types/channels'; +import {Theme} from '@mm-redux/types/preferences'; +import {DoAppCall, PostEphemeralCallResponseForChannel} from '@mm-types/actions/apps'; import Separator from '@screens/channel_info/separator'; +import {createCallContext, createCallRequest} from '@utils/apps'; import ChannelInfoRow from '../channel_info_row'; -import {AppBinding} from '@mm-redux/types/apps'; -import {Theme} from '@mm-redux/types/preferences'; -import {Channel} from '@mm-redux/types/channels'; -import {AppCallResponseTypes, AppCallTypes} from '@mm-redux/constants/apps'; -import {dismissModal} from '@actions/navigation'; -import {createCallContext, createCallRequest} from '@utils/apps'; -import {DoAppCall, PostEphemeralCallResponseForChannel} from 'types/actions/apps'; type Props = { bindings: AppBinding[]; @@ -26,7 +26,7 @@ type Props = { actions: { doAppCall: DoAppCall; postEphemeralCallResponseForChannel: PostEphemeralCallResponseForChannel; - } + }; } const Bindings: React.FC = injectIntl((props: Props) => { @@ -65,7 +65,7 @@ type OptionProps = { actions: { doAppCall: DoAppCall; postEphemeralCallResponseForChannel: PostEphemeralCallResponseForChannel; - }, + }; } type OptionState = { diff --git a/app/screens/channel_info/bindings/index.ts b/app/screens/channel_info/bindings/index.ts index 546f6c041..6eff4e48d 100644 --- a/app/screens/channel_info/bindings/index.ts +++ b/app/screens/channel_info/bindings/index.ts @@ -4,18 +4,17 @@ import {connect} from 'react-redux'; import {bindActionCreators, Dispatch, ActionCreatorsMapObject} from 'redux'; -import {getAppsBindings} from '@mm-redux/selectors/entities/apps'; -import {AppBindingLocations} from '@mm-redux/constants/apps'; -import {getCurrentChannel} from '@mm-redux/selectors/entities/channels'; -import {GlobalState} from '@mm-redux/types/store'; -import {GenericAction, ActionFunc} from '@mm-redux/types/actions'; -import {DoAppCall, PostEphemeralCallResponseForChannel} from 'types/actions/apps'; - -import {appsEnabled} from '@utils/apps'; import {doAppCall, postEphemeralCallResponseForChannel} from '@actions/apps'; +import {AppBindingLocations} from '@mm-redux/constants/apps'; +import {getAppsBindings} from '@mm-redux/selectors/entities/apps'; +import {getCurrentChannel} from '@mm-redux/selectors/entities/channels'; +import {getCurrentTeamId} from '@mm-redux/selectors/entities/teams'; +import {GenericAction, ActionFunc} from '@mm-redux/types/actions'; +import {GlobalState} from '@mm-redux/types/store'; +import {DoAppCall, PostEphemeralCallResponseForChannel} from '@mm-types/actions/apps'; +import {appsEnabled} from '@utils/apps'; import Bindings from './bindings'; -import {getCurrentTeamId} from '@mm-redux/selectors/entities/teams'; function mapStateToProps(state: GlobalState) { const apps = appsEnabled(state); diff --git a/app/screens/channel_info/channel_info.js b/app/screens/channel_info/channel_info.js index 45526e38f..7e0e1d241 100644 --- a/app/screens/channel_info/channel_info.js +++ b/app/screens/channel_info/channel_info.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import {intlShape} from 'react-intl'; import { ScrollView, @@ -18,8 +18,8 @@ import {t} from '@utils/i18n'; import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; import AddMembers from './add_members'; -import NotificationPreference from './notification_preference'; import Archive from './archive'; +import Bindings from './bindings'; import ChannelInfoHeader from './channel_info_header'; import ConvertPrivate from './convert_private'; import EditChannel from './edit_channel'; @@ -28,9 +28,9 @@ import IgnoreMentions from './ignore_mentions'; import Leave from './leave'; import ManageMembers from './manage_members'; import Mute from './mute'; +import NotificationPreference from './notification_preference'; import Pinned from './pinned'; import Separator from './separator'; -import Bindings from './bindings'; export default class ChannelInfo extends PureComponent { static propTypes = { diff --git a/app/screens/channel_info/channel_info.test.js b/app/screens/channel_info/channel_info.test.js index 0d319b16c..d24f64046 100644 --- a/app/screens/channel_info/channel_info.test.js +++ b/app/screens/channel_info/channel_info.test.js @@ -1,11 +1,12 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; + import {shallow} from 'enzyme'; +import React from 'react'; import * as NavigationActions from '@actions/navigation'; -import Preferences from '@mm-redux/constants/preferences'; import {General} from '@mm-redux/constants'; +import Preferences from '@mm-redux/constants/preferences'; import ChannelInfo from './channel_info'; import NotificationPreference from './notification_preference'; diff --git a/app/screens/channel_info/channel_info_header.js b/app/screens/channel_info/channel_info_header.js index f7ddf04ad..fa76825fa 100644 --- a/app/screens/channel_info/channel_info_header.js +++ b/app/screens/channel_info/channel_info_header.js @@ -1,16 +1,17 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; +import Clipboard from '@react-native-community/clipboard'; + import PropTypes from 'prop-types'; +import React from 'react'; +import {intlShape} from 'react-intl'; import { Platform, Text, TouchableHighlight, View, } from 'react-native'; -import {intlShape} from 'react-intl'; -import Clipboard from '@react-native-community/clipboard'; import {popToRoot} from '@actions/navigation'; import ChannelIcon from '@components/channel_icon'; @@ -20,14 +21,13 @@ import Emoji from '@components/emoji'; import FormattedDate from '@components/formatted_date'; import FormattedText from '@components/formatted_text'; import Markdown from '@components/markdown'; +import mattermostManaged from '@mattermost-managed'; import {General} from '@mm-redux/constants'; import BottomSheet from '@utils/bottom_sheet'; import {t} from '@utils/i18n'; import {getMarkdownTextStyles, getMarkdownBlockStyles} from '@utils/markdown'; import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; -import mattermostManaged from 'app/mattermost_managed'; - export default class ChannelInfoHeader extends React.PureComponent { static propTypes = { createAt: PropTypes.number.isRequired, diff --git a/app/screens/channel_info/channel_info_header.test.js b/app/screens/channel_info/channel_info_header.test.js index d20d94ce9..c2af06b8c 100644 --- a/app/screens/channel_info/channel_info_header.test.js +++ b/app/screens/channel_info/channel_info_header.test.js @@ -1,10 +1,10 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; -import Preferences from '@mm-redux/constants/preferences'; import {General} from '@mm-redux/constants'; +import Preferences from '@mm-redux/constants/preferences'; import {CustomStatusDuration} from '@mm-redux/types/users'; import ChannelInfoHeader from './channel_info_header.js'; diff --git a/app/screens/channel_info/channel_info_row.js b/app/screens/channel_info/channel_info_row.js index 2b9fa1193..1a44d7d0e 100644 --- a/app/screens/channel_info/channel_info_row.js +++ b/app/screens/channel_info/channel_info_row.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import PropTypes from 'prop-types'; +import React from 'react'; import { Image, Switch, @@ -10,11 +10,11 @@ import { TouchableHighlight, View, } from 'react-native'; +import FastImage from 'react-native-fast-image'; import CompassIcon from '@components/compass_icon'; import FormattedText from '@components/formatted_text'; import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; -import FastImage from 'react-native-fast-image'; import {isValidUrl} from '@utils/url'; function createTouchableComponent(children, action) { diff --git a/app/screens/channel_info/channel_info_row.test.js b/app/screens/channel_info/channel_info_row.test.js index a52853735..25c519dc1 100644 --- a/app/screens/channel_info/channel_info_row.test.js +++ b/app/screens/channel_info/channel_info_row.test.js @@ -2,9 +2,9 @@ // See LICENSE.txt for license information. import React from 'react'; -import {shallowWithIntl} from 'test/intl-test-helper'; import Preferences from '@mm-redux/constants/preferences'; +import {shallowWithIntl} from '@test/intl-test-helper'; import ChannelInfoRow from './channel_info_row'; diff --git a/app/screens/channel_info/convert_private/convert_private.test.js b/app/screens/channel_info/convert_private/convert_private.test.js index 64fa55811..844ec8281 100644 --- a/app/screens/channel_info/convert_private/convert_private.test.js +++ b/app/screens/channel_info/convert_private/convert_private.test.js @@ -2,9 +2,9 @@ // See LICENSE.txt for license information. import React from 'react'; -import {shallowWithIntl} from 'test/intl-test-helper'; import Preferences from '@mm-redux/constants/preferences'; +import {shallowWithIntl} from '@test/intl-test-helper'; import ConvertPrivate from './convert_private'; diff --git a/app/screens/channel_info/convert_private/convert_private.tsx b/app/screens/channel_info/convert_private/convert_private.tsx index d652f15b0..09ff662fd 100644 --- a/app/screens/channel_info/convert_private/convert_private.tsx +++ b/app/screens/channel_info/convert_private/convert_private.tsx @@ -2,8 +2,8 @@ // See LICENSE.txt for license information. import React, {PureComponent} from 'react'; -import {Alert} from 'react-native'; import {intlShape} from 'react-intl'; +import {Alert} from 'react-native'; import {ActionResult} from '@mm-redux/types/actions'; import {Theme} from '@mm-redux/types/preferences'; diff --git a/app/screens/channel_info/convert_private/index.js b/app/screens/channel_info/convert_private/index.js index 2ee8a5fe4..f2131251a 100644 --- a/app/screens/channel_info/convert_private/index.js +++ b/app/screens/channel_info/convert_private/index.js @@ -5,13 +5,13 @@ import {connect} from 'react-redux'; import {convertChannelToPrivate} from '@mm-redux/actions/channels'; import {General, Permissions} from '@mm-redux/constants'; -import {haveIChannelPermission} from '@mm-redux/selectors/entities/roles'; -import {getServerVersion} from '@mm-redux/selectors/entities/general'; import {getCurrentChannel} from '@mm-redux/selectors/entities/channels'; +import {getServerVersion} from '@mm-redux/selectors/entities/general'; +import {haveIChannelPermission} from '@mm-redux/selectors/entities/roles'; import {getCurrentTeamId} from '@mm-redux/selectors/entities/teams'; import {getCurrentUserRoles} from '@mm-redux/selectors/entities/users'; -import {isAdmin as checkIsAdmin} from '@mm-redux/utils/user_utils'; import {isMinimumServerVersion} from '@mm-redux/utils/helpers'; +import {isAdmin as checkIsAdmin} from '@mm-redux/utils/user_utils'; import ConvertPrivate from './convert_private'; diff --git a/app/screens/channel_info/edit_channel/edit_channel.test.js b/app/screens/channel_info/edit_channel/edit_channel.test.js index 2cf5e2409..5db511e85 100644 --- a/app/screens/channel_info/edit_channel/edit_channel.test.js +++ b/app/screens/channel_info/edit_channel/edit_channel.test.js @@ -2,9 +2,9 @@ // See LICENSE.txt for license information. import React from 'react'; -import {shallowWithIntl} from 'test/intl-test-helper'; import Preferences from '@mm-redux/constants/preferences'; +import {shallowWithIntl} from '@test/intl-test-helper'; import EditChannel from './edit_channel'; diff --git a/app/screens/channel_info/favorite/favorite.test.js b/app/screens/channel_info/favorite/favorite.test.js index 8080fa94c..990d65ab7 100644 --- a/app/screens/channel_info/favorite/favorite.test.js +++ b/app/screens/channel_info/favorite/favorite.test.js @@ -2,9 +2,9 @@ // See LICENSE.txt for license information. import React from 'react'; -import {shallowWithIntl} from 'test/intl-test-helper'; import Preferences from '@mm-redux/constants/preferences'; +import {shallowWithIntl} from '@test/intl-test-helper'; import Favorite from './favorite'; diff --git a/app/screens/channel_info/ignore_mentions/ignore_mentions.test.js b/app/screens/channel_info/ignore_mentions/ignore_mentions.test.js index 063f5d698..0d1ca7b1a 100644 --- a/app/screens/channel_info/ignore_mentions/ignore_mentions.test.js +++ b/app/screens/channel_info/ignore_mentions/ignore_mentions.test.js @@ -2,9 +2,9 @@ // See LICENSE.txt for license information. import React from 'react'; -import {shallowWithIntl} from 'test/intl-test-helper'; import Preferences from '@mm-redux/constants/preferences'; +import {shallowWithIntl} from '@test/intl-test-helper'; import IgnoreMentions from './ignore_mentions'; diff --git a/app/screens/channel_info/index.js b/app/screens/channel_info/index.js index cb29bd562..9fd9f3f53 100644 --- a/app/screens/channel_info/index.js +++ b/app/screens/channel_info/index.js @@ -1,15 +1,15 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; import {setChannelDisplayName} from '@actions/views/channel'; import {getChannelStats} from '@mm-redux/actions/channels'; import {getCustomEmojisInText} from '@mm-redux/actions/emojis'; import {General} from '@mm-redux/constants'; -import {getTeammateNameDisplaySetting, getTheme} from '@mm-redux/selectors/entities/preferences'; import {getCurrentChannel, getCurrentChannelStats} from '@mm-redux/selectors/entities/channels'; +import {getTeammateNameDisplaySetting, getTheme} from '@mm-redux/selectors/entities/preferences'; import {getCurrentUserId, getUser} from '@mm-redux/selectors/entities/users'; import {getUserIdFromChannelName} from '@mm-redux/utils/channel_utils'; import {displayUsername} from '@mm-redux/utils/user_utils'; diff --git a/app/screens/channel_info/leave/leave.test.js b/app/screens/channel_info/leave/leave.test.js index 4da374b2c..df4518f99 100644 --- a/app/screens/channel_info/leave/leave.test.js +++ b/app/screens/channel_info/leave/leave.test.js @@ -2,10 +2,10 @@ // See LICENSE.txt for license information. import React from 'react'; -import {shallowWithIntl} from 'test/intl-test-helper'; import {General} from '@mm-redux/constants'; import Preferences from '@mm-redux/constants/preferences'; +import {shallowWithIntl} from '@test/intl-test-helper'; import Leave from './leave'; diff --git a/app/screens/channel_info/leave/leave.tsx b/app/screens/channel_info/leave/leave.tsx index 1553de9a1..0d5afb9de 100644 --- a/app/screens/channel_info/leave/leave.tsx +++ b/app/screens/channel_info/leave/leave.tsx @@ -2,8 +2,8 @@ // See LICENSE.txt for license information. import React, {PureComponent} from 'react'; -import {Alert} from 'react-native'; import {intlShape} from 'react-intl'; +import {Alert} from 'react-native'; import {ActionResult} from '@mm-redux/types/actions'; import {Channel} from '@mm-redux/types/channels'; diff --git a/app/screens/channel_info/manage_members/index.js b/app/screens/channel_info/manage_members/index.js index f5e53c8bd..9302679f6 100644 --- a/app/screens/channel_info/manage_members/index.js +++ b/app/screens/channel_info/manage_members/index.js @@ -5,6 +5,7 @@ import {connect} from 'react-redux'; import {General} from '@mm-redux/constants'; import {canManageChannelMembers, getCurrentChannel, getCurrentChannelStats} from '@mm-redux/selectors/entities/channels'; + import ManageMembers from './manage_members'; function mapStateToProps(state) { diff --git a/app/screens/channel_info/manage_members/manage_members.test.js b/app/screens/channel_info/manage_members/manage_members.test.js index ff29e4358..ff006c313 100644 --- a/app/screens/channel_info/manage_members/manage_members.test.js +++ b/app/screens/channel_info/manage_members/manage_members.test.js @@ -2,9 +2,9 @@ // See LICENSE.txt for license information. import React from 'react'; -import {shallowWithIntl} from 'test/intl-test-helper'; import Preferences from '@mm-redux/constants/preferences'; +import {shallowWithIntl} from '@test/intl-test-helper'; import ManageMembers from './manage_members'; diff --git a/app/screens/channel_info/mute/mute.test.js b/app/screens/channel_info/mute/mute.test.js index 2af2da75e..984a0943c 100644 --- a/app/screens/channel_info/mute/mute.test.js +++ b/app/screens/channel_info/mute/mute.test.js @@ -2,9 +2,9 @@ // See LICENSE.txt for license information. import React from 'react'; -import {shallowWithIntl} from 'test/intl-test-helper'; import Preferences from '@mm-redux/constants/preferences'; +import {shallowWithIntl} from '@test/intl-test-helper'; import Mute from './mute'; diff --git a/app/screens/channel_info/notification_preference/index.js b/app/screens/channel_info/notification_preference/index.js index a9b5f75df..95f6eabb6 100644 --- a/app/screens/channel_info/notification_preference/index.js +++ b/app/screens/channel_info/notification_preference/index.js @@ -2,6 +2,7 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; + import {getMyCurrentChannelMembership} from '@mm-redux/selectors/entities/channels'; import NotificationPreference from './notification_preference'; diff --git a/app/screens/channel_info/notification_preference/notification_preference.test.js b/app/screens/channel_info/notification_preference/notification_preference.test.js index ba296f420..0fc79dfaf 100644 --- a/app/screens/channel_info/notification_preference/notification_preference.test.js +++ b/app/screens/channel_info/notification_preference/notification_preference.test.js @@ -2,9 +2,9 @@ // See LICENSE.txt for license information. import React from 'react'; -import {shallowWithIntl} from 'test/intl-test-helper'; import Preferences from '@mm-redux/constants/preferences'; +import {shallowWithIntl} from '@test/intl-test-helper'; import NotificationPreference from './notification_preference'; diff --git a/app/screens/channel_info/pinned/pinned.test.js b/app/screens/channel_info/pinned/pinned.test.js index 15c36b1bd..05639b9f6 100644 --- a/app/screens/channel_info/pinned/pinned.test.js +++ b/app/screens/channel_info/pinned/pinned.test.js @@ -2,9 +2,9 @@ // See LICENSE.txt for license information. import React from 'react'; -import {shallowWithIntl} from 'test/intl-test-helper'; import Preferences from '@mm-redux/constants/preferences'; +import {shallowWithIntl} from '@test/intl-test-helper'; import Pinned from './pinned'; diff --git a/app/screens/channel_members/channel_members.js b/app/screens/channel_members/channel_members.js index 45bc47f12..d9e400179 100644 --- a/app/screens/channel_members/channel_members.js +++ b/app/screens/channel_members/channel_members.js @@ -1,19 +1,19 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; -import {Alert, View} from 'react-native'; +import React, {PureComponent} from 'react'; import {intlShape} from 'react-intl'; +import {Alert, View} from 'react-native'; import {Navigation} from 'react-native-navigation'; import {SafeAreaView} from 'react-native-safe-area-context'; import {popTopScreen, setButtons} from '@actions/navigation'; -import Loading from '@components/loading'; import CustomList, {FLATLIST, SECTIONLIST} from '@components/custom_list'; import UserListRow from '@components/custom_list/user_list_row'; import FormattedText from '@components/formatted_text'; import KeyboardLayout from '@components/layout/keyboard_layout'; +import Loading from '@components/loading'; import SearchBar from '@components/search_bar'; import StatusBar from '@components/status_bar'; import {debounce} from '@mm-redux/actions/helpers'; diff --git a/app/screens/channel_members/channel_members.test.js b/app/screens/channel_members/channel_members.test.js index 56c3e6a6c..627bf054c 100644 --- a/app/screens/channel_members/channel_members.test.js +++ b/app/screens/channel_members/channel_members.test.js @@ -2,11 +2,10 @@ // See LICENSE.txt for license information. import React from 'react'; +import CustomList from '@components/custom_list'; import Preferences from '@mm-redux/constants/preferences'; +import {shallowWithIntl} from '@test/intl-test-helper'; -import {shallowWithIntl} from 'test/intl-test-helper'; - -import CustomList from 'app/components/custom_list'; import ChannelMembers from './channel_members'; describe('ChannelMembers', () => { diff --git a/app/screens/channel_members/index.js b/app/screens/channel_members/index.js index 04c413e4c..832eb0089 100644 --- a/app/screens/channel_members/index.js +++ b/app/screens/channel_members/index.js @@ -1,15 +1,15 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; -import {getTheme} from '@mm-redux/selectors/entities/preferences'; -import {getCurrentChannel, canManageChannelMembers} from '@mm-redux/selectors/entities/channels'; -import {makeGetProfilesInChannel} from '@mm-redux/selectors/entities/users'; +import {handleRemoveChannelMembers} from '@actions/views/channel_members'; import {getProfilesInChannel, searchProfiles} from '@mm-redux/actions/users'; +import {getCurrentChannel, canManageChannelMembers} from '@mm-redux/selectors/entities/channels'; +import {getTheme} from '@mm-redux/selectors/entities/preferences'; +import {makeGetProfilesInChannel} from '@mm-redux/selectors/entities/users'; -import {handleRemoveChannelMembers} from 'app/actions/views/channel_members'; import ChannelMembers from './channel_members'; function makeMapStateToProps() { diff --git a/app/screens/channel_notification_preference/channel_notification_preference.android.js b/app/screens/channel_notification_preference/channel_notification_preference.android.js index c6387371f..60611635c 100644 --- a/app/screens/channel_notification_preference/channel_notification_preference.android.js +++ b/app/screens/channel_notification_preference/channel_notification_preference.android.js @@ -8,9 +8,10 @@ import { } from 'react-native'; import FormattedText from '@components/formatted_text'; -import RadioButtonGroup from 'app/components/radio_button'; -import StatusBar from 'app/components/status_bar'; -import {changeOpacity, makeStyleSheetFromTheme} from 'app/utils/theme'; +import RadioButtonGroup from '@components/radio_button'; +import StatusBar from '@components/status_bar'; +import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; + import ChannelNotificationPreferenceBase from './channel_notification_preference_base'; export default class ChannelNotificationPreferenceAndroid extends ChannelNotificationPreferenceBase { diff --git a/app/screens/channel_notification_preference/channel_notification_preference.ios.js b/app/screens/channel_notification_preference/channel_notification_preference.ios.js index 828df7fae..2b6f58af4 100644 --- a/app/screens/channel_notification_preference/channel_notification_preference.ios.js +++ b/app/screens/channel_notification_preference/channel_notification_preference.ios.js @@ -9,9 +9,10 @@ import { import {SafeAreaView} from 'react-native-safe-area-context'; import FormattedText from '@components/formatted_text'; -import StatusBar from 'app/components/status_bar'; -import SectionItem from 'app/screens/settings/section_item'; -import {changeOpacity, makeStyleSheetFromTheme} from 'app/utils/theme'; +import StatusBar from '@components/status_bar'; +import SectionItem from '@screens/settings/section_item'; +import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; + import ChannelNotificationPreferenceBase from './channel_notification_preference_base'; export default class ChannelNotificationPreferenceIos extends ChannelNotificationPreferenceBase { diff --git a/app/screens/channel_notification_preference/channel_notification_preference.test.js b/app/screens/channel_notification_preference/channel_notification_preference.test.js index 7dff1b34f..fcca56c30 100644 --- a/app/screens/channel_notification_preference/channel_notification_preference.test.js +++ b/app/screens/channel_notification_preference/channel_notification_preference.test.js @@ -1,12 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. + import React from 'react'; import {ViewTypes} from '@constants'; import Preferences from '@mm-redux/constants/preferences'; import SectionItem from '@screens/settings/section_item'; +import {shallowWithIntlMessages} from '@test/intl-test-helper'; -import {shallowWithIntlMessages} from 'test/intl-test-helper'; import ChannelNotificationPreference from './channel_notification_preference'; function makeProps(pushNotificationLevel) { diff --git a/app/screens/channel_notification_preference/channel_notification_preference_base.js b/app/screens/channel_notification_preference/channel_notification_preference_base.js index d59f74f8e..2f7f23ff0 100644 --- a/app/screens/channel_notification_preference/channel_notification_preference_base.js +++ b/app/screens/channel_notification_preference/channel_notification_preference_base.js @@ -1,14 +1,14 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import {PureComponent} from 'react'; import {intlShape} from 'react-intl'; import {ViewTypes} from '@constants'; -import {alertErrorWithFallback} from 'app/utils/general'; +import {alertErrorWithFallback} from '@utils/general'; import {t} from '@utils/i18n'; -import {preventDoubleTap} from 'app/utils/tap'; +import {preventDoubleTap} from '@utils/tap'; export default class ChannelNotificationPreferenceBase extends PureComponent { static propTypes = { diff --git a/app/screens/channel_notification_preference/index.js b/app/screens/channel_notification_preference/index.js index 0f987e59e..42dad93f2 100644 --- a/app/screens/channel_notification_preference/index.js +++ b/app/screens/channel_notification_preference/index.js @@ -1,12 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; + import {updateChannelNotifyProps} from '@mm-redux/actions/channels'; -import {getCurrentUser} from '@mm-redux/selectors/entities/users'; import {getTheme} from '@mm-redux/selectors/entities/preferences'; -import {isLandscape} from 'app/selectors/device'; +import {getCurrentUser} from '@mm-redux/selectors/entities/users'; +import {isLandscape} from '@selectors/device'; import ChannelNotificationPreference from './channel_notification_preference'; diff --git a/app/screens/code/code.js b/app/screens/code/code.js index 59687f491..4dc50e155 100644 --- a/app/screens/code/code.js +++ b/app/screens/code/code.js @@ -14,13 +14,13 @@ import { } from 'react-native'; import {SafeAreaView} from 'react-native-safe-area-context'; -import {getCodeFont} from 'app/utils/markdown'; +import {popTopScreen} from '@actions/navigation'; +import {getCodeFont} from '@utils/markdown'; import { changeOpacity, makeStyleSheetFromTheme, getKeyboardAppearanceFromTheme, -} from 'app/utils/theme'; -import {popTopScreen} from 'app/actions/navigation'; +} from '@utils/theme'; export default class Code extends React.PureComponent { static propTypes = { diff --git a/app/screens/create_channel/create_channel.js b/app/screens/create_channel/create_channel.js index d88b447c9..5e2d66710 100644 --- a/app/screens/create_channel/create_channel.js +++ b/app/screens/create_channel/create_channel.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import {intlShape} from 'react-intl'; import { Keyboard, @@ -10,13 +10,12 @@ import { } from 'react-native'; import {Navigation} from 'react-native-navigation'; +import {popTopScreen, dismissModal, setButtons} from '@actions/navigation'; +import EditChannelInfo from '@components/edit_channel_info'; +import {NavigationTypes} from '@constants'; import {General, RequestStatus} from '@mm-redux/constants'; import EventEmitter from '@mm-redux/utils/event_emitter'; -import {popTopScreen, dismissModal, setButtons} from 'app/actions/navigation'; -import EditChannelInfo from 'app/components/edit_channel_info'; -import {NavigationTypes} from 'app/constants'; - export default class CreateChannel extends PureComponent { static propTypes = { componentId: PropTypes.string, diff --git a/app/screens/create_channel/index.js b/app/screens/create_channel/index.js index 4f09f9e4d..3b4ae77c0 100644 --- a/app/screens/create_channel/index.js +++ b/app/screens/create_channel/index.js @@ -1,13 +1,12 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; +import {handleCreateChannel} from '@actions/views/create_channel'; import {getTheme} from '@mm-redux/selectors/entities/preferences'; -import {handleCreateChannel} from 'app/actions/views/create_channel'; - import CreateChannel from './create_channel'; function mapStateToProps(state) { diff --git a/app/screens/custom_status/custom_status_modal.test.tsx b/app/screens/custom_status/custom_status_modal.test.tsx index 84bdb139f..43ba166bb 100644 --- a/app/screens/custom_status/custom_status_modal.test.tsx +++ b/app/screens/custom_status/custom_status_modal.test.tsx @@ -4,10 +4,9 @@ import React from 'react'; import Preferences from '@mm-redux/constants/preferences'; -import CustomStatusModal from '@screens/custom_status/custom_status_modal'; - -import {shallowWithIntl} from 'test/intl-test-helper'; import {CustomStatusDuration} from '@mm-redux/types/users'; +import CustomStatusModal from '@screens/custom_status/custom_status_modal'; +import {shallowWithIntl} from '@test/intl-test-helper'; describe('screens/custom_status_modal', () => { const customStatus = { diff --git a/app/screens/custom_status/custom_status_modal.tsx b/app/screens/custom_status/custom_status_modal.tsx index f876c1fb3..593d9dda4 100644 --- a/app/screens/custom_status/custom_status_modal.tsx +++ b/app/screens/custom_status/custom_status_modal.tsx @@ -9,10 +9,10 @@ import {Navigation, NavigationComponent, NavigationComponentProps, OptionsTopBar import {SafeAreaView} from 'react-native-safe-area-context'; import {dismissModal, showModal, mergeNavigationOptions, goToScreen} from '@actions/navigation'; -import Emoji from '@components/emoji'; import CompassIcon from '@components/compass_icon'; import ClearButton from '@components/custom_status/clear_button'; import CustomStatusExpiry from '@components/custom_status/custom_status_expiry'; +import Emoji from '@components/emoji'; import FormattedText from '@components/formatted_text'; import StatusBar from '@components/status_bar'; import {CustomStatus, DeviceTypes} from '@constants'; @@ -25,8 +25,8 @@ import CustomStatusSuggestion from '@screens/custom_status/custom_status_suggest import {getRoundedTime} from '@screens/custom_status_clear_after/date_time_selector'; import {t} from '@utils/i18n'; import {preventDoubleTap} from '@utils/tap'; -import {getCurrentMomentForTimezone} from '@utils/timezone'; import {changeOpacity, getKeyboardAppearanceFromTheme, makeStyleSheetFromTheme} from '@utils/theme'; +import {getCurrentMomentForTimezone} from '@utils/timezone'; type DefaultUserCustomStatus = { emoji: string; diff --git a/app/screens/custom_status/custom_status_suggestion.test.tsx b/app/screens/custom_status/custom_status_suggestion.test.tsx index a1b8b1226..df76288c8 100644 --- a/app/screens/custom_status/custom_status_suggestion.test.tsx +++ b/app/screens/custom_status/custom_status_suggestion.test.tsx @@ -5,9 +5,9 @@ import React from 'react'; import {TouchableOpacity} from 'react-native'; import Preferences from '@mm-redux/constants/preferences'; -import CustomStatusSuggestion from '@screens/custom_status/custom_status_suggestion'; import {CustomStatusDuration} from '@mm-redux/types/users'; -import {shallowWithIntl} from 'test/intl-test-helper'; +import CustomStatusSuggestion from '@screens/custom_status/custom_status_suggestion'; +import {shallowWithIntl} from '@test/intl-test-helper'; describe('screens/custom_status_suggestion', () => { const baseProps = { diff --git a/app/screens/custom_status/custom_status_suggestion.tsx b/app/screens/custom_status/custom_status_suggestion.tsx index 17edcb301..a10d213f8 100644 --- a/app/screens/custom_status/custom_status_suggestion.tsx +++ b/app/screens/custom_status/custom_status_suggestion.tsx @@ -1,13 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {injectIntl, intlShape} from 'react-intl'; import React, {useCallback} from 'react'; +import {injectIntl, intlShape} from 'react-intl'; import {View, TouchableOpacity, Text} from 'react-native'; -import Emoji from '@components/emoji'; import ClearButton from '@components/custom_status/clear_button'; import CustomStatusText from '@components/custom_status/custom_status_text'; +import Emoji from '@components/emoji'; import {durationValues} from '@constants/custom_status'; import {Theme} from '@mm-redux/types/preferences'; import {CustomStatusDuration, UserCustomStatus} from '@mm-redux/types/users'; diff --git a/app/screens/custom_status_clear_after/clear_after_menu_item.test.tsx b/app/screens/custom_status_clear_after/clear_after_menu_item.test.tsx index 12248d650..fb776b23c 100644 --- a/app/screens/custom_status_clear_after/clear_after_menu_item.test.tsx +++ b/app/screens/custom_status_clear_after/clear_after_menu_item.test.tsx @@ -5,7 +5,8 @@ import {TouchableOpacity} from 'react-native'; import Preferences from '@mm-redux/constants/preferences'; import {CustomStatusDuration} from '@mm-redux/types/users'; -import {shallowWithIntl} from 'test/intl-test-helper'; +import {shallowWithIntl} from '@test/intl-test-helper'; + import ClearAfterMenuItem from './clear_after_menu_item'; describe('screens/clear_after_menu_item', () => { diff --git a/app/screens/custom_status_clear_after/clear_after_modal.test.tsx b/app/screens/custom_status_clear_after/clear_after_modal.test.tsx index c78149ee7..dbde77ee9 100644 --- a/app/screens/custom_status_clear_after/clear_after_modal.test.tsx +++ b/app/screens/custom_status_clear_after/clear_after_modal.test.tsx @@ -6,7 +6,7 @@ import React from 'react'; import Preferences from '@mm-redux/constants/preferences'; import {CustomStatusDuration} from '@mm-redux/types/users'; import ClearAfterModal from '@screens/custom_status_clear_after/clear_after_modal'; -import {shallowWithIntl} from 'test/intl-test-helper'; +import {shallowWithIntl} from '@test/intl-test-helper'; describe('screens/clear_after_modal', () => { const baseProps = { diff --git a/app/screens/custom_status_clear_after/clear_after_modal.tsx b/app/screens/custom_status_clear_after/clear_after_modal.tsx index f4c373e2f..3f51e20fa 100644 --- a/app/screens/custom_status_clear_after/clear_after_modal.tsx +++ b/app/screens/custom_status_clear_after/clear_after_modal.tsx @@ -1,9 +1,9 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {SafeAreaView, View, StatusBar} from 'react-native'; import React from 'react'; import {intlShape, injectIntl} from 'react-intl'; +import {SafeAreaView, View, StatusBar} from 'react-native'; import {KeyboardAwareScrollView} from 'react-native-keyboard-aware-scrollview'; import { Navigation, @@ -14,11 +14,11 @@ import { OptionsTopBarButton, } from 'react-native-navigation'; +import {mergeNavigationOptions, popTopScreen} from '@actions/navigation'; import {Theme} from '@mm-redux/types/preferences'; import {CustomStatusDuration} from '@mm-redux/types/users'; import {makeStyleSheetFromTheme, changeOpacity} from '@utils/theme'; -import {mergeNavigationOptions, popTopScreen} from 'app/actions/navigation'; import ClearAfterMenuItem from './clear_after_menu_item'; interface Props extends NavigationComponentProps { intl: typeof intlShape; diff --git a/app/screens/custom_status_clear_after/date_time_selector.test.tsx b/app/screens/custom_status_clear_after/date_time_selector.test.tsx index 63af3ddb3..3a2c0a86a 100644 --- a/app/screens/custom_status_clear_after/date_time_selector.test.tsx +++ b/app/screens/custom_status_clear_after/date_time_selector.test.tsx @@ -4,7 +4,8 @@ import React from 'react'; import Preferences from '@mm-redux/constants/preferences'; -import {renderWithRedux} from 'test/testing_library'; +import {renderWithRedux} from '@test/testing_library'; + import DateTimeSelector from './date_time_selector'; describe('screens/date_time_selector', () => { diff --git a/app/screens/custom_status_clear_after/date_time_selector.tsx b/app/screens/custom_status_clear_after/date_time_selector.tsx index 99e6a52b1..c9ef31a8e 100644 --- a/app/screens/custom_status_clear_after/date_time_selector.tsx +++ b/app/screens/custom_status_clear_after/date_time_selector.tsx @@ -1,6 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import DateTimePicker from '@react-native-community/datetimepicker'; + import moment, {Moment} from 'moment-timezone'; import React, {useState} from 'react'; import {View, Button, Platform} from 'react-native'; @@ -11,7 +13,6 @@ import {getBool} from '@mm-redux/selectors/entities/preferences'; import {getCurrentUserTimezone} from '@mm-redux/selectors/entities/timezone'; import {Theme} from '@mm-redux/types/preferences'; import {GlobalState} from '@mm-redux/types/store'; -import DateTimePicker from '@react-native-community/datetimepicker'; import {makeStyleSheetFromTheme} from '@utils/theme'; import {getCurrentMomentForTimezone, getUtcOffsetForTimeZone} from '@utils/timezone'; diff --git a/app/screens/edit_channel/edit_channel.js b/app/screens/edit_channel/edit_channel.js index 1fa84b463..e07d08cb2 100644 --- a/app/screens/edit_channel/edit_channel.js +++ b/app/screens/edit_channel/edit_channel.js @@ -1,22 +1,22 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import {intlShape} from 'react-intl'; import { Keyboard, InteractionManager, } from 'react-native'; import {Navigation} from 'react-native-navigation'; + +import {popTopScreen, setButtons} from '@actions/navigation'; +import EditChannelInfo from '@components/edit_channel_info'; +import {NavigationTypes, ViewTypes} from '@constants'; import {General, RequestStatus} from '@mm-redux/constants'; import EventEmitter from '@mm-redux/utils/event_emitter'; - -import EditChannelInfo from 'app/components/edit_channel_info'; -import {NavigationTypes, ViewTypes} from 'app/constants'; -import {cleanUpUrlable} from 'app/utils/url'; -import {t} from 'app/utils/i18n'; -import {popTopScreen, setButtons} from 'app/actions/navigation'; +import {t} from '@utils/i18n'; +import {cleanUpUrlable} from '@utils/url'; const messages = { display_name_required: { diff --git a/app/screens/edit_channel/index.js b/app/screens/edit_channel/index.js index ced8ad665..d266b39d0 100644 --- a/app/screens/edit_channel/index.js +++ b/app/screens/edit_channel/index.js @@ -1,15 +1,14 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; -import {getCurrentChannel} from '@mm-redux/selectors/entities/channels'; -import {getCurrentTeamUrl} from '@mm-redux/selectors/entities/teams'; +import {setChannelDisplayName} from '@actions/views/channel'; import {patchChannel, getChannel} from '@mm-redux/actions/channels'; +import {getCurrentChannel} from '@mm-redux/selectors/entities/channels'; import {getTheme} from '@mm-redux/selectors/entities/preferences'; - -import {setChannelDisplayName} from 'app/actions/views/channel'; +import {getCurrentTeamUrl} from '@mm-redux/selectors/entities/teams'; import EditChannel from './edit_channel'; diff --git a/app/screens/edit_post/edit_post.js b/app/screens/edit_post/edit_post.js index ea7b68c90..08dc18809 100644 --- a/app/screens/edit_post/edit_post.js +++ b/app/screens/edit_post/edit_post.js @@ -1,31 +1,31 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import {intlShape} from 'react-intl'; import { Platform, View, Keyboard, } from 'react-native'; -import {Navigation} from 'react-native-navigation'; import {KeyboardTrackingView} from 'react-native-keyboard-tracking-view'; +import {Navigation} from 'react-native-navigation'; import {SafeAreaView} from 'react-native-safe-area-context'; -import Autocomplete from 'app/components/autocomplete'; -import ErrorText from 'app/components/error_text'; -import Loading from 'app/components/loading'; -import StatusBar from 'app/components/status_bar'; -import TextInputWithLocalizedPlaceholder from 'app/components/text_input_with_localized_placeholder'; +import {dismissModal, setButtons} from '@actions/navigation'; +import Autocomplete from '@components/autocomplete'; +import ErrorText from '@components/error_text'; +import Loading from '@components/loading'; +import StatusBar from '@components/status_bar'; +import TextInputWithLocalizedPlaceholder from '@components/text_input_with_localized_placeholder'; import DEVICE from '@constants/device'; -import {switchKeyboardForCodeBlocks} from 'app/utils/markdown'; +import {t} from '@utils/i18n'; +import {switchKeyboardForCodeBlocks} from '@utils/markdown'; import { changeOpacity, makeStyleSheetFromTheme, getKeyboardAppearanceFromTheme, -} from 'app/utils/theme'; -import {t} from 'app/utils/i18n'; -import {dismissModal, setButtons} from 'app/actions/navigation'; +} from '@utils/theme'; export default class EditPost extends PureComponent { static propTypes = { diff --git a/app/screens/edit_post/edit_post.test.js b/app/screens/edit_post/edit_post.test.js index 7d02a341c..2cd140332 100644 --- a/app/screens/edit_post/edit_post.test.js +++ b/app/screens/edit_post/edit_post.test.js @@ -5,8 +5,7 @@ import React from 'react'; import {Keyboard} from 'react-native'; import Preferences from '@mm-redux/constants/preferences'; - -import {shallowWithIntl} from 'test/intl-test-helper'; +import {shallowWithIntl} from '@test/intl-test-helper'; import EditPost from './edit_post'; diff --git a/app/screens/edit_post/index.js b/app/screens/edit_post/index.js index 04f1e62b5..31b7d2c99 100644 --- a/app/screens/edit_post/index.js +++ b/app/screens/edit_post/index.js @@ -1,14 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; +import {MAX_MESSAGE_LENGTH_FALLBACK} from '@constants/post_draft'; import {editPost} from '@mm-redux/actions/posts'; import {getConfig} from '@mm-redux/selectors/entities/general'; import {getTheme} from '@mm-redux/selectors/entities/preferences'; - -import {MAX_MESSAGE_LENGTH_FALLBACK} from '@constants/post_draft'; import {getDimensions} from '@selectors/device'; import EditPost from './edit_post'; diff --git a/app/screens/edit_profile/edit_profile.js b/app/screens/edit_profile/edit_profile.js index 7621f21e3..6d3eac38e 100644 --- a/app/screens/edit_profile/edit_profile.js +++ b/app/screens/edit_profile/edit_profile.js @@ -1,32 +1,31 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import {intlShape} from 'react-intl'; import {Alert, View} from 'react-native'; -import RNFetchBlob from 'rn-fetch-blob'; -import {KeyboardAwareScrollView} from 'react-native-keyboard-aware-scrollview'; import DocumentPicker from 'react-native-document-picker'; +import {KeyboardAwareScrollView} from 'react-native-keyboard-aware-scrollview'; import {Navigation} from 'react-native-navigation'; import {SafeAreaView} from 'react-native-safe-area-context'; +import RNFetchBlob from 'rn-fetch-blob'; +import {popTopScreen, dismissModal, setButtons} from '@actions/navigation'; import {Client4} from '@client/rest'; +import ErrorText from '@components/error_text'; +import Loading from '@components/loading'; +import ProfilePicture from '@components/profile_picture'; +import ProfilePictureButton from '@components/profile_picture_button'; +import StatusBar from '@components/status_bar/index'; +import TextSetting from '@components/widgets/settings/text_setting'; import {getFormattedFileSize} from '@mm-redux/utils/file_utils'; +import {buildFileUploadData, encodeHeaderURIStringToUTF8} from '@utils/file'; +import {t} from '@utils/i18n'; +import {preventDoubleTap} from '@utils/tap'; +import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; -import {buildFileUploadData, encodeHeaderURIStringToUTF8} from 'app/utils/file'; -import {preventDoubleTap} from 'app/utils/tap'; -import {changeOpacity, makeStyleSheetFromTheme} from 'app/utils/theme'; -import {t} from 'app/utils/i18n'; - -import TextSetting from 'app/components/widgets/settings/text_setting'; -import Loading from 'app/components/loading'; -import ErrorText from 'app/components/error_text'; -import StatusBar from 'app/components/status_bar/index'; -import ProfilePictureButton from 'app/components/profile_picture_button'; -import ProfilePicture from 'app/components/profile_picture'; import mattermostBucket from 'app/mattermost_bucket'; -import {popTopScreen, dismissModal, setButtons} from 'app/actions/navigation'; const MAX_SIZE = 20 * 1024 * 1024; export const VALID_MIME_TYPES = [ diff --git a/app/screens/edit_profile/edit_profile.test.js b/app/screens/edit_profile/edit_profile.test.js index 21e9695d4..d371c5c09 100644 --- a/app/screens/edit_profile/edit_profile.test.js +++ b/app/screens/edit_profile/edit_profile.test.js @@ -3,7 +3,7 @@ import React from 'react'; import Preferences from '@mm-redux/constants/preferences'; -import {shallowWithIntl} from 'test/intl-test-helper'; +import {shallowWithIntl} from '@test/intl-test-helper'; import EditProfile from './edit_profile.js'; diff --git a/app/screens/edit_profile/index.js b/app/screens/edit_profile/index.js index 573e5f10c..86dfae878 100644 --- a/app/screens/edit_profile/index.js +++ b/app/screens/edit_profile/index.js @@ -4,11 +4,11 @@ import {connect} from 'react-redux'; import {bindActionCreators} from 'redux'; +import {setProfileImageUri, removeProfileImage, updateUser} from '@actions/views/edit_profile'; import {getConfig} from '@mm-redux/selectors/entities/general'; import {getTheme} from '@mm-redux/selectors/entities/preferences'; import {isMinimumServerVersion} from '@mm-redux/utils/helpers'; -import {isLandscape} from 'app/selectors/device'; -import {setProfileImageUri, removeProfileImage, updateUser} from 'app/actions/views/edit_profile'; +import {isLandscape} from '@selectors/device'; import EditProfile from './edit_profile'; diff --git a/app/screens/error_teams_list/error_teams_list.js b/app/screens/error_teams_list/error_teams_list.js index 45950ac5e..15998e477 100644 --- a/app/screens/error_teams_list/error_teams_list.js +++ b/app/screens/error_teams_list/error_teams_list.js @@ -1,17 +1,17 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import {intlShape} from 'react-intl'; import {InteractionManager, StyleSheet} from 'react-native'; import {Navigation} from 'react-native-navigation'; import {SafeAreaView} from 'react-native-safe-area-context'; -import FailedNetworkAction from 'app/components/failed_network_action'; -import Loading from 'app/components/loading'; -import StatusBar from 'app/components/status_bar'; -import {resetToChannel} from 'app/actions/navigation'; +import {resetToChannel} from '@actions/navigation'; +import FailedNetworkAction from '@components/failed_network_action'; +import Loading from '@components/loading'; +import StatusBar from '@components/status_bar'; export default class ErrorTeamsList extends PureComponent { static propTypes = { diff --git a/app/screens/error_teams_list/error_teams_list.test.js b/app/screens/error_teams_list/error_teams_list.test.js index b0d719813..5764756fb 100644 --- a/app/screens/error_teams_list/error_teams_list.test.js +++ b/app/screens/error_teams_list/error_teams_list.test.js @@ -5,7 +5,7 @@ import React from 'react'; import FailedNetworkAction from '@components/failed_network_action'; import Preferences from '@mm-redux/constants/preferences'; -import {shallowWithIntl} from 'test/intl-test-helper.js'; +import {shallowWithIntl} from '@test/intl-test-helper.js'; import ErrorTeamsList from './error_teams_list'; diff --git a/app/screens/error_teams_list/index.js b/app/screens/error_teams_list/index.js index 2512a624a..645fe7f05 100644 --- a/app/screens/error_teams_list/index.js +++ b/app/screens/error_teams_list/index.js @@ -1,12 +1,12 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; -import {logout, loadMe} from 'app/actions/views/user'; -import {connection} from 'app/actions/device'; -import {selectDefaultTeam} from 'app/actions/views/select_team'; +import {connection} from '@actions/device'; +import {selectDefaultTeam} from '@actions/views/select_team'; +import {logout, loadMe} from '@actions/views/user'; import ErrorTeamsList from './error_teams_list.js'; diff --git a/app/screens/expanded_announcement_banner/index.js b/app/screens/expanded_announcement_banner/index.js index aa6141903..f12d3b54f 100644 --- a/app/screens/expanded_announcement_banner/index.js +++ b/app/screens/expanded_announcement_banner/index.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; import {dismissBanner} from '@actions/views/announcement'; import {getConfig} from '@mm-redux/selectors/entities/general'; diff --git a/app/screens/forgot_password/forgot_password.js b/app/screens/forgot_password/forgot_password.js index 251eb880e..8622ee42d 100644 --- a/app/screens/forgot_password/forgot_password.js +++ b/app/screens/forgot_password/forgot_password.js @@ -1,11 +1,9 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; -import Button from 'react-native-button'; +import React, {PureComponent} from 'react'; import {intlShape} from 'react-intl'; - import { Image, StyleSheet, @@ -14,6 +12,7 @@ import { TouchableWithoutFeedback, View, } from 'react-native'; +import Button from 'react-native-button'; import {SafeAreaView} from 'react-native-safe-area-context'; import ErrorText from '@components/error_text'; diff --git a/app/screens/forgot_password/forgot_password.test.js b/app/screens/forgot_password/forgot_password.test.js index 492808e8e..cd56dee2a 100644 --- a/app/screens/forgot_password/forgot_password.test.js +++ b/app/screens/forgot_password/forgot_password.test.js @@ -3,7 +3,7 @@ import React from 'react'; -import {shallowWithIntl} from 'test/intl-test-helper'; +import {shallowWithIntl} from '@test/intl-test-helper'; import ForgotPassword from './forgot_password.js'; diff --git a/app/screens/forgot_password/index.js b/app/screens/forgot_password/index.js index 3413bb5b6..aae9f6836 100644 --- a/app/screens/forgot_password/index.js +++ b/app/screens/forgot_password/index.js @@ -1,10 +1,11 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; import {sendPasswordResetEmail} from '@mm-redux/actions/users'; + import ForgotPassword from './forgot_password'; function mapDispatchToProps(dispatch) { diff --git a/app/screens/gallery/animation_helper.ts b/app/screens/gallery/animation_helper.ts index 2f663e3fb..01058f022 100644 --- a/app/screens/gallery/animation_helper.ts +++ b/app/screens/gallery/animation_helper.ts @@ -1,5 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import {Platform} from 'react-native'; +import {State} from 'react-native-gesture-handler'; import Animated, { Clock, Value, @@ -33,8 +35,6 @@ import { useValue, vec, } from 'react-native-redash/lib/module/v1'; -import {Platform} from 'react-native'; -import {State} from 'react-native-gesture-handler'; const pinchEnd = proc( (state: Animated.Node, numberOfPointers: Animated.Node) => diff --git a/app/screens/gallery/footer/index.tsx b/app/screens/gallery/footer/index.tsx index c8cf253d8..e42322173 100644 --- a/app/screens/gallery/footer/index.tsx +++ b/app/screens/gallery/footer/index.tsx @@ -1,21 +1,22 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {forwardRef, useEffect, useRef, useState, useImperativeHandle} from 'react'; -import {Animated, Easing, StyleSheet} from 'react-native'; -import {injectIntl} from 'react-intl'; import Clipboard from '@react-native-community/clipboard'; -import {ATTACHMENT_DOWNLOAD} from '@constants/attachment'; -import {Client4} from '@client/rest'; -import EventEmitter from '@mm-redux/utils/event_emitter'; +import React, {forwardRef, useEffect, useRef, useState, useImperativeHandle} from 'react'; +import {injectIntl} from 'react-intl'; +import {Animated, Easing, StyleSheet} from 'react-native'; -import type {CallbackFunctionWithoutArguments, PrepareFileRef, FooterProps, FooterRef, ShowToast, ToastRef} from 'types/screens/gallery'; +import {Client4} from '@client/rest'; +import {ATTACHMENT_DOWNLOAD} from '@constants/attachment'; +import EventEmitter from '@mm-redux/utils/event_emitter'; import PrepareFile from './prepare_file'; import Summary from './summary'; import Toast from './toast'; +import type {CallbackFunctionWithoutArguments, PrepareFileRef, FooterProps, FooterRef, ShowToast, ToastRef} from '@mm-types/screens/gallery'; + const styles = StyleSheet.create({ footer: { position: 'absolute', diff --git a/app/screens/gallery/footer/prepare_file/index.ts b/app/screens/gallery/footer/prepare_file/index.ts index 0ef0d5c1c..501a231f8 100644 --- a/app/screens/gallery/footer/prepare_file/index.ts +++ b/app/screens/gallery/footer/prepare_file/index.ts @@ -6,10 +6,10 @@ import {connect} from 'react-redux'; import {getTheme} from '@mm-redux/selectors/entities/preferences'; import {isLandscape} from '@selectors/device'; -import type {GlobalState} from '@mm-redux/types/store'; - import PrepareFile from './prepare_file'; +import type {GlobalState} from '@mm-redux/types/store'; + function mapStateToProps(state: GlobalState) { return { isLandscape: isLandscape(state), diff --git a/app/screens/gallery/footer/prepare_file/prepare_file.tsx b/app/screens/gallery/footer/prepare_file/prepare_file.tsx index aa0dfa643..79eaac4f1 100644 --- a/app/screens/gallery/footer/prepare_file/prepare_file.tsx +++ b/app/screens/gallery/footer/prepare_file/prepare_file.tsx @@ -4,25 +4,26 @@ import React, {forwardRef, useEffect, useRef, useState, useImperativeHandle} from 'react'; import {intlShape} from 'react-intl'; import {Alert, BackHandler, Platform, StyleSheet, Text, View, ViewStyle} from 'react-native'; -import RNFetchBlob, {FetchBlobResponse, RNFetchBlobConfig, StatefulPromise} from 'rn-fetch-blob'; import {useSafeAreaInsets} from 'react-native-safe-area-context'; import Share from 'react-native-share'; +import RNFetchBlob, {FetchBlobResponse, RNFetchBlobConfig, StatefulPromise} from 'rn-fetch-blob'; +import {Client4} from '@client/rest'; import CompassIcon from '@components/compass_icon'; import FormattedText from '@components/formatted_text'; import ProgressBar from '@components/progress_bar'; -import {Client4} from '@client/rest'; +import {Theme} from '@mm-redux/types/preferences'; import {getLocalPath} from '@utils/file'; + import mattermostBucket from 'app/mattermost_bucket'; import type {FileInfo} from '@mm-redux/types/files'; -import {Theme} from '@mm-redux/types/preferences'; -import type {PrepareFileRef} from 'types/screens/gallery'; +import type {PrepareFileRef} from '@mm-types/screens/gallery'; type PrepareFileProps = { intl: typeof intlShape; isLandscape: boolean; - theme: Theme, + theme: Theme; } const styles = StyleSheet.create({ diff --git a/app/screens/gallery/footer/summary/actions/action.tsx b/app/screens/gallery/footer/summary/actions/action.tsx index 06cf7248a..d81a773ed 100644 --- a/app/screens/gallery/footer/summary/actions/action.tsx +++ b/app/screens/gallery/footer/summary/actions/action.tsx @@ -4,7 +4,7 @@ import React, {useCallback, useState} from 'react'; import {Platform, Pressable, PressableStateCallbackType} from 'react-native'; -import type {ActionProps} from 'types/screens/gallery'; +import type {ActionProps} from '@mm-types/screens/gallery'; const pressedStyle = ({pressed}: PressableStateCallbackType) => { let opacity = 1; diff --git a/app/screens/gallery/footer/summary/actions/actions.tsx b/app/screens/gallery/footer/summary/actions/actions.tsx index f4f08d52a..44881b9f8 100644 --- a/app/screens/gallery/footer/summary/actions/actions.tsx +++ b/app/screens/gallery/footer/summary/actions/actions.tsx @@ -5,12 +5,12 @@ import React, {useEffect, useState} from 'react'; import {StyleSheet, View} from 'react-native'; import CompassIcon from '@components/compass_icon'; -import type {ActionsProps, ManagedConfig} from 'types/screens/gallery'; - -import mattermostManaged from 'app/mattermost_managed'; +import mattermostManaged from '@mattermost-managed'; import Action from './action'; +import type {ActionsProps, ManagedConfig} from '@mm-types/screens/gallery'; + const styles = StyleSheet.create({ contaier: { flexDirection: 'row', diff --git a/app/screens/gallery/footer/summary/actions/index.ts b/app/screens/gallery/footer/summary/actions/index.ts index 30aec0a9b..46eab5c80 100644 --- a/app/screens/gallery/footer/summary/actions/index.ts +++ b/app/screens/gallery/footer/summary/actions/index.ts @@ -5,10 +5,10 @@ import {connect} from 'react-redux'; import {canDownloadFilesOnMobile, getConfig} from '@mm-redux/selectors/entities/general'; -import type {GlobalState} from '@mm-redux/types/store'; - import Actions from './actions'; +import type {GlobalState} from '@mm-redux/types/store'; + function mapStateToProps(state: GlobalState) { const config = getConfig(state); diff --git a/app/screens/gallery/footer/summary/avatar.tsx b/app/screens/gallery/footer/summary/avatar.tsx index bc32a611b..a34e4d184 100644 --- a/app/screens/gallery/footer/summary/avatar.tsx +++ b/app/screens/gallery/footer/summary/avatar.tsx @@ -7,7 +7,8 @@ import FastImage from 'react-native-fast-image'; import CompassIcon from '@components/compass_icon'; import {changeOpacity} from '@mm-redux/utils/theme_utils'; -import type {AvatarProps} from 'types/screens/gallery'; + +import type {AvatarProps} from '@mm-types/screens/gallery'; const styles = StyleSheet.create({ avatarContainer: { diff --git a/app/screens/gallery/footer/summary/details.tsx b/app/screens/gallery/footer/summary/details.tsx index 1d599240a..3eef01176 100644 --- a/app/screens/gallery/footer/summary/details.tsx +++ b/app/screens/gallery/footer/summary/details.tsx @@ -6,7 +6,7 @@ import {StyleSheet, Text, View} from 'react-native'; import FormattedText from '@components/formatted_text'; -import type {DetailsProps} from 'types/screens/gallery'; +import type {DetailsProps} from '@mm-types/screens/gallery'; const styles = StyleSheet.create({ container: { diff --git a/app/screens/gallery/footer/summary/index.ts b/app/screens/gallery/footer/summary/index.ts index 931199c53..9ab37f962 100644 --- a/app/screens/gallery/footer/summary/index.ts +++ b/app/screens/gallery/footer/summary/index.ts @@ -8,17 +8,17 @@ import {General} from '@mm-redux/constants'; import {getChannel, getCurrentChannel} from '@mm-redux/selectors/entities/channels'; import {getConfig} from '@mm-redux/selectors/entities/general'; import {getPost} from '@mm-redux/selectors/entities/posts'; -import {getCurrentUserId, getUser} from '@mm-redux/selectors/entities/users'; import {getTeammateNameDisplaySetting, getTheme} from '@mm-redux/selectors/entities/preferences'; +import {getCurrentUserId, getUser} from '@mm-redux/selectors/entities/users'; import {isFromWebhook} from '@mm-redux/utils/post_utils'; import {displayUsername} from '@mm-redux/utils/user_utils'; import {isLandscape} from '@selectors/device'; -import type {GlobalState} from '@mm-redux/types/store'; -import type {FooterProps} from 'types/screens/gallery'; - import Summary from './summary'; +import type {GlobalState} from '@mm-redux/types/store'; +import type {FooterProps} from '@mm-types/screens/gallery'; + function mapStateToProps(state: GlobalState, ownProps: FooterProps) { const config = getConfig(state); const currentUserId = getCurrentUserId(state); diff --git a/app/screens/gallery/footer/summary/summary.tsx b/app/screens/gallery/footer/summary/summary.tsx index 490230d3e..12a07ebc4 100644 --- a/app/screens/gallery/footer/summary/summary.tsx +++ b/app/screens/gallery/footer/summary/summary.tsx @@ -5,12 +5,12 @@ import React from 'react'; import {Platform, StyleSheet, View, ViewStyle} from 'react-native'; import {SafeAreaView} from 'react-native-safe-area-context'; -import type {SummaryProps} from 'types/screens/gallery'; - import Actions from './actions'; import Avatar from './avatar'; import Details from './details'; +import type {SummaryProps} from '@mm-types/screens/gallery'; + const styles = StyleSheet.create({ container: { backgroundColor: '#000', diff --git a/app/screens/gallery/footer/toast/index.ts b/app/screens/gallery/footer/toast/index.ts index c31d8b63f..6b3dec9fd 100644 --- a/app/screens/gallery/footer/toast/index.ts +++ b/app/screens/gallery/footer/toast/index.ts @@ -5,10 +5,10 @@ import {connect} from 'react-redux'; import {getTheme} from '@mm-redux/selectors/entities/preferences'; -import type {GlobalState} from '@mm-redux/types/store'; - import Toast from './toast'; +import type {GlobalState} from '@mm-redux/types/store'; + function mapStateToProps(state: GlobalState) { return { theme: getTheme(state), diff --git a/app/screens/gallery/footer/toast/toast.tsx b/app/screens/gallery/footer/toast/toast.tsx index 0abe68d76..0fc97052d 100644 --- a/app/screens/gallery/footer/toast/toast.tsx +++ b/app/screens/gallery/footer/toast/toast.tsx @@ -5,7 +5,8 @@ import React, {useEffect, useImperativeHandle, useState, useRef, forwardRef} fro import {Animated, StyleSheet, Text, View} from 'react-native'; import CompassIcon from '@components/compass_icon'; -import type {ToastProps, ToastRef, ToastState, ShowToast} from 'types/screens/gallery'; + +import type {ToastProps, ToastRef, ToastState, ShowToast} from '@mm-types/screens/gallery'; const DEFAULT_DURATION = 1000; const FADE_DURATION = 400; diff --git a/app/screens/gallery/gallery.js b/app/screens/gallery/gallery.js index fba7d53f4..24c822fda 100644 --- a/app/screens/gallery/gallery.js +++ b/app/screens/gallery/gallery.js @@ -1,10 +1,10 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; -import {Platform, StatusBar} from 'react-native'; +import React, {PureComponent} from 'react'; import {intlShape} from 'react-intl'; +import {Platform, StatusBar} from 'react-native'; import {mergeNavigationOptions, popTopScreen} from '@actions/navigation'; import CompassIcon from '@components/compass_icon'; diff --git a/app/screens/gallery/gallery.test.js.disabled b/app/screens/gallery/gallery.test.js.disabled index 0c5fca87c..77d6e3b81 100644 --- a/app/screens/gallery/gallery.test.js.disabled +++ b/app/screens/gallery/gallery.test.js.disabled @@ -2,11 +2,11 @@ // See LICENSE.txt for license information. import React from 'react'; -import {shallowWithIntl} from 'test/intl-test-helper'; +import {shallowWithIntl} from '@test/intl-test-helper'; import Preferences from '@mm-redux/constants/preferences'; -import * as NavigationActions from 'app/actions/navigation'; +import * as NavigationActions from '@actions/navigation'; import Gallery from './gallery'; diff --git a/app/screens/gallery/gallery_file/gallery_file.tsx b/app/screens/gallery/gallery_file/gallery_file.tsx index 17ba5d712..8a028f282 100644 --- a/app/screens/gallery/gallery_file/gallery_file.tsx +++ b/app/screens/gallery/gallery_file/gallery_file.tsx @@ -4,8 +4,8 @@ import React, {useCallback, useState} from 'react'; import {injectIntl} from 'react-intl'; import {Alert, Appearance, Platform, Text, StatusBar, StatusBarStyle, View} from 'react-native'; -import {TapGestureHandler} from 'react-native-gesture-handler'; import FileViewer from 'react-native-file-viewer'; +import {TapGestureHandler} from 'react-native-gesture-handler'; import tinyColor from 'tinycolor2'; import FileIcon from '@components//post_list/post/body/files/file_icon'; @@ -16,7 +16,7 @@ import {isDocument} from '@utils/file'; import {preventDoubleTap} from '@utils/tap'; import {makeStyleSheetFromTheme} from '@utils/theme'; -import type {GalleryItemProps} from 'types/screens/gallery'; +import type {GalleryItemProps} from '@mm-types/screens/gallery'; interface GalleryFileProps extends GalleryItemProps { canDownloadFiles: boolean; diff --git a/app/screens/gallery/gallery_file/index.ts b/app/screens/gallery/gallery_file/index.ts index c92420808..1fff5ed7b 100644 --- a/app/screens/gallery/gallery_file/index.ts +++ b/app/screens/gallery/gallery_file/index.ts @@ -5,10 +5,10 @@ import {connect} from 'react-redux'; import {canDownloadFilesOnMobile} from '@mm-redux/selectors/entities/general'; -import type {GlobalState} from '@mm-redux/types/store'; - import GalleryFile from './gallery_file'; +import type {GlobalState} from '@mm-redux/types/store'; + function mapStateToProps(state: GlobalState) { return { canDownloadFiles: canDownloadFilesOnMobile(state), diff --git a/app/screens/gallery/gallery_image.tsx b/app/screens/gallery/gallery_image.tsx index adfa52bcd..b2cd7984a 100644 --- a/app/screens/gallery/gallery_image.tsx +++ b/app/screens/gallery/gallery_image.tsx @@ -6,10 +6,9 @@ import FastImage from 'react-native-fast-image'; import Animated from 'react-native-reanimated'; import {DeviceTypes} from '@constants'; +import {GalleryItemProps} from '@mm-types/screens/gallery'; import {calculateDimensions} from '@utils/images'; -import {GalleryItemProps} from 'types/screens/gallery'; - // @ts-expect-error: Ignore the typescript error for createAnimatedComponent const AnimatedImage = Animated.createAnimatedComponent(FastImage); diff --git a/app/screens/gallery/gallery_video.tsx b/app/screens/gallery/gallery_video.tsx index cbb61a6b8..870f6bc04 100644 --- a/app/screens/gallery/gallery_video.tsx +++ b/app/screens/gallery/gallery_video.tsx @@ -4,16 +4,15 @@ import React, {useCallback, useEffect, useRef, useState} from 'react'; import {injectIntl} from 'react-intl'; import {Alert, Platform, View} from 'react-native'; -import RNFetchBlob from 'rn-fetch-blob'; import {TapGestureHandler, State, TapGestureHandlerStateChangeEvent} from 'react-native-gesture-handler'; import Video, {OnLoadData, OnProgressData} from 'react-native-video'; +import RNFetchBlob from 'rn-fetch-blob'; -import {DeviceTypes} from '@constants'; import {Client4} from '@client/rest'; +import {DeviceTypes} from '@constants'; +import {GalleryItemProps} from '@mm-types/screens/gallery'; import {getLocalPath} from '@utils/file'; -import {GalleryItemProps} from 'types/screens/gallery'; - import VideoControls, {VideoControlsRef} from './video_controls'; const GalleryVideo = ({file, deviceHeight, deviceWidth, intl, isActive, showHideHeaderFooter, theme}: GalleryItemProps) => { diff --git a/app/screens/gallery/gallery_viewer.tsx b/app/screens/gallery/gallery_viewer.tsx index e4e61e943..8f2ff8530 100644 --- a/app/screens/gallery/gallery_viewer.tsx +++ b/app/screens/gallery/gallery_viewer.tsx @@ -6,17 +6,18 @@ import {Platform, StyleSheet, View} from 'react-native'; import {PanGestureHandler, PinchGestureHandler, State, TapGestureHandler, TapGestureHandlerStateChangeEvent} from 'react-native-gesture-handler'; import Animated, {abs, add, and, call, clockRunning, cond, divide, eq, greaterOrEq, greaterThan, multiply, neq, not, onChange, set, sub, useCode, EasingNode, ceil} from 'react-native-reanimated'; import {clamp, snapPoint, timing, useClock, usePanGestureHandler, usePinchGestureHandler, useTapGestureHandler, useValue, vec} from 'react-native-redash/lib/module/v1'; + import {isImage, isVideo} from '@utils/file'; import {calculateDimensions} from '@utils/images'; import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; -import type {GalleryProps} from 'types/screens/gallery'; - import {usePinch} from './animation_helper'; import GalleryFile from './gallery_file'; import GalleryImage from './gallery_image'; import GalleryVideo from './gallery_video'; +import type {GalleryProps} from '@mm-types/screens/gallery'; + const itemTopStyle = (props: GalleryProps): number => { if (Platform.OS === 'android') { if (props.footerVisible) { diff --git a/app/screens/gallery/video_controls.tsx b/app/screens/gallery/video_controls.tsx index cac5232fd..0ff1eae16 100644 --- a/app/screens/gallery/video_controls.tsx +++ b/app/screens/gallery/video_controls.tsx @@ -7,8 +7,8 @@ import {SafeAreaView} from 'react-native-safe-area-context'; import Slider from 'react-native-slider'; import CompassIcon from '@components/compass_icon'; +import {CallbackFunctionWithoutArguments} from '@mm-types/screens/gallery'; import {makeStyleSheetFromTheme} from '@utils/theme'; -import {CallbackFunctionWithoutArguments} from 'types/screens/gallery'; interface VideoControlsProps { isLandscape: boolean; diff --git a/app/screens/index.js b/app/screens/index.js index 593810501..6fe99be03 100644 --- a/app/screens/index.js +++ b/app/screens/index.js @@ -6,8 +6,8 @@ import {Platform} from 'react-native'; import {ThemeProvider} from 'react-native-elements'; import {gestureHandlerRootHOC} from 'react-native-gesture-handler'; import {Navigation} from 'react-native-navigation'; -import {Provider} from 'react-redux'; import {SafeAreaProvider} from 'react-native-safe-area-context'; +import {Provider} from 'react-redux'; import RootWrapper from '@components/root'; import ThreadFollow from '@screens/thread/thread_follow'; diff --git a/app/screens/interactive_dialog/dialog_element.js b/app/screens/interactive_dialog/dialog_element.js index c14a5617c..6481e665a 100644 --- a/app/screens/interactive_dialog/dialog_element.js +++ b/app/screens/interactive_dialog/dialog_element.js @@ -1,13 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; -import BoolSetting from '@components/widgets/settings/bool_setting'; -import TextSetting from '@components/widgets/settings/text_setting'; import AutocompleteSelector from '@components/autocomplete_selector'; +import BoolSetting from '@components/widgets/settings/bool_setting'; import RadioSetting from '@components/widgets/settings/radio_setting'; +import TextSetting from '@components/widgets/settings/text_setting'; const TEXT_DEFAULT_MAX_LENGTH = 150; const TEXTAREA_DEFAULT_MAX_LENGTH = 3000; diff --git a/app/screens/interactive_dialog/dialog_element.test.js b/app/screens/interactive_dialog/dialog_element.test.js index f1e4ffc79..8218e0233 100644 --- a/app/screens/interactive_dialog/dialog_element.test.js +++ b/app/screens/interactive_dialog/dialog_element.test.js @@ -1,13 +1,14 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; -import Preferences from '@mm-redux/constants/preferences'; -import RadioSetting from '@components/widgets/settings/radio_setting'; -import BoolSetting from '@components/widgets/settings/bool_setting'; import AutocompleteSelector from '@components/autocomplete_selector'; +import BoolSetting from '@components/widgets/settings/bool_setting'; +import RadioSetting from '@components/widgets/settings/radio_setting'; +import Preferences from '@mm-redux/constants/preferences'; + import DialogElement from './dialog_element.js'; describe('DialogElement', () => { diff --git a/app/screens/interactive_dialog/dialog_introduction_text.js b/app/screens/interactive_dialog/dialog_introduction_text.js index 048f3664e..2f412b85a 100644 --- a/app/screens/interactive_dialog/dialog_introduction_text.js +++ b/app/screens/interactive_dialog/dialog_introduction_text.js @@ -1,9 +1,9 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import PropTypes from 'prop-types'; import React, {PureComponent} from 'react'; import {View} from 'react-native'; -import PropTypes from 'prop-types'; import Markdown from '@components/markdown'; import {getMarkdownTextStyles, getMarkdownBlockStyles} from '@utils/markdown'; diff --git a/app/screens/interactive_dialog/dialog_introduction_text.test.js b/app/screens/interactive_dialog/dialog_introduction_text.test.js index 07919c98a..008430ba9 100644 --- a/app/screens/interactive_dialog/dialog_introduction_text.test.js +++ b/app/screens/interactive_dialog/dialog_introduction_text.test.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import Preferences from '@mm-redux/constants/preferences'; diff --git a/app/screens/interactive_dialog/index.js b/app/screens/interactive_dialog/index.js index 1a68fb28f..a8fa987dc 100644 --- a/app/screens/interactive_dialog/index.js +++ b/app/screens/interactive_dialog/index.js @@ -1,11 +1,11 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; -import {getTheme} from '@mm-redux/selectors/entities/preferences'; import {submitInteractiveDialog} from '@mm-redux/actions/integrations'; +import {getTheme} from '@mm-redux/selectors/entities/preferences'; import InteractiveDialog from './interactive_dialog'; diff --git a/app/screens/interactive_dialog/interactive_dialog.js b/app/screens/interactive_dialog/interactive_dialog.js index 307f3f3ed..ccadacaa0 100644 --- a/app/screens/interactive_dialog/interactive_dialog.js +++ b/app/screens/interactive_dialog/interactive_dialog.js @@ -1,20 +1,18 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import {ScrollView} from 'react-native'; import {Navigation} from 'react-native-navigation'; import {SafeAreaView} from 'react-native-safe-area-context'; -import {checkDialogElementForError, checkIfErrorsMatchElements} from '@mm-redux/utils/integration_utils'; - -import ErrorText from 'app/components/error_text'; -import StatusBar from 'app/components/status_bar'; +import {dismissModal} from '@actions/navigation'; +import ErrorText from '@components/error_text'; import FormattedText from '@components/formatted_text'; - -import {changeOpacity, makeStyleSheetFromTheme} from 'app/utils/theme'; -import {dismissModal} from 'app/actions/navigation'; +import StatusBar from '@components/status_bar'; +import {checkDialogElementForError, checkIfErrorsMatchElements} from '@mm-redux/utils/integration_utils'; +import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; import DialogElement from './dialog_element.js'; import DialogIntroductionText from './dialog_introduction_text.js'; diff --git a/app/screens/interactive_dialog/interactive_dialog.test.js b/app/screens/interactive_dialog/interactive_dialog.test.js index 66fd7b95d..86bf567fa 100644 --- a/app/screens/interactive_dialog/interactive_dialog.test.js +++ b/app/screens/interactive_dialog/interactive_dialog.test.js @@ -1,15 +1,15 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; -import {shallow} from 'enzyme'; +import {shallow} from 'enzyme'; +import React from 'react'; + +import ErrorText from '@components/error_text'; import Preferences from '@mm-redux/constants/preferences'; +import DialogElement from '@screens/interactive_dialog/dialog_element'; import InteractiveDialog from './interactive_dialog'; -import ErrorText from 'app/components/error_text'; -import DialogElement from 'app/screens/interactive_dialog/dialog_element'; - describe('InteractiveDialog', () => { const baseProps = { url: 'http://mattermost.com', diff --git a/app/screens/login/index.js b/app/screens/login/index.js index b3efa9cc1..3cc768054 100644 --- a/app/screens/login/index.js +++ b/app/screens/login/index.js @@ -1,13 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; -import {login} from '@actions/views/user'; import {scheduleExpiredNotification} from '@actions/views/session'; -import {getTheme} from '@mm-redux/selectors/entities/preferences'; +import {login} from '@actions/views/user'; import {getConfig, getLicense} from '@mm-redux/selectors/entities/general'; +import {getTheme} from '@mm-redux/selectors/entities/preferences'; import Login from './login.js'; diff --git a/app/screens/login/login.js b/app/screens/login/login.js index 51ad858a7..dd0b1daf0 100644 --- a/app/screens/login/login.js +++ b/app/screens/login/login.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import {intlShape} from 'react-intl'; import { ActivityIndicator, @@ -24,11 +24,11 @@ import {resetToChannel, goToScreen} from '@actions/navigation'; import ErrorText from '@components/error_text'; import FormattedText from '@components/formatted_text'; import StatusBar from '@components/status_bar'; +import mattermostManaged from '@mattermost-managed'; import {t} from '@utils/i18n'; import {preventDoubleTap} from '@utils/tap'; import {changeOpacity} from '@utils/theme'; -import mattermostManaged from 'app/mattermost_managed'; import {GlobalStyles} from 'app/styles'; export const mfaExpectedErrors = ['mfa.validate_token.authenticate.app_error', 'ent.mfa.validate_token.authenticate.app_error']; diff --git a/app/screens/login/login.test.js b/app/screens/login/login.test.js index 2811d281f..d10b662db 100644 --- a/app/screens/login/login.test.js +++ b/app/screens/login/login.test.js @@ -3,13 +3,11 @@ import React from 'react'; +import * as NavigationActions from '@actions/navigation'; import FormattedText from '@components/formatted_text'; +import {mfaExpectedErrors} from '@screens/login/login'; +import {shallowWithIntl} from '@test/intl-test-helper'; -import {shallowWithIntl} from 'test/intl-test-helper'; - -import * as NavigationActions from 'app/actions/navigation'; - -import {mfaExpectedErrors} from 'app/screens/login/login'; import Login from './login'; describe('Login', () => { diff --git a/app/screens/login_options/index.js b/app/screens/login_options/index.js index 1552b7f1a..26b2251ba 100644 --- a/app/screens/login_options/index.js +++ b/app/screens/login_options/index.js @@ -3,8 +3,8 @@ import {connect} from 'react-redux'; -import {getTheme} from '@mm-redux/selectors/entities/preferences'; import {getConfig, getLicense} from '@mm-redux/selectors/entities/general'; +import {getTheme} from '@mm-redux/selectors/entities/preferences'; import LoginOptions from './login_options'; diff --git a/app/screens/login_options/login_options.js b/app/screens/login_options/login_options.js index 691baeaff..49664d450 100644 --- a/app/screens/login_options/login_options.js +++ b/app/screens/login_options/login_options.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import {intlShape} from 'react-intl'; import { Dimensions, diff --git a/app/screens/login_options/login_options.test.js b/app/screens/login_options/login_options.test.js index 7b78b8da6..debb3f4ea 100644 --- a/app/screens/login_options/login_options.test.js +++ b/app/screens/login_options/login_options.test.js @@ -4,8 +4,7 @@ import React from 'react'; import FormattedText from '@components/formatted_text'; - -import {shallowWithIntl} from 'test/intl-test-helper'; +import {shallowWithIntl} from '@test/intl-test-helper'; import LoginOptions from './login_options'; diff --git a/app/screens/mfa/index.js b/app/screens/mfa/index.js index 369533398..c2975a5b4 100644 --- a/app/screens/mfa/index.js +++ b/app/screens/mfa/index.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; import {login} from '@actions/views/user'; diff --git a/app/screens/mfa/mfa.js b/app/screens/mfa/mfa.js index 7060c2a8e..5853a73ae 100644 --- a/app/screens/mfa/mfa.js +++ b/app/screens/mfa/mfa.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import { ActivityIndicator, Image, diff --git a/app/screens/more_channels/index.js b/app/screens/more_channels/index.js index 2251099f0..4cc3296d6 100644 --- a/app/screens/more_channels/index.js +++ b/app/screens/more_channels/index.js @@ -1,20 +1,19 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; import {handleSelectChannel, setChannelDisplayName} from '@actions/views/channel'; -import {General} from '@mm-redux/constants'; import {getArchivedChannels, getChannels, getSharedChannels, joinChannel, searchChannels} from '@mm-redux/actions/channels'; -import {getCurrentUserId, getCurrentUserRoles} from '@mm-redux/selectors/entities/users'; +import {General} from '@mm-redux/constants'; +import {getConfig, getLicense} from '@mm-redux/selectors/entities/general'; +import {getTheme} from '@mm-redux/selectors/entities/preferences'; import {getCurrentTeamId} from '@mm-redux/selectors/entities/teams'; +import {getCurrentUserId, getCurrentUserRoles} from '@mm-redux/selectors/entities/users'; import {showCreateOption} from '@mm-redux/utils/channel_utils'; import {isMinimumServerVersion} from '@mm-redux/utils/helpers'; import {isAdmin, isSystemAdmin} from '@mm-redux/utils/user_utils'; -import {getTheme} from '@mm-redux/selectors/entities/preferences'; -import {getConfig, getLicense} from '@mm-redux/selectors/entities/general'; - import {teamArchivedChannels, joinablePublicChannels, joinableSharedChannels} from '@selectors/channel'; import MoreChannels from './more_channels'; diff --git a/app/screens/more_channels/more_channels.js b/app/screens/more_channels/more_channels.js index d773107f4..b1eb13a9d 100644 --- a/app/screens/more_channels/more_channels.js +++ b/app/screens/more_channels/more_channels.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import {intlShape} from 'react-intl'; import {Keyboard, View, Text} from 'react-native'; import {Navigation} from 'react-native-navigation'; @@ -21,8 +21,8 @@ import {NavigationTypes} from '@constants'; import {debounce} from '@mm-redux/actions/helpers'; import {General} from '@mm-redux/constants'; import EventEmitter from '@mm-redux/utils/event_emitter'; -import {alertErrorWithFallback, emptyFunction} from '@utils/general'; import BottomSheet from '@utils/bottom_sheet'; +import {alertErrorWithFallback, emptyFunction} from '@utils/general'; import { changeOpacity, makeStyleSheetFromTheme, diff --git a/app/screens/more_channels/more_channels.test.js b/app/screens/more_channels/more_channels.test.js index a3f4cdd8e..830d93865 100644 --- a/app/screens/more_channels/more_channels.test.js +++ b/app/screens/more_channels/more_channels.test.js @@ -5,8 +5,7 @@ import React from 'react'; import * as NavigationActions from '@actions/navigation'; import Preferences from '@mm-redux/constants/preferences'; - -import {shallowWithIntl} from 'test/intl-test-helper'; +import {shallowWithIntl} from '@test/intl-test-helper'; import MoreChannels from './more_channels.js'; diff --git a/app/screens/more_dms/index.js b/app/screens/more_dms/index.js index 5475c18e6..f1e8eb18d 100644 --- a/app/screens/more_dms/index.js +++ b/app/screens/more_dms/index.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; import {setChannelDisplayName} from '@actions/views/channel'; import {makeDirectChannel, makeGroupChannel} from '@actions/views/more_dms'; diff --git a/app/screens/more_dms/more_dms.js b/app/screens/more_dms/more_dms.js index 134bd5a36..b95f404e2 100644 --- a/app/screens/more_dms/more_dms.js +++ b/app/screens/more_dms/more_dms.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import {intlShape} from 'react-intl'; import {Keyboard, View} from 'react-native'; import {Navigation} from 'react-native-navigation'; @@ -19,8 +19,8 @@ import StatusBar from '@components/status_bar'; import {NavigationTypes} from '@constants'; import {debounce} from '@mm-redux/actions/helpers'; import {General} from '@mm-redux/constants'; -import EventEmitter from '@mm-redux/utils/event_emitter'; import {getGroupDisplayNameFromUserIds} from '@mm-redux/utils/channel_utils'; +import EventEmitter from '@mm-redux/utils/event_emitter'; import {displayUsername, filterProfilesMatchingTerm} from '@mm-redux/utils/user_utils'; import {alertErrorWithFallback} from '@utils/general'; import {t} from '@utils/i18n'; diff --git a/app/screens/more_dms/selected_users/selected_user.js b/app/screens/more_dms/selected_users/selected_user.js index 3a79f8bd6..90a12140d 100644 --- a/app/screens/more_dms/selected_users/selected_user.js +++ b/app/screens/more_dms/selected_users/selected_user.js @@ -9,9 +9,8 @@ import { View, } from 'react-native'; -import {displayUsername} from '@mm-redux/utils/user_utils'; - import CompassIcon from '@components/compass_icon'; +import {displayUsername} from '@mm-redux/utils/user_utils'; import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; export default class SelectedUser extends React.PureComponent { diff --git a/app/screens/more_dms/selected_users/selected_users.js b/app/screens/more_dms/selected_users/selected_users.js index 2c1accda0..c1fa587fb 100644 --- a/app/screens/more_dms/selected_users/selected_users.js +++ b/app/screens/more_dms/selected_users/selected_users.js @@ -6,8 +6,8 @@ import React from 'react'; import {View} from 'react-native'; import FormattedText from '@components/formatted_text'; -import SelectedUser from 'app/screens/more_dms/selected_users/selected_user'; -import {changeOpacity, makeStyleSheetFromTheme} from 'app/utils/theme'; +import SelectedUser from '@screens/more_dms/selected_users/selected_user'; +import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; export default class SelectedUsers extends React.PureComponent { static propTypes = { diff --git a/app/screens/more_dms/selected_users/selected_users.test.js b/app/screens/more_dms/selected_users/selected_users.test.js index 22a646661..2d9481b69 100644 --- a/app/screens/more_dms/selected_users/selected_users.test.js +++ b/app/screens/more_dms/selected_users/selected_users.test.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import Preferences from '@mm-redux/constants/preferences'; diff --git a/app/screens/notification/index.tsx b/app/screens/notification/index.tsx index bcc397940..6cd18f879 100644 --- a/app/screens/notification/index.tsx +++ b/app/screens/notification/index.tsx @@ -4,10 +4,10 @@ import React, {useEffect, useRef, useState} from 'react'; import {Platform, StyleSheet, Text, TouchableOpacity, View} from 'react-native'; import * as Animatable from 'react-native-animatable'; -import {Navigation} from 'react-native-navigation'; import {PanGestureHandler} from 'react-native-gesture-handler'; -import {useDispatch} from 'react-redux'; +import {Navigation} from 'react-native-navigation'; import {useSafeAreaInsets} from 'react-native-safe-area-context'; +import {useDispatch} from 'react-redux'; import {popToRoot, dismissAllModals, dismissOverlay} from '@actions/navigation'; import {loadFromPushNotification} from '@actions/views/root'; diff --git a/app/screens/notification/notification_icon.tsx b/app/screens/notification/notification_icon.tsx index e3b646fb6..8208bbd62 100644 --- a/app/screens/notification/notification_icon.tsx +++ b/app/screens/notification/notification_icon.tsx @@ -6,11 +6,12 @@ import {Platform, StyleSheet, View} from 'react-native'; import FastImage from 'react-native-fast-image'; import {useSelector} from 'react-redux'; +import {Client4} from '@client/rest'; import CompassIcon from '@components/compass_icon'; import ProfilePicture from '@components/profile_picture'; -import {Client4} from '@client/rest'; import {getConfig} from '@mm-redux/selectors/entities/general'; import {getUser} from '@mm-redux/selectors/entities/users'; + import type {GlobalState} from '@mm-redux/types/store'; interface NotificationIconProps { diff --git a/app/screens/options_modal/index.js b/app/screens/options_modal/index.js index 0c73b392b..4c788f463 100644 --- a/app/screens/options_modal/index.js +++ b/app/screens/options_modal/index.js @@ -3,7 +3,7 @@ import {connect} from 'react-redux'; -import {getDimensions} from 'app/selectors/device'; +import {getDimensions} from '@selectors/device'; import OptionsModal from './options_modal'; diff --git a/app/screens/options_modal/options_modal.js b/app/screens/options_modal/options_modal.js index 09a7ce52c..543617563 100644 --- a/app/screens/options_modal/options_modal.js +++ b/app/screens/options_modal/options_modal.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import { Animated, Platform, @@ -11,11 +11,10 @@ import { View, } from 'react-native'; +import {dismissModal} from '@actions/navigation'; +import {NavigationTypes} from '@constants'; import EventEmitter from '@mm-redux/utils/event_emitter'; - -import {NavigationTypes} from 'app/constants'; -import {emptyFunction} from 'app/utils/general'; -import {dismissModal} from 'app/actions/navigation'; +import {emptyFunction} from '@utils/general'; import OptionsModalList from './options_modal_list'; diff --git a/app/screens/options_modal/options_modal_list.android.js b/app/screens/options_modal/options_modal_list.android.js index 0e33250da..a81105395 100644 --- a/app/screens/options_modal/options_modal_list.android.js +++ b/app/screens/options_modal/options_modal_list.android.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import { StyleSheet, Text, diff --git a/app/screens/options_modal/options_modal_list.ios.js b/app/screens/options_modal/options_modal_list.ios.js index abd53c027..8c3bda392 100644 --- a/app/screens/options_modal/options_modal_list.ios.js +++ b/app/screens/options_modal/options_modal_list.ios.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import { StyleSheet, Text, diff --git a/app/screens/options_modal/options_modal_list.test.js b/app/screens/options_modal/options_modal_list.test.js index 703558226..53635dbb1 100644 --- a/app/screens/options_modal/options_modal_list.test.js +++ b/app/screens/options_modal/options_modal_list.test.js @@ -1,10 +1,10 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; -import OptionModalListIOS from './options_modal_list.ios'; import OptionModalListAndroid from './options_modal_list.android'; +import OptionModalListIOS from './options_modal_list.ios'; describe('OptionModalList', () => { const baseProps = { diff --git a/app/screens/participants_list/index.ts b/app/screens/participants_list/index.ts index 2b9aa3fad..e5a2c55e8 100644 --- a/app/screens/participants_list/index.ts +++ b/app/screens/participants_list/index.ts @@ -5,11 +5,12 @@ import {connect} from 'react-redux'; import {getTeammateNameDisplaySetting, getTheme} from '@mm-redux/selectors/entities/preferences'; import {getCurrentUserId, makeGetProfilesByIds} from '@mm-redux/selectors/entities/users'; -import type {GlobalState} from '@mm-redux/types/store'; -import type {UserProfile} from '@mm-redux/types/users'; import ParticipantsList from './participants_list'; +import type {GlobalState} from '@mm-redux/types/store'; +import type {UserProfile} from '@mm-redux/types/users'; + interface ListProps { userIds: string[]; } diff --git a/app/screens/participants_list/participant_row/index.tsx b/app/screens/participants_list/participant_row/index.tsx index ed33a842f..e165a5203 100644 --- a/app/screens/participants_list/participant_row/index.tsx +++ b/app/screens/participants_list/participant_row/index.tsx @@ -9,18 +9,19 @@ import {showModal} from '@actions/navigation'; import CompassIcon from '@components/compass_icon'; import FormattedText from '@components/formatted_text'; import ProfilePicture from '@components/profile_picture'; -import type {Theme} from '@mm-redux/types/preferences'; import {UserProfile} from '@mm-redux/types/users'; import {$ID} from '@mm-redux/types/utilities'; import {displayUsername} from '@mm-redux/utils/user_utils'; import {preventDoubleTap} from '@utils/tap'; import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; +import type {Theme} from '@mm-redux/types/preferences'; + type Props = { currentUserId: $ID; teammateNameDisplay: string; - theme: Theme, - user: UserProfile, + theme: Theme; + user: UserProfile; intl: typeof intlShape; } diff --git a/app/screens/participants_list/participants_list.tsx b/app/screens/participants_list/participants_list.tsx index 950ab36b3..30aefdb2b 100644 --- a/app/screens/participants_list/participants_list.tsx +++ b/app/screens/participants_list/participants_list.tsx @@ -6,13 +6,14 @@ import {View} from 'react-native'; import {dismissModal} from '@actions/navigation'; import FormattedText from '@components/formatted_text'; import SlideUpPanel from '@components/slide_up_panel'; -import type {UserProfile} from '@mm-redux/types/users'; -import type {Theme} from '@mm-redux/types/preferences'; -import type {$ID} from '@mm-redux/types/utilities'; import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; import ParticipantRow from './participant_row'; +import type {Theme} from '@mm-redux/types/preferences'; +import type {UserProfile} from '@mm-redux/types/users'; +import type {$ID} from '@mm-redux/types/utilities'; + type Props = { currentUserId: $ID; userProfiles: UserProfile[]; diff --git a/app/screens/perf_metrics/index.tsx b/app/screens/perf_metrics/index.tsx index 8b0c79d75..aa4ad4acf 100644 --- a/app/screens/perf_metrics/index.tsx +++ b/app/screens/perf_metrics/index.tsx @@ -9,10 +9,10 @@ import {getTheme} from '@mm-redux/selectors/entities/preferences'; import {changeOpacity, makeStyleFromTheme} from '@mm-redux/utils/theme_utils'; import telemetry, {PerfMetric} from '@telemetry'; -import type {Theme} from '@mm-redux/types/preferences'; - import PerfItem from './item'; +import type {Theme} from '@mm-redux/types/preferences'; + const getStyleSheet = makeStyleFromTheme((theme: Theme) => { return { container: { diff --git a/app/screens/perf_metrics/item.tsx b/app/screens/perf_metrics/item.tsx index 4cf27bd48..2bac7b4f8 100644 --- a/app/screens/perf_metrics/item.tsx +++ b/app/screens/perf_metrics/item.tsx @@ -11,7 +11,7 @@ import type {PerfMetric} from '@telemetry'; type PerfItemProps = { metric: PerfMetric; - theme: Theme + theme: Theme; }; const getStyleSheet = makeStyleSheetFromTheme((theme: Theme) => ({ diff --git a/app/screens/permalink/index.js b/app/screens/permalink/index.js index fe6701bfa..6f497ffb4 100644 --- a/app/screens/permalink/index.js +++ b/app/screens/permalink/index.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; import {handleSelectChannel} from '@actions/views/channel'; import {closePermalink} from '@actions/views/permalink'; diff --git a/app/screens/permalink/permalink.js b/app/screens/permalink/permalink.js index e3337646e..f26c08542 100644 --- a/app/screens/permalink/permalink.js +++ b/app/screens/permalink/permalink.js @@ -1,10 +1,10 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; -import {Text, TouchableOpacity, View} from 'react-native'; +import React, {PureComponent} from 'react'; import {intlShape} from 'react-intl'; +import {Text, TouchableOpacity, View} from 'react-native'; import * as Animatable from 'react-native-animatable'; import {Navigation} from 'react-native-navigation'; @@ -20,11 +20,11 @@ import Loading from '@components/loading'; import PostList from '@components/post_list'; import PostListRetry from '@components/post_list_retry'; import SafeAreaView from '@components/safe_area_view'; +import {PERMALINK} from '@constants/screen'; import {General} from '@mm-redux/constants'; import EventEmitter from '@mm-redux/utils/event_emitter'; import {privateChannelJoinPrompt} from '@utils/channels'; import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; -import {PERMALINK} from '@constants/screen'; Animatable.initializeRegistryWithDefinitions({ growOut: { diff --git a/app/screens/permalink/permalink.test.js b/app/screens/permalink/permalink.test.js index d85257bb1..a3bd66692 100644 --- a/app/screens/permalink/permalink.test.js +++ b/app/screens/permalink/permalink.test.js @@ -2,9 +2,9 @@ // See LICENSE.txt for license information. import React from 'react'; -import {shallowWithIntl} from 'test/intl-test-helper'; import Preferences from '@mm-redux/constants/preferences'; +import {shallowWithIntl} from '@test/intl-test-helper'; import Permalink from './permalink.js'; diff --git a/app/screens/pinned_posts/index.js b/app/screens/pinned_posts/index.js index 5f36bca61..57db37117 100644 --- a/app/screens/pinned_posts/index.js +++ b/app/screens/pinned_posts/index.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; import {clearSearch, getPinnedPosts} from '@mm-redux/actions/search'; import {getTheme} from '@mm-redux/selectors/entities/preferences'; diff --git a/app/screens/pinned_posts/pinned_posts.js b/app/screens/pinned_posts/pinned_posts.js index 8244335c6..38b5189eb 100644 --- a/app/screens/pinned_posts/pinned_posts.js +++ b/app/screens/pinned_posts/pinned_posts.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import {intlShape} from 'react-intl'; import { DeviceEventEmitter, @@ -14,9 +14,9 @@ import {SafeAreaView} from 'react-native-safe-area-context'; import {dismissModal} from '@actions/navigation'; import ChannelLoader from '@components/channel_loader'; -import DateSeparator from '@components/post_list/date_separator'; import FailedNetworkAction from '@components/failed_network_action'; import NoResults from '@components/no_results'; +import DateSeparator from '@components/post_list/date_separator'; import PostSeparator from '@components/post_separator'; import StatusBar from '@components/status_bar'; import {isDateLine, getDateForDateLine} from '@mm-redux/utils/post_list'; diff --git a/app/screens/pinned_posts/pinned_posts.test.js b/app/screens/pinned_posts/pinned_posts.test.js index de017c997..399c036d8 100644 --- a/app/screens/pinned_posts/pinned_posts.test.js +++ b/app/screens/pinned_posts/pinned_posts.test.js @@ -4,8 +4,7 @@ import React from 'react'; import Preferences from '@mm-redux/constants/preferences'; - -import {shallowWithIntl} from 'test/intl-test-helper'; +import {shallowWithIntl} from '@test/intl-test-helper'; import PinnedPosts from './pinned_posts'; diff --git a/app/screens/post_options/bindings/bindings.tsx b/app/screens/post_options/bindings/bindings.tsx index 077de709b..ab81aab3c 100644 --- a/app/screens/post_options/bindings/bindings.tsx +++ b/app/screens/post_options/bindings/bindings.tsx @@ -2,33 +2,33 @@ // See LICENSE.txt for license information. import React from 'react'; -import {Alert} from 'react-native'; import {intlShape, injectIntl} from 'react-intl'; +import {Alert} from 'react-native'; +import {AppCallResponseTypes, AppCallTypes, AppExpandLevels} from '@mm-redux/constants/apps'; +import {AppBinding, AppCallResponse} from '@mm-redux/types/apps'; +import {Post} from '@mm-redux/types/posts'; +import {Theme} from '@mm-redux/types/preferences'; +import {UserProfile} from '@mm-redux/types/users'; import {isSystemMessage} from '@mm-redux/utils/post_utils'; +import {DoAppCall, PostEphemeralCallResponseForPost} from '@mm-types/actions/apps'; +import {createCallContext, createCallRequest} from '@utils/apps'; import PostOption from '../post_option'; -import {AppBinding, AppCallResponse} from '@mm-redux/types/apps'; -import {Theme} from '@mm-redux/types/preferences'; -import {Post} from '@mm-redux/types/posts'; -import {UserProfile} from '@mm-redux/types/users'; -import {AppCallResponseTypes, AppCallTypes, AppExpandLevels} from '@mm-redux/constants/apps'; -import {createCallContext, createCallRequest} from '@utils/apps'; -import {DoAppCall, PostEphemeralCallResponseForPost} from 'types/actions/apps'; type Props = { - bindings: AppBinding[], - theme: Theme, - post: Post, - currentUser: UserProfile, - teamID: string, - closeWithAnimation: (cb?: () => void) => void, - appsEnabled: boolean, - intl: typeof intlShape, + bindings: AppBinding[]; + theme: Theme; + post: Post; + currentUser: UserProfile; + teamID: string; + closeWithAnimation: (cb?: () => void) => void; + appsEnabled: boolean; + intl: typeof intlShape; actions: { doAppCall: DoAppCall; postEphemeralCallResponseForPost: PostEphemeralCallResponseForPost; - } + }; } const Bindings = injectIntl((props: Props) => { @@ -64,17 +64,17 @@ const Bindings = injectIntl((props: Props) => { export default Bindings; type OptionProps = { - binding: AppBinding, - theme: Theme, - post: Post, - currentUser: UserProfile, - teamID: string, - closeWithAnimation: (cb?: () => void) => void, - intl: typeof intlShape, + binding: AppBinding; + theme: Theme; + post: Post; + currentUser: UserProfile; + teamID: string; + closeWithAnimation: (cb?: () => void) => void; + intl: typeof intlShape; actions: { doAppCall: DoAppCall; postEphemeralCallResponseForPost: PostEphemeralCallResponseForPost; - }, + }; } class Option extends React.PureComponent { diff --git a/app/screens/post_options/bindings/index.ts b/app/screens/post_options/bindings/index.ts index a86d4ded8..395c045dd 100644 --- a/app/screens/post_options/bindings/index.ts +++ b/app/screens/post_options/bindings/index.ts @@ -4,22 +4,20 @@ import {connect} from 'react-redux'; import {bindActionCreators, Dispatch, ActionCreatorsMapObject} from 'redux'; -import {getTheme} from '@mm-redux/selectors/entities/preferences'; - -import {GlobalState} from '@mm-redux/types/store'; -import {GenericAction, ActionFunc} from '@mm-redux/types/actions'; -import {getAppsBindings} from '@mm-redux/selectors/entities/apps'; -import {AppBindingLocations} from '@mm-redux/constants/apps'; -import {getCurrentUser} from '@mm-redux/selectors/entities/users'; - import {doAppCall, postEphemeralCallResponseForPost} from '@actions/apps'; +import {AppBindingLocations} from '@mm-redux/constants/apps'; +import {getAppsBindings} from '@mm-redux/selectors/entities/apps'; +import {getChannel} from '@mm-redux/selectors/entities/channels'; +import {getTheme} from '@mm-redux/selectors/entities/preferences'; +import {getCurrentTeamId} from '@mm-redux/selectors/entities/teams'; +import {getCurrentUser} from '@mm-redux/selectors/entities/users'; +import {GenericAction, ActionFunc} from '@mm-redux/types/actions'; +import {Post} from '@mm-redux/types/posts'; +import {GlobalState} from '@mm-redux/types/store'; +import {DoAppCall, PostEphemeralCallResponseForPost} from '@mm-types/actions/apps'; import {appsEnabled} from '@utils/apps'; import Bindings from './bindings'; -import {getCurrentTeamId} from '@mm-redux/selectors/entities/teams'; -import {Post} from '@mm-redux/types/posts'; -import {getChannel} from '@mm-redux/selectors/entities/channels'; -import {DoAppCall, PostEphemeralCallResponseForPost} from 'types/actions/apps'; type OwnProps = { post: Post; diff --git a/app/screens/post_options/index.js b/app/screens/post_options/index.js index 6c1802956..b0a90f585 100644 --- a/app/screens/post_options/index.js +++ b/app/screens/post_options/index.js @@ -1,12 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; import {addReaction} from '@actions/views/emoji'; import {MAX_ALLOWED_REACTIONS} from '@constants/emoji'; import {THREAD} from '@constants/screen'; +import mattermostManaged from '@mattermost-managed'; import { deletePost, flagPost, @@ -18,19 +19,18 @@ import { } from '@mm-redux/actions/posts'; import {setThreadFollow} from '@mm-redux/actions/threads'; import {General, Permissions, Posts} from '@mm-redux/constants'; -import {makeGetReactionsForPost} from '@mm-redux/selectors/entities/posts'; import {isChannelReadOnlyById, getChannel, getCurrentChannelId} from '@mm-redux/selectors/entities/channels'; -import {getCurrentUserId} from '@mm-redux/selectors/entities/users'; import {getConfig, getLicense} from '@mm-redux/selectors/entities/general'; +import {makeGetReactionsForPost} from '@mm-redux/selectors/entities/posts'; import {getMyPreferences, getTheme, isCollapsedThreadsEnabled} from '@mm-redux/selectors/entities/preferences'; import {haveIChannelPermission} from '@mm-redux/selectors/entities/roles'; import {getCurrentTeamId, getCurrentTeamUrl} from '@mm-redux/selectors/entities/teams'; import {getThread} from '@mm-redux/selectors/entities/threads'; +import {getCurrentUserId} from '@mm-redux/selectors/entities/users'; import {canEditPost, isPostFlagged, isSystemMessage} from '@mm-redux/utils/post_utils'; import {getDimensions} from '@selectors/device'; -import {canDeletePost} from '@selectors/permissions'; import {selectEmojisCountFromReactions} from '@selectors/emojis'; -import mattermostManaged from 'app/mattermost_managed'; +import {canDeletePost} from '@selectors/permissions'; import PostOptions from './post_options'; diff --git a/app/screens/post_options/post_option.js b/app/screens/post_options/post_option.js index 0df9b1667..49fe1dfff 100644 --- a/app/screens/post_options/post_option.js +++ b/app/screens/post_options/post_option.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import { Text, Platform, @@ -10,11 +10,11 @@ import { TouchableNativeFeedback, View, } from 'react-native'; +import FastImage from 'react-native-fast-image'; import CompassIcon from '@components/compass_icon'; -import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; import {preventDoubleTap} from '@utils/tap'; -import FastImage from 'react-native-fast-image'; +import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; import {isValidUrl} from '@utils/url'; export default class PostOption extends PureComponent { diff --git a/app/screens/post_options/post_options.js b/app/screens/post_options/post_options.js index f4b19b8d4..8cb8322de 100644 --- a/app/screens/post_options/post_options.js +++ b/app/screens/post_options/post_options.js @@ -1,11 +1,12 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; -import PropTypes from 'prop-types'; -import {Alert, StyleSheet, View} from 'react-native'; import Clipboard from '@react-native-community/clipboard'; + +import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import {intlShape} from 'react-intl'; +import {Alert, StyleSheet, View} from 'react-native'; import {showModal, dismissModal} from '@actions/navigation'; import CompassIcon from '@components/compass_icon'; @@ -18,9 +19,9 @@ import {isSystemMessage} from '@mm-redux/utils/post_utils'; import {t} from '@utils/i18n'; import {preventDoubleTap} from '@utils/tap'; +import Bindings from './bindings'; import PostOption from './post_option'; import {OPTION_HEIGHT, getInitialPosition} from './post_options_utils'; -import Bindings from './bindings'; export default class PostOptions extends PureComponent { static propTypes = { diff --git a/app/screens/post_options/post_options.test.js b/app/screens/post_options/post_options.test.js index 703e33b27..86e3060ce 100644 --- a/app/screens/post_options/post_options.test.js +++ b/app/screens/post_options/post_options.test.js @@ -3,9 +3,9 @@ import React from 'react'; import {Alert} from 'react-native'; -import {shallowWithIntl} from 'test/intl-test-helper'; import Preferences from '@mm-redux/constants/preferences'; +import {shallowWithIntl} from '@test/intl-test-helper'; import PostOptions from './post_options'; diff --git a/app/screens/reaction_list/index.js b/app/screens/reaction_list/index.js index 3912cb89b..7b89e2006 100644 --- a/app/screens/reaction_list/index.js +++ b/app/screens/reaction_list/index.js @@ -1,16 +1,15 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; import {getMissingProfilesByIds} from '@mm-redux/actions/users'; import {makeGetReactionsForPost} from '@mm-redux/selectors/entities/posts'; -import {getCurrentUserId, makeGetProfilesByIdsAndUsernames} from '@mm-redux/selectors/entities/users'; import {getTeammateNameDisplaySetting, getTheme} from '@mm-redux/selectors/entities/preferences'; - -import {isLandscape} from 'app/selectors/device'; -import {getUniqueUserIds} from 'app/utils/reaction'; +import {getCurrentUserId, makeGetProfilesByIdsAndUsernames} from '@mm-redux/selectors/entities/users'; +import {isLandscape} from '@selectors/device'; +import {getUniqueUserIds} from '@utils/reaction'; import ReactionList from './reaction_list'; diff --git a/app/screens/reaction_list/reaction_header.js b/app/screens/reaction_list/reaction_header.js index 907af95fd..93e6aebe3 100644 --- a/app/screens/reaction_list/reaction_header.js +++ b/app/screens/reaction_list/reaction_header.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import { Animated, Platform, @@ -10,7 +10,7 @@ import { } from 'react-native'; import {NativeViewGestureHandler} from 'react-native-gesture-handler'; -import {makeStyleSheetFromTheme} from 'app/utils/theme'; +import {makeStyleSheetFromTheme} from '@utils/theme'; import ReactionHeaderItem from './reaction_header_item'; diff --git a/app/screens/reaction_list/reaction_header.test.js b/app/screens/reaction_list/reaction_header.test.js index 175ec2d76..c085d8dea 100644 --- a/app/screens/reaction_list/reaction_header.test.js +++ b/app/screens/reaction_list/reaction_header.test.js @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import {ScrollView} from 'react-native'; import Preferences from '@mm-redux/constants/preferences'; diff --git a/app/screens/reaction_list/reaction_header_item.js b/app/screens/reaction_list/reaction_header_item.js index 1fad3fb26..815a7aec3 100644 --- a/app/screens/reaction_list/reaction_header_item.js +++ b/app/screens/reaction_list/reaction_header_item.js @@ -1,19 +1,17 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import { Text, TouchableOpacity, } from 'react-native'; import Emoji from '@components/emoji'; -import {makeStyleSheetFromTheme} from '@utils/theme'; - import FormattedText from '@components/formatted_text'; - import {ALL_EMOJIS} from '@constants/emoji'; +import {makeStyleSheetFromTheme} from '@utils/theme'; export default class ReactionHeaderItem extends PureComponent { static propTypes = { diff --git a/app/screens/reaction_list/reaction_header_item.test.js b/app/screens/reaction_list/reaction_header_item.test.js index ba86168e6..6719cae4a 100644 --- a/app/screens/reaction_list/reaction_header_item.test.js +++ b/app/screens/reaction_list/reaction_header_item.test.js @@ -1,15 +1,14 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import {TouchableOpacity} from 'react-native'; +import {ALL_EMOJIS} from '@constants/emoji'; import Preferences from '@mm-redux/constants/preferences'; import ReactionHeaderItem from './reaction_header_item'; -import {ALL_EMOJIS} from 'app/constants/emoji'; - describe('ReactionHeaderItem', () => { const baseProps = { count: 3, diff --git a/app/screens/reaction_list/reaction_list.js b/app/screens/reaction_list/reaction_list.js index 744878cba..2adf7ee8d 100644 --- a/app/screens/reaction_list/reaction_list.js +++ b/app/screens/reaction_list/reaction_list.js @@ -1,15 +1,15 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; +import {intlShape} from 'react-intl'; import {View} from 'react-native'; import {Navigation} from 'react-native-navigation'; -import {intlShape} from 'react-intl'; - -import SlideUpPanel from 'app/components/slide_up_panel'; -import {changeOpacity, makeStyleSheetFromTheme} from 'app/utils/theme'; +import {dismissModal} from '@actions/navigation'; +import SlideUpPanel from '@components/slide_up_panel'; +import {ALL_EMOJIS} from '@constants/emoji'; import { generateUserProfilesById, getMissingUserIds, @@ -17,14 +17,12 @@ import { getSortedReactionsForHeader, getUniqueUserIds, sortReactions, -} from 'app/utils/reaction'; -import {dismissModal} from 'app/actions/navigation'; +} from '@utils/reaction'; +import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; import ReactionHeader from './reaction_header'; import ReactionRow from './reaction_row'; -import {ALL_EMOJIS} from 'app/constants/emoji'; - export default class ReactionList extends PureComponent { static propTypes = { actions: PropTypes.shape({ diff --git a/app/screens/reaction_list/reaction_list.test.js b/app/screens/reaction_list/reaction_list.test.js index 1507a7414..5de09bae9 100644 --- a/app/screens/reaction_list/reaction_list.test.js +++ b/app/screens/reaction_list/reaction_list.test.js @@ -1,10 +1,11 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. + import React from 'react'; import SlideUpPanel from '@components/slide_up_panel'; import Preferences from '@mm-redux/constants/preferences'; -import {shallowWithIntl} from 'test/intl-test-helper'; +import {shallowWithIntl} from '@test/intl-test-helper'; import ReactionList from './reaction_list'; diff --git a/app/screens/reaction_list/reaction_row/index.js b/app/screens/reaction_list/reaction_row/index.js index 9a967c8ea..99085b627 100644 --- a/app/screens/reaction_list/reaction_row/index.js +++ b/app/screens/reaction_list/reaction_row/index.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import PropTypes from 'prop-types'; +import React from 'react'; import {intlShape} from 'react-intl'; import { Text, @@ -10,12 +10,11 @@ import { View, } from 'react-native'; -import {displayUsername} from '@mm-redux/utils/user_utils'; - import {showModal} from '@actions/navigation'; import CompassIcon from '@components/compass_icon'; -import ProfilePicture from '@components/profile_picture'; import Emoji from '@components/emoji'; +import ProfilePicture from '@components/profile_picture'; +import {displayUsername} from '@mm-redux/utils/user_utils'; import {preventDoubleTap} from '@utils/tap'; import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; diff --git a/app/screens/reaction_list/reaction_row/reaction_row.test.js b/app/screens/reaction_list/reaction_row/reaction_row.test.js index ba705fe2a..617530f5f 100644 --- a/app/screens/reaction_list/reaction_row/reaction_row.test.js +++ b/app/screens/reaction_list/reaction_row/reaction_row.test.js @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import Preferences from '@mm-redux/constants/preferences'; diff --git a/app/screens/recent_mentions/index.js b/app/screens/recent_mentions/index.js index 49b9bfab1..e46ff7e40 100644 --- a/app/screens/recent_mentions/index.js +++ b/app/screens/recent_mentions/index.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; import {clearSearch, getRecentMentions} from '@mm-redux/actions/search'; import {getTheme} from '@mm-redux/selectors/entities/preferences'; diff --git a/app/screens/recent_mentions/recent_mentions.js b/app/screens/recent_mentions/recent_mentions.js index 2291fcb81..76d467f98 100644 --- a/app/screens/recent_mentions/recent_mentions.js +++ b/app/screens/recent_mentions/recent_mentions.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import {intlShape} from 'react-intl'; import { DeviceEventEmitter, @@ -15,14 +15,14 @@ import {SafeAreaView} from 'react-native-safe-area-context'; import {dismissModal} from '@actions/navigation'; import ChannelLoader from '@components/channel_loader'; -import DateSeparator from '@components/post_list/date_separator'; import FailedNetworkAction from '@components/failed_network_action'; import NoResults from '@components/no_results'; +import DateSeparator from '@components/post_list/date_separator'; import PostSeparator from '@components/post_separator'; import StatusBar from '@components/status_bar'; import {isDateLine, getDateForDateLine} from '@mm-redux/utils/post_list'; -import SearchResultPost from '@screens/search/search_result_post'; import ChannelDisplayName from '@screens/search/channel_display_name'; +import SearchResultPost from '@screens/search/search_result_post'; export default class RecentMentions extends PureComponent { static propTypes = { diff --git a/app/screens/recent_mentions/recent_mentions.test.js b/app/screens/recent_mentions/recent_mentions.test.js index 0bf414996..4ee31e1b1 100644 --- a/app/screens/recent_mentions/recent_mentions.test.js +++ b/app/screens/recent_mentions/recent_mentions.test.js @@ -4,7 +4,7 @@ import React from 'react'; import Preferences from '@mm-redux/constants/preferences'; -import {shallowWithIntl} from 'test/intl-test-helper'; +import {shallowWithIntl} from '@test/intl-test-helper'; import RecentMentions from './recent_mentions'; diff --git a/app/screens/saved_posts/index.js b/app/screens/saved_posts/index.js index ed40bbe98..50f95bf9b 100644 --- a/app/screens/saved_posts/index.js +++ b/app/screens/saved_posts/index.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; import {clearSearch, getFlaggedPosts} from '@mm-redux/actions/search'; import {getTheme} from '@mm-redux/selectors/entities/preferences'; diff --git a/app/screens/saved_posts/saved_posts.js b/app/screens/saved_posts/saved_posts.js index caf5a697d..b44077460 100644 --- a/app/screens/saved_posts/saved_posts.js +++ b/app/screens/saved_posts/saved_posts.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import {intlShape} from 'react-intl'; import { DeviceEventEmitter, @@ -15,14 +15,14 @@ import {SafeAreaView} from 'react-native-safe-area-context'; import {dismissModal} from '@actions/navigation'; import ChannelLoader from '@components/channel_loader'; -import DateSeparator from '@components/post_list/date_separator'; import FailedNetworkAction from '@components/failed_network_action'; import NoResults from '@components/no_results'; +import DateSeparator from '@components/post_list/date_separator'; import PostSeparator from '@components/post_separator'; import StatusBar from '@components/status_bar'; import {isDateLine, getDateForDateLine} from '@mm-redux/utils/post_list'; -import SearchResultPost from '@screens/search/search_result_post'; import ChannelDisplayName from '@screens/search/channel_display_name'; +import SearchResultPost from '@screens/search/search_result_post'; export default class SavedPosts extends PureComponent { static propTypes = { diff --git a/app/screens/saved_posts/saved_posts.test.js b/app/screens/saved_posts/saved_posts.test.js index f66191681..6a4e41226 100644 --- a/app/screens/saved_posts/saved_posts.test.js +++ b/app/screens/saved_posts/saved_posts.test.js @@ -4,8 +4,7 @@ import React from 'react'; import Preferences from '@mm-redux/constants/preferences'; - -import {shallowWithIntl} from 'test/intl-test-helper'; +import {shallowWithIntl} from '@test/intl-test-helper'; import SavedPosts from './saved_posts'; diff --git a/app/screens/search/channel_display_name/channel_display_name.js b/app/screens/search/channel_display_name/channel_display_name.js index 45fd3deb1..6841ec1e5 100644 --- a/app/screens/search/channel_display_name/channel_display_name.js +++ b/app/screens/search/channel_display_name/channel_display_name.js @@ -1,10 +1,11 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import {Text} from 'react-native'; -import {changeOpacity, makeStyleSheetFromTheme} from 'app/utils/theme'; + +import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; export default class ChannelDisplayName extends PureComponent { static propTypes = { diff --git a/app/screens/search/channel_display_name/index.js b/app/screens/search/channel_display_name/index.js index 781b3e073..9bdf012d3 100644 --- a/app/screens/search/channel_display_name/index.js +++ b/app/screens/search/channel_display_name/index.js @@ -6,6 +6,7 @@ import {connect} from 'react-redux'; import {makeGetChannel} from '@mm-redux/selectors/entities/channels'; import {getPost} from '@mm-redux/selectors/entities/posts'; import {getTheme} from '@mm-redux/selectors/entities/preferences'; + import ChannelDisplayName from './channel_display_name'; function makeMapStateToProps() { diff --git a/app/screens/search/index.js b/app/screens/search/index.js index df7a991cc..dfb74b648 100644 --- a/app/screens/search/index.js +++ b/app/screens/search/index.js @@ -1,19 +1,19 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; import {handleSearchDraftChanged} from '@actions/views/search'; import {clearSearch, removeSearchTerms, searchPostsWithParams, getMorePostsForSearch} from '@mm-redux/actions/search'; import {getCurrentChannelId, filterPostIds} from '@mm-redux/selectors/entities/channels'; -import {getCurrentTeamId} from '@mm-redux/selectors/entities/teams'; import {getConfig} from '@mm-redux/selectors/entities/general'; import {getTheme} from '@mm-redux/selectors/entities/preferences'; +import {getCurrentTeamId} from '@mm-redux/selectors/entities/teams'; import {isTimezoneEnabled} from '@mm-redux/selectors/entities/timezone'; +import {getCurrentUser} from '@mm-redux/selectors/entities/users'; import {isMinimumServerVersion} from '@mm-redux/utils/helpers'; import {getUserCurrentTimezone} from '@mm-redux/utils/timezone_utils'; -import {getCurrentUser} from '@mm-redux/selectors/entities/users'; import {makePreparePostIdsForSearchPosts} from '@selectors/post_list'; import {getDeviceUtcOffset, getUtcOffsetForTimeZone} from '@utils/timezone'; diff --git a/app/screens/search/modifier.js b/app/screens/search/modifier.js index 88c02aa29..d6578b87b 100644 --- a/app/screens/search/modifier.js +++ b/app/screens/search/modifier.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import {Text, TouchableHighlight, View} from 'react-native'; import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; diff --git a/app/screens/search/modifier.test.js b/app/screens/search/modifier.test.js index 6e00f57d9..f7bb85aec 100644 --- a/app/screens/search/modifier.test.js +++ b/app/screens/search/modifier.test.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import Preferences from '@mm-redux/constants/preferences'; diff --git a/app/screens/search/recent_item.js b/app/screens/search/recent_item.js index f9cd9e983..61dc6c909 100644 --- a/app/screens/search/recent_item.js +++ b/app/screens/search/recent_item.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import {Text, TouchableHighlight, TouchableOpacity, View} from 'react-native'; import CompassIcon from '@components/compass_icon'; diff --git a/app/screens/search/recent_item.test.js b/app/screens/search/recent_item.test.js index 36581d1e8..ee3e65e9f 100644 --- a/app/screens/search/recent_item.test.js +++ b/app/screens/search/recent_item.test.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import Preferences from '@mm-redux/constants/preferences'; diff --git a/app/screens/search/search.js b/app/screens/search/search.js index 9c19ab134..95809a2f6 100644 --- a/app/screens/search/search.js +++ b/app/screens/search/search.js @@ -3,8 +3,8 @@ /* eslint-disable no-underscore-dangle */ -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import {intlShape} from 'react-intl'; import { DeviceEventEmitter, @@ -14,17 +14,17 @@ import { Text, View, } from 'react-native'; -import {Navigation} from 'react-native-navigation'; import HWKeyboardEvent from 'react-native-hw-keyboard-event'; +import {Navigation} from 'react-native-navigation'; import {SafeAreaView} from 'react-native-safe-area-context'; import {dismissModal} from '@actions/navigation'; import Autocomplete from '@components/autocomplete'; import CompassIcon from '@components/compass_icon'; -import KeyboardLayout from '@components/layout/keyboard_layout'; -import DateSeparator from '@components/post_list/date_separator'; import FormattedText from '@components/formatted_text'; +import KeyboardLayout from '@components/layout/keyboard_layout'; import Loading from '@components/loading'; +import DateSeparator from '@components/post_list/date_separator'; import PostListRetry from '@components/post_list_retry'; import PostSeparator from '@components/post_separator'; import SearchBar from '@components/search_bar'; diff --git a/app/screens/search/search.test.js b/app/screens/search/search.test.js index 5663fed24..494995210 100644 --- a/app/screens/search/search.test.js +++ b/app/screens/search/search.test.js @@ -4,7 +4,7 @@ import React from 'react'; import Preferences from '@mm-redux/constants/preferences'; -import {shallowWithIntl} from 'test/intl-test-helper'; +import {shallowWithIntl} from '@test/intl-test-helper'; import Search from './search'; diff --git a/app/screens/search/search_result_post/search_result_post.js b/app/screens/search/search_result_post/search_result_post.js index 585ac5486..29a2db7c9 100644 --- a/app/screens/search/search_result_post/search_result_post.js +++ b/app/screens/search/search_result_post/search_result_post.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import Post from '@components/post_list/post'; import {SEARCH} from '@constants/screen'; diff --git a/app/screens/search/search_result_post/search_result_post.test.js b/app/screens/search/search_result_post/search_result_post.test.js index 49d60193d..4dfea786c 100644 --- a/app/screens/search/search_result_post/search_result_post.test.js +++ b/app/screens/search/search_result_post/search_result_post.test.js @@ -4,7 +4,7 @@ import React from 'react'; import {Preferences} from '@mm-redux/constants'; -import {shallowWithIntl} from 'test/intl-test-helper'; +import {shallowWithIntl} from '@test/intl-test-helper'; import SearchResultPost from './search_result_post'; diff --git a/app/screens/select_server/index.js b/app/screens/select_server/index.js index 1c2647694..cde53677d 100644 --- a/app/screens/select_server/index.js +++ b/app/screens/select_server/index.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; import {loadConfigAndLicense} from '@actions/views/root'; import {handleServerUrlChanged} from '@actions/views/select_server'; diff --git a/app/screens/select_server/select_server.js b/app/screens/select_server/select_server.js index 9b83189e4..2e19e5c21 100644 --- a/app/screens/select_server/select_server.js +++ b/app/screens/select_server/select_server.js @@ -1,9 +1,9 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; -import {Navigation} from 'react-native-navigation'; +import merge from 'deepmerge'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import {intlShape} from 'react-intl'; import { ActivityIndicator, @@ -21,19 +21,19 @@ import { View, } from 'react-native'; import Button from 'react-native-button'; +import {Navigation} from 'react-native-navigation'; import {SafeAreaView} from 'react-native-safe-area-context'; import RNFetchBlob from 'rn-fetch-blob'; -import merge from 'deepmerge'; import urlParse from 'url-parse'; import {resetToChannel, goToScreen} from '@actions/navigation'; import LocalConfig from '@assets/config'; +import {Client4} from '@client/rest'; import AppVersion from '@components/app_version'; import ErrorText from '@components/error_text'; import FormattedText from '@components/formatted_text'; import fetchConfig from '@init/fetch'; import globalEventHandler from '@init/global_event_handler'; -import {Client4} from '@client/rest'; import {isMinimumServerVersion} from '@mm-redux/utils/helpers'; import {t} from '@utils/i18n'; import {preventDoubleTap} from '@utils/tap'; diff --git a/app/screens/select_server/select_server.test.js b/app/screens/select_server/select_server.test.js index c5e1a90e2..03aa33e8e 100644 --- a/app/screens/select_server/select_server.test.js +++ b/app/screens/select_server/select_server.test.js @@ -1,10 +1,12 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import {fireEvent, waitFor} from '@testing-library/react-native'; + import React from 'react'; +import {renderWithReduxIntl} from '@test/testing_library'; + import SelectServer from './select_server.js'; -import {renderWithReduxIntl} from 'test/testing_library'; -import {fireEvent, waitFor} from '@testing-library/react-native'; describe('SelectServer', () => { const actions = { diff --git a/app/screens/select_team/index.js b/app/screens/select_team/index.js index e7712518c..d03a34dd2 100644 --- a/app/screens/select_team/index.js +++ b/app/screens/select_team/index.js @@ -1,18 +1,17 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; +import {handleTeamChange} from '@actions/views/select_team'; +import {logout} from '@actions/views/user'; import {getTeams, addUserToTeam} from '@mm-redux/actions/teams'; import {General} from '@mm-redux/constants'; import {getTheme} from '@mm-redux/selectors/entities/preferences'; import {getSortedJoinableTeams} from '@mm-redux/selectors/entities/teams'; import {getCurrentUser} from '@mm-redux/selectors/entities/users'; - -import {logout} from 'app/actions/views/user'; -import {handleTeamChange} from 'app/actions/views/select_team'; -import {isGuest} from 'app/utils/users'; +import {isGuest} from '@utils/users'; import SelectTeam from './select_team.js'; diff --git a/app/screens/select_team/select_team.js b/app/screens/select_team/select_team.js index 94a86d54b..21f241cf1 100644 --- a/app/screens/select_team/select_team.js +++ b/app/screens/select_team/select_team.js @@ -1,8 +1,9 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; +import memoize from 'memoize-one'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import { Alert, InteractionManager, @@ -13,20 +14,18 @@ import { import {Navigation} from 'react-native-navigation'; import {SafeAreaView} from 'react-native-safe-area-context'; +import {resetToChannel, dismissModal} from '@actions/navigation'; +import CustomList from '@components/custom_list'; +import FormattedText from '@components/formatted_text'; +import Loading from '@components/loading'; +import StatusBar from '@components/status_bar'; +import TeamIcon from '@components/team_icon'; +import {NavigationTypes} from '@constants'; import {RequestStatus} from '@mm-redux/constants'; import EventEmitter from '@mm-redux/utils/event_emitter'; - -import FormattedText from '@components/formatted_text'; -import Loading from 'app/components/loading'; -import StatusBar from 'app/components/status_bar'; -import CustomList from 'app/components/custom_list'; -import TeamIcon from 'app/components/team_icon'; -import {NavigationTypes} from 'app/constants'; -import {resetToChannel, dismissModal} from 'app/actions/navigation'; -import {preventDoubleTap} from 'app/utils/tap'; -import {changeOpacity, makeStyleSheetFromTheme} from 'app/utils/theme'; -import {t} from 'app/utils/i18n'; -import memoize from 'memoize-one'; +import {t} from '@utils/i18n'; +import {preventDoubleTap} from '@utils/tap'; +import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; const TEAMS_PER_PAGE = 50; diff --git a/app/screens/select_team/select_team.test.js b/app/screens/select_team/select_team.test.js index f37bfb8cf..25b33491c 100644 --- a/app/screens/select_team/select_team.test.js +++ b/app/screens/select_team/select_team.test.js @@ -1,11 +1,10 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; - -import Preferences from '@mm-redux/constants/preferences'; +import React from 'react'; import {RequestStatus} from '@mm-redux/constants'; +import Preferences from '@mm-redux/constants/preferences'; import SelectTeam from './select_team.js'; diff --git a/app/screens/selector_screen/index.js b/app/screens/selector_screen/index.js index a2f20885c..b5770fa3f 100644 --- a/app/screens/selector_screen/index.js +++ b/app/screens/selector_screen/index.js @@ -1,13 +1,14 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; -import {getCurrentTeamId} from '@mm-redux/selectors/entities/teams'; -import {getTheme} from '@mm-redux/selectors/entities/preferences'; -import {getProfiles, searchProfiles} from '@mm-redux/actions/users'; import {getChannels, searchChannels} from '@mm-redux/actions/channels'; +import {getProfiles, searchProfiles} from '@mm-redux/actions/users'; +import {getTheme} from '@mm-redux/selectors/entities/preferences'; +import {getCurrentTeamId} from '@mm-redux/selectors/entities/teams'; + import SelectorScreen from './selector_screen'; function mapStateToProps(state) { diff --git a/app/screens/selector_screen/selector_screen.js b/app/screens/selector_screen/selector_screen.js index 521d8c72a..a567a88d8 100644 --- a/app/screens/selector_screen/selector_screen.js +++ b/app/screens/selector_screen/selector_screen.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import {intlShape} from 'react-intl'; import { Platform, @@ -12,18 +12,18 @@ import {SafeAreaView} from 'react-native-safe-area-context'; import {popTopScreen} from '@actions/navigation'; import CustomList, {FLATLIST, SECTIONLIST} from '@components/custom_list'; -import UserListRow from '@components/custom_list/user_list_row'; import ChannelListRow from '@components/custom_list/channel_list_row'; import OptionListRow from '@components/custom_list/option_list_row'; +import UserListRow from '@components/custom_list/user_list_row'; import FormattedText from '@components/formatted_text'; import SearchBar from '@components/search_bar'; import StatusBar from '@components/status_bar'; import {ViewTypes} from '@constants'; import {debounce} from '@mm-redux/actions/helpers'; import {General} from '@mm-redux/constants'; -import {filterProfilesMatchingTerm} from '@mm-redux/utils/user_utils'; import {filterChannelsMatchingTerm} from '@mm-redux/utils/channel_utils'; import {memoizeResult} from '@mm-redux/utils/helpers'; +import {filterProfilesMatchingTerm} from '@mm-redux/utils/user_utils'; import {t} from '@utils/i18n'; import {createProfilesSections, loadingText} from '@utils/member_list'; import { diff --git a/app/screens/selector_screen/selector_screen.test.js b/app/screens/selector_screen/selector_screen.test.js index 4621c9b48..ae176d38c 100644 --- a/app/screens/selector_screen/selector_screen.test.js +++ b/app/screens/selector_screen/selector_screen.test.js @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import {IntlProvider} from 'react-intl'; import Preferences from '@mm-redux/constants/preferences'; diff --git a/app/screens/settings/advanced_settings/advanced_settings.js b/app/screens/settings/advanced_settings/advanced_settings.js index b716a9a83..4b0af079c 100644 --- a/app/screens/settings/advanced_settings/advanced_settings.js +++ b/app/screens/settings/advanced_settings/advanced_settings.js @@ -1,8 +1,10 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {Component} from 'react'; +import * as Sentry from '@sentry/react-native'; + import PropTypes from 'prop-types'; +import React, {Component} from 'react'; import {injectIntl, intlShape} from 'react-intl'; import { ActivityIndicator, @@ -13,15 +15,14 @@ import { View, } from 'react-native'; import {SafeAreaView} from 'react-native-safe-area-context'; -import * as Sentry from '@sentry/react-native'; import {dismissAllModals, goToScreen} from '@actions/navigation'; import Config from '@assets/config'; import StatusBar from '@components/status_bar'; import {getFormattedFileSize} from '@mm-redux/utils/file_utils'; import SettingsItem from '@screens/settings/settings_item'; -import {t} from '@utils/i18n'; import {deleteFileCache, getFileCacheSize} from '@utils/file'; +import {t} from '@utils/i18n'; import {preventDoubleTap} from '@utils/tap'; import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; diff --git a/app/screens/settings/advanced_settings/index.js b/app/screens/settings/advanced_settings/index.js index c46329c7e..94b88b55d 100644 --- a/app/screens/settings/advanced_settings/index.js +++ b/app/screens/settings/advanced_settings/index.js @@ -1,11 +1,12 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; -import {purgeOfflineStore} from 'app/actions/views/root'; +import {purgeOfflineStore} from '@actions/views/root'; import {getTheme} from '@mm-redux/selectors/entities/preferences'; + import AdvancedSettings from './advanced_settings'; function mapStateToProps(state) { diff --git a/app/screens/settings/clock_display/clock_display.android.js b/app/screens/settings/clock_display/clock_display.android.js index 479344ae3..d5047a458 100644 --- a/app/screens/settings/clock_display/clock_display.android.js +++ b/app/screens/settings/clock_display/clock_display.android.js @@ -1,18 +1,18 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; + import PropTypes from 'prop-types'; +import React from 'react'; import { TouchableOpacity, Modal, View, } from 'react-native'; -import StatusBar from 'app/components/status_bar'; import FormattedText from '@components/formatted_text'; -import RadioButtonGroup from 'app/components/radio_button'; - -import {changeOpacity, makeStyleSheetFromTheme} from 'app/utils/theme'; +import RadioButtonGroup from '@components/radio_button'; +import StatusBar from '@components/status_bar'; +import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; import ClockDisplayBase from './clock_display_base'; diff --git a/app/screens/settings/clock_display/clock_display.ios.js b/app/screens/settings/clock_display/clock_display.ios.js index b6275ae25..143272616 100644 --- a/app/screens/settings/clock_display/clock_display.ios.js +++ b/app/screens/settings/clock_display/clock_display.ios.js @@ -6,13 +6,12 @@ import { } from 'react-native'; import {SafeAreaView} from 'react-native-safe-area-context'; -import StatusBar from 'app/components/status_bar'; -import Section from 'app/screens/settings/section'; -import SectionItem from 'app/screens/settings/section_item'; import FormattedText from '@components/formatted_text'; - -import {changeOpacity, makeStyleSheetFromTheme} from 'app/utils/theme'; -import {t} from 'app/utils/i18n'; +import StatusBar from '@components/status_bar'; +import Section from '@screens/settings/section'; +import SectionItem from '@screens/settings/section_item'; +import {t} from '@utils/i18n'; +import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; import ClockDisplayBase from './clock_display_base'; diff --git a/app/screens/settings/clock_display/clock_display_base.js b/app/screens/settings/clock_display/clock_display_base.js index 1d0ffb170..36b59ad36 100644 --- a/app/screens/settings/clock_display/clock_display_base.js +++ b/app/screens/settings/clock_display/clock_display_base.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import {PureComponent} from 'react'; import {intlShape} from 'react-intl'; import Preferences from '@mm-redux/constants/preferences'; diff --git a/app/screens/settings/clock_display/index.js b/app/screens/settings/clock_display/index.js index 9b77d66c6..3740dbfb6 100644 --- a/app/screens/settings/clock_display/index.js +++ b/app/screens/settings/clock_display/index.js @@ -1,13 +1,14 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; -import {getTheme, get as getPreference} from '@mm-redux/selectors/entities/preferences'; -import {getCurrentUserId} from '@mm-redux/selectors/entities/users'; import {savePreferences} from '@mm-redux/actions/preferences'; import Preferences from '@mm-redux/constants/preferences'; +import {getTheme, get as getPreference} from '@mm-redux/selectors/entities/preferences'; +import {getCurrentUserId} from '@mm-redux/selectors/entities/users'; + import ClockDisplay from './clock_display'; function mapStateToProps(state) { diff --git a/app/screens/settings/display_settings/display_settings.js b/app/screens/settings/display_settings/display_settings.js index 160c0d571..65fc7eaf9 100644 --- a/app/screens/settings/display_settings/display_settings.js +++ b/app/screens/settings/display_settings/display_settings.js @@ -1,15 +1,15 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import {intlShape} from 'react-intl'; import {Platform, View} from 'react-native'; import {SafeAreaView} from 'react-native-safe-area-context'; import {goToScreen} from '@actions/navigation'; -import {DeviceTypes} from '@constants'; import StatusBar from '@components/status_bar'; +import {DeviceTypes} from '@constants'; import ClockDisplay from '@screens/settings/clock_display'; import SettingsItem from '@screens/settings/settings_item'; import {preventDoubleTap} from '@utils/tap'; diff --git a/app/screens/settings/display_settings/display_settings.test.js b/app/screens/settings/display_settings/display_settings.test.js index 029e15458..63ccde67d 100644 --- a/app/screens/settings/display_settings/display_settings.test.js +++ b/app/screens/settings/display_settings/display_settings.test.js @@ -6,7 +6,7 @@ import React from 'react'; import {DeviceTypes} from '@constants'; import Preferences from '@mm-redux/constants/preferences'; import SettingsItem from '@screens/settings/settings_item'; -import {shallowWithIntl} from 'test/intl-test-helper'; +import {shallowWithIntl} from '@test/intl-test-helper'; import DisplaySettings from './display_settings'; diff --git a/app/screens/settings/display_settings/index.js b/app/screens/settings/display_settings/index.js index 8cd05387c..e5488357b 100644 --- a/app/screens/settings/display_settings/index.js +++ b/app/screens/settings/display_settings/index.js @@ -7,6 +7,7 @@ import {getTheme} from '@mm-redux/selectors/entities/preferences'; import {isTimezoneEnabled} from '@mm-redux/selectors/entities/timezone'; import {getAllowedThemes} from '@selectors/theme'; import {isThemeSwitchingEnabled} from '@utils/theme'; + import DisplaySettings from './display_settings'; function mapStateToProps(state) { diff --git a/app/screens/settings/general/index.js b/app/screens/settings/general/index.js index af0d4dffd..2b4a9b526 100644 --- a/app/screens/settings/general/index.js +++ b/app/screens/settings/general/index.js @@ -1,16 +1,15 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; +import {purgeOfflineStore} from '@actions/views/root'; import {clearErrors} from '@mm-redux/actions/errors'; import {getCurrentUrl, getConfig} from '@mm-redux/selectors/entities/general'; -import {getJoinableTeams} from '@mm-redux/selectors/entities/teams'; import {getTheme} from '@mm-redux/selectors/entities/preferences'; - -import {purgeOfflineStore} from 'app/actions/views/root'; -import {removeProtocol} from 'app/utils/url'; +import {getJoinableTeams} from '@mm-redux/selectors/entities/teams'; +import {removeProtocol} from '@utils/url'; import Settings from './settings'; diff --git a/app/screens/settings/general/settings.js b/app/screens/settings/general/settings.js index e86c07bc1..3383c5e8c 100644 --- a/app/screens/settings/general/settings.js +++ b/app/screens/settings/general/settings.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import {intlShape, injectIntl} from 'react-intl'; import { Alert, diff --git a/app/screens/settings/notification_settings/index.js b/app/screens/settings/notification_settings/index.js index b5bdafb63..7364d34b4 100644 --- a/app/screens/settings/notification_settings/index.js +++ b/app/screens/settings/notification_settings/index.js @@ -1,15 +1,15 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; -import {getCurrentUser, getStatusForUserId} from '@mm-redux/selectors/entities/users'; +import {updateMe} from '@mm-redux/actions/users'; import {getConfig} from '@mm-redux/selectors/entities/general'; import {getMyPreferences, getTheme} from '@mm-redux/selectors/entities/preferences'; +import {getCurrentUser, getStatusForUserId} from '@mm-redux/selectors/entities/users'; import {isMinimumServerVersion} from '@mm-redux/utils/helpers'; -import {isLandscape} from 'app/selectors/device'; -import {updateMe} from '@mm-redux/actions/users'; +import {isLandscape} from '@selectors/device'; import NotificationSettings from './notification_settings'; diff --git a/app/screens/settings/notification_settings/notification_settings.js b/app/screens/settings/notification_settings/notification_settings.js index ad1b4ffe7..2428860f5 100644 --- a/app/screens/settings/notification_settings/notification_settings.js +++ b/app/screens/settings/notification_settings/notification_settings.js @@ -1,8 +1,9 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; +import deepEqual from 'deep-equal'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import {intlShape} from 'react-intl'; import { Alert, @@ -10,19 +11,18 @@ import { ScrollView, View, } from 'react-native'; -import deepEqual from 'deep-equal'; import {SafeAreaView} from 'react-native-safe-area-context'; +import {goToScreen} from '@actions/navigation'; +import StatusBar from '@components/status_bar'; import {General, RequestStatus} from '@mm-redux/constants'; +import SettingsItem from '@screens/settings/settings_item'; +import {t} from '@utils/i18n'; +import {getNotificationProps} from '@utils/notify_props'; +import {preventDoubleTap} from '@utils/tap'; +import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; -import StatusBar from 'app/components/status_bar'; import NotificationPreferences from 'app/notification_preferences'; -import SettingsItem from 'app/screens/settings/settings_item'; -import {getNotificationProps} from 'app/utils/notify_props'; -import {preventDoubleTap} from 'app/utils/tap'; -import {changeOpacity, makeStyleSheetFromTheme} from 'app/utils/theme'; -import {t} from 'app/utils/i18n'; -import {goToScreen} from 'app/actions/navigation'; export default class NotificationSettings extends PureComponent { static propTypes = { diff --git a/app/screens/settings/notification_settings/notification_settings.test.js b/app/screens/settings/notification_settings/notification_settings.test.js index 3367f7f5b..e6debc892 100644 --- a/app/screens/settings/notification_settings/notification_settings.test.js +++ b/app/screens/settings/notification_settings/notification_settings.test.js @@ -4,13 +4,11 @@ import React from 'react'; import Preferences from '@mm-redux/constants/preferences'; - -import {shallowWithIntl} from 'test/intl-test-helper'; +import {shallowWithIntl} from '@test/intl-test-helper'; +import {getNotificationProps} from '@utils/notify_props'; import NotificationSettings from './notification_settings.js'; -import {getNotificationProps} from 'app/utils/notify_props'; - describe('NotificationSettings', () => { const currentUser = {id: 'current_user_id'}; const baseProps = { diff --git a/app/screens/settings/notification_settings_auto_responder/index.ts b/app/screens/settings/notification_settings_auto_responder/index.ts index db03f34a2..648a07458 100644 --- a/app/screens/settings/notification_settings_auto_responder/index.ts +++ b/app/screens/settings/notification_settings_auto_responder/index.ts @@ -6,6 +6,7 @@ import {connect} from 'react-redux'; import {getTheme} from '@mm-redux/selectors/entities/preferences'; import {getCurrentUserId, getStatusForUserId} from '@mm-redux/selectors/entities/users'; import {GlobalState} from '@mm-redux/types/store'; + import NotificationSettingsAutoResponder from './notification_settings_auto_responder'; function mapStateToProps(state: GlobalState) { diff --git a/app/screens/settings/notification_settings_auto_responder/notification_settings_auto_responder.tsx b/app/screens/settings/notification_settings_auto_responder/notification_settings_auto_responder.tsx index e920d52ff..78810603d 100644 --- a/app/screens/settings/notification_settings_auto_responder/notification_settings_auto_responder.tsx +++ b/app/screens/settings/notification_settings_auto_responder/notification_settings_auto_responder.tsx @@ -2,9 +2,8 @@ // See LICENSE.txt for license information. import React, {useEffect, useRef, useState} from 'react'; - -import {View} from 'react-native'; import {intlShape, injectIntl} from 'react-intl'; +import {View} from 'react-native'; import {SafeAreaView} from 'react-native-safe-area-context'; import {popTopScreen} from '@actions/navigation'; @@ -12,6 +11,8 @@ import FormattedText from '@components/formatted_text'; import StatusBar from '@components/status_bar'; import TextInputWithLocalizedPlaceholder from '@components/text_input_with_localized_placeholder'; import {General} from '@mm-redux/constants'; +import {Theme} from '@mm-redux/types/preferences'; +import {UserNotifyProps, UserProfile} from '@mm-redux/types/users'; import Section from '@screens/settings/section'; import SectionItem from '@screens/settings/section_item'; import {t} from '@utils/i18n'; @@ -21,8 +22,6 @@ import { makeStyleSheetFromTheme, getKeyboardAppearanceFromTheme, } from '@utils/theme'; -import {UserNotifyProps, UserProfile} from '@mm-redux/types/users'; -import {Theme} from '@mm-redux/types/preferences'; interface NotificationSettingsAutoResponderProps { currentUser: UserProfile; diff --git a/app/screens/settings/notification_settings_email/index.js b/app/screens/settings/notification_settings_email/index.js index 10772cf0a..eebc57aa7 100644 --- a/app/screens/settings/notification_settings_email/index.js +++ b/app/screens/settings/notification_settings_email/index.js @@ -1,22 +1,19 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators} from 'redux'; import {connect} from 'react-redux'; - -import {Preferences} from '@mm-redux/constants'; +import {bindActionCreators} from 'redux'; import {savePreferences} from '@mm-redux/actions/preferences'; import {updateMe} from '@mm-redux/actions/users'; - -import {getCurrentUser} from '@mm-redux/selectors/entities/users'; +import {Preferences} from '@mm-redux/constants'; import {getConfig} from '@mm-redux/selectors/entities/general'; import { get as getPreference, getTheme, } from '@mm-redux/selectors/entities/preferences'; - -import {getNotificationProps} from 'app/utils/notify_props'; +import {getCurrentUser} from '@mm-redux/selectors/entities/users'; +import {getNotificationProps} from '@utils/notify_props'; import NotificationSettingsEmail from './notification_settings_email'; diff --git a/app/screens/settings/notification_settings_email/notification_settings_email.android.js b/app/screens/settings/notification_settings_email/notification_settings_email.android.js index a5e964c76..4ab8e2a53 100644 --- a/app/screens/settings/notification_settings_email/notification_settings_email.android.js +++ b/app/screens/settings/notification_settings_email/notification_settings_email.android.js @@ -10,14 +10,12 @@ import { View, } from 'react-native'; -import {Preferences} from '@mm-redux/constants'; - -import {changeOpacity, makeStyleSheetFromTheme} from 'app/utils/theme'; -import {t} from 'app/utils/i18n'; - import FormattedText from '@components/formatted_text'; -import RadioButtonGroup from 'app/components/radio_button'; -import SectionItem from 'app/screens/settings/section_item'; +import RadioButtonGroup from '@components/radio_button'; +import {Preferences} from '@mm-redux/constants'; +import SectionItem from '@screens/settings/section_item'; +import {t} from '@utils/i18n'; +import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; import NotificationSettingsEmailBase from './notification_settings_email_base'; diff --git a/app/screens/settings/notification_settings_email/notification_settings_email.android.test.js b/app/screens/settings/notification_settings_email/notification_settings_email.android.test.js index b5646b8ec..e82a9911b 100644 --- a/app/screens/settings/notification_settings_email/notification_settings_email.android.test.js +++ b/app/screens/settings/notification_settings_email/notification_settings_email.android.test.js @@ -3,11 +3,9 @@ import React from 'react'; +import RadioButtonGroup from '@components/radio_button'; import Preferences from '@mm-redux/constants/preferences'; - -import {shallowWithIntl} from 'test/intl-test-helper'; - -import RadioButtonGroup from 'app/components/radio_button'; +import {shallowWithIntl} from '@test/intl-test-helper'; import NotificationSettingsEmailAndroid from './notification_settings_email.android.js'; diff --git a/app/screens/settings/notification_settings_email/notification_settings_email.ios.js b/app/screens/settings/notification_settings_email/notification_settings_email.ios.js index 1e242fbd3..a38ee0289 100644 --- a/app/screens/settings/notification_settings_email/notification_settings_email.ios.js +++ b/app/screens/settings/notification_settings_email/notification_settings_email.ios.js @@ -2,7 +2,6 @@ // See LICENSE.txt for license information. import React from 'react'; - import { ScrollView, View, @@ -12,10 +11,10 @@ import {SafeAreaView} from 'react-native-safe-area-context'; import FormattedText from '@components/formatted_text'; import StatusBar from '@components/status_bar'; import {Preferences} from '@mm-redux/constants'; -import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; -import {t} from '@utils/i18n'; import Section from '@screens/settings/section'; import SectionItem from '@screens/settings/section_item'; +import {t} from '@utils/i18n'; +import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; import NotificationSettingsEmailBase from './notification_settings_email_base'; diff --git a/app/screens/settings/notification_settings_email/notification_settings_email.ios.test.js b/app/screens/settings/notification_settings_email/notification_settings_email.ios.test.js index a3285d62a..e3b0cfcaf 100644 --- a/app/screens/settings/notification_settings_email/notification_settings_email.ios.test.js +++ b/app/screens/settings/notification_settings_email/notification_settings_email.ios.test.js @@ -1,11 +1,10 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import Preferences from '@mm-redux/constants/preferences'; - import SectionItem from '@screens/settings/section_item'; import NotificationSettingsEmailIos from './notification_settings_email.ios.js'; diff --git a/app/screens/settings/notification_settings_email/notification_settings_email_base.js b/app/screens/settings/notification_settings_email/notification_settings_email_base.js index 6f698117a..23504b95e 100644 --- a/app/screens/settings/notification_settings_email/notification_settings_email_base.js +++ b/app/screens/settings/notification_settings_email/notification_settings_email_base.js @@ -1,9 +1,9 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import PropTypes from 'prop-types'; import {PureComponent} from 'react'; import {Platform} from 'react-native'; -import PropTypes from 'prop-types'; import {Navigation} from 'react-native-navigation'; import {Preferences} from '@mm-redux/constants'; diff --git a/app/screens/settings/notification_settings_mentions/notification_settings_mention_base.js b/app/screens/settings/notification_settings_mentions/notification_settings_mention_base.js index dc15f8526..1ec8e209c 100644 --- a/app/screens/settings/notification_settings_mentions/notification_settings_mention_base.js +++ b/app/screens/settings/notification_settings_mentions/notification_settings_mention_base.js @@ -1,12 +1,12 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import {PureComponent} from 'react'; import {intlShape} from 'react-intl'; import {Navigation} from 'react-native-navigation'; -import {getNotificationProps} from 'app/utils/notify_props'; +import {getNotificationProps} from '@utils/notify_props'; export default class NotificationSettingsMentionsBase extends PureComponent { static propTypes = { diff --git a/app/screens/settings/notification_settings_mentions/notification_settings_mentions.android.js b/app/screens/settings/notification_settings_mentions/notification_settings_mentions.android.js index d1919ca3e..fccd7cdf5 100644 --- a/app/screens/settings/notification_settings_mentions/notification_settings_mentions.android.js +++ b/app/screens/settings/notification_settings_mentions/notification_settings_mentions.android.js @@ -2,6 +2,7 @@ // See LICENSE.txt for license information. import React from 'react'; +import {injectIntl} from 'react-intl'; import { Modal, ScrollView, @@ -9,19 +10,18 @@ import { TouchableOpacity, View, } from 'react-native'; -import {injectIntl} from 'react-intl'; import FormattedText from '@components/formatted_text'; -import RadioButtonGroup from 'app/components/radio_button'; -import StatusBar from 'app/components/status_bar'; -import TextInputWithLocalizedPlaceholder from 'app/components/text_input_with_localized_placeholder'; -import SectionItem from 'app/screens/settings/section_item'; +import RadioButtonGroup from '@components/radio_button'; +import StatusBar from '@components/status_bar'; +import TextInputWithLocalizedPlaceholder from '@components/text_input_with_localized_placeholder'; +import SectionItem from '@screens/settings/section_item'; +import {t} from '@utils/i18n'; import { changeOpacity, makeStyleSheetFromTheme, getKeyboardAppearanceFromTheme, -} from 'app/utils/theme'; -import {t} from 'app/utils/i18n'; +} from '@utils/theme'; import NotificationSettingsMentionsBase from './notification_settings_mention_base'; diff --git a/app/screens/settings/notification_settings_mentions/notification_settings_mentions.ios.js b/app/screens/settings/notification_settings_mentions/notification_settings_mentions.ios.js index ee8299532..e2d8fef94 100644 --- a/app/screens/settings/notification_settings_mentions/notification_settings_mentions.ios.js +++ b/app/screens/settings/notification_settings_mentions/notification_settings_mentions.ios.js @@ -2,21 +2,21 @@ // See LICENSE.txt for license information. import React from 'react'; +import {injectIntl} from 'react-intl'; import { ScrollView, Text, View, } from 'react-native'; -import {injectIntl} from 'react-intl'; import {SafeAreaView} from 'react-native-safe-area-context'; +import {goToScreen} from '@actions/navigation'; import FormattedText from '@components/formatted_text'; import StatusBar from '@components/status_bar'; import Section from '@screens/settings/section'; import SectionItem from '@screens/settings/section_item'; -import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; import {t} from '@utils/i18n'; -import {goToScreen} from '@actions/navigation'; +import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; import NotificationSettingsMentionsBase from './notification_settings_mention_base'; diff --git a/app/screens/settings/notification_settings_mentions_keywords/notification_settings_mentions_keywords.js b/app/screens/settings/notification_settings_mentions_keywords/notification_settings_mentions_keywords.js index 142bc65f7..fd4c27706 100644 --- a/app/screens/settings/notification_settings_mentions_keywords/notification_settings_mentions_keywords.js +++ b/app/screens/settings/notification_settings_mentions_keywords/notification_settings_mentions_keywords.js @@ -1,7 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; + import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import {ScrollView, View} from 'react-native'; import {Navigation} from 'react-native-navigation'; import {SafeAreaView} from 'react-native-safe-area-context'; diff --git a/app/screens/settings/notification_settings_mentions_keywords/notification_settings_mentions_keywords.test.js b/app/screens/settings/notification_settings_mentions_keywords/notification_settings_mentions_keywords.test.js index 3152c3b24..6c008f3a4 100644 --- a/app/screens/settings/notification_settings_mentions_keywords/notification_settings_mentions_keywords.test.js +++ b/app/screens/settings/notification_settings_mentions_keywords/notification_settings_mentions_keywords.test.js @@ -4,8 +4,7 @@ import React from 'react'; import Preferences from '@mm-redux/constants/preferences'; - -import {shallowWithIntl} from 'test/intl-test-helper'; +import {shallowWithIntl} from '@test/intl-test-helper'; import NotificationSettingsMentionsKeywords from './notification_settings_mentions_keywords'; diff --git a/app/screens/settings/notification_settings_mobile/index.js b/app/screens/settings/notification_settings_mobile/index.js index 6cd50957d..e894a9ed4 100644 --- a/app/screens/settings/notification_settings_mobile/index.js +++ b/app/screens/settings/notification_settings_mobile/index.js @@ -1,13 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; +import {updateMe} from '@mm-redux/actions/users'; import {getConfig} from '@mm-redux/selectors/entities/general'; import {getTeammateNameDisplaySetting, getTheme} from '@mm-redux/selectors/entities/preferences'; import {getCurrentUser} from '@mm-redux/selectors/entities/users'; -import {updateMe} from '@mm-redux/actions/users'; import NotificationSettingsMobile from './notification_settings_mobile'; diff --git a/app/screens/settings/notification_settings_mobile/notification_settings_mobile.android.js b/app/screens/settings/notification_settings_mobile/notification_settings_mobile.android.js index 5504ab262..0ef82f042 100644 --- a/app/screens/settings/notification_settings_mobile/notification_settings_mobile.android.js +++ b/app/screens/settings/notification_settings_mobile/notification_settings_mobile.android.js @@ -3,6 +3,8 @@ /* eslint-disable max-lines */ +import deepEqual from 'deep-equal'; +import PropTypes, {string} from 'prop-types'; import React from 'react'; import {injectIntl} from 'react-intl'; import { @@ -15,9 +17,6 @@ import { View, } from 'react-native'; -import deepEqual from 'deep-equal'; -import PropTypes, {string} from 'prop-types'; - import FormattedText from '@components/formatted_text'; import RadioButtonGroup from '@components/radio_button'; import StatusBar from '@components/status_bar'; @@ -25,8 +24,9 @@ import PushNotifications from '@init/push_notifications'; import {RequestStatus} from '@mm-redux/constants'; import {displayUsername} from '@mm-redux/utils/user_utils'; import SectionItem from '@screens/settings/section_item'; -import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; import {getNotificationProps} from '@utils/notify_props'; +import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; + import NotificationPreferences from 'app/notification_preferences'; import NotificationSettingsMobileBase from './notification_settings_mobile_base'; diff --git a/app/screens/settings/notification_settings_mobile/notification_settings_mobile.ios.js b/app/screens/settings/notification_settings_mobile/notification_settings_mobile.ios.js index 0c641fbe2..50b10f07e 100644 --- a/app/screens/settings/notification_settings_mobile/notification_settings_mobile.ios.js +++ b/app/screens/settings/notification_settings_mobile/notification_settings_mobile.ios.js @@ -8,13 +8,13 @@ import { View, } from 'react-native'; -import SafeAreaView from '@components/safe_area_view'; import FormattedText from '@components/formatted_text'; +import SafeAreaView from '@components/safe_area_view'; import StatusBar from '@components/status_bar'; -import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; -import {t} from '@utils/i18n'; import Section from '@screens/settings/section'; import SectionItem from '@screens/settings/section_item'; +import {t} from '@utils/i18n'; +import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; import NotificationSettingsMobileBase from './notification_settings_mobile_base'; diff --git a/app/screens/settings/notification_settings_mobile/notification_settings_mobile_base.js b/app/screens/settings/notification_settings_mobile/notification_settings_mobile_base.js index 7644ccfa7..377eb4db2 100644 --- a/app/screens/settings/notification_settings_mobile/notification_settings_mobile_base.js +++ b/app/screens/settings/notification_settings_mobile/notification_settings_mobile_base.js @@ -1,13 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {PureComponent} from 'react'; -import {Platform} from 'react-native'; import PropTypes from 'prop-types'; +import {PureComponent} from 'react'; import {intlShape} from 'react-intl'; +import {Platform} from 'react-native'; import {Navigation} from 'react-native-navigation'; -import {getNotificationProps} from 'app/utils/notify_props'; +import {getNotificationProps} from '@utils/notify_props'; export default class NotificationSettingsMobileBase extends PureComponent { static propTypes = { diff --git a/app/screens/settings/section.js b/app/screens/settings/section.js index dba49989b..9776465b1 100644 --- a/app/screens/settings/section.js +++ b/app/screens/settings/section.js @@ -1,14 +1,14 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import PropTypes from 'prop-types'; +import React from 'react'; import { View, } from 'react-native'; import FormattedText from '@components/formatted_text'; -import {changeOpacity, makeStyleSheetFromTheme} from 'app/utils/theme'; +import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; function section(props) { const { diff --git a/app/screens/settings/section_item.js b/app/screens/settings/section_item.js index dfe5f7974..49d4c3042 100644 --- a/app/screens/settings/section_item.js +++ b/app/screens/settings/section_item.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import PropTypes from 'prop-types'; +import React from 'react'; import { Switch, TouchableOpacity, diff --git a/app/screens/settings/settings_item/index.js b/app/screens/settings/settings_item/index.js index f81e05d9a..ca2762c0f 100644 --- a/app/screens/settings/settings_item/index.js +++ b/app/screens/settings/settings_item/index.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import {Text, TouchableOpacity, View} from 'react-native'; import CompassIcon from '@components/compass_icon'; diff --git a/app/screens/settings/settings_item/style.android.js b/app/screens/settings/settings_item/style.android.js index 4c06f5981..b72fa7aa3 100644 --- a/app/screens/settings/settings_item/style.android.js +++ b/app/screens/settings/settings_item/style.android.js @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {changeOpacity, makeStyleSheetFromTheme} from 'app/utils/theme'; +import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; export default makeStyleSheetFromTheme((theme) => { return { diff --git a/app/screens/settings/settings_item/style.ios.js b/app/screens/settings/settings_item/style.ios.js index 47ac4603b..8f8d5d464 100644 --- a/app/screens/settings/settings_item/style.ios.js +++ b/app/screens/settings/settings_item/style.ios.js @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {changeOpacity, makeStyleSheetFromTheme} from 'app/utils/theme'; +import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; export default makeStyleSheetFromTheme((theme) => { return { diff --git a/app/screens/settings/sidebar/index.js b/app/screens/settings/sidebar/index.js index 2ef87c2e4..3bdd8c507 100644 --- a/app/screens/settings/sidebar/index.js +++ b/app/screens/settings/sidebar/index.js @@ -1,24 +1,24 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; +import AsyncStorage from '@react-native-community/async-storage'; + import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; +import {intlShape} from 'react-intl'; import { View, Platform, } from 'react-native'; -import {intlShape} from 'react-intl'; -import AsyncStorage from '@react-native-community/async-storage'; import {SafeAreaView} from 'react-native-safe-area-context'; -import EventEmitter from '@mm-redux/utils/event_emitter'; - -import {DeviceTypes} from 'app/constants'; import FormattedText from '@components/formatted_text'; -import StatusBar from 'app/components/status_bar'; -import Section from 'app/screens/settings/section'; -import SectionItem from 'app/screens/settings/section_item'; -import {changeOpacity, makeStyleSheetFromTheme} from 'app/utils/theme'; +import StatusBar from '@components/status_bar'; +import {DeviceTypes} from '@constants'; +import EventEmitter from '@mm-redux/utils/event_emitter'; +import Section from '@screens/settings/section'; +import SectionItem from '@screens/settings/section_item'; +import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; export default class SidebarSettings extends PureComponent { static propTypes = { diff --git a/app/screens/settings/sidebar/sidebar.test.js b/app/screens/settings/sidebar/sidebar.test.js index e577ff377..af05da7d0 100644 --- a/app/screens/settings/sidebar/sidebar.test.js +++ b/app/screens/settings/sidebar/sidebar.test.js @@ -6,7 +6,7 @@ import React from 'react'; import MainSidebar from '@components/sidebars/main/main_sidebar.ios'; import {DeviceTypes} from '@constants'; import Preferences from '@mm-redux/constants/preferences'; -import {shallowWithIntl} from 'test/intl-test-helper'; +import {shallowWithIntl} from '@test/intl-test-helper'; import SidebarSettings from './index'; diff --git a/app/screens/settings/theme/index.js b/app/screens/settings/theme/index.js index ff8af39ec..7b1d93c72 100644 --- a/app/screens/settings/theme/index.js +++ b/app/screens/settings/theme/index.js @@ -4,13 +4,12 @@ import {connect} from 'react-redux'; import {bindActionCreators} from 'redux'; -import {getTheme} from '@mm-redux/selectors/entities/preferences'; -import {getCurrentUserId} from '@mm-redux/selectors/entities/users'; -import {getCurrentTeamId} from '@mm-redux/selectors/entities/teams'; import {savePreferences} from '@mm-redux/actions/preferences'; - -import {getAllowedThemes, getCustomTheme} from 'app/selectors/theme'; -import {isLandscape, isTablet} from 'app/selectors/device'; +import {getTheme} from '@mm-redux/selectors/entities/preferences'; +import {getCurrentTeamId} from '@mm-redux/selectors/entities/teams'; +import {getCurrentUserId} from '@mm-redux/selectors/entities/users'; +import {isLandscape, isTablet} from '@selectors/device'; +import {getAllowedThemes, getCustomTheme} from '@selectors/theme'; import Theme from './theme'; diff --git a/app/screens/settings/theme/theme.js b/app/screens/settings/theme/theme.js index 0db929f41..c244d64f6 100644 --- a/app/screens/settings/theme/theme.js +++ b/app/screens/settings/theme/theme.js @@ -1,16 +1,15 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; -import {Text, View} from 'react-native'; import PropTypes from 'prop-types'; +import React from 'react'; import {intlShape} from 'react-intl'; +import {Text, View} from 'react-native'; import {SafeAreaView} from 'react-native-safe-area-context'; -import Preferences from '@mm-redux/constants/preferences'; - import FormattedText from '@components/formatted_text'; import StatusBar from '@components/status_bar'; +import Preferences from '@mm-redux/constants/preferences'; import Section from '@screens/settings/section'; import SectionItem from '@screens/settings/section_item'; import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; diff --git a/app/screens/settings/theme/theme.test.js b/app/screens/settings/theme/theme.test.js index e36cbf54b..59cf98d2f 100644 --- a/app/screens/settings/theme/theme.test.js +++ b/app/screens/settings/theme/theme.test.js @@ -4,7 +4,7 @@ import React from 'react'; import Preferences from '@mm-redux/constants/preferences'; -import {shallowWithIntl} from 'test/intl-test-helper'; +import {shallowWithIntl} from '@test/intl-test-helper'; import Theme from './theme'; import ThemeTile from './theme_tile'; diff --git a/app/screens/settings/theme/theme_tile.js b/app/screens/settings/theme/theme_tile.js index cf060133f..c8fb0471e 100644 --- a/app/screens/settings/theme/theme_tile.js +++ b/app/screens/settings/theme/theme_tile.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import PropTypes from 'prop-types'; +import React from 'react'; import { Dimensions, Image, diff --git a/app/screens/settings/timezone/index.js b/app/screens/settings/timezone/index.js index cccca84c7..226df968a 100644 --- a/app/screens/settings/timezone/index.js +++ b/app/screens/settings/timezone/index.js @@ -4,12 +4,12 @@ import {connect} from 'react-redux'; import {bindActionCreators} from 'redux'; +import {updateUser} from '@actions/views/edit_profile'; import {getSupportedTimezones} from '@mm-redux/actions/general'; import {getSupportedTimezones as getTimezones} from '@mm-redux/selectors/entities/general'; import {getTheme} from '@mm-redux/selectors/entities/preferences'; import {getUserTimezone} from '@mm-redux/selectors/entities/timezone'; import {getCurrentUser} from '@mm-redux/selectors/entities/users'; -import {updateUser} from 'app/actions/views/edit_profile'; import Timezone from './timezone'; diff --git a/app/screens/settings/timezone/select_timezone/index.js b/app/screens/settings/timezone/select_timezone/index.js index a130068ce..85c618db6 100644 --- a/app/screens/settings/timezone/select_timezone/index.js +++ b/app/screens/settings/timezone/select_timezone/index.js @@ -3,8 +3,8 @@ import {connect} from 'react-redux'; -import {getTheme} from '@mm-redux/selectors/entities/preferences'; import {getSupportedTimezones} from '@mm-redux/selectors/entities/general'; +import {getTheme} from '@mm-redux/selectors/entities/preferences'; import SelectTimezone from './select_timezone'; diff --git a/app/screens/settings/timezone/select_timezone/select_timezone.js b/app/screens/settings/timezone/select_timezone/select_timezone.js index bbe331d8c..043ac1ba6 100644 --- a/app/screens/settings/timezone/select_timezone/select_timezone.js +++ b/app/screens/settings/timezone/select_timezone/select_timezone.js @@ -1,16 +1,17 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; +import {intlShape} from 'react-intl'; import { View, FlatList, Platform, } from 'react-native'; -import {intlShape} from 'react-intl'; import {SafeAreaView} from 'react-native-safe-area-context'; +import {popTopScreen} from '@actions/navigation'; import SearchBar from '@components/search_bar'; import StatusBar from '@components/status_bar'; import {ListTypes} from '@constants'; @@ -20,7 +21,6 @@ import { makeStyleSheetFromTheme, getKeyboardAppearanceFromTheme, } from '@utils/theme'; -import {popTopScreen} from '@actions/navigation'; import SelectTimezoneRow from './select_timezone_row'; diff --git a/app/screens/settings/timezone/select_timezone/select_timezone.test.js b/app/screens/settings/timezone/select_timezone/select_timezone.test.js index 048eadd13..00854fd91 100644 --- a/app/screens/settings/timezone/select_timezone/select_timezone.test.js +++ b/app/screens/settings/timezone/select_timezone/select_timezone.test.js @@ -2,9 +2,9 @@ // See LICENSE.txt for license information. import React from 'react'; -import {shallowWithIntl} from 'test/intl-test-helper'; import Preferences from '@mm-redux/constants/preferences'; +import {shallowWithIntl} from '@test/intl-test-helper'; import SelectTimezone from './select_timezone'; diff --git a/app/screens/settings/timezone/select_timezone/select_timezone_row.js b/app/screens/settings/timezone/select_timezone/select_timezone_row.js index 33c2e605d..d7ea2c4f8 100644 --- a/app/screens/settings/timezone/select_timezone/select_timezone_row.js +++ b/app/screens/settings/timezone/select_timezone/select_timezone_row.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; import { TouchableOpacity, Text, diff --git a/app/screens/settings/timezone/timezone.js b/app/screens/settings/timezone/timezone.js index 374098985..7bbec2683 100644 --- a/app/screens/settings/timezone/timezone.js +++ b/app/screens/settings/timezone/timezone.js @@ -1,25 +1,24 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; +import {intlShape} from 'react-intl'; import { View, Text, Platform, } from 'react-native'; -import {intlShape} from 'react-intl'; import {SafeAreaView} from 'react-native-safe-area-context'; -import {getTimezoneRegion} from '@mm-redux/utils/timezone_utils'; - +import {goToScreen} from '@actions/navigation'; import FormattedText from '@components/formatted_text'; -import StatusBar from 'app/components/status_bar'; -import Section from 'app/screens/settings/section'; -import SectionItem from 'app/screens/settings/section_item'; -import {changeOpacity, makeStyleSheetFromTheme} from 'app/utils/theme'; -import {getDeviceTimezone} from 'app/utils/timezone'; -import {goToScreen} from 'app/actions/navigation'; +import StatusBar from '@components/status_bar'; +import {getTimezoneRegion} from '@mm-redux/utils/timezone_utils'; +import Section from '@screens/settings/section'; +import SectionItem from '@screens/settings/section_item'; +import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; +import {getDeviceTimezone} from '@utils/timezone'; export default class Timezone extends PureComponent { static propTypes = { diff --git a/app/screens/slide_up/index.tsx b/app/screens/slide_up/index.tsx index 6d86416ba..39e53a38f 100644 --- a/app/screens/slide_up/index.tsx +++ b/app/screens/slide_up/index.tsx @@ -4,12 +4,12 @@ import React, {ReactElement, useCallback, useEffect, useRef} from 'react'; import {StyleSheet, View} from 'react-native'; -import {NavigationTypes} from '@constants'; +import {dismissModal} from '@actions/navigation'; import SlideUpPanel from '@components/slide_up_panel'; +import {NavigationTypes} from '@constants'; import EventEmitter from '@mm-redux/utils/event_emitter'; import type {Theme} from '@mm-redux/types/preferences'; -import {dismissModal} from '@actions/navigation'; type Props = { allowStayMiddle?: boolean; diff --git a/app/screens/sso/index.tsx b/app/screens/sso/index.tsx index c6b459f70..5d53f34b4 100644 --- a/app/screens/sso/index.tsx +++ b/app/screens/sso/index.tsx @@ -1,26 +1,27 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. + import React from 'react'; import {injectIntl, intlShape} from 'react-intl'; import {shallowEqual, useDispatch, useSelector} from 'react-redux'; -import type {GlobalState} from '@mm-redux/types/store'; - -import {resetToChannel} from 'app/actions/navigation'; -import {ViewTypes} from 'app/constants'; +import {resetToChannel} from '@actions/navigation'; import {scheduleExpiredNotification} from '@actions/views/session'; import {ssoLogin} from '@actions/views/user'; -import emmProvider from '@init/emm_provider'; -import {DispatchFunc} from '@mm-redux/types/actions'; import {Client4} from '@client/rest'; -import {getTheme} from '@mm-redux/selectors/entities/preferences'; +import {ViewTypes} from '@constants'; +import emmProvider from '@init/emm_provider'; import {getConfig} from '@mm-redux/selectors/entities/general'; +import {getTheme} from '@mm-redux/selectors/entities/preferences'; +import {DispatchFunc} from '@mm-redux/types/actions'; import {ErrorApi} from '@mm-redux/types/client4'; import {isMinimumServerVersion} from '@mm-redux/utils/helpers'; import SSOWithRedirectURL from './sso_with_redirect_url'; import SSOWithWebView from './sso_with_webview'; +import type {GlobalState} from '@mm-redux/types/store'; + interface SSOProps { intl: typeof intlShape; ssoType: string; diff --git a/app/screens/sso/sso.test.tsx b/app/screens/sso/sso.test.tsx index a7b2eb5ca..95cb109de 100644 --- a/app/screens/sso/sso.test.tsx +++ b/app/screens/sso/sso.test.tsx @@ -1,13 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import merge from 'deepmerge'; import React from 'react'; import {Linking} from 'react-native'; import configureMockStore from 'redux-mock-store'; -import merge from 'deepmerge'; import initialState from '@store/initial_state'; -import {renderWithReduxIntl} from 'test/testing_library'; +import {renderWithReduxIntl} from '@test/testing_library'; import SSOComponent from './index'; diff --git a/app/screens/sso/sso_with_redirect_url.test.tsx b/app/screens/sso/sso_with_redirect_url.test.tsx index 007a9b86d..0ec3a66f0 100644 --- a/app/screens/sso/sso_with_redirect_url.test.tsx +++ b/app/screens/sso/sso_with_redirect_url.test.tsx @@ -1,11 +1,11 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; -import Preferences from '@mm-redux/constants/preferences'; import FormattedText from '@components/formatted_text'; +import Preferences from '@mm-redux/constants/preferences'; import SSOWithRedirectURL from './sso_with_redirect_url'; diff --git a/app/screens/sso/sso_with_redirect_url.tsx b/app/screens/sso/sso_with_redirect_url.tsx index 81bc3c952..09b53f49c 100644 --- a/app/screens/sso/sso_with_redirect_url.tsx +++ b/app/screens/sso/sso_with_redirect_url.tsx @@ -7,13 +7,12 @@ import DeviceInfo from 'react-native-device-info'; import {SafeAreaView} from 'react-native-safe-area-context'; import urlParse from 'url-parse'; -import {changeOpacity, makeStyleSheetFromTheme} from 'app/utils/theme'; - import {setDeepLinkURL} from '@actions/views/root'; import FormattedText from '@components/formatted_text'; import Loading from '@components/loading'; import {Theme} from '@mm-redux/types/preferences'; import Store from '@store/store'; +import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; import {tryOpenURL} from '@utils/url'; interface SSOWithRedirectURLProps { @@ -23,7 +22,7 @@ interface SSOWithRedirectURLProps { onCSRFToken: (token: string) => void; onMMToken: (token: string) => void; setLoginError: (value: string) => void; - theme: Theme + theme: Theme; } function SSOWithRedirectURL({ diff --git a/app/screens/sso/sso_with_webview.tsx b/app/screens/sso/sso_with_webview.tsx index 76226e974..b89b2cf11 100644 --- a/app/screens/sso/sso_with_webview.tsx +++ b/app/screens/sso/sso_with_webview.tsx @@ -2,6 +2,7 @@ // See LICENSE.txt for license information. import CookieManager, {Cookies} from '@react-native-cookies/cookies'; + import React from 'react'; import {intlShape} from 'react-intl'; import {Alert, Text, View} from 'react-native'; @@ -10,14 +11,14 @@ import {WebView} from 'react-native-webview'; import {WebViewErrorEvent, WebViewMessageEvent, WebViewNavigation, WebViewNavigationEvent} from 'react-native-webview/lib/WebViewTypes'; import urlParse from 'url-parse'; -import {Client4} from '@client/rest'; -import type {Theme} from '@mm-redux/types/preferences'; - -import Loading from 'app/components/loading'; -import StatusBar from 'app/components/status_bar'; -import {ViewTypes} from 'app/constants'; -import {changeOpacity, makeStyleSheetFromTheme} from 'app/utils/theme'; import {popTopScreen} from '@actions/navigation'; +import {Client4} from '@client/rest'; +import Loading from '@components/loading'; +import StatusBar from '@components/status_bar'; +import {ViewTypes} from '@constants'; +import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; + +import type {Theme} from '@mm-redux/types/preferences'; const HEADERS = { 'X-Mobile-App': 'mattermost', @@ -64,7 +65,7 @@ interface SSOWithWebViewProps { onMMToken: (token: string) => void; serverUrl: string; ssoType: string; - theme: Theme + theme: Theme; } function SSOWithWebView({completeUrlPath, intl, loginError, loginUrl, onCSRFToken, onMMToken, serverUrl, ssoType, theme}: SSOWithWebViewProps) { diff --git a/app/screens/table/index.js b/app/screens/table/index.js index 399fca1f2..4f4caa069 100644 --- a/app/screens/table/index.js +++ b/app/screens/table/index.js @@ -6,7 +6,7 @@ import React from 'react'; import {Platform, ScrollView} from 'react-native'; import {SafeAreaView} from 'react-native-safe-area-context'; -import {makeStyleSheetFromTheme} from 'app/utils/theme'; +import {makeStyleSheetFromTheme} from '@utils/theme'; export default class Table extends React.PureComponent { static propTypes = { diff --git a/app/screens/terms_of_service/index.js b/app/screens/terms_of_service/index.js index a9e8af002..9d4aed77c 100644 --- a/app/screens/terms_of_service/index.js +++ b/app/screens/terms_of_service/index.js @@ -1,13 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; +import {logout} from '@actions/views/user'; import {getTermsOfService, updateMyTermsOfServiceStatus} from '@mm-redux/actions/users'; import {getConfig} from '@mm-redux/selectors/entities/general'; import {getTheme} from '@mm-redux/selectors/entities/preferences'; -import {logout} from 'app/actions/views/user'; import TermsOfService from './terms_of_service.js'; diff --git a/app/screens/terms_of_service/terms_of_service.js b/app/screens/terms_of_service/terms_of_service.js index d013eb2f8..c5fa47642 100644 --- a/app/screens/terms_of_service/terms_of_service.js +++ b/app/screens/terms_of_service/terms_of_service.js @@ -1,22 +1,22 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; +import {intlShape} from 'react-intl'; import { Alert, ScrollView, View, } from 'react-native'; -import {intlShape} from 'react-intl'; import {Navigation} from 'react-native-navigation'; import {SafeAreaView} from 'react-native-safe-area-context'; import {dismissModal, setButtons} from '@actions/navigation'; import FailedNetworkAction from '@components/failed_network_action'; -import Loading from 'app/components/loading'; -import Markdown from 'app/components/markdown'; -import StatusBar from 'app/components/status_bar'; +import Loading from '@components/loading'; +import Markdown from '@components/markdown'; +import StatusBar from '@components/status_bar'; import {getMarkdownTextStyles, getMarkdownBlockStyles} from '@utils/markdown'; import {unsupportedServer} from '@utils/supported_server'; import {makeStyleSheetFromTheme} from '@utils/theme'; diff --git a/app/screens/terms_of_service/terms_of_service.test.js b/app/screens/terms_of_service/terms_of_service.test.js index 1e2700591..f1c8971db 100644 --- a/app/screens/terms_of_service/terms_of_service.test.js +++ b/app/screens/terms_of_service/terms_of_service.test.js @@ -5,8 +5,8 @@ import React from 'react'; import * as NavigationActions from '@actions/navigation'; import Preferences from '@mm-redux/constants/preferences'; -import {shallowWithIntl} from 'test/intl-test-helper'; -import TestHelper from 'test/test_helper'; +import {shallowWithIntl} from '@test/intl-test-helper'; +import TestHelper from '@test/test_helper'; import TermsOfService from './terms_of_service.js'; diff --git a/app/screens/thread/index.js b/app/screens/thread/index.js index 83f580e21..9dd50c075 100644 --- a/app/screens/thread/index.js +++ b/app/screens/thread/index.js @@ -1,13 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; import {selectPost} from '@mm-redux/actions/posts'; import {setThreadFollow, updateThreadRead} from '@mm-redux/actions/threads'; -import {getCurrentUserId} from '@mm-redux/selectors/entities/common'; import {getChannel, getMyCurrentChannelMembership} from '@mm-redux/selectors/entities/channels'; +import {getCurrentUserId} from '@mm-redux/selectors/entities/common'; import {makeGetPostIdsForThread} from '@mm-redux/selectors/entities/posts'; import {getTheme, isCollapsedThreadsEnabled} from '@mm-redux/selectors/entities/preferences'; import {getThread} from '@mm-redux/selectors/entities/threads'; diff --git a/app/screens/thread/thread.android.js b/app/screens/thread/thread.android.js index d2cb8c526..8d3b19007 100644 --- a/app/screens/thread/thread.android.js +++ b/app/screens/thread/thread.android.js @@ -6,8 +6,8 @@ import {Animated, View} from 'react-native'; import KeyboardLayout from '@components/layout/keyboard_layout'; import Loading from '@components/loading'; -import PostList from '@components/post_list'; import PostDraft from '@components/post_draft'; +import PostList from '@components/post_list'; import SafeAreaView from '@components/safe_area_view'; import StatusBar from '@components/status_bar'; import {THREAD} from '@constants/screen'; diff --git a/app/screens/thread/thread.ios.js b/app/screens/thread/thread.ios.js index ad25a4ef8..2d25eb086 100644 --- a/app/screens/thread/thread.ios.js +++ b/app/screens/thread/thread.ios.js @@ -6,8 +6,8 @@ import {Animated, View} from 'react-native'; import Autocomplete from '@components/autocomplete'; import Loading from '@components/loading'; -import PostList from '@components/post_list'; import PostDraft from '@components/post_draft'; +import PostList from '@components/post_list'; import SafeAreaView from '@components/safe_area_view'; import StatusBar from '@components/status_bar'; import DEVICE from '@constants/device'; diff --git a/app/screens/thread/thread.ios.test.js b/app/screens/thread/thread.ios.test.js index f2f55fee1..8435df4ad 100644 --- a/app/screens/thread/thread.ios.test.js +++ b/app/screens/thread/thread.ios.test.js @@ -5,10 +5,10 @@ import React from 'react'; import PostList from '@components/post_list'; import {TYPING_VISIBLE} from '@constants/post_draft'; -import Preferences from '@mm-redux/constants/preferences'; import {General, RequestStatus} from '@mm-redux/constants'; +import Preferences from '@mm-redux/constants/preferences'; import EventEmitter from '@mm-redux/utils/event_emitter'; -import {shallowWithIntl} from 'test/intl-test-helper'; +import {shallowWithIntl} from '@test/intl-test-helper'; import ThreadIOS from './thread.ios'; diff --git a/app/screens/thread/thread_base.js b/app/screens/thread/thread_base.js index 8947bd29e..0b5b9556a 100644 --- a/app/screens/thread/thread_base.js +++ b/app/screens/thread/thread_base.js @@ -1,20 +1,19 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; -import {Animated} from 'react-native'; +import React, {PureComponent} from 'react'; import {intlShape} from 'react-intl'; +import {Animated} from 'react-native'; import {Navigation} from 'react-native-navigation'; +import {popTopScreen, mergeNavigationOptions} from '@actions/navigation'; +import DeletedPost from '@components/deleted_post'; +import Loading from '@components/loading'; +import {TYPING_HEIGHT, TYPING_VISIBLE} from '@constants/post_draft'; import {General, RequestStatus} from '@mm-redux/constants'; import EventEmitter from '@mm-redux/utils/event_emitter'; -import Loading from 'app/components/loading'; -import DeletedPost from 'app/components/deleted_post'; -import {popTopScreen, mergeNavigationOptions} from 'app/actions/navigation'; -import {TYPING_HEIGHT, TYPING_VISIBLE} from '@constants/post_draft'; - export default class ThreadBase extends PureComponent { static propTypes = { actions: PropTypes.shape({ diff --git a/app/screens/thread/thread_follow/index.tsx b/app/screens/thread/thread_follow/index.tsx index 48da04976..8a4db5e10 100644 --- a/app/screens/thread/thread_follow/index.tsx +++ b/app/screens/thread/thread_follow/index.tsx @@ -2,8 +2,8 @@ // See LICENSE.txt for license information. import React from 'react'; -import {Platform, StyleSheet, Text, TouchableOpacity, View} from 'react-native'; import {IntlShape} from 'react-intl'; +import {Platform, StyleSheet, Text, TouchableOpacity, View} from 'react-native'; import {Theme} from '@mm-redux/types/preferences'; import {changeOpacity} from '@mm-redux/utils/theme_utils'; @@ -14,7 +14,7 @@ type Props = { active: boolean; intl: typeof IntlShape; onPress: () => void; - theme: Theme + theme: Theme; }; function ThreadFollow({active, intl, onPress, theme}: Props) { diff --git a/app/screens/user_profile/index.js b/app/screens/user_profile/index.js index 1fd9a3b43..b7d61b55b 100644 --- a/app/screens/user_profile/index.js +++ b/app/screens/user_profile/index.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; import {setChannelDisplayName} from '@actions/views/channel'; import {unsetCustomStatus} from '@actions/views/custom_status'; diff --git a/app/screens/user_profile/user_profile.js b/app/screens/user_profile/user_profile.js index 9238b875a..21a3cde54 100644 --- a/app/screens/user_profile/user_profile.js +++ b/app/screens/user_profile/user_profile.js @@ -1,15 +1,15 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; +import React, {PureComponent} from 'react'; +import {intlShape} from 'react-intl'; import { Alert, ScrollView, Text, View, } from 'react-native'; -import {intlShape} from 'react-intl'; import {Navigation} from 'react-native-navigation'; import {SafeAreaView} from 'react-native-safe-area-context'; @@ -25,14 +25,14 @@ import ClearButton from '@components/custom_status/clear_button'; import CustomStatusExpiry from '@components/custom_status/custom_status_expiry'; import CustomStatusText from '@components/custom_status/custom_status_text'; import Emoji from '@components/emoji'; +import FormattedText from '@components/formatted_text'; import FormattedTime from '@components/formatted_time'; import ProfilePicture from '@components/profile_picture'; -import FormattedText from '@components/formatted_text'; import StatusBar from '@components/status_bar'; import {BotTag, GuestTag} from '@components/tag'; import {General} from '@mm-redux/constants'; -import {displayUsername} from '@mm-redux/utils/user_utils'; import {getUserCurrentTimezone} from '@mm-redux/utils/timezone_utils'; +import {displayUsername} from '@mm-redux/utils/user_utils'; import {alertErrorWithFallback} from '@utils/general'; import {t} from '@utils/i18n'; import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; diff --git a/app/screens/user_profile/user_profile.test.js b/app/screens/user_profile/user_profile.test.js index d8007e4a2..4328d4599 100644 --- a/app/screens/user_profile/user_profile.test.js +++ b/app/screens/user_profile/user_profile.test.js @@ -1,12 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. + import React from 'react'; import * as NavigationActions from '@actions/navigation'; import {BotTag, GuestTag} from '@components/tag'; import Preferences from '@mm-redux/constants/preferences'; import {CustomStatusDuration} from '@mm-redux/types/users'; -import {shallowWithIntl} from 'test/intl-test-helper'; +import {shallowWithIntl} from '@test/intl-test-helper'; import UserProfile from './user_profile.js'; diff --git a/app/screens/user_profile/user_profile_row.js b/app/screens/user_profile/user_profile_row.js index 7597b2044..9a1b7f7ee 100644 --- a/app/screens/user_profile/user_profile_row.js +++ b/app/screens/user_profile/user_profile_row.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import PropTypes from 'prop-types'; +import React from 'react'; import { Switch, Text, diff --git a/app/selectors/autocomplete.js b/app/selectors/autocomplete.js index 559cd452d..30c602415 100644 --- a/app/selectors/autocomplete.js +++ b/app/selectors/autocomplete.js @@ -3,18 +3,17 @@ import {createSelector} from 'reselect'; +import * as Autocomplete from '@constants/autocomplete'; import {General} from '@mm-redux/constants'; -import {getConfig} from '@mm-redux/selectors/entities/general'; import {getMyChannels, getOtherChannels} from '@mm-redux/selectors/entities/channels'; +import {getConfig} from '@mm-redux/selectors/entities/general'; import { getCurrentUser, getProfilesInCurrentChannel, getProfilesNotInCurrentChannel, getProfilesInCurrentTeam, } from '@mm-redux/selectors/entities/users'; import {sortChannelsByDisplayName} from '@mm-redux/utils/channel_utils'; import {sortByUsername} from '@mm-redux/utils/user_utils'; - -import * as Autocomplete from 'app/constants/autocomplete'; -import {getCurrentLocale} from 'app/selectors/i18n'; +import {getCurrentLocale} from '@selectors/i18n'; export const getMatchTermForAtMention = (() => { let lastMatchTerm = null; diff --git a/app/selectors/autocomplete.test.js b/app/selectors/autocomplete.test.js index 2d6202b21..bfe927550 100644 --- a/app/selectors/autocomplete.test.js +++ b/app/selectors/autocomplete.test.js @@ -3,14 +3,13 @@ import assert from 'assert'; +import {General} from '@mm-redux/constants'; import { getMatchTermForAtMention, filterMembersNotInChannel, filterMembersInChannel, filterDirectAndGroupMessages, -} from 'app/selectors/autocomplete'; - -import {General} from '@mm-redux/constants'; +} from '@selectors/autocomplete'; /* eslint-disable max-nested-callbacks */ diff --git a/app/selectors/channel.js b/app/selectors/channel.js index c5fd649e8..5ceb6a8d4 100644 --- a/app/selectors/channel.js +++ b/app/selectors/channel.js @@ -4,10 +4,10 @@ import {createSelector} from 'reselect'; import {General} from '@mm-redux/constants'; -import {getCurrentUserId, getUser} from '@mm-redux/selectors/entities/users'; import {getChannelByName, getChannelsInCurrentTeam, getMyChannelMemberships} from '@mm-redux/selectors/entities/channels'; -import {getTeamByName} from '@mm-redux/selectors/entities/teams'; import {getConfig} from '@mm-redux/selectors/entities/general'; +import {getTeamByName} from '@mm-redux/selectors/entities/teams'; +import {getCurrentUserId, getUser} from '@mm-redux/selectors/entities/users'; import {isArchivedChannel} from '@mm-redux/utils/channel_utils'; const getOtherUserIdForDm = createSelector( diff --git a/app/selectors/custom_status.ts b/app/selectors/custom_status.ts index ea842c48d..423d62e25 100644 --- a/app/selectors/custom_status.ts +++ b/app/selectors/custom_status.ts @@ -4,14 +4,13 @@ import moment from 'moment-timezone'; import {createSelector} from 'reselect'; -import {GlobalState} from '@mm-redux/types/store'; -import {CustomStatusDuration, UserCustomStatus} from '@mm-redux/types/users'; - import {Preferences} from '@mm-redux/constants'; import {getConfig} from '@mm-redux/selectors/entities/general'; import {get} from '@mm-redux/selectors/entities/preferences'; import {getCurrentUserTimezone} from '@mm-redux/selectors/entities/timezone'; import {getCurrentUser, getUser} from '@mm-redux/selectors/entities/users'; +import {GlobalState} from '@mm-redux/types/store'; +import {CustomStatusDuration, UserCustomStatus} from '@mm-redux/types/users'; import {isMinimumServerVersion} from '@mm-redux/utils/helpers'; import {getCurrentMomentForTimezone} from '@utils/timezone'; diff --git a/app/selectors/emojis.js b/app/selectors/emojis.js index 810e1f856..b1b070e7d 100644 --- a/app/selectors/emojis.js +++ b/app/selectors/emojis.js @@ -3,11 +3,11 @@ import {createSelector} from 'reselect'; +import {Preferences} from '@mm-redux/constants'; import {getCustomEmojisByName as selectCustomEmojisByName} from '@mm-redux/selectors/entities/emojis'; +import {get} from '@mm-redux/selectors/entities/preferences'; import {createIdsSelector} from '@mm-redux/utils/helpers'; import {CategoryNames, CategoryTranslations, Emojis, EmojiIndicesByAlias, EmojiIndicesByCategory, CategoryMessage} from '@utils/emojis'; -import {get} from '@mm-redux/selectors/entities/preferences'; -import {Preferences} from '@mm-redux/constants'; const icons = { recent: 'clock-outline', diff --git a/app/selectors/post_list.js b/app/selectors/post_list.js index f1527df97..a39f8310f 100644 --- a/app/selectors/post_list.js +++ b/app/selectors/post_list.js @@ -5,7 +5,6 @@ import {Posts} from '@mm-redux/constants'; import {makeGetPostsForIds} from '@mm-redux/selectors/entities/posts'; import {getCurrentUser} from '@mm-redux/selectors/entities/users'; import {createIdsSelector} from '@mm-redux/utils/helpers'; - import {DATE_LINE} from '@mm-redux/utils/post_list'; export {DATE_LINE}; diff --git a/app/selectors/post_list.test.js b/app/selectors/post_list.test.js index f01e27c2a..579439915 100644 --- a/app/selectors/post_list.test.js +++ b/app/selectors/post_list.test.js @@ -3,7 +3,7 @@ import assert from 'assert'; -import {makePreparePostIdsForSearchPosts} from 'app/selectors/post_list'; +import {makePreparePostIdsForSearchPosts} from '@selectors/post_list'; describe('makePreparePostIdsForSearchPosts', () => { it('should return an empty array if there are no posts specified', () => { diff --git a/app/store/ephemeral_store.js b/app/store/ephemeral_store.js index 22d7fecb2..50e20c02f 100644 --- a/app/store/ephemeral_store.js +++ b/app/store/ephemeral_store.js @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {ViewTypes} from 'app/constants'; +import {ViewTypes} from '@constants'; class EphemeralStore { constructor() { diff --git a/app/store/helpers.ts b/app/store/helpers.ts index 8c8e40905..826f4e998 100644 --- a/app/store/helpers.ts +++ b/app/store/helpers.ts @@ -2,6 +2,7 @@ // See LICENSE.txt for license information. import AsyncStorage from '@react-native-community/async-storage'; + import {combineReducers} from 'redux'; import {enableBatching, Reducer} from '@mm-redux/types/actions'; diff --git a/app/store/index.ts b/app/store/index.ts index 5e197b0c8..a4551ac3e 100644 --- a/app/store/index.ts +++ b/app/store/index.ts @@ -2,17 +2,18 @@ // See LICENSE.txt for license information. import AsyncStorage from '@react-native-community/async-storage'; + +import DeviceInfo from 'react-native-device-info'; import * as redux from 'redux'; import {createPersistoid, createTransform, persistReducer, persistStore, Persistor, PersistConfig} from 'redux-persist'; import {createBlacklistFilter} from 'redux-persist-transform-filter'; -import DeviceInfo from 'react-native-device-info'; import {General} from '@mm-redux/constants'; import serviceReducer from '@mm-redux/reducers'; import {GenericAction} from '@mm-redux/types/actions'; import {GlobalState} from '@mm-redux/types/store'; - import initialState from '@store/initial_state'; + import appReducer from 'app/reducers'; import {createReducer, getStoredState} from './helpers'; diff --git a/app/store/middlewares/index.ts b/app/store/middlewares/index.ts index 5b74a1186..c872909d3 100644 --- a/app/store/middlewares/index.ts +++ b/app/store/middlewares/index.ts @@ -2,9 +2,9 @@ // See LICENSE.txt for license information. import {Platform} from 'react-native'; +import createActionBuffer from 'redux-action-buffer'; import {PERSIST, REHYDRATE} from 'redux-persist'; import {ThunkMiddleware} from 'redux-thunk'; -import createActionBuffer from 'redux-action-buffer'; import messageRetention from './message_retention'; import createSentryMiddleware from './sentry'; diff --git a/app/store/middlewares/ios_extension.js b/app/store/middlewares/ios_extension.js index f7aa925c2..a1c35e544 100644 --- a/app/store/middlewares/ios_extension.js +++ b/app/store/middlewares/ios_extension.js @@ -1,9 +1,10 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import mattermostBucket from 'app/mattermost_bucket'; import {throttle} from '@utils/general'; +import mattermostBucket from 'app/mattermost_bucket'; + const SAVE_STATE_ACTIONS = [ 'CONNECTION_CHANGED', 'DATA_CLEANUP', diff --git a/app/store/middlewares/middleware.test.js b/app/store/middlewares/middleware.test.js index e109a3942..3f19ebdec 100644 --- a/app/store/middlewares/middleware.test.js +++ b/app/store/middlewares/middleware.test.js @@ -3,14 +3,15 @@ /* eslint-disable max-nested-callbacks */ -import DeviceInfo from 'react-native-device-info'; - import assert from 'assert'; -import {REHYDRATE} from 'redux-persist'; + import merge from 'deepmerge'; +import DeviceInfo from 'react-native-device-info'; +import {REHYDRATE} from 'redux-persist'; import {ViewTypes} from '@constants'; import initialState from '@store/initial_state'; + import { cleanUpPostsInChannel, cleanUpState, diff --git a/app/store/middlewares/thunk.js b/app/store/middlewares/thunk.js index 25a132aa9..7e3c85737 100644 --- a/app/store/middlewares/thunk.js +++ b/app/store/middlewares/thunk.js @@ -5,7 +5,7 @@ import { captureMessage, cleanUrlForLogging, LOGGER_JAVASCRIPT_WARNING, -} from 'app/utils/sentry'; +} from '@utils/sentry'; // Creates middleware that mimics thunk while catching network errors thrown by Client4 that haven't // been otherwise handled. diff --git a/app/utils/apps.test.ts b/app/utils/apps.test.ts index cab90bb79..57f7bd5bf 100644 --- a/app/utils/apps.test.ts +++ b/app/utils/apps.test.ts @@ -2,6 +2,7 @@ // See LICENSE.txt for license information. import {AppBinding, AppCall} from '@mm-redux/types/apps'; + import {fillAndTrimBindingsInformation} from './apps'; describe('Apps Utils', () => { diff --git a/app/utils/apps.ts b/app/utils/apps.ts index cb3ba6749..65beda98c 100644 --- a/app/utils/apps.ts +++ b/app/utils/apps.ts @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. import {AppBindingLocations, AppCallResponseTypes} from '@mm-redux/constants/apps'; -import {AppBinding, AppCall, AppCallRequest, AppCallValues, AppContext, AppExpand} from '@mm-redux/types/apps'; import {getConfig} from '@mm-redux/selectors/entities/general'; +import {AppBinding, AppCall, AppCallRequest, AppCallValues, AppContext, AppExpand} from '@mm-redux/types/apps'; import {Config} from '@mm-redux/types/config'; import {GlobalState} from '@mm-redux/types/store'; diff --git a/app/utils/bottom_sheet/bottom_sheet.android.js b/app/utils/bottom_sheet/bottom_sheet.android.js index 2a1548527..e77016f31 100644 --- a/app/utils/bottom_sheet/bottom_sheet.android.js +++ b/app/utils/bottom_sheet/bottom_sheet.android.js @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {showModalOverCurrentContext} from 'app/actions/navigation'; +import {showModalOverCurrentContext} from '@actions/navigation'; export default { showBottomSheetWithOptions: (options, callback) => { diff --git a/app/utils/channels.js b/app/utils/channels.js index 03a2144b7..aebea0a6d 100644 --- a/app/utils/channels.js +++ b/app/utils/channels.js @@ -1,6 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. import {Alert} from 'react-native'; + import {Preferences} from '@mm-redux/constants'; import {getUserIdFromChannelName} from '@mm-redux/utils/channel_utils'; import {getLastCreateAt} from '@mm-redux/utils/post_utils'; diff --git a/app/utils/error_handling.js b/app/utils/error_handling.js index 7356fc0f1..78ceca509 100644 --- a/app/utils/error_handling.js +++ b/app/utils/error_handling.js @@ -7,8 +7,8 @@ import {setJSExceptionHandler, setNativeExceptionHandler} from 'react-native-exc import {dismissAllModals} from '@actions/navigation'; import {purgeOfflineStore} from '@actions/views/root'; import {close as closeWebSocket} from '@actions/websocket'; -import {DEFAULT_LOCALE, getTranslations} from '@i18n'; import {Client4} from '@client/rest'; +import {DEFAULT_LOCALE, getTranslations} from '@i18n'; import {logError} from '@mm-redux/actions/errors'; import {t} from '@utils/i18n'; import { diff --git a/app/utils/file.js b/app/utils/file.js index 77b5998be..8dcb3ac9d 100644 --- a/app/utils/file.js +++ b/app/utils/file.js @@ -1,9 +1,9 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import mimeDB from 'mime-db'; import {Platform} from 'react-native'; import RNFetchBlob from 'rn-fetch-blob'; -import mimeDB from 'mime-db'; import {DeviceTypes} from '@constants'; diff --git a/app/utils/file.test.js b/app/utils/file.test.js index ff3294fe8..3eb6fbf3c 100644 --- a/app/utils/file.test.js +++ b/app/utils/file.test.js @@ -1,15 +1,14 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import {DeviceTypes} from '@constants'; import { generateId, getLocalPath, getLocalFilePathFromFile, getExtensionFromContentDisposition, hashCode, -} from 'app/utils/file'; - -import {DeviceTypes} from 'app/constants'; +} from '@utils/file'; describe('getExtensionFromContentDisposition', () => { it('should return the extracted the extension', () => { diff --git a/app/utils/gallery.ts b/app/utils/gallery.ts index 22d75c711..97dd76207 100644 --- a/app/utils/gallery.ts +++ b/app/utils/gallery.ts @@ -2,13 +2,13 @@ // See LICENSE.txt for license information. import {Dimensions, Keyboard, Platform} from 'react-native'; +import {Options, SharedElementTransition, StackAnimationOptions, ViewAnimationOptions} from 'react-native-navigation'; import parseUrl from 'url-parse'; import {goToScreen} from '@actions/navigation'; import {FileInfo} from '@mm-redux/types/files'; import {generateId, isImage, lookupMimeType} from './file'; -import {Options, SharedElementTransition, StackAnimationOptions, ViewAnimationOptions} from 'react-native-navigation'; export function openGalleryAtIndex(index: number, files: FileInfo[]) { Keyboard.dismiss(); diff --git a/app/utils/general.js b/app/utils/general.js index b2fbce1de..b3194a3dd 100644 --- a/app/utils/general.js +++ b/app/utils/general.js @@ -4,8 +4,8 @@ import {Alert, Platform} from 'react-native'; import ReactNativeHapticFeedback from 'react-native-haptic-feedback'; -import {t} from '@utils/i18n'; import {Posts} from '@mm-redux/constants'; +import {t} from '@utils/i18n'; const INVALID_VERSIONS = ['1.29.0']; diff --git a/app/utils/image_cache_manager.js b/app/utils/image_cache_manager.js index 5cd1e6fc0..14ad62534 100644 --- a/app/utils/image_cache_manager.js +++ b/app/utils/image_cache_manager.js @@ -5,17 +5,16 @@ import {Platform} from 'react-native'; import RNFetchBlob from 'rn-fetch-blob'; - import Url from 'url-parse'; import {Client4} from '@client/rest'; - -import {DeviceTypes} from 'app/constants'; +import {DeviceTypes} from '@constants'; import { getExtensionFromMime, getExtensionFromContentDisposition, hashCode, -} from 'app/utils/file'; +} from '@utils/file'; + import mattermostBucket from 'app/mattermost_bucket'; const {IMAGES_PATH} = DeviceTypes; diff --git a/app/utils/image_cache_manager.test.js b/app/utils/image_cache_manager.test.js index 40f730774..0616603c0 100644 --- a/app/utils/image_cache_manager.test.js +++ b/app/utils/image_cache_manager.test.js @@ -5,9 +5,10 @@ import RNFetchBlob from 'rn-fetch-blob'; -import ImageCacheManager, {getCacheFile} from 'app/utils/image_cache_manager'; -import {emptyFunction} from 'app/utils/general'; -import * as fileUtils from 'app/utils/file'; +import * as fileUtils from '@utils/file'; +import {emptyFunction} from '@utils/general'; +import ImageCacheManager, {getCacheFile} from '@utils/image_cache_manager'; + import mattermostBucket from 'app/mattermost_bucket'; fileUtils.getExtensionFromMime = jest.fn(); diff --git a/app/utils/images.test.ts b/app/utils/images.test.ts index 385e3a6bd..211424e2b 100644 --- a/app/utils/images.test.ts +++ b/app/utils/images.test.ts @@ -1,11 +1,11 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {calculateDimensions, isGifTooLarge} from '@utils/images'; import { IMAGE_MAX_HEIGHT, IMAGE_MIN_DIMENSION, } from '@constants/image'; +import {calculateDimensions, isGifTooLarge} from '@utils/images'; const PORTRAIT_VIEWPORT = 315; diff --git a/app/utils/images.ts b/app/utils/images.ts index 4b03c890f..a14623724 100644 --- a/app/utils/images.ts +++ b/app/utils/images.ts @@ -11,7 +11,6 @@ import { VIEWPORT_IMAGE_OFFSET, VIEWPORT_IMAGE_REPLY_OFFSET, } from '@constants/image'; - import {PostImage} from '@mm-redux/types/posts'; export const calculateDimensions = (height: number, width: number, viewPortWidth = 0, viewPortHeight = 0) => { diff --git a/app/utils/markdown.js b/app/utils/markdown.js index 70c75b1c5..ee39113f7 100644 --- a/app/utils/markdown.js +++ b/app/utils/markdown.js @@ -2,7 +2,8 @@ // See LICENSE.txt for license information. import {Platform, StyleSheet} from 'react-native'; -import {changeOpacity, makeStyleSheetFromTheme} from 'app/utils/theme'; + +import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; export function getCodeFont() { return Platform.OS === 'ios' ? 'Menlo' : 'monospace'; diff --git a/app/utils/markdown.test.js b/app/utils/markdown.test.js index cafd4d72c..fb6ddb72b 100644 --- a/app/utils/markdown.test.js +++ b/app/utils/markdown.test.js @@ -2,6 +2,7 @@ // See LICENSE.txt for license information. import {Platform} from 'react-native'; + import {switchKeyboardForCodeBlocks} from './markdown'; describe('switchKeyboardForCodeBlocks', () => { diff --git a/app/utils/member_list.js b/app/utils/member_list.js index 3595a3c7b..53e793e15 100644 --- a/app/utils/member_list.js +++ b/app/utils/member_list.js @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {t} from 'app/utils/i18n'; +import {t} from '@utils/i18n'; export const loadingText = { id: t('mobile.loading_members'), diff --git a/app/utils/network.js b/app/utils/network.js index 82c0ff5ff..59de744a8 100644 --- a/app/utils/network.js +++ b/app/utils/network.js @@ -1,14 +1,15 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {Platform} from 'react-native'; import NetInfo from '@react-native-community/netinfo'; + +import {Platform} from 'react-native'; import RNFetchBlob from 'rn-fetch-blob'; import {Client4} from '@client/rest'; +import mattermostManaged from '@mattermost-managed'; import mattermostBucket from 'app/mattermost_bucket'; -import mattermostManaged from 'app/mattermost_managed'; let certificate = ''; let previousState; diff --git a/app/utils/reaction.js b/app/utils/reaction.js index c7b0f560e..fdd713992 100644 --- a/app/utils/reaction.js +++ b/app/utils/reaction.js @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {ALL_EMOJIS} from 'app/constants/emoji'; +import {ALL_EMOJIS} from '@constants/emoji'; export function generateUserProfilesById(userProfiles = []) { return userProfiles.reduce((acc, userProfile) => { diff --git a/app/utils/reaction.test.js b/app/utils/reaction.test.js index 05876925e..a4cefe010 100644 --- a/app/utils/reaction.test.js +++ b/app/utils/reaction.test.js @@ -1,14 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import {ALL_EMOJIS} from '@constants/emoji'; import { getMissingUserIds, getReactionsByName, getSortedReactionsForHeader, getUniqueUserIds, -} from 'app/utils/reaction'; - -import {ALL_EMOJIS} from 'app/constants/emoji'; +} from '@utils/reaction'; describe('getMissingUserIds', () => { const testCases = [{ diff --git a/app/utils/security.js b/app/utils/security.js index 8a672fd9f..37908f407 100644 --- a/app/utils/security.js +++ b/app/utils/security.js @@ -1,9 +1,10 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {Client4} from '@client/rest'; import CookieManager from '@react-native-cookies/cookies'; +import {Client4} from '@client/rest'; + export function setCSRFFromCookie(url) { return new Promise((resolve) => { CookieManager.get(url, false).then((cookies) => { diff --git a/app/utils/sentry/index.js b/app/utils/sentry/index.js index de5967fd5..077dcb897 100644 --- a/app/utils/sentry/index.js +++ b/app/utils/sentry/index.js @@ -5,10 +5,10 @@ import {Platform} from 'react-native'; import Config from '@assets/config'; import {Client4} from '@client/rest'; -import {getConfig} from '@mm-redux/selectors/entities/general'; -import {getCurrentUser} from '@mm-redux/selectors/entities/users'; -import {getCurrentTeam, getCurrentTeamMembership} from '@mm-redux/selectors/entities/teams'; import {getCurrentChannel, getMyCurrentChannelMembership} from '@mm-redux/selectors/entities/channels'; +import {getConfig} from '@mm-redux/selectors/entities/general'; +import {getCurrentTeam, getCurrentTeamMembership} from '@mm-redux/selectors/entities/teams'; +import {getCurrentUser} from '@mm-redux/selectors/entities/users'; export const LOGGER_EXTENSION = 'extension'; export const LOGGER_JAVASCRIPT = 'javascript'; diff --git a/app/utils/sentry/index.test.js b/app/utils/sentry/index.test.js index 8bc99cd5d..647296802 100644 --- a/app/utils/sentry/index.test.js +++ b/app/utils/sentry/index.test.js @@ -2,8 +2,7 @@ // See LICENSE.txt for license information. import {Client4} from '@client/rest'; - -import {cleanUrlForLogging} from 'app/utils/sentry'; +import {cleanUrlForLogging} from '@utils/sentry'; /* eslint-disable max-nested-callbacks */ diff --git a/app/utils/status.js b/app/utils/status.js index 89f211c29..e292590fa 100644 --- a/app/utils/status.js +++ b/app/utils/status.js @@ -4,8 +4,9 @@ import { Alert, } from 'react-native'; -import {toTitleCase} from 'app/utils/general'; -import {t} from 'app/utils/i18n'; + +import {toTitleCase} from '@utils/general'; +import {t} from '@utils/i18n'; export function confirmOutOfOfficeDisabled(intl, status, updateStatus) { const userStatusId = 'modal.manual_status.auto_responder.message_' + status; diff --git a/app/utils/supported_server.ts b/app/utils/supported_server.ts index 6b563571a..a8de21328 100644 --- a/app/utils/supported_server.ts +++ b/app/utils/supported_server.ts @@ -2,6 +2,7 @@ // See LICENSE.txt for license information. import {Alert, AlertButton} from 'react-native'; + import {ViewTypes} from '@constants'; import {tryOpenURL} from '@utils/url'; diff --git a/app/utils/teams.test.js b/app/utils/teams.test.js index 51b92f8e5..5e72a4801 100644 --- a/app/utils/teams.test.js +++ b/app/utils/teams.test.js @@ -2,8 +2,7 @@ // See LICENSE.txt for license information. import {General} from '@mm-redux/constants'; - -import {selectFirstAvailableTeam} from 'app/utils/teams'; +import {selectFirstAvailableTeam} from '@utils/teams'; describe('selectFirstAvailableTeam', () => { const myTeams = [{ diff --git a/app/utils/theme.js b/app/utils/theme.js index eb1a24cd5..0c90f46a4 100644 --- a/app/utils/theme.js +++ b/app/utils/theme.js @@ -4,10 +4,9 @@ import {StyleSheet} from 'react-native'; import tinyColor from 'tinycolor2'; +import {mergeNavigationOptions} from '@actions/navigation'; import * as ThemeUtils from '@mm-redux/utils/theme_utils'; -import {mergeNavigationOptions} from 'app/actions/navigation'; - const MODAL_SCREENS_WITHOUT_BACK = [ 'AddReaction', 'ChannelInfo', diff --git a/app/utils/theme.test.js b/app/utils/theme.test.js index b6ae57c24..6bc9f6808 100644 --- a/app/utils/theme.test.js +++ b/app/utils/theme.test.js @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {getKeyboardAppearanceFromTheme} from 'app/utils/theme'; +import {getKeyboardAppearanceFromTheme} from '@utils/theme'; describe('getKeyboardAppearanceFromTheme', () => { const themes = [{ diff --git a/app/utils/timezone.js b/app/utils/timezone.js index 5bb05327d..f38ec5d73 100644 --- a/app/utils/timezone.js +++ b/app/utils/timezone.js @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {getTimeZone} from 'react-native-localize'; import moment from 'moment-timezone'; +import {getTimeZone} from 'react-native-localize'; export function getDeviceTimezone() { return getTimeZone(); diff --git a/app/utils/url.js b/app/utils/url.js index 918a1d92a..f331420eb 100644 --- a/app/utils/url.js +++ b/app/utils/url.js @@ -3,15 +3,14 @@ import {Linking} from 'react-native'; +import {DeepLinkTypes} from '@constants'; +import {getCurrentServerUrl} from '@init/credentials'; +import {Files} from '@mm-redux/constants'; +import {emptyErrorHandlingFunction, emptyFunction} from '@utils/general'; + import {latinise} from './latinise.js'; import {escapeRegex} from './markdown'; -import {Files} from '@mm-redux/constants'; -import {getCurrentServerUrl} from '@init/credentials'; - -import {DeepLinkTypes} from '@constants'; -import {emptyErrorHandlingFunction, emptyFunction} from '@utils/general'; - const ytRegex = /(?:http|https):\/\/(?:www\.|m\.)?(?:(?:youtube\.com\/(?:(?:v\/)|(?:(?:watch|embed\/watch)(?:\/|.*v=))|(?:embed\/)|(?:user\/[^/]+\/u\/[0-9]\/)))|(?:youtu\.be\/))([^#&?]*)/; export function isValidUrl(url = '') { diff --git a/app/utils/wrap_context_provider.js b/app/utils/wrap_context_provider.js index cea58cabb..ff62e27dc 100644 --- a/app/utils/wrap_context_provider.js +++ b/app/utils/wrap_context_provider.js @@ -2,7 +2,8 @@ // See LICENSE.txt for license information. import React from 'react'; -import IntlWrapper from 'app/components/root'; + +import IntlWrapper from '@components/root'; export function wrapWithContextProvider(Comp, excludeEvents = true) { return (props) => { //eslint-disable-line react/display-name diff --git a/babel.config.js b/babel.config.js index b973cd7f6..dc5efd06a 100644 --- a/babel.config.js +++ b/babel.config.js @@ -27,6 +27,8 @@ module.exports = { '@selectors': './app/selectors', '@store': './app/store', '@telemetry': './app/telemetry', + '@test': './test', + '@mm-types': './types', '@utils': './app/utils', '@websocket': './app/client/websocket', }, diff --git a/detox/e2e/path_builder.js b/detox/e2e/path_builder.js index 3e2050d7a..36d829019 100644 --- a/detox/e2e/path_builder.js +++ b/detox/e2e/path_builder.js @@ -2,6 +2,7 @@ // See LICENSE.txt for license information. const path = require('path'); + const sanitizeFilename = require('sanitize-filename'); const SANITIZE_OPTIONS = {replacement: '_'}; diff --git a/detox/e2e/support/server_api/common.js b/detox/e2e/support/server_api/common.js index 1b30d3c08..5c48fb6f9 100644 --- a/detox/e2e/support/server_api/common.js +++ b/detox/e2e/support/server_api/common.js @@ -1,9 +1,10 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import FormData from 'form-data'; import fs from 'fs'; +import FormData from 'form-data'; + import client from './client'; export const getResponseFromError = (err) => { diff --git a/detox/e2e/support/server_api/system.js b/detox/e2e/support/server_api/system.js index e3fbfc9c5..382c84681 100644 --- a/detox/e2e/support/server_api/system.js +++ b/detox/e2e/support/server_api/system.js @@ -1,9 +1,10 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import path from 'path'; + import merge from 'deepmerge'; import jestExpect from 'expect'; -import path from 'path'; import testConfig from '@support/test_config'; diff --git a/detox/e2e/support/server_api/team.js b/detox/e2e/support/server_api/team.js index 316102383..b35341446 100644 --- a/detox/e2e/support/server_api/team.js +++ b/detox/e2e/support/server_api/team.js @@ -2,6 +2,7 @@ // See LICENSE.txt for license information. import jestExpect from 'expect'; + import {capitalize, getRandomId} from '@support/utils'; import client from './client'; diff --git a/detox/e2e/support/ui/component/index.js b/detox/e2e/support/ui/component/index.js index ff969fe30..fe51e0de5 100644 --- a/detox/e2e/support/ui/component/index.js +++ b/detox/e2e/support/ui/component/index.js @@ -5,13 +5,12 @@ import Alert from './alert'; import Autocomplete from './autocomplete'; import BottomSheet from './bottom_sheet'; import CameraQuickAction from './camera_quick_action'; +import ChannelsList from './channels_list'; import DateTimePicker from './date_time_picker'; import EditChannelInfo from './edit_channel_info'; import FileQuickAction from './file_quick_action'; import ImageQuickAction from './image_quick_action'; import InputQuickAction from './input_quick_action'; -import ChannelsList from './channels_list'; -import TeamsList from './teams_list'; import MainSidebar from './main_sidebar'; import Post from './post'; import PostDraft from './post_draft'; @@ -22,6 +21,7 @@ import RecentItem from './recent_item'; import SearchBar from './search_bar'; import SendButton from './send_button'; import SettingsSidebar from './settings_sidebar'; +import TeamsList from './teams_list'; export { Alert, diff --git a/detox/e2e/support/ui/component/post_options.js b/detox/e2e/support/ui/component/post_options.js index 56c4d6b44..4c6e58e4f 100644 --- a/detox/e2e/support/ui/component/post_options.js +++ b/detox/e2e/support/ui/component/post_options.js @@ -1,9 +1,10 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import Alert from './alert'; import {isAndroid, timeouts, wait} from '@support/utils'; +import Alert from './alert'; + class PostOptions { testID = { reactionButtonPrefix: 'reaction_picker.reaction_button.', diff --git a/detox/e2e/support/ui/screen/index.js b/detox/e2e/support/ui/screen/index.js index fdbe2b188..bf0380b49 100644 --- a/detox/e2e/support/ui/screen/index.js +++ b/detox/e2e/support/ui/screen/index.js @@ -2,17 +2,17 @@ // See LICENSE.txt for license information. import AboutScreen from './about'; -import AdvancedSettingsScreen from './advanced_settings'; import AddReactionScreen from './add_reaction'; -import ChannelInfoScreen from './channel_info'; +import AdvancedSettingsScreen from './advanced_settings'; +import ChannelScreen from './channel'; import ChannelAddMembersScreen from './channel_add_members'; +import ChannelInfoScreen from './channel_info'; import ChannelMembersScreen from './channel_members'; import ChannelNotificationPreferenceScreen from './channel_notification_preference'; -import ChannelScreen from './channel'; -import ClearAfterScreen from './custom_status_clear_after'; import ClockDisplaySettingsScreen from './clock_display_settings'; import CreateChannelScreen from './create_channel'; import CustomStatusScreen from './custom_status'; +import ClearAfterScreen from './custom_status_clear_after'; import DisplaySettingsScreen from './display_settings'; import EditChannelScreen from './edit_channel'; import EditPostScreen from './edit_post'; @@ -22,16 +22,16 @@ import LoginScreen from './login'; import MoreChannelsScreen from './more_channels'; import MoreDirectMessagesScreen from './more_direct_messages'; import NotificationScreen from './notification'; +import NotificationSettingsScreen from './notification_settings'; import NotificationSettingsEmailScreen from './notification_settings_email'; import NotificationSettingsMobileScreen from './notification_settings_mobile'; -import NotificationSettingsScreen from './notification_settings'; import PermalinkScreen from './permalink'; import PinnedMessagesScreen from './pinned_messages'; import ReactionListScreen from './reaction_list'; import RecentMentionsScreen from './recent_mentions'; import SavedMessagesScreen from './saved_messages'; -import SearchResultPostScreen from './search_result_post'; import SearchScreen from './search'; +import SearchResultPostScreen from './search_result_post'; import SelectServerScreen from './select_server'; import SelectTeamScreen from './select_team'; import TableScreen from './table'; diff --git a/detox/e2e/support/utils/email.js b/detox/e2e/support/utils/email.js index 6d54b5daa..db5858337 100644 --- a/detox/e2e/support/utils/email.js +++ b/detox/e2e/support/utils/email.js @@ -3,6 +3,7 @@ import axios from 'axios'; import jestExpect from 'expect'; + import testConfig from '@support/test_config'; /** diff --git a/detox/e2e/support/utils/index.js b/detox/e2e/support/utils/index.js index f6e402c48..6e5fedb1c 100644 --- a/detox/e2e/support/utils/index.js +++ b/detox/e2e/support/utils/index.js @@ -2,6 +2,7 @@ // See LICENSE.txt for license information. import {v4 as uuidv4} from 'uuid'; + import testConfig from '@support/test_config'; export * from './email'; diff --git a/detox/e2e/test/account_settings/advanced_settings.e2e.js b/detox/e2e/test/account_settings/advanced_settings.e2e.js index b4228620b..4a616244e 100644 --- a/detox/e2e/test/account_settings/advanced_settings.e2e.js +++ b/detox/e2e/test/account_settings/advanced_settings.e2e.js @@ -7,15 +7,15 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* +import { + Channel, + Setup, +} from '@support/server_api'; import { AdvancedSettingsScreen, ChannelScreen, GeneralSettingsScreen, } from '@support/ui/screen'; -import { - Channel, - Setup, -} from '@support/server_api'; describe('Advanced Settings', () => { let townSquareChannel; diff --git a/detox/e2e/test/account_settings/clock_display.e2e.js b/detox/e2e/test/account_settings/clock_display.e2e.js index 2779f50ef..c62a02f5d 100644 --- a/detox/e2e/test/account_settings/clock_display.e2e.js +++ b/detox/e2e/test/account_settings/clock_display.e2e.js @@ -9,12 +9,6 @@ import moment from 'moment-timezone'; -import { - ChannelScreen, - ClockDisplaySettingsScreen, - DisplaySettingsScreen, - GeneralSettingsScreen, -} from '@support/ui/screen'; import { Channel, Post, @@ -22,6 +16,12 @@ import { System, User, } from '@support/server_api'; +import { + ChannelScreen, + ClockDisplaySettingsScreen, + DisplaySettingsScreen, + GeneralSettingsScreen, +} from '@support/ui/screen'; import {isAndroid, isIos} from '@support/utils'; describe('Clock Display', () => { diff --git a/detox/e2e/test/account_settings/language_settings.e2e.js b/detox/e2e/test/account_settings/language_settings.e2e.js index d6d8537d8..3bf268896 100644 --- a/detox/e2e/test/account_settings/language_settings.e2e.js +++ b/detox/e2e/test/account_settings/language_settings.e2e.js @@ -7,12 +7,12 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* -import {ChannelScreen} from '@support/ui/screen'; import { Channel, Setup, User, } from '@support/server_api'; +import {ChannelScreen} from '@support/ui/screen'; describe('Language Settings', () => { let testUser; diff --git a/detox/e2e/test/account_settings/user_profile.e2e.js b/detox/e2e/test/account_settings/user_profile.e2e.js index 1a40562a3..49e294d03 100644 --- a/detox/e2e/test/account_settings/user_profile.e2e.js +++ b/detox/e2e/test/account_settings/user_profile.e2e.js @@ -7,17 +7,17 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* -import { - ChannelScreen, - EditProfileScreen, - UserProfileScreen, -} from '@support/ui/screen'; import { Channel, Post, Setup, System, } from '@support/server_api'; +import { + ChannelScreen, + EditProfileScreen, + UserProfileScreen, +} from '@support/ui/screen'; describe('User Profile', () => { let testUser; diff --git a/detox/e2e/test/autocomplete/at_mention.e2e.js b/detox/e2e/test/autocomplete/at_mention.e2e.js index 3ef59c1b8..105701422 100644 --- a/detox/e2e/test/autocomplete/at_mention.e2e.js +++ b/detox/e2e/test/autocomplete/at_mention.e2e.js @@ -7,13 +7,13 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* -import {Autocomplete} from '@support/ui/component'; -import {ChannelScreen} from '@support/ui/screen'; import { Setup, Team, User, } from '@support/server_api'; +import {Autocomplete} from '@support/ui/component'; +import {ChannelScreen} from '@support/ui/screen'; describe('Autocomplete', () => { const {postInput} = ChannelScreen; diff --git a/detox/e2e/test/autocomplete/autocomplete.e2e.js b/detox/e2e/test/autocomplete/autocomplete.e2e.js index 0594e1db4..af4f02635 100644 --- a/detox/e2e/test/autocomplete/autocomplete.e2e.js +++ b/detox/e2e/test/autocomplete/autocomplete.e2e.js @@ -7,12 +7,6 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* -import {Autocomplete} from '@support/ui/component'; -import { - ChannelScreen, - SearchScreen, - ThreadScreen, -} from '@support/ui/screen'; import { Channel, Post, @@ -20,6 +14,12 @@ import { Team, User, } from '@support/server_api'; +import {Autocomplete} from '@support/ui/component'; +import { + ChannelScreen, + SearchScreen, + ThreadScreen, +} from '@support/ui/screen'; describe('Autocomplete', () => { const { diff --git a/detox/e2e/test/autocomplete/edit_channel.e2e.js b/detox/e2e/test/autocomplete/edit_channel.e2e.js index 3cdf51ab0..3898d1011 100644 --- a/detox/e2e/test/autocomplete/edit_channel.e2e.js +++ b/detox/e2e/test/autocomplete/edit_channel.e2e.js @@ -7,13 +7,13 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* +import {Setup} from '@support/server_api'; import {Autocomplete} from '@support/ui/component'; import { ChannelScreen, ChannelInfoScreen, EditChannelScreen, } from '@support/ui/screen'; -import {Setup} from '@support/server_api'; describe('Autocomplete', () => { beforeAll(async () => { diff --git a/detox/e2e/test/autocomplete/edit_post.e2e.js b/detox/e2e/test/autocomplete/edit_post.e2e.js index 09d8b5079..3717f3255 100644 --- a/detox/e2e/test/autocomplete/edit_post.e2e.js +++ b/detox/e2e/test/autocomplete/edit_post.e2e.js @@ -7,16 +7,16 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* -import {Autocomplete} from '@support/ui/component'; -import { - ChannelScreen, - EditPostScreen, -} from '@support/ui/screen'; import { Channel, Post, Setup, } from '@support/server_api'; +import {Autocomplete} from '@support/ui/component'; +import { + ChannelScreen, + EditPostScreen, +} from '@support/ui/screen'; describe('Autocomplete', () => { let testChannel; diff --git a/detox/e2e/test/autocomplete/post_draft.e2e.js b/detox/e2e/test/autocomplete/post_draft.e2e.js index b2f2b8ebe..c590a0865 100644 --- a/detox/e2e/test/autocomplete/post_draft.e2e.js +++ b/detox/e2e/test/autocomplete/post_draft.e2e.js @@ -7,9 +7,9 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* +import {Setup} from '@support/server_api'; import {Autocomplete} from '@support/ui/component'; import {ChannelScreen} from '@support/ui/screen'; -import {Setup} from '@support/server_api'; describe('Autocomplete', () => { const {postInput} = ChannelScreen; diff --git a/detox/e2e/test/autocomplete/search.e2e.js b/detox/e2e/test/autocomplete/search.e2e.js index 3d9c81c31..c136deaad 100644 --- a/detox/e2e/test/autocomplete/search.e2e.js +++ b/detox/e2e/test/autocomplete/search.e2e.js @@ -7,12 +7,12 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* +import {Setup} from '@support/server_api'; import {Autocomplete} from '@support/ui/component'; import { ChannelScreen, SearchScreen, } from '@support/ui/screen'; -import {Setup} from '@support/server_api'; describe('Autocomplete', () => { const { diff --git a/detox/e2e/test/bot_account/bot_account.e2e.js b/detox/e2e/test/bot_account/bot_account.e2e.js index 89ef627dc..45d9b88e6 100644 --- a/detox/e2e/test/bot_account/bot_account.e2e.js +++ b/detox/e2e/test/bot_account/bot_account.e2e.js @@ -7,16 +7,16 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* -import { - ChannelScreen, - MoreDirectMessagesScreen, - UserProfileScreen, -} from '@support/ui/screen'; import { Bot, Setup, Team, } from '@support/server_api'; +import { + ChannelScreen, + MoreDirectMessagesScreen, + UserProfileScreen, +} from '@support/ui/screen'; describe('Bot Account', () => { const { diff --git a/detox/e2e/test/channel_moderation/remove_user_from_channel.e2e.js b/detox/e2e/test/channel_moderation/remove_user_from_channel.e2e.js index f4171cc92..dfb7ae100 100644 --- a/detox/e2e/test/channel_moderation/remove_user_from_channel.e2e.js +++ b/detox/e2e/test/channel_moderation/remove_user_from_channel.e2e.js @@ -7,6 +7,12 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* +import { + Channel, + Setup, + Team, + User, +} from '@support/server_api'; import { Alert, MainSidebar, @@ -16,12 +22,6 @@ import { ChannelMembersScreen, ChannelScreen, } from '@support/ui/screen'; -import { - Channel, - Setup, - Team, - User, -} from '@support/server_api'; import {isAndroid, timeouts} from '@support/utils'; describe('Channel Moderation', () => { diff --git a/detox/e2e/test/channel_settings/channel_add_members.e2e.js b/detox/e2e/test/channel_settings/channel_add_members.e2e.js index d62b38b59..7a1175991 100644 --- a/detox/e2e/test/channel_settings/channel_add_members.e2e.js +++ b/detox/e2e/test/channel_settings/channel_add_members.e2e.js @@ -7,16 +7,16 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* -import { - ChannelAddMembersScreen, - ChannelInfoScreen, - ChannelScreen, -} from '@support/ui/screen'; import { Setup, Team, User, } from '@support/server_api'; +import { + ChannelAddMembersScreen, + ChannelInfoScreen, + ChannelScreen, +} from '@support/ui/screen'; describe('Channel Add Members', () => { const { diff --git a/detox/e2e/test/channel_settings/channel_info.e2e.js b/detox/e2e/test/channel_settings/channel_info.e2e.js index dbd6b43e0..ffdabf4a9 100644 --- a/detox/e2e/test/channel_settings/channel_info.e2e.js +++ b/detox/e2e/test/channel_settings/channel_info.e2e.js @@ -7,6 +7,10 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* +import { + Channel, + Setup, +} from '@support/server_api'; import {BottomSheet} from '@support/ui/component'; import { ChannelInfoScreen, @@ -14,10 +18,6 @@ import { EditChannelScreen, MoreDirectMessagesScreen, } from '@support/ui/screen'; -import { - Channel, - Setup, -} from '@support/server_api'; import {isIos, timeouts, wait} from '@support/utils'; describe('Channel Info', () => { diff --git a/detox/e2e/test/channel_settings/channel_view_members.e2e.js b/detox/e2e/test/channel_settings/channel_view_members.e2e.js index 672402ef9..bbbbe02d1 100644 --- a/detox/e2e/test/channel_settings/channel_view_members.e2e.js +++ b/detox/e2e/test/channel_settings/channel_view_members.e2e.js @@ -7,17 +7,17 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* +import { + Setup, + Team, + User, +} from '@support/server_api'; import { ChannelInfoScreen, ChannelMembersScreen, ChannelScreen, MoreDirectMessagesScreen, } from '@support/ui/screen'; -import { - Setup, - Team, - User, -} from '@support/server_api'; import {getRandomId} from '@support/utils'; describe('Channel View Members', () => { diff --git a/detox/e2e/test/channels/archived_channels.e2e.js b/detox/e2e/test/channels/archived_channels.e2e.js index ad2bc0bc2..b1c93342d 100644 --- a/detox/e2e/test/channels/archived_channels.e2e.js +++ b/detox/e2e/test/channels/archived_channels.e2e.js @@ -7,11 +7,6 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* -import { - ChannelScreen, - ChannelInfoScreen, - MoreChannelsScreen, -} from '@support/ui/screen'; import { Channel, Post, @@ -20,6 +15,11 @@ import { Team, User, } from '@support/server_api'; +import { + ChannelScreen, + ChannelInfoScreen, + MoreChannelsScreen, +} from '@support/ui/screen'; describe('Archived Channels', () => { const { diff --git a/detox/e2e/test/channels/channels_list.e2e.js b/detox/e2e/test/channels/channels_list.e2e.js index 58389704a..035bdf1a0 100644 --- a/detox/e2e/test/channels/channels_list.e2e.js +++ b/detox/e2e/test/channels/channels_list.e2e.js @@ -7,12 +7,6 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* -import {MainSidebar} from '@support/ui/component'; -import { - ChannelScreen, - MoreChannelsScreen, - MoreDirectMessagesScreen, -} from '@support/ui/screen'; import { Channel, Post, @@ -21,6 +15,12 @@ import { Team, User, } from '@support/server_api'; +import {MainSidebar} from '@support/ui/component'; +import { + ChannelScreen, + MoreChannelsScreen, + MoreDirectMessagesScreen, +} from '@support/ui/screen'; import {getRandomId} from '@support/utils'; describe('Channels List', () => { diff --git a/detox/e2e/test/channels/create_public_channel.e2e.js b/detox/e2e/test/channels/create_public_channel.e2e.js index 65fd1b765..c626bba58 100644 --- a/detox/e2e/test/channels/create_public_channel.e2e.js +++ b/detox/e2e/test/channels/create_public_channel.e2e.js @@ -9,13 +9,13 @@ import jestExpect from 'expect'; +import {Setup} from '@support/server_api'; import { ChannelScreen, ChannelInfoScreen, CreateChannelScreen, MoreChannelsScreen, } from '@support/ui/screen'; -import {Setup} from '@support/server_api'; import {isAndroid} from '@support/utils'; describe('Channels', () => { diff --git a/detox/e2e/test/channels/direct_messages.e2e.js b/detox/e2e/test/channels/direct_messages.e2e.js index 5d636b739..61fc0dde6 100644 --- a/detox/e2e/test/channels/direct_messages.e2e.js +++ b/detox/e2e/test/channels/direct_messages.e2e.js @@ -7,18 +7,18 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* -import {MainSidebar} from '@support/ui/component'; -import { - ChannelInfoScreen, - ChannelScreen, - MoreDirectMessagesScreen, -} from '@support/ui/screen'; import { Preference, Setup, Team, User, } from '@support/server_api'; +import {MainSidebar} from '@support/ui/component'; +import { + ChannelInfoScreen, + ChannelScreen, + MoreDirectMessagesScreen, +} from '@support/ui/screen'; describe('Direct Messages', () => { const { diff --git a/detox/e2e/test/channels/favorite_channels.e2e.js b/detox/e2e/test/channels/favorite_channels.e2e.js index 7b54f15ad..0f184dbc0 100644 --- a/detox/e2e/test/channels/favorite_channels.e2e.js +++ b/detox/e2e/test/channels/favorite_channels.e2e.js @@ -7,12 +7,12 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* +import {Setup} from '@support/server_api'; import {MainSidebar} from '@support/ui/component'; import { ChannelInfoScreen, ChannelScreen, } from '@support/ui/screen'; -import {Setup} from '@support/server_api'; describe('Favorite Channels', () => { let testChannel; diff --git a/detox/e2e/test/channels/group_messages.e2e.js b/detox/e2e/test/channels/group_messages.e2e.js index fb0110220..ddac6d94a 100644 --- a/detox/e2e/test/channels/group_messages.e2e.js +++ b/detox/e2e/test/channels/group_messages.e2e.js @@ -7,15 +7,15 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* -import { - ChannelScreen, - MoreDirectMessagesScreen, -} from '@support/ui/screen'; import { Setup, Team, User, } from '@support/server_api'; +import { + ChannelScreen, + MoreDirectMessagesScreen, +} from '@support/ui/screen'; describe('Group Messages', () => { const {openMainSidebar} = ChannelScreen; diff --git a/detox/e2e/test/custom_statuses/custom_status.e2e.js b/detox/e2e/test/custom_statuses/custom_status.e2e.js index 287df0707..44cc55dd0 100644 --- a/detox/e2e/test/custom_statuses/custom_status.e2e.js +++ b/detox/e2e/test/custom_statuses/custom_status.e2e.js @@ -1,6 +1,12 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import { + Setup, + System, + Post, + Channel, +} from '@support/server_api'; import {SettingsSidebar} from '@support/ui/component'; import { AddReactionScreen, @@ -11,12 +17,6 @@ import { ThreadScreen, UserProfileScreen, } from '@support/ui/screen'; -import { - Setup, - System, - Post, - Channel, -} from '@support/server_api'; describe('Custom status', () => { const { diff --git a/detox/e2e/test/files_and_attachments/disable_upload.e2e.js b/detox/e2e/test/files_and_attachments/disable_upload.e2e.js index 98858461b..91804d493 100644 --- a/detox/e2e/test/files_and_attachments/disable_upload.e2e.js +++ b/detox/e2e/test/files_and_attachments/disable_upload.e2e.js @@ -7,11 +7,11 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* -import {ChannelScreen} from '@support/ui/screen'; import { Setup, System, } from '@support/server_api'; +import {ChannelScreen} from '@support/ui/screen'; describe('Disable Upload', () => { beforeAll(async () => { diff --git a/detox/e2e/test/files_and_attachments/enable_upload.e2e.js b/detox/e2e/test/files_and_attachments/enable_upload.e2e.js index 625743d82..176f06be9 100644 --- a/detox/e2e/test/files_and_attachments/enable_upload.e2e.js +++ b/detox/e2e/test/files_and_attachments/enable_upload.e2e.js @@ -7,11 +7,11 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* -import {ChannelScreen} from '@support/ui/screen'; import { Setup, System, } from '@support/server_api'; +import {ChannelScreen} from '@support/ui/screen'; describe('Enable Upload', () => { beforeAll(async () => { diff --git a/detox/e2e/test/guest_account/guest_experience.e2e.js b/detox/e2e/test/guest_account/guest_experience.e2e.js index 2f6879333..874da743b 100644 --- a/detox/e2e/test/guest_account/guest_experience.e2e.js +++ b/detox/e2e/test/guest_account/guest_experience.e2e.js @@ -7,17 +7,17 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* -import {Autocomplete} from '@support/ui/component'; -import { - ChannelScreen, - SearchScreen, -} from '@support/ui/screen'; import { Channel, Post, Setup, User, } from '@support/server_api'; +import {Autocomplete} from '@support/ui/component'; +import { + ChannelScreen, + SearchScreen, +} from '@support/ui/screen'; describe('Guest Experience', () => { let testChannel; diff --git a/detox/e2e/test/main_sidebar/main_sidebar.e2e.js b/detox/e2e/test/main_sidebar/main_sidebar.e2e.js index 2d93a6da4..fca386d10 100644 --- a/detox/e2e/test/main_sidebar/main_sidebar.e2e.js +++ b/detox/e2e/test/main_sidebar/main_sidebar.e2e.js @@ -7,12 +7,12 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* -import {MainSidebar} from '@support/ui/component'; -import {ChannelScreen} from '@support/ui/screen'; import { Setup, Team, } from '@support/server_api'; +import {MainSidebar} from '@support/ui/component'; +import {ChannelScreen} from '@support/ui/screen'; describe('Main Sidebar', () => { const { diff --git a/detox/e2e/test/messaging/at_mention.e2e.js b/detox/e2e/test/messaging/at_mention.e2e.js index 18158909c..0ae83d745 100644 --- a/detox/e2e/test/messaging/at_mention.e2e.js +++ b/detox/e2e/test/messaging/at_mention.e2e.js @@ -7,8 +7,6 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* -import {Alert} from '@support/ui/component'; -import {ChannelScreen} from '@support/ui/screen'; import { Channel, Post, @@ -16,6 +14,8 @@ import { Team, User, } from '@support/server_api'; +import {Alert} from '@support/ui/component'; +import {ChannelScreen} from '@support/ui/screen'; describe('At Mention', () => { const { diff --git a/detox/e2e/test/messaging/channel_link.e2e.js b/detox/e2e/test/messaging/channel_link.e2e.js index b7eb3e631..382cf65db 100644 --- a/detox/e2e/test/messaging/channel_link.e2e.js +++ b/detox/e2e/test/messaging/channel_link.e2e.js @@ -7,13 +7,13 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* -import {ChannelScreen} from '@support/ui/screen'; import { Channel, Post, Setup, } from '@support/server_api'; import testConfig from '@support/test_config'; +import {ChannelScreen} from '@support/ui/screen'; import {timeouts, wait} from '@support/utils'; describe('Channel Link', () => { diff --git a/detox/e2e/test/messaging/emojis_and_reactions.e2e.js b/detox/e2e/test/messaging/emojis_and_reactions.e2e.js index 5247202c1..d7748f6bc 100644 --- a/detox/e2e/test/messaging/emojis_and_reactions.e2e.js +++ b/detox/e2e/test/messaging/emojis_and_reactions.e2e.js @@ -7,17 +7,17 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* +import { + Channel, + Post, + Setup, +} from '@support/server_api'; import {PostOptions} from '@support/ui/component'; import { ChannelScreen, AddReactionScreen, ReactionListScreen, } from '@support/ui/screen'; -import { - Channel, - Post, - Setup, -} from '@support/server_api'; describe('Emojis and Reactions', () => { const { diff --git a/detox/e2e/test/messaging/hashtags.e2e.js b/detox/e2e/test/messaging/hashtags.e2e.js index d58834948..3381b7f53 100644 --- a/detox/e2e/test/messaging/hashtags.e2e.js +++ b/detox/e2e/test/messaging/hashtags.e2e.js @@ -7,17 +7,17 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* -import { - ChannelScreen, - PermalinkScreen, - SearchScreen, - ThreadScreen, -} from '@support/ui/screen'; import { Channel, Post, Setup, } from '@support/server_api'; +import { + ChannelScreen, + SearchScreen, + PermalinkScreen, + ThreadScreen, +} from '@support/ui/screen'; import {isIos} from '@support/utils'; describe('Hashtags', () => { diff --git a/detox/e2e/test/messaging/mark_as_read.e2e.js b/detox/e2e/test/messaging/mark_as_read.e2e.js index e43626079..3d9cca234 100644 --- a/detox/e2e/test/messaging/mark_as_read.e2e.js +++ b/detox/e2e/test/messaging/mark_as_read.e2e.js @@ -9,13 +9,13 @@ import jestExpect from 'expect'; -import {MainSidebar} from '@support/ui/component'; -import {ChannelScreen} from '@support/ui/screen'; import { Channel, Post, Setup, } from '@support/server_api'; +import {MainSidebar} from '@support/ui/component'; +import {ChannelScreen} from '@support/ui/screen'; describe('Mark As Read', () => { const { diff --git a/detox/e2e/test/messaging/mark_as_unread.e2e.js b/detox/e2e/test/messaging/mark_as_unread.e2e.js index 15825f14b..3c34fd5ce 100644 --- a/detox/e2e/test/messaging/mark_as_unread.e2e.js +++ b/detox/e2e/test/messaging/mark_as_unread.e2e.js @@ -7,11 +7,6 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* -import { - MainSidebar, - PostOptions, -} from '@support/ui/component'; -import {ChannelScreen} from '@support/ui/screen'; import { Channel, Post, @@ -19,6 +14,11 @@ import { Team, User, } from '@support/server_api'; +import { + MainSidebar, + PostOptions, +} from '@support/ui/component'; +import {ChannelScreen} from '@support/ui/screen'; describe('Mark as Unread', () => { const { diff --git a/detox/e2e/test/messaging/markdown_block_quote.e2e.js b/detox/e2e/test/messaging/markdown_block_quote.e2e.js index 4597f80ae..789a89047 100644 --- a/detox/e2e/test/messaging/markdown_block_quote.e2e.js +++ b/detox/e2e/test/messaging/markdown_block_quote.e2e.js @@ -7,12 +7,12 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* -import {ChannelScreen} from '@support/ui/screen'; import { Channel, Post, Setup, } from '@support/server_api'; +import {ChannelScreen} from '@support/ui/screen'; describe('Markdown Block Quote', () => { let townSquareChannel; diff --git a/detox/e2e/test/messaging/markdown_separator.e2e.js b/detox/e2e/test/messaging/markdown_separator.e2e.js index bb96eb3b7..89e967232 100644 --- a/detox/e2e/test/messaging/markdown_separator.e2e.js +++ b/detox/e2e/test/messaging/markdown_separator.e2e.js @@ -7,12 +7,12 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* -import {ChannelScreen} from '@support/ui/screen'; import { Channel, Post, Setup, } from '@support/server_api'; +import {ChannelScreen} from '@support/ui/screen'; describe('Markdown Separator', () => { let townSquareChannel; diff --git a/detox/e2e/test/messaging/markdown_table.e2e.js b/detox/e2e/test/messaging/markdown_table.e2e.js index 6a1285397..01b48a355 100644 --- a/detox/e2e/test/messaging/markdown_table.e2e.js +++ b/detox/e2e/test/messaging/markdown_table.e2e.js @@ -7,15 +7,15 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* -import { - ChannelScreen, - TableScreen, -} from '@support/ui/screen'; import { Channel, Post, Setup, } from '@support/server_api'; +import { + ChannelScreen, + TableScreen, +} from '@support/ui/screen'; import {isIos} from '@support/utils'; describe('Markdown Table', () => { diff --git a/detox/e2e/test/messaging/message_deletion.e2e.js b/detox/e2e/test/messaging/message_deletion.e2e.js index f07b86a52..05f69dc26 100644 --- a/detox/e2e/test/messaging/message_deletion.e2e.js +++ b/detox/e2e/test/messaging/message_deletion.e2e.js @@ -7,12 +7,12 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* -import {ChannelScreen} from '@support/ui/screen'; import { Channel, Post, Setup, } from '@support/server_api'; +import {ChannelScreen} from '@support/ui/screen'; describe('Message Deletion', () => { const { diff --git a/detox/e2e/test/messaging/message_draft.e2e.js b/detox/e2e/test/messaging/message_draft.e2e.js index 081316b2c..62829c55d 100644 --- a/detox/e2e/test/messaging/message_draft.e2e.js +++ b/detox/e2e/test/messaging/message_draft.e2e.js @@ -7,9 +7,9 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* +import {Setup} from '@support/server_api'; import {Alert} from '@support/ui/component'; import {ChannelScreen} from '@support/ui/screen'; -import {Setup} from '@support/server_api'; describe('Message Draft', () => { const { diff --git a/detox/e2e/test/messaging/message_edit.e2e.js b/detox/e2e/test/messaging/message_edit.e2e.js index 67012f942..5186ff5ce 100644 --- a/detox/e2e/test/messaging/message_edit.e2e.js +++ b/detox/e2e/test/messaging/message_edit.e2e.js @@ -7,15 +7,15 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* -import { - ChannelScreen, - EditPostScreen, -} from '@support/ui/screen'; import { Channel, Post, Setup, } from '@support/server_api'; +import { + ChannelScreen, + EditPostScreen, +} from '@support/ui/screen'; describe('Message Edit', () => { const testMessage = Date.now().toString(); diff --git a/detox/e2e/test/messaging/message_posting.e2e.js b/detox/e2e/test/messaging/message_posting.e2e.js index dbe23c9c2..6760c541e 100644 --- a/detox/e2e/test/messaging/message_posting.e2e.js +++ b/detox/e2e/test/messaging/message_posting.e2e.js @@ -9,17 +9,17 @@ import moment from 'moment-timezone'; +import { + Channel, + Post, + Setup, +} from '@support/server_api'; import { MainSidebar, PostOptions, TeamsList, } from '@support/ui/component'; import {ChannelScreen} from '@support/ui/screen'; -import { - Channel, - Post, - Setup, -} from '@support/server_api'; import { getAdminAccount, isAndroid, diff --git a/detox/e2e/test/messaging/message_reply.e2e.js b/detox/e2e/test/messaging/message_reply.e2e.js index b9e32c608..668b12365 100644 --- a/detox/e2e/test/messaging/message_reply.e2e.js +++ b/detox/e2e/test/messaging/message_reply.e2e.js @@ -7,17 +7,17 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* +import { + Channel, + Post, + Setup, +} from '@support/server_api'; import {PostOptions} from '@support/ui/component'; import { AddReactionScreen, ChannelScreen, ThreadScreen, } from '@support/ui/screen'; -import { - Channel, - Post, - Setup, -} from '@support/server_api'; describe('Message Reply', () => { const { diff --git a/detox/e2e/test/messaging/permalink.e2e.js b/detox/e2e/test/messaging/permalink.e2e.js index fddebae53..327c1b34e 100644 --- a/detox/e2e/test/messaging/permalink.e2e.js +++ b/detox/e2e/test/messaging/permalink.e2e.js @@ -7,6 +7,12 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* +import { + Channel, + Post, + Setup, + User, +} from '@support/server_api'; import { ChannelScreen, PermalinkScreen, @@ -15,12 +21,6 @@ import { timeouts, wait, } from '@support/utils'; -import { - Channel, - Post, - Setup, - User, -} from '@support/server_api'; describe('Permalink', () => { let testUser; diff --git a/detox/e2e/test/messaging/pinned_messages.e2e.js b/detox/e2e/test/messaging/pinned_messages.e2e.js index 24ef7b3f3..fd7af29d5 100644 --- a/detox/e2e/test/messaging/pinned_messages.e2e.js +++ b/detox/e2e/test/messaging/pinned_messages.e2e.js @@ -7,6 +7,11 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* +import { + Channel, + Post, + Setup, +} from '@support/server_api'; import {PostOptions} from '@support/ui/component'; import { ChannelInfoScreen, @@ -16,11 +21,6 @@ import { PinnedMessagesScreen, ThreadScreen, } from '@support/ui/screen'; -import { - Channel, - Post, - Setup, -} from '@support/server_api'; describe('Pinned Messages', () => { const { diff --git a/detox/e2e/test/messaging/recent_mentions.e2e.js b/detox/e2e/test/messaging/recent_mentions.e2e.js index 987d48d35..2a39b50b1 100644 --- a/detox/e2e/test/messaging/recent_mentions.e2e.js +++ b/detox/e2e/test/messaging/recent_mentions.e2e.js @@ -7,11 +7,11 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* +import {Setup} from '@support/server_api'; import { ChannelScreen, RecentMentionsScreen, } from '@support/ui/screen'; -import {Setup} from '@support/server_api'; describe('Recent Mentions', () => { beforeAll(async () => { diff --git a/detox/e2e/test/messaging/saved_messages.e2e.js b/detox/e2e/test/messaging/saved_messages.e2e.js index 16b91934d..f6089b8b0 100644 --- a/detox/e2e/test/messaging/saved_messages.e2e.js +++ b/detox/e2e/test/messaging/saved_messages.e2e.js @@ -7,17 +7,17 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* -import {PostOptions} from '@support/ui/component'; -import { - ChannelScreen, - SavedMessagesScreen, -} from '@support/ui/screen'; import { Channel, Post, Setup, System, } from '@support/server_api'; +import {PostOptions} from '@support/ui/component'; +import { + ChannelScreen, + SavedMessagesScreen, +} from '@support/ui/screen'; describe('Saved Messages', () => { const { diff --git a/detox/e2e/test/messaging/scrolling.e2e.js b/detox/e2e/test/messaging/scrolling.e2e.js index 3fc328107..388896b4c 100644 --- a/detox/e2e/test/messaging/scrolling.e2e.js +++ b/detox/e2e/test/messaging/scrolling.e2e.js @@ -7,12 +7,12 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* -import {ChannelScreen} from '@support/ui/screen'; import { Channel, Post, Setup, } from '@support/server_api'; +import {ChannelScreen} from '@support/ui/screen'; describe('Scrolling', () => { let townSquareChannel; diff --git a/detox/e2e/test/messaging/tap_send_button_repeatedly.e2e.js b/detox/e2e/test/messaging/tap_send_button_repeatedly.e2e.js index d46093c68..9f693dfbd 100644 --- a/detox/e2e/test/messaging/tap_send_button_repeatedly.e2e.js +++ b/detox/e2e/test/messaging/tap_send_button_repeatedly.e2e.js @@ -9,8 +9,8 @@ import jestExpect from 'expect'; -import {ChannelScreen} from '@support/ui/screen'; import {Channel, Post, Setup} from '@support/server_api'; +import {ChannelScreen} from '@support/ui/screen'; describe('Messaging', () => { let team; diff --git a/detox/e2e/test/messaging/tapping_channel_url_link_joins_channel.e2e.js b/detox/e2e/test/messaging/tapping_channel_url_link_joins_channel.e2e.js index 36cc19119..0fa9f4ae6 100644 --- a/detox/e2e/test/messaging/tapping_channel_url_link_joins_channel.e2e.js +++ b/detox/e2e/test/messaging/tapping_channel_url_link_joins_channel.e2e.js @@ -7,16 +7,6 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* -import { - Alert, - MainSidebar, - TeamsList, -} from '@support/ui/component'; -import { - ChannelScreen, - CreateChannelScreen, - PermalinkScreen, -} from '@support/ui/screen'; import { Channel, Post, @@ -27,6 +17,16 @@ import { import { serverUrl, } from '@support/test_config'; +import { + Alert, + MainSidebar, + TeamsList, +} from '@support/ui/component'; +import { + ChannelScreen, + CreateChannelScreen, + PermalinkScreen, +} from '@support/ui/screen'; import { getAdminAccount, getRandomId, diff --git a/detox/e2e/test/notifications/channel_notification_default.e2e.js b/detox/e2e/test/notifications/channel_notification_default.e2e.js index 571576af8..599d7e52b 100644 --- a/detox/e2e/test/notifications/channel_notification_default.e2e.js +++ b/detox/e2e/test/notifications/channel_notification_default.e2e.js @@ -7,6 +7,7 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* +import {Setup} from '@support/server_api'; import { ChannelInfoScreen, ChannelNotificationPreferenceScreen, @@ -15,7 +16,6 @@ import { NotificationSettingsMobileScreen, NotificationSettingsScreen, } from '@support/ui/screen'; -import {Setup} from '@support/server_api'; import {isAndroid} from '@support/utils'; describe('Channel Notification Preference - Default', () => { diff --git a/detox/e2e/test/notifications/channel_notification_preference.e2e.js b/detox/e2e/test/notifications/channel_notification_preference.e2e.js index cd0c25376..8945d21c7 100644 --- a/detox/e2e/test/notifications/channel_notification_preference.e2e.js +++ b/detox/e2e/test/notifications/channel_notification_preference.e2e.js @@ -7,13 +7,13 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* +import {Setup} from '@support/server_api'; import { ChannelInfoScreen, ChannelNotificationPreferenceScreen, ChannelScreen, MoreDirectMessagesScreen, } from '@support/ui/screen'; -import {Setup} from '@support/server_api'; import {isAndroid} from '@support/utils'; describe('Channel Notification Preference', () => { diff --git a/detox/e2e/test/notifications/in_app_notification.e2e.js b/detox/e2e/test/notifications/in_app_notification.e2e.js index 0dc4bd0f4..04bb836d9 100644 --- a/detox/e2e/test/notifications/in_app_notification.e2e.js +++ b/detox/e2e/test/notifications/in_app_notification.e2e.js @@ -7,16 +7,16 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* -import { - AddReactionScreen, - ChannelScreen, - NotificationScreen, -} from '@support/ui/screen'; import { Channel, Post, Setup, } from '@support/server_api'; +import { + AddReactionScreen, + ChannelScreen, + NotificationScreen, +} from '@support/ui/screen'; import { isAndroid, timeouts, diff --git a/detox/e2e/test/notifications/mention_badges.e2e.js b/detox/e2e/test/notifications/mention_badges.e2e.js index 85fd39c5c..7a620591c 100644 --- a/detox/e2e/test/notifications/mention_badges.e2e.js +++ b/detox/e2e/test/notifications/mention_badges.e2e.js @@ -7,14 +7,14 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* -import {MainSidebar} from '@support/ui/component'; -import {ChannelScreen} from '@support/ui/screen'; import { Channel, Post, Team, User, } from '@support/server_api'; +import {MainSidebar} from '@support/ui/component'; +import {ChannelScreen} from '@support/ui/screen'; describe('Mention Badges', () => { const { diff --git a/detox/e2e/test/signin_authentication/select_server.e2e.js b/detox/e2e/test/signin_authentication/select_server.e2e.js index c6048bb3e..8ed9e7282 100644 --- a/detox/e2e/test/signin_authentication/select_server.e2e.js +++ b/detox/e2e/test/signin_authentication/select_server.e2e.js @@ -7,12 +7,12 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* +import {serverUrl} from '@support/test_config'; import {Alert} from '@support/ui/component'; import { LoginScreen, SelectServerScreen, } from '@support/ui/screen'; -import {serverUrl} from '@support/test_config'; import {timeouts} from '@support/utils'; describe('Select Server', () => { diff --git a/detox/e2e/test/smoke_test/about.e2e.js b/detox/e2e/test/smoke_test/about.e2e.js index 229337e63..9a3887414 100644 --- a/detox/e2e/test/smoke_test/about.e2e.js +++ b/detox/e2e/test/smoke_test/about.e2e.js @@ -7,12 +7,12 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* +import {Setup} from '@support/server_api'; import { AboutScreen, ChannelScreen, GeneralSettingsScreen, } from '@support/ui/screen'; -import {Setup} from '@support/server_api'; describe('About', () => { beforeAll(async () => { diff --git a/detox/e2e/test/smoke_test/add_reaction.e2e.js b/detox/e2e/test/smoke_test/add_reaction.e2e.js index aad850a89..fcfc27b7b 100644 --- a/detox/e2e/test/smoke_test/add_reaction.e2e.js +++ b/detox/e2e/test/smoke_test/add_reaction.e2e.js @@ -7,10 +7,6 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* -import { - AddReactionScreen, - ChannelScreen, -} from '@support/ui/screen'; import { Channel, Post, @@ -18,6 +14,10 @@ import { Team, User, } from '@support/server_api'; +import { + AddReactionScreen, + ChannelScreen, +} from '@support/ui/screen'; describe('Add Reaction', () => { let testChannel; diff --git a/detox/e2e/test/smoke_test/advanced_settings.e2e.js b/detox/e2e/test/smoke_test/advanced_settings.e2e.js index 8d080e802..ddc9aadbb 100644 --- a/detox/e2e/test/smoke_test/advanced_settings.e2e.js +++ b/detox/e2e/test/smoke_test/advanced_settings.e2e.js @@ -7,15 +7,15 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* +import { + Channel, + Setup, +} from '@support/server_api'; import { AdvancedSettingsScreen, ChannelScreen, GeneralSettingsScreen, } from '@support/ui/screen'; -import { - Channel, - Setup, -} from '@support/server_api'; describe('Advanced Settings', () => { let townSquareChannel; diff --git a/detox/e2e/test/smoke_test/channel_add_members.e2e.js b/detox/e2e/test/smoke_test/channel_add_members.e2e.js index aa9465e68..f21954bff 100644 --- a/detox/e2e/test/smoke_test/channel_add_members.e2e.js +++ b/detox/e2e/test/smoke_test/channel_add_members.e2e.js @@ -7,16 +7,16 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* -import { - ChannelAddMembersScreen, - ChannelInfoScreen, - ChannelScreen, -} from '@support/ui/screen'; import { Setup, Team, User, } from '@support/server_api'; +import { + ChannelAddMembersScreen, + ChannelInfoScreen, + ChannelScreen, +} from '@support/ui/screen'; describe('Channel Add Members', () => { const { diff --git a/detox/e2e/test/smoke_test/channel_manage_members.e2e.js b/detox/e2e/test/smoke_test/channel_manage_members.e2e.js index 880881a4c..5d53a0f16 100644 --- a/detox/e2e/test/smoke_test/channel_manage_members.e2e.js +++ b/detox/e2e/test/smoke_test/channel_manage_members.e2e.js @@ -7,17 +7,17 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* -import { - ChannelInfoScreen, - ChannelMembersScreen, - ChannelScreen, -} from '@support/ui/screen'; import { Channel, Setup, Team, User, } from '@support/server_api'; +import { + ChannelInfoScreen, + ChannelMembersScreen, + ChannelScreen, +} from '@support/ui/screen'; import {getRandomId} from '@support/utils'; describe('Channel Manage Members', () => { diff --git a/detox/e2e/test/smoke_test/channels.e2e.js b/detox/e2e/test/smoke_test/channels.e2e.js index 4cc881703..6ffdd1d8d 100644 --- a/detox/e2e/test/smoke_test/channels.e2e.js +++ b/detox/e2e/test/smoke_test/channels.e2e.js @@ -7,11 +7,6 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* -import {MainSidebar} from '@support/ui/component'; -import { - ChannelScreen, - MoreDirectMessagesScreen, -} from '@support/ui/screen'; import { Channel, Post, @@ -20,6 +15,11 @@ import { Team, User, } from '@support/server_api'; +import {MainSidebar} from '@support/ui/component'; +import { + ChannelScreen, + MoreDirectMessagesScreen, +} from '@support/ui/screen'; import {getRandomId} from '@support/utils'; describe('Channels', () => { diff --git a/detox/e2e/test/smoke_test/clock_display.e2e.js b/detox/e2e/test/smoke_test/clock_display.e2e.js index 3ea94d4e8..cb57c567f 100644 --- a/detox/e2e/test/smoke_test/clock_display.e2e.js +++ b/detox/e2e/test/smoke_test/clock_display.e2e.js @@ -9,12 +9,6 @@ import moment from 'moment-timezone'; -import { - ChannelScreen, - ClockDisplaySettingsScreen, - DisplaySettingsScreen, - GeneralSettingsScreen, -} from '@support/ui/screen'; import { Channel, Post, @@ -22,6 +16,12 @@ import { System, User, } from '@support/server_api'; +import { + ChannelScreen, + ClockDisplaySettingsScreen, + DisplaySettingsScreen, + GeneralSettingsScreen, +} from '@support/ui/screen'; import {isAndroid, isIos} from '@support/utils'; describe('Clock Display', () => { diff --git a/detox/e2e/test/smoke_test/direct_messages.e2e.js b/detox/e2e/test/smoke_test/direct_messages.e2e.js index 1ef33be31..e023769fa 100644 --- a/detox/e2e/test/smoke_test/direct_messages.e2e.js +++ b/detox/e2e/test/smoke_test/direct_messages.e2e.js @@ -7,6 +7,13 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* +import { + Channel, + Post, + Setup, + Team, + User, +} from '@support/server_api'; import {MainSidebar} from '@support/ui/component'; import { ChannelInfoScreen, @@ -15,13 +22,6 @@ import { ThreadScreen, UserProfileScreen, } from '@support/ui/screen'; -import { - Channel, - Post, - Setup, - Team, - User, -} from '@support/server_api'; import {getRandomId} from '@support/utils'; describe('Direct Messages', () => { diff --git a/detox/e2e/test/smoke_test/edit_channel.e2e.js b/detox/e2e/test/smoke_test/edit_channel.e2e.js index 2b6c37cc6..637dcc2f2 100644 --- a/detox/e2e/test/smoke_test/edit_channel.e2e.js +++ b/detox/e2e/test/smoke_test/edit_channel.e2e.js @@ -7,17 +7,17 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* +import { + Setup, + Team, + User, +} from '@support/server_api'; import { ChannelScreen, ChannelInfoScreen, EditChannelScreen, MoreDirectMessagesScreen, } from '@support/ui/screen'; -import { - Setup, - Team, - User, -} from '@support/server_api'; describe('Edit Channel', () => { const { diff --git a/detox/e2e/test/smoke_test/email_notifications.e2e.js b/detox/e2e/test/smoke_test/email_notifications.e2e.js index b3b32765e..3bd39e68c 100644 --- a/detox/e2e/test/smoke_test/email_notifications.e2e.js +++ b/detox/e2e/test/smoke_test/email_notifications.e2e.js @@ -9,12 +9,6 @@ import jestExpect from 'expect'; -import { - ChannelScreen, - GeneralSettingsScreen, - NotificationSettingsEmailScreen, - NotificationSettingsScreen, -} from '@support/ui/screen'; import { Channel, Post, @@ -24,6 +18,12 @@ import { Team, User, } from '@support/server_api'; +import { + ChannelScreen, + GeneralSettingsScreen, + NotificationSettingsEmailScreen, + NotificationSettingsScreen, +} from '@support/ui/screen'; import { capitalize, getMentionEmailTemplate, diff --git a/detox/e2e/test/smoke_test/favorite_channels.e2e.js b/detox/e2e/test/smoke_test/favorite_channels.e2e.js index dd9f54369..ad84ef69b 100644 --- a/detox/e2e/test/smoke_test/favorite_channels.e2e.js +++ b/detox/e2e/test/smoke_test/favorite_channels.e2e.js @@ -7,12 +7,12 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* +import {Setup} from '@support/server_api'; import {MainSidebar} from '@support/ui/component'; import { ChannelInfoScreen, ChannelScreen, } from '@support/ui/screen'; -import {Setup} from '@support/server_api'; describe('Favorite Channels', () => { const { diff --git a/detox/e2e/test/smoke_test/group_messages.e2e.js b/detox/e2e/test/smoke_test/group_messages.e2e.js index 31c567f8e..46935014d 100644 --- a/detox/e2e/test/smoke_test/group_messages.e2e.js +++ b/detox/e2e/test/smoke_test/group_messages.e2e.js @@ -7,16 +7,16 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* -import { - ChannelInfoScreen, - ChannelScreen, - MoreDirectMessagesScreen, -} from '@support/ui/screen'; import { User, Setup, Team, } from '@support/server_api'; +import { + ChannelInfoScreen, + ChannelScreen, + MoreDirectMessagesScreen, +} from '@support/ui/screen'; import {getRandomId} from '@support/utils'; describe('Group Messages', () => { diff --git a/detox/e2e/test/smoke_test/login_ldap.e2e.js b/detox/e2e/test/smoke_test/login_ldap.e2e.js index fe0f2df16..696949afa 100644 --- a/detox/e2e/test/smoke_test/login_ldap.e2e.js +++ b/detox/e2e/test/smoke_test/login_ldap.e2e.js @@ -7,9 +7,9 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* +import ldapUsers from '@support/fixtures/ldap_users.json'; import {Ldap, Setup, System, Team, User} from '@support/server_api'; import {ChannelScreen, LoginScreen} from '@support/ui/screen'; -import ldapUsers from '@support/fixtures/ldap_users.json'; describe('Smoke Tests', () => { const testOne = ldapUsers['test-1']; diff --git a/detox/e2e/test/smoke_test/logout.e2e.js b/detox/e2e/test/smoke_test/logout.e2e.js index 50eb88be1..1e47c5741 100644 --- a/detox/e2e/test/smoke_test/logout.e2e.js +++ b/detox/e2e/test/smoke_test/logout.e2e.js @@ -7,12 +7,12 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* +import {Setup} from '@support/server_api'; import {SettingsSidebar} from '@support/ui/component'; import { ChannelScreen, SelectServerScreen, } from '@support/ui/screen'; -import {Setup} from '@support/server_api'; describe('Logout', () => { beforeAll(async () => { diff --git a/detox/e2e/test/smoke_test/mention_badges.e2e.js b/detox/e2e/test/smoke_test/mention_badges.e2e.js index 17fc93d32..b40138e56 100644 --- a/detox/e2e/test/smoke_test/mention_badges.e2e.js +++ b/detox/e2e/test/smoke_test/mention_badges.e2e.js @@ -7,14 +7,14 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* -import {MainSidebar} from '@support/ui/component'; -import {ChannelScreen} from '@support/ui/screen'; import { Channel, Post, Team, User, } from '@support/server_api'; +import {MainSidebar} from '@support/ui/component'; +import {ChannelScreen} from '@support/ui/screen'; describe('Mention Badges', () => { let testChannel1; diff --git a/detox/e2e/test/smoke_test/message_deletion.e2e.js b/detox/e2e/test/smoke_test/message_deletion.e2e.js index d763f75b8..16b5f6ad7 100644 --- a/detox/e2e/test/smoke_test/message_deletion.e2e.js +++ b/detox/e2e/test/smoke_test/message_deletion.e2e.js @@ -7,15 +7,15 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* -import { - ChannelScreen, - ThreadScreen, -} from '@support/ui/screen'; import { Channel, Post, Setup, } from '@support/server_api'; +import { + ChannelScreen, + ThreadScreen, +} from '@support/ui/screen'; describe('Message Deletion', () => { const { diff --git a/detox/e2e/test/smoke_test/message_edit.e2e.js b/detox/e2e/test/smoke_test/message_edit.e2e.js index b5c7b110e..a2fe54cb6 100644 --- a/detox/e2e/test/smoke_test/message_edit.e2e.js +++ b/detox/e2e/test/smoke_test/message_edit.e2e.js @@ -7,15 +7,15 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* -import { - ChannelScreen, - EditPostScreen, -} from '@support/ui/screen'; import { Channel, Post, Setup, } from '@support/server_api'; +import { + ChannelScreen, + EditPostScreen, +} from '@support/ui/screen'; describe('Message Edit', () => { const testMessage = Date.now().toString(); diff --git a/detox/e2e/test/smoke_test/message_posting.e2e.js b/detox/e2e/test/smoke_test/message_posting.e2e.js index aaab8b57f..9fc6eb601 100644 --- a/detox/e2e/test/smoke_test/message_posting.e2e.js +++ b/detox/e2e/test/smoke_test/message_posting.e2e.js @@ -9,12 +9,12 @@ import moment from 'moment-timezone'; -import {ChannelScreen} from '@support/ui/screen'; import { Channel, Post, Setup, } from '@support/server_api'; +import {ChannelScreen} from '@support/ui/screen'; import {isAndroid} from '@support/utils'; describe('Message Posting', () => { diff --git a/detox/e2e/test/smoke_test/message_reply.e2e.js b/detox/e2e/test/smoke_test/message_reply.e2e.js index a71d219b3..35c859d26 100644 --- a/detox/e2e/test/smoke_test/message_reply.e2e.js +++ b/detox/e2e/test/smoke_test/message_reply.e2e.js @@ -7,15 +7,15 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* -import { - ChannelScreen, - ThreadScreen, -} from '@support/ui/screen'; import { Channel, Post, Setup, } from '@support/server_api'; +import { + ChannelScreen, + ThreadScreen, +} from '@support/ui/screen'; describe('Message Reply', () => { let testChannel; diff --git a/detox/e2e/test/smoke_test/mute_channels.e2e.js b/detox/e2e/test/smoke_test/mute_channels.e2e.js index 322c2fb44..35f23bc43 100644 --- a/detox/e2e/test/smoke_test/mute_channels.e2e.js +++ b/detox/e2e/test/smoke_test/mute_channels.e2e.js @@ -7,12 +7,12 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* +import {Setup} from '@support/server_api'; import {MainSidebar} from '@support/ui/component'; import { ChannelInfoScreen, ChannelScreen, } from '@support/ui/screen'; -import {Setup} from '@support/server_api'; describe('Mute Channels', () => { const { diff --git a/detox/e2e/test/smoke_test/private_channels.e2e.js b/detox/e2e/test/smoke_test/private_channels.e2e.js index 1e3d59f80..7b2363d36 100644 --- a/detox/e2e/test/smoke_test/private_channels.e2e.js +++ b/detox/e2e/test/smoke_test/private_channels.e2e.js @@ -7,6 +7,12 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* +import { + Channel, + Setup, + Team, + User, +} from '@support/server_api'; import {MainSidebar} from '@support/ui/component'; import { ChannelAddMembersScreen, @@ -16,12 +22,6 @@ import { CreateChannelScreen, EditChannelScreen, } from '@support/ui/screen'; -import { - Channel, - Setup, - Team, - User, -} from '@support/server_api'; import {getRandomId} from '@support/utils'; describe('Private Channels', () => { diff --git a/detox/e2e/test/smoke_test/public_channels.e2e.js b/detox/e2e/test/smoke_test/public_channels.e2e.js index ddda3850f..0d2a76842 100644 --- a/detox/e2e/test/smoke_test/public_channels.e2e.js +++ b/detox/e2e/test/smoke_test/public_channels.e2e.js @@ -7,6 +7,11 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* +import { + Channel, + Setup, + System, +} from '@support/server_api'; import {MainSidebar} from '@support/ui/component'; import { ChannelInfoScreen, @@ -14,11 +19,6 @@ import { ChannelScreen, MoreChannelsScreen, } from '@support/ui/screen'; -import { - Channel, - Setup, - System, -} from '@support/server_api'; describe('Public Channels', () => { const testPublicChannePrefix = '1-public-channel'; diff --git a/detox/e2e/test/smoke_test/recent_mentions.e2e.js b/detox/e2e/test/smoke_test/recent_mentions.e2e.js index 8d2f08ff0..f8985f168 100644 --- a/detox/e2e/test/smoke_test/recent_mentions.e2e.js +++ b/detox/e2e/test/smoke_test/recent_mentions.e2e.js @@ -7,11 +7,6 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* -import {PostOptions} from '@support/ui/component'; -import { - ChannelScreen, - RecentMentionsScreen, -} from '@support/ui/screen'; import { Channel, Post, @@ -19,6 +14,11 @@ import { Team, User, } from '@support/server_api'; +import {PostOptions} from '@support/ui/component'; +import { + ChannelScreen, + RecentMentionsScreen, +} from '@support/ui/screen'; describe('Recent Mentions', () => { let testUser1; diff --git a/detox/e2e/test/smoke_test/saved_messages.e2e.js b/detox/e2e/test/smoke_test/saved_messages.e2e.js index d81bc53d3..1fdd1d1f8 100644 --- a/detox/e2e/test/smoke_test/saved_messages.e2e.js +++ b/detox/e2e/test/smoke_test/saved_messages.e2e.js @@ -7,17 +7,17 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* +import { + Channel, + Post, + Setup, +} from '@support/server_api'; import {PostOptions} from '@support/ui/component'; import { ChannelScreen, SavedMessagesScreen, ThreadScreen, } from '@support/ui/screen'; -import { - Channel, - Post, - Setup, -} from '@support/server_api'; describe('Saved Messages', () => { const { diff --git a/detox/e2e/test/smoke_test/search.e2e.js b/detox/e2e/test/smoke_test/search.e2e.js index ba229a059..504de8c4b 100644 --- a/detox/e2e/test/smoke_test/search.e2e.js +++ b/detox/e2e/test/smoke_test/search.e2e.js @@ -7,6 +7,11 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* +import { + Channel, + Post, + Setup, +} from '@support/server_api'; import { Autocomplete, PostOptions, @@ -17,11 +22,6 @@ import { SearchScreen, ThreadScreen, } from '@support/ui/screen'; -import { - Channel, - Post, - Setup, -} from '@support/server_api'; describe('Search', () => { const { diff --git a/detox/e2e/test/smoke_test/select_team.e2e.js b/detox/e2e/test/smoke_test/select_team.e2e.js index a34becf92..21c0be5ff 100644 --- a/detox/e2e/test/smoke_test/select_team.e2e.js +++ b/detox/e2e/test/smoke_test/select_team.e2e.js @@ -7,16 +7,16 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* -import { - ChannelScreen, - LoginScreen, - SelectTeamScreen, -} from '@support/ui/screen'; import { Channel, Team, User, } from '@support/server_api'; +import { + ChannelScreen, + LoginScreen, + SelectTeamScreen, +} from '@support/ui/screen'; describe('Select Team', () => { const {getTeamByDisplayName} = SelectTeamScreen; diff --git a/detox/e2e/test/smoke_test/teams.e2e.js b/detox/e2e/test/smoke_test/teams.e2e.js index 63bf737d0..f6b7014d8 100644 --- a/detox/e2e/test/smoke_test/teams.e2e.js +++ b/detox/e2e/test/smoke_test/teams.e2e.js @@ -7,13 +7,13 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* -import {MainSidebar} from '@support/ui/component'; -import {ChannelScreen} from '@support/ui/screen'; import { Channel, Setup, Team, } from '@support/server_api'; +import {MainSidebar} from '@support/ui/component'; +import {ChannelScreen} from '@support/ui/screen'; describe('Teams', () => { let testTeam1; diff --git a/detox/e2e/test/smoke_test/unread_channels.e2e.js b/detox/e2e/test/smoke_test/unread_channels.e2e.js index 134a4f163..cfc75141a 100644 --- a/detox/e2e/test/smoke_test/unread_channels.e2e.js +++ b/detox/e2e/test/smoke_test/unread_channels.e2e.js @@ -7,12 +7,12 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* -import {MainSidebar} from '@support/ui/component'; -import {ChannelScreen} from '@support/ui/screen'; import { Channel, Setup, } from '@support/server_api'; +import {MainSidebar} from '@support/ui/component'; +import {ChannelScreen} from '@support/ui/screen'; describe('Unread channels', () => { const { diff --git a/detox/e2e/test/smoke_test/user_status.e2e.js b/detox/e2e/test/smoke_test/user_status.e2e.js index 590dbbce6..6158e0cf6 100644 --- a/detox/e2e/test/smoke_test/user_status.e2e.js +++ b/detox/e2e/test/smoke_test/user_status.e2e.js @@ -7,8 +7,6 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* -import {SettingsSidebar} from '@support/ui/component'; -import {ChannelScreen} from '@support/ui/screen'; import { Channel, Post, @@ -16,6 +14,8 @@ import { Team, User, } from '@support/server_api'; +import {SettingsSidebar} from '@support/ui/component'; +import {ChannelScreen} from '@support/ui/screen'; describe('User Status', () => { const testMessage = Date.now().toString(); diff --git a/detox/e2e/test/teams/select_team.e2e.js b/detox/e2e/test/teams/select_team.e2e.js index 367c7b748..030be29cd 100644 --- a/detox/e2e/test/teams/select_team.e2e.js +++ b/detox/e2e/test/teams/select_team.e2e.js @@ -7,16 +7,16 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* -import { - ChannelScreen, - LoginScreen, - SelectTeamScreen, -} from '@support/ui/screen'; import { Channel, Team, User, } from '@support/server_api'; +import { + ChannelScreen, + LoginScreen, + SelectTeamScreen, +} from '@support/ui/screen'; describe('Select Team', () => { let testTeam; diff --git a/detox/e2e/test/teams/teams_order.e2e.js b/detox/e2e/test/teams/teams_order.e2e.js index d5a3b87f8..5f070af3f 100644 --- a/detox/e2e/test/teams/teams_order.e2e.js +++ b/detox/e2e/test/teams/teams_order.e2e.js @@ -7,13 +7,13 @@ // - Use element testID when selecting an element. Create one if none. // ******************************************************************* -import {MainSidebar} from '@support/ui/component'; -import {ChannelScreen} from '@support/ui/screen'; import { Preference, Setup, Team, } from '@support/server_api'; +import {MainSidebar} from '@support/ui/component'; +import {ChannelScreen} from '@support/ui/screen'; describe('Teams Order', () => { let testUser; diff --git a/detox/webhook_server.js b/detox/webhook_server.js index b9f26716d..fde15b5fa 100644 --- a/detox/webhook_server.js +++ b/detox/webhook_server.js @@ -3,12 +3,12 @@ /* eslint-disable camelcase, no-console */ -const express = require('express'); const axios = require('axios'); var ClientOAuth2 = require('client-oauth2'); +const express = require('express'); -const webhookUtils = require('./e2e/utils/webhook_utils'); const postMessageAs = require('./e2e/plugins/post_message_as'); +const webhookUtils = require('./e2e/utils/webhook_utils'); const port = 3000; const { diff --git a/metro.config.js b/metro.config.js index ed503210a..585fc1214 100644 --- a/metro.config.js +++ b/metro.config.js @@ -2,8 +2,8 @@ // See LICENSE.txt for license information. /* eslint-disable no-console */ -const resolve = require('path').resolve; const fs = require('fs'); +const resolve = require('path').resolve; const modulesRegex = /\/(node_modules)/; diff --git a/package-lock.json b/package-lock.json index f626c1b89..4104248fa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -135,6 +135,7 @@ "enzyme-to-json": "3.6.2", "eslint": "7.30.0", "eslint-plugin-header": "3.1.1", + "eslint-plugin-import": "2.23.4", "eslint-plugin-jest": "24.3.6", "eslint-plugin-mattermost": "github:mattermost/eslint-plugin-mattermost#070ce792d105482ffb2b27cfc0b7e78b3d20acee", "eslint-plugin-react": "7.24.0", @@ -15037,6 +15038,123 @@ "eslint": ">=3.14.1" } }, + "node_modules/eslint-import-resolver-node": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.4.tgz", + "integrity": "sha512-ogtf+5AB/O+nM6DIeBUNr2fuT7ot9Qg/1harBfBtaP13ekEWFQEEMP94BCB7zaNW3gyY+8SHYF00rnqYwXKWOA==", + "dev": true, + "dependencies": { + "debug": "^2.6.9", + "resolve": "^1.13.1" + } + }, + "node_modules/eslint-import-resolver-node/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/eslint-import-resolver-node/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "node_modules/eslint-module-utils": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.6.1.tgz", + "integrity": "sha512-ZXI9B8cxAJIH4nfkhTwcRTEAnrVfobYqwjWy/QMCZ8rHkZHFjf9yO4BzpiF9kCSfNlMG54eKigISHpX0+AaT4A==", + "dev": true, + "dependencies": { + "debug": "^3.2.7", + "pkg-dir": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-module-utils/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-module-utils/node_modules/find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "dependencies": { + "locate-path": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-module-utils/node_modules/locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "dependencies": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-module-utils/node_modules/p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "dependencies": { + "p-try": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-module-utils/node_modules/p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "dependencies": { + "p-limit": "^1.1.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-module-utils/node_modules/p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-module-utils/node_modules/pkg-dir": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", + "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", + "dev": true, + "dependencies": { + "find-up": "^2.1.0" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/eslint-plugin-eslint-comments": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/eslint-plugin-eslint-comments/-/eslint-plugin-eslint-comments-3.2.0.tgz", @@ -15098,6 +15216,180 @@ "eslint": ">=7.7.0" } }, + "node_modules/eslint-plugin-import": { + "version": "2.23.4", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.23.4.tgz", + "integrity": "sha512-6/wP8zZRsnQFiR3iaPFgh5ImVRM1WN5NUWfTIRqwOdeiGJlBcSk82o1FEVq8yXmy4lkIzTo7YhHCIxlU/2HyEQ==", + "dev": true, + "dependencies": { + "array-includes": "^3.1.3", + "array.prototype.flat": "^1.2.4", + "debug": "^2.6.9", + "doctrine": "^2.1.0", + "eslint-import-resolver-node": "^0.3.4", + "eslint-module-utils": "^2.6.1", + "find-up": "^2.0.0", + "has": "^1.0.3", + "is-core-module": "^2.4.0", + "minimatch": "^3.0.4", + "object.values": "^1.1.3", + "pkg-up": "^2.0.0", + "read-pkg-up": "^3.0.0", + "resolve": "^1.20.0", + "tsconfig-paths": "^3.9.0" + }, + "engines": { + "node": ">=4" + }, + "peerDependencies": { + "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0" + } + }, + "node_modules/eslint-plugin-import/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/eslint-plugin-import/node_modules/doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/eslint-plugin-import/node_modules/find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "dependencies": { + "locate-path": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-plugin-import/node_modules/locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "dependencies": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-plugin-import/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "node_modules/eslint-plugin-import/node_modules/p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "dependencies": { + "p-try": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-plugin-import/node_modules/p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "dependencies": { + "p-limit": "^1.1.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-plugin-import/node_modules/p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-plugin-import/node_modules/path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, + "dependencies": { + "pify": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-plugin-import/node_modules/pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-plugin-import/node_modules/pkg-up": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pkg-up/-/pkg-up-2.0.0.tgz", + "integrity": "sha1-yBmscoBZpGHKscOImivjxJoATX8=", + "dev": true, + "dependencies": { + "find-up": "^2.1.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-plugin-import/node_modules/read-pkg": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", + "dev": true, + "dependencies": { + "load-json-file": "^4.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-plugin-import/node_modules/read-pkg-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", + "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", + "dev": true, + "dependencies": { + "find-up": "^2.0.0", + "read-pkg": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/eslint-plugin-jest": { "version": "24.3.6", "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-24.3.6.tgz", @@ -36605,6 +36897,26 @@ } } }, + "node_modules/tsconfig-paths": { + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.10.1.tgz", + "integrity": "sha512-rETidPDgCpltxF7MjBZlAFPUHv5aHH2MymyPvh+vEyWAED4Eb/WeMbsnD/JDr4OKPOA1TssDHgIcpTN5Kh0p6Q==", + "dev": true, + "dependencies": { + "json5": "^2.2.0", + "minimist": "^1.2.0", + "strip-bom": "^3.0.0" + } + }, + "node_modules/tsconfig-paths/node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/tslib": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", @@ -50968,6 +51280,106 @@ "get-stdin": "^6.0.0" } }, + "eslint-import-resolver-node": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.4.tgz", + "integrity": "sha512-ogtf+5AB/O+nM6DIeBUNr2fuT7ot9Qg/1harBfBtaP13ekEWFQEEMP94BCB7zaNW3gyY+8SHYF00rnqYwXKWOA==", + "dev": true, + "requires": { + "debug": "^2.6.9", + "resolve": "^1.13.1" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "eslint-module-utils": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.6.1.tgz", + "integrity": "sha512-ZXI9B8cxAJIH4nfkhTwcRTEAnrVfobYqwjWy/QMCZ8rHkZHFjf9yO4BzpiF9kCSfNlMG54eKigISHpX0+AaT4A==", + "dev": true, + "requires": { + "debug": "^3.2.7", + "pkg-dir": "^2.0.0" + }, + "dependencies": { + "debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, + "pkg-dir": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", + "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", + "dev": true, + "requires": { + "find-up": "^2.1.0" + } + } + } + }, "eslint-plugin-eslint-comments": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/eslint-plugin-eslint-comments/-/eslint-plugin-eslint-comments-3.2.0.tgz", @@ -51008,6 +51420,143 @@ "dev": true, "requires": {} }, + "eslint-plugin-import": { + "version": "2.23.4", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.23.4.tgz", + "integrity": "sha512-6/wP8zZRsnQFiR3iaPFgh5ImVRM1WN5NUWfTIRqwOdeiGJlBcSk82o1FEVq8yXmy4lkIzTo7YhHCIxlU/2HyEQ==", + "dev": true, + "requires": { + "array-includes": "^3.1.3", + "array.prototype.flat": "^1.2.4", + "debug": "^2.6.9", + "doctrine": "^2.1.0", + "eslint-import-resolver-node": "^0.3.4", + "eslint-module-utils": "^2.6.1", + "find-up": "^2.0.0", + "has": "^1.0.3", + "is-core-module": "^2.4.0", + "minimatch": "^3.0.4", + "object.values": "^1.1.3", + "pkg-up": "^2.0.0", + "read-pkg-up": "^3.0.0", + "resolve": "^1.20.0", + "tsconfig-paths": "^3.9.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, + "path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, + "requires": { + "pify": "^3.0.0" + } + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + }, + "pkg-up": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pkg-up/-/pkg-up-2.0.0.tgz", + "integrity": "sha1-yBmscoBZpGHKscOImivjxJoATX8=", + "dev": true, + "requires": { + "find-up": "^2.1.0" + } + }, + "read-pkg": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", + "dev": true, + "requires": { + "load-json-file": "^4.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^3.0.0" + } + }, + "read-pkg-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", + "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", + "dev": true, + "requires": { + "find-up": "^2.0.0", + "read-pkg": "^3.0.0" + } + } + } + }, "eslint-plugin-jest": { "version": "24.3.6", "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-24.3.6.tgz", @@ -67996,6 +68545,25 @@ "integrity": "sha512-csd+vJOb/gkzvcCHgTGSChYpy5f1/XKNsmvBGO4JXS+z1v2HobugDz4s1IeFXM3wZB44uczs+eazB5Q/ccdhQw==", "dev": true }, + "tsconfig-paths": { + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.10.1.tgz", + "integrity": "sha512-rETidPDgCpltxF7MjBZlAFPUHv5aHH2MymyPvh+vEyWAED4Eb/WeMbsnD/JDr4OKPOA1TssDHgIcpTN5Kh0p6Q==", + "dev": true, + "requires": { + "json5": "^2.2.0", + "minimist": "^1.2.0", + "strip-bom": "^3.0.0" + }, + "dependencies": { + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + } + } + }, "tslib": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", diff --git a/package.json b/package.json index 5f89b8122..fec3b8e3c 100644 --- a/package.json +++ b/package.json @@ -133,6 +133,7 @@ "enzyme-to-json": "3.6.2", "eslint": "7.30.0", "eslint-plugin-header": "3.1.1", + "eslint-plugin-import": "2.23.4", "eslint-plugin-jest": "24.3.6", "eslint-plugin-mattermost": "github:mattermost/eslint-plugin-mattermost#070ce792d105482ffb2b27cfc0b7e78b3d20acee", "eslint-plugin-react": "7.24.0", diff --git a/packager/generateModulePaths.js b/packager/generateModulePaths.js index 2c7d0099e..ab77f5ff6 100644 --- a/packager/generateModulePaths.js +++ b/packager/generateModulePaths.js @@ -4,9 +4,11 @@ /* eslint-disable no-console */ const execSync = require('child_process').execSync; const fs = require('fs'); -const moduleNames = require('./moduleNames'); const pjson = require('../package.json'); + +const moduleNames = require('./moduleNames'); + const localPrefix = `${pjson.name}/`; // Transforming to Module Paths diff --git a/share_extension/actions/index.ts b/share_extension/actions/index.ts index bc0a20f65..fd357260d 100644 --- a/share_extension/actions/index.ts +++ b/share_extension/actions/index.ts @@ -4,8 +4,8 @@ import {batchActions} from 'redux-batched-actions'; import {loadSidebar} from '@actions/views/channel'; -import {ChannelTypes, RoleTypes} from '@mm-redux/action_types'; import {Client4} from '@client/rest'; +import {ChannelTypes, RoleTypes} from '@mm-redux/action_types'; import {getRedirectChannelNameForTeam, getChannelsNameMapInTeam} from '@mm-redux/selectors/entities/channels'; import {getCurrentUserId} from '@mm-redux/selectors/entities/users'; import {DispatchFunc, GetStateFunc} from '@mm-redux/types/actions'; diff --git a/share_extension/components/channel_button.tsx b/share_extension/components/channel_button.tsx index f2ccc7830..abf3a3deb 100644 --- a/share_extension/components/channel_button.tsx +++ b/share_extension/components/channel_button.tsx @@ -2,15 +2,17 @@ // See LICENSE.txt for license information. import {useNavigation} from '@react-navigation/native'; + import React from 'react'; import {injectIntl, intlShape} from 'react-intl'; import {StyleSheet, Text, TouchableHighlight, View} from 'react-native'; import FormattedText from '@components/formatted_text'; import {Preferences} from '@mm-redux/constants'; -import type {Channel} from '@mm-redux/types/channels'; import {changeOpacity} from '@utils/theme'; +import type {Channel} from '@mm-redux/types/channels'; + interface ChannelButtonProps { channel?: Channel | null; intl: typeof intlShape; diff --git a/share_extension/components/channel_item.tsx b/share_extension/components/channel_item.tsx index e9f524ad6..dd78a68ec 100644 --- a/share_extension/components/channel_item.tsx +++ b/share_extension/components/channel_item.tsx @@ -7,11 +7,10 @@ import {StyleSheet, Text, TouchableHighlight, View} from 'react-native'; import CompassIcon from '@components/compass_icon'; import {Preferences} from '@mm-redux/constants'; import {Channel} from '@mm-redux/types/channels'; +import {DirectChannel, GroupChannel, PublicChannel, PrivateChannel} from '@share/components/channel_type'; import {preventDoubleTap} from '@utils/tap'; import {changeOpacity} from '@utils/theme'; -import {DirectChannel, GroupChannel, PublicChannel, PrivateChannel} from '@share/components/channel_type'; - interface ChannelItemProps { onSelect: (channel: Channel) => void; selected: boolean; diff --git a/share_extension/components/post_header_button.tsx b/share_extension/components/post_header_button.tsx index b35b4195b..49047f7a3 100644 --- a/share_extension/components/post_header_button.tsx +++ b/share_extension/components/post_header_button.tsx @@ -7,8 +7,8 @@ import {useSelector} from 'react-redux'; import CompassIcon from '@components/compass_icon'; import {Preferences} from '@mm-redux/constants'; -import EventEmitter from '@mm-redux/utils/event_emitter'; import {canUploadFilesOnMobile} from '@mm-redux/selectors/entities/general'; +import EventEmitter from '@mm-redux/utils/event_emitter'; import {preventDoubleTap} from '@utils/tap'; export const SHARE_EXTENSION_POST_EVENT = 'share-extesion-post-event'; diff --git a/share_extension/components/team_button.tsx b/share_extension/components/team_button.tsx index 2fd357787..86e88739c 100644 --- a/share_extension/components/team_button.tsx +++ b/share_extension/components/team_button.tsx @@ -2,6 +2,7 @@ // See LICENSE.txt for license information. import {useNavigation} from '@react-navigation/native'; + import React from 'react'; import {injectIntl, intlShape} from 'react-intl'; import {StyleSheet, Text, TouchableHighlight, View} from 'react-native'; @@ -11,10 +12,11 @@ import FormattedText from '@components/formatted_text'; import {getMyTeams} from '@mm-redux/actions/teams'; import {Preferences} from '@mm-redux/constants'; import {DispatchFunc} from '@mm-redux/types/actions'; +import {loadTeamChannels, getTeamDefaultChannel} from '@share/actions'; +import {changeOpacity} from '@utils/theme'; + import type {Channel} from '@mm-redux/types/channels'; import type {Team} from '@mm-redux/types/teams'; -import {changeOpacity} from '@utils/theme'; -import {loadTeamChannels, getTeamDefaultChannel} from '@share/actions'; interface TeamButtonProps { intl: typeof intlShape; diff --git a/share_extension/index.tsx b/share_extension/index.tsx index adb876740..f273e56af 100644 --- a/share_extension/index.tsx +++ b/share_extension/index.tsx @@ -2,11 +2,11 @@ // See LICENSE.txt for license information. import React, {useCallback, useEffect, useState} from 'react'; -import {Provider} from 'react-redux'; import {IntlProvider} from 'react-intl'; +import {Provider} from 'react-redux'; -import {General} from '@mm-redux/constants'; import {getTranslations} from '@i18n'; +import {General} from '@mm-redux/constants'; import {getCurrentLocale} from '@selectors/i18n'; import configureStore from '@store'; import getStorage from '@store/mmkv_adapter'; diff --git a/share_extension/screens/channel_list.tsx b/share_extension/screens/channel_list.tsx index b15110767..7eefd7dc1 100644 --- a/share_extension/screens/channel_list.tsx +++ b/share_extension/screens/channel_list.tsx @@ -2,6 +2,7 @@ // See LICENSE.txt for license information. import {RouteProp, useFocusEffect, useNavigation, useRoute} from '@react-navigation/native'; + import React, {useCallback, useEffect, useLayoutEffect, useState} from 'react'; import {injectIntl, intlShape} from 'react-intl'; import {BackHandler, SectionList, SectionListData, SectionListRenderItemInfo, StyleSheet, View} from 'react-native'; @@ -11,13 +12,13 @@ import FormattedText from '@components/formatted_text'; import Loading from '@components/loading'; import SearchBar from '@components/search_bar'; import {Preferences} from '@mm-redux/constants'; -import type {Channel} from '@mm-redux/types/channels'; +import {GlobalState} from '@mm-redux/types/store'; +import ChannelItem from '@share/components/channel_item'; +import {getExtensionSortedDirectChannels, getExtensionSortedPrivateChannels, getExtensionSortedPublicChannels} from '@share/selectors'; import {throttle} from '@utils/general'; import {changeOpacity} from '@utils/theme'; -import ChannelItem from '@share/components/channel_item'; -import {getExtensionSortedDirectChannels, getExtensionSortedPrivateChannels, getExtensionSortedPublicChannels} from '@share/selectors'; -import {GlobalState} from '@mm-redux/types/store'; +import type {Channel} from '@mm-redux/types/channels'; interface ChannnelListProps { intl: typeof intlShape; @@ -35,7 +36,7 @@ type ChannnelListParams = { onSelectChannel: (channel: Channel) => void; teamId: string; title: string; - } + }; } type SectionDataHeader = (info: {section: SectionListData}) => React.ReactElement | null; diff --git a/share_extension/screens/extension.tsx b/share_extension/screens/extension.tsx index 3ffd60b28..ea6ff4fd0 100644 --- a/share_extension/screens/extension.tsx +++ b/share_extension/screens/extension.tsx @@ -2,8 +2,8 @@ // See LICENSE.txt for license information. import React, {PureComponent} from 'react'; -import {Alert, NativeModules, View} from 'react-native'; import {intlShape} from 'react-intl'; +import {Alert, NativeModules, View} from 'react-native'; import FormattedText from '@components/formatted_text'; import {captureException, initializeSentry, LOGGER_EXTENSION} from '@utils/sentry'; diff --git a/share_extension/screens/navigation.tsx b/share_extension/screens/navigation.tsx index def38058a..7b0ac8ef7 100644 --- a/share_extension/screens/navigation.tsx +++ b/share_extension/screens/navigation.tsx @@ -2,9 +2,10 @@ // See LICENSE.txt for license information. import {NavigationContainer} from '@react-navigation/native'; -import React from 'react'; import {createStackNavigator} from '@react-navigation/stack'; +import React from 'react'; + import {Preferences} from '@mm-redux/constants'; import Channels from './channel_list'; diff --git a/share_extension/screens/share.tsx b/share_extension/screens/share.tsx index 9968a6cb9..c858d674e 100644 --- a/share_extension/screens/share.tsx +++ b/share_extension/screens/share.tsx @@ -2,30 +2,31 @@ // See LICENSE.txt for license information. import {useFocusEffect, useNavigation} from '@react-navigation/native'; + import React, {useCallback, useEffect, useLayoutEffect, useRef, useState} from 'react'; import {injectIntl, intlShape} from 'react-intl'; import {Alert, BackHandler, NativeModules, StyleSheet, View} from 'react-native'; import {useSelector} from 'react-redux'; -import {MAX_FILE_COUNT, MAX_MESSAGE_LENGTH_FALLBACK} from '@constants/post_draft'; import {Client4} from '@client/rest'; +import {MAX_FILE_COUNT, MAX_MESSAGE_LENGTH_FALLBACK} from '@constants/post_draft'; import {Preferences} from '@mm-redux/constants'; import {getCurrentChannel} from '@mm-redux/selectors/entities/channels'; import {getConfig, canUploadFilesOnMobile} from '@mm-redux/selectors/entities/general'; import {getCurrentTeam} from '@mm-redux/selectors/entities/teams'; import {getCurrentUserId} from '@mm-redux/selectors/entities/users'; -import EventEmitter from '@mm-redux/utils/event_emitter'; import {Channel} from '@mm-redux/types/channels'; -import type {Team} from '@mm-redux/types/teams'; -import {getAllowedServerMaxFileSize} from '@utils/file'; -import {changeOpacity} from '@utils/theme'; - +import EventEmitter from '@mm-redux/utils/event_emitter'; +import Body from '@share/components/body'; import ChannelButton from '@share/components/channel_button'; import CloseHeaderButton from '@share/components/close_header_button'; import PostHeaderButton, {SHARE_EXTENSION_POST_EVENT} from '@share/components/post_header_button'; -import Body from '@share/components/body'; import TeamButton from '@share/components/team_button'; import {isAuthorized, getErrorElement, getSharedItems, permissionEnabled} from '@share/utils'; +import {getAllowedServerMaxFileSize} from '@utils/file'; +import {changeOpacity} from '@utils/theme'; + +import type {Team} from '@mm-redux/types/teams'; interface ShareProps { intl: typeof intlShape; diff --git a/share_extension/screens/team_list.tsx b/share_extension/screens/team_list.tsx index 447273d83..9c92b9eb0 100644 --- a/share_extension/screens/team_list.tsx +++ b/share_extension/screens/team_list.tsx @@ -2,6 +2,7 @@ // See LICENSE.txt for license information. import {RouteProp, useFocusEffect, useNavigation, useRoute} from '@react-navigation/native'; + import React, {useCallback, useLayoutEffect} from 'react'; import {BackHandler, FlatList, StyleSheet, View} from 'react-native'; import {useSelector} from 'react-redux'; @@ -9,19 +10,19 @@ import {useSelector} from 'react-redux'; import Loading from '@components/loading'; import {Preferences} from '@mm-redux/constants'; import {getMyTeams} from '@mm-redux/selectors/entities/teams'; -import type {Team} from '@mm-redux/types/teams'; import {sortTeamsWithLocale} from '@mm-redux/utils/team_utils'; import {getCurrentLocale} from '@selectors/i18n'; +import TeamItem from '@share/components/team_item'; import {changeOpacity} from '@utils/theme'; -import TeamItem from '@share/components/team_item'; +import type {Team} from '@mm-redux/types/teams'; type TeamListParams = { Teams: { currentTeamId?: string; onSelectTeam: (team: Team) => void; title: string; - } + }; } type TeamListRoute = RouteProp; diff --git a/share_extension/selectors/index.ts b/share_extension/selectors/index.ts index 4e6128e12..0ec66c20a 100644 --- a/share_extension/selectors/index.ts +++ b/share_extension/selectors/index.ts @@ -5,11 +5,11 @@ import {createSelector} from 'reselect'; import {General} from '@mm-redux/constants'; import {getAllChannels, getMyChannelMemberships} from '@mm-redux/selectors/entities/channels'; -import {getCurrentUser, getUsers, getUserIdsInChannels} from '@mm-redux/selectors/entities/users'; import {getTeammateNameDisplaySetting, getVisibleTeammate, getVisibleGroupIds} from '@mm-redux/selectors/entities/preferences'; -import {completeDirectChannelDisplayName, getDirectChannelName, sortChannelsByDisplayName} from '@mm-redux/utils/channel_utils'; +import {getCurrentUser, getUsers, getUserIdsInChannels} from '@mm-redux/selectors/entities/users'; import {Channel} from '@mm-redux/types/channels'; import {GlobalState} from '@mm-redux/types/store'; +import {completeDirectChannelDisplayName, getDirectChannelName, sortChannelsByDisplayName} from '@mm-redux/utils/channel_utils'; export const getExtensionSortedPublicChannels = createSelector( getCurrentUser, diff --git a/share_extension/utils/index.tsx b/share_extension/utils/index.tsx index c901f035f..0ad1ed20b 100644 --- a/share_extension/utils/index.tsx +++ b/share_extension/utils/index.tsx @@ -10,13 +10,13 @@ import RNFetchBlob from 'rn-fetch-blob'; import Loading from '@components/loading'; import {MAX_FILE_COUNT} from '@constants/post_draft'; import {getAppCredentials} from '@init/credentials'; +import mattermostManaged from '@mattermost-managed'; +import {getFormattedFileSize, lookupMimeType} from '@mm-redux/utils/file_utils'; +import ShareError from '@share/components/error'; +import {getExtensionFromMime} from '@utils/file'; + import type {FileInfo} from '@mm-redux/types/files'; import type {Team} from '@mm-redux/types/teams'; -import {getFormattedFileSize, lookupMimeType} from '@mm-redux/utils/file_utils'; -import {getExtensionFromMime} from '@utils/file'; -import mattermostManaged from 'app/mattermost_managed'; - -import ShareError from '@share/components/error'; const ShareExtension = NativeModules.MattermostShare; diff --git a/storybook/index.ts b/storybook/index.ts index b871fc154..d0db0469c 100644 --- a/storybook/index.ts +++ b/storybook/index.ts @@ -1,9 +1,11 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {Platform} from 'react-native'; -import {STORYBOOK_HOST, STORYBOOK_PORT} from '@env'; import {getStorybookUI, configure} from '@storybook/react-native'; +import {Platform} from 'react-native'; + +import {STORYBOOK_HOST, STORYBOOK_PORT} from '@env'; + // load react-native addons for storybook rn import '@storybook/addon-ondevice-knobs/register'; diff --git a/storybook/mattermost_storybook.ts b/storybook/mattermost_storybook.ts index deb6223a5..2b060f98f 100644 --- a/storybook/mattermost_storybook.ts +++ b/storybook/mattermost_storybook.ts @@ -1,10 +1,10 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import DevMenu from 'react-native-dev-menu'; import {Navigation} from 'react-native-navigation'; + import {goToScreen} from '@actions/navigation'; import {withReduxProvider} from '@screens'; - -import DevMenu from 'react-native-dev-menu'; DevMenu.addItem('StoryBook', () => goToScreen('StoryBook', 'StoryBook')); Navigation.registerComponent('StoryBook', () => withReduxProvider(require('../storybook').default)); diff --git a/test/intl-test-helper.js b/test/intl-test-helper.js index aa2193a8f..56682d943 100644 --- a/test/intl-test-helper.js +++ b/test/intl-test-helper.js @@ -1,9 +1,9 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import {mount, shallow} from 'enzyme'; import React from 'react'; import {IntlProvider, intlShape} from 'react-intl'; -import {mount, shallow} from 'enzyme'; import {getTranslations} from '@i18n'; diff --git a/test/setup.js b/test/setup.js index e067bfe6f..e50f862fd 100644 --- a/test/setup.js +++ b/test/setup.js @@ -3,10 +3,10 @@ /* eslint-disable react/no-multi-comp */ -import * as ReactNative from 'react-native'; -import MockAsyncStorage from 'mock-async-storage'; import {configure} from 'enzyme'; import Adapter from 'enzyme-adapter-react-16'; +import MockAsyncStorage from 'mock-async-storage'; +import * as ReactNative from 'react-native'; import 'react-native-gesture-handler/jestSetup'; require('react-native-reanimated/lib/reanimated2/jestUtils').setUpTests(); diff --git a/test/test_helper.js b/test/test_helper.js index 7ec4f4ff6..05df75229 100644 --- a/test/test_helper.js +++ b/test/test_helper.js @@ -2,6 +2,7 @@ // See LICENSE.txt for license information. import assert from 'assert'; + import nock from 'nock'; import Config from '@assets/config.json'; diff --git a/test/test_store.js b/test/test_store.js index dfd7cf6e5..723f7eee7 100644 --- a/test/test_store.js +++ b/test/test_store.js @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {AsyncNodeStorage} from 'redux-persist-node-storage'; import {createTransform} from 'redux-persist'; +import {AsyncNodeStorage} from 'redux-persist-node-storage'; import configureStore from '@store'; diff --git a/test/testing_library.js b/test/testing_library.js index e2baf8dce..ec9336986 100644 --- a/test/testing_library.js +++ b/test/testing_library.js @@ -1,12 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import {render} from '@testing-library/react-native'; + import React from 'react'; import {IntlProvider} from 'react-intl'; import {Provider} from 'react-redux'; import configureMockStore from 'redux-mock-store'; import thunk from 'redux-thunk'; -import {render} from '@testing-library/react-native'; import intitialState from '@store/initial_state'; diff --git a/tsconfig.json b/tsconfig.json index a6c92524e..b9ac0342d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -50,6 +50,8 @@ "@store": ["app/store/index"], "@store/*": ["app/store/*"], "@telemetry": ["app/telemetry/index"], + "@test/*": ["test/*"], + "@mm-types/*": ["types/*"], "@typings/*": ["types/*"], "@utils/*": ["app/utils/*"], "@websocket": ["app/client/websocket"], @@ -67,4 +69,4 @@ "metro.config.js", "jest.config.js", ] -} \ No newline at end of file +} diff --git a/types/modules/react-native-slider.d.ts b/types/modules/react-native-slider.d.ts index 9295be447..4cd4306ec 100644 --- a/types/modules/react-native-slider.d.ts +++ b/types/modules/react-native-slider.d.ts @@ -1,7 +1,6 @@ /* eslint-disable header/header */ declare module 'react-native-slider' { import {ComponentClass} from 'react'; - import { ImageSourcePropType, SpringAnimationConfig, @@ -20,46 +19,46 @@ declare module 'react-native-slider' { * *This is not a controlled component*, e.g. if you don't update * the value, the component won't be reset to its inital value. */ - value?: number + value?: number; /** * If true the user won't be able to move the slider. * Default value is false. */ - disabled?: boolean + disabled?: boolean; /** * Initial minimum value of the slider. Default value is 0. */ - minimumValue?: number + minimumValue?: number; /** * Initial maximum value of the slider. Default value is 1. */ - maximumValue?: number + maximumValue?: number; /** * Step value of the slider. The value should be between 0 and * (maximumValue - minimumValue). Default value is 0. */ - step?: number + step?: number; /** * The color used for the track to the left of the button. Overrides the * default blue gradient image. */ - minimumTrackTintColor?: string + minimumTrackTintColor?: string; /** * The color used for the track to the right of the button. Overrides the * default blue gradient image. */ - maximumTrackTintColor?: string + maximumTrackTintColor?: string; /** * The color used for the thumb. */ - thumbTintColor?: string + thumbTintColor?: string; /** * The size of the touch area that allows moving the thumb. @@ -68,64 +67,64 @@ declare module 'react-native-slider' { * to move it easily. * The default is {width: 40, height: 40}. */ - thumbTouchSize?: { width: number; height: number } + thumbTouchSize?: { width: number; height: number }; /** * Callback continuously called while the user is dragging the slider. */ - onValueChange: (value: number) => void + onValueChange: (value: number) => void; /** * Callback called when the user starts changing the value (e.g. when * the slider is pressed). */ - onSlidingStart?: (value: number) => void + onSlidingStart?: (value: number) => void; /** * Callback called when the user finishes changing the value (e.g. when * the slider is released). */ - onSlidingComplete?: (value: number) => void + onSlidingComplete?: (value: number) => void; /** * The style applied to the slider container. */ - style?: StyleProp + style?: StyleProp; /** * The style applied to the track. */ - trackStyle?: StyleProp + trackStyle?: StyleProp; /** * The style applied to the thumb. */ - thumbStyle?: StyleProp + thumbStyle?: StyleProp; /** * Sets an image for the thumb. */ - thumbImage?: ImageSourcePropType + thumbImage?: ImageSourcePropType; /** * Set this to true to visually see the thumb touch rect in green. */ - debugTouchArea?: boolean + debugTouchArea?: boolean; /** * Set to true to animate values with default 'timing' animation type */ - animateTransitions?: boolean + animateTransitions?: boolean; /** * Custom Animation type. 'spring' or 'timing'. */ - animationType?: 'spring' | 'timing' + animationType?: 'spring' | 'timing'; /** * Used to configure the animation parameters. These are the same parameters in the Animated library. */ - animationConfig?: SpringAnimationConfig | TimingAnimationConfig + animationConfig?: SpringAnimationConfig | TimingAnimationConfig; } const Slider: ComponentClass; diff --git a/types/screens/gallery.d.ts b/types/screens/gallery.d.ts index a40cfb09e..0271f9a69 100644 --- a/types/screens/gallery.d.ts +++ b/types/screens/gallery.d.ts @@ -108,11 +108,11 @@ export interface ToastProps { } export interface ToastRef { - show: ShowToast + show: ShowToast; } export interface ToastState { - animation?: CompositeAnimation, + animation?: CompositeAnimation; duration?: number; callback?: () => void; }