forked from Ivasoft/mattermost-mobile
Add import order lint rules (#5672)
* Add import order lint rules * Address feedback * Revert change
This commit is contained in:
committed by
GitHub
parent
6c2e28afc2
commit
1c26f14fdb
@@ -8,7 +8,8 @@
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"plugins": [
|
||||
"@typescript-eslint",
|
||||
"mattermost"
|
||||
"mattermost",
|
||||
"import"
|
||||
],
|
||||
"settings": {
|
||||
"react": {
|
||||
@@ -58,7 +59,32 @@
|
||||
"singleLine": {
|
||||
"beforeColon": false,
|
||||
"afterColon": true
|
||||
}}]
|
||||
}}],
|
||||
"@typescript-eslint/member-delimiter-style": 2,
|
||||
"import/order": [
|
||||
2,
|
||||
{
|
||||
"groups": ["builtin", "external", "parent", "sibling", "index", "type"],
|
||||
"newlines-between": "always",
|
||||
"pathGroups": [
|
||||
{
|
||||
"pattern": "{@(@actions|@app|@assets|@client|@components|@constants|@context|@database|@helpers|@hooks|@init|@queries|@screens|@selectors|@share|@store|@telemetry|@typings|@test|@utils)/**,@(@constants|@i18n|@notifications|@store|@websocket)}",
|
||||
"group": "external",
|
||||
"position": "after"
|
||||
},
|
||||
{
|
||||
"pattern": "app/**",
|
||||
"group": "parent",
|
||||
"position": "before"
|
||||
}
|
||||
],
|
||||
"alphabetize": {
|
||||
"order": "asc",
|
||||
"caseInsensitive": true
|
||||
},
|
||||
"pathGroupsExcludedImportTypes": ["type"]
|
||||
}
|
||||
]
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
|
||||
@@ -11,16 +11,15 @@ import {General} from '@constants';
|
||||
import DatabaseManager from '@database/manager';
|
||||
import {privateChannelJoinPrompt} from '@helpers/api/channel';
|
||||
import {prepareMyChannelsForTeam, queryMyChannel} from '@queries/servers/channel';
|
||||
import {addChannelToTeamHistory, prepareMyTeams, queryMyTeamById, queryTeamById, queryTeamByName} from '@queries/servers/team';
|
||||
import {queryCommonSystemValues, setCurrentChannelId, setCurrentTeamAndChannelId} from '@queries/servers/system';
|
||||
import {addChannelToTeamHistory, prepareMyTeams, queryMyTeamById, queryTeamById, queryTeamByName} from '@queries/servers/team';
|
||||
import {PERMALINK_GENERIC_TEAM_NAME_REDIRECT} from '@utils/url';
|
||||
|
||||
import type {IntlShape} from 'react-intl';
|
||||
|
||||
import type ChannelModel from '@typings/database/models/servers/channel';
|
||||
import type MyChannelModel from '@typings/database/models/servers/my_channel';
|
||||
import type MyTeamModel from '@typings/database/models/servers/my_team';
|
||||
import type TeamModel from '@typings/database/models/servers/team';
|
||||
import type {IntlShape} from 'react-intl';
|
||||
|
||||
export const switchToChannel = async (serverUrl: string, channelId: string) => {
|
||||
const database = DatabaseManager.serverDatabases[serverUrl]?.database;
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
|
||||
import {Keyboard} from 'react-native';
|
||||
|
||||
import type {IntlShape} from 'react-intl';
|
||||
|
||||
import {fetchMyChannelsForTeam} from '@actions/remote/channel';
|
||||
import DatabaseManager from '@database/manager';
|
||||
import {queryCommonSystemValues} from '@queries/servers/system';
|
||||
@@ -15,6 +13,7 @@ import {changeOpacity} from '@utils/theme';
|
||||
import {PERMALINK_GENERIC_TEAM_NAME_REDIRECT} from '@utils/url';
|
||||
|
||||
import type TeamModel from '@typings/database/models/servers/team';
|
||||
import type {IntlShape} from 'react-intl';
|
||||
|
||||
let showingPermalink = false;
|
||||
|
||||
|
||||
@@ -8,8 +8,8 @@ import {queryPostById} from '@queries/servers/post';
|
||||
import {queryCurrentUserId} from '@queries/servers/system';
|
||||
import {generateId} from '@utils/general';
|
||||
|
||||
import type UserModel from '@typings/database/models/servers/user';
|
||||
import type PostModel from '@typings/database/models/servers/post';
|
||||
import type UserModel from '@typings/database/models/servers/user';
|
||||
|
||||
export const sendAddToChannelEphemeralPost = async (serverUrl: string, user: UserModel, addedUsernames: string[], messages: string[], channeId: string, postRootId = '') => {
|
||||
const operator = DatabaseManager.serverDatabases[serverUrl]?.operator;
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
import moment from 'moment-timezone';
|
||||
import {createIntl} from 'react-intl';
|
||||
|
||||
import {getSessions} from '@actions/remote/session';
|
||||
import {DEFAULT_LOCALE, getTranslations} from '@i18n';
|
||||
import PushNotifications from '@init/push_notifications';
|
||||
import {sortByNewest} from '@utils/general';
|
||||
import {createIntl} from 'react-intl';
|
||||
|
||||
export const scheduleExpiredNotification = async (serverUrl: string, config: Partial<ClientConfig>, userId: string, locale = DEFAULT_LOCALE) => {
|
||||
if (config.ExtendSessionLengthWithActivity === 'true') {
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
|
||||
import {getTimeZone} from 'react-native-localize';
|
||||
|
||||
import {updateMe} from '@actions/remote/user';
|
||||
import DatabaseManager from '@database/manager';
|
||||
import {queryUserById} from '@queries/servers/user';
|
||||
import {updateMe} from '@actions/remote/user';
|
||||
|
||||
import type UserModel from '@typings/database/models/servers/user';
|
||||
|
||||
|
||||
@@ -11,9 +11,8 @@ import {fetchRolesIfNeeded} from './role';
|
||||
import {forceLogoutIfNecessary} from './session';
|
||||
import {fetchProfilesPerChannels, fetchUsersByIds} from './user';
|
||||
|
||||
import type {Model} from '@nozbe/watermelondb';
|
||||
|
||||
import type {Client} from '@client/rest';
|
||||
import type {Model} from '@nozbe/watermelondb';
|
||||
|
||||
export type MyChannelsRequest = {
|
||||
channels?: Channel[];
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
import type {ClientResponse} from '@mattermost/react-native-network-client';
|
||||
|
||||
import {SYSTEM_IDENTIFIERS} from '@constants/database';
|
||||
import DatabaseManager from '@database/manager';
|
||||
import NetworkManager from '@init/network_manager';
|
||||
@@ -11,6 +9,7 @@ import {queryExpandedLinks} from '@queries/servers/system';
|
||||
import {forceLogoutIfNecessary} from './session';
|
||||
|
||||
import type {Client} from '@client/rest';
|
||||
import type {ClientResponse} from '@mattermost/react-native-network-client';
|
||||
|
||||
export const doPing = async (serverUrl: string) => {
|
||||
const client = await NetworkManager.createClient(serverUrl);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
import {Q} from '@nozbe/watermelondb';
|
||||
|
||||
import {MM_TABLES, SYSTEM_IDENTIFIERS} from '@constants/database';
|
||||
|
||||
@@ -11,12 +11,12 @@ import {queryDeviceToken} from '@queries/app/global';
|
||||
import {queryCurrentUserId, queryCommonSystemValues} from '@queries/servers/system';
|
||||
import {getCSRFFromCookie} from '@utils/security';
|
||||
|
||||
import type {LoginArgs} from '@typings/database/database';
|
||||
|
||||
import {logError} from './error';
|
||||
import {loginEntry} from './entry';
|
||||
import {logError} from './error';
|
||||
import {fetchDataRetentionPolicy} from './systems';
|
||||
|
||||
import type {LoginArgs} from '@typings/database/database';
|
||||
|
||||
const HTTP_UNAUTHORIZED = 401;
|
||||
|
||||
export const completeLogin = async (serverUrl: string, user: UserProfile) => {
|
||||
|
||||
@@ -12,8 +12,9 @@ import {fetchMyChannelsForTeam} from './channel';
|
||||
import {fetchPostsForUnreadChannels} from './post';
|
||||
import {fetchRolesIfNeeded} from './role';
|
||||
import {forceLogoutIfNecessary} from './session';
|
||||
import TeamModel from '@typings/database/models/servers/team';
|
||||
import TeamMembershipModel from '@typings/database/models/servers/team_membership';
|
||||
|
||||
import type TeamModel from '@typings/database/models/servers/team';
|
||||
import type TeamMembershipModel from '@typings/database/models/servers/team_membership';
|
||||
|
||||
export type MyTeamsRequest = {
|
||||
teams?: Team[];
|
||||
|
||||
@@ -2,22 +2,23 @@
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
import {Q} from '@nozbe/watermelondb';
|
||||
|
||||
import {fetchRolesIfNeeded} from '@actions/remote/role';
|
||||
import {Database, General} from '@constants';
|
||||
import DatabaseManager from '@database/manager';
|
||||
import {debounce} from '@helpers/api/general';
|
||||
import analytics from '@init/analytics';
|
||||
import NetworkManager from '@init/network_manager';
|
||||
import {prepareUsers, queryCurrentUser, queryUsersById, queryUsersByUsername} from '@queries/servers/user';
|
||||
import {queryCurrentUserId} from '@queries/servers/system';
|
||||
import {prepareUsers, queryCurrentUser, queryUsersById, queryUsersByUsername} from '@queries/servers/user';
|
||||
|
||||
import {forceLogoutIfNecessary} from './session';
|
||||
|
||||
import type {Client} from '@client/rest';
|
||||
import type {LoadMeArgs} from '@typings/database/database';
|
||||
import type RoleModel from '@typings/database/models/servers/role';
|
||||
import type UserModel from '@typings/database/models/servers/user';
|
||||
|
||||
import {forceLogoutIfNecessary} from './session';
|
||||
|
||||
export type ProfilesPerChannelRequest = {
|
||||
data?: ProfilesInChannelRequest[];
|
||||
error?: never;
|
||||
|
||||
@@ -8,6 +8,9 @@ import {t} from '@i18n';
|
||||
import {Analytics, create} from '@init/analytics';
|
||||
import {setServerCredentials} from '@init/credentials';
|
||||
|
||||
import * as ClientConstants from './constants';
|
||||
import ClientError from './error';
|
||||
|
||||
import type {
|
||||
APIClientInterface,
|
||||
ClientHeaders,
|
||||
@@ -15,9 +18,6 @@ import type {
|
||||
RequestOptions,
|
||||
} from '@mattermost/react-native-network-client';
|
||||
|
||||
import * as ClientConstants from './constants';
|
||||
import ClientError from './error';
|
||||
|
||||
export default class ClientBase {
|
||||
analytics: Analytics|undefined;
|
||||
apiClient: APIClientInterface;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
import assert from 'assert';
|
||||
|
||||
import nock from 'nock';
|
||||
|
||||
import {HEADER_X_VERSION_ID} from '@client/rest/constants';
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
|
||||
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 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';
|
||||
|
||||
@@ -5,8 +5,8 @@ import React from 'react';
|
||||
import {StyleSheet, TextStyle, View} from 'react-native';
|
||||
import DeviceInfo from 'react-native-device-info';
|
||||
|
||||
import {t} from '@i18n';
|
||||
import FormattedText from '@components/formatted_text';
|
||||
import {t} from '@i18n';
|
||||
|
||||
const style = StyleSheet.create({
|
||||
info: {
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
import Database from '@nozbe/watermelondb/Database';
|
||||
import React from 'react';
|
||||
|
||||
import CustomStatusEmoji from '@components/custom_status/custom_status_emoji';
|
||||
import {renderWithEverything} from '@test/intl-test-helper';
|
||||
import TestHelper from '@test/test_helper';
|
||||
import Database from '@nozbe/watermelondb/Database';
|
||||
|
||||
describe('components/custom_status/custom_status_emoji', () => {
|
||||
let database: Database | undefined;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import CustomStatusText from '@components/custom_status/custom_status_text';
|
||||
|
||||
@@ -23,8 +23,8 @@ import NetworkManager from '@init/network_manager';
|
||||
import {EmojiIndicesByAlias, Emojis} from '@utils/emoji';
|
||||
|
||||
import type {WithDatabaseArgs} from '@typings/database/database';
|
||||
import type CustomEmojiModel from '@typings/database/models/servers/custom_emoji';
|
||||
import type SystemModel from '@typings/database/models/servers/system';
|
||||
import CustomEmojiModel from '@typings/database/models/servers/custom_emoji';
|
||||
|
||||
const assetImages = new Map([['mattermost.png', require('@assets/images/emojis/mattermost.png')]]);
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
import React from 'react';
|
||||
import {render} from '@testing-library/react-native';
|
||||
import React from 'react';
|
||||
|
||||
import {Preferences} from '@constants';
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import AtMention from '@components/markdown/at_mention';
|
||||
import MarkdownLink from '@components/markdown/markdown_link';
|
||||
import {useTheme} from '@context/theme';
|
||||
import {getMarkdownTextStyles} from '@utils/markdown';
|
||||
import {concatStyles, changeOpacity, makeStyleSheetFromTheme} from '@app/utils/theme';
|
||||
import {concatStyles, changeOpacity, makeStyleSheetFromTheme} from '@utils/theme';
|
||||
|
||||
import type {PrimitiveType} from 'intl-messageformat';
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
import {createElement, isValidElement} from 'react';
|
||||
import {StyleProp, Text, TextProps, TextStyle, ViewStyle} from 'react-native';
|
||||
import {useIntl} from 'react-intl';
|
||||
import {StyleProp, Text, TextProps, TextStyle, ViewStyle} from 'react-native';
|
||||
|
||||
type FormattedTextProps = TextProps & {
|
||||
id: string;
|
||||
|
||||
@@ -11,13 +11,13 @@ import {useIntl} from 'react-intl';
|
||||
import {DeviceEventEmitter, GestureResponderEvent, StyleProp, StyleSheet, Text, TextStyle, View} from 'react-native';
|
||||
import {of as of$} from 'rxjs';
|
||||
|
||||
import CompassIcon from '@components/compass_icon';
|
||||
import SlideUpPanelItem, {ITEM_HEIGHT} from '@components/slide_up_panel_item';
|
||||
import {useTheme} from '@context/theme';
|
||||
import {Navigation, Preferences} from '@constants';
|
||||
import {MM_TABLES, SYSTEM_IDENTIFIERS} from '@constants/database';
|
||||
import {useTheme} from '@context/theme';
|
||||
import UserModel from '@database/models/server/user';
|
||||
import {getTeammateNameDisplaySetting} from '@helpers/api/preference';
|
||||
import CompassIcon from '@components/compass_icon';
|
||||
import {showModal, showModalOverCurrentContext} from '@screens/navigation';
|
||||
import {displayUsername, getUserMentionKeys, getUsersByUsername} from '@utils/user';
|
||||
|
||||
|
||||
@@ -21,9 +21,9 @@ import MarkdownLink from './markdown_link';
|
||||
import MarkdownList from './markdown_list';
|
||||
import MarkdownListItem from './markdown_list_item';
|
||||
import MarkdownTable from './markdown_table';
|
||||
import MarkdownTableCell, {MarkdownTableCellProps} from './markdown_table_cell';
|
||||
import MarkdownTableImage from './markdown_table_image';
|
||||
import MarkdownTableRow, {MarkdownTableRowProps} from './markdown_table_row';
|
||||
import MarkdownTableCell, {MarkdownTableCellProps} from './markdown_table_cell';
|
||||
import {addListItemIndices, combineTextNodes, highlightMentions, pullOutImages} from './transform';
|
||||
|
||||
import type {MarkdownBlockStyles, MarkdownTextStyles, UserMentionKey} from '@typings/global/markdown';
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
import React, {ReactNode} from 'react';
|
||||
|
||||
import {StyleSheet, TextStyle, View, ViewStyle} from 'react-native';
|
||||
|
||||
import CompassIcon from '@components/compass_icon';
|
||||
|
||||
@@ -8,10 +8,10 @@ import {useIntl} from 'react-intl';
|
||||
import {DeviceEventEmitter, Keyboard, StyleSheet, Text, TextStyle, View} from 'react-native';
|
||||
|
||||
import FormattedText from '@components/formatted_text';
|
||||
import {useTheme} from '@context/theme';
|
||||
import SlideUpPanelItem, {ITEM_HEIGHT} from '@components/slide_up_panel_item';
|
||||
import TouchableWithFeedback from '@components/touchable_with_feedback';
|
||||
import {Navigation} from '@constants';
|
||||
import {useTheme} from '@context/theme';
|
||||
import {goToScreen, showModalOverCurrentContext} from '@screens/navigation';
|
||||
import {getDisplayNameForLanguage} from '@utils/markdown';
|
||||
import {preventDoubleTap} from '@utils/tap';
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
import {useManagedConfig} from '@mattermost/react-native-emm';
|
||||
import Clipboard from '@react-native-community/clipboard';
|
||||
import {withDatabase} from '@nozbe/watermelondb/DatabaseProvider';
|
||||
import withObservables from '@nozbe/with-observables';
|
||||
import Clipboard from '@react-native-community/clipboard';
|
||||
import React, {Children, ReactElement, useCallback} from 'react';
|
||||
import {useIntl} from 'react-intl';
|
||||
import {Alert, DeviceEventEmitter, StyleSheet, Text, View} from 'react-native';
|
||||
@@ -20,8 +20,8 @@ import DeepLinkTypes from '@constants/deep_linking';
|
||||
import {useServerUrl} from '@context/server_url';
|
||||
import {dismissAllModals, popToRoot, showModalOverCurrentContext} from '@screens/navigation';
|
||||
import {errorBadChannel} from '@utils/draft';
|
||||
import {matchDeepLink, normalizeProtocol, tryOpenURL} from '@utils/url';
|
||||
import {preventDoubleTap} from '@utils/tap';
|
||||
import {matchDeepLink, normalizeProtocol, tryOpenURL} from '@utils/url';
|
||||
|
||||
import type {WithDatabaseArgs} from '@typings/database/database';
|
||||
import type SystemModel from '@typings/database/models/servers/system';
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
import {useServerUrl} from '@context/server_url';
|
||||
import {generateId} from '@utils/general';
|
||||
import React, {memo, useCallback, useRef, useState} from 'react';
|
||||
import {StyleSheet, View} from 'react-native';
|
||||
import parseUrl from 'url-parse';
|
||||
@@ -10,7 +8,9 @@ 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 {useServerUrl} from '@context/server_url';
|
||||
import {openGallerWithMockFile} from '@utils/gallery';
|
||||
import {generateId} from '@utils/general';
|
||||
import {calculateDimensions, isGifTooLarge} from '@utils/images';
|
||||
|
||||
type MarkdownTableImageProps = {
|
||||
|
||||
@@ -7,8 +7,8 @@ import {Keyboard, StyleProp, View, ViewStyle} from 'react-native';
|
||||
|
||||
import {fetchMissinProfilesByIds, fetchMissinProfilesByUsernames} from '@actions/remote/user';
|
||||
import Markdown from '@components/markdown';
|
||||
import SystemAvatar from '@app/components/system_avatar';
|
||||
import SystemHeader from '@app/components/system_header';
|
||||
import SystemAvatar from '@components/system_avatar';
|
||||
import SystemHeader from '@components/system_header';
|
||||
import TouchableWithFeedback from '@components/touchable_with_feedback';
|
||||
import {Post as PostConstants} from '@constants';
|
||||
import {useServerUrl} from '@context/server_url';
|
||||
|
||||
@@ -9,10 +9,10 @@ import {DeviceEventEmitter, FlatList, Platform, RefreshControl, StyleSheet, View
|
||||
import {of as of$} from 'rxjs';
|
||||
import {switchMap} from 'rxjs/operators';
|
||||
|
||||
import Post from '@components/post_list/post';
|
||||
import CombinedUserActivity from '@app/components/post_list/combined_user_activity';
|
||||
import CombinedUserActivity from '@components/post_list/combined_user_activity';
|
||||
import DateSeparator from '@components/post_list/date_separator';
|
||||
import NewMessagesLine from '@components/post_list/new_message_line';
|
||||
import Post from '@components/post_list/post';
|
||||
import {Preferences} from '@constants';
|
||||
import {MM_TABLES, SYSTEM_IDENTIFIERS} from '@constants/database';
|
||||
import {useTheme} from '@context/theme';
|
||||
@@ -26,7 +26,7 @@ import type PostModel from '@typings/database/models/servers/post';
|
||||
import type PostsInChannelModel from '@typings/database/models/servers/posts_in_channel';
|
||||
import type PreferenceModel from '@typings/database/models/servers/preference';
|
||||
import type SystemModel from '@typings/database/models/servers/system';
|
||||
import UserModel from '@typings/database/models/servers/user';
|
||||
import type UserModel from '@typings/database/models/servers/user';
|
||||
|
||||
type RefreshProps = {
|
||||
children: ReactElement;
|
||||
|
||||
@@ -11,8 +11,8 @@ import {of as of$} from 'rxjs';
|
||||
import {switchMap} from 'rxjs/operators';
|
||||
|
||||
import CompassIcon from '@components/compass_icon';
|
||||
import SystemAvatar from '@components/system_avatar';
|
||||
import ProfilePicture from '@components/profile_picture';
|
||||
import SystemAvatar from '@components/system_avatar';
|
||||
import TouchableWithFeedback from '@components/touchable_with_feedback';
|
||||
import {View as ViewConstant} from '@constants';
|
||||
import {MM_TABLES, SYSTEM_IDENTIFIERS} from '@constants/database';
|
||||
@@ -22,13 +22,12 @@ import NetworkManager from '@init/network_manager';
|
||||
import {showModal} from '@screens/navigation';
|
||||
import {preventDoubleTap} from '@utils/tap';
|
||||
|
||||
import type {ImageSource} from 'react-native-vector-icons/Icon';
|
||||
|
||||
import type {Client} from '@client/rest';
|
||||
import type {WithDatabaseArgs} from '@typings/database/database';
|
||||
import type PostModel from '@typings/database/models/servers/post';
|
||||
import type UserModel from '@typings/database/models/servers/user';
|
||||
import type SystemModel from '@typings/database/models/servers/system';
|
||||
import type UserModel from '@typings/database/models/servers/user';
|
||||
import type {ImageSource} from 'react-native-vector-icons/Icon';
|
||||
|
||||
type AvatarProps = {
|
||||
author: UserModel;
|
||||
|
||||
@@ -11,8 +11,8 @@ import {switchMap} from 'rxjs/operators';
|
||||
|
||||
import {removePost, sendAddToChannelEphemeralPost} from '@actions/local/post';
|
||||
import {addMembersToChannel} from '@actions/remote/channel';
|
||||
import AtMention from '@components/markdown/at_mention';
|
||||
import FormattedText from '@components/formatted_text';
|
||||
import AtMention from '@components/markdown/at_mention';
|
||||
import {General} from '@constants';
|
||||
import {MM_TABLES, SYSTEM_IDENTIFIERS} from '@constants/database';
|
||||
import {useServerUrl} from '@context/server_url';
|
||||
@@ -23,8 +23,8 @@ import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme';
|
||||
import type {WithDatabaseArgs} from '@typings/database/database';
|
||||
import type ChannelModel from '@typings/database/models/servers/channel';
|
||||
import type PostModel from '@typings/database/models/servers/post';
|
||||
import type SystemModel from '@typings/database/models/servers/system';
|
||||
import type UserModel from '@typings/database/models/servers/user';
|
||||
import SystemModel from '@typings/database/models/servers/system';
|
||||
|
||||
type AddMembersProps = {
|
||||
channelType: string | null;
|
||||
|
||||
@@ -6,7 +6,7 @@ import {LayoutChangeEvent, useWindowDimensions, ScrollView, View} from 'react-na
|
||||
import Animated from 'react-native-reanimated';
|
||||
|
||||
import Markdown from '@components/markdown';
|
||||
import ShowMoreButton from '@app/components/post_list/post/body/message/show_more_button';
|
||||
import ShowMoreButton from '@components/post_list/post/body/message/show_more_button';
|
||||
import {useShowMoreAnimatedStyle} from '@hooks/show_more';
|
||||
import {getMarkdownBlockStyles, getMarkdownTextStyles} from '@utils/markdown';
|
||||
import {makeStyleSheetFromTheme} from '@utils/theme';
|
||||
|
||||
@@ -10,16 +10,16 @@ import {of as of$} from 'rxjs';
|
||||
import {switchMap} from 'rxjs/operators';
|
||||
|
||||
import {getRedirectLocation} from '@actions/remote/general';
|
||||
import FileIcon from '@app/components/post_list/post/body/files/file_icon';
|
||||
import FileIcon from '@components/post_list/post/body/files/file_icon';
|
||||
import ProgressiveImage from '@components/progressive_image';
|
||||
import TouchableWithFeedback from '@components/touchable_with_feedback';
|
||||
import {Device} from '@constants';
|
||||
import {MM_TABLES, SYSTEM_IDENTIFIERS} from '@constants/database';
|
||||
import {useServerUrl} from '@context/server_url';
|
||||
import useDidUpdate from '@hooks/did_update';
|
||||
import {useSplitView} from '@hooks/device';
|
||||
import {generateId} from '@utils/general';
|
||||
import useDidUpdate from '@hooks/did_update';
|
||||
import {openGallerWithMockFile} from '@utils/gallery';
|
||||
import {generateId} from '@utils/general';
|
||||
import {calculateDimensions, getViewPortWidth, isGifTooLarge} from '@utils/images';
|
||||
import {changeOpacity} from '@utils/theme';
|
||||
import {isImageLink, isValidUrl} from '@utils/url';
|
||||
|
||||
@@ -4,9 +4,8 @@
|
||||
import React, {useCallback, useState} from 'react';
|
||||
|
||||
import {selectAttachmentMenuAction} from '@actions/local/post';
|
||||
import {useServerUrl} from '@context/server_url';
|
||||
|
||||
import AutocompleteSelector from '@components/autocomplete_selector';
|
||||
import {useServerUrl} from '@context/server_url';
|
||||
|
||||
type Props = {
|
||||
dataSource?: string;
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
import React, {useCallback, useRef, useState} from 'react';
|
||||
import {View} from 'react-native';
|
||||
|
||||
import FileIcon from '@app/components/post_list/post/body/files/file_icon';
|
||||
import FileIcon from '@components/post_list/post/body/files/file_icon';
|
||||
import ProgressiveImage from '@components/progressive_image';
|
||||
import TouchableWithFeedback from '@components/touchable_with_feedback';
|
||||
import {Device} from '@constants';
|
||||
import {useSplitView} from '@hooks/device';
|
||||
import {generateId} from '@utils/general';
|
||||
import {openGallerWithMockFile} from '@utils/gallery';
|
||||
import {generateId} from '@utils/general';
|
||||
import {isGifTooLarge, calculateDimensions, getViewPortWidth} from '@utils/images';
|
||||
import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme';
|
||||
import {isValidUrl} from '@utils/url';
|
||||
|
||||
@@ -6,7 +6,7 @@ import {LayoutChangeEvent, useWindowDimensions, ScrollView, StyleProp, StyleShee
|
||||
import Animated from 'react-native-reanimated';
|
||||
|
||||
import Markdown from '@components/markdown';
|
||||
import ShowMoreButton from '@app/components/post_list/post/body/message/show_more_button';
|
||||
import ShowMoreButton from '@components/post_list/post/body/message/show_more_button';
|
||||
import {useShowMoreAnimatedStyle} from '@hooks/show_more';
|
||||
|
||||
import type {MarkdownBlockStyles, MarkdownTextStyles} from '@typings/global/markdown';
|
||||
|
||||
@@ -12,9 +12,8 @@ import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme';
|
||||
|
||||
import FileIcon from './file_icon';
|
||||
|
||||
import type {ResizeMode} from 'react-native-fast-image';
|
||||
|
||||
import type {Client} from '@client/rest';
|
||||
import type {ResizeMode} from 'react-native-fast-image';
|
||||
|
||||
type ImageFileProps = {
|
||||
backgroundColor?: string;
|
||||
|
||||
@@ -17,8 +17,8 @@ import Files from './files';
|
||||
import Message from './message';
|
||||
import Reactions from './reactions';
|
||||
|
||||
import type FileModel from '@typings/database/models/servers/file';
|
||||
import type PostModel from '@typings/database/models/servers/post';
|
||||
import FileModel from '@typings/database/models/servers/file';
|
||||
|
||||
type BodyProps = {
|
||||
appsEnabled: boolean;
|
||||
|
||||
@@ -8,15 +8,14 @@ import Animated from 'react-native-reanimated';
|
||||
import Markdown from '@components/markdown';
|
||||
import {SEARCH} from '@constants/screens';
|
||||
import {useShowMoreAnimatedStyle} from '@hooks/show_more';
|
||||
import {getMentionKeysForPost} from '@utils/post';
|
||||
import {getMarkdownTextStyles, getMarkdownBlockStyles} from '@utils/markdown';
|
||||
|
||||
import {getMentionKeysForPost} from '@utils/post';
|
||||
import {makeStyleSheetFromTheme} from '@utils/theme';
|
||||
|
||||
import ShowMoreButton from './show_more_button';
|
||||
|
||||
import type PostModel from '@typings/database/models/servers/post';
|
||||
import type GroupModel from '@typings/database/models/servers/group';
|
||||
import type PostModel from '@typings/database/models/servers/post';
|
||||
import type UserModel from '@typings/database/models/servers/user';
|
||||
|
||||
type MessageProps = {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
import withObservables from '@nozbe/with-observables';
|
||||
import {withDatabase} from '@nozbe/watermelondb/DatabaseProvider';
|
||||
import withObservables from '@nozbe/with-observables';
|
||||
import {from as from$, of as of$} from 'rxjs';
|
||||
import {switchMap} from 'rxjs/operators';
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@ import FormattedTime from '@components/formatted_time';
|
||||
import {CHANNEL, THREAD} from '@constants/screens';
|
||||
import {useTheme} from '@context/theme';
|
||||
import {postUserDisplayName} from '@utils/post';
|
||||
import {displayUsername, getUserCustomStatus, getUserTimezone, isCustomStatusExpired} from '@utils/user';
|
||||
import {makeStyleSheetFromTheme} from '@utils/theme';
|
||||
import {displayUsername, getUserCustomStatus, getUserTimezone, isCustomStatusExpired} from '@utils/user';
|
||||
|
||||
import HeaderCommentedOn from './commented_on';
|
||||
import HeaderDisplayName from './display_name';
|
||||
|
||||
@@ -16,8 +16,8 @@ import Header from './header';
|
||||
|
||||
import type {WithDatabaseArgs} from '@typings/database/database';
|
||||
import type PostModel from '@typings/database/models/servers/post';
|
||||
import type SystemModel from '@typings/database/models/servers/system';
|
||||
import type PreferenceModel from '@typings/database/models/servers/preference';
|
||||
import type SystemModel from '@typings/database/models/servers/system';
|
||||
|
||||
type HeaderInputProps = {
|
||||
config: ClientConfig;
|
||||
|
||||
@@ -17,12 +17,12 @@ import {canManageChannelMembers, hasPermissionForPost} from '@utils/role';
|
||||
import Post from './post';
|
||||
|
||||
import type {WithDatabaseArgs} from '@typings/database/database';
|
||||
import type PreferenceModel from '@typings/database/models/servers/preference';
|
||||
import type CustomEmojiModel from '@typings/database/models/servers/custom_emoji';
|
||||
import type PostModel from '@typings/database/models/servers/post';
|
||||
import type PostsInThreadModel from '@typings/database/models/servers/posts_in_thread';
|
||||
import type PreferenceModel from '@typings/database/models/servers/preference';
|
||||
import type SystemModel from '@typings/database/models/servers/system';
|
||||
import type UserModel from '@typings/database/models/servers/user';
|
||||
import PostsInThreadModel from '@typings/database/models/servers/posts_in_thread';
|
||||
import CustomEmojiModel from '@typings/database/models/servers/custom_emoji';
|
||||
|
||||
const {SERVER: {CUSTOM_EMOJI, POST, PREFERENCE, SYSTEM, USER}} = MM_TABLES;
|
||||
|
||||
|
||||
@@ -7,12 +7,12 @@ import {DeviceEventEmitter, Keyboard, StyleProp, View, ViewStyle} from 'react-na
|
||||
|
||||
import {showPermalink} from '@actions/local/permalink';
|
||||
import {removePost} from '@actions/local/post';
|
||||
import SystemAvatar from '@app/components/system_avatar';
|
||||
import SystemHeader from '@app/components/system_header';
|
||||
import SystemAvatar from '@components/system_avatar';
|
||||
import SystemHeader from '@components/system_header';
|
||||
import TouchableWithFeedback from '@components/touchable_with_feedback';
|
||||
import * as Screens from '@constants/screens';
|
||||
import {useTheme} from '@context/theme';
|
||||
import {useServerUrl} from '@context/server_url';
|
||||
import {useTheme} from '@context/theme';
|
||||
import {showModalOverCurrentContext} from '@screens/navigation';
|
||||
import {fromAutoResponder, isFromWebhook, isPostPendingOrFailed, isSystemMessage} from '@utils/post';
|
||||
import {preventDoubleTap} from '@utils/tap';
|
||||
@@ -24,9 +24,9 @@ import Header from './header';
|
||||
import PreHeader from './pre_header';
|
||||
import SystemMessage from './system_message';
|
||||
|
||||
import type FileModel from '@typings/database/models/servers/file';
|
||||
import type PostModel from '@typings/database/models/servers/post';
|
||||
import type UserModel from '@typings/database/models/servers/user';
|
||||
import FileModel from '@typings/database/models/servers/file';
|
||||
|
||||
type PostProps = {
|
||||
appsEnabled: boolean;
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
|
||||
import withObservables from '@nozbe/with-observables';
|
||||
|
||||
import type PostModel from '@typings/database/models/servers/post';
|
||||
|
||||
import SystemMessage from './system_message';
|
||||
|
||||
import type PostModel from '@typings/database/models/servers/post';
|
||||
|
||||
const withPost = withObservables(['post'], ({post}: {post: PostModel}) => ({
|
||||
author: post.author.observe(),
|
||||
}));
|
||||
|
||||
@@ -12,10 +12,9 @@ import {t} from '@i18n';
|
||||
import {getMarkdownTextStyles} from '@utils/markdown';
|
||||
import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme';
|
||||
|
||||
import type {PrimitiveType} from 'intl-messageformat';
|
||||
|
||||
import type PostModel from '@typings/database/models/servers/post';
|
||||
import type UserModel from '@typings/database/models/servers/user';
|
||||
import type {PrimitiveType} from 'intl-messageformat';
|
||||
|
||||
type SystemMessageProps = {
|
||||
author?: UserModel;
|
||||
|
||||
@@ -9,7 +9,7 @@ import {useIntl} from 'react-intl';
|
||||
import {View} from '@constants';
|
||||
import {MM_TABLES, SYSTEM_IDENTIFIERS} from '@constants/database';
|
||||
import {isMinimumServerVersion} from '@utils/helpers';
|
||||
import {unsupportedServer} from '@app/utils/supported_server';
|
||||
import {unsupportedServer} from '@utils/supported_server';
|
||||
import {isSystemAdmin} from '@utils/user';
|
||||
|
||||
import type {WithDatabaseArgs} from '@typings/database/database';
|
||||
|
||||
@@ -17,10 +17,9 @@ import {makeStyleSheetFromTheme} from '@utils/theme';
|
||||
import {getUserTimezone} from '@utils/user';
|
||||
|
||||
import type {WithDatabaseArgs} from '@typings/database/database';
|
||||
|
||||
import type PreferenceModel from '@typings/database/models/servers/preference';
|
||||
import type SystemModel from '@typings/database/models/servers/system';
|
||||
import type UserModel from '@typings/database/models/servers/user';
|
||||
import type PreferenceModel from '@typings/database/models/servers/preference';
|
||||
|
||||
type withUserInputProps = {
|
||||
config: SystemModel;
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
import React from 'react';
|
||||
|
||||
import CompassIcon from '@components/compass_icon';
|
||||
import {useTheme} from '@context/theme';
|
||||
import {General} from '@constants';
|
||||
import {useTheme} from '@context/theme';
|
||||
import {changeOpacity} from '@utils/theme';
|
||||
|
||||
type UserStatusProps = {
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
import {Platform} from 'react-native';
|
||||
import {FileSystem} from 'react-native-unimodules';
|
||||
import DeviceInfo from 'react-native-device-info';
|
||||
import {FileSystem} from 'react-native-unimodules';
|
||||
|
||||
import keyMirror from '@utils/key_mirror';
|
||||
|
||||
|
||||
@@ -15,8 +15,8 @@ import Network from './network';
|
||||
import Permissions from './permissions';
|
||||
import Post from './post';
|
||||
import Preferences from './preferences';
|
||||
import SSO, {REDIRECT_URL_SCHEME, REDIRECT_URL_SCHEME_DEV} from './sso';
|
||||
import Screens from './screens';
|
||||
import SSO, {REDIRECT_URL_SCHEME, REDIRECT_URL_SCHEME_DEV} from './sso';
|
||||
import View, {Upgrade} from './view';
|
||||
import WebsocketEvents from './websocket';
|
||||
|
||||
|
||||
@@ -11,8 +11,8 @@ import {MM_TABLES, SYSTEM_IDENTIFIERS} from '@constants/database';
|
||||
import EphemeralStore from '@store/ephemeral_store';
|
||||
import {setNavigationStackStyles} from '@utils/theme';
|
||||
|
||||
import type Database from '@nozbe/watermelondb/Database';
|
||||
import type {PreferenceModel, SystemModel} from '@database/models/server';
|
||||
import type Database from '@nozbe/watermelondb/Database';
|
||||
|
||||
type Props = {
|
||||
currentTeamId: SystemModel[];
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
import React, {ComponentType, useEffect, useState} from 'react';
|
||||
import {Database} from '@nozbe/watermelondb';
|
||||
import DatabaseProvider from '@nozbe/watermelondb/DatabaseProvider';
|
||||
import React, {ComponentType, useEffect, useState} from 'react';
|
||||
|
||||
import {MM_TABLES} from '@constants/database';
|
||||
import ServerUrlProvider from '@context/server_url';
|
||||
|
||||
@@ -3,33 +3,31 @@
|
||||
|
||||
import {Database, Q} from '@nozbe/watermelondb';
|
||||
import LokiJSAdapter from '@nozbe/watermelondb/adapters/lokijs';
|
||||
|
||||
import logger from '@nozbe/watermelondb/utils/common/logger';
|
||||
import {DeviceEventEmitter, Platform} from 'react-native';
|
||||
import {FileSystem} from 'react-native-unimodules';
|
||||
import urlParse from 'url-parse';
|
||||
|
||||
import {MIGRATION_EVENTS, MM_TABLES} from '@constants/database';
|
||||
import AppDataOperator from '@database/operator/app_data_operator';
|
||||
import AppDatabaseMigrations from '@app/database/migration/app';
|
||||
import {InfoModel, GlobalModel, ServersModel} from '@database/models/app';
|
||||
import {schema as appSchema} from '@app/database/schema/app';
|
||||
import AppDatabaseMigrations from '@database/migration/app';
|
||||
import ServerDatabaseMigrations from '@database/migration/server';
|
||||
import {InfoModel, GlobalModel, ServersModel} from '@database/models/app';
|
||||
import {ChannelModel, ChannelInfoModel, ChannelMembershipModel, CustomEmojiModel, DraftModel, FileModel,
|
||||
GroupModel, GroupMembershipModel, GroupsChannelModel, GroupsTeamModel, MyChannelModel, MyChannelSettingsModel, MyTeamModel,
|
||||
PostModel, PostsInChannelModel, PostsInThreadModel, PreferenceModel, ReactionModel, RoleModel,
|
||||
SlashCommandModel, SystemModel, TeamModel, TeamChannelHistoryModel, TeamMembershipModel, TeamSearchHistoryModel,
|
||||
TermsOfServiceModel, UserModel,
|
||||
} from '@database/models/server';
|
||||
import AppDataOperator from '@database/operator/app_data_operator';
|
||||
import ServerDataOperator from '@database/operator/server_data_operator';
|
||||
import {schema as appSchema} from '@database/schema/app';
|
||||
import {serverSchema} from '@database/schema/server';
|
||||
import {queryActiveServer, queryServer} from '@queries/app/servers';
|
||||
import {DatabaseType} from '@typings/database/enums';
|
||||
import {deleteIOSDatabase} from '@utils/mattermost_managed';
|
||||
import {hashCode} from '@utils/security';
|
||||
|
||||
import type {AppDatabase, CreateServerDatabaseArgs, Models, RegisterServerDatabaseArgs, ServerDatabase, ServerDatabases} from '@typings/database/database';
|
||||
import {DatabaseType} from '@typings/database/enums';
|
||||
|
||||
import ServerDataOperator from '../../operator/server_data_operator';
|
||||
|
||||
const {SERVERS} = MM_TABLES.APP;
|
||||
const APP_DATABASE = 'app';
|
||||
|
||||
@@ -10,26 +10,25 @@ import {FileSystem} from 'react-native-unimodules';
|
||||
import urlParse from 'url-parse';
|
||||
|
||||
import {MIGRATION_EVENTS, MM_TABLES} from '@constants/database';
|
||||
import AppDataOperator from '@database/operator/app_data_operator';
|
||||
import AppDatabaseMigrations from '@database/migration/app';
|
||||
import {InfoModel, GlobalModel, ServersModel} from '@database/models/app';
|
||||
import {schema as appSchema} from '@database/schema/app';
|
||||
import ServerDatabaseMigrations from '@database/migration/server';
|
||||
import {InfoModel, GlobalModel, ServersModel} from '@database/models/app';
|
||||
import {ChannelModel, ChannelInfoModel, ChannelMembershipModel, CustomEmojiModel, DraftModel, FileModel,
|
||||
GroupModel, GroupMembershipModel, GroupsChannelModel, GroupsTeamModel, MyChannelModel, MyChannelSettingsModel, MyTeamModel,
|
||||
PostModel, PostsInChannelModel, PostsInThreadModel, PreferenceModel, ReactionModel, RoleModel,
|
||||
SlashCommandModel, SystemModel, TeamModel, TeamChannelHistoryModel, TeamMembershipModel, TeamSearchHistoryModel,
|
||||
TermsOfServiceModel, UserModel,
|
||||
} from '@database/models/server';
|
||||
import AppDataOperator from '@database/operator/app_data_operator';
|
||||
import ServerDataOperator from '@database/operator/server_data_operator';
|
||||
import {schema as appSchema} from '@database/schema/app';
|
||||
import {serverSchema} from '@database/schema/server';
|
||||
import {queryActiveServer, queryServer} from '@queries/app/servers';
|
||||
import {DatabaseType} from '@typings/database/enums';
|
||||
import {deleteIOSDatabase, getIOSAppGroupDetails} from '@utils/mattermost_managed';
|
||||
import {hashCode} from '@utils/security';
|
||||
|
||||
import type {AppDatabase, CreateServerDatabaseArgs, RegisterServerDatabaseArgs, Models, ServerDatabase, ServerDatabases} from '@typings/database/database';
|
||||
import {DatabaseType} from '@typings/database/enums';
|
||||
|
||||
import ServerDataOperator from '../operator/server_data_operator';
|
||||
|
||||
const {SERVERS} = MM_TABLES.APP;
|
||||
const APP_DATABASE = 'app';
|
||||
|
||||
@@ -5,11 +5,11 @@ import {Q} from '@nozbe/watermelondb';
|
||||
import {Platform} from 'react-native';
|
||||
|
||||
import {MM_TABLES} from '@constants/database';
|
||||
import {DatabaseType} from '@typings/database/enums';
|
||||
import {getIOSAppGroupDetails} from '@utils/mattermost_managed';
|
||||
|
||||
import DatabaseManager from './index';
|
||||
|
||||
import {DatabaseType} from '@typings/database/enums';
|
||||
import type ServersModel from '@typings/database/models/app/servers';
|
||||
|
||||
export default async () => {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
import Model, {Associations} from '@nozbe/watermelondb/Model';
|
||||
import {field, json} from '@nozbe/watermelondb/decorators';
|
||||
import Model, {Associations} from '@nozbe/watermelondb/Model';
|
||||
|
||||
import {MM_TABLES} from '@constants/database';
|
||||
import {safeParseJSON} from '@utils/helpers';
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
import {Relation} from '@nozbe/watermelondb';
|
||||
import Model, {Associations} from '@nozbe/watermelondb/Model';
|
||||
import {field, immutableRelation} from '@nozbe/watermelondb/decorators';
|
||||
import Model, {Associations} from '@nozbe/watermelondb/Model';
|
||||
|
||||
import {MM_TABLES} from '@constants/database';
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
import Model, {Associations} from '@nozbe/watermelondb/Model';
|
||||
import {children, field} from '@nozbe/watermelondb/decorators';
|
||||
import Model, {Associations} from '@nozbe/watermelondb/Model';
|
||||
|
||||
import {MM_TABLES} from '@constants/database';
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
import {Relation} from '@nozbe/watermelondb';
|
||||
import Model, {Associations} from '@nozbe/watermelondb/Model';
|
||||
import {field, immutableRelation} from '@nozbe/watermelondb/decorators';
|
||||
import Model, {Associations} from '@nozbe/watermelondb/Model';
|
||||
|
||||
import {MM_TABLES} from '@constants/database';
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
import type InfoModel from '@typings/database/models/app/info';
|
||||
import type GlobalModel from '@typings/database/models/app/global';
|
||||
import type InfoModel from '@typings/database/models/app/info';
|
||||
|
||||
export const isRecordInfoEqualToRaw = (record: InfoModel, raw: AppInfo) => {
|
||||
return (raw.build_number === record.buildNumber && raw.version_number === record.versionNumber);
|
||||
|
||||
@@ -3,13 +3,12 @@
|
||||
|
||||
import {MM_TABLES} from '@constants/database';
|
||||
import {prepareBaseRecord} from '@database/operator/server_data_operator/transformers';
|
||||
import {OperationType} from '@typings/database/enums';
|
||||
|
||||
import type {Model} from '@nozbe/watermelondb';
|
||||
|
||||
import type InfoModel from '@typings/database/models/app/info';
|
||||
import type {TransformerArgs} from '@typings/database/database';
|
||||
import {OperationType} from '@typings/database/enums';
|
||||
import type GlobalModel from '@typings/database/models/app/global';
|
||||
import type InfoModel from '@typings/database/models/app/info';
|
||||
|
||||
const {INFO, GLOBAL} = MM_TABLES.APP;
|
||||
|
||||
|
||||
@@ -9,10 +9,10 @@ import {
|
||||
getValidRecordsForUpdate,
|
||||
retrieveRecords,
|
||||
} from '@database/operator/utils/general';
|
||||
import {OperationType} from '@typings/database/enums';
|
||||
|
||||
import type {WriterInterface} from '@nozbe/watermelondb/Database';
|
||||
import type Model from '@nozbe/watermelondb/Model';
|
||||
|
||||
import type {
|
||||
HandleRecordsArgs,
|
||||
OperationArgs,
|
||||
@@ -20,7 +20,6 @@ import type {
|
||||
ProcessRecordsArgs,
|
||||
RecordPair,
|
||||
} from '@typings/database/database';
|
||||
import {OperationType} from '@typings/database/enums';
|
||||
|
||||
export interface BaseDataOperatorType {
|
||||
database: Database;
|
||||
|
||||
@@ -17,9 +17,9 @@ import {
|
||||
} from '@database/operator/server_data_operator/transformers/channel';
|
||||
import {getUniqueRawsBy} from '@database/operator/utils/general';
|
||||
|
||||
import type {HandleChannelArgs, HandleChannelInfoArgs, HandleMyChannelArgs, HandleMyChannelSettingsArgs} from '@typings/database/database';
|
||||
import type ChannelModel from '@typings/database/models/servers/channel';
|
||||
import type ChannelInfoModel from '@typings/database/models/servers/channel_info';
|
||||
import type {HandleChannelArgs, HandleChannelInfoArgs, HandleMyChannelArgs, HandleMyChannelSettingsArgs} from '@typings/database/database';
|
||||
import type MyChannelModel from '@typings/database/models/servers/my_channel';
|
||||
import type MyChannelSettingsModel from '@typings/database/models/servers/my_channel_settings';
|
||||
|
||||
|
||||
@@ -16,9 +16,8 @@ import {
|
||||
transformTermsOfServiceRecord,
|
||||
} from '@database/operator/server_data_operator/transformers/general';
|
||||
|
||||
import type {Model} from '@nozbe/watermelondb';
|
||||
|
||||
import type ServerDataOperator from '..';
|
||||
import type {Model} from '@nozbe/watermelondb';
|
||||
|
||||
describe('*** DataOperator: Base Handlers tests ***', () => {
|
||||
let operator: ServerDataOperator;
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
import {MM_TABLES} from '@constants/database';
|
||||
import BaseDataOperator from '@database/operator/base_data_operator';
|
||||
import DataOperatorException from '@database/exceptions/data_operator_exception';
|
||||
import BaseDataOperator from '@database/operator/base_data_operator';
|
||||
import {
|
||||
isRecordCustomEmojiEqualToRaw,
|
||||
isRecordRoleEqualToRaw,
|
||||
@@ -19,10 +19,9 @@ import {
|
||||
import {getUniqueRawsBy} from '@database/operator/utils/general';
|
||||
|
||||
import type {Model} from '@nozbe/watermelondb';
|
||||
|
||||
import type {HandleCustomEmojiArgs, HandleRoleArgs, HandleSystemArgs, HandleTOSArgs, OperationArgs} from '@typings/database/database';
|
||||
import type RoleModel from '@typings/database/models/servers/role';
|
||||
import type CustomEmojiModel from '@typings/database/models/servers/custom_emoji';
|
||||
import type RoleModel from '@typings/database/models/servers/role';
|
||||
import type SystemModel from '@typings/database/models/servers/system';
|
||||
import type TermsOfServiceModel from '@typings/database/models/servers/terms_of_service';
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
import {Q} from '@nozbe/watermelondb';
|
||||
|
||||
import {Database} from '@constants';
|
||||
import {transformPostsInChannelRecord} from '@database/operator/server_data_operator/transformers/post';
|
||||
import {getPostListEdges} from '@database//operator/utils/post';
|
||||
import {transformPostsInChannelRecord} from '@database/operator/server_data_operator/transformers/post';
|
||||
|
||||
import type PostsInChannelModel from '@typings/database/models/servers/posts_in_channel';
|
||||
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
import {Q} from '@nozbe/watermelondb';
|
||||
|
||||
import {Database} from '@constants';
|
||||
import {getRawRecordPairs, getValidRecordsForUpdate} from '@database/operator/utils/general';
|
||||
import {transformPostInThreadRecord} from '@database/operator/server_data_operator/transformers/post';
|
||||
import {getPostListEdges} from '@database//operator/utils/post';
|
||||
import {transformPostInThreadRecord} from '@database/operator/server_data_operator/transformers/post';
|
||||
import {getRawRecordPairs, getValidRecordsForUpdate} from '@database/operator/utils/general';
|
||||
|
||||
import type {RecordPair} from '@typings/database/database';
|
||||
import type PostsInThreadModel from '@typings/database/models/servers/posts_in_thread';
|
||||
|
||||
@@ -17,14 +17,14 @@ import {
|
||||
import {getUniqueRawsBy} from '@database/operator/utils/general';
|
||||
import {sanitizeReactions} from '@database/operator/utils/reaction';
|
||||
|
||||
import type ChannelMembershipModel from '@typings/database/models/servers/channel_membership';
|
||||
import type CustomEmojiModel from '@typings/database/models/servers/custom_emoji';
|
||||
import type {
|
||||
HandleChannelMembershipArgs,
|
||||
HandlePreferencesArgs,
|
||||
HandleReactionsArgs,
|
||||
HandleUsersArgs,
|
||||
} from '@typings/database/database';
|
||||
import type ChannelMembershipModel from '@typings/database/models/servers/channel_membership';
|
||||
import type CustomEmojiModel from '@typings/database/models/servers/custom_emoji';
|
||||
import type PreferenceModel from '@typings/database/models/servers/preference';
|
||||
import type ReactionModel from '@typings/database/models/servers/reaction';
|
||||
import type UserModel from '@typings/database/models/servers/user';
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
|
||||
import {MM_TABLES} from '@constants/database';
|
||||
import {prepareBaseRecord} from '@database/operator/server_data_operator/transformers/index';
|
||||
import {OperationType} from '@typings/database/enums';
|
||||
|
||||
import type {TransformerArgs} from '@typings/database/database';
|
||||
import type ChannelModel from '@typings/database/models/servers/channel';
|
||||
import type ChannelInfoModel from '@typings/database/models/servers/channel_info';
|
||||
import type {TransformerArgs} from '@typings/database/database';
|
||||
import {OperationType} from '@typings/database/enums';
|
||||
import type MyChannelModel from '@typings/database/models/servers/my_channel';
|
||||
import type MyChannelSettingsModel from '@typings/database/models/servers/my_channel_settings';
|
||||
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
|
||||
import {MM_TABLES} from '@constants/database';
|
||||
import {prepareBaseRecord} from '@database/operator/server_data_operator/transformers/index';
|
||||
|
||||
import type CustomEmojiModel from '@typings/database/models/servers/custom_emoji';
|
||||
import type {TransformerArgs} from '@typings/database/database';
|
||||
import {OperationType} from '@typings/database/enums';
|
||||
|
||||
import type {TransformerArgs} from '@typings/database/database';
|
||||
import type CustomEmojiModel from '@typings/database/models/servers/custom_emoji';
|
||||
import type RoleModel from '@typings/database/models/servers/role';
|
||||
import type SystemModel from '@typings/database/models/servers/system';
|
||||
import type TermsOfServiceModel from '@typings/database/models/servers/terms_of_service';
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
|
||||
import {MM_TABLES} from '@constants/database';
|
||||
import {prepareBaseRecord} from '@database/operator/server_data_operator/transformers/index';
|
||||
import {OperationType} from '@typings/database/enums';
|
||||
|
||||
import type {TransformerArgs} from '@typings/database/database';
|
||||
import {OperationType} from '@typings/database/enums';
|
||||
import type GroupModel from '@typings/database/models/servers/group';
|
||||
import type GroupMembershipModel from '@typings/database/models/servers/group_membership';
|
||||
import type GroupsChannelModel from '@typings/database/models/servers/groups_channel';
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
import Model from '@nozbe/watermelondb/Model';
|
||||
|
||||
import {TransformerArgs} from '@typings/database/database';
|
||||
import {OperationType} from '@typings/database/enums';
|
||||
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
|
||||
import {MM_TABLES} from '@constants/database';
|
||||
import {prepareBaseRecord} from '@database/operator/server_data_operator/transformers/index';
|
||||
import {OperationType} from '@typings/database/enums';
|
||||
|
||||
import type{TransformerArgs} from '@typings/database/database';
|
||||
import type DraftModel from '@typings/database/models/servers/draft';
|
||||
import {OperationType} from '@typings/database/enums';
|
||||
import type FileModel from '@typings/database/models/servers/file';
|
||||
import type PostModel from '@typings/database/models/servers/post';
|
||||
import type PostsInChannelModel from '@typings/database/models/servers/posts_in_channel';
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
import {MM_TABLES} from '@constants/database';
|
||||
|
||||
import {prepareBaseRecord} from '@database/operator/server_data_operator/transformers/index';
|
||||
import type {TransformerArgs} from '@typings/database/database';
|
||||
import {OperationType} from '@typings/database/enums';
|
||||
|
||||
import type {TransformerArgs} from '@typings/database/database';
|
||||
import type MyTeamModel from '@typings/database/models/servers/my_team';
|
||||
import type SlashCommandModel from '@typings/database/models/servers/slash_command';
|
||||
import type TeamModel from '@typings/database/models/servers/team';
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
import {
|
||||
transformChannelMembershipRecord,
|
||||
transformPreferenceRecord,
|
||||
transformReactionRecord,
|
||||
transformUserRecord,
|
||||
} from '@database/operator/server_data_operator/transformers/user';
|
||||
|
||||
// See LICENSE.txt for license information.
|
||||
import {createTestConnection} from '@database/operator/utils/create_test_connection';
|
||||
import {OperationType} from '@typings/database/enums';
|
||||
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
|
||||
import {MM_TABLES} from '@constants/database';
|
||||
import {prepareBaseRecord} from '@database/operator/server_data_operator/transformers/index';
|
||||
|
||||
import type ChannelMembershipModel from '@typings/database/models/servers/channel_membership';
|
||||
import type {TransformerArgs} from '@typings/database/database';
|
||||
import {OperationType} from '@typings/database/enums';
|
||||
|
||||
import type {TransformerArgs} from '@typings/database/database';
|
||||
import type ChannelMembershipModel from '@typings/database/models/servers/channel_membership';
|
||||
import type PreferenceModel from '@typings/database/models/servers/preference';
|
||||
import type ReactionModel from '@typings/database/models/servers/reaction';
|
||||
import type UserModel from '@typings/database/models/servers/user';
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
|
||||
import {MM_TABLES} from '@constants/database';
|
||||
|
||||
import type ChannelModel from '@typings/database/models/servers/channel';
|
||||
import type {IdenticalRecordArgs, RangeOfValueArgs, RecordPair, RetrieveRecordsArgs} from '@typings/database/database';
|
||||
import type ChannelModel from '@typings/database/models/servers/channel';
|
||||
import type PostModel from '@typings/database/models/servers/post';
|
||||
import type SlashCommandModel from '@typings/database/models/servers/slash_command';
|
||||
import type TeamModel from '@typings/database/models/servers/team';
|
||||
|
||||
@@ -5,12 +5,11 @@ import DatabaseManager from '@database/manager';
|
||||
import {createPostsChain, sanitizePosts} from '@database/operator/utils/post';
|
||||
import {sanitizeReactions} from '@database/operator/utils/reaction';
|
||||
|
||||
import type {WriterInterface} from '@nozbe/watermelondb/Database';
|
||||
|
||||
import type ReactionModel from '@typings/database/models/servers/reaction';
|
||||
|
||||
import {mockedPosts, mockedReactions} from './mock';
|
||||
|
||||
import type {WriterInterface} from '@nozbe/watermelondb/Database';
|
||||
import type ReactionModel from '@typings/database/models/servers/reaction';
|
||||
|
||||
describe('DataOperator: Utils tests', () => {
|
||||
it('=> sanitizePosts: should filter between ordered and unordered posts', () => {
|
||||
const {postsOrdered, postsUnordered} = sanitizePosts({
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
import {AppSchema, appSchema, tableSchema} from '@nozbe/watermelondb';
|
||||
|
||||
import {MM_TABLES} from '@constants/database';
|
||||
|
||||
const {INFO, GLOBAL, SERVERS} = MM_TABLES.APP;
|
||||
|
||||
@@ -5,9 +5,9 @@ import {MM_TABLES} from '@constants/database';
|
||||
|
||||
import type ChannelModel from '@typings/database/models/servers/channel';
|
||||
import type GroupModel from '@typings/database/models/servers/group';
|
||||
import type GroupMembershipModel from '@typings/database/models/servers/group_membership';
|
||||
import type GroupsChannelModel from '@typings/database/models/servers/groups_channel';
|
||||
import type GroupsTeamModel from '@typings/database/models/servers/groups_team';
|
||||
import type GroupMembershipModel from '@typings/database/models/servers/group_membership';
|
||||
import type PostModel from '@typings/database/models/servers/post';
|
||||
import type TeamModel from '@typings/database/models/servers/team';
|
||||
|
||||
|
||||
@@ -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';
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
import {Alert, DeviceEventEmitter, Linking, Platform} from 'react-native';
|
||||
import CookieManager, {Cookie} from '@react-native-cookies/cookies';
|
||||
import {Alert, DeviceEventEmitter, Linking, Platform} from 'react-native';
|
||||
import semver from 'semver';
|
||||
|
||||
import {fetchConfigAndLicense} from '@actions/remote/systems';
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
import Emm, {ManagedConfig} from '@mattermost/react-native-emm';
|
||||
import {Alert, AlertButton, AppState, AppStateStatus, Platform} from 'react-native';
|
||||
import JailMonkey from 'jail-monkey';
|
||||
import {Alert, AlertButton, AppState, AppStateStatus, Platform} from 'react-native';
|
||||
|
||||
import {DEFAULT_LOCALE, getTranslations, t} from '@i18n';
|
||||
import {getIOSAppGroupDetails} from '@utils/mattermost_managed';
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
import {DeviceEventEmitter} from 'react-native';
|
||||
import DeviceInfo from 'react-native-device-info';
|
||||
|
||||
import Emm from '@mattermost/react-native-emm';
|
||||
import {
|
||||
APIClientErrorEvent,
|
||||
@@ -11,6 +8,8 @@ import {
|
||||
getOrCreateAPIClient,
|
||||
RetryTypes,
|
||||
} from '@mattermost/react-native-network-client';
|
||||
import {DeviceEventEmitter} from 'react-native';
|
||||
import DeviceInfo from 'react-native-device-info';
|
||||
|
||||
import LocalConfig from '@assets/config.json';
|
||||
import {Client} from '@client/rest';
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
import {DEFAULT_LOCALE, getLocalizedMessage, t} from '@i18n';
|
||||
import {AppState, DeviceEventEmitter, Platform} from 'react-native';
|
||||
import DeviceInfo from 'react-native-device-info';
|
||||
import {
|
||||
@@ -18,6 +17,7 @@ import {
|
||||
import {Device, General, Navigation} from '@constants';
|
||||
import {GLOBAL_IDENTIFIERS} from '@constants/database';
|
||||
import DatabaseManager from '@database/manager';
|
||||
import {DEFAULT_LOCALE, getLocalizedMessage, t} from '@i18n';
|
||||
import {getLaunchPropsFromNotification, relaunchApp} from '@init/launch';
|
||||
import NativeNotifications from '@notifications';
|
||||
import {queryMentionCount} from '@queries/app/global';
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
import {GLOBAL_IDENTIFIERS, MM_TABLES} from '@constants/database';
|
||||
import {Database} from '@nozbe/watermelondb';
|
||||
|
||||
import {GLOBAL_IDENTIFIERS, MM_TABLES} from '@constants/database';
|
||||
|
||||
import type Global from '@typings/database/models/app/global';
|
||||
|
||||
const {APP: {GLOBAL}} = MM_TABLES;
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
import {MM_TABLES} from '@constants/database';
|
||||
import {Database, Q} from '@nozbe/watermelondb';
|
||||
|
||||
import {MM_TABLES} from '@constants/database';
|
||||
|
||||
import type Servers from '@typings/database/models/app/servers';
|
||||
|
||||
const {APP: {SERVERS}} = MM_TABLES;
|
||||
|
||||
@@ -7,8 +7,8 @@ import {Database as DatabaseConstants} from '@constants';
|
||||
|
||||
import type ServerDataOperator from '@database/operator/server_data_operator';
|
||||
import type MyTeamModel from '@typings/database/models/servers/my_team';
|
||||
import type TeamChannelHistoryModel from '@typings/database/models/servers/team_channel_history';
|
||||
import type TeamModel from '@typings/database/models/servers/team';
|
||||
import type TeamChannelHistoryModel from '@typings/database/models/servers/team_channel_history';
|
||||
|
||||
const {MY_TEAM, TEAM, TEAM_CHANNEL_HISTORY} = DatabaseConstants.MM_TABLES.SERVER;
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
import FormattedText from '@components/formatted_text';
|
||||
import React from 'react';
|
||||
|
||||
import FormattedText from '@components/formatted_text';
|
||||
import {useTheme} from '@context/theme';
|
||||
import {t} from '@i18n';
|
||||
import {makeStyleSheetFromTheme} from '@utils/theme';
|
||||
|
||||
@@ -18,11 +18,11 @@ import ChannelDisplayName from './channel_display_name';
|
||||
import ChannelGuestLabel from './channel_guest_label';
|
||||
|
||||
import type {WithDatabaseArgs} from '@typings/database/database';
|
||||
import type ChannelInfoModel from '@typings/database/models/servers/channel_info';
|
||||
import type ChannelModel from '@typings/database/models/servers/channel';
|
||||
import type ChannelInfoModel from '@typings/database/models/servers/channel_info';
|
||||
import type MyChannelSettingsModel from '@typings/database/models/servers/my_channel_settings';
|
||||
import type UserModel from '@typings/database/models/servers/user';
|
||||
import type SystemModel from '@typings/database/models/servers/system';
|
||||
import type UserModel from '@typings/database/models/servers/user';
|
||||
|
||||
type WithChannelArgs = WithDatabaseArgs & {
|
||||
currentUserId: SystemModel;
|
||||
|
||||
@@ -7,9 +7,9 @@ import React from 'react';
|
||||
import {DeviceEventEmitter, LayoutChangeEvent, Platform, useWindowDimensions, View} from 'react-native';
|
||||
import {useSafeAreaInsets} from 'react-native-safe-area-context';
|
||||
|
||||
import {useTheme} from '@context/theme';
|
||||
import {Device, View as ViewConstants} from '@constants';
|
||||
import {MM_TABLES} from '@constants/database';
|
||||
import {useTheme} from '@context/theme';
|
||||
import {useSplitView} from '@hooks/device';
|
||||
import {makeStyleSheetFromTheme} from '@utils/theme';
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
|
||||
import {withDatabase} from '@nozbe/watermelondb/DatabaseProvider';
|
||||
import withObservables from '@nozbe/with-observables';
|
||||
import {goToScreen} from '@screens/navigation';
|
||||
import React, {useMemo} from 'react';
|
||||
import {useIntl} from 'react-intl';
|
||||
import {Text, View} from 'react-native';
|
||||
@@ -16,6 +15,7 @@ import StatusBar from '@components/status_bar';
|
||||
import {Screens, Database} from '@constants';
|
||||
import {useServerUrl} from '@context/server_url';
|
||||
import {useTheme} from '@context/theme';
|
||||
import {goToScreen} from '@screens/navigation';
|
||||
import {makeStyleSheetFromTheme} from '@utils/theme';
|
||||
|
||||
import ChannelNavBar from './channel_nav_bar';
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
import {act, waitFor} from '@testing-library/react-native';
|
||||
import React from 'react';
|
||||
|
||||
import {Preferences} from '@constants';
|
||||
import * as SessionAPICalls from '@actions/remote/session';
|
||||
import {Preferences} from '@constants';
|
||||
import {renderWithIntl, fireEvent} from '@test/intl-test-helper';
|
||||
|
||||
import ForgotPassword from './index';
|
||||
|
||||
@@ -7,9 +7,9 @@ import {Image, Text, TextInput, TouchableWithoutFeedback, View} from 'react-nati
|
||||
import Button from 'react-native-button';
|
||||
import {SafeAreaView} from 'react-native-safe-area-context';
|
||||
|
||||
import {sendPasswordResetEmail} from '@actions/remote/session';
|
||||
import ErrorText from '@components/error_text';
|
||||
import FormattedText from '@components/formatted_text';
|
||||
import {sendPasswordResetEmail} from '@actions/remote/session';
|
||||
import {isEmail} from '@utils/helpers';
|
||||
import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme';
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
import {NavigationContainer} from '@react-navigation/native';
|
||||
import {createBottomTabNavigator, BottomTabBarProps} from '@react-navigation/bottom-tabs';
|
||||
import {NavigationContainer} from '@react-navigation/native';
|
||||
import React from 'react';
|
||||
import {Platform} from 'react-native';
|
||||
import {enableScreens} from 'react-native-screens';
|
||||
|
||||
@@ -8,7 +8,7 @@ import {View} from 'react-native';
|
||||
import {switchMap} from 'rxjs/operators';
|
||||
|
||||
import ProfilePicture from '@components/profile_picture';
|
||||
import {MM_TABLES, SYSTEM_IDENTIFIERS} from '@app/constants/database';
|
||||
import {MM_TABLES, SYSTEM_IDENTIFIERS} from '@constants/database';
|
||||
import {makeStyleSheetFromTheme} from '@utils/theme';
|
||||
|
||||
import type {WithDatabaseArgs} from '@typings/database/database';
|
||||
|
||||
@@ -5,16 +5,15 @@ import {Q} from '@nozbe/watermelondb';
|
||||
import React, {useEffect, useState} from 'react';
|
||||
import {Platform, View} from 'react-native';
|
||||
|
||||
import {MM_TABLES} from '@constants/database';
|
||||
import Badge from '@components/badge';
|
||||
import CompassIcon from '@components/compass_icon';
|
||||
import {MM_TABLES} from '@constants/database';
|
||||
import DatabaseManager from '@database/manager';
|
||||
import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme';
|
||||
|
||||
import type {Subscription} from 'rxjs';
|
||||
|
||||
import type ServersModel from '@typings/database/models/app/servers';
|
||||
import type MyChannelModel from '@typings/database/models/servers/my_channel';
|
||||
import type {Subscription} from 'rxjs';
|
||||
|
||||
type Props = {
|
||||
isFocused: boolean;
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
|
||||
import React, {useEffect, useState} from 'react';
|
||||
import {DeviceEventEmitter, View, TouchableOpacity, useWindowDimensions} from 'react-native';
|
||||
import Animated, {useAnimatedStyle, withTiming} from 'react-native-reanimated';
|
||||
import {Shadow} from 'react-native-neomorph-shadows';
|
||||
import Animated, {useAnimatedStyle, withTiming} from 'react-native-reanimated';
|
||||
import {useSafeAreaInsets} from 'react-native-safe-area-context';
|
||||
|
||||
import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme';
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user