From 3803e8fa02769208792b228ed4e62687606e7b0c Mon Sep 17 00:00:00 2001 From: Przemyslaw Jozwik Date: Wed, 30 Oct 2024 11:29:19 +0100 Subject: [PATCH 01/12] feat: improve application structure --- jest.config.ts | 1 + src/script/components/Avatar/AvatarImage.tsx | 2 +- .../UserBlockedBadge.styles.ts | 0 .../UserBlockedBadge/UserBlockedBadge.tsx | 0 .../components/UserBlockedBadge}/index.ts | 4 +- .../UserStatusBadges.styles.ts | 0 .../UserStatusBadges.test.tsx | 0 .../UserStatusBadges}/UserStatusBadges.tsx | 0 .../components/UserStatusBadges}/index.ts | 0 .../VerificationBadges.test.tsx | 0 .../VerificationBadges.tsx | 1 + .../components/VerificationBadges}/index.ts | 0 src/script/components/Badge/index.tsx | 22 +++++ .../components/Checkbox/Checkbox.styles.ts | 90 ------------------- src/script/components/Checkbox/Checkbox.tsx | 83 ----------------- .../ClassifiedBar.test.tsx | 0 .../ClassifiedBar.tsx | 14 +-- .../ConnectRequests/ConnectionRequests.tsx | 2 +- .../ConversationListCell.tsx | 10 +-- .../components/StatusIcon/StatusIcon.tsx} | 12 ++- .../components/StatusIcon/index.tsx | 20 +++++ .../components/ConversationListCell/index.tsx | 20 +++++ .../CopyToClipboardButton.test.tsx | 2 +- .../CopyToClipboardButton.tsx | 8 +- .../CopyToClipboardButton/index.tsx | 20 +++++ .../DraggableClickWrapper.tsx} | 6 +- .../DraggableClickWrapper/index.tsx | 20 +++++ .../ErrorFallback.test.tsx | 3 +- .../{ => ErrorFallback}/ErrorFallback.tsx | 11 +-- src/script/components/ErrorFallback/index.tsx | 20 +++++ src/script/components/Image/Image.tsx | 2 +- .../{utils => InViewport}/InViewport.tsx | 6 +- src/script/components/InViewport/index.tsx | 20 +++++ src/script/components/InputBar/InputBar.tsx | 2 +- .../{ => LegalHoldDot}/LegalHoldDot.test.tsx | 0 .../{ => LegalHoldDot}/LegalHoldDot.tsx | 8 +- src/script/components/LegalHoldDot/index.tsx | 20 +++++ .../Message/ContentMessage/MessageHeader.tsx | 2 +- .../asset/ImageAsset/ImageAsset.test.tsx | 2 +- .../MemberMessage/ConnectedMessage.tsx | 2 +- .../Message/VerificationMessage.tsx | 2 +- .../components/MessagesList/Message/index.tsx | 2 +- .../GroupCreation/GroupCreationModal.tsx | 2 +- .../Modals/InviteModal/InviteModal.tsx | 2 +- .../Modals/LegalHoldModal/LegalHoldModal.tsx | 5 +- .../ModalComponent/ModalComponent.styles.tsx | 65 ++++++++++++++ .../ModalComponent}/ModalComponent.tsx | 58 +++--------- .../Modals/ModalComponent/index.tsx | 20 +++++ .../Modals/PrimaryModal/PrimaryModal.tsx | 2 +- .../QualityFeedbackModal.tsx | 2 +- .../Modals/ServiceModal/ServiceModal.tsx | 2 +- .../components/Modals/UserModal/UserModal.tsx | 2 +- .../ParticipantItemContent.tsx | 3 +- .../PasswordGeneratorButton.test.tsx | 2 +- .../PasswordGeneratorButton.tsx | 6 +- .../PasswordGeneratorButton/index.tsx | 20 +++++ .../{ => SearchInput}/SearchInput.tsx | 9 +- src/script/components/SearchInput/index.tsx | 20 +++++ .../{ => SelectText}/SelectText.test.tsx | 3 +- .../{ => SelectText}/SelectText.tsx | 4 +- src/script/components/SelectText/index.tsx | 20 +++++ src/script/components/TitleBar/TitleBar.tsx | 2 +- .../{ => UserDevices}/UserDevices.tsx | 57 +++--------- .../UserDevices/UserDevices.types.tsx | 30 +++++++ .../DeviceCard}/DeviceCard.test.tsx | 2 +- .../components/DeviceCard}/DeviceCard.tsx | 10 +-- .../components/DeviceCard/index.tsx | 20 +++++ .../DeviceDetails}/DeviceDetails.tsx | 16 ++-- .../components/DeviceDetails/index.tsx | 20 +++++ .../components/DeviceList}/DeviceList.tsx | 15 ++-- .../components/DeviceList/index.tsx | 20 +++++ .../NoDevicesFound}/NoDevicesFound.tsx | 8 +- .../components/NoDevicesFound/index.tsx | 20 +++++ .../SelfFingerprint}/SelfFingerprint.tsx | 15 ++-- .../components/SelfFingerprint/index.tsx | 20 +++++ src/script/components/UserDevices/index.tsx | 21 +++++ .../components/{ => UserInfo}/UserInfo.tsx | 5 +- src/script/components/UserInfo/index.tsx | 20 +++++ src/script/components/UserList/UserList.tsx | 2 +- .../components/UserListItem/UserListItem.tsx | 2 +- .../components/{ => UserName}/UserName.tsx | 2 +- src/script/components/UserName/index.tsx | 20 +++++ .../UserSearchableList.tsx | 17 ++-- .../components/UserSearchableList/index.tsx | 20 +++++ .../VerificationIcon.tsx} | 8 +- .../components/VerificationIcon/index.tsx | 20 +++++ .../CallParticipantsListItem.tsx | 2 +- .../calling/CallingCell/CallingCell.test.tsx | 2 +- .../calling/CallingCell/CallingCell.tsx | 2 +- .../DetachedCallingCell.tsx | 3 +- .../DetachedWindow/DetachedWindow.tsx | 2 +- .../components}/DetachedWindow/index.ts | 0 .../calling/FullscreenVideoCall.tsx | 4 +- src/script/components/panel/UserDetails.tsx | 5 +- .../hooks/useUserDevicesHistory/index.tsx | 20 +++++ .../useUserDevicesHistory.tsx | 38 ++++++++ src/script/page/AppLock/AppLock.tsx | 2 +- .../LeftSidebar/UserDetails/UserDetails.tsx | 2 +- .../Conversations/ConversationsList.tsx | 2 +- .../panels/preferences/AccountPreferences.tsx | 2 +- .../components/DetailedDevice.tsx | 2 +- .../components/Device/Device.tsx | 2 +- .../E2EICertificateDetails.tsx | 2 +- .../components/ProteusDeviceDetails.tsx | 2 +- .../ConversationDetailsHeader.tsx | 2 +- .../RightSidebar/PanelHeader/PanelHeader.tsx | 14 +-- .../ParticipantDevices/ParticipantDevices.tsx | 3 +- tsconfig.json | 1 + webpack.config.common.js | 1 + 109 files changed, 754 insertions(+), 439 deletions(-) rename src/script/components/{ => Badge/components}/UserBlockedBadge/UserBlockedBadge.styles.ts (100%) rename src/script/components/{ => Badge/components}/UserBlockedBadge/UserBlockedBadge.tsx (100%) rename src/script/components/{Checkbox => Badge/components/UserBlockedBadge}/index.ts (89%) rename src/script/components/{UserBadges => Badge/components/UserStatusBadges}/UserStatusBadges.styles.ts (100%) rename src/script/components/{UserBadges => Badge/components/UserStatusBadges}/UserStatusBadges.test.tsx (100%) rename src/script/components/{UserBadges => Badge/components/UserStatusBadges}/UserStatusBadges.tsx (100%) rename src/script/components/{UserBadges => Badge/components/UserStatusBadges}/index.ts (100%) rename src/script/components/{VerificationBadge => Badge/components/VerificationBadges}/VerificationBadges.test.tsx (100%) rename src/script/components/{VerificationBadge => Badge/components/VerificationBadges}/VerificationBadges.tsx (99%) rename src/script/components/{VerificationBadge => Badge/components/VerificationBadges}/index.ts (100%) create mode 100644 src/script/components/Badge/index.tsx delete mode 100644 src/script/components/Checkbox/Checkbox.styles.ts delete mode 100644 src/script/components/Checkbox/Checkbox.tsx rename src/script/components/{input => ClassifiedBar}/ClassifiedBar.test.tsx (100%) rename src/script/components/{input => ClassifiedBar}/ClassifiedBar.tsx (89%) rename src/script/components/{list => ConversationListCell}/ConversationListCell.tsx (96%) rename src/script/components/{list/ConversationListCellStatusIcon.tsx => ConversationListCell/components/StatusIcon/StatusIcon.tsx} (89%) create mode 100644 src/script/components/ConversationListCell/components/StatusIcon/index.tsx create mode 100644 src/script/components/ConversationListCell/index.tsx rename src/script/components/{ => CopyToClipboardButton}/CopyToClipboardButton.test.tsx (97%) rename src/script/components/{ => CopyToClipboardButton}/CopyToClipboardButton.tsx (92%) create mode 100644 src/script/components/CopyToClipboardButton/index.tsx rename src/script/components/{DragableClickWrapper.tsx => DraggableClickWrapper/DraggableClickWrapper.tsx} (91%) create mode 100644 src/script/components/DraggableClickWrapper/index.tsx rename src/script/components/{ => ErrorFallback}/ErrorFallback.test.tsx (95%) rename src/script/components/{ => ErrorFallback}/ErrorFallback.tsx (86%) create mode 100644 src/script/components/ErrorFallback/index.tsx rename src/script/components/{utils => InViewport}/InViewport.tsx (96%) create mode 100644 src/script/components/InViewport/index.tsx rename src/script/components/{ => LegalHoldDot}/LegalHoldDot.test.tsx (100%) rename src/script/components/{ => LegalHoldDot}/LegalHoldDot.tsx (94%) create mode 100644 src/script/components/LegalHoldDot/index.tsx create mode 100644 src/script/components/Modals/ModalComponent/ModalComponent.styles.tsx rename src/script/components/{ => Modals/ModalComponent}/ModalComponent.tsx (74%) create mode 100644 src/script/components/Modals/ModalComponent/index.tsx rename src/script/components/{ => PasswordGeneratorButton}/PasswordGeneratorButton.test.tsx (98%) rename src/script/components/{ => PasswordGeneratorButton}/PasswordGeneratorButton.tsx (88%) create mode 100644 src/script/components/PasswordGeneratorButton/index.tsx rename src/script/components/{ => SearchInput}/SearchInput.tsx (94%) create mode 100644 src/script/components/SearchInput/index.tsx rename src/script/components/{ => SelectText}/SelectText.test.tsx (94%) rename src/script/components/{ => SelectText}/SelectText.tsx (92%) create mode 100644 src/script/components/SelectText/index.tsx rename src/script/components/{ => UserDevices}/UserDevices.tsx (72%) create mode 100644 src/script/components/UserDevices/UserDevices.types.tsx rename src/script/components/{userDevices => UserDevices/components/DeviceCard}/DeviceCard.test.tsx (96%) rename src/script/components/{userDevices => UserDevices/components/DeviceCard}/DeviceCard.tsx (91%) create mode 100644 src/script/components/UserDevices/components/DeviceCard/index.tsx rename src/script/components/{userDevices => UserDevices/components/DeviceDetails}/DeviceDetails.tsx (91%) create mode 100644 src/script/components/UserDevices/components/DeviceDetails/index.tsx rename src/script/components/{userDevices => UserDevices/components/DeviceList}/DeviceList.tsx (87%) create mode 100644 src/script/components/UserDevices/components/DeviceList/index.tsx rename src/script/components/{userDevices => UserDevices/components/NoDevicesFound}/NoDevicesFound.tsx (88%) create mode 100644 src/script/components/UserDevices/components/NoDevicesFound/index.tsx rename src/script/components/{userDevices => UserDevices/components/SelfFingerprint}/SelfFingerprint.tsx (83%) create mode 100644 src/script/components/UserDevices/components/SelfFingerprint/index.tsx create mode 100644 src/script/components/UserDevices/index.tsx rename src/script/components/{ => UserInfo}/UserInfo.tsx (97%) create mode 100644 src/script/components/UserInfo/index.tsx rename src/script/components/{ => UserName}/UserName.tsx (97%) create mode 100644 src/script/components/UserName/index.tsx rename src/script/components/{ => UserSearchableList}/UserSearchableList.tsx (93%) create mode 100644 src/script/components/UserSearchableList/index.tsx rename src/script/components/{VerifiedIcon.tsx => VerificationIcon/VerificationIcon.tsx} (82%) create mode 100644 src/script/components/VerificationIcon/index.tsx rename src/script/components/{ => calling/DetachedCallingCell/components}/DetachedWindow/DetachedWindow.tsx (97%) rename src/script/components/{ => calling/DetachedCallingCell/components}/DetachedWindow/index.ts (100%) create mode 100644 src/script/hooks/useUserDevicesHistory/index.tsx create mode 100644 src/script/hooks/useUserDevicesHistory/useUserDevicesHistory.tsx diff --git a/jest.config.ts b/jest.config.ts index 8e37ab95824..2dcf361ee47 100644 --- a/jest.config.ts +++ b/jest.config.ts @@ -26,6 +26,7 @@ const config: Config = { // Must be in sync with tsconfig.json >> paths moduleNameMapper: { 'Components/(.*)': '/src/script/components/$1', + 'Hooks/(.*)': '/src/script/hooks/$1', 'I18n/(.*)': '/src/i18n/$1', 'Resource/(.*)': '/resource/$1', 'Util/(.*)': '/src/script/util/$1', diff --git a/src/script/components/Avatar/AvatarImage.tsx b/src/script/components/Avatar/AvatarImage.tsx index ec746b5c2fb..5a6778ebe31 100644 --- a/src/script/components/Avatar/AvatarImage.tsx +++ b/src/script/components/Avatar/AvatarImage.tsx @@ -23,7 +23,7 @@ import {CSSObject} from '@emotion/serialize'; import {Transition} from 'react-transition-group'; import {container} from 'tsyringe'; -import {InViewport} from 'Components/utils/InViewport'; +import {InViewport} from 'Components/InViewport'; import {CSS_FILL_PARENT} from 'Util/CSSMixin'; import {AssetRemoteData} from '../../assets/AssetRemoteData'; diff --git a/src/script/components/UserBlockedBadge/UserBlockedBadge.styles.ts b/src/script/components/Badge/components/UserBlockedBadge/UserBlockedBadge.styles.ts similarity index 100% rename from src/script/components/UserBlockedBadge/UserBlockedBadge.styles.ts rename to src/script/components/Badge/components/UserBlockedBadge/UserBlockedBadge.styles.ts diff --git a/src/script/components/UserBlockedBadge/UserBlockedBadge.tsx b/src/script/components/Badge/components/UserBlockedBadge/UserBlockedBadge.tsx similarity index 100% rename from src/script/components/UserBlockedBadge/UserBlockedBadge.tsx rename to src/script/components/Badge/components/UserBlockedBadge/UserBlockedBadge.tsx diff --git a/src/script/components/Checkbox/index.ts b/src/script/components/Badge/components/UserBlockedBadge/index.ts similarity index 89% rename from src/script/components/Checkbox/index.ts rename to src/script/components/Badge/components/UserBlockedBadge/index.ts index ddc633025b6..42748c906c5 100644 --- a/src/script/components/Checkbox/index.ts +++ b/src/script/components/Badge/components/UserBlockedBadge/index.ts @@ -1,6 +1,6 @@ /* * Wire - * Copyright (C) 2022 Wire Swiss GmbH + * Copyright (C) 2024 Wire Swiss GmbH * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,4 +17,4 @@ * */ -export * from './Checkbox'; +export * from './UserBlockedBadge'; diff --git a/src/script/components/UserBadges/UserStatusBadges.styles.ts b/src/script/components/Badge/components/UserStatusBadges/UserStatusBadges.styles.ts similarity index 100% rename from src/script/components/UserBadges/UserStatusBadges.styles.ts rename to src/script/components/Badge/components/UserStatusBadges/UserStatusBadges.styles.ts diff --git a/src/script/components/UserBadges/UserStatusBadges.test.tsx b/src/script/components/Badge/components/UserStatusBadges/UserStatusBadges.test.tsx similarity index 100% rename from src/script/components/UserBadges/UserStatusBadges.test.tsx rename to src/script/components/Badge/components/UserStatusBadges/UserStatusBadges.test.tsx diff --git a/src/script/components/UserBadges/UserStatusBadges.tsx b/src/script/components/Badge/components/UserStatusBadges/UserStatusBadges.tsx similarity index 100% rename from src/script/components/UserBadges/UserStatusBadges.tsx rename to src/script/components/Badge/components/UserStatusBadges/UserStatusBadges.tsx diff --git a/src/script/components/UserBadges/index.ts b/src/script/components/Badge/components/UserStatusBadges/index.ts similarity index 100% rename from src/script/components/UserBadges/index.ts rename to src/script/components/Badge/components/UserStatusBadges/index.ts diff --git a/src/script/components/VerificationBadge/VerificationBadges.test.tsx b/src/script/components/Badge/components/VerificationBadges/VerificationBadges.test.tsx similarity index 100% rename from src/script/components/VerificationBadge/VerificationBadges.test.tsx rename to src/script/components/Badge/components/VerificationBadges/VerificationBadges.test.tsx diff --git a/src/script/components/VerificationBadge/VerificationBadges.tsx b/src/script/components/Badge/components/VerificationBadges/VerificationBadges.tsx similarity index 99% rename from src/script/components/VerificationBadge/VerificationBadges.tsx rename to src/script/components/Badge/components/VerificationBadges/VerificationBadges.tsx index 0fd12634226..4efe61ba13e 100644 --- a/src/script/components/VerificationBadge/VerificationBadges.tsx +++ b/src/script/components/Badge/components/VerificationBadges/VerificationBadges.tsx @@ -171,6 +171,7 @@ type ConversationVerificationBadgeProps = { conversation: Conversation; displayTitle?: boolean; }; + export const ConversationVerificationBadges = ({conversation, displayTitle}: ConversationVerificationBadgeProps) => { const {MLS, proteus} = useConversationVerificationState(conversation); diff --git a/src/script/components/VerificationBadge/index.ts b/src/script/components/Badge/components/VerificationBadges/index.ts similarity index 100% rename from src/script/components/VerificationBadge/index.ts rename to src/script/components/Badge/components/VerificationBadges/index.ts diff --git a/src/script/components/Badge/index.tsx b/src/script/components/Badge/index.tsx new file mode 100644 index 00000000000..119fd9ed0f1 --- /dev/null +++ b/src/script/components/Badge/index.tsx @@ -0,0 +1,22 @@ +/* + * Wire + * Copyright (C) 2024 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + * + */ + +export * from './components/UserStatusBadges'; +export * from './components/UserBlockedBadge'; +export * from './components/VerificationBadges'; diff --git a/src/script/components/Checkbox/Checkbox.styles.ts b/src/script/components/Checkbox/Checkbox.styles.ts deleted file mode 100644 index ba2058d4c58..00000000000 --- a/src/script/components/Checkbox/Checkbox.styles.ts +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Wire - * Copyright (C) 2022 Wire Swiss GmbH - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/. - * - */ - -import {CSSObject} from '@emotion/react'; - -export const getLabelCSS = (disabled?: boolean): CSSObject => ({ - '&:hover': { - cursor: !disabled && 'pointer', - }, - '&:hover svg': { - borderColor: !disabled && 'var(--accent-color-500)', - }, - alignItems: 'center', - display: 'flex', - fontSize: '', -}); - -export const getInputCSS = (isChecked: boolean, disabled?: boolean): CSSObject => ({ - '&:active + svg': { - borderColor: !disabled && 'var(--accent-color-500)', - }, - '&:focus + svg, &:focus-visible + svg': { - backgroundColor: isChecked && 'var(--accent-color-600)', - borderColor: 'var(--accent-color-600)', - outline: '1px solid var(--accent-color-700)', - }, - clip: 'rect(0 0 0 0)', - clipPath: 'inset(50%)', - height: 1, - overflow: 'hidden', - position: 'absolute', - whiteSpace: 'nowrap', - width: 1, -}); - -export const getInputCSSDark = (isChecked: boolean, disabled?: boolean): CSSObject => ({ - 'body.theme-dark .input-dark': { - '& + svg': { - ...(isChecked && { - background: 'var(--accent-color-600)', - borderColor: 'var(--accent-color-600)', - }), - }, - '&:active + svg': { - borderColor: !disabled && 'var(--accent-color-600)', - }, - '&:focus + svg, &:focus-visible + svg': { - backgroundColor: isChecked && 'var(--accent-color-700)', - borderColor: 'var(--accent-color-700)', - outline: '1px solid var(--accent-color-700)', - }, - }, -}); - -export const getSvgCSS = (isChecked: boolean, disabled?: boolean): CSSObject => ({ - background: 'var(--checkbox-background)', - border: '1.5px var(--checkbox-border) solid', - borderRadius: 3, - - // set to `inline-block` as `inline elements ignore `height` and `width` - display: 'inline-block', - height: 20, - marginRight: 8, - width: 20, - ...(isChecked && { - background: 'var(--accent-color-500)', - borderColor: 'var(--accent-color-500)', - }), - ...(disabled && { - background: isChecked ? 'var(--checkbox-background-disabled-selected)' : 'var(--checkbox-background-disabled)', - borderColor: 'var(--checkbox-border-disabled)', - pointerEvents: 'none', - }), -}); diff --git a/src/script/components/Checkbox/Checkbox.tsx b/src/script/components/Checkbox/Checkbox.tsx deleted file mode 100644 index f6d43ce076c..00000000000 --- a/src/script/components/Checkbox/Checkbox.tsx +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Wire - * Copyright (C) 2018 Wire Swiss GmbH - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/. - * - */ - -import React from 'react'; - -import {Global} from '@emotion/react'; - -import {getInputCSS, getInputCSSDark, getLabelCSS, getSvgCSS} from './Checkbox.styles'; - -interface CheckboxProps { - disabled?: boolean; - isChecked: boolean; - label: string; - name: string; - onCheckedChanged: () => void; - uieName: string; -} - -const Checkbox: React.FC = ({disabled, label, isChecked, name, onCheckedChanged, uieName}) => { - return ( - <> - - - - - ); -}; - -export {Checkbox}; diff --git a/src/script/components/input/ClassifiedBar.test.tsx b/src/script/components/ClassifiedBar/ClassifiedBar.test.tsx similarity index 100% rename from src/script/components/input/ClassifiedBar.test.tsx rename to src/script/components/ClassifiedBar/ClassifiedBar.test.tsx diff --git a/src/script/components/input/ClassifiedBar.tsx b/src/script/components/ClassifiedBar/ClassifiedBar.tsx similarity index 89% rename from src/script/components/input/ClassifiedBar.tsx rename to src/script/components/ClassifiedBar/ClassifiedBar.tsx index c261f2e7ea2..c4adaa66161 100644 --- a/src/script/components/input/ClassifiedBar.tsx +++ b/src/script/components/ClassifiedBar/ClassifiedBar.tsx @@ -17,8 +17,6 @@ * */ -import React from 'react'; - import {CSSObject} from '@emotion/react'; import cx from 'classnames'; @@ -50,12 +48,7 @@ interface UserClassifiedBarProps extends ClassifiedBarProps { users: User[]; } -export const UserClassifiedBar: React.FC = ({ - users, - conversationDomain, - classifiedDomains, - style, -}) => { +export const UserClassifiedBar = ({users, conversationDomain, classifiedDomains, style}: UserClassifiedBarProps) => { if (typeof classifiedDomains === 'undefined') { return null; } @@ -79,10 +72,7 @@ interface ConversationClassifiedBarProps extends ClassifiedBarProps { conversation: Conversation; } -export const ConversationClassifiedBar: React.FC = ({ - conversation, - ...classifiedBarProps -}) => { +export const ConversationClassifiedBar = ({conversation, ...classifiedBarProps}: ConversationClassifiedBarProps) => { const {allUserEntities: users} = useKoSubscribableChildren(conversation, ['allUserEntities']); return ; }; diff --git a/src/script/components/ConnectRequests/ConnectionRequests.tsx b/src/script/components/ConnectRequests/ConnectionRequests.tsx index e1a030523ca..1f91ee603f1 100644 --- a/src/script/components/ConnectRequests/ConnectionRequests.tsx +++ b/src/script/components/ConnectRequests/ConnectionRequests.tsx @@ -24,7 +24,7 @@ import {container} from 'tsyringe'; import {Button, ButtonVariant, IconButton, IconButtonVariant, useMatchMedia} from '@wireapp/react-ui-kit'; import {Avatar, AVATAR_SIZE} from 'Components/Avatar'; -import {UserClassifiedBar} from 'Components/input/ClassifiedBar'; +import {UserClassifiedBar} from 'Components/ClassifiedBar/ClassifiedBar'; import {UnverifiedUserWarning} from 'Components/Modals/UserModal'; import {UserName} from 'Components/UserName'; import {SidebarTabs, useSidebarStore} from 'src/script/page/LeftSidebar/panels/Conversations/useSidebarStore'; diff --git a/src/script/components/list/ConversationListCell.tsx b/src/script/components/ConversationListCell/ConversationListCell.tsx similarity index 96% rename from src/script/components/list/ConversationListCell.tsx rename to src/script/components/ConversationListCell/ConversationListCell.tsx index b9b64a0da18..25384973b43 100644 --- a/src/script/components/list/ConversationListCell.tsx +++ b/src/script/components/ConversationListCell/ConversationListCell.tsx @@ -30,14 +30,14 @@ import {TabIndex} from '@wireapp/react-ui-kit/lib/types/enums'; import cx from 'classnames'; import {Avatar, AVATAR_SIZE, GroupAvatar} from 'Components/Avatar'; -import {UserBlockedBadge} from 'Components/UserBlockedBadge/UserBlockedBadge'; +import {UserBlockedBadge} from 'Components/Badge'; import {UserInfo} from 'Components/UserInfo'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {isKey, isOneOfKeys, KEY} from 'Util/KeyboardUtil'; import {t} from 'Util/LocalizerUtil'; import {noop, setContextMenuPosition} from 'Util/util'; -import {ConversationListCellStatusIcon} from './ConversationListCellStatusIcon'; +import {StatusIcon} from './components/StatusIcon'; import {generateCellState} from '../../conversation/ConversationCellState'; import type {Conversation} from '../../entity/Conversation'; @@ -57,7 +57,7 @@ export interface ConversationListCellProps { resetConversationFocus: () => void; } -const ConversationListCell = ({ +export const ConversationListCell = ({ showJoinButton, conversation, onJoinCall, @@ -232,7 +232,7 @@ const ConversationListCell = ({ onKeyDown={handleContextKeyDown} /> - {!showJoinButton && } + {!showJoinButton && } {showJoinButton && ( ); }; - -export {CopyToClipboardButton}; diff --git a/src/script/components/CopyToClipboardButton/index.tsx b/src/script/components/CopyToClipboardButton/index.tsx new file mode 100644 index 00000000000..b580643cb12 --- /dev/null +++ b/src/script/components/CopyToClipboardButton/index.tsx @@ -0,0 +1,20 @@ +/* + * Wire + * Copyright (C) 2024 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + * + */ + +export * from './CopyToClipboardButton'; diff --git a/src/script/components/DragableClickWrapper.tsx b/src/script/components/DraggableClickWrapper/DraggableClickWrapper.tsx similarity index 91% rename from src/script/components/DragableClickWrapper.tsx rename to src/script/components/DraggableClickWrapper/DraggableClickWrapper.tsx index 95c94775f82..a8a4e260ddf 100644 --- a/src/script/components/DragableClickWrapper.tsx +++ b/src/script/components/DraggableClickWrapper/DraggableClickWrapper.tsx @@ -21,12 +21,12 @@ import React from 'react'; import {Runtime} from '@wireapp/commons'; -interface DragableClickWrapperProps { +interface DraggableClickWrapperProps { children: React.ReactElement; onClick: React.MouseEventHandler; } -const DragableClickWrapper: React.FC = ({onClick, children}) => { +export const DraggableClickWrapper = ({onClick, children}: DraggableClickWrapperProps) => { const isMacDesktop = Runtime.isDesktopApp() && Runtime.isMacOS(); if (!isMacDesktop) { return React.cloneElement(children, {onClick}); @@ -61,5 +61,3 @@ const DragableClickWrapper: React.FC = ({onClick, chi }, }); }; - -export {DragableClickWrapper}; diff --git a/src/script/components/DraggableClickWrapper/index.tsx b/src/script/components/DraggableClickWrapper/index.tsx new file mode 100644 index 00000000000..3d60d425c93 --- /dev/null +++ b/src/script/components/DraggableClickWrapper/index.tsx @@ -0,0 +1,20 @@ +/* + * Wire + * Copyright (C) 2024 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + * + */ + +export * from './DraggableClickWrapper'; diff --git a/src/script/components/ErrorFallback.test.tsx b/src/script/components/ErrorFallback/ErrorFallback.test.tsx similarity index 95% rename from src/script/components/ErrorFallback.test.tsx rename to src/script/components/ErrorFallback/ErrorFallback.test.tsx index ad62144c679..9b90a72fc8a 100644 --- a/src/script/components/ErrorFallback.test.tsx +++ b/src/script/components/ErrorFallback/ErrorFallback.test.tsx @@ -20,8 +20,9 @@ import {render} from '@testing-library/react'; import {ErrorBoundary} from 'react-error-boundary'; +import {PrimaryModal} from 'Components/Modals/PrimaryModal'; + import {ErrorFallback} from './ErrorFallback'; -import {PrimaryModal} from './Modals/PrimaryModal'; const SimpleError: React.FC = () => { throw new Error('failed to render'); diff --git a/src/script/components/ErrorFallback.tsx b/src/script/components/ErrorFallback/ErrorFallback.tsx similarity index 86% rename from src/script/components/ErrorFallback.tsx rename to src/script/components/ErrorFallback/ErrorFallback.tsx index e1764d98e64..4685f559b06 100644 --- a/src/script/components/ErrorFallback.tsx +++ b/src/script/components/ErrorFallback/ErrorFallback.tsx @@ -17,18 +17,17 @@ * */ -import React, {useEffect} from 'react'; +import {useEffect} from 'react'; import {FallbackProps} from 'react-error-boundary'; +import {PrimaryModal} from 'Components/Modals/PrimaryModal'; import {t} from 'Util/LocalizerUtil'; import {getLogger} from 'Util/Logger'; -import {PrimaryModal} from './Modals/PrimaryModal'; - const logger = getLogger('ErrorFallback'); -const ErrorFallback: React.FC = ({error, resetErrorBoundary}) => { +export const ErrorFallback = ({error, resetErrorBoundary}: FallbackProps) => { useEffect(() => { logger.error(error); PrimaryModal.show(PrimaryModal.type.CONFIRM, { @@ -48,7 +47,5 @@ const ErrorFallback: React.FC = ({error, resetErrorBoundary}) => }); }, [error, resetErrorBoundary]); - return null; + return <>; }; - -export {ErrorFallback}; diff --git a/src/script/components/ErrorFallback/index.tsx b/src/script/components/ErrorFallback/index.tsx new file mode 100644 index 00000000000..b45b7606a47 --- /dev/null +++ b/src/script/components/ErrorFallback/index.tsx @@ -0,0 +1,20 @@ +/* + * Wire + * Copyright (C) 2024 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + * + */ + +export * from './ErrorFallback'; diff --git a/src/script/components/Image/Image.tsx b/src/script/components/Image/Image.tsx index 15ac207720b..6443122690e 100644 --- a/src/script/components/Image/Image.tsx +++ b/src/script/components/Image/Image.tsx @@ -23,6 +23,7 @@ import {CSSObject} from '@emotion/react'; import cx from 'classnames'; import {container} from 'tsyringe'; +import {InViewport} from 'Components/InViewport'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {getImageStyle, getWrapperStyles} from './Image.styles'; @@ -33,7 +34,6 @@ import {Config} from '../../Config'; import {MediumImage} from '../../entity/message/MediumImage'; import {TeamState} from '../../team/TeamState'; import {AssetUrl, useAssetTransfer} from '../MessagesList/Message/ContentMessage/asset/useAssetTransfer'; -import {InViewport} from '../utils/InViewport'; interface BaseImageProps extends React.HTMLProps { alt?: string; diff --git a/src/script/components/utils/InViewport.tsx b/src/script/components/InViewport/InViewport.tsx similarity index 96% rename from src/script/components/utils/InViewport.tsx rename to src/script/components/InViewport/InViewport.tsx index 9b8cc424934..c3280e54f1a 100644 --- a/src/script/components/utils/InViewport.tsx +++ b/src/script/components/InViewport/InViewport.tsx @@ -32,7 +32,7 @@ interface InViewportParams { checkOverlay?: boolean; } -const InViewport: React.FC> = ({ +export const InViewport = ({ children, onVisible, onVisibilityLost, @@ -41,7 +41,7 @@ const InViewport: React.FC> = allowBiggerThanViewport = false, callVisibilityLostOnUnmount = false, ...props -}) => { +}: InViewportParams & React.HTMLProps) => { const domNode = useRef(null); useEffect(() => { @@ -116,5 +116,3 @@ const InViewport: React.FC> = ); }; - -export {InViewport}; diff --git a/src/script/components/InViewport/index.tsx b/src/script/components/InViewport/index.tsx new file mode 100644 index 00000000000..eebd5fda190 --- /dev/null +++ b/src/script/components/InViewport/index.tsx @@ -0,0 +1,20 @@ +/* + * Wire + * Copyright (C) 2024 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + * + */ + +export * from './InViewport'; diff --git a/src/script/components/InputBar/InputBar.tsx b/src/script/components/InputBar/InputBar.tsx index 130c6e85942..0e0454d98cb 100644 --- a/src/script/components/InputBar/InputBar.tsx +++ b/src/script/components/InputBar/InputBar.tsx @@ -28,8 +28,8 @@ import {useMatchMedia} from '@wireapp/react-ui-kit'; import {WebAppEvents} from '@wireapp/webapp-events'; import {Avatar, AVATAR_SIZE} from 'Components/Avatar'; +import {ConversationClassifiedBar} from 'Components/ClassifiedBar/ClassifiedBar'; import {checkFileSharingPermission} from 'Components/Conversation/utils/checkFileSharingPermission'; -import {ConversationClassifiedBar} from 'Components/input/ClassifiedBar'; import {PrimaryModal} from 'Components/Modals/PrimaryModal'; import {showWarningModal} from 'Components/Modals/utils/showWarningModal'; import {RichTextContent, RichTextEditor} from 'Components/RichTextEditor'; diff --git a/src/script/components/LegalHoldDot.test.tsx b/src/script/components/LegalHoldDot/LegalHoldDot.test.tsx similarity index 100% rename from src/script/components/LegalHoldDot.test.tsx rename to src/script/components/LegalHoldDot/LegalHoldDot.test.tsx diff --git a/src/script/components/LegalHoldDot.tsx b/src/script/components/LegalHoldDot/LegalHoldDot.tsx similarity index 94% rename from src/script/components/LegalHoldDot.tsx rename to src/script/components/LegalHoldDot/LegalHoldDot.tsx index 1f8569a8435..487c95f6ab6 100644 --- a/src/script/components/LegalHoldDot.tsx +++ b/src/script/components/LegalHoldDot/LegalHoldDot.tsx @@ -25,7 +25,7 @@ import * as Icon from 'Components/Icon'; import {useLegalHoldModalState} from 'Components/Modals/LegalHoldModal/LegalHoldModal.state'; import {t} from 'Util/LocalizerUtil'; -import type {Conversation} from '../entity/Conversation'; +import type {Conversation} from '../../entity/Conversation'; export interface LegalHoldDotProps { isInteractive?: boolean; @@ -38,7 +38,7 @@ export interface LegalHoldDotProps { showText?: boolean; } -const LegalHoldDot: React.FC = ({ +export const LegalHoldDot = ({ isInteractive = false, conversation, isPending, @@ -47,7 +47,7 @@ const LegalHoldDot: React.FC = ({ showText = false, className = '', dataUieName = 'legal-hold-dot-pending-icon', -}) => { +}: LegalHoldDotProps) => { const {showRequestModal, showUsers} = useLegalHoldModalState(state => state); const onClick = (event: React.MouseEvent) => { @@ -90,5 +90,3 @@ const LegalHoldDot: React.FC = ({ ); }; - -export {LegalHoldDot}; diff --git a/src/script/components/LegalHoldDot/index.tsx b/src/script/components/LegalHoldDot/index.tsx new file mode 100644 index 00000000000..2cbbe0c5d78 --- /dev/null +++ b/src/script/components/LegalHoldDot/index.tsx @@ -0,0 +1,20 @@ +/* + * Wire + * Copyright (C) 2024 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + * + */ + +export * from './LegalHoldDot'; diff --git a/src/script/components/MessagesList/Message/ContentMessage/MessageHeader.tsx b/src/script/components/MessagesList/Message/ContentMessage/MessageHeader.tsx index 998d02a0358..7369d2935b6 100644 --- a/src/script/components/MessagesList/Message/ContentMessage/MessageHeader.tsx +++ b/src/script/components/MessagesList/Message/ContentMessage/MessageHeader.tsx @@ -20,8 +20,8 @@ import {Tooltip} from '@wireapp/react-ui-kit'; import {AVATAR_SIZE, Avatar} from 'Components/Avatar'; +import {UserBlockedBadge} from 'Components/Badge'; import * as Icon from 'Components/Icon'; -import {UserBlockedBadge} from 'Components/UserBlockedBadge/UserBlockedBadge'; import {UserName} from 'Components/UserName'; import {ContentMessage} from 'src/script/entity/message/ContentMessage'; import {DeleteMessage} from 'src/script/entity/message/DeleteMessage'; diff --git a/src/script/components/MessagesList/Message/ContentMessage/asset/ImageAsset/ImageAsset.test.tsx b/src/script/components/MessagesList/Message/ContentMessage/asset/ImageAsset/ImageAsset.test.tsx index 90a6b112e78..b033ec28870 100644 --- a/src/script/components/MessagesList/Message/ContentMessage/asset/ImageAsset/ImageAsset.test.tsx +++ b/src/script/components/MessagesList/Message/ContentMessage/asset/ImageAsset/ImageAsset.test.tsx @@ -27,7 +27,7 @@ import {MediumImage} from 'src/script/entity/message/MediumImage'; import {ImageAsset, ImageAssetProps} from './ImageAsset'; -jest.mock('Components/utils/InViewport', () => ({ +jest.mock('Components/InViewport', () => ({ InViewport: ({onVisible, children}: {onVisible: () => void; children: any}) => { setTimeout(onVisible); return
{children}
; diff --git a/src/script/components/MessagesList/Message/MemberMessage/ConnectedMessage.tsx b/src/script/components/MessagesList/Message/MemberMessage/ConnectedMessage.tsx index c8a1d9e4ad0..395921ae475 100644 --- a/src/script/components/MessagesList/Message/MemberMessage/ConnectedMessage.tsx +++ b/src/script/components/MessagesList/Message/MemberMessage/ConnectedMessage.tsx @@ -22,8 +22,8 @@ import React from 'react'; import {Button, ButtonVariant} from '@wireapp/react-ui-kit'; import {Avatar, AVATAR_SIZE} from 'Components/Avatar'; +import {UserClassifiedBar} from 'Components/ClassifiedBar/ClassifiedBar'; import * as Icon from 'Components/Icon'; -import {UserClassifiedBar} from 'Components/input/ClassifiedBar'; import {UnverifiedUserWarning} from 'Components/Modals/UserModal'; import {User} from 'src/script/entity/User'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; diff --git a/src/script/components/MessagesList/Message/VerificationMessage.tsx b/src/script/components/MessagesList/Message/VerificationMessage.tsx index 753bb5ffdde..2cf08ba7abc 100644 --- a/src/script/components/MessagesList/Message/VerificationMessage.tsx +++ b/src/script/components/MessagesList/Message/VerificationMessage.tsx @@ -23,7 +23,7 @@ import {amplify} from 'amplify'; import {WebAppEvents} from '@wireapp/webapp-events'; -import {VerificationIcon} from 'Components/VerifiedIcon'; +import {VerificationIcon} from 'Components/VerificationIcon'; import {SidebarTabs, useSidebarStore} from 'src/script/page/LeftSidebar/panels/Conversations/useSidebarStore'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {Declension, joinNames, t} from 'Util/LocalizerUtil'; diff --git a/src/script/components/MessagesList/Message/index.tsx b/src/script/components/MessagesList/Message/index.tsx index ea77a4d0193..8c09f66fb4a 100644 --- a/src/script/components/MessagesList/Message/index.tsx +++ b/src/script/components/MessagesList/Message/index.tsx @@ -22,7 +22,7 @@ import React, {useLayoutEffect, useRef, useEffect} from 'react'; import {QualifiedId} from '@wireapp/api-client/lib/user'; import cx from 'classnames'; -import {InViewport} from 'Components/utils/InViewport'; +import {InViewport} from 'Components/InViewport'; import {ServiceEntity} from 'src/script/integration/ServiceEntity'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {getAllFocusableElements, setElementsTabIndex} from 'Util/focusUtil'; diff --git a/src/script/components/Modals/GroupCreation/GroupCreationModal.tsx b/src/script/components/Modals/GroupCreation/GroupCreationModal.tsx index e54d15ce7b8..0e656dd0cd5 100644 --- a/src/script/components/Modals/GroupCreation/GroupCreationModal.tsx +++ b/src/script/components/Modals/GroupCreation/GroupCreationModal.tsx @@ -31,7 +31,7 @@ import {WebAppEvents} from '@wireapp/webapp-events'; import {FadingScrollbar} from 'Components/FadingScrollbar'; import * as Icon from 'Components/Icon'; -import {ModalComponent} from 'Components/ModalComponent'; +import {ModalComponent} from 'Components/Modals/ModalComponent'; import {SearchInput} from 'Components/SearchInput'; import {TextInput} from 'Components/TextInput'; import {BaseToggle} from 'Components/toggle/BaseToggle'; diff --git a/src/script/components/Modals/InviteModal/InviteModal.tsx b/src/script/components/Modals/InviteModal/InviteModal.tsx index 3c1e86e791b..7b106346f9c 100644 --- a/src/script/components/Modals/InviteModal/InviteModal.tsx +++ b/src/script/components/Modals/InviteModal/InviteModal.tsx @@ -22,7 +22,7 @@ import React, {useState} from 'react'; import {Runtime} from '@wireapp/commons'; import * as Icon from 'Components/Icon'; -import {ModalComponent} from 'Components/ModalComponent'; +import {ModalComponent} from 'Components/Modals/ModalComponent'; import {User} from 'src/script/entity/User'; import {t} from 'Util/LocalizerUtil'; import {renderElement} from 'Util/renderElement'; diff --git a/src/script/components/Modals/LegalHoldModal/LegalHoldModal.tsx b/src/script/components/Modals/LegalHoldModal/LegalHoldModal.tsx index 149c49feac9..ae47f644569 100644 --- a/src/script/components/Modals/LegalHoldModal/LegalHoldModal.tsx +++ b/src/script/components/Modals/LegalHoldModal/LegalHoldModal.tsx @@ -25,9 +25,10 @@ import {StatusCodes as HTTP_STATUS} from 'http-status-codes'; import * as Icon from 'Components/Icon'; import {LegalHoldDot} from 'Components/LegalHoldDot'; -import {ModalComponent} from 'Components/ModalComponent'; -import {useUserDevicesHistory, UserDevicesState, UserDevices} from 'Components/UserDevices'; +import {ModalComponent} from 'Components/Modals/ModalComponent'; +import {UserDevicesState, UserDevices} from 'Components/UserDevices'; import {UserSearchableList} from 'Components/UserSearchableList'; +import {useUserDevicesHistory} from 'Hooks/useUserDevicesHistory'; import {handleEnterDown} from 'Util/KeyboardUtil'; import {t} from 'Util/LocalizerUtil'; diff --git a/src/script/components/Modals/ModalComponent/ModalComponent.styles.tsx b/src/script/components/Modals/ModalComponent/ModalComponent.styles.tsx new file mode 100644 index 00000000000..557b4ef904f --- /dev/null +++ b/src/script/components/Modals/ModalComponent/ModalComponent.styles.tsx @@ -0,0 +1,65 @@ +/* + * Wire + * Copyright (C) 2024 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + * + */ + +import {CSSObject} from '@emotion/react'; + +export const ModalOverlayStyles: CSSObject = { + alignItems: 'center', + backgroundColor: 'rgba(0,0,0, 0.64)', + bottom: 0, + justifyContent: 'center', + left: 0, + opacity: 0, + overflowX: 'hidden', + overflowY: 'auto', + position: 'fixed', + right: 0, + top: 0, + transition: 'opacity 0.15s cubic-bezier(0.165, 0.84, 0.44, 1)', + zIndex: 10000000, +}; + +export const ModalOverlayVisibleStyles: CSSObject = { + ...ModalOverlayStyles, + opacity: 1, + transition: 'opacity 0.25s cubic-bezier(0.165, 0.84, 0.44, 1)', +}; + +export const ModalContentStyles: CSSObject = { + animation: 'scaleIn 0.35s cubic-bezier(0.165, 0.84, 0.44, 1)', + backgroundColor: 'var(--modal-bg)', + border: 'var(--modal-border-color)', + borderRadius: 4, + cursor: 'default', + display: 'flex', + flexDirection: 'column', + fontSize: '0.875rem', + margin: 'auto', + maxHeight: '90vh', + overflow: 'hidden', + position: 'relative', + transform: 'scale(0.8)', + transition: 'transform 0.35s cubic-bezier(0.165, 0.84, 0.44, 1)', + width: 384, +}; + +export const ModalContentVisibleStyles: CSSObject = { + ...ModalContentStyles, + transform: 'scale(1)', +}; diff --git a/src/script/components/ModalComponent.tsx b/src/script/components/Modals/ModalComponent/ModalComponent.tsx similarity index 74% rename from src/script/components/ModalComponent.tsx rename to src/script/components/Modals/ModalComponent/ModalComponent.tsx index 66cfddba2ce..619dd231461 100644 --- a/src/script/components/ModalComponent.tsx +++ b/src/script/components/Modals/ModalComponent/ModalComponent.tsx @@ -24,7 +24,14 @@ import {TabIndex} from '@wireapp/react-ui-kit/lib/types/enums'; import {noop, preventFocusOutside} from 'Util/util'; -import {LoadingIcon} from './Icon'; +import { + ModalContentStyles, + ModalContentVisibleStyles, + ModalOverlayStyles, + ModalOverlayVisibleStyles, +} from './ModalComponent.styles'; + +import {LoadingIcon} from '../../Icon'; interface ModalComponentProps extends HTMLProps { children: React.ReactNode; @@ -37,54 +44,9 @@ interface ModalComponentProps extends HTMLProps { wrapperCSS?: CSSObject; } -const ModalOverlayStyles: CSSObject = { - alignItems: 'center', - backgroundColor: 'rgba(0,0,0, 0.64)', - bottom: 0, - justifyContent: 'center', - left: 0, - opacity: 0, - overflowX: 'hidden', - overflowY: 'auto', - position: 'fixed', - right: 0, - top: 0, - transition: 'opacity 0.15s cubic-bezier(0.165, 0.84, 0.44, 1)', - zIndex: 10000000, -}; - -const ModalOverlayVisibleStyles: CSSObject = { - ...ModalOverlayStyles, - opacity: 1, - transition: 'opacity 0.25s cubic-bezier(0.165, 0.84, 0.44, 1)', -}; - -const ModalContentStyles: CSSObject = { - animation: 'scaleIn 0.35s cubic-bezier(0.165, 0.84, 0.44, 1)', - backgroundColor: 'var(--modal-bg)', - border: 'var(--modal-border-color)', - borderRadius: 4, - cursor: 'default', - display: 'flex', - flexDirection: 'column', - fontSize: '0.875rem', - margin: 'auto', - maxHeight: '90vh', - overflow: 'hidden', - position: 'relative', - transform: 'scale(0.8)', - transition: 'transform 0.35s cubic-bezier(0.165, 0.84, 0.44, 1)', - width: 384, -}; - -const ModalContentVisibleStyles: CSSObject = { - ...ModalContentStyles, - transform: 'scale(1)', -}; - const CLOSE_DELAY = 350; -const ModalComponent: React.FC = ({ +const ModalComponent = ({ id, className = '', isShown, @@ -95,7 +57,7 @@ const ModalComponent: React.FC = ({ children, onKeyDown, ...rest -}) => { +}: ModalComponentProps) => { const [displayNone, setDisplayNone] = useState(!isShown); const hasVisibleClass = isShown && !displayNone; const isMounting = useRef(true); diff --git a/src/script/components/Modals/ModalComponent/index.tsx b/src/script/components/Modals/ModalComponent/index.tsx new file mode 100644 index 00000000000..0fe3bb49d2b --- /dev/null +++ b/src/script/components/Modals/ModalComponent/index.tsx @@ -0,0 +1,20 @@ +/* + * Wire + * Copyright (C) 2024 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + * + */ + +export * from './ModalComponent'; diff --git a/src/script/components/Modals/PrimaryModal/PrimaryModal.tsx b/src/script/components/Modals/PrimaryModal/PrimaryModal.tsx index fa1446d2d69..e8ba21332c7 100644 --- a/src/script/components/Modals/PrimaryModal/PrimaryModal.tsx +++ b/src/script/components/Modals/PrimaryModal/PrimaryModal.tsx @@ -27,7 +27,7 @@ import {Checkbox, CheckboxLabel, COLOR, Form, Link, Text, Input, Loading, ErrorM import {CopyToClipboardButton} from 'Components/CopyToClipboardButton'; import {FadingScrollbar} from 'Components/FadingScrollbar'; import * as Icon from 'Components/Icon'; -import {ModalComponent} from 'Components/ModalComponent'; +import {ModalComponent} from 'Components/Modals/ModalComponent'; import {PasswordGeneratorButton} from 'Components/PasswordGeneratorButton'; import {Config} from 'src/script/Config'; import {isEnterKey, isEscapeKey} from 'Util/KeyboardUtil'; diff --git a/src/script/components/Modals/QualityFeedbackModal/QualityFeedbackModal.tsx b/src/script/components/Modals/QualityFeedbackModal/QualityFeedbackModal.tsx index a86d0cea1b2..1605db52acd 100644 --- a/src/script/components/Modals/QualityFeedbackModal/QualityFeedbackModal.tsx +++ b/src/script/components/Modals/QualityFeedbackModal/QualityFeedbackModal.tsx @@ -27,7 +27,7 @@ import {WebAppEvents} from '@wireapp/webapp-events'; import {showAppNotification} from 'Components/AppNotification'; import {useCallAlertState} from 'Components/calling/useCallAlertState'; -import {ModalComponent} from 'Components/ModalComponent'; +import {ModalComponent} from 'Components/Modals/ModalComponent'; import {RatingListLabel} from 'Components/Modals/QualityFeedbackModal/typings'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; diff --git a/src/script/components/Modals/ServiceModal/ServiceModal.tsx b/src/script/components/Modals/ServiceModal/ServiceModal.tsx index 7ee33fc3236..421f27cc575 100644 --- a/src/script/components/Modals/ServiceModal/ServiceModal.tsx +++ b/src/script/components/Modals/ServiceModal/ServiceModal.tsx @@ -21,7 +21,7 @@ import React from 'react'; import {Avatar, AVATAR_SIZE} from 'Components/Avatar'; import * as Icon from 'Components/Icon'; -import {ModalComponent} from 'Components/ModalComponent'; +import {ModalComponent} from 'Components/Modals/ModalComponent'; import {SidebarTabs, useSidebarStore} from 'src/script/page/LeftSidebar/panels/Conversations/useSidebarStore'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; diff --git a/src/script/components/Modals/UserModal/UserModal.tsx b/src/script/components/Modals/UserModal/UserModal.tsx index 6af97306fc7..d485a54ae76 100644 --- a/src/script/components/Modals/UserModal/UserModal.tsx +++ b/src/script/components/Modals/UserModal/UserModal.tsx @@ -27,7 +27,7 @@ import {Link, LinkVariant} from '@wireapp/react-ui-kit'; import {FadingScrollbar} from 'Components/FadingScrollbar'; import * as Icon from 'Components/Icon'; -import {ModalComponent} from 'Components/ModalComponent'; +import {ModalComponent} from 'Components/Modals/ModalComponent'; import {EnrichedFields} from 'Components/panel/EnrichedFields'; import {UserActions} from 'Components/panel/UserActions'; import {UserDetails} from 'Components/panel/UserDetails'; diff --git a/src/script/components/ParticipantItemContent/ParticipantItemContent.tsx b/src/script/components/ParticipantItemContent/ParticipantItemContent.tsx index 14b0abfb67a..9d8dc4e9379 100644 --- a/src/script/components/ParticipantItemContent/ParticipantItemContent.tsx +++ b/src/script/components/ParticipantItemContent/ParticipantItemContent.tsx @@ -21,10 +21,9 @@ import React from 'react'; import ko from 'knockout'; +import {UserBlockedBadge, UserVerificationBadges} from 'Components/Badge'; import * as Icon from 'Components/Icon'; -import {UserBlockedBadge} from 'Components/UserBlockedBadge/UserBlockedBadge'; import {UserInfo} from 'Components/UserInfo'; -import {UserVerificationBadges} from 'Components/VerificationBadge'; import {User} from 'src/script/entity/User'; import {ServiceEntity} from 'src/script/integration/ServiceEntity'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; diff --git a/src/script/components/PasswordGeneratorButton.test.tsx b/src/script/components/PasswordGeneratorButton/PasswordGeneratorButton.test.tsx similarity index 98% rename from src/script/components/PasswordGeneratorButton.test.tsx rename to src/script/components/PasswordGeneratorButton/PasswordGeneratorButton.test.tsx index e9f8783cacc..f285704205a 100644 --- a/src/script/components/PasswordGeneratorButton.test.tsx +++ b/src/script/components/PasswordGeneratorButton/PasswordGeneratorButton.test.tsx @@ -22,7 +22,7 @@ import {act} from 'react-dom/test-utils'; import {PasswordGeneratorButton} from './PasswordGeneratorButton'; -import {withTheme} from '../auth/util/test/TestUtil'; +import {withTheme} from '../../auth/util/test/TestUtil'; describe('PasswordGeneratorButton', () => { it('calls onGeneratePassword prop with a random password when clicked', () => { diff --git a/src/script/components/PasswordGeneratorButton.tsx b/src/script/components/PasswordGeneratorButton/PasswordGeneratorButton.tsx similarity index 88% rename from src/script/components/PasswordGeneratorButton.tsx rename to src/script/components/PasswordGeneratorButton/PasswordGeneratorButton.tsx index 06e436a48d7..4a8b24d4daf 100644 --- a/src/script/components/PasswordGeneratorButton.tsx +++ b/src/script/components/PasswordGeneratorButton/PasswordGeneratorButton.tsx @@ -17,8 +17,6 @@ * */ -import React from 'react'; - import {Button, ButtonVariant} from '@wireapp/react-ui-kit'; import * as Icon from 'Components/Icon'; @@ -30,7 +28,7 @@ interface PasswordGeneratorButtonProps { onGeneratePassword: (password: string) => void; } -const PasswordGeneratorButton: React.FC = ({passwordLength = 8, onGeneratePassword}) => { +export const PasswordGeneratorButton = ({passwordLength = 8, onGeneratePassword}: PasswordGeneratorButtonProps) => { const generatePassword = () => { const password = generateRandomPassword(passwordLength); onGeneratePassword(password); @@ -43,5 +41,3 @@ const PasswordGeneratorButton: React.FC = ({passwo ); }; - -export {PasswordGeneratorButton}; diff --git a/src/script/components/PasswordGeneratorButton/index.tsx b/src/script/components/PasswordGeneratorButton/index.tsx new file mode 100644 index 00000000000..b760c03373f --- /dev/null +++ b/src/script/components/PasswordGeneratorButton/index.tsx @@ -0,0 +1,20 @@ +/* + * Wire + * Copyright (C) 2024 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + * + */ + +export * from './PasswordGeneratorButton'; diff --git a/src/script/components/SearchInput.tsx b/src/script/components/SearchInput/SearchInput.tsx similarity index 94% rename from src/script/components/SearchInput.tsx rename to src/script/components/SearchInput/SearchInput.tsx index 52f9628b480..c0635b92fd6 100644 --- a/src/script/components/SearchInput.tsx +++ b/src/script/components/SearchInput/SearchInput.tsx @@ -24,10 +24,9 @@ import cx from 'classnames'; import {isEnterKey} from 'Util/KeyboardUtil'; import {t} from 'Util/LocalizerUtil'; -import * as Icon from './Icon'; - -import type {User} from '../entity/User'; -import {MAX_HANDLE_LENGTH} from '../user/UserHandleGenerator'; +import type {User} from '../../entity/User'; +import {MAX_HANDLE_LENGTH} from '../../user/UserHandleGenerator'; +import * as Icon from '../Icon'; interface SearchInputProps { onEnter?: (event: React.KeyboardEvent) => void | Promise; @@ -39,7 +38,7 @@ interface SearchInputProps { setInput: (input: string) => void; } -export const SearchInput: React.FC = ({ +export const SearchInput = ({ onEnter, input, selectedUsers = [], diff --git a/src/script/components/SearchInput/index.tsx b/src/script/components/SearchInput/index.tsx new file mode 100644 index 00000000000..f94bfb6a34e --- /dev/null +++ b/src/script/components/SearchInput/index.tsx @@ -0,0 +1,20 @@ +/* + * Wire + * Copyright (C) 2024 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + * + */ + +export * from './SearchInput'; diff --git a/src/script/components/SelectText.test.tsx b/src/script/components/SelectText/SelectText.test.tsx similarity index 94% rename from src/script/components/SelectText.test.tsx rename to src/script/components/SelectText/SelectText.test.tsx index bcda79d3c27..4e7a54393ef 100644 --- a/src/script/components/SelectText.test.tsx +++ b/src/script/components/SelectText/SelectText.test.tsx @@ -17,8 +17,7 @@ * */ -import {render} from '@testing-library/react'; -import {act} from 'react-dom/test-utils'; +import {act, render} from '@testing-library/react'; import {SelectText} from './SelectText'; diff --git a/src/script/components/SelectText.tsx b/src/script/components/SelectText/SelectText.tsx similarity index 92% rename from src/script/components/SelectText.tsx rename to src/script/components/SelectText/SelectText.tsx index 805b4eff6f6..f780da8b589 100644 --- a/src/script/components/SelectText.tsx +++ b/src/script/components/SelectText/SelectText.tsx @@ -30,7 +30,7 @@ export interface SelectTextProps { dataUieName?: string; } -const SelectText: React.FC = ({text, className = '', dataUieName = 'select-text'}) => { +export const SelectText = ({text, className = '', dataUieName = 'select-text'}: SelectTextProps) => { const onClick = ({currentTarget}: React.UIEvent) => { if (window.getSelection) { const selectionRange = document.createRange(); @@ -58,5 +58,3 @@ const SelectText: React.FC = ({text, className = '', dataUieNam ); }; - -export {SelectText}; diff --git a/src/script/components/SelectText/index.tsx b/src/script/components/SelectText/index.tsx new file mode 100644 index 00000000000..1f4cf9c33bc --- /dev/null +++ b/src/script/components/SelectText/index.tsx @@ -0,0 +1,20 @@ +/* + * Wire + * Copyright (C) 2024 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + * + */ + +export * from './SelectText'; diff --git a/src/script/components/TitleBar/TitleBar.tsx b/src/script/components/TitleBar/TitleBar.tsx index ab62488b2f2..74aa8a4391e 100644 --- a/src/script/components/TitleBar/TitleBar.tsx +++ b/src/script/components/TitleBar/TitleBar.tsx @@ -27,10 +27,10 @@ import {container} from 'tsyringe'; import {IconButton, IconButtonVariant, useMatchMedia} from '@wireapp/react-ui-kit'; import {WebAppEvents} from '@wireapp/webapp-events'; +import {ConversationVerificationBadges} from 'Components/Badge'; import {useCallAlertState} from 'Components/calling/useCallAlertState'; import * as Icon from 'Components/Icon'; import {LegalHoldDot} from 'Components/LegalHoldDot'; -import {ConversationVerificationBadges} from 'Components/VerificationBadge'; import {User} from 'src/script/entity/User'; import {useAppMainState, ViewType} from 'src/script/page/state'; import {ContentState} from 'src/script/page/useAppState'; diff --git a/src/script/components/UserDevices.tsx b/src/script/components/UserDevices/UserDevices.tsx similarity index 72% rename from src/script/components/UserDevices.tsx rename to src/script/components/UserDevices/UserDevices.tsx index 26ea277a512..1f4bced2b31 100644 --- a/src/script/components/UserDevices.tsx +++ b/src/script/components/UserDevices/UserDevices.tsx @@ -17,7 +17,7 @@ * */ -import React, {useEffect, useMemo, useState} from 'react'; +import {useEffect, useMemo, useState} from 'react'; import {ClientClassification} from '@wireapp/api-client/lib/client/'; @@ -26,50 +26,23 @@ import {t} from 'Util/LocalizerUtil'; import {getLogger} from 'Util/Logger'; import {capitalizeFirstChar} from 'Util/StringUtil'; -import {DeviceDetails} from './userDevices/DeviceDetails'; -import {DeviceList} from './userDevices/DeviceList'; -import {NoDevicesFound} from './userDevices/NoDevicesFound'; -import {SelfFingerprint} from './userDevices/SelfFingerprint'; - -import {ClientRepository, ClientEntity} from '../client'; -import {MessageRepository} from '../conversation/MessageRepository'; -import {CryptographyRepository} from '../cryptography/CryptographyRepository'; -import {User} from '../entity/User'; -import {useUserIdentity} from '../hooks/useDeviceIdentities'; - -enum FIND_MODE { - FOUND = 'UserDevices.MODE.FOUND', - NOT_FOUND = 'UserDevices.MODE.NOT_FOUND', - REQUESTING = 'UserDevices.MODE.REQUESTING', -} +import {DeviceDetails} from './components/DeviceDetails'; +import {DeviceList} from './components/DeviceList'; +import {NoDevicesFound} from './components/NoDevicesFound'; +import {SelfFingerprint} from './components/SelfFingerprint'; +import {FIND_MODE, UserDevicesState} from './UserDevices.types'; -export enum UserDevicesState { - DEVICE_DETAILS = 'UserDevices.DEVICE_DETAILS', - DEVICE_LIST = 'UserDevices.DEVICE_LIST', - SELF_FINGERPRINT = 'UserDevices.SELF_FINGERPRINT', -} +import {ClientRepository, ClientEntity} from '../../client'; +import {MessageRepository} from '../../conversation/MessageRepository'; +import {CryptographyRepository} from '../../cryptography/CryptographyRepository'; +import {User} from '../../entity/User'; +import {useUserIdentity} from '../../hooks/useDeviceIdentities'; export interface UserDevicesHistoryEntry { headline: string; state: UserDevicesState; } -export const useUserDevicesHistory = () => { - const [history, setHistory] = useState([ - {headline: '', state: UserDevicesState.DEVICE_LIST}, - ]); - const current = useMemo(() => history[history.length - 1], [history]); - return { - current, - goBack: () => { - setHistory(history.slice(0, -1)); - }, - goTo: (state: UserDevicesState, headline: string) => { - setHistory([...history, {headline, state}]); - }, - }; -}; - const sortUserDevices = (devices: ClientEntity[]): ClientEntity[] => { const [legalholdDevices, otherDevices] = partition( devices, @@ -89,7 +62,7 @@ interface UserDevicesProps { groupId?: string; } -const UserDevices: React.FC = ({ +export const UserDevices = ({ noPadding = false, current, user, @@ -98,7 +71,7 @@ const UserDevices: React.FC = ({ messageRepository, cryptographyRepository, groupId, -}) => { +}: UserDevicesProps) => { const [selectedClient, setSelectedClient] = useState(); const {getDeviceIdentity} = useUserIdentity(user.qualifiedId, groupId); const [deviceMode, setDeviceMode] = useState(FIND_MODE.REQUESTING); @@ -118,7 +91,7 @@ const UserDevices: React.FC = ({ } } } catch (error) { - logger.error(`Unable to retrieve clients for user '${user.id}': ${error.message || error}`); + logger.error(`Unable to retrieve clients for user '${user.id}': ${(error as Error).message || error}`); } })(); }, [user]); @@ -165,5 +138,3 @@ const UserDevices: React.FC = ({ ); }; - -export {UserDevices}; diff --git a/src/script/components/UserDevices/UserDevices.types.tsx b/src/script/components/UserDevices/UserDevices.types.tsx new file mode 100644 index 00000000000..95e71b43792 --- /dev/null +++ b/src/script/components/UserDevices/UserDevices.types.tsx @@ -0,0 +1,30 @@ +/* + * Wire + * Copyright (C) 2024 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + * + */ + +export enum FIND_MODE { + FOUND = 'UserDevices.MODE.FOUND', + NOT_FOUND = 'UserDevices.MODE.NOT_FOUND', + REQUESTING = 'UserDevices.MODE.REQUESTING', +} + +export enum UserDevicesState { + DEVICE_DETAILS = 'UserDevices.DEVICE_DETAILS', + DEVICE_LIST = 'UserDevices.DEVICE_LIST', + SELF_FINGERPRINT = 'UserDevices.SELF_FINGERPRINT', +} diff --git a/src/script/components/userDevices/DeviceCard.test.tsx b/src/script/components/UserDevices/components/DeviceCard/DeviceCard.test.tsx similarity index 96% rename from src/script/components/userDevices/DeviceCard.test.tsx rename to src/script/components/UserDevices/components/DeviceCard/DeviceCard.test.tsx index 75ab4d0265b..09bbb087049 100644 --- a/src/script/components/userDevices/DeviceCard.test.tsx +++ b/src/script/components/UserDevices/components/DeviceCard/DeviceCard.test.tsx @@ -23,7 +23,7 @@ import ko from 'knockout'; import {DeviceCard} from './DeviceCard'; -import type {ClientEntity} from '../../client/ClientEntity'; +import type {ClientEntity} from '../../../../client/ClientEntity'; function createClientEntity(clientEntity: Partial): ClientEntity { const device: Partial = { diff --git a/src/script/components/userDevices/DeviceCard.tsx b/src/script/components/UserDevices/components/DeviceCard/DeviceCard.tsx similarity index 91% rename from src/script/components/userDevices/DeviceCard.tsx rename to src/script/components/UserDevices/components/DeviceCard/DeviceCard.tsx index d2b1898a562..e700ca53bff 100644 --- a/src/script/components/userDevices/DeviceCard.tsx +++ b/src/script/components/UserDevices/components/DeviceCard/DeviceCard.tsx @@ -20,17 +20,17 @@ import {ClientClassification} from '@wireapp/api-client/lib/client'; import cx from 'classnames'; +import {DeviceVerificationBadges} from 'Components/Badge'; +import {LegalHoldDot} from 'Components/LegalHoldDot'; import {useMessageFocusedTabIndex} from 'Components/MessagesList/Message/util'; -import {DeviceVerificationBadges} from 'Components/VerificationBadge'; import {WireIdentity} from 'src/script/E2EIdentity'; import {handleKeyDown} from 'Util/KeyboardUtil'; import {t} from 'Util/LocalizerUtil'; import {splitFingerprint} from 'Util/StringUtil'; -import {type ClientEntity} from '../../client/ClientEntity'; -import {FormattedId} from '../../page/MainContent/panels/preferences/DevicesPreferences/components/FormattedId'; -import * as Icon from '../Icon'; -import {LegalHoldDot} from '../LegalHoldDot'; +import {type ClientEntity} from '../../../../client/ClientEntity'; +import {FormattedId} from '../../../../page/MainContent/panels/preferences/DevicesPreferences/components/FormattedId'; +import * as Icon from '../../../Icon'; export interface DeviceCardProps { click?: (device: ClientEntity) => void; diff --git a/src/script/components/UserDevices/components/DeviceCard/index.tsx b/src/script/components/UserDevices/components/DeviceCard/index.tsx new file mode 100644 index 00000000000..8c2040396b2 --- /dev/null +++ b/src/script/components/UserDevices/components/DeviceCard/index.tsx @@ -0,0 +1,20 @@ +/* + * Wire + * Copyright (C) 2024 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + * + */ + +export * from './DeviceCard'; diff --git a/src/script/components/userDevices/DeviceDetails.tsx b/src/script/components/UserDevices/components/DeviceDetails/DeviceDetails.tsx similarity index 91% rename from src/script/components/userDevices/DeviceDetails.tsx rename to src/script/components/UserDevices/components/DeviceDetails/DeviceDetails.tsx index b32fb4cf47f..6c5bf7fb1a5 100644 --- a/src/script/components/userDevices/DeviceDetails.tsx +++ b/src/script/components/UserDevices/components/DeviceDetails/DeviceDetails.tsx @@ -33,14 +33,14 @@ import {t} from 'Util/LocalizerUtil'; import type {Logger} from 'Util/Logger'; import {splitFingerprint} from 'Util/StringUtil'; -import type {ClientRepository, ClientEntity} from '../../client'; -import {Config} from '../../Config'; -import {ConversationState} from '../../conversation/ConversationState'; -import type {MessageRepository} from '../../conversation/MessageRepository'; -import type {CryptographyRepository} from '../../cryptography/CryptographyRepository'; -import type {User} from '../../entity/User'; -import {MotionDuration} from '../../motion/MotionDuration'; -import {FormattedId} from '../../page/MainContent/panels/preferences/DevicesPreferences/components/FormattedId'; +import type {ClientRepository, ClientEntity} from '../../../../client'; +import {Config} from '../../../../Config'; +import {ConversationState} from '../../../../conversation/ConversationState'; +import type {MessageRepository} from '../../../../conversation/MessageRepository'; +import type {CryptographyRepository} from '../../../../cryptography/CryptographyRepository'; +import type {User} from '../../../../entity/User'; +import {MotionDuration} from '../../../../motion/MotionDuration'; +import {FormattedId} from '../../../../page/MainContent/panels/preferences/DevicesPreferences/components/FormattedId'; interface DeviceDetailsProps { clickToShowSelfFingerprint: () => void; diff --git a/src/script/components/UserDevices/components/DeviceDetails/index.tsx b/src/script/components/UserDevices/components/DeviceDetails/index.tsx new file mode 100644 index 00000000000..b945c2fb7a6 --- /dev/null +++ b/src/script/components/UserDevices/components/DeviceDetails/index.tsx @@ -0,0 +1,20 @@ +/* + * Wire + * Copyright (C) 2024 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + * + */ + +export * from './DeviceDetails'; diff --git a/src/script/components/userDevices/DeviceList.tsx b/src/script/components/UserDevices/components/DeviceList/DeviceList.tsx similarity index 87% rename from src/script/components/userDevices/DeviceList.tsx rename to src/script/components/UserDevices/components/DeviceList/DeviceList.tsx index a0dc7c891ce..166e4799ba6 100644 --- a/src/script/components/userDevices/DeviceList.tsx +++ b/src/script/components/UserDevices/components/DeviceList/DeviceList.tsx @@ -17,19 +17,16 @@ * */ -import React from 'react'; - import cx from 'classnames'; import {WireIdentity} from 'src/script/E2EIdentity'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; -import {DeviceCard} from './DeviceCard'; - -import type {ClientEntity} from '../../client/ClientEntity'; -import {Config} from '../../Config'; -import type {User} from '../../entity/User'; +import type {ClientEntity} from '../../../../client/ClientEntity'; +import {Config} from '../../../../Config'; +import type {User} from '../../../../entity/User'; +import {DeviceCard} from '../DeviceCard'; interface DeviceListProps { clickOnDevice: (client: ClientEntity) => void; @@ -39,7 +36,7 @@ interface DeviceListProps { user: User; } -const DeviceList: React.FC = ({user, getDeviceIdentity, noPadding, clients, clickOnDevice}) => { +export const DeviceList = ({user, getDeviceIdentity, noPadding, clients, clickOnDevice}: DeviceListProps) => { const {name: userName} = useKoSubscribableChildren(user, ['name']); return ( @@ -80,5 +77,3 @@ const DeviceList: React.FC = ({user, getDeviceIdentity, noPaddi ); }; - -export {DeviceList}; diff --git a/src/script/components/UserDevices/components/DeviceList/index.tsx b/src/script/components/UserDevices/components/DeviceList/index.tsx new file mode 100644 index 00000000000..27edf8b1a28 --- /dev/null +++ b/src/script/components/UserDevices/components/DeviceList/index.tsx @@ -0,0 +1,20 @@ +/* + * Wire + * Copyright (C) 2024 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + * + */ + +export * from './DeviceList'; diff --git a/src/script/components/userDevices/NoDevicesFound.tsx b/src/script/components/UserDevices/components/NoDevicesFound/NoDevicesFound.tsx similarity index 88% rename from src/script/components/userDevices/NoDevicesFound.tsx rename to src/script/components/UserDevices/components/NoDevicesFound/NoDevicesFound.tsx index 662407c3348..ca13024aa5a 100644 --- a/src/script/components/userDevices/NoDevicesFound.tsx +++ b/src/script/components/UserDevices/components/NoDevicesFound/NoDevicesFound.tsx @@ -17,21 +17,19 @@ * */ -import React from 'react'; - import cx from 'classnames'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; -import type {User} from '../../entity/User'; +import type {User} from '../../../../entity/User'; interface NoDevicesFoundProps { noPadding: boolean; user: User; } -const NoDevicesFound: React.FC = ({user, noPadding}) => { +export const NoDevicesFound = ({user, noPadding}: NoDevicesFoundProps) => { const {name: userName} = useKoSubscribableChildren(user, ['name']); return ( @@ -46,5 +44,3 @@ const NoDevicesFound: React.FC = ({user, noPadding}) => { ); }; - -export {NoDevicesFound}; diff --git a/src/script/components/UserDevices/components/NoDevicesFound/index.tsx b/src/script/components/UserDevices/components/NoDevicesFound/index.tsx new file mode 100644 index 00000000000..c922c4d1127 --- /dev/null +++ b/src/script/components/UserDevices/components/NoDevicesFound/index.tsx @@ -0,0 +1,20 @@ +/* + * Wire + * Copyright (C) 2024 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + * + */ + +export * from './NoDevicesFound'; diff --git a/src/script/components/userDevices/SelfFingerprint.tsx b/src/script/components/UserDevices/components/SelfFingerprint/SelfFingerprint.tsx similarity index 83% rename from src/script/components/userDevices/SelfFingerprint.tsx rename to src/script/components/UserDevices/components/SelfFingerprint/SelfFingerprint.tsx index b0cec4224c6..4402177ddaf 100644 --- a/src/script/components/userDevices/SelfFingerprint.tsx +++ b/src/script/components/UserDevices/components/SelfFingerprint/SelfFingerprint.tsx @@ -17,7 +17,7 @@ * */ -import React, {useEffect, useState} from 'react'; +import {useEffect, useState} from 'react'; import {amplify} from 'amplify'; import cx from 'classnames'; @@ -28,11 +28,10 @@ import {WebAppEvents} from '@wireapp/webapp-events'; import {t} from 'Util/LocalizerUtil'; import {splitFingerprint} from 'Util/StringUtil'; -import {DeviceCard} from './DeviceCard'; - -import {ClientState} from '../../client/ClientState'; -import type {CryptographyRepository} from '../../cryptography/CryptographyRepository'; -import {FormattedId} from '../../page/MainContent/panels/preferences/DevicesPreferences/components/FormattedId'; +import {ClientState} from '../../../../client/ClientState'; +import type {CryptographyRepository} from '../../../../cryptography/CryptographyRepository'; +import {FormattedId} from '../../../../page/MainContent/panels/preferences/DevicesPreferences/components/FormattedId'; +import {DeviceCard} from '../DeviceCard'; interface SelfFingerprintProps { clientState?: ClientState; @@ -40,11 +39,11 @@ interface SelfFingerprintProps { noPadding: boolean; } -export const SelfFingerprint: React.FC = ({ +export const SelfFingerprint = ({ cryptographyRepository, noPadding, clientState = container.resolve(ClientState), -}) => { +}: SelfFingerprintProps) => { const [localFingerprint, setLocalFingerprint] = useState(''); useEffect(() => { cryptographyRepository.getLocalFingerprint().then(setLocalFingerprint); diff --git a/src/script/components/UserDevices/components/SelfFingerprint/index.tsx b/src/script/components/UserDevices/components/SelfFingerprint/index.tsx new file mode 100644 index 00000000000..d25adb76675 --- /dev/null +++ b/src/script/components/UserDevices/components/SelfFingerprint/index.tsx @@ -0,0 +1,20 @@ +/* + * Wire + * Copyright (C) 2024 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + * + */ + +export * from './SelfFingerprint'; diff --git a/src/script/components/UserDevices/index.tsx b/src/script/components/UserDevices/index.tsx new file mode 100644 index 00000000000..fceb2679c74 --- /dev/null +++ b/src/script/components/UserDevices/index.tsx @@ -0,0 +1,21 @@ +/* + * Wire + * Copyright (C) 2024 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + * + */ + +export * from './UserDevices'; +export * from './UserDevices.types'; diff --git a/src/script/components/UserInfo.tsx b/src/script/components/UserInfo/UserInfo.tsx similarity index 97% rename from src/script/components/UserInfo.tsx rename to src/script/components/UserInfo/UserInfo.tsx index 9acb7d0d0d1..0a8f511e64a 100644 --- a/src/script/components/UserInfo.tsx +++ b/src/script/components/UserInfo/UserInfo.tsx @@ -23,12 +23,11 @@ import {CSSObject} from '@emotion/react'; import cx from 'classnames'; import {selfIndicator} from 'Components/ParticipantItemContent/ParticipantItem.styles'; +import {UserName} from 'Components/UserName'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {KEY} from 'Util/KeyboardUtil'; -import {UserName} from './UserName'; - -import {User} from '../entity/User'; +import {User} from '../../entity/User'; interface UserInfoProps { user: User; diff --git a/src/script/components/UserInfo/index.tsx b/src/script/components/UserInfo/index.tsx new file mode 100644 index 00000000000..2b17c75022d --- /dev/null +++ b/src/script/components/UserInfo/index.tsx @@ -0,0 +1,20 @@ +/* + * Wire + * Copyright (C) 2024 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + * + */ + +export * from './UserInfo'; diff --git a/src/script/components/UserList/UserList.tsx b/src/script/components/UserList/UserList.tsx index 25269f79852..764afb6188d 100644 --- a/src/script/components/UserList/UserList.tsx +++ b/src/script/components/UserList/UserList.tsx @@ -23,6 +23,7 @@ import cx from 'classnames'; import {container} from 'tsyringe'; import * as Icon from 'Components/Icon'; +import {InViewport} from 'Components/InViewport'; import {collapseButton, collapseIcon} from 'Components/UserList/UserList.styles'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {isEnterKey, isSpaceKey} from 'Util/KeyboardUtil'; @@ -35,7 +36,6 @@ import {ConversationState} from '../../conversation/ConversationState'; import type {Conversation} from '../../entity/Conversation'; import type {User} from '../../entity/User'; import {TeamState} from '../../team/TeamState'; -import {InViewport} from '../utils/InViewport'; export enum UserlistMode { COMPACT = 'UserlistMode.COMPACT', diff --git a/src/script/components/UserList/components/UserListItem/UserListItem.tsx b/src/script/components/UserList/components/UserListItem/UserListItem.tsx index c215a6a1d9c..7f5996a51e7 100644 --- a/src/script/components/UserList/components/UserListItem/UserListItem.tsx +++ b/src/script/components/UserList/components/UserListItem/UserListItem.tsx @@ -24,9 +24,9 @@ import {TabIndex} from '@wireapp/react-ui-kit/lib/types/enums'; import {Checkbox, CheckboxLabel} from '@wireapp/react-ui-kit'; import {Avatar, AVATAR_SIZE} from 'Components/Avatar'; +import {UserStatusBadges} from 'Components/Badge'; import {ParticipantItemContent} from 'Components/ParticipantItemContent'; import {listItem, listWrapper} from 'Components/ParticipantItemContent/ParticipantItem.styles'; -import {UserStatusBadges} from 'Components/UserBadges'; import {UserlistMode} from 'Components/UserList'; import {useUserName} from 'Components/UserName'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; diff --git a/src/script/components/UserName.tsx b/src/script/components/UserName/UserName.tsx similarity index 97% rename from src/script/components/UserName.tsx rename to src/script/components/UserName/UserName.tsx index d1dac0d4725..bedd39b006b 100644 --- a/src/script/components/UserName.tsx +++ b/src/script/components/UserName/UserName.tsx @@ -20,7 +20,7 @@ import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; -import {User} from '../entity/User'; +import {User} from '../../entity/User'; interface UserNameProps { user: User; diff --git a/src/script/components/UserName/index.tsx b/src/script/components/UserName/index.tsx new file mode 100644 index 00000000000..4afb261c950 --- /dev/null +++ b/src/script/components/UserName/index.tsx @@ -0,0 +1,20 @@ +/* + * Wire + * Copyright (C) 2024 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + * + */ + +export * from './UserName'; diff --git a/src/script/components/UserSearchableList.tsx b/src/script/components/UserSearchableList/UserSearchableList.tsx similarity index 93% rename from src/script/components/UserSearchableList.tsx rename to src/script/components/UserSearchableList/UserSearchableList.tsx index ddf4fbc907e..3439a9734ce 100644 --- a/src/script/components/UserSearchableList.tsx +++ b/src/script/components/UserSearchableList/UserSearchableList.tsx @@ -23,18 +23,17 @@ import {QualifiedId} from '@wireapp/api-client/lib/user'; import {container} from 'tsyringe'; import {debounce} from 'underscore'; +import {UserList} from 'Components/UserList'; import {partition} from 'Util/ArrayUtil'; import {t} from 'Util/LocalizerUtil'; import {matchQualifiedIds} from 'Util/QualifiedId'; import {sortByPriority} from 'Util/StringUtil'; -import {UserList} from './UserList'; - -import {ConversationState} from '../conversation/ConversationState'; -import type {User} from '../entity/User'; -import {SearchRepository} from '../search/SearchRepository'; -import type {TeamRepository} from '../team/TeamRepository'; -import {TeamState} from '../team/TeamState'; +import {ConversationState} from '../../conversation/ConversationState'; +import type {User} from '../../entity/User'; +import {SearchRepository} from '../../search/SearchRepository'; +import type {TeamRepository} from '../../team/TeamRepository'; +import {TeamState} from '../../team/TeamState'; export type UserListProps = React.ComponentProps & { conversationState?: ConversationState; @@ -57,7 +56,7 @@ export type UserListProps = React.ComponentProps & { filterRemoteTeamUsers?: boolean; }; -export const UserSearchableList: React.FC = ({ +export const UserSearchableList = ({ onUpdateSelectedUsers, filterRemoteTeamUsers = false, dataUieName = '', @@ -69,7 +68,7 @@ export const UserSearchableList: React.FC = ({ users, teamState = container.resolve(TeamState), ...props -}) => { +}: UserListProps) => { const {searchRepository, teamRepository, selfFirst, ...userListProps} = props; const {conversationState = container.resolve(ConversationState)} = props; diff --git a/src/script/components/UserSearchableList/index.tsx b/src/script/components/UserSearchableList/index.tsx new file mode 100644 index 00000000000..1b97138a672 --- /dev/null +++ b/src/script/components/UserSearchableList/index.tsx @@ -0,0 +1,20 @@ +/* + * Wire + * Copyright (C) 2024 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + * + */ + +export * from './UserSearchableList'; diff --git a/src/script/components/VerifiedIcon.tsx b/src/script/components/VerificationIcon/VerificationIcon.tsx similarity index 82% rename from src/script/components/VerifiedIcon.tsx rename to src/script/components/VerificationIcon/VerificationIcon.tsx index 9d41e284aef..f855d89b7bb 100644 --- a/src/script/components/VerifiedIcon.tsx +++ b/src/script/components/VerificationIcon/VerificationIcon.tsx @@ -17,17 +17,15 @@ * */ -import React from 'react'; +import {VerifiedIcon, NotVerifiedIcon} from '../Icon'; -import {VerifiedIcon, NotVerifiedIcon} from './Icon'; - -export interface VerifiedIconProps { +export interface VerificationIconProps { className?: string; dataUieName?: string; isVerified: boolean; } -export const VerificationIcon: React.FC = ({isVerified, dataUieName, className}) => { +export const VerificationIcon = ({isVerified, dataUieName, className}: VerificationIconProps) => { return isVerified ? ( ) : ( diff --git a/src/script/components/VerificationIcon/index.tsx b/src/script/components/VerificationIcon/index.tsx new file mode 100644 index 00000000000..e7e8bd88a2a --- /dev/null +++ b/src/script/components/VerificationIcon/index.tsx @@ -0,0 +1,20 @@ +/* + * Wire + * Copyright (C) 2024 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + * + */ + +export * from './VerificationIcon'; diff --git a/src/script/components/calling/CallParticipantsListItem/CallParticipantsListItem.tsx b/src/script/components/calling/CallParticipantsListItem/CallParticipantsListItem.tsx index 15e8e2b638d..b58a8468a01 100644 --- a/src/script/components/calling/CallParticipantsListItem/CallParticipantsListItem.tsx +++ b/src/script/components/calling/CallParticipantsListItem/CallParticipantsListItem.tsx @@ -22,7 +22,7 @@ import React from 'react'; import {TabIndex} from '@wireapp/react-ui-kit/lib/types/enums'; import {Avatar, AVATAR_SIZE} from 'Components/Avatar'; -import {UserStatusBadges} from 'Components/UserBadges'; +import {UserStatusBadges} from 'Components/Badge'; import {Participant} from 'src/script/calling/Participant'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {handleKeyDown} from 'Util/KeyboardUtil'; diff --git a/src/script/components/calling/CallingCell/CallingCell.test.tsx b/src/script/components/calling/CallingCell/CallingCell.test.tsx index 0533efa1f73..9192e0f47e8 100644 --- a/src/script/components/calling/CallingCell/CallingCell.test.tsx +++ b/src/script/components/calling/CallingCell/CallingCell.test.tsx @@ -35,7 +35,7 @@ import {createUuid} from 'Util/uuid'; import {CallingCell, CallingCellProps} from './CallingCell'; -jest.mock('Components/utils/InViewport', () => ({ +jest.mock('Components/InViewport', () => ({ InViewport: ({onVisible, children}: {onVisible: () => void; children: any}) => { setTimeout(onVisible); return
{children}
; diff --git a/src/script/components/calling/CallingCell/CallingCell.tsx b/src/script/components/calling/CallingCell/CallingCell.tsx index 4daec26f79e..ea1fd4f4b71 100644 --- a/src/script/components/calling/CallingCell/CallingCell.tsx +++ b/src/script/components/calling/CallingCell/CallingCell.tsx @@ -29,8 +29,8 @@ import {CallingControls} from 'Components/calling/CallingCell/CallingControls'; import {CallingHeader} from 'Components/calling/CallingCell/CallingHeader'; import {GroupVideoGrid} from 'Components/calling/GroupVideoGrid'; import {useCallAlertState} from 'Components/calling/useCallAlertState'; +import {ConversationClassifiedBar} from 'Components/ClassifiedBar/ClassifiedBar'; import * as Icon from 'Components/Icon'; -import {ConversationClassifiedBar} from 'Components/input/ClassifiedBar'; import {usePushToTalk} from 'src/script/hooks/usePushToTalk/usePushToTalk'; import {useAppMainState, ViewType} from 'src/script/page/state'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; diff --git a/src/script/components/calling/DetachedCallingCell/DetachedCallingCell.tsx b/src/script/components/calling/DetachedCallingCell/DetachedCallingCell.tsx index 07c7d3b329a..1a5ad39a3c9 100644 --- a/src/script/components/calling/DetachedCallingCell/DetachedCallingCell.tsx +++ b/src/script/components/calling/DetachedCallingCell/DetachedCallingCell.tsx @@ -19,7 +19,6 @@ import {container} from 'tsyringe'; -import {DetachedWindow} from 'Components/DetachedWindow'; import {Call} from 'src/script/calling/Call'; import {CallingRepository} from 'src/script/calling/CallingRepository'; import {CallState, CallingViewMode, DesktopScreenShareMenu} from 'src/script/calling/CallState'; @@ -27,6 +26,8 @@ import {MediaRepository} from 'src/script/media/MediaRepository'; import {UserState} from 'src/script/user/UserState'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; +import {DetachedWindow} from './components/DetachedWindow'; + import {CallingContainer} from '../CallingOverlayContainer'; import {WindowContextProvider} from '../useWindow'; diff --git a/src/script/components/DetachedWindow/DetachedWindow.tsx b/src/script/components/calling/DetachedCallingCell/components/DetachedWindow/DetachedWindow.tsx similarity index 97% rename from src/script/components/DetachedWindow/DetachedWindow.tsx rename to src/script/components/calling/DetachedCallingCell/components/DetachedWindow/DetachedWindow.tsx index 6f548e39ae3..933371c07e6 100644 --- a/src/script/components/DetachedWindow/DetachedWindow.tsx +++ b/src/script/components/calling/DetachedCallingCell/components/DetachedWindow/DetachedWindow.tsx @@ -29,7 +29,7 @@ import {CallState} from 'src/script/calling/CallState'; import {useActiveWindow} from 'src/script/hooks/useActiveWindow'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; -import '../../../style/default.less'; +import '../../../../../../style/default.less'; interface DetachedWindowProps { children: React.ReactNode; diff --git a/src/script/components/DetachedWindow/index.ts b/src/script/components/calling/DetachedCallingCell/components/DetachedWindow/index.ts similarity index 100% rename from src/script/components/DetachedWindow/index.ts rename to src/script/components/calling/DetachedCallingCell/components/DetachedWindow/index.ts diff --git a/src/script/components/calling/FullscreenVideoCall.tsx b/src/script/components/calling/FullscreenVideoCall.tsx index 5829e77ca7c..67290ca6ab1 100644 --- a/src/script/components/calling/FullscreenVideoCall.tsx +++ b/src/script/components/calling/FullscreenVideoCall.tsx @@ -36,9 +36,9 @@ import { } from '@wireapp/react-ui-kit'; import {useCallAlertState} from 'Components/calling/useCallAlertState'; +import {ConversationClassifiedBar} from 'Components/ClassifiedBar/ClassifiedBar'; import * as Icon from 'Components/Icon'; -import {ConversationClassifiedBar} from 'Components/input/ClassifiedBar'; -import {ModalComponent} from 'Components/ModalComponent'; +import {ModalComponent} from 'Components/Modals/ModalComponent'; import {CallingRepository} from 'src/script/calling/CallingRepository'; import {Config} from 'src/script/Config'; import {isCallViewOption} from 'src/script/guards/CallView'; diff --git a/src/script/components/panel/UserDetails.tsx b/src/script/components/panel/UserDetails.tsx index e0cee0a5ed6..9b10a8013b1 100644 --- a/src/script/components/panel/UserDetails.tsx +++ b/src/script/components/panel/UserDetails.tsx @@ -25,12 +25,11 @@ import {ErrorBoundary} from 'react-error-boundary'; import {WebAppEvents} from '@wireapp/webapp-events'; import {Avatar, AVATAR_SIZE} from 'Components/Avatar'; +import {UserBlockedBadge, UserVerificationBadges} from 'Components/Badge'; +import {UserClassifiedBar} from 'Components/ClassifiedBar/ClassifiedBar'; import {ErrorFallback} from 'Components/ErrorFallback'; import * as Icon from 'Components/Icon'; -import {UserClassifiedBar} from 'Components/input/ClassifiedBar'; -import {UserBlockedBadge} from 'Components/UserBlockedBadge/UserBlockedBadge'; import {UserInfo} from 'Components/UserInfo'; -import {UserVerificationBadges} from 'Components/VerificationBadge'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; diff --git a/src/script/hooks/useUserDevicesHistory/index.tsx b/src/script/hooks/useUserDevicesHistory/index.tsx new file mode 100644 index 00000000000..648eb79f089 --- /dev/null +++ b/src/script/hooks/useUserDevicesHistory/index.tsx @@ -0,0 +1,20 @@ +/* + * Wire + * Copyright (C) 2024 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + * + */ + +export * from './useUserDevicesHistory'; diff --git a/src/script/hooks/useUserDevicesHistory/useUserDevicesHistory.tsx b/src/script/hooks/useUserDevicesHistory/useUserDevicesHistory.tsx new file mode 100644 index 00000000000..20d12f29582 --- /dev/null +++ b/src/script/hooks/useUserDevicesHistory/useUserDevicesHistory.tsx @@ -0,0 +1,38 @@ +/* + * Wire + * Copyright (C) 2024 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + * + */ + +import {useMemo, useState} from 'react'; + +import {UserDevicesHistoryEntry, UserDevicesState} from 'Components/UserDevices'; + +export const useUserDevicesHistory = () => { + const [history, setHistory] = useState([ + {headline: '', state: UserDevicesState.DEVICE_LIST}, + ]); + const current = useMemo(() => history[history.length - 1], [history]); + return { + current, + goBack: () => { + setHistory(history.slice(0, -1)); + }, + goTo: (state: UserDevicesState, headline: string) => { + setHistory([...history, {headline, state}]); + }, + }; +}; diff --git a/src/script/page/AppLock/AppLock.tsx b/src/script/page/AppLock/AppLock.tsx index edd06449d33..2dceed775b7 100644 --- a/src/script/page/AppLock/AppLock.tsx +++ b/src/script/page/AppLock/AppLock.tsx @@ -28,7 +28,7 @@ import {ValidationUtil} from '@wireapp/commons'; import {WebAppEvents} from '@wireapp/webapp-events'; import * as Icon from 'Components/Icon'; -import {ModalComponent} from 'Components/ModalComponent'; +import {ModalComponent} from 'Components/Modals/ModalComponent'; import {SIGN_OUT_REASON} from 'src/script/auth/SignOutReason'; import {ClientRepository} from 'src/script/client'; import {ClientState} from 'src/script/client/ClientState'; diff --git a/src/script/page/LeftSidebar/UserDetails/UserDetails.tsx b/src/script/page/LeftSidebar/UserDetails/UserDetails.tsx index 9084aa164e3..808d045e249 100644 --- a/src/script/page/LeftSidebar/UserDetails/UserDetails.tsx +++ b/src/script/page/LeftSidebar/UserDetails/UserDetails.tsx @@ -23,8 +23,8 @@ import {TabIndex} from '@wireapp/react-ui-kit/lib/types/enums'; import cx from 'classnames'; import {Avatar, AVATAR_SIZE} from 'Components/Avatar'; +import {UserVerificationBadges} from 'Components/Badge'; import {LegalHoldDot} from 'Components/LegalHoldDot'; -import {UserVerificationBadges} from 'Components/VerificationBadge'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; diff --git a/src/script/page/LeftSidebar/panels/Conversations/ConversationsList.tsx b/src/script/page/LeftSidebar/panels/Conversations/ConversationsList.tsx index b3c847fb6a7..b1255391d03 100644 --- a/src/script/page/LeftSidebar/panels/Conversations/ConversationsList.tsx +++ b/src/script/page/LeftSidebar/panels/Conversations/ConversationsList.tsx @@ -19,7 +19,7 @@ import React, {MouseEvent as ReactMouseEvent, KeyboardEvent as ReactKeyBoardEvent, useEffect, useState} from 'react'; -import {ConversationListCell} from 'Components/list/ConversationListCell'; +import {ConversationListCell} from 'Components/ConversationListCell'; import {Call} from 'src/script/calling/Call'; import {ConversationLabel, ConversationLabelRepository} from 'src/script/conversation/ConversationLabelRepository'; import {User} from 'src/script/entity/User'; diff --git a/src/script/page/MainContent/panels/preferences/AccountPreferences.tsx b/src/script/page/MainContent/panels/preferences/AccountPreferences.tsx index 75d93aeb293..e8ca670b1dd 100644 --- a/src/script/page/MainContent/panels/preferences/AccountPreferences.tsx +++ b/src/script/page/MainContent/panels/preferences/AccountPreferences.tsx @@ -22,10 +22,10 @@ import {container} from 'tsyringe'; import {Runtime} from '@wireapp/commons'; +import {UserVerificationBadges} from 'Components/Badge'; import {ErrorFallback} from 'Components/ErrorFallback'; import {PrimaryModal} from 'Components/Modals/PrimaryModal'; import {useEnrichedFields} from 'Components/panel/EnrichedFields'; -import {UserVerificationBadges} from 'Components/VerificationBadge'; import {ConversationState} from 'src/script/conversation/ConversationState'; import {ContentState} from 'src/script/page/useAppState'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; diff --git a/src/script/page/MainContent/panels/preferences/DevicesPreferences/components/DetailedDevice.tsx b/src/script/page/MainContent/panels/preferences/DevicesPreferences/components/DetailedDevice.tsx index c2d1222a19c..5ea3e240ef7 100644 --- a/src/script/page/MainContent/panels/preferences/DevicesPreferences/components/DetailedDevice.tsx +++ b/src/script/page/MainContent/panels/preferences/DevicesPreferences/components/DetailedDevice.tsx @@ -19,7 +19,7 @@ import React from 'react'; -import {DeviceVerificationBadges} from 'Components/VerificationBadge'; +import {DeviceVerificationBadges} from 'Components/Badge'; import {ClientEntity} from 'src/script/client/ClientEntity'; import {WireIdentity} from 'src/script/E2EIdentity'; diff --git a/src/script/page/MainContent/panels/preferences/DevicesPreferences/components/Device/Device.tsx b/src/script/page/MainContent/panels/preferences/DevicesPreferences/components/Device/Device.tsx index 89f43c6cd22..be5ae564a81 100644 --- a/src/script/page/MainContent/panels/preferences/DevicesPreferences/components/Device/Device.tsx +++ b/src/script/page/MainContent/panels/preferences/DevicesPreferences/components/Device/Device.tsx @@ -21,8 +21,8 @@ import {MouseEvent, KeyboardEvent} from 'react'; import {TabIndex} from '@wireapp/react-ui-kit/lib/types/enums'; +import {DeviceVerificationBadges} from 'Components/Badge'; import * as Icon from 'Components/Icon'; -import {DeviceVerificationBadges} from 'Components/VerificationBadge'; import {WireIdentity} from 'src/script/E2EIdentity'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {handleKeyDown} from 'Util/KeyboardUtil'; diff --git a/src/script/page/MainContent/panels/preferences/DevicesPreferences/components/E2EICertificateDetails/E2EICertificateDetails.tsx b/src/script/page/MainContent/panels/preferences/DevicesPreferences/components/E2EICertificateDetails/E2EICertificateDetails.tsx index 54d8f54f17b..9ab19b7afd9 100644 --- a/src/script/page/MainContent/panels/preferences/DevicesPreferences/components/E2EICertificateDetails/E2EICertificateDetails.tsx +++ b/src/script/page/MainContent/panels/preferences/DevicesPreferences/components/E2EICertificateDetails/E2EICertificateDetails.tsx @@ -21,7 +21,7 @@ import {TabIndex} from '@wireapp/react-ui-kit/lib/types/enums'; import {Button, ButtonVariant} from '@wireapp/react-ui-kit'; -import {VerificationBadges} from 'Components/VerificationBadge'; +import {VerificationBadges} from 'Components/Badge'; import {E2EIHandler, MLSStatuses, WireIdentity} from 'src/script/E2EIdentity'; import {useCertificateStatus} from 'src/script/hooks/useCertificateStatus'; import {t} from 'Util/LocalizerUtil'; diff --git a/src/script/page/MainContent/panels/preferences/DevicesPreferences/components/ProteusDeviceDetails.tsx b/src/script/page/MainContent/panels/preferences/DevicesPreferences/components/ProteusDeviceDetails.tsx index cf46bace7d8..a2b0e867975 100644 --- a/src/script/page/MainContent/panels/preferences/DevicesPreferences/components/ProteusDeviceDetails.tsx +++ b/src/script/page/MainContent/panels/preferences/DevicesPreferences/components/ProteusDeviceDetails.tsx @@ -17,7 +17,7 @@ * */ -import {VerificationBadges} from 'Components/VerificationBadge'; +import {VerificationBadges} from 'Components/Badge'; import {t} from 'Util/LocalizerUtil'; import {splitFingerprint} from 'Util/StringUtil'; import {formatTimestamp} from 'Util/TimeUtil'; diff --git a/src/script/page/RightSidebar/ConversationDetails/components/ConversationDetailsHeader/ConversationDetailsHeader.tsx b/src/script/page/RightSidebar/ConversationDetails/components/ConversationDetailsHeader/ConversationDetailsHeader.tsx index 38ec2690d3b..959eedbebe4 100644 --- a/src/script/page/RightSidebar/ConversationDetails/components/ConversationDetailsHeader/ConversationDetailsHeader.tsx +++ b/src/script/page/RightSidebar/ConversationDetails/components/ConversationDetailsHeader/ConversationDetailsHeader.tsx @@ -19,8 +19,8 @@ import {ChangeEvent, FC, KeyboardEvent, useEffect, useRef, useState} from 'react'; +import {ConversationVerificationBadges} from 'Components/Badge'; import * as Icon from 'Components/Icon'; -import {ConversationVerificationBadges} from 'Components/VerificationBadge'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {isEnterKey} from 'Util/KeyboardUtil'; import {t} from 'Util/LocalizerUtil'; diff --git a/src/script/page/RightSidebar/PanelHeader/PanelHeader.tsx b/src/script/page/RightSidebar/PanelHeader/PanelHeader.tsx index 34095bad593..d94cd362c75 100644 --- a/src/script/page/RightSidebar/PanelHeader/PanelHeader.tsx +++ b/src/script/page/RightSidebar/PanelHeader/PanelHeader.tsx @@ -22,7 +22,7 @@ import {FC, useEffect, useRef} from 'react'; import {TabIndex} from '@wireapp/react-ui-kit/lib/types/enums'; import cx from 'classnames'; -import {DragableClickWrapper} from 'Components/DragableClickWrapper'; +import {DraggableClickWrapper} from 'Components/DraggableClickWrapper'; import * as Icon from 'Components/Icon'; import {t} from 'Util/LocalizerUtil'; import {noop} from 'Util/util'; @@ -80,11 +80,11 @@ const PanelHeader: FC = ({ return (
{showBackArrow && ( - onGoBack()}> + onGoBack()}> - + )} {title && ( @@ -93,14 +93,14 @@ const PanelHeader: FC = ({ )} - + - + {showActionMute && ( - + - + )}
); diff --git a/src/script/page/RightSidebar/ParticipantDevices/ParticipantDevices.tsx b/src/script/page/RightSidebar/ParticipantDevices/ParticipantDevices.tsx index a7623fbb8c8..68fb1869280 100644 --- a/src/script/page/RightSidebar/ParticipantDevices/ParticipantDevices.tsx +++ b/src/script/page/RightSidebar/ParticipantDevices/ParticipantDevices.tsx @@ -20,7 +20,8 @@ import {FC} from 'react'; import {FadingScrollbar} from 'Components/FadingScrollbar'; -import {UserDevices, UserDevicesState, useUserDevicesHistory} from 'Components/UserDevices'; +import {UserDevices, UserDevicesState} from 'Components/UserDevices'; +import {useUserDevicesHistory} from 'Hooks/useUserDevicesHistory'; import {t} from 'Util/LocalizerUtil'; import type {User} from '../../../entity/User'; diff --git a/tsconfig.json b/tsconfig.json index f17dccaa913..b2d3b147abd 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -27,6 +27,7 @@ "outDir": "src/script/auth", "paths": { "Components/*": ["./src/script/components/*"], + "Hooks/*": ["./src/script/hooks/*"], "I18n/*": ["./src/i18n/*"], "Resource/*": ["./resource/*"], "Util/*": ["./src/script/util/*"] diff --git a/webpack.config.common.js b/webpack.config.common.js index ac96677e78d..bd6afaf6c5f 100644 --- a/webpack.config.common.js +++ b/webpack.config.common.js @@ -190,6 +190,7 @@ module.exports = { resolve: { alias: { Components: path.resolve(srcScript, 'components'), + Hooks: path.resolve(srcScript, 'hooks'), I18n: path.resolve(SRC_PATH, 'i18n'), Resource: path.resolve(ROOT_PATH, 'resource'), Util: path.resolve(srcScript, 'util'), From ca32d1f7288c57ac16dd812773ce3470962f4a2e Mon Sep 17 00:00:00 2001 From: Przemyslaw Jozwik Date: Wed, 30 Oct 2024 12:18:18 +0100 Subject: [PATCH 02/12] feat: Improve repositories folder structure --- jest.config.ts | 1 + src/script/auth/page/OAuthPermissions.tsx | 4 ++-- src/script/components/Avatar/AvatarImage.test.tsx | 4 ++-- src/script/components/Avatar/AvatarImage.tsx | 5 ++--- src/script/components/Image/Image.tsx | 2 +- src/script/components/InputBar/InputBar.test.tsx | 2 +- .../Message/ContentMessage/asset/AudioAsset.tsx | 2 +- .../ContentMessage/asset/FileAssetComponent.tsx | 2 +- .../asset/ImageAsset/ImageAsset.test.tsx | 4 ++-- .../Message/ContentMessage/asset/VideoAsset.tsx | 4 ++-- .../asset/controls/MediaButton.test.tsx | 2 +- .../ContentMessage/asset/controls/MediaButton.tsx | 2 +- .../Message/ContentMessage/asset/index.tsx | 2 +- .../ContentMessage/asset/useAssetTransfer.test.ts | 4 ++-- .../Message/ContentMessage/asset/useAssetTransfer.ts | 6 +++--- .../MessagesList/Message/MessageWrapper.tsx | 2 +- .../components/Modals/DetailViewModal/index.tsx | 2 +- src/script/conversation/ConversationCellState.ts | 2 +- src/script/conversation/ConversationRepository.ts | 2 +- src/script/conversation/EventBuilder.ts | 2 +- src/script/conversation/EventMapper.test.ts | 2 +- src/script/conversation/EventMapper.ts | 4 ++-- src/script/conversation/MessageRepository.test.ts | 2 +- src/script/conversation/MessageRepository.ts | 6 +++--- src/script/cryptography/CryptographyMapper.ts | 2 +- src/script/entity/User/User.ts | 2 +- src/script/entity/message/Asset.ts | 4 ++-- src/script/entity/message/Button.ts | 4 ++-- src/script/entity/message/ContentMessage.ts | 2 +- src/script/entity/message/FileAsset.ts | 7 +++---- src/script/entity/message/LinkPreview.ts | 3 +-- src/script/entity/message/Location.ts | 4 ++-- src/script/entity/message/MediumImage.ts | 5 ++--- src/script/entity/message/Message.ts | 4 ++-- src/script/entity/message/Text.ts | 2 +- src/script/event/EventService.ts | 2 +- .../EventStorageMiddleware.test.ts | 2 +- .../eventHandlers/assetEventHandler.ts | 2 +- src/script/integration/IntegrationMapper.ts | 4 ++-- src/script/integration/ServiceEntity.ts | 2 +- src/script/main/app.ts | 2 +- src/script/notification/NotificationRepository.ts | 2 +- .../panels/StartUI/components/TopPeople.tsx | 3 ++- .../StartUI/components/topPeople/TopContact.tsx | 2 +- .../panels/Collection/Collection.test.tsx | 2 +- .../MainContent/panels/Collection/Collection.tsx | 2 +- .../{ => repositories}/assets/AssetMapper.test.ts | 0 src/script/{ => repositories}/assets/AssetMapper.ts | 4 ++-- .../assets/AssetMetaDataBuilder.test.ts | 0 .../assets/AssetMetaDataBuilder.ts | 0 .../{ => repositories}/assets/AssetRemoteData.ts | 0 .../assets/AssetRepository.test.ts | 2 +- .../{ => repositories}/assets/AssetRepository.ts | 12 ++++++------ .../{ => repositories}/assets/AssetTransferState.ts | 0 src/script/{ => repositories}/assets/AssetType.ts | 0 .../{ => repositories}/assets/AssetURLCache.ts | 0 src/script/{ => repositories}/assets/imageWorker.ts | 0 src/script/team/TeamEntity.ts | 3 ++- src/script/team/TeamRepository.test.ts | 2 +- src/script/team/TeamRepository.ts | 2 +- src/script/user/UserMapper.ts | 2 +- src/script/user/UserRepository.test.ts | 2 +- src/script/user/UserRepository.ts | 4 ++-- src/script/util/conversationMessages.ts | 2 +- src/script/util/isHittingUploadLimit.ts | 2 +- src/script/view_model/MainViewModel.ts | 3 ++- test/helper/EventGenerator.ts | 2 +- test/helper/TestFactory.js | 2 +- test/unit_tests/event/EventServiceCommon.js | 2 +- tsconfig.json | 1 + webpack.config.common.js | 1 + 71 files changed, 92 insertions(+), 90 deletions(-) rename src/script/{ => repositories}/assets/AssetMapper.test.ts (100%) rename src/script/{ => repositories}/assets/AssetMapper.ts (95%) rename src/script/{ => repositories}/assets/AssetMetaDataBuilder.test.ts (100%) rename src/script/{ => repositories}/assets/AssetMetaDataBuilder.ts (100%) rename src/script/{ => repositories}/assets/AssetRemoteData.ts (100%) rename src/script/{ => repositories}/assets/AssetRepository.test.ts (98%) rename src/script/{ => repositories}/assets/AssetRepository.ts (96%) rename src/script/{ => repositories}/assets/AssetTransferState.ts (100%) rename src/script/{ => repositories}/assets/AssetType.ts (100%) rename src/script/{ => repositories}/assets/AssetURLCache.ts (100%) rename src/script/{ => repositories}/assets/imageWorker.ts (100%) diff --git a/jest.config.ts b/jest.config.ts index 2dcf361ee47..94f7452ff0d 100644 --- a/jest.config.ts +++ b/jest.config.ts @@ -29,6 +29,7 @@ const config: Config = { 'Hooks/(.*)': '/src/script/hooks/$1', 'I18n/(.*)': '/src/i18n/$1', 'Resource/(.*)': '/resource/$1', + 'Repositories/(.*)': '/src/script/repositories/$1', 'Util/(.*)': '/src/script/util/$1', '^react(.*)$': '/node_modules/react$1', '.*\\.glsl': 'jest-transform-stub', diff --git a/src/script/auth/page/OAuthPermissions.tsx b/src/script/auth/page/OAuthPermissions.tsx index 3991eb74dc6..8dcca3e9351 100644 --- a/src/script/auth/page/OAuthPermissions.tsx +++ b/src/script/auth/page/OAuthPermissions.tsx @@ -41,8 +41,8 @@ import { } from '@wireapp/react-ui-kit'; import * as Icon from 'Components/Icon'; -import {AssetRemoteData} from 'src/script/assets/AssetRemoteData'; -import {AssetRepository} from 'src/script/assets/AssetRepository'; +import {AssetRemoteData} from 'Repositories/assets/AssetRemoteData'; +import {AssetRepository} from 'Repositories/assets/AssetRepository'; import {handleEscDown, handleKeyDown} from 'Util/KeyboardUtil'; import {loadDataUrl} from 'Util/util'; diff --git a/src/script/components/Avatar/AvatarImage.test.tsx b/src/script/components/Avatar/AvatarImage.test.tsx index 3e9419770fa..0145eafe8f8 100644 --- a/src/script/components/Avatar/AvatarImage.test.tsx +++ b/src/script/components/Avatar/AvatarImage.test.tsx @@ -20,11 +20,11 @@ import {render, waitFor} from '@testing-library/react'; import {AVATAR_SIZE} from 'Components/Avatar'; -import {AssetRemoteData} from 'src/script/assets/AssetRemoteData'; +import {AssetRemoteData} from 'Repositories/assets/AssetRemoteData'; +import {AssetRepository} from 'Repositories/assets/AssetRepository'; import {AvatarImage} from './AvatarImage'; -import {AssetRepository} from '../../assets/AssetRepository'; import {User} from '../../entity/User'; describe('AvatarImage', () => { diff --git a/src/script/components/Avatar/AvatarImage.tsx b/src/script/components/Avatar/AvatarImage.tsx index 5a6778ebe31..a4d4a64aa44 100644 --- a/src/script/components/Avatar/AvatarImage.tsx +++ b/src/script/components/Avatar/AvatarImage.tsx @@ -24,11 +24,10 @@ import {Transition} from 'react-transition-group'; import {container} from 'tsyringe'; import {InViewport} from 'Components/InViewport'; +import {AssetRemoteData} from 'Repositories/assets/AssetRemoteData'; +import {AssetRepository} from 'Repositories/assets/AssetRepository'; import {CSS_FILL_PARENT} from 'Util/CSSMixin'; -import {AssetRemoteData} from '../../assets/AssetRemoteData'; -import {AssetRepository} from '../../assets/AssetRepository'; - import {AVATAR_SIZE} from '.'; export interface AvatarImageProps { diff --git a/src/script/components/Image/Image.tsx b/src/script/components/Image/Image.tsx index 6443122690e..97578ec20e8 100644 --- a/src/script/components/Image/Image.tsx +++ b/src/script/components/Image/Image.tsx @@ -24,12 +24,12 @@ import cx from 'classnames'; import {container} from 'tsyringe'; import {InViewport} from 'Components/InViewport'; +import {AssetRemoteData} from 'Repositories/assets/AssetRemoteData'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {getImageStyle, getWrapperStyles} from './Image.styles'; import {RestrictedImage} from './RestrictedImage'; -import {AssetRemoteData} from '../../assets/AssetRemoteData'; import {Config} from '../../Config'; import {MediumImage} from '../../entity/message/MediumImage'; import {TeamState} from '../../team/TeamState'; diff --git a/src/script/components/InputBar/InputBar.test.tsx b/src/script/components/InputBar/InputBar.test.tsx index 35050c94386..ef5c688710b 100644 --- a/src/script/components/InputBar/InputBar.test.tsx +++ b/src/script/components/InputBar/InputBar.test.tsx @@ -20,6 +20,7 @@ import {act, fireEvent, render, waitFor} from '@testing-library/react'; import {InputBar} from 'Components/InputBar/index'; +import {AssetRepository} from 'Repositories/assets/AssetRepository'; import {withTheme} from 'src/script/auth/util/test/TestUtil'; import {Config} from 'src/script/Config'; import {PropertiesService} from 'src/script/properties/PropertiesService'; @@ -27,7 +28,6 @@ import {SelfService} from 'src/script/self/SelfService'; import {createUuid} from 'Util/uuid'; import {TestFactory} from '../../../../test/helper/TestFactory'; -import {AssetRepository} from '../../assets/AssetRepository'; import {ConversationRepository} from '../../conversation/ConversationRepository'; import {MessageRepository} from '../../conversation/MessageRepository'; import {Conversation} from '../../entity/Conversation'; diff --git a/src/script/components/MessagesList/Message/ContentMessage/asset/AudioAsset.tsx b/src/script/components/MessagesList/Message/ContentMessage/asset/AudioAsset.tsx index 2ae15d40e16..6967307dc1e 100644 --- a/src/script/components/MessagesList/Message/ContentMessage/asset/AudioAsset.tsx +++ b/src/script/components/MessagesList/Message/ContentMessage/asset/AudioAsset.tsx @@ -24,6 +24,7 @@ import {container} from 'tsyringe'; import {RestrictedAudio} from 'Components/asset/RestrictedAudio'; import * as Icon from 'Components/Icon'; +import {AssetTransferState} from 'Repositories/assets/AssetTransferState'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {getLogger} from 'Util/Logger'; import {formatSeconds} from 'Util/TimeUtil'; @@ -35,7 +36,6 @@ import {MediaButton} from './controls/MediaButton'; import {SeekBar} from './controls/SeekBar'; import {AssetUrl, useAssetTransfer} from './useAssetTransfer'; -import {AssetTransferState} from '../../../../../assets/AssetTransferState'; import type {ContentMessage} from '../../../../../entity/message/ContentMessage'; import type {FileAsset} from '../../../../../entity/message/FileAsset'; import {TeamState} from '../../../../../team/TeamState'; diff --git a/src/script/components/MessagesList/Message/ContentMessage/asset/FileAssetComponent.tsx b/src/script/components/MessagesList/Message/ContentMessage/asset/FileAssetComponent.tsx index 2da2892838d..7d0ddb9e65f 100644 --- a/src/script/components/MessagesList/Message/ContentMessage/asset/FileAssetComponent.tsx +++ b/src/script/components/MessagesList/Message/ContentMessage/asset/FileAssetComponent.tsx @@ -23,6 +23,7 @@ import cx from 'classnames'; import {container} from 'tsyringe'; import {RestrictedFile} from 'Components/asset/RestrictedFile'; +import {AssetTransferState} from 'Repositories/assets/AssetTransferState'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {handleKeyDown} from 'Util/KeyboardUtil'; import {t} from 'Util/LocalizerUtil'; @@ -32,7 +33,6 @@ import {AssetHeader} from './AssetHeader'; import {AssetLoader} from './AssetLoader'; import {useAssetTransfer} from './useAssetTransfer'; -import {AssetTransferState} from '../../../../../assets/AssetTransferState'; import type {ContentMessage} from '../../../../../entity/message/ContentMessage'; import type {FileAsset as FileAssetType} from '../../../../../entity/message/FileAsset'; import {TeamState} from '../../../../../team/TeamState'; diff --git a/src/script/components/MessagesList/Message/ContentMessage/asset/ImageAsset/ImageAsset.test.tsx b/src/script/components/MessagesList/Message/ContentMessage/asset/ImageAsset/ImageAsset.test.tsx index b033ec28870..3a7b347333f 100644 --- a/src/script/components/MessagesList/Message/ContentMessage/asset/ImageAsset/ImageAsset.test.tsx +++ b/src/script/components/MessagesList/Message/ContentMessage/asset/ImageAsset/ImageAsset.test.tsx @@ -20,8 +20,8 @@ import {render, screen, waitFor} from '@testing-library/react'; import {container} from 'tsyringe'; -import {AssetRemoteData} from 'src/script/assets/AssetRemoteData'; -import {AssetRepository} from 'src/script/assets/AssetRepository'; +import {AssetRemoteData} from 'Repositories/assets/AssetRemoteData'; +import {AssetRepository} from 'Repositories/assets/AssetRepository'; import {ContentMessage} from 'src/script/entity/message/ContentMessage'; import {MediumImage} from 'src/script/entity/message/MediumImage'; diff --git a/src/script/components/MessagesList/Message/ContentMessage/asset/VideoAsset.tsx b/src/script/components/MessagesList/Message/ContentMessage/asset/VideoAsset.tsx index bb31868a73d..8ff1e2cc029 100644 --- a/src/script/components/MessagesList/Message/ContentMessage/asset/VideoAsset.tsx +++ b/src/script/components/MessagesList/Message/ContentMessage/asset/VideoAsset.tsx @@ -28,6 +28,8 @@ import {Button, ButtonVariant, useTimeout} from '@wireapp/react-ui-kit'; import {WebAppEvents} from '@wireapp/webapp-events'; import {RestrictedVideo} from 'Components/asset/RestrictedVideo'; +import {AssetRepository} from 'Repositories/assets/AssetRepository'; +import {AssetTransferState} from 'Repositories/assets/AssetTransferState'; import {EventName} from 'src/script/tracking/EventName'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; @@ -39,8 +41,6 @@ import {SeekBar} from './controls/SeekBar'; import {FileAsset} from './FileAssetComponent'; import {AssetUrl, useAssetTransfer} from './useAssetTransfer'; -import {AssetRepository} from '../../../../../assets/AssetRepository'; -import {AssetTransferState} from '../../../../../assets/AssetTransferState'; import type {ContentMessage} from '../../../../../entity/message/ContentMessage'; import type {FileAsset as FileAssetType} from '../../../../../entity/message/FileAsset'; import {TeamState} from '../../../../../team/TeamState'; diff --git a/src/script/components/MessagesList/Message/ContentMessage/asset/controls/MediaButton.test.tsx b/src/script/components/MessagesList/Message/ContentMessage/asset/controls/MediaButton.test.tsx index f22e3b901f6..6b9be287a60 100644 --- a/src/script/components/MessagesList/Message/ContentMessage/asset/controls/MediaButton.test.tsx +++ b/src/script/components/MessagesList/Message/ContentMessage/asset/controls/MediaButton.test.tsx @@ -20,7 +20,7 @@ import {fireEvent, render} from '@testing-library/react'; import ko from 'knockout'; -import {AssetTransferState} from 'src/script/assets/AssetTransferState'; +import {AssetTransferState} from 'Repositories/assets/AssetTransferState'; import {FileAsset} from 'src/script/entity/message/FileAsset'; import {MediaButton, MediaButtonProps} from './MediaButton'; diff --git a/src/script/components/MessagesList/Message/ContentMessage/asset/controls/MediaButton.tsx b/src/script/components/MessagesList/Message/ContentMessage/asset/controls/MediaButton.tsx index bde0a6b9e29..298a7546a9d 100644 --- a/src/script/components/MessagesList/Message/ContentMessage/asset/controls/MediaButton.tsx +++ b/src/script/components/MessagesList/Message/ContentMessage/asset/controls/MediaButton.tsx @@ -22,11 +22,11 @@ import React, {useEffect, useState} from 'react'; import cx from 'classnames'; import {useMessageFocusedTabIndex} from 'Components/MessagesList/Message/util'; +import {AssetTransferState} from 'Repositories/assets/AssetTransferState'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; import {noop} from 'Util/util'; -import {AssetTransferState} from '../../../../../../assets/AssetTransferState'; import type {FileAsset} from '../../../../../../entity/message/FileAsset'; import {AssetLoader} from '../AssetLoader'; diff --git a/src/script/components/MessagesList/Message/ContentMessage/asset/index.tsx b/src/script/components/MessagesList/Message/ContentMessage/asset/index.tsx index 8237f1ebfd0..6965e08a998 100644 --- a/src/script/components/MessagesList/Message/ContentMessage/asset/index.tsx +++ b/src/script/components/MessagesList/Message/ContentMessage/asset/index.tsx @@ -20,6 +20,7 @@ import {QualifiedId} from '@wireapp/api-client/lib/user'; import cx from 'classnames'; +import {AssetType} from 'Repositories/assets/AssetType'; import {Asset} from 'src/script/entity/message/Asset'; import type {FileAsset as FileAssetType} from 'src/script/entity/message/FileAsset'; import type {Location} from 'src/script/entity/message/Location'; @@ -39,7 +40,6 @@ import {TextMessageRenderer} from './TextMessageRenderer'; import {VideoAsset} from './VideoAsset'; import {MessageActions} from '../..'; -import {AssetType} from '../../../../../assets/AssetType'; import {Button} from '../../../../../entity/message/Button'; import {CompositeMessage} from '../../../../../entity/message/CompositeMessage'; import {ContentMessage} from '../../../../../entity/message/ContentMessage'; diff --git a/src/script/components/MessagesList/Message/ContentMessage/asset/useAssetTransfer.test.ts b/src/script/components/MessagesList/Message/ContentMessage/asset/useAssetTransfer.test.ts index 684b39a3f80..4f1b2e4a23f 100644 --- a/src/script/components/MessagesList/Message/ContentMessage/asset/useAssetTransfer.test.ts +++ b/src/script/components/MessagesList/Message/ContentMessage/asset/useAssetTransfer.test.ts @@ -20,8 +20,8 @@ import {renderHook} from '@testing-library/react'; import ko from 'knockout'; -import {AssetRemoteData} from 'src/script/assets/AssetRemoteData'; -import {AssetRepository} from 'src/script/assets/AssetRepository'; +import {AssetRemoteData} from 'Repositories/assets/AssetRemoteData'; +import {AssetRepository} from 'Repositories/assets/AssetRepository'; import {ContentMessage} from 'src/script/entity/message/ContentMessage'; import {createUuid} from 'Util/uuid'; diff --git a/src/script/components/MessagesList/Message/ContentMessage/asset/useAssetTransfer.ts b/src/script/components/MessagesList/Message/ContentMessage/asset/useAssetTransfer.ts index 1c5cbe55995..9b43d9eac86 100644 --- a/src/script/components/MessagesList/Message/ContentMessage/asset/useAssetTransfer.ts +++ b/src/script/components/MessagesList/Message/ContentMessage/asset/useAssetTransfer.ts @@ -21,11 +21,11 @@ import {useEffect, useState} from 'react'; import {container} from 'tsyringe'; +import {AssetRemoteData} from 'Repositories/assets/AssetRemoteData'; +import {AssetRepository} from 'Repositories/assets/AssetRepository'; +import {AssetTransferState} from 'Repositories/assets/AssetTransferState'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; -import {AssetRemoteData} from '../../../../../assets/AssetRemoteData'; -import {AssetRepository} from '../../../../../assets/AssetRepository'; -import {AssetTransferState} from '../../../../../assets/AssetTransferState'; import {ContentMessage} from '../../../../../entity/message/ContentMessage'; import {FileAsset} from '../../../../../entity/message/FileAsset'; diff --git a/src/script/components/MessagesList/Message/MessageWrapper.tsx b/src/script/components/MessagesList/Message/MessageWrapper.tsx index 062f007ee67..1aaf0eae9a3 100644 --- a/src/script/components/MessagesList/Message/MessageWrapper.tsx +++ b/src/script/components/MessagesList/Message/MessageWrapper.tsx @@ -27,6 +27,7 @@ import {container} from 'tsyringe'; import {WebAppEvents} from '@wireapp/webapp-events'; import {E2EIVerificationMessage} from 'Components/MessagesList/Message/E2EIVerificationMessage'; +import {AssetRepository} from 'Repositories/assets/AssetRepository'; import {OutgoingQuote} from 'src/script/conversation/MessageRepository'; import {ContentMessage} from 'src/script/entity/message/ContentMessage'; import {Text} from 'src/script/entity/message/Text'; @@ -49,7 +50,6 @@ import {PingMessage} from './PingMessage'; import {SystemMessage} from './SystemMessage'; import {VerificationMessage} from './VerificationMessage'; -import {AssetRepository} from '../../../assets/AssetRepository'; import {Conversation} from '../../../entity/Conversation'; import {CompositeMessage} from '../../../entity/message/CompositeMessage'; import {TeamState} from '../../../team/TeamState'; diff --git a/src/script/components/Modals/DetailViewModal/index.tsx b/src/script/components/Modals/DetailViewModal/index.tsx index bccf49ce3b7..236499de1d0 100644 --- a/src/script/components/Modals/DetailViewModal/index.tsx +++ b/src/script/components/Modals/DetailViewModal/index.tsx @@ -25,6 +25,7 @@ import cx from 'classnames'; import {WebAppEvents} from '@wireapp/webapp-events'; import {ZoomableImage} from 'Components/ZoomableImage'; +import {AssetRepository} from 'Repositories/assets/AssetRepository'; import {User} from 'src/script/entity/User'; import {handleKeyDown, KEY} from 'Util/KeyboardUtil'; import {t} from 'Util/LocalizerUtil'; @@ -35,7 +36,6 @@ import {waitFor} from 'Util/waitFor'; import {DetailViewModalFooter} from './DetailViewModalFooter'; import {DetailViewModalHeader} from './DetailViewModalHeader'; -import {AssetRepository} from '../../../assets/AssetRepository'; import {ConversationRepository} from '../../../conversation/ConversationRepository'; import {MessageRepository} from '../../../conversation/MessageRepository'; import {Conversation} from '../../../entity/Conversation'; diff --git a/src/script/conversation/ConversationCellState.ts b/src/script/conversation/ConversationCellState.ts index 4a210f226c3..110c2c91bd7 100644 --- a/src/script/conversation/ConversationCellState.ts +++ b/src/script/conversation/ConversationCellState.ts @@ -17,13 +17,13 @@ * */ +import {AssetTransferState} from 'Repositories/assets/AssetTransferState'; import {t} from 'Util/LocalizerUtil'; import {getRenderedTextContent} from 'Util/messageRenderer'; import {matchQualifiedIds} from 'Util/QualifiedId'; import {ConversationStatusIcon} from './ConversationStatusIcon'; -import {AssetTransferState} from '../assets/AssetTransferState'; import type {Conversation} from '../entity/Conversation'; import type {FileAsset} from '../entity/message/FileAsset'; import type {MemberMessage} from '../entity/message/MemberMessage'; diff --git a/src/script/conversation/ConversationRepository.ts b/src/script/conversation/ConversationRepository.ts index abf2b0e155d..feacb50cdc5 100644 --- a/src/script/conversation/ConversationRepository.ts +++ b/src/script/conversation/ConversationRepository.ts @@ -59,6 +59,7 @@ import {Asset as ProtobufAsset, Confirmation, LegalHoldStatus} from '@wireapp/pr import {WebAppEvents} from '@wireapp/webapp-events'; import {TYPING_TIMEOUT, useTypingIndicatorState} from 'Components/InputBar/components/TypingIndicator'; +import {AssetTransferState} from 'Repositories/assets/AssetTransferState'; import {getNextItem} from 'Util/ArrayUtil'; import {allowsAllFiles, getFileExtensionOrName, isAllowedFile} from 'Util/FileTypeUtil'; import {replaceLink, t} from 'Util/LocalizerUtil'; @@ -113,7 +114,6 @@ import {EventMapper} from './EventMapper'; import {MessageRepository} from './MessageRepository'; import {NOTIFICATION_STATE} from './NotificationSetting'; -import {AssetTransferState} from '../assets/AssetTransferState'; import {CallingRepository} from '../calling/CallingRepository'; import {LEAVE_CALL_REASON} from '../calling/enum/LeaveCallReason'; import {PrimaryModal} from '../components/Modals/PrimaryModal'; diff --git a/src/script/conversation/EventBuilder.ts b/src/script/conversation/EventBuilder.ts index 8c0b3ba465f..b07df955d5a 100644 --- a/src/script/conversation/EventBuilder.ts +++ b/src/script/conversation/EventBuilder.ts @@ -31,9 +31,9 @@ import {DecryptionError} from '@wireapp/core/lib/errors/DecryptionError'; import type {REASON as AVS_REASON} from '@wireapp/avs'; import type {Asset, LegalHoldStatus} from '@wireapp/protocol-messaging'; +import {AssetTransferState} from 'Repositories/assets/AssetTransferState'; import {createUuid} from 'Util/uuid'; -import {AssetTransferState} from '../assets/AssetTransferState'; import type {Conversation} from '../entity/Conversation'; import type {Message} from '../entity/message/Message'; import type {User} from '../entity/User'; diff --git a/src/script/conversation/EventMapper.test.ts b/src/script/conversation/EventMapper.test.ts index 308e7b32f77..a5039a017e1 100644 --- a/src/script/conversation/EventMapper.test.ts +++ b/src/script/conversation/EventMapper.test.ts @@ -19,7 +19,7 @@ import {Article, LinkPreview, Mention} from '@wireapp/protocol-messaging'; -import {AssetType} from 'src/script/assets/AssetType'; +import {AssetType} from 'Repositories/assets/AssetType'; import {Conversation} from 'src/script/entity/Conversation'; import {MentionEntity} from 'src/script/message/MentionEntity'; import {createMessageAddEvent} from 'test/helper/EventGenerator'; diff --git a/src/script/conversation/EventMapper.ts b/src/script/conversation/EventMapper.ts index 0b74b682f78..eec948098bd 100644 --- a/src/script/conversation/EventMapper.ts +++ b/src/script/conversation/EventMapper.ts @@ -22,6 +22,8 @@ import {container} from 'tsyringe'; import {LinkPreview, Mention} from '@wireapp/protocol-messaging'; +import {AssetRemoteData} from 'Repositories/assets/AssetRemoteData'; +import {AssetTransferState} from 'Repositories/assets/AssetTransferState'; import {t} from 'Util/LocalizerUtil'; import {getLogger, Logger} from 'Util/Logger'; import {userReactionMapToReactionMap} from 'Util/ReactionUtil'; @@ -40,8 +42,6 @@ import { CompositeMessageAddEvent, } from './EventBuilder'; -import {AssetRemoteData} from '../assets/AssetRemoteData'; -import {AssetTransferState} from '../assets/AssetTransferState'; import {TERMINATION_REASON} from '../calling/enum/TerminationReason'; import {AssetData} from '../cryptography/CryptographyMapper'; import type {Conversation} from '../entity/Conversation'; diff --git a/src/script/conversation/MessageRepository.test.ts b/src/script/conversation/MessageRepository.test.ts index 8499df657fc..1155cf63838 100644 --- a/src/script/conversation/MessageRepository.test.ts +++ b/src/script/conversation/MessageRepository.test.ts @@ -25,6 +25,7 @@ import {MessageSendingState} from '@wireapp/core/lib/conversation'; import {Account} from '@wireapp/core'; import {LegalHoldStatus} from '@wireapp/protocol-messaging'; +import {AssetRepository} from 'Repositories/assets/AssetRepository'; import {ConnectionEntity} from 'src/script/connection/ConnectionEntity'; import {MessageRepository} from 'src/script/conversation/MessageRepository'; import {Conversation} from 'src/script/entity/Conversation'; @@ -38,7 +39,6 @@ import {createUuid} from 'Util/uuid'; import {ConversationRepository} from './ConversationRepository'; import {ConversationState} from './ConversationState'; -import {AssetRepository} from '../assets/AssetRepository'; import {AudioRepository} from '../audio/AudioRepository'; import {ClientEntity} from '../client/ClientEntity'; import {ClientState} from '../client/ClientState'; diff --git a/src/script/conversation/MessageRepository.ts b/src/script/conversation/MessageRepository.ts index 6f026b015ec..1343499c90d 100644 --- a/src/script/conversation/MessageRepository.ts +++ b/src/script/conversation/MessageRepository.ts @@ -50,6 +50,9 @@ import {partition} from 'underscore'; import {Asset, Availability, Confirmation, GenericMessage} from '@wireapp/protocol-messaging'; import {WebAppEvents} from '@wireapp/webapp-events'; +import {buildMetadata, ImageMetadata, isAudio, isImage, isVideo} from 'Repositories/assets/AssetMetaDataBuilder'; +import {AssetRepository} from 'Repositories/assets/AssetRepository'; +import {AssetTransferState} from 'Repositories/assets/AssetTransferState'; import { cancelSendingLinkPreview, clearLinkPreviewSendingState, @@ -74,9 +77,6 @@ import {ConversationVerificationState} from './ConversationVerificationState'; import {EventMapper} from './EventMapper'; import {getLinkPreviewFromString} from './linkPreviews'; -import {buildMetadata, ImageMetadata, isAudio, isImage, isVideo} from '../assets/AssetMetaDataBuilder'; -import {AssetRepository} from '../assets/AssetRepository'; -import {AssetTransferState} from '../assets/AssetTransferState'; import {AudioRepository} from '../audio/AudioRepository'; import {AudioType} from '../audio/AudioType'; import {ClientState} from '../client/ClientState'; diff --git a/src/script/cryptography/CryptographyMapper.ts b/src/script/cryptography/CryptographyMapper.ts index 38a98b2aa9e..5133e1eea5b 100644 --- a/src/script/cryptography/CryptographyMapper.ts +++ b/src/script/cryptography/CryptographyMapper.ts @@ -52,12 +52,12 @@ import { InCallEmoji, } from '@wireapp/protocol-messaging'; +import {AssetTransferState} from 'Repositories/assets/AssetTransferState'; import {CALL_MESSAGE_TYPE} from 'src/script/calling/enum/CallMessageType'; import {getLogger, Logger} from 'Util/Logger'; import {TIME_IN_MILLIS} from 'Util/TimeUtil'; import {base64ToArray, arrayToBase64} from 'Util/util'; -import {AssetTransferState} from '../assets/AssetTransferState'; import {ConversationEphemeralHandler} from '../conversation/ConversationEphemeralHandler'; import {MessageAddEvent} from '../conversation/EventBuilder'; import {PROTO_MESSAGE_TYPE} from '../cryptography/ProtoMessageType'; diff --git a/src/script/entity/User/User.ts b/src/script/entity/User/User.ts index 8f913f65d3c..84dfb0d7302 100644 --- a/src/script/entity/User/User.ts +++ b/src/script/entity/User/User.ts @@ -26,12 +26,12 @@ import ko from 'knockout'; import {Availability} from '@wireapp/protocol-messaging'; import {WebAppEvents} from '@wireapp/webapp-events'; +import type {AssetRemoteData} from 'Repositories/assets/AssetRemoteData'; import {t} from 'Util/LocalizerUtil'; import {clamp} from 'Util/NumberUtil'; import {getFirstChar} from 'Util/StringUtil'; import {TIME_IN_MILLIS} from 'Util/TimeUtil'; -import type {AssetRemoteData} from '../../assets/AssetRemoteData'; import type {ClientEntity} from '../../client/ClientEntity'; import {ACCENT_ID} from '../../Config'; import {ConnectionEntity} from '../../connection/ConnectionEntity'; diff --git a/src/script/entity/message/Asset.ts b/src/script/entity/message/Asset.ts index 17dc6c8648d..f035e45b2eb 100644 --- a/src/script/entity/message/Asset.ts +++ b/src/script/entity/message/Asset.ts @@ -17,13 +17,13 @@ * */ +import {AssetType} from 'Repositories/assets/AssetType'; + import type {FileAsset} from './FileAsset'; import type {Location as LocationAsset} from './Location'; import type {MediumImage as MediumImageAsset} from './MediumImage'; import type {Text as TextAsset} from './Text'; -import {AssetType} from '../../assets/AssetType'; - export interface AssetPayload { id: string; key: string; diff --git a/src/script/entity/message/Button.ts b/src/script/entity/message/Button.ts index c40766457be..623de718317 100644 --- a/src/script/entity/message/Button.ts +++ b/src/script/entity/message/Button.ts @@ -17,9 +17,9 @@ * */ -import {Asset} from './Asset'; +import {AssetType} from 'Repositories/assets/AssetType'; -import {AssetType} from '../../assets/AssetType'; +import {Asset} from './Asset'; export class Button extends Asset { constructor(id?: string, text: string = '') { diff --git a/src/script/entity/message/ContentMessage.ts b/src/script/entity/message/ContentMessage.ts index 8d31dc29c8d..8ee7a32bb13 100644 --- a/src/script/entity/message/ContentMessage.ts +++ b/src/script/entity/message/ContentMessage.ts @@ -21,6 +21,7 @@ import type {QualifiedUserClients} from '@wireapp/api-client/lib/conversation'; import {QualifiedId} from '@wireapp/api-client/lib/user'; import ko from 'knockout'; +import {AssetRepository} from 'Repositories/assets/AssetRepository'; import {copyText} from 'Util/ClipboardUtil'; import {t} from 'Util/LocalizerUtil'; import {formatLocale, formatTimeShort} from 'Util/TimeUtil'; @@ -31,7 +32,6 @@ import type {MediumImage} from './MediumImage'; import {Message} from './Message'; import {Text as TextAsset} from './Text'; -import {AssetRepository} from '../../assets/AssetRepository'; import type {QuoteEntity} from '../../message/QuoteEntity'; import {SuperType} from '../../message/SuperType'; import {ReactionMap, ReadReceipt} from '../../storage'; diff --git a/src/script/entity/message/FileAsset.ts b/src/script/entity/message/FileAsset.ts index ff928197a82..f132b157c8b 100644 --- a/src/script/entity/message/FileAsset.ts +++ b/src/script/entity/message/FileAsset.ts @@ -21,14 +21,13 @@ import ko from 'knockout'; import type {Asset as ProtobufAsset} from '@wireapp/protocol-messaging'; +import type {AssetRemoteData} from 'Repositories/assets/AssetRemoteData'; +import {AssetTransferState} from 'Repositories/assets/AssetTransferState'; +import {AssetType} from 'Repositories/assets/AssetType'; import {Logger, getLogger} from 'Util/Logger'; import {Asset} from './Asset'; -import type {AssetRemoteData} from '../../assets/AssetRemoteData'; -import {AssetTransferState} from '../../assets/AssetTransferState'; -import {AssetType} from '../../assets/AssetType'; - type AssetMetaData = (ProtobufAsset.IAudioMetaData | ProtobufAsset.IImageMetaData | ProtobufAsset.IVideoMetaData) & { duration?: number; loudness?: number[]; diff --git a/src/script/entity/message/LinkPreview.ts b/src/script/entity/message/LinkPreview.ts index a5051216347..e3f01544722 100644 --- a/src/script/entity/message/LinkPreview.ts +++ b/src/script/entity/message/LinkPreview.ts @@ -19,10 +19,9 @@ import type {ITweet} from '@wireapp/protocol-messaging'; +import type {AssetRemoteData} from 'Repositories/assets/AssetRemoteData'; import {obfuscate} from 'Util/StringUtil'; -import type {AssetRemoteData} from '../../assets/AssetRemoteData'; - export type LinkPreviewData = { image?: AssetRemoteData; title?: string; diff --git a/src/script/entity/message/Location.ts b/src/script/entity/message/Location.ts index 93c457f2092..87a380a944b 100644 --- a/src/script/entity/message/Location.ts +++ b/src/script/entity/message/Location.ts @@ -17,9 +17,9 @@ * */ -import {Asset} from './Asset'; +import {AssetType} from 'Repositories/assets/AssetType'; -import {AssetType} from '../../assets/AssetType'; +import {Asset} from './Asset'; export class Location extends Asset { public latitude: string; diff --git a/src/script/entity/message/MediumImage.ts b/src/script/entity/message/MediumImage.ts index 348dfa957e8..3a97f7b10d4 100644 --- a/src/script/entity/message/MediumImage.ts +++ b/src/script/entity/message/MediumImage.ts @@ -19,13 +19,12 @@ import ko from 'knockout'; +import type {AssetRemoteData} from 'Repositories/assets/AssetRemoteData'; +import {AssetType} from 'Repositories/assets/AssetType'; import {getLogger} from 'Util/Logger'; import {FileAsset} from './FileAsset'; -import type {AssetRemoteData} from '../../assets/AssetRemoteData'; -import {AssetType} from '../../assets/AssetType'; - export class MediumImage extends FileAsset { public readonly resource: ko.Observable; public height: string; diff --git a/src/script/entity/message/Message.ts b/src/script/entity/message/Message.ts index 8a841510652..9c973568490 100644 --- a/src/script/entity/message/Message.ts +++ b/src/script/entity/message/Message.ts @@ -22,6 +22,8 @@ import ko from 'knockout'; import type {LegalHoldStatus} from '@wireapp/protocol-messaging'; +import {AssetTransferState} from 'Repositories/assets/AssetTransferState'; +import {AssetType} from 'Repositories/assets/AssetType'; import {t, getUserName} from 'Util/LocalizerUtil'; import {formatDateNumeral, formatDurationCaption, formatTimeShort, fromUnixTime, TIME_IN_MILLIS} from 'Util/TimeUtil'; @@ -44,8 +46,6 @@ import type {PingMessage} from './PingMessage'; import type {SystemMessage} from './SystemMessage'; import type {VerificationMessage} from './VerificationMessage'; -import {AssetTransferState} from '../../assets/AssetTransferState'; -import {AssetType} from '../../assets/AssetType'; import {EphemeralStatusType} from '../../message/EphemeralStatusType'; import type {MessageCategory} from '../../message/MessageCategory'; import {StatusType} from '../../message/StatusType'; diff --git a/src/script/entity/message/Text.ts b/src/script/entity/message/Text.ts index 4fb54b99192..71cd52ea37d 100644 --- a/src/script/entity/message/Text.ts +++ b/src/script/entity/message/Text.ts @@ -20,12 +20,12 @@ import {QualifiedId} from '@wireapp/api-client/lib/user'; import ko from 'knockout'; +import {AssetType} from 'Repositories/assets/AssetType'; import {renderMessage} from 'Util/messageRenderer'; import {Asset} from './Asset'; import type {LinkPreview} from './LinkPreview'; -import {AssetType} from '../../assets/AssetType'; import {containsOnlyLink} from '../../conversation/linkPreviews/helpers'; import {mediaParser} from '../../media/MediaParser'; import type {MentionEntity} from '../../message/MentionEntity'; diff --git a/src/script/event/EventService.ts b/src/script/event/EventService.ts index 18346938d3b..b8c574db557 100644 --- a/src/script/event/EventService.ts +++ b/src/script/event/EventService.ts @@ -24,11 +24,11 @@ import {container} from 'tsyringe'; import {Asset as ProtobufAsset} from '@wireapp/protocol-messaging'; +import {AssetTransferState} from 'Repositories/assets/AssetTransferState'; import {getLogger, Logger} from 'Util/Logger'; import {ClientEvent, CONVERSATION as CLIENT_CONVERSATION_EVENT} from './Client'; -import {AssetTransferState} from '../assets/AssetTransferState'; import {BaseError, BASE_ERROR_TYPE} from '../error/BaseError'; import {ConversationError} from '../error/ConversationError'; import {StorageError} from '../error/StorageError'; diff --git a/src/script/event/preprocessor/EventStorageMiddleware/EventStorageMiddleware.test.ts b/src/script/event/preprocessor/EventStorageMiddleware/EventStorageMiddleware.test.ts index 5485bfa0ae0..5cb0bb9bd84 100644 --- a/src/script/event/preprocessor/EventStorageMiddleware/EventStorageMiddleware.test.ts +++ b/src/script/event/preprocessor/EventStorageMiddleware/EventStorageMiddleware.test.ts @@ -19,7 +19,7 @@ import {Asset as ProtobufAsset} from '@wireapp/protocol-messaging'; -import {AssetTransferState} from 'src/script/assets/AssetTransferState'; +import {AssetTransferState} from 'Repositories/assets/AssetTransferState'; import {ConversationState} from 'src/script/conversation/ConversationState'; import {Conversation} from 'src/script/entity/Conversation'; import {User} from 'src/script/entity/User'; diff --git a/src/script/event/preprocessor/EventStorageMiddleware/eventHandlers/assetEventHandler.ts b/src/script/event/preprocessor/EventStorageMiddleware/eventHandlers/assetEventHandler.ts index 9c380f5d629..4cca9f23dad 100644 --- a/src/script/event/preprocessor/EventStorageMiddleware/eventHandlers/assetEventHandler.ts +++ b/src/script/event/preprocessor/EventStorageMiddleware/eventHandlers/assetEventHandler.ts @@ -19,7 +19,7 @@ import {Asset as ProtobufAsset} from '@wireapp/protocol-messaging'; -import {AssetTransferState} from 'src/script/assets/AssetTransferState'; +import {AssetTransferState} from 'Repositories/assets/AssetTransferState'; import {AssetAddEvent} from 'src/script/conversation/EventBuilder'; import {StoredEvent} from 'src/script/storage'; diff --git a/src/script/integration/IntegrationMapper.ts b/src/script/integration/IntegrationMapper.ts index 5d04da3253b..a8824b2382d 100644 --- a/src/script/integration/IntegrationMapper.ts +++ b/src/script/integration/IntegrationMapper.ts @@ -17,11 +17,11 @@ * */ +import {mapProfileAssets, updateUserEntityAssets} from 'Repositories/assets/AssetMapper'; + import {ProviderData, ProviderEntity} from './ProviderEntity'; import {ServiceData, ServiceEntity} from './ServiceEntity'; -import {mapProfileAssets, updateUserEntityAssets} from '../assets/AssetMapper'; - export const IntegrationMapper = { mapProviderFromObject: (providerData: ProviderData, providerEntity = new ProviderEntity()) => { if (providerData) { diff --git a/src/script/integration/ServiceEntity.ts b/src/script/integration/ServiceEntity.ts index 307d65017ad..38c3c114792 100644 --- a/src/script/integration/ServiceEntity.ts +++ b/src/script/integration/ServiceEntity.ts @@ -20,7 +20,7 @@ import type {UserAsset as APIClientUserAsset} from '@wireapp/api-client/lib/user/'; import ko from 'knockout'; -import {AssetRemoteData} from '../assets/AssetRemoteData'; +import {AssetRemoteData} from 'Repositories/assets/AssetRemoteData'; export interface ServiceData { assets?: APIClientUserAsset[]; diff --git a/src/script/main/app.ts b/src/script/main/app.ts index 4eb66dfc971..1c016d10d70 100644 --- a/src/script/main/app.ts +++ b/src/script/main/app.ts @@ -32,6 +32,7 @@ import {Runtime} from '@wireapp/commons'; import {WebAppEvents} from '@wireapp/webapp-events'; import {PrimaryModal} from 'Components/Modals/PrimaryModal'; +import {AssetRepository} from 'Repositories/assets/AssetRepository'; import {initializeDataDog} from 'Util/DataDog'; import {DebugUtil} from 'Util/DebugUtil'; import {Environment} from 'Util/Environment'; @@ -43,7 +44,6 @@ import {appendParameter} from 'Util/UrlUtil'; import {AppInitializationStep, checkIndexedDb, InitializationEventLogger} from 'Util/util'; import '../../style/default.less'; -import {AssetRepository} from '../assets/AssetRepository'; import {AudioRepository} from '../audio/AudioRepository'; import {SIGN_OUT_REASON} from '../auth/SignOutReason'; import {URLParameter} from '../auth/URLParameter'; diff --git a/src/script/notification/NotificationRepository.ts b/src/script/notification/NotificationRepository.ts index f0d4f1a2082..dc3911bd71a 100644 --- a/src/script/notification/NotificationRepository.ts +++ b/src/script/notification/NotificationRepository.ts @@ -27,6 +27,7 @@ import {Runtime} from '@wireapp/commons'; import {Availability} from '@wireapp/protocol-messaging'; import {WebAppEvents} from '@wireapp/webapp-events'; +import {AssetRepository} from 'Repositories/assets/AssetRepository'; import {CallingRepository} from 'src/script/calling/CallingRepository'; import {Declension, t, getUserName} from 'Util/LocalizerUtil'; import {getLogger, Logger} from 'Util/Logger'; @@ -37,7 +38,6 @@ import {ValidationUtilError} from 'Util/ValidationUtil'; import {PermissionState} from './PermissionState'; -import {AssetRepository} from '../assets/AssetRepository'; import {AudioRepository} from '../audio/AudioRepository'; import {AudioType} from '../audio/AudioType'; import {CallingViewMode, CallState} from '../calling/CallState'; diff --git a/src/script/page/LeftSidebar/panels/StartUI/components/TopPeople.tsx b/src/script/page/LeftSidebar/panels/StartUI/components/TopPeople.tsx index e72564f8e5c..9bd38178dcc 100644 --- a/src/script/page/LeftSidebar/panels/StartUI/components/TopPeople.tsx +++ b/src/script/page/LeftSidebar/panels/StartUI/components/TopPeople.tsx @@ -21,9 +21,10 @@ import React from 'react'; import {container} from 'tsyringe'; +import {AssetRepository} from 'Repositories/assets/AssetRepository'; + import {TopContact} from './topPeople/TopContact'; -import {AssetRepository} from '../../../../../assets/AssetRepository'; import {User} from '../../../../../entity/User'; interface TopPeopleProps { diff --git a/src/script/page/LeftSidebar/panels/StartUI/components/topPeople/TopContact.tsx b/src/script/page/LeftSidebar/panels/StartUI/components/topPeople/TopContact.tsx index fd76937cd3d..3c266060232 100644 --- a/src/script/page/LeftSidebar/panels/StartUI/components/topPeople/TopContact.tsx +++ b/src/script/page/LeftSidebar/panels/StartUI/components/topPeople/TopContact.tsx @@ -23,10 +23,10 @@ import {ConnectionStatus} from '@wireapp/api-client/lib/connection'; import {TabIndex} from '@wireapp/react-ui-kit/lib/types/enums'; import {Avatar, AVATAR_SIZE} from 'Components/Avatar'; +import {AssetRepository} from 'Repositories/assets/AssetRepository'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {handleKeyDown} from 'Util/KeyboardUtil'; -import {AssetRepository} from '../../../../../../assets/AssetRepository'; import {User} from '../../../../../../entity/User'; export interface TopContactProps { diff --git a/src/script/page/MainContent/panels/Collection/Collection.test.tsx b/src/script/page/MainContent/panels/Collection/Collection.test.tsx index 52811432082..0e363e39783 100644 --- a/src/script/page/MainContent/panels/Collection/Collection.test.tsx +++ b/src/script/page/MainContent/panels/Collection/Collection.test.tsx @@ -20,6 +20,7 @@ import {fireEvent, render, waitFor, act} from '@testing-library/react'; import {container} from 'tsyringe'; +import {AssetRepository} from 'Repositories/assets/AssetRepository'; import {withTheme} from 'src/script/auth/util/test/TestUtil'; import {Conversation} from 'src/script/entity/Conversation'; import {ContentMessage} from 'src/script/entity/message/ContentMessage'; @@ -31,7 +32,6 @@ import {createUuid} from 'Util/uuid'; import {Collection} from './Collection'; -import {AssetRepository} from '../../../../assets/AssetRepository'; import {MessageRepository} from '../../../../conversation/MessageRepository'; import {Text} from '../../../../entity/message/Text'; import {User} from '../../../../entity/User'; diff --git a/src/script/page/MainContent/panels/Collection/Collection.tsx b/src/script/page/MainContent/panels/Collection/Collection.tsx index 44ba9d72792..3ff3a5943b5 100644 --- a/src/script/page/MainContent/panels/Collection/Collection.tsx +++ b/src/script/page/MainContent/panels/Collection/Collection.tsx @@ -25,6 +25,7 @@ import {WebAppEvents} from '@wireapp/webapp-events'; import * as Icon from 'Components/Icon'; import {showDetailViewModal} from 'Components/Modals/DetailViewModal'; +import {AssetRepository} from 'Repositories/assets/AssetRepository'; import {ConversationRepository} from 'src/script/conversation/ConversationRepository'; import {ContentMessage} from 'src/script/entity/message/ContentMessage'; import {generateConversationUrl} from 'src/script/router/routeGenerator'; @@ -37,7 +38,6 @@ import {CollectionSection} from './CollectionSection'; import {FullSearch} from './FullSearch'; import {Category, isOfCategory} from './utils'; -import {AssetRepository} from '../../../../assets/AssetRepository'; import {MessageRepository} from '../../../../conversation/MessageRepository'; import {Conversation} from '../../../../entity/Conversation'; import {User} from '../../../../entity/User'; diff --git a/src/script/assets/AssetMapper.test.ts b/src/script/repositories/assets/AssetMapper.test.ts similarity index 100% rename from src/script/assets/AssetMapper.test.ts rename to src/script/repositories/assets/AssetMapper.test.ts diff --git a/src/script/assets/AssetMapper.ts b/src/script/repositories/assets/AssetMapper.ts similarity index 95% rename from src/script/assets/AssetMapper.ts rename to src/script/repositories/assets/AssetMapper.ts index 9a9bd2c9d3a..4753dcb3112 100644 --- a/src/script/assets/AssetMapper.ts +++ b/src/script/repositories/assets/AssetMapper.ts @@ -23,8 +23,8 @@ import type {UserAsset as APIClientUserAsset} from '@wireapp/api-client/lib/user import {AssetRemoteData} from './AssetRemoteData'; -import type {User} from '../entity/User'; -import type {ServiceEntity} from '../integration/ServiceEntity'; +import type {User} from '../../entity/User'; +import type {ServiceEntity} from '../../integration/ServiceEntity'; export type MappedAsset = {[index: string]: AssetRemoteData}; diff --git a/src/script/assets/AssetMetaDataBuilder.test.ts b/src/script/repositories/assets/AssetMetaDataBuilder.test.ts similarity index 100% rename from src/script/assets/AssetMetaDataBuilder.test.ts rename to src/script/repositories/assets/AssetMetaDataBuilder.test.ts diff --git a/src/script/assets/AssetMetaDataBuilder.ts b/src/script/repositories/assets/AssetMetaDataBuilder.ts similarity index 100% rename from src/script/assets/AssetMetaDataBuilder.ts rename to src/script/repositories/assets/AssetMetaDataBuilder.ts diff --git a/src/script/assets/AssetRemoteData.ts b/src/script/repositories/assets/AssetRemoteData.ts similarity index 100% rename from src/script/assets/AssetRemoteData.ts rename to src/script/repositories/assets/AssetRemoteData.ts diff --git a/src/script/assets/AssetRepository.test.ts b/src/script/repositories/assets/AssetRepository.test.ts similarity index 98% rename from src/script/assets/AssetRepository.test.ts rename to src/script/repositories/assets/AssetRepository.test.ts index 1816542abb6..dba6781dcde 100644 --- a/src/script/assets/AssetRepository.test.ts +++ b/src/script/repositories/assets/AssetRepository.test.ts @@ -25,7 +25,7 @@ import {createUuid} from 'Util/uuid'; import {AssetRemoteData} from './AssetRemoteData'; import {AssetRepository, AssetUploadOptions} from './AssetRepository'; -import {Core} from '../service/CoreSingleton'; +import {Core} from '../../service/CoreSingleton'; describe('AssetRepository', () => { let assetRepository: AssetRepository; diff --git a/src/script/assets/AssetRepository.ts b/src/script/repositories/assets/AssetRepository.ts similarity index 96% rename from src/script/assets/AssetRepository.ts rename to src/script/repositories/assets/AssetRepository.ts index 340b2fa1939..374e94186ed 100644 --- a/src/script/assets/AssetRepository.ts +++ b/src/script/repositories/assets/AssetRepository.ts @@ -32,12 +32,12 @@ import {AssetRemoteData} from './AssetRemoteData'; import {AssetTransferState} from './AssetTransferState'; import {getAssetUrl, setAssetUrl} from './AssetURLCache'; -import {Conversation} from '../entity/Conversation'; -import {FileAsset} from '../entity/message/FileAsset'; -import type {User} from '../entity/User'; -import {Core} from '../service/CoreSingleton'; -import {TeamState} from '../team/TeamState'; -import {stripImageExifData} from '../util/ImageUtil'; +import {Conversation} from '../../entity/Conversation'; +import {FileAsset} from '../../entity/message/FileAsset'; +import type {User} from '../../entity/User'; +import {Core} from '../../service/CoreSingleton'; +import {TeamState} from '../../team/TeamState'; +import {stripImageExifData} from '../../util/ImageUtil'; interface CompressedImage { compressedBytes: Uint8Array; diff --git a/src/script/assets/AssetTransferState.ts b/src/script/repositories/assets/AssetTransferState.ts similarity index 100% rename from src/script/assets/AssetTransferState.ts rename to src/script/repositories/assets/AssetTransferState.ts diff --git a/src/script/assets/AssetType.ts b/src/script/repositories/assets/AssetType.ts similarity index 100% rename from src/script/assets/AssetType.ts rename to src/script/repositories/assets/AssetType.ts diff --git a/src/script/assets/AssetURLCache.ts b/src/script/repositories/assets/AssetURLCache.ts similarity index 100% rename from src/script/assets/AssetURLCache.ts rename to src/script/repositories/assets/AssetURLCache.ts diff --git a/src/script/assets/imageWorker.ts b/src/script/repositories/assets/imageWorker.ts similarity index 100% rename from src/script/assets/imageWorker.ts rename to src/script/repositories/assets/imageWorker.ts diff --git a/src/script/team/TeamEntity.ts b/src/script/team/TeamEntity.ts index 43ad1c5bcaa..22dde9cecc2 100644 --- a/src/script/team/TeamEntity.ts +++ b/src/script/team/TeamEntity.ts @@ -19,7 +19,8 @@ import ko from 'knockout'; -import {AssetRemoteData} from '../assets/AssetRemoteData'; +import {AssetRemoteData} from 'Repositories/assets/AssetRemoteData'; + import {assetV3} from '../util/ValidationUtil'; export class TeamEntity { diff --git a/src/script/team/TeamRepository.test.ts b/src/script/team/TeamRepository.test.ts index abf5d804ffd..faec361d58b 100644 --- a/src/script/team/TeamRepository.test.ts +++ b/src/script/team/TeamRepository.test.ts @@ -22,6 +22,7 @@ import {FeatureList, FeatureStatus} from '@wireapp/api-client/lib/team/feature/' import {randomUUID} from 'crypto'; +import {AssetRepository} from 'Repositories/assets/AssetRepository'; import {User} from 'src/script/entity/User'; import {TeamRepository} from 'src/script/team/TeamRepository'; import {TeamState} from 'src/script/team/TeamState'; @@ -31,7 +32,6 @@ import {TeamEntity} from './TeamEntity'; import {TeamMemberEntity} from './TeamMemberEntity'; import {TeamService} from './TeamService'; -import {AssetRepository} from '../assets/AssetRepository'; import {ROLE} from '../user/UserPermission'; import {UserRepository} from '../user/UserRepository'; diff --git a/src/script/team/TeamRepository.ts b/src/script/team/TeamRepository.ts index 48ec835d4a4..736dbb591d3 100644 --- a/src/script/team/TeamRepository.ts +++ b/src/script/team/TeamRepository.ts @@ -37,6 +37,7 @@ import {Runtime, TypedEventEmitter} from '@wireapp/commons'; import {Availability} from '@wireapp/protocol-messaging'; import {WebAppEvents} from '@wireapp/webapp-events'; +import {AssetRepository} from 'Repositories/assets/AssetRepository'; import {Environment} from 'Util/Environment'; import {t} from 'Util/LocalizerUtil'; import {getLogger, Logger} from 'Util/Logger'; @@ -49,7 +50,6 @@ import {TeamMemberEntity} from './TeamMemberEntity'; import {TeamService} from './TeamService'; import {TeamState} from './TeamState'; -import {AssetRepository} from '../assets/AssetRepository'; import {User} from '../entity/User'; import {EventSource} from '../event/EventSource'; import {NOTIFICATION_HANDLING_STATE} from '../event/NotificationHandlingState'; diff --git a/src/script/user/UserMapper.ts b/src/script/user/UserMapper.ts index 650cca79c1d..69d20dc9382 100644 --- a/src/script/user/UserMapper.ts +++ b/src/script/user/UserMapper.ts @@ -17,11 +17,11 @@ * */ +import {mapProfileAssets, mapProfileAssetsV1, updateUserEntityAssets} from 'Repositories/assets/AssetMapper'; import {getLogger, Logger} from 'Util/Logger'; import {isSelfAPIUser} from './UserGuards'; -import {mapProfileAssets, mapProfileAssetsV1, updateUserEntityAssets} from '../assets/AssetMapper'; import {User} from '../entity/User'; import {UserRecord} from '../storage'; import type {ServerTimeHandler} from '../time/serverTimeHandler'; diff --git a/src/script/user/UserRepository.test.ts b/src/script/user/UserRepository.test.ts index 2dab6374277..c33e587da66 100644 --- a/src/script/user/UserRepository.test.ts +++ b/src/script/user/UserRepository.test.ts @@ -28,6 +28,7 @@ import {StatusCodes as HTTP_STATUS} from 'http-status-codes'; import {Availability} from '@wireapp/protocol-messaging'; import {WebAppEvents} from '@wireapp/webapp-events'; +import {AssetRepository} from 'Repositories/assets/AssetRepository'; import {entities} from 'test/api/payloads'; import {TestFactory} from 'test/helper/TestFactory'; import {generateAPIUser} from 'test/helper/UserGenerator'; @@ -38,7 +39,6 @@ import {UserRepository} from './UserRepository'; import {UserService} from './UserService'; import {UserState} from './UserState'; -import {AssetRepository} from '../assets/AssetRepository'; import {ClientRepository} from '../client'; import {ClientMapper} from '../client/ClientMapper'; import {ConnectionEntity} from '../connection/ConnectionEntity'; diff --git a/src/script/user/UserRepository.ts b/src/script/user/UserRepository.ts index 6190018aa44..e47aa0f6382 100644 --- a/src/script/user/UserRepository.ts +++ b/src/script/user/UserRepository.ts @@ -45,6 +45,8 @@ import {Availability} from '@wireapp/protocol-messaging'; import {WebAppEvents} from '@wireapp/webapp-events'; import {useLegalHoldModalState} from 'Components/Modals/LegalHoldModal/LegalHoldModal.state'; +import {mapProfileAssetsV1} from 'Repositories/assets/AssetMapper'; +import {AssetRepository} from 'Repositories/assets/AssetRepository'; import {chunk, partition} from 'Util/ArrayUtil'; import {t} from 'Util/LocalizerUtil'; import {getLogger, Logger} from 'Util/Logger'; @@ -58,8 +60,6 @@ import {UserMapper} from './UserMapper'; import type {UserService} from './UserService'; import {UserState} from './UserState'; -import {mapProfileAssetsV1} from '../assets/AssetMapper'; -import {AssetRepository} from '../assets/AssetRepository'; import {SIGN_OUT_REASON} from '../auth/SignOutReason'; import type {ClientRepository, QualifiedUserClientEntityMap} from '../client'; import {ClientEntity} from '../client/ClientEntity'; diff --git a/src/script/util/conversationMessages.ts b/src/script/util/conversationMessages.ts index 4350246ea3a..236ca215438 100644 --- a/src/script/util/conversationMessages.ts +++ b/src/script/util/conversationMessages.ts @@ -17,10 +17,10 @@ * */ +import {AssetType} from 'Repositories/assets/AssetType'; import {Asset} from 'src/script/entity/message/Asset'; import type {FileAsset as FileAssetType} from 'src/script/entity/message/FileAsset'; -import {AssetType} from '../assets/AssetType'; import {Conversation} from '../entity/Conversation'; import type {Message} from '../entity/message/Message'; diff --git a/src/script/util/isHittingUploadLimit.ts b/src/script/util/isHittingUploadLimit.ts index 74ee8e24cca..c321b2636f4 100644 --- a/src/script/util/isHittingUploadLimit.ts +++ b/src/script/util/isHittingUploadLimit.ts @@ -17,9 +17,9 @@ * */ +import {AssetRepository} from 'Repositories/assets/AssetRepository'; import {t} from 'Util/LocalizerUtil'; -import {AssetRepository} from '../assets/AssetRepository'; import {PrimaryModal} from '../components/Modals/PrimaryModal'; const CONCURRENT_UPLOAD_LIMIT = 10; diff --git a/src/script/view_model/MainViewModel.ts b/src/script/view_model/MainViewModel.ts index d12dcce9884..0830766066d 100644 --- a/src/script/view_model/MainViewModel.ts +++ b/src/script/view_model/MainViewModel.ts @@ -19,12 +19,13 @@ import {container} from 'tsyringe'; +import type {AssetRepository} from 'Repositories/assets/AssetRepository'; + import {ActionsViewModel} from './ActionsViewModel'; import {CallingViewModel} from './CallingViewModel'; import {ContentViewModel} from './ContentViewModel'; import {ListViewModel} from './ListViewModel'; -import type {AssetRepository} from '../assets/AssetRepository'; import type {AudioRepository} from '../audio/AudioRepository'; import type {BackupRepository} from '../backup/BackupRepository'; import type {CallingRepository} from '../calling/CallingRepository'; diff --git a/test/helper/EventGenerator.ts b/test/helper/EventGenerator.ts index faf785720c5..2e7ac4f43c0 100644 --- a/test/helper/EventGenerator.ts +++ b/test/helper/EventGenerator.ts @@ -20,7 +20,7 @@ import {MemberLeaveReason} from '@wireapp/api-client/lib/conversation/data/'; import {CONVERSATION_EVENT} from '@wireapp/api-client/lib/event'; -import {AssetTransferState} from 'src/script/assets/AssetTransferState'; +import {AssetTransferState} from 'Repositories/assets/AssetTransferState'; import { AssetAddEvent, DeleteEvent, diff --git a/test/helper/TestFactory.js b/test/helper/TestFactory.js index fa81c8beb8f..9aa8e0aa33a 100644 --- a/test/helper/TestFactory.js +++ b/test/helper/TestFactory.js @@ -28,7 +28,7 @@ import {ClientClassification, ClientType} from '@wireapp/api-client/lib/client/' import ko from 'knockout'; import {container} from 'tsyringe'; -import {AssetRepository} from 'src/script/assets/AssetRepository'; +import {AssetRepository} from 'Repositories/assets/AssetRepository'; import {CallingRepository} from 'src/script/calling/CallingRepository'; import {ClientEntity} from 'src/script/client/ClientEntity'; import {ClientRepository} from 'src/script/client/ClientRepository'; diff --git a/test/unit_tests/event/EventServiceCommon.js b/test/unit_tests/event/EventServiceCommon.js index 6988951c94f..7baed8d58c0 100644 --- a/test/unit_tests/event/EventServiceCommon.js +++ b/test/unit_tests/event/EventServiceCommon.js @@ -17,7 +17,7 @@ * */ -import {AssetTransferState} from 'src/script/assets/AssetTransferState'; +import {AssetTransferState} from 'src/script/repositories/assets/AssetTransferState'; import {ConversationError} from 'src/script/error/ConversationError'; import {StorageError} from 'src/script/error/StorageError'; import {MessageCategory} from 'src/script/message/MessageCategory'; diff --git a/tsconfig.json b/tsconfig.json index b2d3b147abd..835ad207a57 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -30,6 +30,7 @@ "Hooks/*": ["./src/script/hooks/*"], "I18n/*": ["./src/i18n/*"], "Resource/*": ["./resource/*"], + "Repositories/*": ["./src/script/repositories/*"], "Util/*": ["./src/script/util/*"] }, "skipLibCheck": true, diff --git a/webpack.config.common.js b/webpack.config.common.js index bd6afaf6c5f..18cbc2e02c5 100644 --- a/webpack.config.common.js +++ b/webpack.config.common.js @@ -193,6 +193,7 @@ module.exports = { Hooks: path.resolve(srcScript, 'hooks'), I18n: path.resolve(SRC_PATH, 'i18n'), Resource: path.resolve(ROOT_PATH, 'resource'), + Repositories: path.resolve(srcScript, 'repositories'), Util: path.resolve(srcScript, 'util'), src: path.resolve(ROOT_PATH, 'src'), test: path.resolve(ROOT_PATH, 'test'), From 297bf83e6fe2f50fa9294d7c20a07f92cd2cfd5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20J=C3=B3=C5=BAwik?= Date: Wed, 30 Oct 2024 13:46:12 +0100 Subject: [PATCH 03/12] feat: Move AudioRepository to new folder structure (#18238) * feat: Move AudioRepository to new folder structure * fix test factory path --- src/script/conversation/MessageRepository.test.ts | 2 +- src/script/conversation/MessageRepository.ts | 4 ++-- src/script/main/app.ts | 2 +- src/script/notification/NotificationRepository.test.ts | 2 +- src/script/notification/NotificationRepository.ts | 4 ++-- src/script/{ => repositories}/audio/AudioPlayingType.ts | 0 .../{ => repositories}/audio/AudioRepository.test.ts | 9 +++++---- src/script/{ => repositories}/audio/AudioRepository.ts | 6 +++--- src/script/{ => repositories}/audio/AudioType.ts | 0 src/script/view_model/CallingViewModel.ts | 4 ++-- src/script/view_model/MainViewModel.ts | 2 +- test/helper/TestFactory.js | 2 +- 12 files changed, 19 insertions(+), 18 deletions(-) rename src/script/{ => repositories}/audio/AudioPlayingType.ts (100%) rename src/script/{ => repositories}/audio/AudioRepository.test.ts (93%) rename src/script/{ => repositories}/audio/AudioRepository.ts (96%) rename src/script/{ => repositories}/audio/AudioType.ts (100%) diff --git a/src/script/conversation/MessageRepository.test.ts b/src/script/conversation/MessageRepository.test.ts index 1155cf63838..6b964334999 100644 --- a/src/script/conversation/MessageRepository.test.ts +++ b/src/script/conversation/MessageRepository.test.ts @@ -26,6 +26,7 @@ import {Account} from '@wireapp/core'; import {LegalHoldStatus} from '@wireapp/protocol-messaging'; import {AssetRepository} from 'Repositories/assets/AssetRepository'; +import {AudioRepository} from 'Repositories/audio/AudioRepository'; import {ConnectionEntity} from 'src/script/connection/ConnectionEntity'; import {MessageRepository} from 'src/script/conversation/MessageRepository'; import {Conversation} from 'src/script/entity/Conversation'; @@ -39,7 +40,6 @@ import {createUuid} from 'Util/uuid'; import {ConversationRepository} from './ConversationRepository'; import {ConversationState} from './ConversationState'; -import {AudioRepository} from '../audio/AudioRepository'; import {ClientEntity} from '../client/ClientEntity'; import {ClientState} from '../client/ClientState'; import {CryptographyRepository} from '../cryptography/CryptographyRepository'; diff --git a/src/script/conversation/MessageRepository.ts b/src/script/conversation/MessageRepository.ts index 1343499c90d..9c7196c4df6 100644 --- a/src/script/conversation/MessageRepository.ts +++ b/src/script/conversation/MessageRepository.ts @@ -53,6 +53,8 @@ import {WebAppEvents} from '@wireapp/webapp-events'; import {buildMetadata, ImageMetadata, isAudio, isImage, isVideo} from 'Repositories/assets/AssetMetaDataBuilder'; import {AssetRepository} from 'Repositories/assets/AssetRepository'; import {AssetTransferState} from 'Repositories/assets/AssetTransferState'; +import {AudioRepository} from 'Repositories/audio/AudioRepository'; +import {AudioType} from 'Repositories/audio/AudioType'; import { cancelSendingLinkPreview, clearLinkPreviewSendingState, @@ -77,8 +79,6 @@ import {ConversationVerificationState} from './ConversationVerificationState'; import {EventMapper} from './EventMapper'; import {getLinkPreviewFromString} from './linkPreviews'; -import {AudioRepository} from '../audio/AudioRepository'; -import {AudioType} from '../audio/AudioType'; import {ClientState} from '../client/ClientState'; import {PrimaryModal} from '../components/Modals/PrimaryModal'; import {EventBuilder} from '../conversation/EventBuilder'; diff --git a/src/script/main/app.ts b/src/script/main/app.ts index 1c016d10d70..de9a9a94f73 100644 --- a/src/script/main/app.ts +++ b/src/script/main/app.ts @@ -33,6 +33,7 @@ import {WebAppEvents} from '@wireapp/webapp-events'; import {PrimaryModal} from 'Components/Modals/PrimaryModal'; import {AssetRepository} from 'Repositories/assets/AssetRepository'; +import {AudioRepository} from 'Repositories/audio/AudioRepository'; import {initializeDataDog} from 'Util/DataDog'; import {DebugUtil} from 'Util/DebugUtil'; import {Environment} from 'Util/Environment'; @@ -44,7 +45,6 @@ import {appendParameter} from 'Util/UrlUtil'; import {AppInitializationStep, checkIndexedDb, InitializationEventLogger} from 'Util/util'; import '../../style/default.less'; -import {AudioRepository} from '../audio/AudioRepository'; import {SIGN_OUT_REASON} from '../auth/SignOutReason'; import {URLParameter} from '../auth/URLParameter'; import {BackupRepository} from '../backup/BackupRepository'; diff --git a/src/script/notification/NotificationRepository.test.ts b/src/script/notification/NotificationRepository.test.ts index 6ac96230ef0..183a37c2845 100644 --- a/src/script/notification/NotificationRepository.test.ts +++ b/src/script/notification/NotificationRepository.test.ts @@ -28,6 +28,7 @@ import {Runtime} from '@wireapp/commons'; import {Availability} from '@wireapp/protocol-messaging'; import {WebAppEvents} from '@wireapp/webapp-events'; +import {AudioRepository} from 'Repositories/audio/AudioRepository'; import {CallingRepository} from 'src/script/calling/CallingRepository'; import {TERMINATION_REASON} from 'src/script/calling/enum/TerminationReason'; import {ConnectionMapper} from 'src/script/connection/ConnectionMapper'; @@ -60,7 +61,6 @@ import {createUuid} from 'Util/uuid'; import {NotificationRepository} from './NotificationRepository'; -import {AudioRepository} from '../audio/AudioRepository'; import {CallingViewMode, CallState} from '../calling/CallState'; import {ConnectionEntity} from '../connection/ConnectionEntity'; import {ConversationState} from '../conversation/ConversationState'; diff --git a/src/script/notification/NotificationRepository.ts b/src/script/notification/NotificationRepository.ts index dc3911bd71a..75b08750d8d 100644 --- a/src/script/notification/NotificationRepository.ts +++ b/src/script/notification/NotificationRepository.ts @@ -28,6 +28,8 @@ import {Availability} from '@wireapp/protocol-messaging'; import {WebAppEvents} from '@wireapp/webapp-events'; import {AssetRepository} from 'Repositories/assets/AssetRepository'; +import {AudioRepository} from 'Repositories/audio/AudioRepository'; +import {AudioType} from 'Repositories/audio/AudioType'; import {CallingRepository} from 'src/script/calling/CallingRepository'; import {Declension, t, getUserName} from 'Util/LocalizerUtil'; import {getLogger, Logger} from 'Util/Logger'; @@ -38,8 +40,6 @@ import {ValidationUtilError} from 'Util/ValidationUtil'; import {PermissionState} from './PermissionState'; -import {AudioRepository} from '../audio/AudioRepository'; -import {AudioType} from '../audio/AudioType'; import {CallingViewMode, CallState} from '../calling/CallState'; import {TERMINATION_REASON} from '../calling/enum/TerminationReason'; import type {ConnectionEntity} from '../connection/ConnectionEntity'; diff --git a/src/script/audio/AudioPlayingType.ts b/src/script/repositories/audio/AudioPlayingType.ts similarity index 100% rename from src/script/audio/AudioPlayingType.ts rename to src/script/repositories/audio/AudioPlayingType.ts diff --git a/src/script/audio/AudioRepository.test.ts b/src/script/repositories/audio/AudioRepository.test.ts similarity index 93% rename from src/script/audio/AudioRepository.test.ts rename to src/script/repositories/audio/AudioRepository.test.ts index e84147750be..d8c9f6522ca 100644 --- a/src/script/audio/AudioRepository.test.ts +++ b/src/script/repositories/audio/AudioRepository.test.ts @@ -20,10 +20,11 @@ import {AudioPreference} from '@wireapp/api-client/lib/user/data/'; import {difference} from 'underscore'; -import {AudioPlayingType} from 'src/script/audio/AudioPlayingType'; -import {AudioRepository} from 'src/script/audio/AudioRepository'; -import {AudioType} from 'src/script/audio/AudioType'; -import {NOTIFICATION_HANDLING_STATE} from 'src/script/event/NotificationHandlingState'; +import {AudioPlayingType} from './AudioPlayingType'; +import {AudioRepository} from './AudioRepository'; +import {AudioType} from './AudioType'; + +import {NOTIFICATION_HANDLING_STATE} from '../../event/NotificationHandlingState'; describe('AudioRepository', () => { const audioRepository = new AudioRepository(); diff --git a/src/script/audio/AudioRepository.ts b/src/script/repositories/audio/AudioRepository.ts similarity index 96% rename from src/script/audio/AudioRepository.ts rename to src/script/repositories/audio/AudioRepository.ts index d61811db833..a8138e165c8 100644 --- a/src/script/audio/AudioRepository.ts +++ b/src/script/repositories/audio/AudioRepository.ts @@ -28,9 +28,9 @@ import {Logger, getLogger} from 'Util/Logger'; import {AudioPlayingType} from './AudioPlayingType'; import {AudioType} from './AudioType'; -import {NOTIFICATION_HANDLING_STATE} from '../event/NotificationHandlingState'; -import {MediaDevicesHandler} from '../media/MediaDevicesHandler'; -import {MediaDeviceType} from '../media/MediaDeviceType'; +import {NOTIFICATION_HANDLING_STATE} from '../../event/NotificationHandlingState'; +import {MediaDevicesHandler} from '../../media/MediaDevicesHandler'; +import {MediaDeviceType} from '../../media/MediaDeviceType'; enum AUDIO_PLAY_PERMISSION { ALLOWED = 0, diff --git a/src/script/audio/AudioType.ts b/src/script/repositories/audio/AudioType.ts similarity index 100% rename from src/script/audio/AudioType.ts rename to src/script/repositories/audio/AudioType.ts diff --git a/src/script/view_model/CallingViewModel.ts b/src/script/view_model/CallingViewModel.ts index d77cdd02e77..a0cbd01e52d 100644 --- a/src/script/view_model/CallingViewModel.ts +++ b/src/script/view_model/CallingViewModel.ts @@ -28,12 +28,12 @@ import {WebAppEvents} from '@wireapp/webapp-events'; import {ButtonGroupTab} from 'Components/calling/ButtonGroup'; import 'Components/calling/ChooseScreen'; +import type {AudioRepository} from 'Repositories/audio/AudioRepository'; +import {AudioType} from 'Repositories/audio/AudioType'; import {replaceLink, t} from 'Util/LocalizerUtil'; import {matchQualifiedIds} from 'Util/QualifiedId'; import {safeWindowOpen} from 'Util/SanitizationUtil'; -import type {AudioRepository} from '../audio/AudioRepository'; -import {AudioType} from '../audio/AudioType'; import type {Call} from '../calling/Call'; import {CallingRepository} from '../calling/CallingRepository'; import {CallState, DesktopScreenShareMenu} from '../calling/CallState'; diff --git a/src/script/view_model/MainViewModel.ts b/src/script/view_model/MainViewModel.ts index 0830766066d..0254acb6c3e 100644 --- a/src/script/view_model/MainViewModel.ts +++ b/src/script/view_model/MainViewModel.ts @@ -20,13 +20,13 @@ import {container} from 'tsyringe'; import type {AssetRepository} from 'Repositories/assets/AssetRepository'; +import type {AudioRepository} from 'Repositories/audio/AudioRepository'; import {ActionsViewModel} from './ActionsViewModel'; import {CallingViewModel} from './CallingViewModel'; import {ContentViewModel} from './ContentViewModel'; import {ListViewModel} from './ListViewModel'; -import type {AudioRepository} from '../audio/AudioRepository'; import type {BackupRepository} from '../backup/BackupRepository'; import type {CallingRepository} from '../calling/CallingRepository'; import type {ClientRepository} from '../client'; diff --git a/test/helper/TestFactory.js b/test/helper/TestFactory.js index 9aa8e0aa33a..be49c52f15b 100644 --- a/test/helper/TestFactory.js +++ b/test/helper/TestFactory.js @@ -29,6 +29,7 @@ import ko from 'knockout'; import {container} from 'tsyringe'; import {AssetRepository} from 'Repositories/assets/AssetRepository'; +import {AudioRepository} from 'Repositories/audio/AudioRepository'; import {CallingRepository} from 'src/script/calling/CallingRepository'; import {ClientEntity} from 'src/script/client/ClientEntity'; import {ClientRepository} from 'src/script/client/ClientRepository'; @@ -66,7 +67,6 @@ import {UserState} from 'src/script/user/UserState'; import {entities} from '../api/payloads'; import {SelfRepository} from 'src/script/self/SelfRepository'; -import {AudioRepository} from 'src/script/audio/AudioRepository'; export class TestFactory { constructor() { From da178fe90aed311b7fa1abb88feeccf79bde67be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20J=C3=B3=C5=BAwik?= Date: Wed, 30 Oct 2024 13:49:56 +0100 Subject: [PATCH 04/12] feat: Move Backup & Cache Repository to new folder structure (#18239) * feat: Move AudioRepository to new folder structure * feat: Move Backup & Cache Repository to new folder structure * fix path for cache repository --- .../components/HistoryExport/HistoryExport.tsx | 2 +- .../components/HistoryImport/HistoryImport.tsx | 16 ++++++++-------- src/script/main/app.ts | 6 +++--- .../{ => repositories}/backup/BackUpHeader.ts | 0 .../backup/BackupHeader.test.tsx | 0 .../backup/BackupRepository.test.ts | 10 +++++----- .../backup/BackupRepository.ts | 14 +++++++------- .../{ => repositories}/backup/BackupService.ts | 4 ++-- src/script/{ => repositories}/backup/Error.ts | 0 .../backup/recordPreprocessors.ts | 4 ++-- .../{ => repositories}/backup/zipWorker.ts | 0 .../{ => repositories}/cache/CacheRepository.ts | 2 +- src/script/util/BackupUtil.ts | 2 +- src/script/view_model/MainViewModel.ts | 2 +- test/unit_tests/cache/CacheRepositorySpec.js | 2 +- 15 files changed, 32 insertions(+), 32 deletions(-) rename src/script/{ => repositories}/backup/BackUpHeader.ts (100%) rename src/script/{ => repositories}/backup/BackupHeader.test.tsx (100%) rename src/script/{ => repositories}/backup/BackupRepository.test.ts (97%) rename src/script/{ => repositories}/backup/BackupRepository.ts (97%) rename src/script/{ => repositories}/backup/BackupService.ts (98%) rename src/script/{ => repositories}/backup/Error.ts (100%) rename src/script/{ => repositories}/backup/recordPreprocessors.ts (93%) rename src/script/{ => repositories}/backup/zipWorker.ts (100%) rename src/script/{ => repositories}/cache/CacheRepository.ts (97%) diff --git a/src/script/components/HistoryExport/HistoryExport.tsx b/src/script/components/HistoryExport/HistoryExport.tsx index 0ea428b8563..591b95f8c51 100644 --- a/src/script/components/HistoryExport/HistoryExport.tsx +++ b/src/script/components/HistoryExport/HistoryExport.tsx @@ -25,6 +25,7 @@ import {Button, ButtonVariant, FlexBox} from '@wireapp/react-ui-kit'; import {LoadingBar} from 'Components/LoadingBar/LoadingBar'; import {PrimaryModal} from 'Components/Modals/PrimaryModal'; +import {CancelError} from 'Repositories/backup/Error'; import {ClientState} from 'src/script/client/ClientState'; import {User} from 'src/script/entity/User'; import {ContentState} from 'src/script/page/useAppState'; @@ -33,7 +34,6 @@ import {getLogger} from 'Util/Logger'; import {getCurrentDate} from 'Util/TimeUtil'; import {downloadBlob} from 'Util/util'; -import {CancelError} from '../../backup/Error'; import {Config} from '../../Config'; import {RootContext} from '../../page/RootProvider'; diff --git a/src/script/components/HistoryImport/HistoryImport.tsx b/src/script/components/HistoryImport/HistoryImport.tsx index e7db739fbc2..1017dac3184 100644 --- a/src/script/components/HistoryImport/HistoryImport.tsx +++ b/src/script/components/HistoryImport/HistoryImport.tsx @@ -24,6 +24,14 @@ import {Button, ButtonVariant} from '@wireapp/react-ui-kit'; import * as Icon from 'Components/Icon'; import {LoadingBar} from 'Components/LoadingBar/LoadingBar'; import {PrimaryModal} from 'Components/Modals/PrimaryModal'; +import {BackupRepository} from 'Repositories/backup/BackupRepository'; +import { + CancelError, + DifferentAccountError, + IncompatibleBackupError, + IncompatibleBackupFormatError, + InvalidPassword, +} from 'Repositories/backup/Error'; import {User} from 'src/script/entity/User'; import {ContentState} from 'src/script/page/useAppState'; import {checkBackupEncryption} from 'Util/BackupUtil'; @@ -33,14 +41,6 @@ import {loadFileBuffer} from 'Util/util'; import {BackupFileUpload} from './BackupFileUpload'; -import {BackupRepository} from '../../backup/BackupRepository'; -import { - CancelError, - DifferentAccountError, - IncompatibleBackupError, - IncompatibleBackupFormatError, - InvalidPassword, -} from '../../backup/Error'; import {Config} from '../../Config'; import {MotionDuration} from '../../motion/MotionDuration'; diff --git a/src/script/main/app.ts b/src/script/main/app.ts index de9a9a94f73..6c2e2b27e41 100644 --- a/src/script/main/app.ts +++ b/src/script/main/app.ts @@ -34,6 +34,9 @@ import {WebAppEvents} from '@wireapp/webapp-events'; import {PrimaryModal} from 'Components/Modals/PrimaryModal'; import {AssetRepository} from 'Repositories/assets/AssetRepository'; import {AudioRepository} from 'Repositories/audio/AudioRepository'; +import {BackupRepository} from 'Repositories/backup/BackupRepository'; +import {BackupService} from 'Repositories/backup/BackupService'; +import {CacheRepository} from 'Repositories/cache/CacheRepository'; import {initializeDataDog} from 'Util/DataDog'; import {DebugUtil} from 'Util/DebugUtil'; import {Environment} from 'Util/Environment'; @@ -47,9 +50,6 @@ import {AppInitializationStep, checkIndexedDb, InitializationEventLogger} from ' import '../../style/default.less'; import {SIGN_OUT_REASON} from '../auth/SignOutReason'; import {URLParameter} from '../auth/URLParameter'; -import {BackupRepository} from '../backup/BackupRepository'; -import {BackupService} from '../backup/BackupService'; -import {CacheRepository} from '../cache/CacheRepository'; import {CallingRepository} from '../calling/CallingRepository'; import {ClientRepository, ClientService} from '../client'; import {getClientMLSConfig} from '../client/clientMLSConfig'; diff --git a/src/script/backup/BackUpHeader.ts b/src/script/repositories/backup/BackUpHeader.ts similarity index 100% rename from src/script/backup/BackUpHeader.ts rename to src/script/repositories/backup/BackUpHeader.ts diff --git a/src/script/backup/BackupHeader.test.tsx b/src/script/repositories/backup/BackupHeader.test.tsx similarity index 100% rename from src/script/backup/BackupHeader.test.tsx rename to src/script/repositories/backup/BackupHeader.test.tsx diff --git a/src/script/backup/BackupRepository.test.ts b/src/script/repositories/backup/BackupRepository.test.ts similarity index 97% rename from src/script/backup/BackupRepository.test.ts rename to src/script/repositories/backup/BackupRepository.test.ts index f809c94130d..07d7594e438 100644 --- a/src/script/backup/BackupRepository.test.ts +++ b/src/script/repositories/backup/BackupRepository.test.ts @@ -34,11 +34,11 @@ import {BackupService} from './BackupService'; import {CancelError, DifferentAccountError, IncompatiblePlatformError} from './Error'; import {handleZipEvent} from './zipWorker'; -import {User} from '../entity/User'; -import {ClientEvent} from '../event/Client'; -import {DatabaseTypes, createStorageEngine} from '../service/StoreEngineProvider'; -import {StorageService} from '../storage'; -import {StorageSchemata} from '../storage/StorageSchemata'; +import {User} from '../../entity/User'; +import {ClientEvent} from '../../event/Client'; +import {DatabaseTypes, createStorageEngine} from '../../service/StoreEngineProvider'; +import {StorageService} from '../../storage'; +import {StorageSchemata} from '../../storage/StorageSchemata'; const conversationId = '35a9a89d-70dc-4d9e-88a2-4d8758458a6a'; diff --git a/src/script/backup/BackupRepository.ts b/src/script/repositories/backup/BackupRepository.ts similarity index 97% rename from src/script/backup/BackupRepository.ts rename to src/script/repositories/backup/BackupRepository.ts index 5fa092feeab..dd9d338d24e 100644 --- a/src/script/backup/BackupRepository.ts +++ b/src/script/repositories/backup/BackupRepository.ts @@ -40,13 +40,13 @@ import { } from './Error'; import {preprocessConversations, preprocessEvents, preprocessUsers} from './recordPreprocessors'; -import type {ConversationRepository} from '../conversation/ConversationRepository'; -import {isReadableConversation} from '../conversation/ConversationSelectors'; -import type {Conversation} from '../entity/Conversation'; -import {User} from '../entity/User'; -import {EventRecord, UserRecord} from '../storage'; -import {ConversationRecord} from '../storage/record/ConversationRecord'; -import {StorageSchemata} from '../storage/StorageSchemata'; +import type {ConversationRepository} from '../../conversation/ConversationRepository'; +import {isReadableConversation} from '../../conversation/ConversationSelectors'; +import type {Conversation} from '../../entity/Conversation'; +import {User} from '../../entity/User'; +import {EventRecord, UserRecord} from '../../storage'; +import {ConversationRecord} from '../../storage/record/ConversationRecord'; +import {StorageSchemata} from '../../storage/StorageSchemata'; interface Metadata { client_id: string; diff --git a/src/script/backup/BackupService.ts b/src/script/repositories/backup/BackupService.ts similarity index 98% rename from src/script/backup/BackupService.ts rename to src/script/repositories/backup/BackupService.ts index 41abd4c69c7..40bfa814346 100644 --- a/src/script/backup/BackupService.ts +++ b/src/script/repositories/backup/BackupService.ts @@ -23,8 +23,8 @@ import {container} from 'tsyringe'; import {Logger, getLogger} from 'Util/Logger'; -import {CONVERSATION} from '../event/Client'; -import {StorageService} from '../storage'; +import {CONVERSATION} from '../../event/Client'; +import {StorageService} from '../../storage'; export class BackupService { private readonly logger: Logger; diff --git a/src/script/backup/Error.ts b/src/script/repositories/backup/Error.ts similarity index 100% rename from src/script/backup/Error.ts rename to src/script/repositories/backup/Error.ts diff --git a/src/script/backup/recordPreprocessors.ts b/src/script/repositories/backup/recordPreprocessors.ts similarity index 93% rename from src/script/backup/recordPreprocessors.ts rename to src/script/repositories/backup/recordPreprocessors.ts index 670fa424716..bd7f51709e6 100644 --- a/src/script/backup/recordPreprocessors.ts +++ b/src/script/repositories/backup/recordPreprocessors.ts @@ -17,8 +17,8 @@ * */ -import {ClientEvent} from '../event/Client'; -import {ConversationRecord, EventRecord, UserRecord} from '../storage'; +import {ClientEvent} from '../../event/Client'; +import {ConversationRecord, EventRecord, UserRecord} from '../../storage'; export function preprocessEvents(events: EventRecord[]): EventRecord[] { // The verification message are not relevant for a new device (no conversation can be verified on a new device). diff --git a/src/script/backup/zipWorker.ts b/src/script/repositories/backup/zipWorker.ts similarity index 100% rename from src/script/backup/zipWorker.ts rename to src/script/repositories/backup/zipWorker.ts diff --git a/src/script/cache/CacheRepository.ts b/src/script/repositories/cache/CacheRepository.ts similarity index 97% rename from src/script/cache/CacheRepository.ts rename to src/script/repositories/cache/CacheRepository.ts index 9b4672b26dc..2541254ad58 100644 --- a/src/script/cache/CacheRepository.ts +++ b/src/script/repositories/cache/CacheRepository.ts @@ -21,7 +21,7 @@ import {amplify} from 'amplify'; import {resetStoreValue} from 'Util/StorageUtil'; -import {StorageKey} from '../storage/StorageKey'; +import {StorageKey} from '../../storage/StorageKey'; export class CacheRepository { public static CACHE_KEY = { diff --git a/src/script/util/BackupUtil.ts b/src/script/util/BackupUtil.ts index d9560df4e32..89f32b032a2 100644 --- a/src/script/util/BackupUtil.ts +++ b/src/script/util/BackupUtil.ts @@ -17,7 +17,7 @@ * */ -import {ENCRYPTED_BACKUP_FORMAT} from '../backup/BackUpHeader'; +import {ENCRYPTED_BACKUP_FORMAT} from 'Repositories/backup/BackUpHeader'; export const checkBackupEncryption = async (data: ArrayBuffer | Blob): Promise => { const fileBytes = await getFileBytes(data); diff --git a/src/script/view_model/MainViewModel.ts b/src/script/view_model/MainViewModel.ts index 0254acb6c3e..435edae610b 100644 --- a/src/script/view_model/MainViewModel.ts +++ b/src/script/view_model/MainViewModel.ts @@ -21,13 +21,13 @@ import {container} from 'tsyringe'; import type {AssetRepository} from 'Repositories/assets/AssetRepository'; import type {AudioRepository} from 'Repositories/audio/AudioRepository'; +import type {BackupRepository} from 'Repositories/backup/BackupRepository'; import {ActionsViewModel} from './ActionsViewModel'; import {CallingViewModel} from './CallingViewModel'; import {ContentViewModel} from './ContentViewModel'; import {ListViewModel} from './ListViewModel'; -import type {BackupRepository} from '../backup/BackupRepository'; import type {CallingRepository} from '../calling/CallingRepository'; import type {ClientRepository} from '../client'; import type {ConnectionRepository} from '../connection/ConnectionRepository'; diff --git a/test/unit_tests/cache/CacheRepositorySpec.js b/test/unit_tests/cache/CacheRepositorySpec.js index 2ed2090b287..356379e7a13 100644 --- a/test/unit_tests/cache/CacheRepositorySpec.js +++ b/test/unit_tests/cache/CacheRepositorySpec.js @@ -19,7 +19,7 @@ import {amplify} from 'amplify'; -import {CacheRepository} from 'src/script/cache/CacheRepository'; +import {CacheRepository} from 'Repositories/cache/CacheRepository'; import {StorageKey} from 'src/script/storage/StorageKey'; import {createUuid} from 'Util/uuid'; From 32166c5862856ae87115fba3cddb6b3c0d65a0cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20J=C3=B3=C5=BAwik?= Date: Wed, 30 Oct 2024 13:52:07 +0100 Subject: [PATCH 05/12] feat: Move CallingRepository to new folder structure (#18240) * feat: Move AudioRepository to new folder structure * feat: Move Backup & Cache Repository to new folder structure * feat: Move CallingRepository to new folder structure --- .github/labeler.yml | 2 +- .../components/Conversation/Conversation.tsx | 2 +- .../LegalHoldModal/LegalHoldModal.test.tsx | 2 +- .../components/TitleBar/TitleBar.test.tsx | 4 +- src/script/components/TitleBar/TitleBar.tsx | 2 +- .../CallParticipantStatusIcons.tsx | 2 +- .../CallParticipantsListItem.test.tsx | 2 +- .../CallParticipantsListItem.tsx | 2 +- .../CallingParticipantList.tsx | 4 +- .../calling/CallingCell/CallingCell.test.tsx | 6 +-- .../calling/CallingCell/CallingCell.tsx | 10 ++-- .../CallingControls/CallingControls.tsx | 6 +-- .../calling/CallingOverlayContainer.tsx | 12 ++--- .../components/calling/ChooseScreen.tsx | 2 +- .../DetachedCallingCell.tsx | 6 +-- .../DetachedWindow/DetachedWindow.tsx | 2 +- .../calling/FullscreenVideoCall.tsx | 10 ++-- .../calling/GroupVideoGrid.test.tsx | 3 +- .../components/calling/GroupVideoGrid.tsx | 5 +- .../components/calling/GroupVideoGridTile.tsx | 3 +- .../components/calling/chooseScreen.test.tsx | 2 +- .../calling/fullscreenVideoCall.test.tsx | 6 +-- .../ConversationRepository.test.ts | 2 +- .../conversation/ConversationRepository.ts | 4 +- src/script/conversation/EventMapper.ts | 2 +- src/script/cryptography/CryptographyMapper.ts | 2 +- src/script/entity/message/CallMessage.ts | 2 +- src/script/event/CallingEvent.ts | 4 +- src/script/hooks/useAppSoftLock.test.ts | 3 +- src/script/hooks/useAppSoftLock.ts | 3 +- src/script/main/app.ts | 2 +- src/script/media/MediaStreamHandler.ts | 2 +- .../NotificationRepository.test.ts | 6 +-- .../notification/NotificationRepository.ts | 6 +-- src/script/page/AppMain.tsx | 2 +- .../ConversationCallingView.tsx | 2 +- .../panels/Conversations/Conversations.tsx | 2 +- .../Conversations/ConversationsList.test.tsx | 2 +- .../Conversations/ConversationsList.tsx | 4 +- .../panels/preferences/AVPreferences.tsx | 4 +- .../avPreferences/SaveCallLogs.tsx | 2 +- src/script/{ => repositories}/calling/Call.ts | 6 +-- .../{ => repositories}/calling/CallState.ts | 10 ++-- .../calling/CallingRepository.test.ts | 18 +++---- .../calling/CallingRepository.ts | 52 +++++++++---------- .../{ => repositories}/calling/Participant.ts | 4 +- .../callingSubscriptionsHandler.test.ts | 0 .../calling/callingSubscriptionsHandler.ts | 0 .../calling/enum/CallMessageType.ts | 0 .../calling/enum/LeaveCallReason.ts | 0 .../calling/enum/TerminationReason.ts | 0 .../calling/videoGridHandler.ts | 3 +- src/script/util/DebugUtil.ts | 6 +-- .../view_model/CallingViewModel.mocks.ts | 7 +-- .../view_model/CallingViewModel.test.ts | 2 +- src/script/view_model/CallingViewModel.ts | 8 +-- src/script/view_model/ListViewModel.ts | 2 +- src/script/view_model/MainViewModel.ts | 2 +- test/helper/TestFactory.js | 2 +- .../calling/videoGridHandlerSpec.js | 6 +-- 60 files changed, 140 insertions(+), 139 deletions(-) rename src/script/{ => repositories}/calling/Call.ts (98%) rename src/script/{ => repositories}/calling/CallState.ts (93%) rename src/script/{ => repositories}/calling/CallingRepository.test.ts (98%) rename src/script/{ => repositories}/calling/CallingRepository.ts (98%) rename src/script/{ => repositories}/calling/Participant.ts (98%) rename src/script/{ => repositories}/calling/callingSubscriptionsHandler.test.ts (100%) rename src/script/{ => repositories}/calling/callingSubscriptionsHandler.ts (100%) rename src/script/{ => repositories}/calling/enum/CallMessageType.ts (100%) rename src/script/{ => repositories}/calling/enum/LeaveCallReason.ts (100%) rename src/script/{ => repositories}/calling/enum/TerminationReason.ts (100%) rename src/script/{ => repositories}/calling/videoGridHandler.ts (97%) diff --git a/.github/labeler.yml b/.github/labeler.yml index 7252aa1c99e..1f1ef0e3ad0 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -33,7 +33,7 @@ # Components 'comp: calling': files: - - 'src/script/calling/.*' + - 'src/script/repositories/calling/.*' 'comp: preferences': files: - 'src/script/properties/.*' diff --git a/src/script/components/Conversation/Conversation.tsx b/src/script/components/Conversation/Conversation.tsx index c779fc93a67..879623daea6 100644 --- a/src/script/components/Conversation/Conversation.tsx +++ b/src/script/components/Conversation/Conversation.tsx @@ -33,7 +33,7 @@ import {showDetailViewModal} from 'Components/Modals/DetailViewModal'; import {PrimaryModal} from 'Components/Modals/PrimaryModal'; import {showWarningModal} from 'Components/Modals/utils/showWarningModal'; import {TitleBar} from 'Components/TitleBar'; -import {CallState} from 'src/script/calling/CallState'; +import {CallState} from 'Repositories/calling/CallState'; import {Config} from 'src/script/Config'; import {PROPERTIES_TYPE} from 'src/script/properties/PropertiesType'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; diff --git a/src/script/components/Modals/LegalHoldModal/LegalHoldModal.test.tsx b/src/script/components/Modals/LegalHoldModal/LegalHoldModal.test.tsx index 1510cc64386..e83544d10c6 100644 --- a/src/script/components/Modals/LegalHoldModal/LegalHoldModal.test.tsx +++ b/src/script/components/Modals/LegalHoldModal/LegalHoldModal.test.tsx @@ -21,11 +21,11 @@ import {act, render} from '@testing-library/react'; import type {QualifiedId} from '@wireapp/api-client/lib/user/'; import {useLegalHoldModalState} from 'Components/Modals/LegalHoldModal/LegalHoldModal.state'; +import {CallingRepository} from 'Repositories/calling/CallingRepository'; import {LegalHoldModal, LegalHoldModalType} from './LegalHoldModal'; import {TestFactory} from '../../../../../test/helper/TestFactory'; -import {CallingRepository} from '../../../calling/CallingRepository'; import {ClientRepository} from '../../../client'; import {ConversationRepository} from '../../../conversation/ConversationRepository'; import {MessageRepository} from '../../../conversation/MessageRepository'; diff --git a/src/script/components/TitleBar/TitleBar.test.tsx b/src/script/components/TitleBar/TitleBar.test.tsx index cdb55b4fcf3..f5d659b5582 100644 --- a/src/script/components/TitleBar/TitleBar.test.tsx +++ b/src/script/components/TitleBar/TitleBar.test.tsx @@ -27,12 +27,12 @@ import * as uiKit from '@wireapp/react-ui-kit'; import {WebAppEvents} from '@wireapp/webapp-events'; import {TitleBar} from 'Components/TitleBar'; +import {CallingRepository} from 'Repositories/calling/CallingRepository'; +import {CallState} from 'Repositories/calling/CallState'; import {withTheme} from 'src/script/auth/util/test/TestUtil'; import {ContentState} from 'src/script/page/useAppState'; import {TestFactory} from '../../../../test/helper/TestFactory'; -import {CallingRepository} from '../../calling/CallingRepository'; -import {CallState} from '../../calling/CallState'; import {ConversationVerificationState} from '../../conversation/ConversationVerificationState'; import {Conversation} from '../../entity/Conversation'; import {User} from '../../entity/User'; diff --git a/src/script/components/TitleBar/TitleBar.tsx b/src/script/components/TitleBar/TitleBar.tsx index 74aa8a4391e..335044d25e2 100644 --- a/src/script/components/TitleBar/TitleBar.tsx +++ b/src/script/components/TitleBar/TitleBar.tsx @@ -31,6 +31,7 @@ import {ConversationVerificationBadges} from 'Components/Badge'; import {useCallAlertState} from 'Components/calling/useCallAlertState'; import * as Icon from 'Components/Icon'; import {LegalHoldDot} from 'Components/LegalHoldDot'; +import {CallState} from 'Repositories/calling/CallState'; import {User} from 'src/script/entity/User'; import {useAppMainState, ViewType} from 'src/script/page/state'; import {ContentState} from 'src/script/page/useAppState'; @@ -40,7 +41,6 @@ import {StringIdentifer, t} from 'Util/LocalizerUtil'; import {matchQualifiedIds} from 'Util/QualifiedId'; import {TIME_IN_MILLIS} from 'Util/TimeUtil'; -import {CallState} from '../../calling/CallState'; import {ConversationFilter} from '../../conversation/ConversationFilter'; import {Conversation} from '../../entity/Conversation'; import {RightSidebarParams} from '../../page/AppMain'; diff --git a/src/script/components/calling/CallParticipantsListItem/CallParticipantStatusIcons.tsx b/src/script/components/calling/CallParticipantsListItem/CallParticipantStatusIcons.tsx index b7a113dfb21..7062fe0896a 100644 --- a/src/script/components/calling/CallParticipantsListItem/CallParticipantStatusIcons.tsx +++ b/src/script/components/calling/CallParticipantsListItem/CallParticipantStatusIcons.tsx @@ -18,7 +18,7 @@ */ import * as Icon from 'Components/Icon'; -import {Participant} from 'src/script/calling/Participant'; +import {Participant} from 'Repositories/calling/Participant'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import { diff --git a/src/script/components/calling/CallParticipantsListItem/CallParticipantsListItem.test.tsx b/src/script/components/calling/CallParticipantsListItem/CallParticipantsListItem.test.tsx index 7204085c9aa..8798cd1092e 100644 --- a/src/script/components/calling/CallParticipantsListItem/CallParticipantsListItem.test.tsx +++ b/src/script/components/calling/CallParticipantsListItem/CallParticipantsListItem.test.tsx @@ -21,7 +21,7 @@ import {render} from '@testing-library/react'; import {Availability} from '@wireapp/protocol-messaging'; -import {Participant} from 'src/script/calling/Participant'; +import {Participant} from 'Repositories/calling/Participant'; import {User} from 'src/script/entity/User'; import {ROLE} from 'src/script/user/UserPermission'; import {createUuid} from 'Util/uuid'; diff --git a/src/script/components/calling/CallParticipantsListItem/CallParticipantsListItem.tsx b/src/script/components/calling/CallParticipantsListItem/CallParticipantsListItem.tsx index b58a8468a01..a81aac1ecd9 100644 --- a/src/script/components/calling/CallParticipantsListItem/CallParticipantsListItem.tsx +++ b/src/script/components/calling/CallParticipantsListItem/CallParticipantsListItem.tsx @@ -23,7 +23,7 @@ import {TabIndex} from '@wireapp/react-ui-kit/lib/types/enums'; import {Avatar, AVATAR_SIZE} from 'Components/Avatar'; import {UserStatusBadges} from 'Components/Badge'; -import {Participant} from 'src/script/calling/Participant'; +import {Participant} from 'Repositories/calling/Participant'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {handleKeyDown} from 'Util/KeyboardUtil'; import {t} from 'Util/LocalizerUtil'; diff --git a/src/script/components/calling/CallingCell/CallIngParticipantList/CallingParticipantList.tsx b/src/script/components/calling/CallingCell/CallIngParticipantList/CallingParticipantList.tsx index 9819b42e0c1..3d44297365d 100644 --- a/src/script/components/calling/CallingCell/CallIngParticipantList/CallingParticipantList.tsx +++ b/src/script/components/calling/CallingCell/CallIngParticipantList/CallingParticipantList.tsx @@ -24,13 +24,13 @@ import cx from 'classnames'; import {CallParticipantsListItem} from 'Components/calling/CallParticipantsListItem'; import {FadingScrollbar} from 'Components/FadingScrollbar'; import * as Icon from 'Components/Icon'; +import {CallingRepository} from 'Repositories/calling/CallingRepository'; +import {Participant} from 'Repositories/calling/Participant'; import {t} from 'Util/LocalizerUtil'; import {sortUsersByPriority} from 'Util/StringUtil'; import {labelStyles} from './CallingParticipantList.styles'; -import {CallingRepository} from '../../../../calling/CallingRepository'; -import {Participant} from '../../../../calling/Participant'; import {Conversation} from '../../../../entity/Conversation'; import {ContextMenuEntry, showContextMenu} from '../../../../ui/ContextMenu'; diff --git a/src/script/components/calling/CallingCell/CallingCell.test.tsx b/src/script/components/calling/CallingCell/CallingCell.test.tsx index 9192e0f47e8..db30fd42e98 100644 --- a/src/script/components/calling/CallingCell/CallingCell.test.tsx +++ b/src/script/components/calling/CallingCell/CallingCell.test.tsx @@ -23,9 +23,9 @@ import {act} from 'react-dom/test-utils'; import {CALL_TYPE, STATE as CALL_STATE} from '@wireapp/avs'; -import {Call} from 'src/script/calling/Call'; -import {CallingRepository} from 'src/script/calling/CallingRepository'; -import {Participant} from 'src/script/calling/Participant'; +import {Call} from 'Repositories/calling/Call'; +import {CallingRepository} from 'Repositories/calling/CallingRepository'; +import {Participant} from 'Repositories/calling/Participant'; import {Conversation} from 'src/script/entity/Conversation'; import {User} from 'src/script/entity/User'; import {MediaDevicesHandler} from 'src/script/media/MediaDevicesHandler'; diff --git a/src/script/components/calling/CallingCell/CallingCell.tsx b/src/script/components/calling/CallingCell/CallingCell.tsx index ea1fd4f4b71..323d0ca8dd9 100644 --- a/src/script/components/calling/CallingCell/CallingCell.tsx +++ b/src/script/components/calling/CallingCell/CallingCell.tsx @@ -31,17 +31,17 @@ import {GroupVideoGrid} from 'Components/calling/GroupVideoGrid'; import {useCallAlertState} from 'Components/calling/useCallAlertState'; import {ConversationClassifiedBar} from 'Components/ClassifiedBar/ClassifiedBar'; import * as Icon from 'Components/Icon'; +import type {Call} from 'Repositories/calling/Call'; +import type {CallingRepository} from 'Repositories/calling/CallingRepository'; +import {CallingViewMode, CallState, MuteState} from 'Repositories/calling/CallState'; +import type {Participant} from 'Repositories/calling/Participant'; +import {useVideoGrid} from 'Repositories/calling/videoGridHandler'; import {usePushToTalk} from 'src/script/hooks/usePushToTalk/usePushToTalk'; import {useAppMainState, ViewType} from 'src/script/page/state'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {isEnterKey, isSpaceOrEnterKey} from 'Util/KeyboardUtil'; import {t} from 'Util/LocalizerUtil'; -import type {Call} from '../../../calling/Call'; -import type {CallingRepository} from '../../../calling/CallingRepository'; -import {CallingViewMode, CallState, MuteState} from '../../../calling/CallState'; -import type {Participant} from '../../../calling/Participant'; -import {useVideoGrid} from '../../../calling/videoGridHandler'; import {generateConversationUrl} from '../../../router/routeGenerator'; import {TeamState} from '../../../team/TeamState'; import {CallActions, CallViewTab} from '../../../view_model/CallingViewModel'; diff --git a/src/script/components/calling/CallingCell/CallingControls/CallingControls.tsx b/src/script/components/calling/CallingCell/CallingControls/CallingControls.tsx index f4e97079dbc..1854be76cc8 100644 --- a/src/script/components/calling/CallingCell/CallingControls/CallingControls.tsx +++ b/src/script/components/calling/CallingCell/CallingControls/CallingControls.tsx @@ -26,12 +26,12 @@ import { } from 'Components/calling/CallingCell/CallingControls/CallingControls.styles'; import {useCallAlertState} from 'Components/calling/useCallAlertState'; import * as Icon from 'Components/Icon'; -import {DesktopScreenShareMenu} from 'src/script/calling/CallState'; +import {Call} from 'Repositories/calling/Call'; +import {DesktopScreenShareMenu} from 'Repositories/calling/CallState'; +import {Participant} from 'Repositories/calling/Participant'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; -import {Call} from '../../../../calling/Call'; -import {Participant} from '../../../../calling/Participant'; import {TeamState} from '../../../../team/TeamState'; import {CallActions} from '../../../../view_model/CallingViewModel'; diff --git a/src/script/components/calling/CallingOverlayContainer.tsx b/src/script/components/calling/CallingOverlayContainer.tsx index ad3c7add5ab..353fe5fb030 100644 --- a/src/script/components/calling/CallingOverlayContainer.tsx +++ b/src/script/components/calling/CallingOverlayContainer.tsx @@ -22,17 +22,17 @@ import React, {Fragment, useEffect} from 'react'; import {container} from 'tsyringe'; import {useCallAlertState} from 'Components/calling/useCallAlertState'; +import {Call} from 'Repositories/calling/Call'; +import {CallingRepository} from 'Repositories/calling/CallingRepository'; +import {CallingViewMode, CallState, DesktopScreenShareMenu, MuteState} from 'Repositories/calling/CallState'; +import {LEAVE_CALL_REASON} from 'Repositories/calling/enum/LeaveCallReason'; +import {Participant} from 'Repositories/calling/Participant'; +import {useVideoGrid} from 'Repositories/calling/videoGridHandler'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {ChooseScreen} from './ChooseScreen'; import {FullscreenVideoCall} from './FullscreenVideoCall'; -import {Call} from '../../calling/Call'; -import {CallingRepository} from '../../calling/CallingRepository'; -import {CallingViewMode, CallState, DesktopScreenShareMenu, MuteState} from '../../calling/CallState'; -import {LEAVE_CALL_REASON} from '../../calling/enum/LeaveCallReason'; -import {Participant} from '../../calling/Participant'; -import {useVideoGrid} from '../../calling/videoGridHandler'; import {MediaRepository} from '../../media/MediaRepository'; import {CallViewTab} from '../../view_model/CallingViewModel'; diff --git a/src/script/components/calling/ChooseScreen.tsx b/src/script/components/calling/ChooseScreen.tsx index 8f5a136b494..7d90b6fd694 100644 --- a/src/script/components/calling/ChooseScreen.tsx +++ b/src/script/components/calling/ChooseScreen.tsx @@ -21,7 +21,7 @@ import {Fragment, useCallback, useEffect} from 'react'; import {container} from 'tsyringe'; -import {CallState} from 'src/script/calling/CallState'; +import {CallState} from 'Repositories/calling/CallState'; import {ElectronDesktopCapturerSource} from 'src/script/media/MediaDevicesHandler'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; diff --git a/src/script/components/calling/DetachedCallingCell/DetachedCallingCell.tsx b/src/script/components/calling/DetachedCallingCell/DetachedCallingCell.tsx index 1a5ad39a3c9..08aa0de1145 100644 --- a/src/script/components/calling/DetachedCallingCell/DetachedCallingCell.tsx +++ b/src/script/components/calling/DetachedCallingCell/DetachedCallingCell.tsx @@ -19,9 +19,9 @@ import {container} from 'tsyringe'; -import {Call} from 'src/script/calling/Call'; -import {CallingRepository} from 'src/script/calling/CallingRepository'; -import {CallState, CallingViewMode, DesktopScreenShareMenu} from 'src/script/calling/CallState'; +import {Call} from 'Repositories/calling/Call'; +import {CallingRepository} from 'Repositories/calling/CallingRepository'; +import {CallState, CallingViewMode, DesktopScreenShareMenu} from 'Repositories/calling/CallState'; import {MediaRepository} from 'src/script/media/MediaRepository'; import {UserState} from 'src/script/user/UserState'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; diff --git a/src/script/components/calling/DetachedCallingCell/components/DetachedWindow/DetachedWindow.tsx b/src/script/components/calling/DetachedCallingCell/components/DetachedWindow/DetachedWindow.tsx index 933371c07e6..a4ebb7ef650 100644 --- a/src/script/components/calling/DetachedCallingCell/components/DetachedWindow/DetachedWindow.tsx +++ b/src/script/components/calling/DetachedCallingCell/components/DetachedWindow/DetachedWindow.tsx @@ -25,7 +25,7 @@ import {container} from 'tsyringe'; import {StyledApp, THEME_ID} from '@wireapp/react-ui-kit'; -import {CallState} from 'src/script/calling/CallState'; +import {CallState} from 'Repositories/calling/CallState'; import {useActiveWindow} from 'src/script/hooks/useActiveWindow'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; diff --git a/src/script/components/calling/FullscreenVideoCall.tsx b/src/script/components/calling/FullscreenVideoCall.tsx index 67290ca6ab1..04abab01024 100644 --- a/src/script/components/calling/FullscreenVideoCall.tsx +++ b/src/script/components/calling/FullscreenVideoCall.tsx @@ -39,7 +39,11 @@ import {useCallAlertState} from 'Components/calling/useCallAlertState'; import {ConversationClassifiedBar} from 'Components/ClassifiedBar/ClassifiedBar'; import * as Icon from 'Components/Icon'; import {ModalComponent} from 'Components/Modals/ModalComponent'; -import {CallingRepository} from 'src/script/calling/CallingRepository'; +import type {Call} from 'Repositories/calling/Call'; +import {CallingRepository} from 'Repositories/calling/CallingRepository'; +import {CallingViewMode, CallState, MuteState} from 'Repositories/calling/CallState'; +import {Participant} from 'Repositories/calling/Participant'; +import type {Grid} from 'Repositories/calling/videoGridHandler'; import {Config} from 'src/script/Config'; import {isCallViewOption} from 'src/script/guards/CallView'; import {isMediaDevice} from 'src/script/guards/MediaDevice'; @@ -67,10 +71,6 @@ import { import {GroupVideoGrid} from './GroupVideoGrid'; import {Pagination} from './Pagination'; -import type {Call} from '../../calling/Call'; -import {CallingViewMode, CallState, MuteState} from '../../calling/CallState'; -import {Participant} from '../../calling/Participant'; -import type {Grid} from '../../calling/videoGridHandler'; import type {Conversation} from '../../entity/Conversation'; import {ElectronDesktopCapturerSource, MediaDevicesHandler} from '../../media/MediaDevicesHandler'; import {TeamState} from '../../team/TeamState'; diff --git a/src/script/components/calling/GroupVideoGrid.test.tsx b/src/script/components/calling/GroupVideoGrid.test.tsx index 7334b40b935..7d46bf311c4 100644 --- a/src/script/components/calling/GroupVideoGrid.test.tsx +++ b/src/script/components/calling/GroupVideoGrid.test.tsx @@ -21,9 +21,10 @@ import {render, fireEvent} from '@testing-library/react'; import {VIDEO_STATE} from '@wireapp/avs'; +import {Participant} from 'Repositories/calling/Participant'; + import {GroupVideoGrid, GroupVideoGripProps} from './GroupVideoGrid'; -import {Participant} from '../../calling/Participant'; import {User} from '../../entity/User'; const createMockParticipant = ( diff --git a/src/script/components/calling/GroupVideoGrid.tsx b/src/script/components/calling/GroupVideoGrid.tsx index c2f2d6056da..9ff59272336 100644 --- a/src/script/components/calling/GroupVideoGrid.tsx +++ b/src/script/components/calling/GroupVideoGrid.tsx @@ -24,15 +24,14 @@ import {QualifiedId} from '@wireapp/api-client/lib/user'; import {Avatar, AVATAR_SIZE} from 'Components/Avatar'; import * as Icon from 'Components/Icon'; +import type {Participant} from 'Repositories/calling/Participant'; +import type {Grid} from 'Repositories/calling/videoGridHandler'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; import {GroupVideoGridTile} from './GroupVideoGridTile'; import {Video} from './Video'; -import type {Participant} from '../../calling/Participant'; -import type {Grid} from '../../calling/videoGridHandler'; - export interface GroupVideoGripProps { grid: Grid; maximizedParticipant: Participant | null; diff --git a/src/script/components/calling/GroupVideoGridTile.tsx b/src/script/components/calling/GroupVideoGridTile.tsx index 4eb8b96f016..fd826fcd5e1 100644 --- a/src/script/components/calling/GroupVideoGridTile.tsx +++ b/src/script/components/calling/GroupVideoGridTile.tsx @@ -26,14 +26,13 @@ import {VIDEO_STATE} from '@wireapp/avs'; import {Avatar, AVATAR_SIZE} from 'Components/Avatar'; import * as Icon from 'Components/Icon'; +import type {Participant} from 'Repositories/calling/Participant'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {isEnterKey} from 'Util/KeyboardUtil'; import {t} from 'Util/LocalizerUtil'; import {Video} from './Video'; -import type {Participant} from '../../calling/Participant'; - export interface GroupVideoGridTileProps { isMaximized: boolean; minimized: boolean; diff --git a/src/script/components/calling/chooseScreen.test.tsx b/src/script/components/calling/chooseScreen.test.tsx index 4d2d8d4dced..5f9b033a1da 100644 --- a/src/script/components/calling/chooseScreen.test.tsx +++ b/src/script/components/calling/chooseScreen.test.tsx @@ -20,7 +20,7 @@ import {render, fireEvent} from '@testing-library/react'; import {container} from 'tsyringe'; -import {CallState} from 'src/script/calling/CallState'; +import {CallState} from 'Repositories/calling/CallState'; import {ChooseScreen} from './ChooseScreen'; diff --git a/src/script/components/calling/fullscreenVideoCall.test.tsx b/src/script/components/calling/fullscreenVideoCall.test.tsx index 55bea2255ce..6e507a5edf4 100644 --- a/src/script/components/calling/fullscreenVideoCall.test.tsx +++ b/src/script/components/calling/fullscreenVideoCall.test.tsx @@ -20,10 +20,10 @@ import {render, waitFor, act} from '@testing-library/react'; import ko from 'knockout'; +import {Call} from 'Repositories/calling/Call'; +import {Participant} from 'Repositories/calling/Participant'; +import {Grid} from 'Repositories/calling/videoGridHandler'; import {withTheme} from 'src/script/auth/util/test/TestUtil'; -import {Call} from 'src/script/calling/Call'; -import {Participant} from 'src/script/calling/Participant'; -import {Grid} from 'src/script/calling/videoGridHandler'; import {Conversation} from 'src/script/entity/Conversation'; import {User} from 'src/script/entity/User'; import {MediaDevicesHandler} from 'src/script/media/MediaDevicesHandler'; diff --git a/src/script/conversation/ConversationRepository.test.ts b/src/script/conversation/ConversationRepository.test.ts index 95368f1f191..c1d44d8fcab 100644 --- a/src/script/conversation/ConversationRepository.test.ts +++ b/src/script/conversation/ConversationRepository.test.ts @@ -50,6 +50,7 @@ import {container} from 'tsyringe'; import {WebAppEvents} from '@wireapp/webapp-events'; +import {CallingRepository} from 'Repositories/calling/CallingRepository'; import {ClientEntity} from 'src/script/client/ClientEntity'; import {Config} from 'src/script/Config'; import {ConnectionEntity} from 'src/script/connection/ConnectionEntity'; @@ -81,7 +82,6 @@ import {MessageRepository} from './MessageRepository'; import {entities, payload} from '../../../test/api/payloads'; import {TestFactory} from '../../../test/helper/TestFactory'; import {generateUser} from '../../../test/helper/UserGenerator'; -import {CallingRepository} from '../calling/CallingRepository'; import {ConnectionRepository} from '../connection/ConnectionRepository'; import {NOTIFICATION_STATE} from '../conversation/NotificationSetting'; import {EventService} from '../event/EventService'; diff --git a/src/script/conversation/ConversationRepository.ts b/src/script/conversation/ConversationRepository.ts index 73efddf7dde..d66c4389726 100644 --- a/src/script/conversation/ConversationRepository.ts +++ b/src/script/conversation/ConversationRepository.ts @@ -60,6 +60,8 @@ import {WebAppEvents} from '@wireapp/webapp-events'; import {TYPING_TIMEOUT, useTypingIndicatorState} from 'Components/InputBar/components/TypingIndicator'; import {AssetTransferState} from 'Repositories/assets/AssetTransferState'; +import {CallingRepository} from 'Repositories/calling/CallingRepository'; +import {LEAVE_CALL_REASON} from 'Repositories/calling/enum/LeaveCallReason'; import {getNextItem} from 'Util/ArrayUtil'; import {allowsAllFiles, getFileExtensionOrName, isAllowedFile} from 'Util/FileTypeUtil'; import {replaceLink, t} from 'Util/LocalizerUtil'; @@ -114,8 +116,6 @@ import {EventMapper} from './EventMapper'; import {MessageRepository} from './MessageRepository'; import {NOTIFICATION_STATE} from './NotificationSetting'; -import {CallingRepository} from '../calling/CallingRepository'; -import {LEAVE_CALL_REASON} from '../calling/enum/LeaveCallReason'; import {PrimaryModal} from '../components/Modals/PrimaryModal'; import {Config} from '../Config'; import {ConnectionEntity} from '../connection/ConnectionEntity'; diff --git a/src/script/conversation/EventMapper.ts b/src/script/conversation/EventMapper.ts index eec948098bd..bcd99536f99 100644 --- a/src/script/conversation/EventMapper.ts +++ b/src/script/conversation/EventMapper.ts @@ -24,6 +24,7 @@ import {LinkPreview, Mention} from '@wireapp/protocol-messaging'; import {AssetRemoteData} from 'Repositories/assets/AssetRemoteData'; import {AssetTransferState} from 'Repositories/assets/AssetTransferState'; +import {TERMINATION_REASON} from 'Repositories/calling/enum/TerminationReason'; import {t} from 'Util/LocalizerUtil'; import {getLogger, Logger} from 'Util/Logger'; import {userReactionMapToReactionMap} from 'Util/ReactionUtil'; @@ -42,7 +43,6 @@ import { CompositeMessageAddEvent, } from './EventBuilder'; -import {TERMINATION_REASON} from '../calling/enum/TerminationReason'; import {AssetData} from '../cryptography/CryptographyMapper'; import type {Conversation} from '../entity/Conversation'; import {Button} from '../entity/message/Button'; diff --git a/src/script/cryptography/CryptographyMapper.ts b/src/script/cryptography/CryptographyMapper.ts index 5133e1eea5b..d8a0dd96c56 100644 --- a/src/script/cryptography/CryptographyMapper.ts +++ b/src/script/cryptography/CryptographyMapper.ts @@ -53,7 +53,7 @@ import { } from '@wireapp/protocol-messaging'; import {AssetTransferState} from 'Repositories/assets/AssetTransferState'; -import {CALL_MESSAGE_TYPE} from 'src/script/calling/enum/CallMessageType'; +import {CALL_MESSAGE_TYPE} from 'Repositories/calling/enum/CallMessageType'; import {getLogger, Logger} from 'Util/Logger'; import {TIME_IN_MILLIS} from 'Util/TimeUtil'; import {base64ToArray, arrayToBase64} from 'Util/util'; diff --git a/src/script/entity/message/CallMessage.ts b/src/script/entity/message/CallMessage.ts index 574d8416c76..1c312db27e5 100644 --- a/src/script/entity/message/CallMessage.ts +++ b/src/script/entity/message/CallMessage.ts @@ -19,11 +19,11 @@ import ko from 'knockout'; +import type {TERMINATION_REASON} from 'Repositories/calling/enum/TerminationReason'; import {t} from 'Util/LocalizerUtil'; import {Message} from './Message'; -import type {TERMINATION_REASON} from '../../calling/enum/TerminationReason'; import {CALL_MESSAGE_TYPE} from '../../message/CallMessageType'; import {SuperType} from '../../message/SuperType'; diff --git a/src/script/event/CallingEvent.ts b/src/script/event/CallingEvent.ts index 04d9486a536..e1da5280031 100644 --- a/src/script/event/CallingEvent.ts +++ b/src/script/event/CallingEvent.ts @@ -21,9 +21,9 @@ import type {QualifiedUserClients} from '@wireapp/api-client/lib/conversation'; import type {QualifiedId} from '@wireapp/api-client/lib/user'; import {InCallEmojiType} from '@wireapp/core/lib/conversation'; -import {CALL} from './Client'; +import {CALL_MESSAGE_TYPE} from 'Repositories/calling/enum/CallMessageType'; -import {CALL_MESSAGE_TYPE} from '../calling/enum/CallMessageType'; +import {CALL} from './Client'; interface CallingRemoteMuteEventContentData { targets: QualifiedUserClients; diff --git a/src/script/hooks/useAppSoftLock.test.ts b/src/script/hooks/useAppSoftLock.test.ts index 572f691447a..2d44beb2efd 100644 --- a/src/script/hooks/useAppSoftLock.test.ts +++ b/src/script/hooks/useAppSoftLock.test.ts @@ -19,9 +19,10 @@ import {renderHook, waitFor} from '@testing-library/react'; +import {CallingRepository} from 'Repositories/calling/CallingRepository'; + import {useAppSoftLock} from './useAppSoftLock'; -import {CallingRepository} from '../calling/CallingRepository'; import {E2EIHandler} from '../E2EIdentity'; import {isFreshMLSSelfClient} from '../E2EIdentity/E2EIdentityVerification'; import {NotificationRepository} from '../notification/NotificationRepository'; diff --git a/src/script/hooks/useAppSoftLock.ts b/src/script/hooks/useAppSoftLock.ts index 1e2283ebfc0..468c4c02ac6 100644 --- a/src/script/hooks/useAppSoftLock.ts +++ b/src/script/hooks/useAppSoftLock.ts @@ -19,7 +19,8 @@ import {useCallback, useEffect, useState} from 'react'; -import {CallingRepository} from '../calling/CallingRepository'; +import {CallingRepository} from 'Repositories/calling/CallingRepository'; + import {E2EIHandler, E2EIDeviceStatus} from '../E2EIdentity'; import {NotificationRepository} from '../notification/NotificationRepository'; diff --git a/src/script/main/app.ts b/src/script/main/app.ts index 6c2e2b27e41..960eb3088ba 100644 --- a/src/script/main/app.ts +++ b/src/script/main/app.ts @@ -37,6 +37,7 @@ import {AudioRepository} from 'Repositories/audio/AudioRepository'; import {BackupRepository} from 'Repositories/backup/BackupRepository'; import {BackupService} from 'Repositories/backup/BackupService'; import {CacheRepository} from 'Repositories/cache/CacheRepository'; +import {CallingRepository} from 'Repositories/calling/CallingRepository'; import {initializeDataDog} from 'Util/DataDog'; import {DebugUtil} from 'Util/DebugUtil'; import {Environment} from 'Util/Environment'; @@ -50,7 +51,6 @@ import {AppInitializationStep, checkIndexedDb, InitializationEventLogger} from ' import '../../style/default.less'; import {SIGN_OUT_REASON} from '../auth/SignOutReason'; import {URLParameter} from '../auth/URLParameter'; -import {CallingRepository} from '../calling/CallingRepository'; import {ClientRepository, ClientService} from '../client'; import {getClientMLSConfig} from '../client/clientMLSConfig'; import {Configuration} from '../Config'; diff --git a/src/script/media/MediaStreamHandler.ts b/src/script/media/MediaStreamHandler.ts index 4324a2cabbe..30ac8913e7f 100644 --- a/src/script/media/MediaStreamHandler.ts +++ b/src/script/media/MediaStreamHandler.ts @@ -21,7 +21,7 @@ import {container} from 'tsyringe'; import {Runtime} from '@wireapp/commons'; -import {CallingViewMode, CallState} from 'src/script/calling/CallState'; +import {CallingViewMode, CallState} from 'Repositories/calling/CallState'; import {getLogger, Logger} from 'Util/Logger'; import {MediaConstraintsHandler, ScreensharingMethods} from './MediaConstraintsHandler'; diff --git a/src/script/notification/NotificationRepository.test.ts b/src/script/notification/NotificationRepository.test.ts index 183a37c2845..f90fb196b41 100644 --- a/src/script/notification/NotificationRepository.test.ts +++ b/src/script/notification/NotificationRepository.test.ts @@ -29,8 +29,9 @@ import {Availability} from '@wireapp/protocol-messaging'; import {WebAppEvents} from '@wireapp/webapp-events'; import {AudioRepository} from 'Repositories/audio/AudioRepository'; -import {CallingRepository} from 'src/script/calling/CallingRepository'; -import {TERMINATION_REASON} from 'src/script/calling/enum/TerminationReason'; +import {CallingRepository} from 'Repositories/calling/CallingRepository'; +import {CallingViewMode, CallState} from 'Repositories/calling/CallState'; +import {TERMINATION_REASON} from 'Repositories/calling/enum/TerminationReason'; import {ConnectionMapper} from 'src/script/connection/ConnectionMapper'; import {ConversationMapper} from 'src/script/conversation/ConversationMapper'; import {NOTIFICATION_STATE} from 'src/script/conversation/NotificationSetting'; @@ -61,7 +62,6 @@ import {createUuid} from 'Util/uuid'; import {NotificationRepository} from './NotificationRepository'; -import {CallingViewMode, CallState} from '../calling/CallState'; import {ConnectionEntity} from '../connection/ConnectionEntity'; import {ConversationState} from '../conversation/ConversationState'; import {Message} from '../entity/message/Message'; diff --git a/src/script/notification/NotificationRepository.ts b/src/script/notification/NotificationRepository.ts index 75b08750d8d..a32fe54194d 100644 --- a/src/script/notification/NotificationRepository.ts +++ b/src/script/notification/NotificationRepository.ts @@ -30,7 +30,9 @@ import {WebAppEvents} from '@wireapp/webapp-events'; import {AssetRepository} from 'Repositories/assets/AssetRepository'; import {AudioRepository} from 'Repositories/audio/AudioRepository'; import {AudioType} from 'Repositories/audio/AudioType'; -import {CallingRepository} from 'src/script/calling/CallingRepository'; +import {CallingRepository} from 'Repositories/calling/CallingRepository'; +import {CallingViewMode, CallState} from 'Repositories/calling/CallState'; +import {TERMINATION_REASON} from 'Repositories/calling/enum/TerminationReason'; import {Declension, t, getUserName} from 'Util/LocalizerUtil'; import {getLogger, Logger} from 'Util/Logger'; import {getRenderedTextContent} from 'Util/messageRenderer'; @@ -40,8 +42,6 @@ import {ValidationUtilError} from 'Util/ValidationUtil'; import {PermissionState} from './PermissionState'; -import {CallingViewMode, CallState} from '../calling/CallState'; -import {TERMINATION_REASON} from '../calling/enum/TerminationReason'; import type {ConnectionEntity} from '../connection/ConnectionEntity'; import {ConversationEphemeralHandler} from '../conversation/ConversationEphemeralHandler'; import type {ConversationRepository} from '../conversation/ConversationRepository'; diff --git a/src/script/page/AppMain.tsx b/src/script/page/AppMain.tsx index 74907cd8f2b..7f6bb217d6e 100644 --- a/src/script/page/AppMain.tsx +++ b/src/script/page/AppMain.tsx @@ -34,6 +34,7 @@ import {GroupCreationModal} from 'Components/Modals/GroupCreation/GroupCreationM import {LegalHoldModal} from 'Components/Modals/LegalHoldModal/LegalHoldModal'; import {PrimaryModal} from 'Components/Modals/PrimaryModal'; import {showUserModal, UserModal} from 'Components/Modals/UserModal'; +import {CallingViewMode, CallState, DesktopScreenShareMenu} from 'Repositories/calling/CallState'; import {Config} from 'src/script/Config'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; @@ -48,7 +49,6 @@ import {RootProvider} from './RootProvider'; import {useAppMainState, ViewType} from './state'; import {useAppState, ContentState} from './useAppState'; -import {CallingViewMode, CallState, DesktopScreenShareMenu} from '../calling/CallState'; import {ConversationState} from '../conversation/ConversationState'; import {User} from '../entity/User'; import {useActiveWindow} from '../hooks/useActiveWindow'; diff --git a/src/script/page/LeftSidebar/panels/Conversations/ConversationCallingView/ConversationCallingView.tsx b/src/script/page/LeftSidebar/panels/Conversations/ConversationCallingView/ConversationCallingView.tsx index a7dccc8dcab..2862e379100 100644 --- a/src/script/page/LeftSidebar/panels/Conversations/ConversationCallingView/ConversationCallingView.tsx +++ b/src/script/page/LeftSidebar/panels/Conversations/ConversationCallingView/ConversationCallingView.tsx @@ -18,7 +18,7 @@ */ import {CallingCell} from 'Components/calling/CallingCell'; -import {Call} from 'src/script/calling/Call'; +import {Call} from 'Repositories/calling/Call'; import {PropertiesRepository} from 'src/script/properties/PropertiesRepository'; import {PROPERTIES_TYPE} from 'src/script/properties/PropertiesType'; import {ListViewModel} from 'src/script/view_model/ListViewModel'; diff --git a/src/script/page/LeftSidebar/panels/Conversations/Conversations.tsx b/src/script/page/LeftSidebar/panels/Conversations/Conversations.tsx index 0f4496104c0..89e4aa397ec 100644 --- a/src/script/page/LeftSidebar/panels/Conversations/Conversations.tsx +++ b/src/script/page/LeftSidebar/panels/Conversations/Conversations.tsx @@ -25,6 +25,7 @@ import {container} from 'tsyringe'; import {useMatchMedia} from '@wireapp/react-ui-kit'; import {WebAppEvents} from '@wireapp/webapp-events'; +import {CallState} from 'Repositories/calling/CallState'; import {IntegrationRepository} from 'src/script/integration/IntegrationRepository'; import {Preferences} from 'src/script/page/LeftSidebar/panels/Preferences'; import {StartUI} from 'src/script/page/LeftSidebar/panels/StartUI'; @@ -48,7 +49,6 @@ import {getTabConversations, scrollToConversation} from './helpers'; import {useFolderStore} from './useFoldersStore'; import {SidebarStatus, SidebarTabs, useSidebarStore} from './useSidebarStore'; -import {CallState} from '../../../../calling/CallState'; import {createLabel} from '../../../../conversation/ConversationLabelRepository'; import {ConversationRepository} from '../../../../conversation/ConversationRepository'; import {ConversationState} from '../../../../conversation/ConversationState'; diff --git a/src/script/page/LeftSidebar/panels/Conversations/ConversationsList.test.tsx b/src/script/page/LeftSidebar/panels/Conversations/ConversationsList.test.tsx index 3aa18f20440..2c6cdc33798 100644 --- a/src/script/page/LeftSidebar/panels/Conversations/ConversationsList.test.tsx +++ b/src/script/page/LeftSidebar/panels/Conversations/ConversationsList.test.tsx @@ -21,7 +21,7 @@ import {render} from '@testing-library/react'; import {ConversationProtocol, CONVERSATION_TYPE} from '@wireapp/api-client/lib/conversation'; import ko from 'knockout'; -import {CallState} from 'src/script/calling/CallState'; +import {CallState} from 'Repositories/calling/CallState'; import {ConversationLabel, ConversationLabelRepository} from 'src/script/conversation/ConversationLabelRepository'; import {ConversationState} from 'src/script/conversation/ConversationState'; import {Conversation} from 'src/script/entity/Conversation'; diff --git a/src/script/page/LeftSidebar/panels/Conversations/ConversationsList.tsx b/src/script/page/LeftSidebar/panels/Conversations/ConversationsList.tsx index b1255391d03..9f8e6636116 100644 --- a/src/script/page/LeftSidebar/panels/Conversations/ConversationsList.tsx +++ b/src/script/page/LeftSidebar/panels/Conversations/ConversationsList.tsx @@ -20,7 +20,8 @@ import React, {MouseEvent as ReactMouseEvent, KeyboardEvent as ReactKeyBoardEvent, useEffect, useState} from 'react'; import {ConversationListCell} from 'Components/ConversationListCell'; -import {Call} from 'src/script/calling/Call'; +import {Call} from 'Repositories/calling/Call'; +import {CallState} from 'Repositories/calling/CallState'; import {ConversationLabel, ConversationLabelRepository} from 'src/script/conversation/ConversationLabelRepository'; import {User} from 'src/script/entity/User'; import {SidebarTabs, useSidebarStore} from 'src/script/page/LeftSidebar/panels/Conversations/useSidebarStore'; @@ -33,7 +34,6 @@ import {ConnectionRequests} from './ConnectionRequests'; import {conversationsList, headingTitle, noResultsMessage} from './ConversationsList.styles'; import {conversationSearchFilter, scrollToConversation} from './helpers'; -import {CallState} from '../../../../calling/CallState'; import {ConversationState} from '../../../../conversation/ConversationState'; import {Conversation} from '../../../../entity/Conversation'; import {generateConversationUrl} from '../../../../router/routeGenerator'; diff --git a/src/script/page/MainContent/panels/preferences/AVPreferences.tsx b/src/script/page/MainContent/panels/preferences/AVPreferences.tsx index e4729e367e5..cac643984b6 100644 --- a/src/script/page/MainContent/panels/preferences/AVPreferences.tsx +++ b/src/script/page/MainContent/panels/preferences/AVPreferences.tsx @@ -17,6 +17,8 @@ * */ +import {useInitializeMediaDevices} from 'Hooks/useInitializeMediaDevices'; +import type {CallingRepository} from 'Repositories/calling/CallingRepository'; import {MediaDeviceType} from 'src/script/media/MediaDeviceType'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; @@ -28,8 +30,6 @@ import {MicrophonePreferences} from './avPreferences/MicrophonePreferences'; import {SaveCallLogs} from './avPreferences/SaveCallLogs'; import {PreferencesPage} from './components/PreferencesPage'; -import type {CallingRepository} from '../../../../calling/CallingRepository'; -import {useInitializeMediaDevices} from '../../../../hooks/useInitializeMediaDevices'; import type {MediaRepository} from '../../../../media/MediaRepository'; import type {PropertiesRepository} from '../../../../properties/PropertiesRepository'; diff --git a/src/script/page/MainContent/panels/preferences/avPreferences/SaveCallLogs.tsx b/src/script/page/MainContent/panels/preferences/avPreferences/SaveCallLogs.tsx index b282d5e36aa..ee7c6b415fd 100644 --- a/src/script/page/MainContent/panels/preferences/avPreferences/SaveCallLogs.tsx +++ b/src/script/page/MainContent/panels/preferences/avPreferences/SaveCallLogs.tsx @@ -24,11 +24,11 @@ import {container} from 'tsyringe'; import {Button, ButtonVariant} from '@wireapp/react-ui-kit'; import {PrimaryModal} from 'Components/Modals/PrimaryModal'; +import type {CallingRepository} from 'Repositories/calling/CallingRepository'; import {t} from 'Util/LocalizerUtil'; import {getCurrentDate} from 'Util/TimeUtil'; import {downloadBlob} from 'Util/util'; -import type {CallingRepository} from '../../../../../calling/CallingRepository'; import {Config} from '../../../../../Config'; import {UserState} from '../../../../../user/UserState'; import {PreferencesSection} from '../components/PreferencesSection'; diff --git a/src/script/calling/Call.ts b/src/script/repositories/calling/Call.ts similarity index 98% rename from src/script/calling/Call.ts rename to src/script/repositories/calling/Call.ts index 460247d8698..4c09855fda0 100644 --- a/src/script/calling/Call.ts +++ b/src/script/repositories/calling/Call.ts @@ -29,9 +29,9 @@ import {sortUsersByPriority} from 'Util/StringUtil'; import {MuteState} from './CallState'; import type {ClientId, Participant} from './Participant'; -import {Config} from '../Config'; -import {Conversation} from '../entity/Conversation'; -import type {MediaDevicesHandler} from '../media/MediaDevicesHandler'; +import {Config} from '../../Config'; +import {Conversation} from '../../entity/Conversation'; +import type {MediaDevicesHandler} from '../../media/MediaDevicesHandler'; export type SerializedConversationId = string; diff --git a/src/script/calling/CallState.ts b/src/script/repositories/calling/CallState.ts similarity index 93% rename from src/script/calling/CallState.ts rename to src/script/repositories/calling/CallState.ts index f87c2cccf95..dddb6f87d5b 100644 --- a/src/script/calling/CallState.ts +++ b/src/script/repositories/calling/CallState.ts @@ -29,11 +29,11 @@ import {matchQualifiedIds} from 'Util/QualifiedId'; import {Call} from './Call'; -import {Config} from '../Config'; -import type {ElectronDesktopCapturerSource} from '../media/MediaDevicesHandler'; -import {EventName} from '../tracking/EventName'; -import {Segmentation} from '../tracking/Segmentation'; -import {CallViewTab} from '../view_model/CallingViewModel'; +import {Config} from '../../Config'; +import type {ElectronDesktopCapturerSource} from '../../media/MediaDevicesHandler'; +import {EventName} from '../../tracking/EventName'; +import {Segmentation} from '../../tracking/Segmentation'; +import {CallViewTab} from '../../view_model/CallingViewModel'; export enum MuteState { NOT_MUTED, diff --git a/src/script/calling/CallingRepository.test.ts b/src/script/repositories/calling/CallingRepository.test.ts similarity index 98% rename from src/script/calling/CallingRepository.test.ts rename to src/script/repositories/calling/CallingRepository.test.ts index 640b9ad6370..5e78731fb57 100644 --- a/src/script/calling/CallingRepository.test.ts +++ b/src/script/repositories/calling/CallingRepository.test.ts @@ -30,10 +30,6 @@ import {container} from 'tsyringe'; import {CONV_TYPE, CALL_TYPE, STATE as CALL_STATE, REASON, Wcall} from '@wireapp/avs'; import {Runtime} from '@wireapp/commons'; -import {Call} from 'src/script/calling/Call'; -import {CallingRepository} from 'src/script/calling/CallingRepository'; -import {CallState, MuteState} from 'src/script/calling/CallState'; -import {Participant} from 'src/script/calling/Participant'; import {Conversation} from 'src/script/entity/Conversation'; import {User} from 'src/script/entity/User'; import {EventRepository} from 'src/script/event/EventRepository'; @@ -42,14 +38,18 @@ import {serverTimeHandler} from 'src/script/time/serverTimeHandler'; import {TestFactory} from 'test/helper/TestFactory'; import {createUuid} from 'Util/uuid'; +import {Call} from './Call'; +import {CallingRepository} from './CallingRepository'; +import {CallState, MuteState} from './CallState'; import {CALL_MESSAGE_TYPE} from './enum/CallMessageType'; import {LEAVE_CALL_REASON} from './enum/LeaveCallReason'; +import {Participant} from './Participant'; -import {CallingEvent} from '../event/CallingEvent'; -import {CALL} from '../event/Client'; -import {MediaDevicesHandler} from '../media/MediaDevicesHandler'; -import {Core} from '../service/CoreSingleton'; -import {UserRepository} from '../user/UserRepository'; +import {CallingEvent} from '../../event/CallingEvent'; +import {CALL} from '../../event/Client'; +import {MediaDevicesHandler} from '../../media/MediaDevicesHandler'; +import {Core} from '../../service/CoreSingleton'; +import {UserRepository} from '../../user/UserRepository'; const createSelfParticipant = () => { const selfUser = new User(); diff --git a/src/script/calling/CallingRepository.ts b/src/script/repositories/calling/CallingRepository.ts similarity index 98% rename from src/script/calling/CallingRepository.ts rename to src/script/repositories/calling/CallingRepository.ts index ae967894554..28cef1e1d16 100644 --- a/src/script/calling/CallingRepository.ts +++ b/src/script/repositories/calling/CallingRepository.ts @@ -74,32 +74,32 @@ import {CALL_MESSAGE_TYPE} from './enum/CallMessageType'; import {LEAVE_CALL_REASON} from './enum/LeaveCallReason'; import {ClientId, Participant, UserId} from './Participant'; -import {PrimaryModal} from '../components/Modals/PrimaryModal'; -import {Config} from '../Config'; -import {isMLSConversation, MLSConversation} from '../conversation/ConversationSelectors'; -import {ConversationState} from '../conversation/ConversationState'; -import {ConversationVerificationState} from '../conversation/ConversationVerificationState'; -import {EventBuilder} from '../conversation/EventBuilder'; -import {CONSENT_TYPE, MessageRepository, MessageSendingOptions} from '../conversation/MessageRepository'; -import {Conversation} from '../entity/Conversation'; -import type {User} from '../entity/User'; -import {NoAudioInputError} from '../error/NoAudioInputError'; -import {CallingEvent} from '../event/CallingEvent'; -import {EventRepository} from '../event/EventRepository'; -import {EventSource} from '../event/EventSource'; -import type {MediaDevicesHandler} from '../media/MediaDevicesHandler'; -import type {MediaStreamHandler} from '../media/MediaStreamHandler'; -import {MediaType} from '../media/MediaType'; -import {APIClient} from '../service/APIClientSingleton'; -import {Core} from '../service/CoreSingleton'; -import {TeamState} from '../team/TeamState'; -import type {ServerTimeHandler} from '../time/serverTimeHandler'; -import {isCountlyEnabledAtCurrentEnvironment} from '../tracking/Countly.helpers'; -import {EventName} from '../tracking/EventName'; -import * as trackingHelpers from '../tracking/Helpers'; -import {Segmentation} from '../tracking/Segmentation'; -import type {UserRepository} from '../user/UserRepository'; -import {Warnings} from '../view_model/WarningsContainer'; +import {PrimaryModal} from '../../components/Modals/PrimaryModal'; +import {Config} from '../../Config'; +import {isMLSConversation, MLSConversation} from '../../conversation/ConversationSelectors'; +import {ConversationState} from '../../conversation/ConversationState'; +import {ConversationVerificationState} from '../../conversation/ConversationVerificationState'; +import {EventBuilder} from '../../conversation/EventBuilder'; +import {CONSENT_TYPE, MessageRepository, MessageSendingOptions} from '../../conversation/MessageRepository'; +import {Conversation} from '../../entity/Conversation'; +import type {User} from '../../entity/User'; +import {NoAudioInputError} from '../../error/NoAudioInputError'; +import {CallingEvent} from '../../event/CallingEvent'; +import {EventRepository} from '../../event/EventRepository'; +import {EventSource} from '../../event/EventSource'; +import type {MediaDevicesHandler} from '../../media/MediaDevicesHandler'; +import type {MediaStreamHandler} from '../../media/MediaStreamHandler'; +import {MediaType} from '../../media/MediaType'; +import {APIClient} from '../../service/APIClientSingleton'; +import {Core} from '../../service/CoreSingleton'; +import {TeamState} from '../../team/TeamState'; +import type {ServerTimeHandler} from '../../time/serverTimeHandler'; +import {isCountlyEnabledAtCurrentEnvironment} from '../../tracking/Countly.helpers'; +import {EventName} from '../../tracking/EventName'; +import * as trackingHelpers from '../../tracking/Helpers'; +import {Segmentation} from '../../tracking/Segmentation'; +import type {UserRepository} from '../../user/UserRepository'; +import {Warnings} from '../../view_model/WarningsContainer'; const avsLogger = getLogger('avs'); diff --git a/src/script/calling/Participant.ts b/src/script/repositories/calling/Participant.ts similarity index 98% rename from src/script/calling/Participant.ts rename to src/script/repositories/calling/Participant.ts index cfe30e68719..9d3df695094 100644 --- a/src/script/calling/Participant.ts +++ b/src/script/repositories/calling/Participant.ts @@ -24,8 +24,8 @@ import {VIDEO_STATE} from '@wireapp/avs'; import {matchQualifiedIds} from 'Util/QualifiedId'; -import {User} from '../entity/User'; -import {applyBlur} from '../media/VideoBackgroundBlur'; +import {User} from '../../entity/User'; +import {applyBlur} from '../../media/VideoBackgroundBlur'; export type UserId = string; export type ClientId = string; diff --git a/src/script/calling/callingSubscriptionsHandler.test.ts b/src/script/repositories/calling/callingSubscriptionsHandler.test.ts similarity index 100% rename from src/script/calling/callingSubscriptionsHandler.test.ts rename to src/script/repositories/calling/callingSubscriptionsHandler.test.ts diff --git a/src/script/calling/callingSubscriptionsHandler.ts b/src/script/repositories/calling/callingSubscriptionsHandler.ts similarity index 100% rename from src/script/calling/callingSubscriptionsHandler.ts rename to src/script/repositories/calling/callingSubscriptionsHandler.ts diff --git a/src/script/calling/enum/CallMessageType.ts b/src/script/repositories/calling/enum/CallMessageType.ts similarity index 100% rename from src/script/calling/enum/CallMessageType.ts rename to src/script/repositories/calling/enum/CallMessageType.ts diff --git a/src/script/calling/enum/LeaveCallReason.ts b/src/script/repositories/calling/enum/LeaveCallReason.ts similarity index 100% rename from src/script/calling/enum/LeaveCallReason.ts rename to src/script/repositories/calling/enum/LeaveCallReason.ts diff --git a/src/script/calling/enum/TerminationReason.ts b/src/script/repositories/calling/enum/TerminationReason.ts similarity index 100% rename from src/script/calling/enum/TerminationReason.ts rename to src/script/repositories/calling/enum/TerminationReason.ts diff --git a/src/script/calling/videoGridHandler.ts b/src/script/repositories/calling/videoGridHandler.ts similarity index 97% rename from src/script/calling/videoGridHandler.ts rename to src/script/repositories/calling/videoGridHandler.ts index 8715352768d..59487b00c70 100644 --- a/src/script/calling/videoGridHandler.ts +++ b/src/script/repositories/calling/videoGridHandler.ts @@ -22,8 +22,7 @@ import {useEffect, useState} from 'react'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {Call} from './Call'; - -import type {Participant} from '../calling/Participant'; +import type {Participant} from './Participant'; export interface Grid { grid: Participant[]; diff --git a/src/script/util/DebugUtil.ts b/src/script/util/DebugUtil.ts index 3c4f28b34c3..3a6a852e809 100644 --- a/src/script/util/DebugUtil.ts +++ b/src/script/util/DebugUtil.ts @@ -38,15 +38,15 @@ import {$createTextNode, $getRoot, LexicalEditor} from 'lexical'; import {container} from 'tsyringe'; import {showAppNotification} from 'Components/AppNotification'; +import {CallingRepository} from 'Repositories/calling/CallingRepository'; +import {CallState} from 'Repositories/calling/CallState'; +import {Participant} from 'Repositories/calling/Participant'; import {getLogger, Logger} from 'Util/Logger'; import {KEY} from './KeyboardUtil'; import {TIME_IN_MILLIS} from './TimeUtil'; import {createUuid} from './uuid'; -import {CallingRepository} from '../calling/CallingRepository'; -import {CallState} from '../calling/CallState'; -import {Participant} from '../calling/Participant'; import {ClientRepository} from '../client'; import {ClientState} from '../client/ClientState'; import {ConnectionRepository} from '../connection/ConnectionRepository'; diff --git a/src/script/view_model/CallingViewModel.mocks.ts b/src/script/view_model/CallingViewModel.mocks.ts index 8011331e57a..172425aa369 100644 --- a/src/script/view_model/CallingViewModel.mocks.ts +++ b/src/script/view_model/CallingViewModel.mocks.ts @@ -22,11 +22,12 @@ import {container} from 'tsyringe'; import {CALL_TYPE, CONV_TYPE} from '@wireapp/avs'; +import {Call} from 'Repositories/calling/Call'; +import {CallingRepository} from 'Repositories/calling/CallingRepository'; +import {CallState} from 'Repositories/calling/CallState'; + import {CallingViewModel} from './CallingViewModel'; -import {Call} from '../calling/Call'; -import {CallingRepository} from '../calling/CallingRepository'; -import {CallState} from '../calling/CallState'; import {Conversation} from '../entity/Conversation'; import {MediaDevicesHandler} from '../media/MediaDevicesHandler'; import {Core} from '../service/CoreSingleton'; diff --git a/src/script/view_model/CallingViewModel.test.ts b/src/script/view_model/CallingViewModel.test.ts index b4b9f84a90f..ec6e8598476 100644 --- a/src/script/view_model/CallingViewModel.test.ts +++ b/src/script/view_model/CallingViewModel.test.ts @@ -20,11 +20,11 @@ import {CALL_TYPE, STATE} from '@wireapp/avs'; import {PrimaryModal} from 'Components/Modals/PrimaryModal'; +import {LEAVE_CALL_REASON} from 'Repositories/calling/enum/LeaveCallReason'; import {createUuid} from 'Util/uuid'; import {buildCall, buildCallingViewModel, callState, mockCallingRepository} from './CallingViewModel.mocks'; -import {LEAVE_CALL_REASON} from '../calling/enum/LeaveCallReason'; import {Conversation} from '../entity/Conversation'; describe('CallingViewModel', () => { diff --git a/src/script/view_model/CallingViewModel.ts b/src/script/view_model/CallingViewModel.ts index a0cbd01e52d..a5ecad82b94 100644 --- a/src/script/view_model/CallingViewModel.ts +++ b/src/script/view_model/CallingViewModel.ts @@ -30,14 +30,14 @@ import {ButtonGroupTab} from 'Components/calling/ButtonGroup'; import 'Components/calling/ChooseScreen'; import type {AudioRepository} from 'Repositories/audio/AudioRepository'; import {AudioType} from 'Repositories/audio/AudioType'; +import type {Call} from 'Repositories/calling/Call'; +import {CallingRepository} from 'Repositories/calling/CallingRepository'; +import {CallState, DesktopScreenShareMenu} from 'Repositories/calling/CallState'; +import {LEAVE_CALL_REASON} from 'Repositories/calling/enum/LeaveCallReason'; import {replaceLink, t} from 'Util/LocalizerUtil'; import {matchQualifiedIds} from 'Util/QualifiedId'; import {safeWindowOpen} from 'Util/SanitizationUtil'; -import type {Call} from '../calling/Call'; -import {CallingRepository} from '../calling/CallingRepository'; -import {CallState, DesktopScreenShareMenu} from '../calling/CallState'; -import {LEAVE_CALL_REASON} from '../calling/enum/LeaveCallReason'; import {PrimaryModal} from '../components/Modals/PrimaryModal'; import {Config} from '../Config'; import {ConversationState} from '../conversation/ConversationState'; diff --git a/src/script/view_model/ListViewModel.ts b/src/script/view_model/ListViewModel.ts index 8cda01dbee2..605cec27635 100644 --- a/src/script/view_model/ListViewModel.ts +++ b/src/script/view_model/ListViewModel.ts @@ -25,6 +25,7 @@ import {Runtime} from '@wireapp/commons'; import {WebAppEvents} from '@wireapp/webapp-events'; import {PrimaryModal, usePrimaryModalState} from 'Components/Modals/PrimaryModal'; +import type {CallingRepository} from 'Repositories/calling/CallingRepository'; import {iterateItem} from 'Util/ArrayUtil'; import {isEscapeKey} from 'Util/KeyboardUtil'; import {t} from 'Util/LocalizerUtil'; @@ -34,7 +35,6 @@ import {CallingViewModel} from './CallingViewModel'; import {ContentViewModel} from './ContentViewModel'; import type {MainViewModel, ViewModelRepositories} from './MainViewModel'; -import type {CallingRepository} from '../calling/CallingRepository'; import type {ConversationRepository} from '../conversation/ConversationRepository'; import {ConversationState} from '../conversation/ConversationState'; import type {Conversation} from '../entity/Conversation'; diff --git a/src/script/view_model/MainViewModel.ts b/src/script/view_model/MainViewModel.ts index 435edae610b..31d347d8d90 100644 --- a/src/script/view_model/MainViewModel.ts +++ b/src/script/view_model/MainViewModel.ts @@ -22,13 +22,13 @@ import {container} from 'tsyringe'; import type {AssetRepository} from 'Repositories/assets/AssetRepository'; import type {AudioRepository} from 'Repositories/audio/AudioRepository'; import type {BackupRepository} from 'Repositories/backup/BackupRepository'; +import type {CallingRepository} from 'Repositories/calling/CallingRepository'; import {ActionsViewModel} from './ActionsViewModel'; import {CallingViewModel} from './CallingViewModel'; import {ContentViewModel} from './ContentViewModel'; import {ListViewModel} from './ListViewModel'; -import type {CallingRepository} from '../calling/CallingRepository'; import type {ClientRepository} from '../client'; import type {ConnectionRepository} from '../connection/ConnectionRepository'; import type {ConversationRepository} from '../conversation/ConversationRepository'; diff --git a/test/helper/TestFactory.js b/test/helper/TestFactory.js index be49c52f15b..b3d6b3e215f 100644 --- a/test/helper/TestFactory.js +++ b/test/helper/TestFactory.js @@ -30,7 +30,7 @@ import {container} from 'tsyringe'; import {AssetRepository} from 'Repositories/assets/AssetRepository'; import {AudioRepository} from 'Repositories/audio/AudioRepository'; -import {CallingRepository} from 'src/script/calling/CallingRepository'; +import {CallingRepository} from 'Repositories/calling/CallingRepository'; import {ClientEntity} from 'src/script/client/ClientEntity'; import {ClientRepository} from 'src/script/client/ClientRepository'; import {ClientService} from 'src/script/client/ClientService'; diff --git a/test/unit_tests/calling/videoGridHandlerSpec.js b/test/unit_tests/calling/videoGridHandlerSpec.js index a9f4a10d20d..f4e9adea9da 100644 --- a/test/unit_tests/calling/videoGridHandlerSpec.js +++ b/test/unit_tests/calling/videoGridHandlerSpec.js @@ -20,9 +20,9 @@ import {CONV_TYPE, CALL_TYPE, VIDEO_STATE} from '@wireapp/avs'; import ko from 'knockout'; -import {Call} from 'src/script/calling/Call'; -import {Participant} from 'src/script/calling/Participant'; -import {getGrid} from 'src/script/calling/videoGridHandler'; +import {Call} from 'Repositories/calling/Call'; +import {Participant} from 'Repositories/calling/Participant'; +import {getGrid} from 'Repositories/calling/videoGridHandler'; import {User} from 'src/script/entity/User'; describe('videoGridHandler', () => { let participants; From 7dc6a19aa9c44f655242cc85068180431bbb3ce0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20J=C3=B3=C5=BAwik?= Date: Wed, 30 Oct 2024 13:57:06 +0100 Subject: [PATCH 06/12] feat: Move ClientRepository to new folder structure (#18242) * feat: Move AudioRepository to new folder structure * feat: Move Backup & Cache Repository to new folder structure * feat: Move CallingRepository to new folder structure * feat: Move ClientRepository to new folder structure --- src/script/auth/module/action/ClientAction.ts | 2 +- .../VerificationBadges/VerificationBadges.tsx | 2 +- .../components/HistoryExport/HistoryExport.tsx | 2 +- .../LegalHoldModal/LegalHoldModal.test.tsx | 2 +- .../Modals/LegalHoldModal/LegalHoldModal.tsx | 2 +- .../components/UserDevices/UserDevices.tsx | 2 +- .../components/DeviceCard/DeviceCard.test.tsx | 4 ++-- .../components/DeviceCard/DeviceCard.tsx | 2 +- .../components/DeviceDetails/DeviceDetails.tsx | 2 +- .../components/DeviceList/DeviceList.tsx | 2 +- .../SelfFingerprint/SelfFingerprint.tsx | 2 +- .../conversation/ClientMismatchUtil.test.ts | 3 ++- .../conversation/ConversationRepository.test.ts | 2 +- .../Proteus/ProteusStateHandler.test.ts | 2 +- .../conversation/MessageRepository.test.ts | 4 ++-- src/script/conversation/MessageRepository.ts | 4 ++-- src/script/entity/Conversation.test.ts | 2 +- src/script/entity/Conversation.ts | 2 +- src/script/entity/User/User.test.ts | 2 +- src/script/entity/User/User.ts | 2 +- src/script/main/app.ts | 4 ++-- .../PreferenceNotificationRepository.test.ts | 2 +- .../PreferenceNotificationRepository.ts | 2 +- src/script/page/AppLock/AppLock.test.tsx | 2 +- src/script/page/AppLock/AppLock.tsx | 4 ++-- src/script/page/MainContent/MainContent.tsx | 2 +- .../panels/preferences/AccountPreferences.tsx | 2 +- .../DevicesPreference.test.tsx | 4 ++-- .../DevicesPreferences/DevicesPreference.tsx | 4 ++-- .../components/DetailedDevice.tsx | 2 +- .../components/Device/Device.tsx | 2 +- .../DeviceDetailsPreferences.test.tsx | 2 +- .../DeviceDetailsPreferences.tsx | 2 +- .../MLSDeviceDetails/MLSDeviceDetails.tsx | 2 +- .../accountPreferences/LogoutSection.tsx | 3 +-- .../{ => repositories}/client/ClientEntity.ts | 2 +- .../client/ClientIdUtil.test.ts | 0 .../{ => repositories}/client/ClientIdUtil.ts | 0 .../client/ClientMapper.test.ts | 2 +- .../{ => repositories}/client/ClientMapper.ts | 4 ++-- .../client/ClientRepository.test.ts | 9 +++++---- .../client/ClientRepository.ts | 16 ++++++++-------- .../{ => repositories}/client/ClientService.ts | 8 ++++---- .../{ => repositories}/client/ClientState.ts | 0 .../client/ClientUtils.test.ts | 0 .../{ => repositories}/client/ClientUtils.ts | 0 .../{ => repositories}/client/clientMLSConfig.ts | 6 +++--- src/script/{ => repositories}/client/index.ts | 0 src/script/self/SelfRepository.test.ts | 2 +- src/script/self/SelfRepository.ts | 2 +- src/script/user/UserRepository.test.ts | 4 ++-- src/script/user/UserRepository.ts | 6 +++--- src/script/util/DebugUtil.ts | 4 ++-- src/script/view_model/ActionsViewModel.ts | 2 +- src/script/view_model/MainViewModel.ts | 2 +- test/helper/TestFactory.js | 8 ++++---- 56 files changed, 82 insertions(+), 81 deletions(-) rename src/script/{ => repositories}/client/ClientEntity.ts (98%) rename src/script/{ => repositories}/client/ClientIdUtil.test.ts (100%) rename src/script/{ => repositories}/client/ClientIdUtil.ts (100%) rename src/script/{ => repositories}/client/ClientMapper.test.ts (99%) rename src/script/{ => repositories}/client/ClientMapper.ts (96%) rename src/script/{ => repositories}/client/ClientRepository.test.ts (97%) rename src/script/{ => repositories}/client/ClientRepository.ts (98%) rename src/script/{ => repositories}/client/ClientService.ts (96%) rename src/script/{ => repositories}/client/ClientState.ts (100%) rename src/script/{ => repositories}/client/ClientUtils.test.ts (100%) rename src/script/{ => repositories}/client/ClientUtils.ts (100%) rename src/script/{ => repositories}/client/clientMLSConfig.ts (82%) rename src/script/{ => repositories}/client/index.ts (100%) diff --git a/src/script/auth/module/action/ClientAction.ts b/src/script/auth/module/action/ClientAction.ts index 9b488e98e7e..3431a580cec 100644 --- a/src/script/auth/module/action/ClientAction.ts +++ b/src/script/auth/module/action/ClientAction.ts @@ -22,7 +22,7 @@ import {ClientInfo} from '@wireapp/core/lib/client/'; import {Runtime} from '@wireapp/commons'; -import {getClientMLSConfig} from 'src/script/client/clientMLSConfig'; +import {getClientMLSConfig} from 'Repositories/client/clientMLSConfig'; import {ClientActionCreator} from './creator/'; diff --git a/src/script/components/Badge/components/VerificationBadges/VerificationBadges.tsx b/src/script/components/Badge/components/VerificationBadges/VerificationBadges.tsx index 4efe61ba13e..3316a4e8052 100644 --- a/src/script/components/Badge/components/VerificationBadges/VerificationBadges.tsx +++ b/src/script/components/Badge/components/VerificationBadges/VerificationBadges.tsx @@ -34,7 +34,7 @@ import { Tooltip, } from '@wireapp/react-ui-kit'; -import {ClientEntity} from 'src/script/client'; +import {ClientEntity} from 'Repositories/client'; import {ConversationVerificationState} from 'src/script/conversation/ConversationVerificationState'; import {checkUserHandle} from 'src/script/conversation/ConversationVerificationStateHandler'; import {MLSStatuses, WireIdentity} from 'src/script/E2EIdentity/E2EIdentityVerification'; diff --git a/src/script/components/HistoryExport/HistoryExport.tsx b/src/script/components/HistoryExport/HistoryExport.tsx index 591b95f8c51..f3708e1c8e1 100644 --- a/src/script/components/HistoryExport/HistoryExport.tsx +++ b/src/script/components/HistoryExport/HistoryExport.tsx @@ -26,7 +26,7 @@ import {Button, ButtonVariant, FlexBox} from '@wireapp/react-ui-kit'; import {LoadingBar} from 'Components/LoadingBar/LoadingBar'; import {PrimaryModal} from 'Components/Modals/PrimaryModal'; import {CancelError} from 'Repositories/backup/Error'; -import {ClientState} from 'src/script/client/ClientState'; +import {ClientState} from 'Repositories/client/ClientState'; import {User} from 'src/script/entity/User'; import {ContentState} from 'src/script/page/useAppState'; import {t} from 'Util/LocalizerUtil'; diff --git a/src/script/components/Modals/LegalHoldModal/LegalHoldModal.test.tsx b/src/script/components/Modals/LegalHoldModal/LegalHoldModal.test.tsx index e83544d10c6..2dfa6b81450 100644 --- a/src/script/components/Modals/LegalHoldModal/LegalHoldModal.test.tsx +++ b/src/script/components/Modals/LegalHoldModal/LegalHoldModal.test.tsx @@ -22,11 +22,11 @@ import type {QualifiedId} from '@wireapp/api-client/lib/user/'; import {useLegalHoldModalState} from 'Components/Modals/LegalHoldModal/LegalHoldModal.state'; import {CallingRepository} from 'Repositories/calling/CallingRepository'; +import {ClientRepository} from 'Repositories/client'; import {LegalHoldModal, LegalHoldModalType} from './LegalHoldModal'; import {TestFactory} from '../../../../../test/helper/TestFactory'; -import {ClientRepository} from '../../../client'; import {ConversationRepository} from '../../../conversation/ConversationRepository'; import {MessageRepository} from '../../../conversation/MessageRepository'; import {CryptographyRepository} from '../../../cryptography/CryptographyRepository'; diff --git a/src/script/components/Modals/LegalHoldModal/LegalHoldModal.tsx b/src/script/components/Modals/LegalHoldModal/LegalHoldModal.tsx index ae47f644569..f8560ae6443 100644 --- a/src/script/components/Modals/LegalHoldModal/LegalHoldModal.tsx +++ b/src/script/components/Modals/LegalHoldModal/LegalHoldModal.tsx @@ -29,12 +29,12 @@ import {ModalComponent} from 'Components/Modals/ModalComponent'; import {UserDevicesState, UserDevices} from 'Components/UserDevices'; import {UserSearchableList} from 'Components/UserSearchableList'; import {useUserDevicesHistory} from 'Hooks/useUserDevicesHistory'; +import {ClientRepository} from 'Repositories/client'; import {handleEnterDown} from 'Util/KeyboardUtil'; import {t} from 'Util/LocalizerUtil'; import {useLegalHoldModalState} from './LegalHoldModal.state'; -import {ClientRepository} from '../../../client'; import {ConversationRepository} from '../../../conversation/ConversationRepository'; import {MessageRepository} from '../../../conversation/MessageRepository'; import {CryptographyRepository} from '../../../cryptography/CryptographyRepository'; diff --git a/src/script/components/UserDevices/UserDevices.tsx b/src/script/components/UserDevices/UserDevices.tsx index 1f4bced2b31..513920e03a6 100644 --- a/src/script/components/UserDevices/UserDevices.tsx +++ b/src/script/components/UserDevices/UserDevices.tsx @@ -21,6 +21,7 @@ import {useEffect, useMemo, useState} from 'react'; import {ClientClassification} from '@wireapp/api-client/lib/client/'; +import {ClientRepository, ClientEntity} from 'Repositories/client'; import {partition} from 'Util/ArrayUtil'; import {t} from 'Util/LocalizerUtil'; import {getLogger} from 'Util/Logger'; @@ -32,7 +33,6 @@ import {NoDevicesFound} from './components/NoDevicesFound'; import {SelfFingerprint} from './components/SelfFingerprint'; import {FIND_MODE, UserDevicesState} from './UserDevices.types'; -import {ClientRepository, ClientEntity} from '../../client'; import {MessageRepository} from '../../conversation/MessageRepository'; import {CryptographyRepository} from '../../cryptography/CryptographyRepository'; import {User} from '../../entity/User'; diff --git a/src/script/components/UserDevices/components/DeviceCard/DeviceCard.test.tsx b/src/script/components/UserDevices/components/DeviceCard/DeviceCard.test.tsx index 09bbb087049..73e478bd8b6 100644 --- a/src/script/components/UserDevices/components/DeviceCard/DeviceCard.test.tsx +++ b/src/script/components/UserDevices/components/DeviceCard/DeviceCard.test.tsx @@ -21,9 +21,9 @@ import {render} from '@testing-library/react'; import {ClientClassification} from '@wireapp/api-client/lib/client/'; import ko from 'knockout'; -import {DeviceCard} from './DeviceCard'; +import type {ClientEntity} from 'Repositories/client/ClientEntity'; -import type {ClientEntity} from '../../../../client/ClientEntity'; +import {DeviceCard} from './DeviceCard'; function createClientEntity(clientEntity: Partial): ClientEntity { const device: Partial = { diff --git a/src/script/components/UserDevices/components/DeviceCard/DeviceCard.tsx b/src/script/components/UserDevices/components/DeviceCard/DeviceCard.tsx index e700ca53bff..c2e86e2797f 100644 --- a/src/script/components/UserDevices/components/DeviceCard/DeviceCard.tsx +++ b/src/script/components/UserDevices/components/DeviceCard/DeviceCard.tsx @@ -23,12 +23,12 @@ import cx from 'classnames'; import {DeviceVerificationBadges} from 'Components/Badge'; import {LegalHoldDot} from 'Components/LegalHoldDot'; import {useMessageFocusedTabIndex} from 'Components/MessagesList/Message/util'; +import {type ClientEntity} from 'Repositories/client/ClientEntity'; import {WireIdentity} from 'src/script/E2EIdentity'; import {handleKeyDown} from 'Util/KeyboardUtil'; import {t} from 'Util/LocalizerUtil'; import {splitFingerprint} from 'Util/StringUtil'; -import {type ClientEntity} from '../../../../client/ClientEntity'; import {FormattedId} from '../../../../page/MainContent/panels/preferences/DevicesPreferences/components/FormattedId'; import * as Icon from '../../../Icon'; diff --git a/src/script/components/UserDevices/components/DeviceDetails/DeviceDetails.tsx b/src/script/components/UserDevices/components/DeviceDetails/DeviceDetails.tsx index 6c5bf7fb1a5..c376b3c979c 100644 --- a/src/script/components/UserDevices/components/DeviceDetails/DeviceDetails.tsx +++ b/src/script/components/UserDevices/components/DeviceDetails/DeviceDetails.tsx @@ -25,6 +25,7 @@ import {container} from 'tsyringe'; import {Button, ButtonVariant} from '@wireapp/react-ui-kit'; +import type {ClientRepository, ClientEntity} from 'Repositories/client'; import {isMLSConversation} from 'src/script/conversation/ConversationSelectors'; import {WireIdentity} from 'src/script/E2EIdentity'; import {MLSDeviceDetails} from 'src/script/page/MainContent/panels/preferences/DevicesPreferences/components/MLSDeviceDetails'; @@ -33,7 +34,6 @@ import {t} from 'Util/LocalizerUtil'; import type {Logger} from 'Util/Logger'; import {splitFingerprint} from 'Util/StringUtil'; -import type {ClientRepository, ClientEntity} from '../../../../client'; import {Config} from '../../../../Config'; import {ConversationState} from '../../../../conversation/ConversationState'; import type {MessageRepository} from '../../../../conversation/MessageRepository'; diff --git a/src/script/components/UserDevices/components/DeviceList/DeviceList.tsx b/src/script/components/UserDevices/components/DeviceList/DeviceList.tsx index 166e4799ba6..590c6c02885 100644 --- a/src/script/components/UserDevices/components/DeviceList/DeviceList.tsx +++ b/src/script/components/UserDevices/components/DeviceList/DeviceList.tsx @@ -19,11 +19,11 @@ import cx from 'classnames'; +import type {ClientEntity} from 'Repositories/client/ClientEntity'; import {WireIdentity} from 'src/script/E2EIdentity'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; -import type {ClientEntity} from '../../../../client/ClientEntity'; import {Config} from '../../../../Config'; import type {User} from '../../../../entity/User'; import {DeviceCard} from '../DeviceCard'; diff --git a/src/script/components/UserDevices/components/SelfFingerprint/SelfFingerprint.tsx b/src/script/components/UserDevices/components/SelfFingerprint/SelfFingerprint.tsx index 4402177ddaf..ae02252d243 100644 --- a/src/script/components/UserDevices/components/SelfFingerprint/SelfFingerprint.tsx +++ b/src/script/components/UserDevices/components/SelfFingerprint/SelfFingerprint.tsx @@ -25,10 +25,10 @@ import {container} from 'tsyringe'; import {WebAppEvents} from '@wireapp/webapp-events'; +import {ClientState} from 'Repositories/client/ClientState'; import {t} from 'Util/LocalizerUtil'; import {splitFingerprint} from 'Util/StringUtil'; -import {ClientState} from '../../../../client/ClientState'; import type {CryptographyRepository} from '../../../../cryptography/CryptographyRepository'; import {FormattedId} from '../../../../page/MainContent/panels/preferences/DevicesPreferences/components/FormattedId'; import {DeviceCard} from '../DeviceCard'; diff --git a/src/script/conversation/ClientMismatchUtil.test.ts b/src/script/conversation/ClientMismatchUtil.test.ts index d68b9f25e74..2bac97c182c 100644 --- a/src/script/conversation/ClientMismatchUtil.test.ts +++ b/src/script/conversation/ClientMismatchUtil.test.ts @@ -17,9 +17,10 @@ * */ +import {ClientEntity} from 'Repositories/client/ClientEntity'; + import {extractClientDiff, findDeletedClients} from './ClientMismatchUtil'; -import {ClientEntity} from '../client/ClientEntity'; import {User} from '../entity/User'; describe('ClientMismatchUtil', () => { diff --git a/src/script/conversation/ConversationRepository.test.ts b/src/script/conversation/ConversationRepository.test.ts index c1d44d8fcab..25be0d3e539 100644 --- a/src/script/conversation/ConversationRepository.test.ts +++ b/src/script/conversation/ConversationRepository.test.ts @@ -51,7 +51,7 @@ import {container} from 'tsyringe'; import {WebAppEvents} from '@wireapp/webapp-events'; import {CallingRepository} from 'Repositories/calling/CallingRepository'; -import {ClientEntity} from 'src/script/client/ClientEntity'; +import {ClientEntity} from 'Repositories/client/ClientEntity'; import {Config} from 'src/script/Config'; import {ConnectionEntity} from 'src/script/connection/ConnectionEntity'; import {ConversationDatabaseData, ConversationMapper} from 'src/script/conversation/ConversationMapper'; diff --git a/src/script/conversation/ConversationVerificationStateHandler/Proteus/ProteusStateHandler.test.ts b/src/script/conversation/ConversationVerificationStateHandler/Proteus/ProteusStateHandler.test.ts index 206594929c3..bfadbfe377f 100644 --- a/src/script/conversation/ConversationVerificationStateHandler/Proteus/ProteusStateHandler.test.ts +++ b/src/script/conversation/ConversationVerificationStateHandler/Proteus/ProteusStateHandler.test.ts @@ -17,7 +17,7 @@ * */ -import {ClientEntity} from 'src/script/client/ClientEntity'; +import {ClientEntity} from 'Repositories/client/ClientEntity'; import {ConversationVerificationState} from 'src/script/conversation/ConversationVerificationState'; import {EventBuilder} from 'src/script/conversation/EventBuilder'; import {Conversation} from 'src/script/entity/Conversation'; diff --git a/src/script/conversation/MessageRepository.test.ts b/src/script/conversation/MessageRepository.test.ts index 6b964334999..c742942d759 100644 --- a/src/script/conversation/MessageRepository.test.ts +++ b/src/script/conversation/MessageRepository.test.ts @@ -27,6 +27,8 @@ import {LegalHoldStatus} from '@wireapp/protocol-messaging'; import {AssetRepository} from 'Repositories/assets/AssetRepository'; import {AudioRepository} from 'Repositories/audio/AudioRepository'; +import {ClientEntity} from 'Repositories/client/ClientEntity'; +import {ClientState} from 'Repositories/client/ClientState'; import {ConnectionEntity} from 'src/script/connection/ConnectionEntity'; import {MessageRepository} from 'src/script/conversation/MessageRepository'; import {Conversation} from 'src/script/entity/Conversation'; @@ -40,8 +42,6 @@ import {createUuid} from 'Util/uuid'; import {ConversationRepository} from './ConversationRepository'; import {ConversationState} from './ConversationState'; -import {ClientEntity} from '../client/ClientEntity'; -import {ClientState} from '../client/ClientState'; import {CryptographyRepository} from '../cryptography/CryptographyRepository'; import {ContentMessage} from '../entity/message/ContentMessage'; import {EventRepository} from '../event/EventRepository'; diff --git a/src/script/conversation/MessageRepository.ts b/src/script/conversation/MessageRepository.ts index 9c7196c4df6..d9c12c876d8 100644 --- a/src/script/conversation/MessageRepository.ts +++ b/src/script/conversation/MessageRepository.ts @@ -50,11 +50,13 @@ import {partition} from 'underscore'; import {Asset, Availability, Confirmation, GenericMessage} from '@wireapp/protocol-messaging'; import {WebAppEvents} from '@wireapp/webapp-events'; +import {PrimaryModal} from 'Components/Modals/PrimaryModal'; import {buildMetadata, ImageMetadata, isAudio, isImage, isVideo} from 'Repositories/assets/AssetMetaDataBuilder'; import {AssetRepository} from 'Repositories/assets/AssetRepository'; import {AssetTransferState} from 'Repositories/assets/AssetTransferState'; import {AudioRepository} from 'Repositories/audio/AudioRepository'; import {AudioType} from 'Repositories/audio/AudioType'; +import {ClientState} from 'Repositories/client/ClientState'; import { cancelSendingLinkPreview, clearLinkPreviewSendingState, @@ -79,8 +81,6 @@ import {ConversationVerificationState} from './ConversationVerificationState'; import {EventMapper} from './EventMapper'; import {getLinkPreviewFromString} from './linkPreviews'; -import {ClientState} from '../client/ClientState'; -import {PrimaryModal} from '../components/Modals/PrimaryModal'; import {EventBuilder} from '../conversation/EventBuilder'; import {CryptographyRepository} from '../cryptography/CryptographyRepository'; import {PROTO_MESSAGE_TYPE} from '../cryptography/ProtoMessageType'; diff --git a/src/script/entity/Conversation.test.ts b/src/script/entity/Conversation.test.ts index 109038cc92f..6aa85e6b549 100644 --- a/src/script/entity/Conversation.test.ts +++ b/src/script/entity/Conversation.test.ts @@ -22,7 +22,7 @@ import {ConnectionStatus} from '@wireapp/api-client/lib/connection/'; import {CONVERSATION_TYPE} from '@wireapp/api-client/lib/conversation/'; -import {ClientEntity} from 'src/script/client/ClientEntity'; +import {ClientEntity} from 'Repositories/client/ClientEntity'; import {ConnectionMapper} from 'src/script/connection/ConnectionMapper'; import {ConversationMapper} from 'src/script/conversation/ConversationMapper'; import {NOTIFICATION_STATE} from 'src/script/conversation/NotificationSetting'; diff --git a/src/script/entity/Conversation.ts b/src/script/entity/Conversation.ts index 7e51e23faeb..36addc430f8 100644 --- a/src/script/entity/Conversation.ts +++ b/src/script/entity/Conversation.ts @@ -36,6 +36,7 @@ import {LegalHoldStatus} from '@wireapp/protocol-messaging'; import {WebAppEvents} from '@wireapp/webapp-events'; import {useLegalHoldModalState} from 'Components/Modals/LegalHoldModal/LegalHoldModal.state'; +import {ClientRepository} from 'Repositories/client'; import {t} from 'Util/LocalizerUtil'; import {getLogger, Logger} from 'Util/Logger'; import {matchQualifiedIds} from 'Util/QualifiedId'; @@ -47,7 +48,6 @@ import type {Message} from './message/Message'; import {PingMessage} from './message/PingMessage'; import type {User} from './User'; -import {ClientRepository} from '../client'; import {Config} from '../Config'; import {ConnectionEntity} from '../connection/ConnectionEntity'; import {ACCESS_STATE} from '../conversation/AccessState'; diff --git a/src/script/entity/User/User.test.ts b/src/script/entity/User/User.test.ts index 425985b1845..53f9dd09dbb 100644 --- a/src/script/entity/User/User.test.ts +++ b/src/script/entity/User/User.test.ts @@ -17,7 +17,7 @@ * */ -import {ClientEntity} from 'src/script/client/ClientEntity'; +import {ClientEntity} from 'Repositories/client/ClientEntity'; import {ACCENT_ID} from 'src/script/Config'; import {User} from './User'; diff --git a/src/script/entity/User/User.ts b/src/script/entity/User/User.ts index 84dfb0d7302..39dbfce0ce9 100644 --- a/src/script/entity/User/User.ts +++ b/src/script/entity/User/User.ts @@ -27,12 +27,12 @@ import {Availability} from '@wireapp/protocol-messaging'; import {WebAppEvents} from '@wireapp/webapp-events'; import type {AssetRemoteData} from 'Repositories/assets/AssetRemoteData'; +import type {ClientEntity} from 'Repositories/client/ClientEntity'; import {t} from 'Util/LocalizerUtil'; import {clamp} from 'Util/NumberUtil'; import {getFirstChar} from 'Util/StringUtil'; import {TIME_IN_MILLIS} from 'Util/TimeUtil'; -import type {ClientEntity} from '../../client/ClientEntity'; import {ACCENT_ID} from '../../Config'; import {ConnectionEntity} from '../../connection/ConnectionEntity'; import {ROLE as TEAM_ROLE} from '../../user/UserPermission'; diff --git a/src/script/main/app.ts b/src/script/main/app.ts index 960eb3088ba..0671b096038 100644 --- a/src/script/main/app.ts +++ b/src/script/main/app.ts @@ -38,6 +38,8 @@ import {BackupRepository} from 'Repositories/backup/BackupRepository'; import {BackupService} from 'Repositories/backup/BackupService'; import {CacheRepository} from 'Repositories/cache/CacheRepository'; import {CallingRepository} from 'Repositories/calling/CallingRepository'; +import {ClientRepository, ClientService} from 'Repositories/client'; +import {getClientMLSConfig} from 'Repositories/client/clientMLSConfig'; import {initializeDataDog} from 'Util/DataDog'; import {DebugUtil} from 'Util/DebugUtil'; import {Environment} from 'Util/Environment'; @@ -51,8 +53,6 @@ import {AppInitializationStep, checkIndexedDb, InitializationEventLogger} from ' import '../../style/default.less'; import {SIGN_OUT_REASON} from '../auth/SignOutReason'; import {URLParameter} from '../auth/URLParameter'; -import {ClientRepository, ClientService} from '../client'; -import {getClientMLSConfig} from '../client/clientMLSConfig'; import {Configuration} from '../Config'; import {ConnectionRepository} from '../connection/ConnectionRepository'; import {ConnectionService} from '../connection/ConnectionService'; diff --git a/src/script/notification/PreferenceNotificationRepository.test.ts b/src/script/notification/PreferenceNotificationRepository.test.ts index 98320b1ab4f..9aec7c482c7 100644 --- a/src/script/notification/PreferenceNotificationRepository.test.ts +++ b/src/script/notification/PreferenceNotificationRepository.test.ts @@ -23,11 +23,11 @@ import ko from 'knockout'; import {WebAppEvents} from '@wireapp/webapp-events'; +import {ClientEntity} from 'Repositories/client/ClientEntity'; import {Notification, PreferenceNotificationRepository} from 'src/script/notification/PreferenceNotificationRepository'; import {PropertiesRepository} from 'src/script/properties/PropertiesRepository'; import {createUuid} from 'Util/uuid'; -import {ClientEntity} from '../client/ClientEntity'; import {User} from '../entity/User'; describe('PreferenceNotificationRepository', () => { diff --git a/src/script/notification/PreferenceNotificationRepository.ts b/src/script/notification/PreferenceNotificationRepository.ts index fbd4fc99838..f20335a659e 100644 --- a/src/script/notification/PreferenceNotificationRepository.ts +++ b/src/script/notification/PreferenceNotificationRepository.ts @@ -26,10 +26,10 @@ import {groupBy} from 'underscore'; import {WebAppEvents} from '@wireapp/webapp-events'; +import type {ClientEntity} from 'Repositories/client/ClientEntity'; import {matchQualifiedIds} from 'Util/QualifiedId'; import {loadValue, resetStoreValue, storeValue} from 'Util/StorageUtil'; -import type {ClientEntity} from '../client/ClientEntity'; import type {User} from '../entity/User'; import {PropertiesRepository} from '../properties/PropertiesRepository'; diff --git a/src/script/page/AppLock/AppLock.test.tsx b/src/script/page/AppLock/AppLock.test.tsx index 9682f5905f6..ba203ad734f 100644 --- a/src/script/page/AppLock/AppLock.test.tsx +++ b/src/script/page/AppLock/AppLock.test.tsx @@ -24,11 +24,11 @@ import ko from 'knockout'; import {WebAppEvents} from '@wireapp/webapp-events'; +import type {ClientRepository} from 'Repositories/client'; import {createUuid} from 'Util/uuid'; import {AppLock, APPLOCK_STATE} from './AppLock'; -import type {ClientRepository} from '../../client'; import {TeamState} from '../../team/TeamState'; import {AppLockRepository} from '../../user/AppLockRepository'; import {AppLockState} from '../../user/AppLockState'; diff --git a/src/script/page/AppLock/AppLock.tsx b/src/script/page/AppLock/AppLock.tsx index 2dceed775b7..b1024d4a52f 100644 --- a/src/script/page/AppLock/AppLock.tsx +++ b/src/script/page/AppLock/AppLock.tsx @@ -29,9 +29,9 @@ import {WebAppEvents} from '@wireapp/webapp-events'; import * as Icon from 'Components/Icon'; import {ModalComponent} from 'Components/Modals/ModalComponent'; +import {ClientRepository} from 'Repositories/client'; +import {ClientState} from 'Repositories/client/ClientState'; import {SIGN_OUT_REASON} from 'src/script/auth/SignOutReason'; -import {ClientRepository} from 'src/script/client'; -import {ClientState} from 'src/script/client/ClientState'; import {Config} from 'src/script/Config'; import {AppLockRepository} from 'src/script/user/AppLockRepository'; import {AppLockState} from 'src/script/user/AppLockState'; diff --git a/src/script/page/MainContent/MainContent.tsx b/src/script/page/MainContent/MainContent.tsx index e2290b998c3..f80bec2e2a2 100644 --- a/src/script/page/MainContent/MainContent.tsx +++ b/src/script/page/MainContent/MainContent.tsx @@ -29,6 +29,7 @@ import {HistoryExport} from 'Components/HistoryExport'; import {HistoryImport} from 'Components/HistoryImport'; import * as Icon from 'Components/Icon'; import {useLegalHoldModalState} from 'Components/Modals/LegalHoldModal/LegalHoldModal.state'; +import {ClientState} from 'Repositories/client/ClientState'; import {User} from 'src/script/entity/User'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; @@ -41,7 +42,6 @@ import {AVPreferences} from './panels/preferences/AVPreferences'; import {DevicesPreferences} from './panels/preferences/DevicesPreferences'; import {OptionPreferences} from './panels/preferences/OptionPreferences'; -import {ClientState} from '../../client/ClientState'; import {ConversationState} from '../../conversation/ConversationState'; import {TeamState} from '../../team/TeamState'; import {UserState} from '../../user/UserState'; diff --git a/src/script/page/MainContent/panels/preferences/AccountPreferences.tsx b/src/script/page/MainContent/panels/preferences/AccountPreferences.tsx index e8ca670b1dd..5c8fe1fa067 100644 --- a/src/script/page/MainContent/panels/preferences/AccountPreferences.tsx +++ b/src/script/page/MainContent/panels/preferences/AccountPreferences.tsx @@ -26,6 +26,7 @@ import {UserVerificationBadges} from 'Components/Badge'; import {ErrorFallback} from 'Components/ErrorFallback'; import {PrimaryModal} from 'Components/Modals/PrimaryModal'; import {useEnrichedFields} from 'Components/panel/EnrichedFields'; +import {ClientRepository} from 'Repositories/client'; import {ConversationState} from 'src/script/conversation/ConversationState'; import {ContentState} from 'src/script/page/useAppState'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; @@ -47,7 +48,6 @@ import {UsernameInput} from './accountPreferences/UsernameInput'; import {PreferencesPage} from './components/PreferencesPage'; import {PreferencesSection} from './components/PreferencesSection'; -import {ClientRepository} from '../../../../client'; import {Config} from '../../../../Config'; import {ConversationRepository} from '../../../../conversation/ConversationRepository'; import {User} from '../../../../entity/User'; diff --git a/src/script/page/MainContent/panels/preferences/DevicesPreferences/DevicesPreference.test.tsx b/src/script/page/MainContent/panels/preferences/DevicesPreferences/DevicesPreference.test.tsx index d94d3044a6b..e806d71fc7c 100644 --- a/src/script/page/MainContent/panels/preferences/DevicesPreferences/DevicesPreference.test.tsx +++ b/src/script/page/MainContent/panels/preferences/DevicesPreferences/DevicesPreference.test.tsx @@ -22,9 +22,9 @@ import {CONVERSATION_TYPE, ConversationProtocol} from '@wireapp/api-client/lib/c import {randomUUID} from 'crypto'; +import {ClientEntity} from 'Repositories/client/ClientEntity'; +import {ClientState} from 'Repositories/client/ClientState'; import {withTheme} from 'src/script/auth/util/test/TestUtil'; -import {ClientEntity} from 'src/script/client/ClientEntity'; -import {ClientState} from 'src/script/client/ClientState'; import {ConversationState} from 'src/script/conversation/ConversationState'; import {CryptographyRepository} from 'src/script/cryptography/CryptographyRepository'; import {User} from 'src/script/entity/User'; diff --git a/src/script/page/MainContent/panels/preferences/DevicesPreferences/DevicesPreference.tsx b/src/script/page/MainContent/panels/preferences/DevicesPreferences/DevicesPreference.tsx index 5bfeaecd1e7..6df896dd876 100644 --- a/src/script/page/MainContent/panels/preferences/DevicesPreferences/DevicesPreference.tsx +++ b/src/script/page/MainContent/panels/preferences/DevicesPreferences/DevicesPreference.tsx @@ -22,7 +22,8 @@ import React, {useEffect, useState} from 'react'; import {QualifiedId} from '@wireapp/api-client/lib/user'; import {container} from 'tsyringe'; -import {ClientEntity} from 'src/script/client/ClientEntity'; +import {ClientEntity} from 'Repositories/client/ClientEntity'; +import {ClientState} from 'Repositories/client/ClientState'; import {CryptographyRepository} from 'src/script/cryptography/CryptographyRepository'; import {Conversation} from 'src/script/entity/Conversation'; import {User} from 'src/script/entity/User'; @@ -34,7 +35,6 @@ import {DetailedDevice} from './components/DetailedDevice'; import {Device} from './components/Device'; import {DeviceDetailsPreferences} from './components/DeviceDetailsPreferences'; -import {ClientState} from '../../../../../client/ClientState'; import {ConversationState} from '../../../../../conversation/ConversationState'; import {PreferencesPage} from '../components/PreferencesPage'; diff --git a/src/script/page/MainContent/panels/preferences/DevicesPreferences/components/DetailedDevice.tsx b/src/script/page/MainContent/panels/preferences/DevicesPreferences/components/DetailedDevice.tsx index 5ea3e240ef7..60adf522ce2 100644 --- a/src/script/page/MainContent/panels/preferences/DevicesPreferences/components/DetailedDevice.tsx +++ b/src/script/page/MainContent/panels/preferences/DevicesPreferences/components/DetailedDevice.tsx @@ -20,7 +20,7 @@ import React from 'react'; import {DeviceVerificationBadges} from 'Components/Badge'; -import {ClientEntity} from 'src/script/client/ClientEntity'; +import {ClientEntity} from 'Repositories/client/ClientEntity'; import {WireIdentity} from 'src/script/E2EIdentity'; import {MLSDeviceDetails} from './MLSDeviceDetails'; diff --git a/src/script/page/MainContent/panels/preferences/DevicesPreferences/components/Device/Device.tsx b/src/script/page/MainContent/panels/preferences/DevicesPreferences/components/Device/Device.tsx index be5ae564a81..5748235c33f 100644 --- a/src/script/page/MainContent/panels/preferences/DevicesPreferences/components/Device/Device.tsx +++ b/src/script/page/MainContent/panels/preferences/DevicesPreferences/components/Device/Device.tsx @@ -23,13 +23,13 @@ import {TabIndex} from '@wireapp/react-ui-kit/lib/types/enums'; import {DeviceVerificationBadges} from 'Components/Badge'; import * as Icon from 'Components/Icon'; +import {ClientEntity} from 'Repositories/client'; import {WireIdentity} from 'src/script/E2EIdentity'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {handleKeyDown} from 'Util/KeyboardUtil'; import {t} from 'Util/LocalizerUtil'; import {splitFingerprint} from 'Util/StringUtil'; -import {ClientEntity} from '../../../../../../../client'; import {FormattedId} from '../FormattedId'; interface DeviceProps { diff --git a/src/script/page/MainContent/panels/preferences/DevicesPreferences/components/DeviceDetailsPreferences/DeviceDetailsPreferences.test.tsx b/src/script/page/MainContent/panels/preferences/DevicesPreferences/components/DeviceDetailsPreferences/DeviceDetailsPreferences.test.tsx index d2824309f36..753e9974d23 100644 --- a/src/script/page/MainContent/panels/preferences/DevicesPreferences/components/DeviceDetailsPreferences/DeviceDetailsPreferences.test.tsx +++ b/src/script/page/MainContent/panels/preferences/DevicesPreferences/components/DeviceDetailsPreferences/DeviceDetailsPreferences.test.tsx @@ -19,8 +19,8 @@ import {act, render, waitFor} from '@testing-library/react'; +import {ClientEntity} from 'Repositories/client/ClientEntity'; import {withTheme} from 'src/script/auth/util/test/TestUtil'; -import {ClientEntity} from 'src/script/client/ClientEntity'; import {createUuid} from 'Util/uuid'; import {DeviceDetailsPreferences} from './DeviceDetailsPreferences'; diff --git a/src/script/page/MainContent/panels/preferences/DevicesPreferences/components/DeviceDetailsPreferences/DeviceDetailsPreferences.tsx b/src/script/page/MainContent/panels/preferences/DevicesPreferences/components/DeviceDetailsPreferences/DeviceDetailsPreferences.tsx index 93cf42db49a..e06bbd82cdb 100644 --- a/src/script/page/MainContent/panels/preferences/DevicesPreferences/components/DeviceDetailsPreferences/DeviceDetailsPreferences.tsx +++ b/src/script/page/MainContent/panels/preferences/DevicesPreferences/components/DeviceDetailsPreferences/DeviceDetailsPreferences.tsx @@ -21,7 +21,7 @@ import React, {useEffect, useState} from 'react'; import {Button, ButtonVariant} from '@wireapp/react-ui-kit'; -import {ClientEntity} from 'src/script/client/ClientEntity'; +import {ClientEntity} from 'Repositories/client/ClientEntity'; import {WireIdentity} from 'src/script/E2EIdentity'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; diff --git a/src/script/page/MainContent/panels/preferences/DevicesPreferences/components/MLSDeviceDetails/MLSDeviceDetails.tsx b/src/script/page/MainContent/panels/preferences/DevicesPreferences/components/MLSDeviceDetails/MLSDeviceDetails.tsx index 253faaa5c9b..4e37335f5f5 100644 --- a/src/script/page/MainContent/panels/preferences/DevicesPreferences/components/MLSDeviceDetails/MLSDeviceDetails.tsx +++ b/src/script/page/MainContent/panels/preferences/DevicesPreferences/components/MLSDeviceDetails/MLSDeviceDetails.tsx @@ -17,13 +17,13 @@ * */ +import {MLSPublicKeys} from 'Repositories/client'; import {MLSStatuses, WireIdentity} from 'src/script/E2EIdentity'; import {t} from 'Util/LocalizerUtil'; import {splitFingerprint} from 'Util/StringUtil'; import {styles} from './MLSDeviceDetails.styles'; -import {MLSPublicKeys} from '../../../../../../../client'; import {E2EICertificateDetails} from '../E2EICertificateDetails'; import {FormattedId} from '../FormattedId'; diff --git a/src/script/page/MainContent/panels/preferences/accountPreferences/LogoutSection.tsx b/src/script/page/MainContent/panels/preferences/accountPreferences/LogoutSection.tsx index c224e19743a..b0ca3a7aacb 100644 --- a/src/script/page/MainContent/panels/preferences/accountPreferences/LogoutSection.tsx +++ b/src/script/page/MainContent/panels/preferences/accountPreferences/LogoutSection.tsx @@ -23,10 +23,9 @@ import {TabIndex} from '@wireapp/react-ui-kit/lib/types/enums'; import {Button, ButtonVariant} from '@wireapp/react-ui-kit'; +import type {ClientRepository} from 'Repositories/client'; import {t} from 'Util/LocalizerUtil'; -import type {ClientRepository} from '../../../../../client'; - interface LogoutSectionProps { clientRepository: ClientRepository; } diff --git a/src/script/client/ClientEntity.ts b/src/script/repositories/client/ClientEntity.ts similarity index 98% rename from src/script/client/ClientEntity.ts rename to src/script/repositories/client/ClientEntity.ts index d3f61569510..1bb5548a25a 100644 --- a/src/script/client/ClientEntity.ts +++ b/src/script/repositories/client/ClientEntity.ts @@ -24,7 +24,7 @@ import {splitFingerprint} from 'Util/StringUtil'; import {ClientMapper} from './ClientMapper'; -import {ClientRecord} from '../storage'; +import {ClientRecord} from '../../storage'; export enum MLSPublicKeys { ED25519 = 'ed25519', diff --git a/src/script/client/ClientIdUtil.test.ts b/src/script/repositories/client/ClientIdUtil.test.ts similarity index 100% rename from src/script/client/ClientIdUtil.test.ts rename to src/script/repositories/client/ClientIdUtil.test.ts diff --git a/src/script/client/ClientIdUtil.ts b/src/script/repositories/client/ClientIdUtil.ts similarity index 100% rename from src/script/client/ClientIdUtil.ts rename to src/script/repositories/client/ClientIdUtil.ts diff --git a/src/script/client/ClientMapper.test.ts b/src/script/repositories/client/ClientMapper.test.ts similarity index 99% rename from src/script/client/ClientMapper.test.ts rename to src/script/repositories/client/ClientMapper.test.ts index a95655d2417..c4419fafd7c 100644 --- a/src/script/client/ClientMapper.test.ts +++ b/src/script/repositories/client/ClientMapper.test.ts @@ -23,7 +23,7 @@ import {entities, payload} from 'test/api/payloads'; import {ClientMapper} from './ClientMapper'; -import {ClientRecord} from '../storage'; +import {ClientRecord} from '../../storage'; describe('ClientMapper', () => { describe('mapClient', () => { diff --git a/src/script/client/ClientMapper.ts b/src/script/repositories/client/ClientMapper.ts similarity index 96% rename from src/script/client/ClientMapper.ts rename to src/script/repositories/client/ClientMapper.ts index 54bcb81edff..794c1a44f73 100644 --- a/src/script/client/ClientMapper.ts +++ b/src/script/repositories/client/ClientMapper.ts @@ -22,8 +22,8 @@ import type {PublicClient, RegisteredClient} from '@wireapp/api-client/lib/clien import {ClientEntity} from './ClientEntity'; import {parseClientId} from './ClientIdUtil'; -import {ClientRecord} from '../storage'; -import {isClientRecord, isClientWithMLSPublicKeys} from '../util/TypePredicateUtil'; +import {ClientRecord} from '../../storage'; +import {isClientRecord, isClientWithMLSPublicKeys} from '../../util/TypePredicateUtil'; export class ClientMapper { static get CONFIG() { diff --git a/src/script/client/ClientRepository.test.ts b/src/script/repositories/client/ClientRepository.test.ts similarity index 97% rename from src/script/client/ClientRepository.test.ts rename to src/script/repositories/client/ClientRepository.test.ts index 32ebda094ed..4fbd2f75f96 100644 --- a/src/script/client/ClientRepository.test.ts +++ b/src/script/repositories/client/ClientRepository.test.ts @@ -22,13 +22,14 @@ import {StatusCodes as HTTP_STATUS} from 'http-status-codes'; import {Runtime} from '@wireapp/commons'; -import {ClientRepository, ClientMapper, ClientEntity} from 'src/script/client'; import {User} from 'src/script/entity/User'; import {ClientError} from 'src/script/error/ClientError'; -import {entities} from '../../../test/api/payloads'; -import {TestFactory} from '../../../test/helper/TestFactory'; -import {ClientRecord} from '../storage/record/ClientRecord'; +import {ClientRepository, ClientMapper, ClientEntity} from './.'; + +import {entities} from '../../../../test/api/payloads'; +import {TestFactory} from '../../../../test/helper/TestFactory'; +import {ClientRecord} from '../../storage/record/ClientRecord'; describe('ClientRepository', () => { const testFactory = new TestFactory(); diff --git a/src/script/client/ClientRepository.ts b/src/script/repositories/client/ClientRepository.ts similarity index 98% rename from src/script/client/ClientRepository.ts rename to src/script/repositories/client/ClientRepository.ts index 6cc0b5da324..7423a2da569 100644 --- a/src/script/client/ClientRepository.ts +++ b/src/script/repositories/client/ClientRepository.ts @@ -29,6 +29,7 @@ import {container} from 'tsyringe'; import {Runtime} from '@wireapp/commons'; import {WebAppEvents} from '@wireapp/webapp-events'; +import {PrimaryModal} from 'Components/Modals/PrimaryModal'; import {t} from 'Util/LocalizerUtil'; import {getLogger, Logger} from 'Util/Logger'; import {matchQualifiedIds} from 'Util/QualifiedId'; @@ -41,14 +42,13 @@ import type {ClientService} from './ClientService'; import {ClientState} from './ClientState'; import {isClientMLSCapable, wasClientActiveWithinLast4Weeks} from './ClientUtils'; -import {SIGN_OUT_REASON} from '../auth/SignOutReason'; -import {PrimaryModal} from '../components/Modals/PrimaryModal'; -import type {CryptographyRepository} from '../cryptography/CryptographyRepository'; -import type {User} from '../entity/User'; -import {ClientError} from '../error/ClientError'; -import {Core} from '../service/CoreSingleton'; -import {ClientRecord} from '../storage'; -import {StorageKey} from '../storage/StorageKey'; +import {SIGN_OUT_REASON} from '../../auth/SignOutReason'; +import type {CryptographyRepository} from '../../cryptography/CryptographyRepository'; +import type {User} from '../../entity/User'; +import {ClientError} from '../../error/ClientError'; +import {Core} from '../../service/CoreSingleton'; +import {ClientRecord} from '../../storage'; +import {StorageKey} from '../../storage/StorageKey'; export type UserClientEntityMap = {[userId: string]: ClientEntity[]}; export type QualifiedUserClientEntityMap = {[domain: string]: UserClientEntityMap}; diff --git a/src/script/client/ClientService.ts b/src/script/repositories/client/ClientService.ts similarity index 96% rename from src/script/client/ClientService.ts rename to src/script/repositories/client/ClientService.ts index edc3cae5f96..bffbccf4309 100644 --- a/src/script/client/ClientService.ts +++ b/src/script/repositories/client/ClientService.ts @@ -21,10 +21,10 @@ import type {RegisteredClient, QualifiedUserClientMap, ClientCapabilityData} fro import type {QualifiedId} from '@wireapp/api-client/lib/user'; import {container} from 'tsyringe'; -import {APIClient} from '../service/APIClientSingleton'; -import type {ClientRecord} from '../storage'; -import {StorageService} from '../storage'; -import {StorageSchemata} from '../storage/StorageSchemata'; +import {APIClient} from '../../service/APIClientSingleton'; +import type {ClientRecord} from '../../storage'; +import {StorageService} from '../../storage'; +import {StorageSchemata} from '../../storage/StorageSchemata'; export class ClientService { private readonly CLIENT_STORE_NAME: string; diff --git a/src/script/client/ClientState.ts b/src/script/repositories/client/ClientState.ts similarity index 100% rename from src/script/client/ClientState.ts rename to src/script/repositories/client/ClientState.ts diff --git a/src/script/client/ClientUtils.test.ts b/src/script/repositories/client/ClientUtils.test.ts similarity index 100% rename from src/script/client/ClientUtils.test.ts rename to src/script/repositories/client/ClientUtils.test.ts diff --git a/src/script/client/ClientUtils.ts b/src/script/repositories/client/ClientUtils.ts similarity index 100% rename from src/script/client/ClientUtils.ts rename to src/script/repositories/client/ClientUtils.ts diff --git a/src/script/client/clientMLSConfig.ts b/src/script/repositories/client/clientMLSConfig.ts similarity index 82% rename from src/script/client/clientMLSConfig.ts rename to src/script/repositories/client/clientMLSConfig.ts index 7696c66ca7e..0cb9ccb08bf 100644 --- a/src/script/client/clientMLSConfig.ts +++ b/src/script/repositories/client/clientMLSConfig.ts @@ -19,9 +19,9 @@ import {FeatureList} from '@wireapp/api-client/lib/team'; -import {Config} from '../Config'; -import {getE2EIConfig} from '../page/components/FeatureConfigChange/FeatureConfigChangeHandler/Features/E2EIdentity'; -import {getMLSConfig} from '../page/components/FeatureConfigChange/FeatureConfigChangeHandler/Features/MLS'; +import {Config} from '../../Config'; +import {getE2EIConfig} from '../../page/components/FeatureConfigChange/FeatureConfigChangeHandler/Features/E2EIdentity'; +import {getMLSConfig} from '../../page/components/FeatureConfigChange/FeatureConfigChangeHandler/Features/MLS'; export function getClientMLSConfig(teamFeatures: FeatureList) { const keyingMaterialUpdateThreshold = Config.getConfig().FEATURE.MLS_CONFIG_KEYING_MATERIAL_UPDATE_THRESHOLD; diff --git a/src/script/client/index.ts b/src/script/repositories/client/index.ts similarity index 100% rename from src/script/client/index.ts rename to src/script/repositories/client/index.ts diff --git a/src/script/self/SelfRepository.test.ts b/src/script/self/SelfRepository.test.ts index 88d74b899f3..874f59fa9f9 100644 --- a/src/script/self/SelfRepository.test.ts +++ b/src/script/self/SelfRepository.test.ts @@ -23,13 +23,13 @@ import {FeatureList, FeatureStatus} from '@wireapp/api-client/lib/team'; import {FEATURE_KEY} from '@wireapp/api-client/lib/team/feature'; import {container} from 'tsyringe'; +import {ClientEntity} from 'Repositories/client'; import {TestFactory} from 'test/helper/TestFactory'; import {TIME_IN_MILLIS} from 'Util/TimeUtil'; import {SelfRepository} from './SelfRepository'; import * as SelfSupportedProtocols from './SelfSupportedProtocols/SelfSupportedProtocols'; -import {ClientEntity} from '../client'; import {Core} from '../service/CoreSingleton'; const testFactory = new TestFactory(); diff --git a/src/script/self/SelfRepository.ts b/src/script/self/SelfRepository.ts index 0dedeef9b44..c4c491b1de6 100644 --- a/src/script/self/SelfRepository.ts +++ b/src/script/self/SelfRepository.ts @@ -26,13 +26,13 @@ import {container} from 'tsyringe'; import {TypedEventEmitter} from '@wireapp/commons'; import {WebAppEvents} from '@wireapp/webapp-events'; +import {ClientEntity, ClientRepository} from 'Repositories/client'; import {Logger, getLogger} from 'Util/Logger'; import {TIME_IN_MILLIS} from 'Util/TimeUtil'; import {SelfService} from './SelfService'; import {evaluateSelfSupportedProtocols} from './SelfSupportedProtocols/SelfSupportedProtocols'; -import {ClientEntity, ClientRepository} from '../client'; import {EventSource} from '../event/EventSource'; import {Core} from '../service/CoreSingleton'; import { diff --git a/src/script/user/UserRepository.test.ts b/src/script/user/UserRepository.test.ts index c33e587da66..0a1740bd78e 100644 --- a/src/script/user/UserRepository.test.ts +++ b/src/script/user/UserRepository.test.ts @@ -29,6 +29,8 @@ import {Availability} from '@wireapp/protocol-messaging'; import {WebAppEvents} from '@wireapp/webapp-events'; import {AssetRepository} from 'Repositories/assets/AssetRepository'; +import {ClientRepository} from 'Repositories/client'; +import {ClientMapper} from 'Repositories/client/ClientMapper'; import {entities} from 'test/api/payloads'; import {TestFactory} from 'test/helper/TestFactory'; import {generateAPIUser} from 'test/helper/UserGenerator'; @@ -39,8 +41,6 @@ import {UserRepository} from './UserRepository'; import {UserService} from './UserService'; import {UserState} from './UserState'; -import {ClientRepository} from '../client'; -import {ClientMapper} from '../client/ClientMapper'; import {ConnectionEntity} from '../connection/ConnectionEntity'; import {User} from '../entity/User'; import {EventRepository} from '../event/EventRepository'; diff --git a/src/script/user/UserRepository.ts b/src/script/user/UserRepository.ts index e47aa0f6382..3526e858d00 100644 --- a/src/script/user/UserRepository.ts +++ b/src/script/user/UserRepository.ts @@ -47,6 +47,9 @@ import {WebAppEvents} from '@wireapp/webapp-events'; import {useLegalHoldModalState} from 'Components/Modals/LegalHoldModal/LegalHoldModal.state'; import {mapProfileAssetsV1} from 'Repositories/assets/AssetMapper'; import {AssetRepository} from 'Repositories/assets/AssetRepository'; +import type {ClientRepository, QualifiedUserClientEntityMap} from 'Repositories/client'; +import {ClientEntity} from 'Repositories/client/ClientEntity'; +import {ClientMapper} from 'Repositories/client/ClientMapper'; import {chunk, partition} from 'Util/ArrayUtil'; import {t} from 'Util/LocalizerUtil'; import {getLogger, Logger} from 'Util/Logger'; @@ -61,9 +64,6 @@ import type {UserService} from './UserService'; import {UserState} from './UserState'; import {SIGN_OUT_REASON} from '../auth/SignOutReason'; -import type {ClientRepository, QualifiedUserClientEntityMap} from '../client'; -import {ClientEntity} from '../client/ClientEntity'; -import {ClientMapper} from '../client/ClientMapper'; import {Config} from '../Config'; import type {ConnectionEntity} from '../connection/ConnectionEntity'; import {flattenUserClientsQualifiedIds} from '../conversation/userClientsUtils'; diff --git a/src/script/util/DebugUtil.ts b/src/script/util/DebugUtil.ts index 3a6a852e809..dc37aa7cf63 100644 --- a/src/script/util/DebugUtil.ts +++ b/src/script/util/DebugUtil.ts @@ -41,14 +41,14 @@ import {showAppNotification} from 'Components/AppNotification'; import {CallingRepository} from 'Repositories/calling/CallingRepository'; import {CallState} from 'Repositories/calling/CallState'; import {Participant} from 'Repositories/calling/Participant'; +import {ClientRepository} from 'Repositories/client'; +import {ClientState} from 'Repositories/client/ClientState'; import {getLogger, Logger} from 'Util/Logger'; import {KEY} from './KeyboardUtil'; import {TIME_IN_MILLIS} from './TimeUtil'; import {createUuid} from './uuid'; -import {ClientRepository} from '../client'; -import {ClientState} from '../client/ClientState'; import {ConnectionRepository} from '../connection/ConnectionRepository'; import {ConversationRepository} from '../conversation/ConversationRepository'; import {isMLSCapableConversation} from '../conversation/ConversationSelectors'; diff --git a/src/script/view_model/ActionsViewModel.ts b/src/script/view_model/ActionsViewModel.ts index 1671c6ea595..4f9a5e6dfc4 100644 --- a/src/script/view_model/ActionsViewModel.ts +++ b/src/script/view_model/ActionsViewModel.ts @@ -26,12 +26,12 @@ import {container} from 'tsyringe'; import {WebAppEvents} from '@wireapp/webapp-events'; import {PrimaryModal, removeCurrentModal, usePrimaryModalState} from 'Components/Modals/PrimaryModal'; +import type {ClientEntity} from 'Repositories/client'; import {t} from 'Util/LocalizerUtil'; import {isBackendError} from 'Util/TypePredicateUtil'; import type {MainViewModel} from './MainViewModel'; -import type {ClientEntity} from '../client'; import type {ConnectionRepository} from '../connection/ConnectionRepository'; import type {ConversationRepository} from '../conversation/ConversationRepository'; import type {MessageRepository} from '../conversation/MessageRepository'; diff --git a/src/script/view_model/MainViewModel.ts b/src/script/view_model/MainViewModel.ts index 31d347d8d90..39634f7ed03 100644 --- a/src/script/view_model/MainViewModel.ts +++ b/src/script/view_model/MainViewModel.ts @@ -23,13 +23,13 @@ import type {AssetRepository} from 'Repositories/assets/AssetRepository'; import type {AudioRepository} from 'Repositories/audio/AudioRepository'; import type {BackupRepository} from 'Repositories/backup/BackupRepository'; import type {CallingRepository} from 'Repositories/calling/CallingRepository'; +import type {ClientRepository} from 'Repositories/client'; import {ActionsViewModel} from './ActionsViewModel'; import {CallingViewModel} from './CallingViewModel'; import {ContentViewModel} from './ContentViewModel'; import {ListViewModel} from './ListViewModel'; -import type {ClientRepository} from '../client'; import type {ConnectionRepository} from '../connection/ConnectionRepository'; import type {ConversationRepository} from '../conversation/ConversationRepository'; import type {MessageRepository} from '../conversation/MessageRepository'; diff --git a/test/helper/TestFactory.js b/test/helper/TestFactory.js index b3d6b3e215f..60a5080c9d6 100644 --- a/test/helper/TestFactory.js +++ b/test/helper/TestFactory.js @@ -31,10 +31,10 @@ import {container} from 'tsyringe'; import {AssetRepository} from 'Repositories/assets/AssetRepository'; import {AudioRepository} from 'Repositories/audio/AudioRepository'; import {CallingRepository} from 'Repositories/calling/CallingRepository'; -import {ClientEntity} from 'src/script/client/ClientEntity'; -import {ClientRepository} from 'src/script/client/ClientRepository'; -import {ClientService} from 'src/script/client/ClientService'; -import {ClientState} from 'src/script/client/ClientState'; +import {ClientEntity} from 'Repositories/client/ClientEntity'; +import {ClientRepository} from 'Repositories/client/ClientRepository'; +import {ClientService} from 'Repositories/client/ClientService'; +import {ClientState} from 'Repositories/client/ClientState'; import {ConnectionRepository} from 'src/script/connection/ConnectionRepository'; import {ConnectionService} from 'src/script/connection/ConnectionService'; import {ConversationRepository} from 'src/script/conversation/ConversationRepository'; From 6cd7a16a6ec4db10d20ab1922754a2f5cba58d55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20J=C3=B3=C5=BAwik?= Date: Wed, 30 Oct 2024 14:01:07 +0100 Subject: [PATCH 07/12] feat: Move ConnectionRepository to new folder structure (#18243) * feat: Move AudioRepository to new folder structure * feat: Move Backup & Cache Repository to new folder structure * feat: Move CallingRepository to new folder structure * feat: Move ClientRepository to new folder structure * feat: Move ConnectionRepository to new folder structure --- .../ReadOnlyConversationMessage.test.tsx | 2 +- .../components/panel/UserActions.test.tsx | 2 +- .../ConversationRepository.test.ts | 4 ++-- .../conversation/ConversationRepository.ts | 6 +++--- .../conversation/MessageRepository.test.ts | 2 +- src/script/entity/Conversation.test.ts | 2 +- src/script/entity/Conversation.ts | 2 +- src/script/entity/User/User.ts | 2 +- src/script/main/app.ts | 4 ++-- .../NotificationRepository.test.ts | 4 ++-- .../notification/NotificationRepository.ts | 2 +- .../ConversationDetails.test.tsx | 2 +- .../connection/ConnectionEntity.ts | 0 .../connection/ConnectionMapper.test.ts | 0 .../connection/ConnectionMapper.ts | 0 .../connection/ConnectionRepository.test.ts | 4 ++-- .../connection/ConnectionRepository.ts | 18 +++++++++--------- .../connection/ConnectionService.ts | 2 +- .../connection/ConnectionState.ts | 0 src/script/user/UserRepository.test.ts | 2 +- src/script/user/UserRepository.ts | 2 +- src/script/util/DebugUtil.ts | 2 +- src/script/view_model/ActionsViewModel.ts | 2 +- src/script/view_model/MainViewModel.ts | 2 +- test/helper/ConversationGenerator.ts | 2 +- test/helper/TestFactory.js | 4 ++-- 26 files changed, 37 insertions(+), 37 deletions(-) rename src/script/{ => repositories}/connection/ConnectionEntity.ts (100%) rename src/script/{ => repositories}/connection/ConnectionMapper.test.ts (100%) rename src/script/{ => repositories}/connection/ConnectionMapper.ts (100%) rename src/script/{ => repositories}/connection/ConnectionRepository.test.ts (98%) rename src/script/{ => repositories}/connection/ConnectionRepository.ts (96%) rename src/script/{ => repositories}/connection/ConnectionService.ts (97%) rename src/script/{ => repositories}/connection/ConnectionState.ts (100%) diff --git a/src/script/components/Conversation/ReadOnlyConversationMessage/ReadOnlyConversationMessage.test.tsx b/src/script/components/Conversation/ReadOnlyConversationMessage/ReadOnlyConversationMessage.test.tsx index 6b74560d771..44c525bccc5 100644 --- a/src/script/components/Conversation/ReadOnlyConversationMessage/ReadOnlyConversationMessage.test.tsx +++ b/src/script/components/Conversation/ReadOnlyConversationMessage/ReadOnlyConversationMessage.test.tsx @@ -21,8 +21,8 @@ import {render} from '@testing-library/react'; import {ConnectionStatus} from '@wireapp/api-client/lib/connection'; import {CONVERSATION_TYPE} from '@wireapp/api-client/lib/conversation'; +import {ConnectionEntity} from 'Repositories/connection/ConnectionEntity'; import {withTheme} from 'src/script/auth/util/test/TestUtil'; -import {ConnectionEntity} from 'src/script/connection/ConnectionEntity'; import {CONVERSATION_READONLY_STATE} from 'src/script/conversation/ConversationRepository'; import {Conversation} from 'src/script/entity/Conversation'; import {User} from 'src/script/entity/User'; diff --git a/src/script/components/panel/UserActions.test.tsx b/src/script/components/panel/UserActions.test.tsx index 647d5075946..e334fbe9b32 100644 --- a/src/script/components/panel/UserActions.test.tsx +++ b/src/script/components/panel/UserActions.test.tsx @@ -25,8 +25,8 @@ import ko from 'knockout'; import {container} from 'tsyringe'; import {PrimaryModalComponent} from 'Components/Modals/PrimaryModal/PrimaryModal'; +import {ConnectionEntity} from 'Repositories/connection/ConnectionEntity'; import {withTheme} from 'src/script/auth/util/test/TestUtil'; -import {ConnectionEntity} from 'src/script/connection/ConnectionEntity'; import {ConversationRoleRepository} from 'src/script/conversation/ConversationRoleRepository'; import {ConversationState} from 'src/script/conversation/ConversationState'; import {Conversation} from 'src/script/entity/Conversation'; diff --git a/src/script/conversation/ConversationRepository.test.ts b/src/script/conversation/ConversationRepository.test.ts index 25be0d3e539..034db6e91ae 100644 --- a/src/script/conversation/ConversationRepository.test.ts +++ b/src/script/conversation/ConversationRepository.test.ts @@ -52,8 +52,9 @@ import {WebAppEvents} from '@wireapp/webapp-events'; import {CallingRepository} from 'Repositories/calling/CallingRepository'; import {ClientEntity} from 'Repositories/client/ClientEntity'; +import {ConnectionEntity} from 'Repositories/connection/ConnectionEntity'; +import {ConnectionRepository} from 'Repositories/connection/ConnectionRepository'; import {Config} from 'src/script/Config'; -import {ConnectionEntity} from 'src/script/connection/ConnectionEntity'; import {ConversationDatabaseData, ConversationMapper} from 'src/script/conversation/ConversationMapper'; import {ConversationStatus} from 'src/script/conversation/ConversationStatus'; import {DeleteEvent, EventBuilder, MessageHiddenEvent} from 'src/script/conversation/EventBuilder'; @@ -82,7 +83,6 @@ import {MessageRepository} from './MessageRepository'; import {entities, payload} from '../../../test/api/payloads'; import {TestFactory} from '../../../test/helper/TestFactory'; import {generateUser} from '../../../test/helper/UserGenerator'; -import {ConnectionRepository} from '../connection/ConnectionRepository'; import {NOTIFICATION_STATE} from '../conversation/NotificationSetting'; import {EventService} from '../event/EventService'; import {SelfRepository} from '../self/SelfRepository'; diff --git a/src/script/conversation/ConversationRepository.ts b/src/script/conversation/ConversationRepository.ts index d66c4389726..75337a056ad 100644 --- a/src/script/conversation/ConversationRepository.ts +++ b/src/script/conversation/ConversationRepository.ts @@ -62,6 +62,9 @@ import {TYPING_TIMEOUT, useTypingIndicatorState} from 'Components/InputBar/compo import {AssetTransferState} from 'Repositories/assets/AssetTransferState'; import {CallingRepository} from 'Repositories/calling/CallingRepository'; import {LEAVE_CALL_REASON} from 'Repositories/calling/enum/LeaveCallReason'; +import {ConnectionEntity} from 'Repositories/connection/ConnectionEntity'; +import {ConnectionRepository} from 'Repositories/connection/ConnectionRepository'; +import {ConnectionState} from 'Repositories/connection/ConnectionState'; import {getNextItem} from 'Util/ArrayUtil'; import {allowsAllFiles, getFileExtensionOrName, isAllowedFile} from 'Util/FileTypeUtil'; import {replaceLink, t} from 'Util/LocalizerUtil'; @@ -118,9 +121,6 @@ import {NOTIFICATION_STATE} from './NotificationSetting'; import {PrimaryModal} from '../components/Modals/PrimaryModal'; import {Config} from '../Config'; -import {ConnectionEntity} from '../connection/ConnectionEntity'; -import {ConnectionRepository} from '../connection/ConnectionRepository'; -import {ConnectionState} from '../connection/ConnectionState'; import { AssetAddEvent, ButtonActionConfirmationEvent, diff --git a/src/script/conversation/MessageRepository.test.ts b/src/script/conversation/MessageRepository.test.ts index c742942d759..797aee4771a 100644 --- a/src/script/conversation/MessageRepository.test.ts +++ b/src/script/conversation/MessageRepository.test.ts @@ -29,7 +29,7 @@ import {AssetRepository} from 'Repositories/assets/AssetRepository'; import {AudioRepository} from 'Repositories/audio/AudioRepository'; import {ClientEntity} from 'Repositories/client/ClientEntity'; import {ClientState} from 'Repositories/client/ClientState'; -import {ConnectionEntity} from 'src/script/connection/ConnectionEntity'; +import {ConnectionEntity} from 'Repositories/connection/ConnectionEntity'; import {MessageRepository} from 'src/script/conversation/MessageRepository'; import {Conversation} from 'src/script/entity/Conversation'; import {Message} from 'src/script/entity/message/Message'; diff --git a/src/script/entity/Conversation.test.ts b/src/script/entity/Conversation.test.ts index 6aa85e6b549..bfdfae71963 100644 --- a/src/script/entity/Conversation.test.ts +++ b/src/script/entity/Conversation.test.ts @@ -23,7 +23,7 @@ import {ConnectionStatus} from '@wireapp/api-client/lib/connection/'; import {CONVERSATION_TYPE} from '@wireapp/api-client/lib/conversation/'; import {ClientEntity} from 'Repositories/client/ClientEntity'; -import {ConnectionMapper} from 'src/script/connection/ConnectionMapper'; +import {ConnectionMapper} from 'Repositories/connection/ConnectionMapper'; import {ConversationMapper} from 'src/script/conversation/ConversationMapper'; import {NOTIFICATION_STATE} from 'src/script/conversation/NotificationSetting'; import 'src/script/localization/Localizer'; diff --git a/src/script/entity/Conversation.ts b/src/script/entity/Conversation.ts index 36addc430f8..c575105989a 100644 --- a/src/script/entity/Conversation.ts +++ b/src/script/entity/Conversation.ts @@ -37,6 +37,7 @@ import {WebAppEvents} from '@wireapp/webapp-events'; import {useLegalHoldModalState} from 'Components/Modals/LegalHoldModal/LegalHoldModal.state'; import {ClientRepository} from 'Repositories/client'; +import {ConnectionEntity} from 'Repositories/connection/ConnectionEntity'; import {t} from 'Util/LocalizerUtil'; import {getLogger, Logger} from 'Util/Logger'; import {matchQualifiedIds} from 'Util/QualifiedId'; @@ -49,7 +50,6 @@ import {PingMessage} from './message/PingMessage'; import type {User} from './User'; import {Config} from '../Config'; -import {ConnectionEntity} from '../connection/ConnectionEntity'; import {ACCESS_STATE} from '../conversation/AccessState'; import {ConversationRepository, CONVERSATION_READONLY_STATE} from '../conversation/ConversationRepository'; import {isProteusTeam1to1Conversation, isSelfConversation} from '../conversation/ConversationSelectors'; diff --git a/src/script/entity/User/User.ts b/src/script/entity/User/User.ts index 39dbfce0ce9..bc0fc2e6ade 100644 --- a/src/script/entity/User/User.ts +++ b/src/script/entity/User/User.ts @@ -28,13 +28,13 @@ import {WebAppEvents} from '@wireapp/webapp-events'; import type {AssetRemoteData} from 'Repositories/assets/AssetRemoteData'; import type {ClientEntity} from 'Repositories/client/ClientEntity'; +import {ConnectionEntity} from 'Repositories/connection/ConnectionEntity'; import {t} from 'Util/LocalizerUtil'; import {clamp} from 'Util/NumberUtil'; import {getFirstChar} from 'Util/StringUtil'; import {TIME_IN_MILLIS} from 'Util/TimeUtil'; import {ACCENT_ID} from '../../Config'; -import {ConnectionEntity} from '../../connection/ConnectionEntity'; import {ROLE as TEAM_ROLE} from '../../user/UserPermission'; export class User { diff --git a/src/script/main/app.ts b/src/script/main/app.ts index 0671b096038..d2ea321694c 100644 --- a/src/script/main/app.ts +++ b/src/script/main/app.ts @@ -40,6 +40,8 @@ import {CacheRepository} from 'Repositories/cache/CacheRepository'; import {CallingRepository} from 'Repositories/calling/CallingRepository'; import {ClientRepository, ClientService} from 'Repositories/client'; import {getClientMLSConfig} from 'Repositories/client/clientMLSConfig'; +import {ConnectionRepository} from 'Repositories/connection/ConnectionRepository'; +import {ConnectionService} from 'Repositories/connection/ConnectionService'; import {initializeDataDog} from 'Util/DataDog'; import {DebugUtil} from 'Util/DebugUtil'; import {Environment} from 'Util/Environment'; @@ -54,8 +56,6 @@ import '../../style/default.less'; import {SIGN_OUT_REASON} from '../auth/SignOutReason'; import {URLParameter} from '../auth/URLParameter'; import {Configuration} from '../Config'; -import {ConnectionRepository} from '../connection/ConnectionRepository'; -import {ConnectionService} from '../connection/ConnectionService'; import {ConversationRepository} from '../conversation/ConversationRepository'; import {ConversationService} from '../conversation/ConversationService'; import {ConversationVerificationState} from '../conversation/ConversationVerificationState'; diff --git a/src/script/notification/NotificationRepository.test.ts b/src/script/notification/NotificationRepository.test.ts index f90fb196b41..1f36487a212 100644 --- a/src/script/notification/NotificationRepository.test.ts +++ b/src/script/notification/NotificationRepository.test.ts @@ -32,7 +32,8 @@ import {AudioRepository} from 'Repositories/audio/AudioRepository'; import {CallingRepository} from 'Repositories/calling/CallingRepository'; import {CallingViewMode, CallState} from 'Repositories/calling/CallState'; import {TERMINATION_REASON} from 'Repositories/calling/enum/TerminationReason'; -import {ConnectionMapper} from 'src/script/connection/ConnectionMapper'; +import {ConnectionEntity} from 'Repositories/connection/ConnectionEntity'; +import {ConnectionMapper} from 'Repositories/connection/ConnectionMapper'; import {ConversationMapper} from 'src/script/conversation/ConversationMapper'; import {NOTIFICATION_STATE} from 'src/script/conversation/NotificationSetting'; import {Conversation} from 'src/script/entity/Conversation'; @@ -62,7 +63,6 @@ import {createUuid} from 'Util/uuid'; import {NotificationRepository} from './NotificationRepository'; -import {ConnectionEntity} from '../connection/ConnectionEntity'; import {ConversationState} from '../conversation/ConversationState'; import {Message} from '../entity/message/Message'; import {PermissionRepository} from '../permission/PermissionRepository'; diff --git a/src/script/notification/NotificationRepository.ts b/src/script/notification/NotificationRepository.ts index a32fe54194d..eba2070e32f 100644 --- a/src/script/notification/NotificationRepository.ts +++ b/src/script/notification/NotificationRepository.ts @@ -33,6 +33,7 @@ import {AudioType} from 'Repositories/audio/AudioType'; import {CallingRepository} from 'Repositories/calling/CallingRepository'; import {CallingViewMode, CallState} from 'Repositories/calling/CallState'; import {TERMINATION_REASON} from 'Repositories/calling/enum/TerminationReason'; +import type {ConnectionEntity} from 'Repositories/connection/ConnectionEntity'; import {Declension, t, getUserName} from 'Util/LocalizerUtil'; import {getLogger, Logger} from 'Util/Logger'; import {getRenderedTextContent} from 'Util/messageRenderer'; @@ -42,7 +43,6 @@ import {ValidationUtilError} from 'Util/ValidationUtil'; import {PermissionState} from './PermissionState'; -import type {ConnectionEntity} from '../connection/ConnectionEntity'; import {ConversationEphemeralHandler} from '../conversation/ConversationEphemeralHandler'; import type {ConversationRepository} from '../conversation/ConversationRepository'; import {ConversationState} from '../conversation/ConversationState'; diff --git a/src/script/page/RightSidebar/ConversationDetails/ConversationDetails.test.tsx b/src/script/page/RightSidebar/ConversationDetails/ConversationDetails.test.tsx index d5c079de537..952167a4afc 100644 --- a/src/script/page/RightSidebar/ConversationDetails/ConversationDetails.test.tsx +++ b/src/script/page/RightSidebar/ConversationDetails/ConversationDetails.test.tsx @@ -20,13 +20,13 @@ import {act, render} from '@testing-library/react'; import {CONVERSATION_TYPE} from '@wireapp/api-client/lib/conversation'; +import {ConnectionRepository} from 'Repositories/connection/ConnectionRepository'; import {Conversation} from 'src/script/entity/Conversation'; import {createUuid} from 'Util/uuid'; import {ConversationDetails} from './ConversationDetails'; import {TestFactory} from '../../../../../test/helper/TestFactory'; -import {ConnectionRepository} from '../../../connection/ConnectionRepository'; import {ConversationRepository} from '../../../conversation/ConversationRepository'; import {ConversationRoleRepository} from '../../../conversation/ConversationRoleRepository'; import {MessageRepository} from '../../../conversation/MessageRepository'; diff --git a/src/script/connection/ConnectionEntity.ts b/src/script/repositories/connection/ConnectionEntity.ts similarity index 100% rename from src/script/connection/ConnectionEntity.ts rename to src/script/repositories/connection/ConnectionEntity.ts diff --git a/src/script/connection/ConnectionMapper.test.ts b/src/script/repositories/connection/ConnectionMapper.test.ts similarity index 100% rename from src/script/connection/ConnectionMapper.test.ts rename to src/script/repositories/connection/ConnectionMapper.test.ts diff --git a/src/script/connection/ConnectionMapper.ts b/src/script/repositories/connection/ConnectionMapper.ts similarity index 100% rename from src/script/connection/ConnectionMapper.ts rename to src/script/repositories/connection/ConnectionMapper.ts diff --git a/src/script/connection/ConnectionRepository.test.ts b/src/script/repositories/connection/ConnectionRepository.test.ts similarity index 98% rename from src/script/connection/ConnectionRepository.test.ts rename to src/script/repositories/connection/ConnectionRepository.test.ts index e74cd2a33ff..85996a60420 100644 --- a/src/script/connection/ConnectionRepository.test.ts +++ b/src/script/repositories/connection/ConnectionRepository.test.ts @@ -33,8 +33,8 @@ import {ConnectionRepository} from './ConnectionRepository'; import {ConnectionService} from './ConnectionService'; import {ConnectionState} from './ConnectionState'; -import {Conversation} from '../entity/Conversation'; -import {UserRepository} from '../user/UserRepository'; +import {Conversation} from '../../entity/Conversation'; +import {UserRepository} from '../../user/UserRepository'; function buildConnectionRepository() { const connectionState = new ConnectionState(); diff --git a/src/script/connection/ConnectionRepository.ts b/src/script/repositories/connection/ConnectionRepository.ts similarity index 96% rename from src/script/connection/ConnectionRepository.ts rename to src/script/repositories/connection/ConnectionRepository.ts index 48bfd671386..3a4abbd0c93 100644 --- a/src/script/connection/ConnectionRepository.ts +++ b/src/script/repositories/connection/ConnectionRepository.ts @@ -28,6 +28,7 @@ import {container} from 'tsyringe'; import {WebAppEvents} from '@wireapp/webapp-events'; +import {PrimaryModal} from 'Components/Modals/PrimaryModal'; import {replaceLink, t} from 'Util/LocalizerUtil'; import {getLogger, Logger} from 'Util/Logger'; import {matchQualifiedIds} from 'Util/QualifiedId'; @@ -38,15 +39,14 @@ import {ConnectionMapper} from './ConnectionMapper'; import type {ConnectionService} from './ConnectionService'; import {ConnectionState} from './ConnectionState'; -import {PrimaryModal} from '../components/Modals/PrimaryModal'; -import {Config} from '../Config'; -import type {Conversation} from '../entity/Conversation'; -import {MemberMessage} from '../entity/message/MemberMessage'; -import type {User} from '../entity/User'; -import {EventRepository} from '../event/EventRepository'; -import type {EventSource} from '../event/EventSource'; -import {SystemMessageType} from '../message/SystemMessageType'; -import type {UserRepository} from '../user/UserRepository'; +import {Config} from '../../Config'; +import type {Conversation} from '../../entity/Conversation'; +import {MemberMessage} from '../../entity/message/MemberMessage'; +import type {User} from '../../entity/User'; +import {EventRepository} from '../../event/EventRepository'; +import type {EventSource} from '../../event/EventSource'; +import {SystemMessageType} from '../../message/SystemMessageType'; +import type {UserRepository} from '../../user/UserRepository'; export class ConnectionRepository { private readonly connectionService: ConnectionService; diff --git a/src/script/connection/ConnectionService.ts b/src/script/repositories/connection/ConnectionService.ts similarity index 97% rename from src/script/connection/ConnectionService.ts rename to src/script/repositories/connection/ConnectionService.ts index 6e1274edcc2..b61d094b263 100644 --- a/src/script/connection/ConnectionService.ts +++ b/src/script/repositories/connection/ConnectionService.ts @@ -21,7 +21,7 @@ import type {Connection, ConnectionStatus} from '@wireapp/api-client/lib/connect import {QualifiedId} from '@wireapp/api-client/lib/user'; import {container} from 'tsyringe'; -import {APIClient} from '../service/APIClientSingleton'; +import {APIClient} from '../../service/APIClientSingleton'; export class ConnectionService { constructor(private readonly apiClient = container.resolve(APIClient)) {} diff --git a/src/script/connection/ConnectionState.ts b/src/script/repositories/connection/ConnectionState.ts similarity index 100% rename from src/script/connection/ConnectionState.ts rename to src/script/repositories/connection/ConnectionState.ts diff --git a/src/script/user/UserRepository.test.ts b/src/script/user/UserRepository.test.ts index 0a1740bd78e..023d246dd9b 100644 --- a/src/script/user/UserRepository.test.ts +++ b/src/script/user/UserRepository.test.ts @@ -31,6 +31,7 @@ import {WebAppEvents} from '@wireapp/webapp-events'; import {AssetRepository} from 'Repositories/assets/AssetRepository'; import {ClientRepository} from 'Repositories/client'; import {ClientMapper} from 'Repositories/client/ClientMapper'; +import {ConnectionEntity} from 'Repositories/connection/ConnectionEntity'; import {entities} from 'test/api/payloads'; import {TestFactory} from 'test/helper/TestFactory'; import {generateAPIUser} from 'test/helper/UserGenerator'; @@ -41,7 +42,6 @@ import {UserRepository} from './UserRepository'; import {UserService} from './UserService'; import {UserState} from './UserState'; -import {ConnectionEntity} from '../connection/ConnectionEntity'; import {User} from '../entity/User'; import {EventRepository} from '../event/EventRepository'; import {PropertiesRepository} from '../properties/PropertiesRepository'; diff --git a/src/script/user/UserRepository.ts b/src/script/user/UserRepository.ts index 3526e858d00..48b2c4efb79 100644 --- a/src/script/user/UserRepository.ts +++ b/src/script/user/UserRepository.ts @@ -50,6 +50,7 @@ import {AssetRepository} from 'Repositories/assets/AssetRepository'; import type {ClientRepository, QualifiedUserClientEntityMap} from 'Repositories/client'; import {ClientEntity} from 'Repositories/client/ClientEntity'; import {ClientMapper} from 'Repositories/client/ClientMapper'; +import type {ConnectionEntity} from 'Repositories/connection/ConnectionEntity'; import {chunk, partition} from 'Util/ArrayUtil'; import {t} from 'Util/LocalizerUtil'; import {getLogger, Logger} from 'Util/Logger'; @@ -65,7 +66,6 @@ import {UserState} from './UserState'; import {SIGN_OUT_REASON} from '../auth/SignOutReason'; import {Config} from '../Config'; -import type {ConnectionEntity} from '../connection/ConnectionEntity'; import {flattenUserClientsQualifiedIds} from '../conversation/userClientsUtils'; import {Conversation} from '../entity/Conversation'; import {User} from '../entity/User'; diff --git a/src/script/util/DebugUtil.ts b/src/script/util/DebugUtil.ts index dc37aa7cf63..1593aae38d9 100644 --- a/src/script/util/DebugUtil.ts +++ b/src/script/util/DebugUtil.ts @@ -43,13 +43,13 @@ import {CallState} from 'Repositories/calling/CallState'; import {Participant} from 'Repositories/calling/Participant'; import {ClientRepository} from 'Repositories/client'; import {ClientState} from 'Repositories/client/ClientState'; +import {ConnectionRepository} from 'Repositories/connection/ConnectionRepository'; import {getLogger, Logger} from 'Util/Logger'; import {KEY} from './KeyboardUtil'; import {TIME_IN_MILLIS} from './TimeUtil'; import {createUuid} from './uuid'; -import {ConnectionRepository} from '../connection/ConnectionRepository'; import {ConversationRepository} from '../conversation/ConversationRepository'; import {isMLSCapableConversation} from '../conversation/ConversationSelectors'; import {ConversationState} from '../conversation/ConversationState'; diff --git a/src/script/view_model/ActionsViewModel.ts b/src/script/view_model/ActionsViewModel.ts index 4f9a5e6dfc4..f4e1025a4fa 100644 --- a/src/script/view_model/ActionsViewModel.ts +++ b/src/script/view_model/ActionsViewModel.ts @@ -27,12 +27,12 @@ import {WebAppEvents} from '@wireapp/webapp-events'; import {PrimaryModal, removeCurrentModal, usePrimaryModalState} from 'Components/Modals/PrimaryModal'; import type {ClientEntity} from 'Repositories/client'; +import type {ConnectionRepository} from 'Repositories/connection/ConnectionRepository'; import {t} from 'Util/LocalizerUtil'; import {isBackendError} from 'Util/TypePredicateUtil'; import type {MainViewModel} from './MainViewModel'; -import type {ConnectionRepository} from '../connection/ConnectionRepository'; import type {ConversationRepository} from '../conversation/ConversationRepository'; import type {MessageRepository} from '../conversation/MessageRepository'; import {NOTIFICATION_STATE} from '../conversation/NotificationSetting'; diff --git a/src/script/view_model/MainViewModel.ts b/src/script/view_model/MainViewModel.ts index 39634f7ed03..8132904edb5 100644 --- a/src/script/view_model/MainViewModel.ts +++ b/src/script/view_model/MainViewModel.ts @@ -24,13 +24,13 @@ import type {AudioRepository} from 'Repositories/audio/AudioRepository'; import type {BackupRepository} from 'Repositories/backup/BackupRepository'; import type {CallingRepository} from 'Repositories/calling/CallingRepository'; import type {ClientRepository} from 'Repositories/client'; +import type {ConnectionRepository} from 'Repositories/connection/ConnectionRepository'; import {ActionsViewModel} from './ActionsViewModel'; import {CallingViewModel} from './CallingViewModel'; import {ContentViewModel} from './ContentViewModel'; import {ListViewModel} from './ListViewModel'; -import type {ConnectionRepository} from '../connection/ConnectionRepository'; import type {ConversationRepository} from '../conversation/ConversationRepository'; import type {MessageRepository} from '../conversation/MessageRepository'; import type {CryptographyRepository} from '../cryptography/CryptographyRepository'; diff --git a/test/helper/ConversationGenerator.ts b/test/helper/ConversationGenerator.ts index fdae535969f..ae5d1457717 100644 --- a/test/helper/ConversationGenerator.ts +++ b/test/helper/ConversationGenerator.ts @@ -29,7 +29,7 @@ import {ConversationProtocol} from '@wireapp/api-client/lib/conversation/NewConv import {QualifiedId} from '@wireapp/api-client/lib/user'; import {LegalHoldStatus} from '@wireapp/core/lib/conversation/content'; -import {ConnectionEntity} from 'src/script/connection/ConnectionEntity'; +import {ConnectionEntity} from 'Repositories/connection/ConnectionEntity'; import {ConversationDatabaseData, ConversationMapper} from 'src/script/conversation/ConversationMapper'; import {ConversationStatus} from 'src/script/conversation/ConversationStatus'; import {ConversationVerificationState} from 'src/script/conversation/ConversationVerificationState'; diff --git a/test/helper/TestFactory.js b/test/helper/TestFactory.js index 60a5080c9d6..f91d235aa1f 100644 --- a/test/helper/TestFactory.js +++ b/test/helper/TestFactory.js @@ -35,8 +35,8 @@ import {ClientEntity} from 'Repositories/client/ClientEntity'; import {ClientRepository} from 'Repositories/client/ClientRepository'; import {ClientService} from 'Repositories/client/ClientService'; import {ClientState} from 'Repositories/client/ClientState'; -import {ConnectionRepository} from 'src/script/connection/ConnectionRepository'; -import {ConnectionService} from 'src/script/connection/ConnectionService'; +import {ConnectionRepository} from 'Repositories/connection/ConnectionRepository'; +import {ConnectionService} from 'Repositories/connection/ConnectionService'; import {ConversationRepository} from 'src/script/conversation/ConversationRepository'; import {ConversationService} from 'src/script/conversation/ConversationService'; import {ConversationState} from 'src/script/conversation/ConversationState'; From 05442dddd9b321b6c5c686cd557feda67a11f0c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20J=C3=B3=C5=BAwik?= Date: Thu, 31 Oct 2024 09:10:30 +0100 Subject: [PATCH 08/12] feat: Move ConversationRepository to new folder structure (#18244) --- .../E2EIdentity/E2EIdentityEnrollment.test.ts | 2 +- .../E2EIdentity/E2EIdentityVerification.ts | 3 +- .../VerificationBadges/VerificationBadges.tsx | 4 +- .../ConfigToolbar/ConfigToolbar.tsx | 2 +- .../components/Conversation/Conversation.tsx | 2 +- .../ReadOnlyConversationMessage.test.tsx | 2 +- .../ReadOnlyConversationMessage.tsx | 2 +- .../Conversation/hooks/useReadReceipt.ts | 2 +- .../ConversationListCell.tsx | 2 +- .../components/StatusIcon/StatusIcon.tsx | 4 +- .../components/InputBar/InputBar.test.tsx | 4 +- src/script/components/InputBar/InputBar.tsx | 6 +- .../InputBar/util/DraftStateUtil.ts | 3 +- .../MessagesList/Message/LegalHoldMessage.tsx | 2 +- .../MessagesList/Message/MessageWrapper.tsx | 2 +- .../components/MessagesList/Message/index.tsx | 2 +- .../components/MessagesList/MessageList.tsx | 4 +- .../MessagesList/utils/messagesGroup.test.ts | 2 +- .../DetailViewModal/DetailViewModalFooter.tsx | 2 +- .../Modals/DetailViewModal/index.tsx | 4 +- .../GroupCreation/GroupCreationModal.tsx | 14 +-- .../LegalHoldModal/LegalHoldModal.test.tsx | 4 +- .../Modals/LegalHoldModal/LegalHoldModal.tsx | 4 +- .../components/TitleBar/TitleBar.test.tsx | 2 +- src/script/components/TitleBar/TitleBar.tsx | 2 +- .../components/UserDevices/UserDevices.tsx | 4 +- .../DeviceDetails/DeviceDetails.tsx | 6 +- .../components/UserList/UserList.test.tsx | 2 +- src/script/components/UserList/UserList.tsx | 4 +- .../UserSearchableList/UserSearchableList.tsx | 2 +- .../components/panel/UserActions.test.tsx | 4 +- src/script/components/panel/UserActions.tsx | 6 +- src/script/cryptography/CryptographyMapper.ts | 4 +- src/script/entity/Conversation.test.ts | 4 +- src/script/entity/Conversation.ts | 12 +-- .../message/MessageTimerUpdateMessage.ts | 2 +- src/script/entity/message/Text.ts | 2 +- src/script/event/EventProcessor.ts | 4 +- src/script/event/EventRepository.test.ts | 2 +- src/script/event/EventRepository.ts | 2 +- src/script/event/EventTypeHandling.ts | 4 +- .../EventStorageMiddleware.test.ts | 2 +- .../EventStorageMiddleware.ts | 2 +- .../eventHandlers/assetEventHandler.ts | 2 +- .../eventHandlers/editedEventHandler.ts | 2 +- .../eventHandlers/getCommonMessageUpdates.ts | 2 +- .../eventHandlers/linkPreviewEventHandler.ts | 2 +- .../eventHandlers/reactionEventHandler.ts | 2 +- .../EventStorageMiddleware/types.ts | 2 +- .../preprocessor/QuoteDecoderMiddleware.ts | 2 +- .../preprocessor/ReceiptsMiddleware.test.ts | 2 +- .../event/preprocessor/ReceiptsMiddleware.ts | 4 +- .../preprocessor/RepliesUpdaterMiddleware.ts | 2 +- .../preprocessor/ServiceMiddleware.test.ts | 4 +- .../event/preprocessor/ServiceMiddleware.ts | 4 +- .../FederationEventProcessor.ts | 6 +- .../integration/IntegrationRepository.ts | 6 +- src/script/legal-hold/LegalHoldWarning.ts | 4 +- src/script/main/app.ts | 12 +-- src/script/mls/MLSConversations.test.ts | 3 +- src/script/mls/MLSConversations.ts | 3 +- ...rsationsAfterMigrationFinalisation.test.ts | 2 +- ...ConversationsAfterMigrationFinalisation.ts | 2 +- .../migrationFinaliser.test.ts | 2 +- .../migrationFinaliser/migrationFinaliser.ts | 6 +- ...oinUnestablishedMixedConversations.test.ts | 2 +- .../joinUnestablishedMixedConversations.ts | 2 +- .../migrationInitialiser.test.ts | 2 +- .../migrationInitialiser.ts | 2 +- .../NotificationRepository.test.ts | 6 +- .../notification/NotificationRepository.ts | 6 +- src/script/page/AppMain.tsx | 6 +- .../ConversationHeader/ConversationHeader.tsx | 2 +- .../ConversationSidebar.tsx | 4 +- .../ConversationFolderTab.test.tsx | 2 +- .../ConversationTab/ConversationFolderTab.tsx | 4 +- .../ConversationTabs/ConversationTabs.tsx | 2 +- .../Conversations/Conversations.test.tsx | 2 +- .../panels/Conversations/Conversations.tsx | 8 +- .../Conversations/ConversationsList.test.tsx | 4 +- .../Conversations/ConversationsList.tsx | 4 +- .../GroupedConversationHeader.tsx | 3 +- .../getGroupParticipantsConversation.ts | 4 +- .../LeftSidebar/panels/StartUI/PeopleTab.tsx | 4 +- .../LeftSidebar/panels/StartUI/StartUI.tsx | 4 +- src/script/page/MainContent/MainContent.tsx | 2 +- .../panels/Collection/Collection.test.tsx | 2 +- .../panels/Collection/Collection.tsx | 4 +- .../panels/preferences/AccountPreferences.tsx | 4 +- .../DevicesPreference.test.tsx | 2 +- .../DevicesPreferences/DevicesPreference.tsx | 2 +- .../AddParticipants/AddParticipants.tsx | 2 +- .../ConversationDetails.test.tsx | 6 +- .../ConversationDetails.tsx | 6 +- .../ConversationDetailsHeader.tsx | 2 +- .../ConversationDetailsOptions.tsx | 6 +- .../ConversationDetailsParticipants.tsx | 2 +- .../components/GroupDetails/GroupDetails.tsx | 2 +- .../utils/getConversationActions.ts | 2 +- .../ConversationParticipants.tsx | 2 +- .../GroupParticipantUser.tsx | 4 +- .../GuestServicesOptions.test.tsx | 4 +- .../GuestServicesOptions.tsx | 4 +- .../components/GuestOptions/GuestOptions.tsx | 6 +- .../ServicesOptions/ServicesOptions.tsx | 2 +- .../MessageDetails/MessageDetails.test.tsx | 2 +- .../MessageDetails/MessageDetails.tsx | 2 +- .../Notifications/Notifications.test.tsx | 4 +- .../Notifications/Notifications.tsx | 2 +- src/script/page/RightSidebar/RightSidebar.tsx | 2 +- .../page/components/WindowTitleUpdater.ts | 2 +- .../repositories/backup/BackupRepository.ts | 4 +- .../repositories/calling/CallingRepository.ts | 12 +-- .../AbstractConversationEventHandler.ts | 2 +- .../conversation/AccessState.ts | 0 .../conversation/ClientMismatchUtil.test.ts | 2 +- .../conversation/ClientMismatchUtil.ts | 2 +- .../ConversationAccessPermission.test.ts | 0 .../ConversationAccessPermission.ts | 2 +- .../ConversationCellState.test.ts | 11 +-- .../conversation/ConversationCellState.ts | 14 +-- .../ConversationEphemeralHandler.ts | 18 ++-- .../conversation/ConversationFilter.test.ts | 2 +- .../conversation/ConversationFilter.ts | 4 +- .../ConversationLabelRepository.ts | 6 +- .../conversation/ConversationMapper.test.ts | 12 +-- .../conversation/ConversationMapper.ts | 8 +- .../ConversationRepository.test.ts | 32 +++---- .../conversation/ConversationRepository.ts | 74 ++++++++-------- .../ConversationRoleRepository.test.ts | 8 +- .../ConversationRoleRepository.ts | 10 +-- .../conversation/ConversationSelectors.ts | 2 +- .../conversation/ConversationService.ts | 18 ++-- .../conversation/ConversationState.test.ts | 6 +- .../conversation/ConversationState.ts | 8 +- .../conversation/ConversationStateHandler.ts | 4 +- .../conversation/ConversationStatus.ts | 0 .../conversation/ConversationStatusIcon.ts | 0 .../ConversationVerificationState.ts | 0 .../MLS/MLSStateHandler.test.ts | 0 .../MLS/MLSStateHandler.ts | 0 .../MLS/index.ts | 0 .../Proteus/ProteusStateHandler.test.ts | 6 +- .../Proteus/ProteusStateHandler.ts | 0 .../Proteus/index.ts | 0 .../index.ts | 0 .../shared/changeHandler/index.ts | 4 +- .../shared/conversation/index.ts | 7 +- .../shared/index.ts | 0 .../conversation/EventBuilder.test.ts | 7 +- .../conversation/EventBuilder.ts | 16 ++-- .../conversation/EventMapper.test.ts | 0 .../conversation/EventMapper.ts | 86 +++++++++---------- .../conversation/MessageRepository.test.ts | 26 +++--- .../conversation/MessageRepository.ts | 62 ++++++------- .../conversation/NotificationSetting.ts | 0 .../linkPreviews/LinkPreviewError.ts | 2 +- .../linkPreviews/blackList.test.ts | 0 .../conversation/linkPreviews/blackList.ts | 0 .../conversation/linkPreviews/helpers.test.ts | 0 .../conversation/linkPreviews/helpers.ts | 0 .../conversation/linkPreviews/index.test.ts | 0 .../conversation/linkPreviews/index.ts | 2 +- .../conversation/userClientsUtils.test.ts | 0 .../conversation/userClientsUtils.ts | 0 .../storage/record/ConversationRecord.ts | 7 +- src/script/storage/record/EventRecord.ts | 2 +- .../tracking/EventTrackingRepository.ts | 2 +- src/script/tracking/countly-skd-web.d.ts | 4 +- src/script/ui/LabelContextMenu.ts | 2 +- src/script/user/UserRepository.ts | 2 +- src/script/util/DebugUtil.ts | 8 +- src/script/view_model/ActionsViewModel.ts | 6 +- src/script/view_model/CallingViewModel.ts | 6 +- src/script/view_model/ContentViewModel.ts | 6 +- src/script/view_model/ListViewModel.ts | 4 +- src/script/view_model/MainViewModel.ts | 4 +- test/helper/ConversationGenerator.ts | 6 +- test/helper/EventGenerator.ts | 2 +- test/helper/TestFactory.js | 8 +- .../ConversationEphemeralHandlerSpec.js | 2 +- .../conversation/ConversationLabelSpec.js | 2 +- .../conversation/ConversationServiceSpec.js | 2 +- 183 files changed, 468 insertions(+), 465 deletions(-) rename src/script/{ => repositories}/conversation/AbstractConversationEventHandler.ts (97%) rename src/script/{ => repositories}/conversation/AccessState.ts (100%) rename src/script/{ => repositories}/conversation/ClientMismatchUtil.test.ts (99%) rename src/script/{ => repositories}/conversation/ClientMismatchUtil.ts (99%) rename src/script/{ => repositories}/conversation/ConversationAccessPermission.test.ts (100%) rename src/script/{ => repositories}/conversation/ConversationAccessPermission.ts (98%) rename src/script/{ => repositories}/conversation/ConversationCellState.test.ts (93%) rename src/script/{ => repositories}/conversation/ConversationCellState.ts (97%) rename src/script/{ => repositories}/conversation/ConversationEphemeralHandler.ts (95%) rename src/script/{ => repositories}/conversation/ConversationFilter.test.ts (99%) rename src/script/{ => repositories}/conversation/ConversationFilter.ts (92%) rename src/script/{ => repositories}/conversation/ConversationLabelRepository.ts (98%) rename src/script/{ => repositories}/conversation/ConversationMapper.test.ts (99%) rename src/script/{ => repositories}/conversation/ConversationMapper.ts (98%) rename src/script/{ => repositories}/conversation/ConversationRepository.test.ts (99%) rename src/script/{ => repositories}/conversation/ConversationRepository.ts (98%) rename src/script/{ => repositories}/conversation/ConversationRoleRepository.test.ts (93%) rename src/script/{ => repositories}/conversation/ConversationRoleRepository.ts (96%) rename src/script/{ => repositories}/conversation/ConversationSelectors.ts (99%) rename src/script/{ => repositories}/conversation/ConversationService.ts (96%) rename src/script/{ => repositories}/conversation/ConversationState.test.ts (97%) rename src/script/{ => repositories}/conversation/ConversationState.ts (98%) rename src/script/{ => repositories}/conversation/ConversationStateHandler.ts (98%) rename src/script/{ => repositories}/conversation/ConversationStatus.ts (100%) rename src/script/{ => repositories}/conversation/ConversationStatusIcon.ts (100%) rename src/script/{ => repositories}/conversation/ConversationVerificationState.ts (100%) rename src/script/{ => repositories}/conversation/ConversationVerificationStateHandler/MLS/MLSStateHandler.test.ts (100%) rename src/script/{ => repositories}/conversation/ConversationVerificationStateHandler/MLS/MLSStateHandler.ts (100%) rename src/script/{ => repositories}/conversation/ConversationVerificationStateHandler/MLS/index.ts (100%) rename src/script/{ => repositories}/conversation/ConversationVerificationStateHandler/Proteus/ProteusStateHandler.test.ts (98%) rename src/script/{ => repositories}/conversation/ConversationVerificationStateHandler/Proteus/ProteusStateHandler.ts (100%) rename src/script/{ => repositories}/conversation/ConversationVerificationStateHandler/Proteus/index.ts (100%) rename src/script/{ => repositories}/conversation/ConversationVerificationStateHandler/index.ts (100%) rename src/script/{ => repositories}/conversation/ConversationVerificationStateHandler/shared/changeHandler/index.ts (89%) rename src/script/{ => repositories}/conversation/ConversationVerificationStateHandler/shared/conversation/index.ts (95%) rename src/script/{ => repositories}/conversation/ConversationVerificationStateHandler/shared/index.ts (100%) rename src/script/{ => repositories}/conversation/EventBuilder.test.ts (94%) rename src/script/{ => repositories}/conversation/EventBuilder.ts (97%) rename src/script/{ => repositories}/conversation/EventMapper.test.ts (100%) rename src/script/{ => repositories}/conversation/EventMapper.ts (91%) rename src/script/{ => repositories}/conversation/MessageRepository.test.ts (95%) rename src/script/{ => repositories}/conversation/MessageRepository.ts (96%) rename src/script/{ => repositories}/conversation/NotificationSetting.ts (100%) rename src/script/{ => repositories}/conversation/linkPreviews/LinkPreviewError.ts (97%) rename src/script/{ => repositories}/conversation/linkPreviews/blackList.test.ts (100%) rename src/script/{ => repositories}/conversation/linkPreviews/blackList.ts (100%) rename src/script/{ => repositories}/conversation/linkPreviews/helpers.test.ts (100%) rename src/script/{ => repositories}/conversation/linkPreviews/helpers.ts (100%) rename src/script/{ => repositories}/conversation/linkPreviews/index.test.ts (100%) rename src/script/{ => repositories}/conversation/linkPreviews/index.ts (99%) rename src/script/{ => repositories}/conversation/userClientsUtils.test.ts (100%) rename src/script/{ => repositories}/conversation/userClientsUtils.ts (100%) diff --git a/src/script/E2EIdentity/E2EIdentityEnrollment.test.ts b/src/script/E2EIdentity/E2EIdentityEnrollment.test.ts index a3fb1394d30..dc04ccc4260 100644 --- a/src/script/E2EIdentity/E2EIdentityEnrollment.test.ts +++ b/src/script/E2EIdentity/E2EIdentityEnrollment.test.ts @@ -24,6 +24,7 @@ import {container} from 'tsyringe'; import {PrimaryModal} from 'Components/Modals/PrimaryModal'; import {PrimaryModalType} from 'Components/Modals/PrimaryModal/PrimaryModalTypes'; +import {ConversationState} from 'Repositories/conversation/ConversationState'; import {Core} from 'src/script/service/CoreSingleton'; import {UserState} from 'src/script/user/UserState'; import * as util from 'Util/util'; @@ -33,7 +34,6 @@ import * as e2EIdentityVerification from './E2EIdentityVerification'; import {getEnrollmentStore} from './Enrollment.store'; import {OIDCServiceStore} from './OIDCService/OIDCServiceStorage'; -import {ConversationState} from '../conversation/ConversationState'; import {Conversation} from '../entity/Conversation'; import {User} from '../entity/User'; diff --git a/src/script/E2EIdentity/E2EIdentityVerification.ts b/src/script/E2EIdentity/E2EIdentityVerification.ts index ccfd6f1bae2..48fe6ef8bda 100644 --- a/src/script/E2EIdentity/E2EIdentityVerification.ts +++ b/src/script/E2EIdentity/E2EIdentityVerification.ts @@ -22,13 +22,12 @@ import {DeviceIdentity} from '@wireapp/core/lib/messagingProtocols/mls'; import {StringifiedQualifiedId, stringifyQualifiedId} from '@wireapp/core/lib/util/qualifiedIdUtil'; import {container} from 'tsyringe'; +import {ConversationState} from 'Repositories/conversation/ConversationState'; import {Core} from 'src/script/service/CoreSingleton'; import {base64ToArray} from 'Util/util'; import {mapMLSStatus, MLSStatuses} from './mlsStatus'; -import {ConversationState} from '../conversation/ConversationState'; - export {MLSStatuses}; export type WireIdentity = Omit & { diff --git a/src/script/components/Badge/components/VerificationBadges/VerificationBadges.tsx b/src/script/components/Badge/components/VerificationBadges/VerificationBadges.tsx index 3316a4e8052..27e7ccfa98c 100644 --- a/src/script/components/Badge/components/VerificationBadges/VerificationBadges.tsx +++ b/src/script/components/Badge/components/VerificationBadges/VerificationBadges.tsx @@ -35,8 +35,8 @@ import { } from '@wireapp/react-ui-kit'; import {ClientEntity} from 'Repositories/client'; -import {ConversationVerificationState} from 'src/script/conversation/ConversationVerificationState'; -import {checkUserHandle} from 'src/script/conversation/ConversationVerificationStateHandler'; +import {ConversationVerificationState} from 'Repositories/conversation/ConversationVerificationState'; +import {checkUserHandle} from 'Repositories/conversation/ConversationVerificationStateHandler'; import {MLSStatuses, WireIdentity} from 'src/script/E2EIdentity/E2EIdentityVerification'; import {Conversation} from 'src/script/entity/Conversation'; import {User} from 'src/script/entity/User'; diff --git a/src/script/components/ConfigToolbar/ConfigToolbar.tsx b/src/script/components/ConfigToolbar/ConfigToolbar.tsx index d8dda991200..ec573e5625e 100644 --- a/src/script/components/ConfigToolbar/ConfigToolbar.tsx +++ b/src/script/components/ConfigToolbar/ConfigToolbar.tsx @@ -24,8 +24,8 @@ import {container} from 'tsyringe'; import {Button, Input, Switch} from '@wireapp/react-ui-kit'; +import {ConversationState} from 'Repositories/conversation/ConversationState'; import {Config, Configuration} from 'src/script/Config'; -import {ConversationState} from 'src/script/conversation/ConversationState'; import {useClickOutside} from 'src/script/hooks/useClickOutside'; import {wrapperStyles} from './ConfigToolbar.styles'; diff --git a/src/script/components/Conversation/Conversation.tsx b/src/script/components/Conversation/Conversation.tsx index 879623daea6..82bed095a27 100644 --- a/src/script/components/Conversation/Conversation.tsx +++ b/src/script/components/Conversation/Conversation.tsx @@ -34,6 +34,7 @@ import {PrimaryModal} from 'Components/Modals/PrimaryModal'; import {showWarningModal} from 'Components/Modals/utils/showWarningModal'; import {TitleBar} from 'Components/TitleBar'; import {CallState} from 'Repositories/calling/CallState'; +import {ConversationState} from 'Repositories/conversation/ConversationState'; import {Config} from 'src/script/Config'; import {PROPERTIES_TYPE} from 'src/script/properties/PropertiesType'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; @@ -49,7 +50,6 @@ import {useReadReceiptSender} from './hooks/useReadReceipt'; import {ReadOnlyConversationMessage} from './ReadOnlyConversationMessage'; import {checkFileSharingPermission} from './utils/checkFileSharingPermission'; -import {ConversationState} from '../../conversation/ConversationState'; import {Conversation as ConversationEntity} from '../../entity/Conversation'; import {ContentMessage} from '../../entity/message/ContentMessage'; import {DecryptErrorMessage} from '../../entity/message/DecryptErrorMessage'; diff --git a/src/script/components/Conversation/ReadOnlyConversationMessage/ReadOnlyConversationMessage.test.tsx b/src/script/components/Conversation/ReadOnlyConversationMessage/ReadOnlyConversationMessage.test.tsx index 44c525bccc5..e64dbb48218 100644 --- a/src/script/components/Conversation/ReadOnlyConversationMessage/ReadOnlyConversationMessage.test.tsx +++ b/src/script/components/Conversation/ReadOnlyConversationMessage/ReadOnlyConversationMessage.test.tsx @@ -22,8 +22,8 @@ import {ConnectionStatus} from '@wireapp/api-client/lib/connection'; import {CONVERSATION_TYPE} from '@wireapp/api-client/lib/conversation'; import {ConnectionEntity} from 'Repositories/connection/ConnectionEntity'; +import {CONVERSATION_READONLY_STATE} from 'Repositories/conversation/ConversationRepository'; import {withTheme} from 'src/script/auth/util/test/TestUtil'; -import {CONVERSATION_READONLY_STATE} from 'src/script/conversation/ConversationRepository'; import {Conversation} from 'src/script/entity/Conversation'; import {User} from 'src/script/entity/User'; diff --git a/src/script/components/Conversation/ReadOnlyConversationMessage/ReadOnlyConversationMessage.tsx b/src/script/components/Conversation/ReadOnlyConversationMessage/ReadOnlyConversationMessage.tsx index ede37910610..49b6b88bd38 100644 --- a/src/script/components/Conversation/ReadOnlyConversationMessage/ReadOnlyConversationMessage.tsx +++ b/src/script/components/Conversation/ReadOnlyConversationMessage/ReadOnlyConversationMessage.tsx @@ -24,7 +24,7 @@ import ko from 'knockout'; import {Link, LinkVariant} from '@wireapp/react-ui-kit'; import * as Icon from 'Components/Icon'; -import {CONVERSATION_READONLY_STATE} from 'src/script/conversation/ConversationRepository'; +import {CONVERSATION_READONLY_STATE} from 'Repositories/conversation/ConversationRepository'; import {Conversation} from 'src/script/entity/Conversation'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; diff --git a/src/script/components/Conversation/hooks/useReadReceipt.ts b/src/script/components/Conversation/hooks/useReadReceipt.ts index 5e4609fb4f8..4461c3f4649 100644 --- a/src/script/components/Conversation/hooks/useReadReceipt.ts +++ b/src/script/components/Conversation/hooks/useReadReceipt.ts @@ -21,7 +21,7 @@ import {useCallback, useRef} from 'react'; import {groupBy} from 'underscore'; -import {MessageRepository} from 'src/script/conversation/MessageRepository'; +import {MessageRepository} from 'Repositories/conversation/MessageRepository'; import {Conversation} from 'src/script/entity/Conversation'; import {Message} from 'src/script/entity/message/Message'; diff --git a/src/script/components/ConversationListCell/ConversationListCell.tsx b/src/script/components/ConversationListCell/ConversationListCell.tsx index 25384973b43..9dd360dfb5e 100644 --- a/src/script/components/ConversationListCell/ConversationListCell.tsx +++ b/src/script/components/ConversationListCell/ConversationListCell.tsx @@ -32,6 +32,7 @@ import cx from 'classnames'; import {Avatar, AVATAR_SIZE, GroupAvatar} from 'Components/Avatar'; import {UserBlockedBadge} from 'Components/Badge'; import {UserInfo} from 'Components/UserInfo'; +import {generateCellState} from 'Repositories/conversation/ConversationCellState'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {isKey, isOneOfKeys, KEY} from 'Util/KeyboardUtil'; import {t} from 'Util/LocalizerUtil'; @@ -39,7 +40,6 @@ import {noop, setContextMenuPosition} from 'Util/util'; import {StatusIcon} from './components/StatusIcon'; -import {generateCellState} from '../../conversation/ConversationCellState'; import type {Conversation} from '../../entity/Conversation'; import {MediaType} from '../../media/MediaType'; diff --git a/src/script/components/ConversationListCell/components/StatusIcon/StatusIcon.tsx b/src/script/components/ConversationListCell/components/StatusIcon/StatusIcon.tsx index eabd7cb05ae..06e4bc23ca2 100644 --- a/src/script/components/ConversationListCell/components/StatusIcon/StatusIcon.tsx +++ b/src/script/components/ConversationListCell/components/StatusIcon/StatusIcon.tsx @@ -20,11 +20,11 @@ import {useMemo} from 'react'; import * as Icon from 'Components/Icon'; +import {generateCellState} from 'Repositories/conversation/ConversationCellState'; +import {ConversationStatusIcon} from 'Repositories/conversation/ConversationStatusIcon'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; -import {generateCellState} from '../../../../conversation/ConversationCellState'; -import {ConversationStatusIcon} from '../../../../conversation/ConversationStatusIcon'; import type {Conversation} from '../../../../entity/Conversation'; export interface Props { diff --git a/src/script/components/InputBar/InputBar.test.tsx b/src/script/components/InputBar/InputBar.test.tsx index ef5c688710b..e684e7ea933 100644 --- a/src/script/components/InputBar/InputBar.test.tsx +++ b/src/script/components/InputBar/InputBar.test.tsx @@ -21,6 +21,8 @@ import {act, fireEvent, render, waitFor} from '@testing-library/react'; import {InputBar} from 'Components/InputBar/index'; import {AssetRepository} from 'Repositories/assets/AssetRepository'; +import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; +import {MessageRepository} from 'Repositories/conversation/MessageRepository'; import {withTheme} from 'src/script/auth/util/test/TestUtil'; import {Config} from 'src/script/Config'; import {PropertiesService} from 'src/script/properties/PropertiesService'; @@ -28,8 +30,6 @@ import {SelfService} from 'src/script/self/SelfService'; import {createUuid} from 'Util/uuid'; import {TestFactory} from '../../../../test/helper/TestFactory'; -import {ConversationRepository} from '../../conversation/ConversationRepository'; -import {MessageRepository} from '../../conversation/MessageRepository'; import {Conversation} from '../../entity/Conversation'; import {User} from '../../entity/User'; import {EventRepository} from '../../event/EventRepository'; diff --git a/src/script/components/InputBar/InputBar.tsx b/src/script/components/InputBar/InputBar.tsx index 0e0454d98cb..b874525575c 100644 --- a/src/script/components/InputBar/InputBar.tsx +++ b/src/script/components/InputBar/InputBar.tsx @@ -34,7 +34,9 @@ import {PrimaryModal} from 'Components/Modals/PrimaryModal'; import {showWarningModal} from 'Components/Modals/utils/showWarningModal'; import {RichTextContent, RichTextEditor} from 'Components/RichTextEditor'; import {SendMessageButton} from 'Components/RichTextEditor/components/SendMessageButton'; -import {ConversationRepository} from 'src/script/conversation/ConversationRepository'; +import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; +import {ConversationVerificationState} from 'Repositories/conversation/ConversationVerificationState'; +import {MessageRepository, OutgoingQuote} from 'Repositories/conversation/MessageRepository'; import {useUserPropertyValue} from 'src/script/hooks/useUserProperty'; import {PropertiesRepository} from 'src/script/properties/PropertiesRepository'; import {PROPERTIES_TYPE} from 'src/script/properties/PropertiesType'; @@ -56,8 +58,6 @@ import {handleClickOutsideOfInputBar, IgnoreOutsideClickWrapper} from './util/cl import {loadDraftState, saveDraftState} from './util/DraftStateUtil'; import {Config} from '../../Config'; -import {ConversationVerificationState} from '../../conversation/ConversationVerificationState'; -import {MessageRepository, OutgoingQuote} from '../../conversation/MessageRepository'; import {Conversation} from '../../entity/Conversation'; import {ContentMessage} from '../../entity/message/ContentMessage'; import {User} from '../../entity/User'; diff --git a/src/script/components/InputBar/util/DraftStateUtil.ts b/src/script/components/InputBar/util/DraftStateUtil.ts index 0f8129dc83d..0d238b222cc 100644 --- a/src/script/components/InputBar/util/DraftStateUtil.ts +++ b/src/script/components/InputBar/util/DraftStateUtil.ts @@ -17,7 +17,8 @@ * */ -import {MessageRepository} from '../../../conversation/MessageRepository'; +import {MessageRepository} from 'Repositories/conversation/MessageRepository'; + import {Conversation} from '../../../entity/Conversation'; import {ContentMessage} from '../../../entity/message/ContentMessage'; import {StorageKey, StorageRepository} from '../../../storage'; diff --git a/src/script/components/MessagesList/Message/LegalHoldMessage.tsx b/src/script/components/MessagesList/Message/LegalHoldMessage.tsx index 1928692c615..474ecc2d6c6 100644 --- a/src/script/components/MessagesList/Message/LegalHoldMessage.tsx +++ b/src/script/components/MessagesList/Message/LegalHoldMessage.tsx @@ -23,9 +23,9 @@ import {container} from 'tsyringe'; import {LegalHoldDot} from 'Components/LegalHoldDot'; import {useLegalHoldModalState} from 'Components/Modals/LegalHoldModal/LegalHoldModal.state'; +import {ConversationState} from 'Repositories/conversation/ConversationState'; import {t} from 'Util/LocalizerUtil'; -import {ConversationState} from '../../../conversation/ConversationState'; import {LegalHoldMessage as LegalHoldMessageEntity} from '../../../entity/message/LegalHoldMessage'; export interface LegalHoldMessageProps { diff --git a/src/script/components/MessagesList/Message/MessageWrapper.tsx b/src/script/components/MessagesList/Message/MessageWrapper.tsx index 1aaf0eae9a3..993603f5032 100644 --- a/src/script/components/MessagesList/Message/MessageWrapper.tsx +++ b/src/script/components/MessagesList/Message/MessageWrapper.tsx @@ -28,7 +28,7 @@ import {WebAppEvents} from '@wireapp/webapp-events'; import {E2EIVerificationMessage} from 'Components/MessagesList/Message/E2EIVerificationMessage'; import {AssetRepository} from 'Repositories/assets/AssetRepository'; -import {OutgoingQuote} from 'src/script/conversation/MessageRepository'; +import {OutgoingQuote} from 'Repositories/conversation/MessageRepository'; import {ContentMessage} from 'src/script/entity/message/ContentMessage'; import {Text} from 'src/script/entity/message/Text'; import {QuoteEntity} from 'src/script/message/QuoteEntity'; diff --git a/src/script/components/MessagesList/Message/index.tsx b/src/script/components/MessagesList/Message/index.tsx index 8c09f66fb4a..8301f7acca3 100644 --- a/src/script/components/MessagesList/Message/index.tsx +++ b/src/script/components/MessagesList/Message/index.tsx @@ -23,6 +23,7 @@ import {QualifiedId} from '@wireapp/api-client/lib/user'; import cx from 'classnames'; import {InViewport} from 'Components/InViewport'; +import type {MessageRepository} from 'Repositories/conversation/MessageRepository'; import {ServiceEntity} from 'src/script/integration/ServiceEntity'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {getAllFocusableElements, setElementsTabIndex} from 'Util/focusUtil'; @@ -33,7 +34,6 @@ import {MessageWrapper} from './MessageWrapper'; import {ScrollToElement} from './types'; import {useMessageFocusedTabIndex} from './util'; -import type {MessageRepository} from '../../../conversation/MessageRepository'; import type {Conversation} from '../../../entity/Conversation'; import type {ContentMessage} from '../../../entity/message/ContentMessage'; import type {DecryptErrorMessage} from '../../../entity/message/DecryptErrorMessage'; diff --git a/src/script/components/MessagesList/MessageList.tsx b/src/script/components/MessagesList/MessageList.tsx index 8ba4ff445c8..afb230b1ef3 100644 --- a/src/script/components/MessagesList/MessageList.tsx +++ b/src/script/components/MessagesList/MessageList.tsx @@ -25,8 +25,8 @@ import cx from 'classnames'; import {FadingScrollbar} from 'Components/FadingScrollbar'; import {JumpToLastMessageButton} from 'Components/MessagesList/JumpToLastMessageButton'; import {filterMessages} from 'Components/MessagesList/utils/messagesFilter'; -import {ConversationRepository} from 'src/script/conversation/ConversationRepository'; -import {MessageRepository} from 'src/script/conversation/MessageRepository'; +import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; +import {MessageRepository} from 'Repositories/conversation/MessageRepository'; import {ContentMessage} from 'src/script/entity/message/ContentMessage'; import {DecryptErrorMessage} from 'src/script/entity/message/DecryptErrorMessage'; import {MemberMessage} from 'src/script/entity/message/MemberMessage'; diff --git a/src/script/components/MessagesList/utils/messagesGroup.test.ts b/src/script/components/MessagesList/utils/messagesGroup.test.ts index 9ec12a044f6..abb7e92d554 100644 --- a/src/script/components/MessagesList/utils/messagesGroup.test.ts +++ b/src/script/components/MessagesList/utils/messagesGroup.test.ts @@ -19,7 +19,7 @@ import {TimeInMillis} from '@wireapp/commons/lib/util/TimeUtil'; -import {EventMapper} from 'src/script/conversation/EventMapper'; +import {EventMapper} from 'Repositories/conversation/EventMapper'; import {Conversation} from 'src/script/entity/Conversation'; import {Message} from 'src/script/entity/message/Message'; import {createGroupCreationEvent, createMessageAddEvent} from 'test/helper/EventGenerator'; diff --git a/src/script/components/Modals/DetailViewModal/DetailViewModalFooter.tsx b/src/script/components/Modals/DetailViewModal/DetailViewModalFooter.tsx index 01caeb11614..0ba2cda2899 100644 --- a/src/script/components/Modals/DetailViewModal/DetailViewModalFooter.tsx +++ b/src/script/components/Modals/DetailViewModal/DetailViewModalFooter.tsx @@ -32,11 +32,11 @@ import { } from 'Components/MessagesList/Message/ContentMessage/MessageActions/MessageActions.styles'; import {MessageReactions} from 'Components/MessagesList/Message/ContentMessage/MessageActions/MessageReactions/MessageReactions'; import {ReplyButton} from 'Components/MessagesList/Message/ContentMessage/MessageActions/ReplyButton'; +import {MessageRepository} from 'Repositories/conversation/MessageRepository'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {isTabKey} from 'Util/KeyboardUtil'; import {t} from 'Util/LocalizerUtil'; -import {MessageRepository} from '../../../conversation/MessageRepository'; import {Conversation} from '../../../entity/Conversation'; import {ContentMessage} from '../../../entity/message/ContentMessage'; diff --git a/src/script/components/Modals/DetailViewModal/index.tsx b/src/script/components/Modals/DetailViewModal/index.tsx index 236499de1d0..79fc62f3720 100644 --- a/src/script/components/Modals/DetailViewModal/index.tsx +++ b/src/script/components/Modals/DetailViewModal/index.tsx @@ -26,6 +26,8 @@ import {WebAppEvents} from '@wireapp/webapp-events'; import {ZoomableImage} from 'Components/ZoomableImage'; import {AssetRepository} from 'Repositories/assets/AssetRepository'; +import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; +import {MessageRepository} from 'Repositories/conversation/MessageRepository'; import {User} from 'src/script/entity/User'; import {handleKeyDown, KEY} from 'Util/KeyboardUtil'; import {t} from 'Util/LocalizerUtil'; @@ -36,8 +38,6 @@ import {waitFor} from 'Util/waitFor'; import {DetailViewModalFooter} from './DetailViewModalFooter'; import {DetailViewModalHeader} from './DetailViewModalHeader'; -import {ConversationRepository} from '../../../conversation/ConversationRepository'; -import {MessageRepository} from '../../../conversation/MessageRepository'; import {Conversation} from '../../../entity/Conversation'; import {ContentMessage} from '../../../entity/message/ContentMessage'; import {MediumImage} from '../../../entity/message/MediumImage'; diff --git a/src/script/components/Modals/GroupCreation/GroupCreationModal.tsx b/src/script/components/Modals/GroupCreation/GroupCreationModal.tsx index 0e656dd0cd5..b4a3341b178 100644 --- a/src/script/components/Modals/GroupCreation/GroupCreationModal.tsx +++ b/src/script/components/Modals/GroupCreation/GroupCreationModal.tsx @@ -37,6 +37,13 @@ import {TextInput} from 'Components/TextInput'; import {BaseToggle} from 'Components/toggle/BaseToggle'; import {InfoToggle} from 'Components/toggle/InfoToggle'; import {UserSearchableList} from 'Components/UserSearchableList'; +import {ACCESS_STATE} from 'Repositories/conversation/AccessState'; +import { + ACCESS_TYPES, + teamPermissionsForAccessState, + toggleFeature, +} from 'Repositories/conversation/ConversationAccessPermission'; +import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; import {SidebarTabs, useSidebarStore} from 'src/script/page/LeftSidebar/panels/Conversations/useSidebarStore'; import {generateConversationUrl} from 'src/script/router/routeGenerator'; import {createNavigate, createNavigateKeyboard} from 'src/script/router/routerBindings'; @@ -46,13 +53,6 @@ import {replaceLink, t} from 'Util/LocalizerUtil'; import {sortUsersByPriority} from 'Util/StringUtil'; import {Config} from '../../../Config'; -import {ACCESS_STATE} from '../../../conversation/AccessState'; -import { - ACCESS_TYPES, - teamPermissionsForAccessState, - toggleFeature, -} from '../../../conversation/ConversationAccessPermission'; -import {ConversationRepository} from '../../../conversation/ConversationRepository'; import {User} from '../../../entity/User'; import {isProtocolOption, ProtocolOption} from '../../../guards/Protocol'; import {RootContext} from '../../../page/RootProvider'; diff --git a/src/script/components/Modals/LegalHoldModal/LegalHoldModal.test.tsx b/src/script/components/Modals/LegalHoldModal/LegalHoldModal.test.tsx index 2dfa6b81450..1b685013edf 100644 --- a/src/script/components/Modals/LegalHoldModal/LegalHoldModal.test.tsx +++ b/src/script/components/Modals/LegalHoldModal/LegalHoldModal.test.tsx @@ -23,12 +23,12 @@ import type {QualifiedId} from '@wireapp/api-client/lib/user/'; import {useLegalHoldModalState} from 'Components/Modals/LegalHoldModal/LegalHoldModal.state'; import {CallingRepository} from 'Repositories/calling/CallingRepository'; import {ClientRepository} from 'Repositories/client'; +import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; +import {MessageRepository} from 'Repositories/conversation/MessageRepository'; import {LegalHoldModal, LegalHoldModalType} from './LegalHoldModal'; import {TestFactory} from '../../../../../test/helper/TestFactory'; -import {ConversationRepository} from '../../../conversation/ConversationRepository'; -import {MessageRepository} from '../../../conversation/MessageRepository'; import {CryptographyRepository} from '../../../cryptography/CryptographyRepository'; import {Conversation} from '../../../entity/Conversation'; import {User} from '../../../entity/User'; diff --git a/src/script/components/Modals/LegalHoldModal/LegalHoldModal.tsx b/src/script/components/Modals/LegalHoldModal/LegalHoldModal.tsx index f8560ae6443..01de0f2dd7f 100644 --- a/src/script/components/Modals/LegalHoldModal/LegalHoldModal.tsx +++ b/src/script/components/Modals/LegalHoldModal/LegalHoldModal.tsx @@ -30,13 +30,13 @@ import {UserDevicesState, UserDevices} from 'Components/UserDevices'; import {UserSearchableList} from 'Components/UserSearchableList'; import {useUserDevicesHistory} from 'Hooks/useUserDevicesHistory'; import {ClientRepository} from 'Repositories/client'; +import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; +import {MessageRepository} from 'Repositories/conversation/MessageRepository'; import {handleEnterDown} from 'Util/KeyboardUtil'; import {t} from 'Util/LocalizerUtil'; import {useLegalHoldModalState} from './LegalHoldModal.state'; -import {ConversationRepository} from '../../../conversation/ConversationRepository'; -import {MessageRepository} from '../../../conversation/MessageRepository'; import {CryptographyRepository} from '../../../cryptography/CryptographyRepository'; import {User} from '../../../entity/User'; import {SearchRepository} from '../../../search/SearchRepository'; diff --git a/src/script/components/TitleBar/TitleBar.test.tsx b/src/script/components/TitleBar/TitleBar.test.tsx index f5d659b5582..04856f29915 100644 --- a/src/script/components/TitleBar/TitleBar.test.tsx +++ b/src/script/components/TitleBar/TitleBar.test.tsx @@ -29,11 +29,11 @@ import {WebAppEvents} from '@wireapp/webapp-events'; import {TitleBar} from 'Components/TitleBar'; import {CallingRepository} from 'Repositories/calling/CallingRepository'; import {CallState} from 'Repositories/calling/CallState'; +import {ConversationVerificationState} from 'Repositories/conversation/ConversationVerificationState'; import {withTheme} from 'src/script/auth/util/test/TestUtil'; import {ContentState} from 'src/script/page/useAppState'; import {TestFactory} from '../../../../test/helper/TestFactory'; -import {ConversationVerificationState} from '../../conversation/ConversationVerificationState'; import {Conversation} from '../../entity/Conversation'; import {User} from '../../entity/User'; import {PanelState} from '../../page/RightSidebar/RightSidebar'; diff --git a/src/script/components/TitleBar/TitleBar.tsx b/src/script/components/TitleBar/TitleBar.tsx index 335044d25e2..08877985726 100644 --- a/src/script/components/TitleBar/TitleBar.tsx +++ b/src/script/components/TitleBar/TitleBar.tsx @@ -32,6 +32,7 @@ import {useCallAlertState} from 'Components/calling/useCallAlertState'; import * as Icon from 'Components/Icon'; import {LegalHoldDot} from 'Components/LegalHoldDot'; import {CallState} from 'Repositories/calling/CallState'; +import {ConversationFilter} from 'Repositories/conversation/ConversationFilter'; import {User} from 'src/script/entity/User'; import {useAppMainState, ViewType} from 'src/script/page/state'; import {ContentState} from 'src/script/page/useAppState'; @@ -41,7 +42,6 @@ import {StringIdentifer, t} from 'Util/LocalizerUtil'; import {matchQualifiedIds} from 'Util/QualifiedId'; import {TIME_IN_MILLIS} from 'Util/TimeUtil'; -import {ConversationFilter} from '../../conversation/ConversationFilter'; import {Conversation} from '../../entity/Conversation'; import {RightSidebarParams} from '../../page/AppMain'; import {PanelState} from '../../page/RightSidebar/RightSidebar'; diff --git a/src/script/components/UserDevices/UserDevices.tsx b/src/script/components/UserDevices/UserDevices.tsx index 513920e03a6..fbbe0f9b4e8 100644 --- a/src/script/components/UserDevices/UserDevices.tsx +++ b/src/script/components/UserDevices/UserDevices.tsx @@ -21,7 +21,9 @@ import {useEffect, useMemo, useState} from 'react'; import {ClientClassification} from '@wireapp/api-client/lib/client/'; +import {useUserIdentity} from 'Hooks/useDeviceIdentities'; import {ClientRepository, ClientEntity} from 'Repositories/client'; +import {MessageRepository} from 'Repositories/conversation/MessageRepository'; import {partition} from 'Util/ArrayUtil'; import {t} from 'Util/LocalizerUtil'; import {getLogger} from 'Util/Logger'; @@ -33,10 +35,8 @@ import {NoDevicesFound} from './components/NoDevicesFound'; import {SelfFingerprint} from './components/SelfFingerprint'; import {FIND_MODE, UserDevicesState} from './UserDevices.types'; -import {MessageRepository} from '../../conversation/MessageRepository'; import {CryptographyRepository} from '../../cryptography/CryptographyRepository'; import {User} from '../../entity/User'; -import {useUserIdentity} from '../../hooks/useDeviceIdentities'; export interface UserDevicesHistoryEntry { headline: string; diff --git a/src/script/components/UserDevices/components/DeviceDetails/DeviceDetails.tsx b/src/script/components/UserDevices/components/DeviceDetails/DeviceDetails.tsx index c376b3c979c..5756c577944 100644 --- a/src/script/components/UserDevices/components/DeviceDetails/DeviceDetails.tsx +++ b/src/script/components/UserDevices/components/DeviceDetails/DeviceDetails.tsx @@ -26,7 +26,9 @@ import {container} from 'tsyringe'; import {Button, ButtonVariant} from '@wireapp/react-ui-kit'; import type {ClientRepository, ClientEntity} from 'Repositories/client'; -import {isMLSConversation} from 'src/script/conversation/ConversationSelectors'; +import {isMLSConversation} from 'Repositories/conversation/ConversationSelectors'; +import {ConversationState} from 'Repositories/conversation/ConversationState'; +import type {MessageRepository} from 'Repositories/conversation/MessageRepository'; import {WireIdentity} from 'src/script/E2EIdentity'; import {MLSDeviceDetails} from 'src/script/page/MainContent/panels/preferences/DevicesPreferences/components/MLSDeviceDetails'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; @@ -35,8 +37,6 @@ import type {Logger} from 'Util/Logger'; import {splitFingerprint} from 'Util/StringUtil'; import {Config} from '../../../../Config'; -import {ConversationState} from '../../../../conversation/ConversationState'; -import type {MessageRepository} from '../../../../conversation/MessageRepository'; import type {CryptographyRepository} from '../../../../cryptography/CryptographyRepository'; import type {User} from '../../../../entity/User'; import {MotionDuration} from '../../../../motion/MotionDuration'; diff --git a/src/script/components/UserList/UserList.test.tsx b/src/script/components/UserList/UserList.test.tsx index 37d978547c5..c0ff4a236d9 100644 --- a/src/script/components/UserList/UserList.test.tsx +++ b/src/script/components/UserList/UserList.test.tsx @@ -22,11 +22,11 @@ import React from 'react'; import {fireEvent, render} from '@testing-library/react'; import {UserList} from 'Components/UserList/UserList'; +import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; import {User} from 'src/script/entity/User'; import {TestFactory} from '../../../../test/helper/TestFactory'; import {withTheme} from '../../auth/util/test/TestUtil'; -import {ConversationRepository} from '../../conversation/ConversationRepository'; const testFactory = new TestFactory(); let conversationRepository: ConversationRepository; diff --git a/src/script/components/UserList/UserList.tsx b/src/script/components/UserList/UserList.tsx index 764afb6188d..d944366bba5 100644 --- a/src/script/components/UserList/UserList.tsx +++ b/src/script/components/UserList/UserList.tsx @@ -25,14 +25,14 @@ import {container} from 'tsyringe'; import * as Icon from 'Components/Icon'; import {InViewport} from 'Components/InViewport'; import {collapseButton, collapseIcon} from 'Components/UserList/UserList.styles'; +import type {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; +import {ConversationState} from 'Repositories/conversation/ConversationState'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {isEnterKey, isSpaceKey} from 'Util/KeyboardUtil'; import {t} from 'Util/LocalizerUtil'; import {UserListItem} from './components/UserListItem'; -import type {ConversationRepository} from '../../conversation/ConversationRepository'; -import {ConversationState} from '../../conversation/ConversationState'; import type {Conversation} from '../../entity/Conversation'; import type {User} from '../../entity/User'; import {TeamState} from '../../team/TeamState'; diff --git a/src/script/components/UserSearchableList/UserSearchableList.tsx b/src/script/components/UserSearchableList/UserSearchableList.tsx index 3439a9734ce..5b2e9bbe8dc 100644 --- a/src/script/components/UserSearchableList/UserSearchableList.tsx +++ b/src/script/components/UserSearchableList/UserSearchableList.tsx @@ -24,12 +24,12 @@ import {container} from 'tsyringe'; import {debounce} from 'underscore'; import {UserList} from 'Components/UserList'; +import {ConversationState} from 'Repositories/conversation/ConversationState'; import {partition} from 'Util/ArrayUtil'; import {t} from 'Util/LocalizerUtil'; import {matchQualifiedIds} from 'Util/QualifiedId'; import {sortByPriority} from 'Util/StringUtil'; -import {ConversationState} from '../../conversation/ConversationState'; import type {User} from '../../entity/User'; import {SearchRepository} from '../../search/SearchRepository'; import type {TeamRepository} from '../../team/TeamRepository'; diff --git a/src/script/components/panel/UserActions.test.tsx b/src/script/components/panel/UserActions.test.tsx index e334fbe9b32..facc2d5e584 100644 --- a/src/script/components/panel/UserActions.test.tsx +++ b/src/script/components/panel/UserActions.test.tsx @@ -26,9 +26,9 @@ import {container} from 'tsyringe'; import {PrimaryModalComponent} from 'Components/Modals/PrimaryModal/PrimaryModal'; import {ConnectionEntity} from 'Repositories/connection/ConnectionEntity'; +import {ConversationRoleRepository} from 'Repositories/conversation/ConversationRoleRepository'; +import {ConversationState} from 'Repositories/conversation/ConversationState'; import {withTheme} from 'src/script/auth/util/test/TestUtil'; -import {ConversationRoleRepository} from 'src/script/conversation/ConversationRoleRepository'; -import {ConversationState} from 'src/script/conversation/ConversationState'; import {Conversation} from 'src/script/entity/Conversation'; import {User} from 'src/script/entity/User'; import {TeamEntity} from 'src/script/team/TeamEntity'; diff --git a/src/script/components/panel/UserActions.tsx b/src/script/components/panel/UserActions.tsx index cf43f249c57..3f5839e7a0b 100644 --- a/src/script/components/panel/UserActions.tsx +++ b/src/script/components/panel/UserActions.tsx @@ -30,7 +30,9 @@ import {WebAppEvents} from '@wireapp/webapp-events'; import * as Icon from 'Components/Icon'; import {PrimaryModal} from 'Components/Modals/PrimaryModal'; import {listCSS} from 'Components/panel/PanelActions/PanelActions.styles'; -import {ConversationState} from 'src/script/conversation/ConversationState'; +import {ACCESS_STATE} from 'Repositories/conversation/AccessState'; +import type {ConversationRoleRepository} from 'Repositories/conversation/ConversationRoleRepository'; +import {ConversationState} from 'Repositories/conversation/ConversationState'; import {SidebarTabs, useSidebarStore} from 'src/script/page/LeftSidebar/panels/Conversations/useSidebarStore'; import {TeamState} from 'src/script/team/TeamState'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; @@ -41,8 +43,6 @@ import type {MenuItem} from './PanelActions'; import {PanelActions} from './PanelActions'; import {SingleAction} from './SingleAction/SingleAction'; -import {ACCESS_STATE} from '../../conversation/AccessState'; -import type {ConversationRoleRepository} from '../../conversation/ConversationRoleRepository'; import {Conversation} from '../../entity/Conversation'; import type {User} from '../../entity/User'; import type {ActionsViewModel} from '../../view_model/ActionsViewModel'; diff --git a/src/script/cryptography/CryptographyMapper.ts b/src/script/cryptography/CryptographyMapper.ts index d8a0dd96c56..ac6523f075b 100644 --- a/src/script/cryptography/CryptographyMapper.ts +++ b/src/script/cryptography/CryptographyMapper.ts @@ -54,12 +54,12 @@ import { import {AssetTransferState} from 'Repositories/assets/AssetTransferState'; import {CALL_MESSAGE_TYPE} from 'Repositories/calling/enum/CallMessageType'; +import {ConversationEphemeralHandler} from 'Repositories/conversation/ConversationEphemeralHandler'; +import {MessageAddEvent} from 'Repositories/conversation/EventBuilder'; import {getLogger, Logger} from 'Util/Logger'; import {TIME_IN_MILLIS} from 'Util/TimeUtil'; import {base64ToArray, arrayToBase64} from 'Util/util'; -import {ConversationEphemeralHandler} from '../conversation/ConversationEphemeralHandler'; -import {MessageAddEvent} from '../conversation/EventBuilder'; import {PROTO_MESSAGE_TYPE} from '../cryptography/ProtoMessageType'; import {CryptographyError} from '../error/CryptographyError'; import {ClientEvent, CONVERSATION} from '../event/Client'; diff --git a/src/script/entity/Conversation.test.ts b/src/script/entity/Conversation.test.ts index bfdfae71963..8d1bc2edbc4 100644 --- a/src/script/entity/Conversation.test.ts +++ b/src/script/entity/Conversation.test.ts @@ -24,8 +24,8 @@ import {CONVERSATION_TYPE} from '@wireapp/api-client/lib/conversation/'; import {ClientEntity} from 'Repositories/client/ClientEntity'; import {ConnectionMapper} from 'Repositories/connection/ConnectionMapper'; -import {ConversationMapper} from 'src/script/conversation/ConversationMapper'; -import {NOTIFICATION_STATE} from 'src/script/conversation/NotificationSetting'; +import {ConversationMapper} from 'Repositories/conversation/ConversationMapper'; +import {NOTIFICATION_STATE} from 'Repositories/conversation/NotificationSetting'; import 'src/script/localization/Localizer'; import {StatusType} from 'src/script/message/StatusType'; import {createUuid} from 'Util/uuid'; diff --git a/src/script/entity/Conversation.ts b/src/script/entity/Conversation.ts index c575105989a..be4bbda804d 100644 --- a/src/script/entity/Conversation.ts +++ b/src/script/entity/Conversation.ts @@ -38,6 +38,12 @@ import {WebAppEvents} from '@wireapp/webapp-events'; import {useLegalHoldModalState} from 'Components/Modals/LegalHoldModal/LegalHoldModal.state'; import {ClientRepository} from 'Repositories/client'; import {ConnectionEntity} from 'Repositories/connection/ConnectionEntity'; +import {ACCESS_STATE} from 'Repositories/conversation/AccessState'; +import {ConversationRepository, CONVERSATION_READONLY_STATE} from 'Repositories/conversation/ConversationRepository'; +import {isProteusTeam1to1Conversation, isSelfConversation} from 'Repositories/conversation/ConversationSelectors'; +import {ConversationStatus} from 'Repositories/conversation/ConversationStatus'; +import {ConversationVerificationState} from 'Repositories/conversation/ConversationVerificationState'; +import {NOTIFICATION_STATE} from 'Repositories/conversation/NotificationSetting'; import {t} from 'Util/LocalizerUtil'; import {getLogger, Logger} from 'Util/Logger'; import {matchQualifiedIds} from 'Util/QualifiedId'; @@ -50,12 +56,6 @@ import {PingMessage} from './message/PingMessage'; import type {User} from './User'; import {Config} from '../Config'; -import {ACCESS_STATE} from '../conversation/AccessState'; -import {ConversationRepository, CONVERSATION_READONLY_STATE} from '../conversation/ConversationRepository'; -import {isProteusTeam1to1Conversation, isSelfConversation} from '../conversation/ConversationSelectors'; -import {ConversationStatus} from '../conversation/ConversationStatus'; -import {ConversationVerificationState} from '../conversation/ConversationVerificationState'; -import {NOTIFICATION_STATE} from '../conversation/NotificationSetting'; import {ConversationError} from '../error/ConversationError'; import {isContentMessage, isDeleteMessage} from '../guards/Message'; import {StatusType} from '../message/StatusType'; diff --git a/src/script/entity/message/MessageTimerUpdateMessage.ts b/src/script/entity/message/MessageTimerUpdateMessage.ts index 89ad40b938a..dbbbf0aea62 100644 --- a/src/script/entity/message/MessageTimerUpdateMessage.ts +++ b/src/script/entity/message/MessageTimerUpdateMessage.ts @@ -19,12 +19,12 @@ import {CONVERSATION_EVENT} from '@wireapp/api-client/lib/event/'; +import {ConversationEphemeralHandler} from 'Repositories/conversation/ConversationEphemeralHandler'; import {t} from 'Util/LocalizerUtil'; import {formatDuration} from 'Util/TimeUtil'; import {SystemMessage} from './SystemMessage'; -import {ConversationEphemeralHandler} from '../../conversation/ConversationEphemeralHandler'; import {SystemMessageType} from '../../message/SystemMessageType'; export class MessageTimerUpdateMessage extends SystemMessage { diff --git a/src/script/entity/message/Text.ts b/src/script/entity/message/Text.ts index 71cd52ea37d..e9230e40d33 100644 --- a/src/script/entity/message/Text.ts +++ b/src/script/entity/message/Text.ts @@ -21,12 +21,12 @@ import {QualifiedId} from '@wireapp/api-client/lib/user'; import ko from 'knockout'; import {AssetType} from 'Repositories/assets/AssetType'; +import {containsOnlyLink} from 'Repositories/conversation/linkPreviews/helpers'; import {renderMessage} from 'Util/messageRenderer'; import {Asset} from './Asset'; import type {LinkPreview} from './LinkPreview'; -import {containsOnlyLink} from '../../conversation/linkPreviews/helpers'; import {mediaParser} from '../../media/MediaParser'; import type {MentionEntity} from '../../message/MentionEntity'; diff --git a/src/script/event/EventProcessor.ts b/src/script/event/EventProcessor.ts index ba3251df192..76cf8ff4201 100644 --- a/src/script/event/EventProcessor.ts +++ b/src/script/event/EventProcessor.ts @@ -19,9 +19,9 @@ import {BackendEvent} from '@wireapp/api-client/lib/event'; -import {EventSource} from './EventSource'; +import {ClientConversationEvent} from 'Repositories/conversation/EventBuilder'; -import {ClientConversationEvent} from '../conversation/EventBuilder'; +import {EventSource} from './EventSource'; export type IncomingEvent = BackendEvent | ClientConversationEvent; diff --git a/src/script/event/EventRepository.test.ts b/src/script/event/EventRepository.test.ts index 1bf11b294c7..5c41a95411b 100644 --- a/src/script/event/EventRepository.test.ts +++ b/src/script/event/EventRepository.test.ts @@ -19,6 +19,7 @@ import {BackendEvent, CONVERSATION_EVENT, USER_EVENT} from '@wireapp/api-client/lib/event/'; +import {ClientConversationEvent} from 'Repositories/conversation/EventBuilder'; import {ClientEvent} from 'src/script/event/Client'; import {EventRepository} from 'src/script/event/EventRepository'; import {NOTIFICATION_HANDLING_STATE} from 'src/script/event/NotificationHandlingState'; @@ -26,7 +27,6 @@ import {NOTIFICATION_HANDLING_STATE} from 'src/script/event/NotificationHandling import {EventSource} from './EventSource'; import {TestFactory} from '../../../test/helper/TestFactory'; -import {ClientConversationEvent} from '../conversation/EventBuilder'; const testFactory = new TestFactory(); diff --git a/src/script/event/EventRepository.ts b/src/script/event/EventRepository.ts index ad04d3fab50..894ae3f023f 100644 --- a/src/script/event/EventRepository.ts +++ b/src/script/event/EventRepository.ts @@ -31,6 +31,7 @@ import {container} from 'tsyringe'; import {Account, ConnectionState, ProcessedEventPayload} from '@wireapp/core'; import {WebAppEvents} from '@wireapp/webapp-events'; +import {ClientConversationEvent, EventBuilder} from 'Repositories/conversation/EventBuilder'; import {getLogger, Logger} from 'Util/Logger'; import {queue} from 'Util/PromiseQueue'; import {TIME_IN_MILLIS} from 'Util/TimeUtil'; @@ -46,7 +47,6 @@ import {NOTIFICATION_HANDLING_STATE} from './NotificationHandlingState'; import type {NotificationService} from './NotificationService'; import {EventValidationError} from './preprocessor/EventStorageMiddleware/eventHandlers/EventValidationError'; -import {ClientConversationEvent, EventBuilder} from '../conversation/EventBuilder'; import {CryptographyMapper} from '../cryptography/CryptographyMapper'; import {CryptographyError} from '../error/CryptographyError'; import {EventError} from '../error/EventError'; diff --git a/src/script/event/EventTypeHandling.ts b/src/script/event/EventTypeHandling.ts index b8c1c6663ee..ce393dedec8 100644 --- a/src/script/event/EventTypeHandling.ts +++ b/src/script/event/EventTypeHandling.ts @@ -19,9 +19,9 @@ import {CONVERSATION_EVENT, ConversationEvent} from '@wireapp/api-client/lib/event'; -import {ClientEvent} from './Client'; +import {ClientConversationEvent} from 'Repositories/conversation/EventBuilder'; -import {ClientConversationEvent} from '../conversation/EventBuilder'; +import {ClientEvent} from './Client'; export function eventShouldBeStored(event: {type: any}): event is ClientConversationEvent | ConversationEvent { return EventTypeHandling.STORE.includes(event.type); diff --git a/src/script/event/preprocessor/EventStorageMiddleware/EventStorageMiddleware.test.ts b/src/script/event/preprocessor/EventStorageMiddleware/EventStorageMiddleware.test.ts index 5cb0bb9bd84..95062a2bc03 100644 --- a/src/script/event/preprocessor/EventStorageMiddleware/EventStorageMiddleware.test.ts +++ b/src/script/event/preprocessor/EventStorageMiddleware/EventStorageMiddleware.test.ts @@ -20,7 +20,7 @@ import {Asset as ProtobufAsset} from '@wireapp/protocol-messaging'; import {AssetTransferState} from 'Repositories/assets/AssetTransferState'; -import {ConversationState} from 'src/script/conversation/ConversationState'; +import {ConversationState} from 'Repositories/conversation/ConversationState'; import {Conversation} from 'src/script/entity/Conversation'; import {User} from 'src/script/entity/User'; import {EventError} from 'src/script/error/EventError'; diff --git a/src/script/event/preprocessor/EventStorageMiddleware/EventStorageMiddleware.ts b/src/script/event/preprocessor/EventStorageMiddleware/EventStorageMiddleware.ts index a4b0b16d2de..2d29fb9fec8 100644 --- a/src/script/event/preprocessor/EventStorageMiddleware/EventStorageMiddleware.ts +++ b/src/script/event/preprocessor/EventStorageMiddleware/EventStorageMiddleware.ts @@ -20,7 +20,7 @@ import {CONVERSATION_EVENT} from '@wireapp/api-client/lib/event'; import {container} from 'tsyringe'; -import {ConversationState} from 'src/script/conversation/ConversationState'; +import {ConversationState} from 'Repositories/conversation/ConversationState'; import {User} from 'src/script/entity/User'; import {UserFilter} from 'src/script/user/UserFilter'; import {matchQualifiedIds} from 'Util/QualifiedId'; diff --git a/src/script/event/preprocessor/EventStorageMiddleware/eventHandlers/assetEventHandler.ts b/src/script/event/preprocessor/EventStorageMiddleware/eventHandlers/assetEventHandler.ts index 4cca9f23dad..52b543a4a67 100644 --- a/src/script/event/preprocessor/EventStorageMiddleware/eventHandlers/assetEventHandler.ts +++ b/src/script/event/preprocessor/EventStorageMiddleware/eventHandlers/assetEventHandler.ts @@ -20,7 +20,7 @@ import {Asset as ProtobufAsset} from '@wireapp/protocol-messaging'; import {AssetTransferState} from 'Repositories/assets/AssetTransferState'; -import {AssetAddEvent} from 'src/script/conversation/EventBuilder'; +import {AssetAddEvent} from 'Repositories/conversation/EventBuilder'; import {StoredEvent} from 'src/script/storage'; import {EventValidationError} from './EventValidationError'; diff --git a/src/script/event/preprocessor/EventStorageMiddleware/eventHandlers/editedEventHandler.ts b/src/script/event/preprocessor/EventStorageMiddleware/eventHandlers/editedEventHandler.ts index 8d41c9195a6..88395f41a8a 100644 --- a/src/script/event/preprocessor/EventStorageMiddleware/eventHandlers/editedEventHandler.ts +++ b/src/script/event/preprocessor/EventStorageMiddleware/eventHandlers/editedEventHandler.ts @@ -17,7 +17,7 @@ * */ -import {MessageAddEvent} from 'src/script/conversation/EventBuilder'; +import {MessageAddEvent} from 'Repositories/conversation/EventBuilder'; import {EventError} from 'src/script/error/EventError'; import {StoredEvent} from 'src/script/storage'; diff --git a/src/script/event/preprocessor/EventStorageMiddleware/eventHandlers/getCommonMessageUpdates.ts b/src/script/event/preprocessor/EventStorageMiddleware/eventHandlers/getCommonMessageUpdates.ts index 0c46cfddd07..9c7a4f4fbce 100644 --- a/src/script/event/preprocessor/EventStorageMiddleware/eventHandlers/getCommonMessageUpdates.ts +++ b/src/script/event/preprocessor/EventStorageMiddleware/eventHandlers/getCommonMessageUpdates.ts @@ -17,7 +17,7 @@ * */ -import {MessageAddEvent} from 'src/script/conversation/EventBuilder'; +import {MessageAddEvent} from 'Repositories/conversation/EventBuilder'; import {StoredEvent} from 'src/script/storage'; export function getCommonMessageUpdates(originalEvent: StoredEvent, newEvent: MessageAddEvent) { diff --git a/src/script/event/preprocessor/EventStorageMiddleware/eventHandlers/linkPreviewEventHandler.ts b/src/script/event/preprocessor/EventStorageMiddleware/eventHandlers/linkPreviewEventHandler.ts index 040aa14e07a..ff21a4ec22d 100644 --- a/src/script/event/preprocessor/EventStorageMiddleware/eventHandlers/linkPreviewEventHandler.ts +++ b/src/script/event/preprocessor/EventStorageMiddleware/eventHandlers/linkPreviewEventHandler.ts @@ -17,7 +17,7 @@ * */ -import {MessageAddEvent} from 'src/script/conversation/EventBuilder'; +import {MessageAddEvent} from 'Repositories/conversation/EventBuilder'; import {categoryFromEvent} from 'src/script/message/MessageCategorization'; import {StoredEvent} from 'src/script/storage'; diff --git a/src/script/event/preprocessor/EventStorageMiddleware/eventHandlers/reactionEventHandler.ts b/src/script/event/preprocessor/EventStorageMiddleware/eventHandlers/reactionEventHandler.ts index 52c247e4df5..966039a61f0 100644 --- a/src/script/event/preprocessor/EventStorageMiddleware/eventHandlers/reactionEventHandler.ts +++ b/src/script/event/preprocessor/EventStorageMiddleware/eventHandlers/reactionEventHandler.ts @@ -17,7 +17,7 @@ * */ -import {MessageAddEvent, ReactionEvent} from 'src/script/conversation/EventBuilder'; +import {MessageAddEvent, ReactionEvent} from 'Repositories/conversation/EventBuilder'; import {StoredEvent} from 'src/script/storage'; import {addReaction, userReactionMapToReactionMap} from 'Util/ReactionUtil'; diff --git a/src/script/event/preprocessor/EventStorageMiddleware/types.ts b/src/script/event/preprocessor/EventStorageMiddleware/types.ts index db404ca160d..f93355c42a7 100644 --- a/src/script/event/preprocessor/EventStorageMiddleware/types.ts +++ b/src/script/event/preprocessor/EventStorageMiddleware/types.ts @@ -19,9 +19,9 @@ import {ConversationEvent} from '@wireapp/api-client/lib/event'; +import {ClientConversationEvent} from 'Repositories/conversation/EventBuilder'; import {EventRecord} from 'src/script/storage'; -import {ClientConversationEvent} from '../../../conversation/EventBuilder'; import {IdentifiedUpdatePayload} from '../../EventService'; export type HandledEvents = ClientConversationEvent | ConversationEvent; diff --git a/src/script/event/preprocessor/QuoteDecoderMiddleware.ts b/src/script/event/preprocessor/QuoteDecoderMiddleware.ts index 17da5532472..f072201602b 100644 --- a/src/script/event/preprocessor/QuoteDecoderMiddleware.ts +++ b/src/script/event/preprocessor/QuoteDecoderMiddleware.ts @@ -19,7 +19,7 @@ import {Quote} from '@wireapp/protocol-messaging'; -import {MessageAddEvent} from 'src/script/conversation/EventBuilder'; +import {MessageAddEvent} from 'Repositories/conversation/EventBuilder'; import {getLogger, Logger} from 'Util/Logger'; import {base64ToArray} from 'Util/util'; diff --git a/src/script/event/preprocessor/ReceiptsMiddleware.test.ts b/src/script/event/preprocessor/ReceiptsMiddleware.test.ts index 688e9559b07..b97ed49570d 100644 --- a/src/script/event/preprocessor/ReceiptsMiddleware.test.ts +++ b/src/script/event/preprocessor/ReceiptsMiddleware.test.ts @@ -17,7 +17,7 @@ * */ -import {ConfirmationEvent} from 'src/script/conversation/EventBuilder'; +import {ConfirmationEvent} from 'Repositories/conversation/EventBuilder'; import {User} from 'src/script/entity/User'; import {ClientEvent} from 'src/script/event/Client'; import {StatusType} from 'src/script/message/StatusType'; diff --git a/src/script/event/preprocessor/ReceiptsMiddleware.ts b/src/script/event/preprocessor/ReceiptsMiddleware.ts index 61af1744694..0441f66c3bb 100644 --- a/src/script/event/preprocessor/ReceiptsMiddleware.ts +++ b/src/script/event/preprocessor/ReceiptsMiddleware.ts @@ -19,11 +19,11 @@ import {RECEIPT_MODE} from '@wireapp/api-client/lib/conversation/data'; -import {ConfirmationEvent} from 'src/script/conversation/EventBuilder'; +import type {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; +import {ConfirmationEvent} from 'Repositories/conversation/EventBuilder'; import {User} from 'src/script/entity/User'; import {getLogger, Logger} from 'Util/Logger'; -import type {ConversationRepository} from '../../conversation/ConversationRepository'; import {StatusType} from '../../message/StatusType'; import type {EventRecord} from '../../storage/record/EventRecord'; import {ClientEvent} from '../Client'; diff --git a/src/script/event/preprocessor/RepliesUpdaterMiddleware.ts b/src/script/event/preprocessor/RepliesUpdaterMiddleware.ts index 5e97ff6d821..9efc233f7dc 100644 --- a/src/script/event/preprocessor/RepliesUpdaterMiddleware.ts +++ b/src/script/event/preprocessor/RepliesUpdaterMiddleware.ts @@ -17,7 +17,7 @@ * */ -import {DeleteEvent, MessageAddEvent} from 'src/script/conversation/EventBuilder'; +import {DeleteEvent, MessageAddEvent} from 'Repositories/conversation/EventBuilder'; import {getLogger, Logger} from 'Util/Logger'; import {QuoteEntity} from '../../message/QuoteEntity'; diff --git a/src/script/event/preprocessor/ServiceMiddleware.test.ts b/src/script/event/preprocessor/ServiceMiddleware.test.ts index 0c126c97f62..a5d9f46aab5 100644 --- a/src/script/event/preprocessor/ServiceMiddleware.test.ts +++ b/src/script/event/preprocessor/ServiceMiddleware.test.ts @@ -17,8 +17,8 @@ * */ -import {ConversationRepository} from 'src/script/conversation/ConversationRepository'; -import {EventBuilder} from 'src/script/conversation/EventBuilder'; +import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; +import {EventBuilder} from 'Repositories/conversation/EventBuilder'; import {Conversation} from 'src/script/entity/Conversation'; import {User} from 'src/script/entity/User'; import {UserRepository} from 'src/script/user/UserRepository'; diff --git a/src/script/event/preprocessor/ServiceMiddleware.ts b/src/script/event/preprocessor/ServiceMiddleware.ts index ac6554d3c90..31488653245 100644 --- a/src/script/event/preprocessor/ServiceMiddleware.ts +++ b/src/script/event/preprocessor/ServiceMiddleware.ts @@ -20,12 +20,12 @@ import {CONVERSATION_EVENT, ConversationMemberJoinEvent} from '@wireapp/api-client/lib/event/'; import type {QualifiedId} from '@wireapp/api-client/lib/user/'; -import {MemberJoinEvent, OneToOneCreationEvent} from 'src/script/conversation/EventBuilder'; +import type {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; +import {MemberJoinEvent, OneToOneCreationEvent} from 'Repositories/conversation/EventBuilder'; import {User} from 'src/script/entity/User'; import {getLogger, Logger} from 'Util/Logger'; import {matchQualifiedIds} from 'Util/QualifiedId'; -import type {ConversationRepository} from '../../conversation/ConversationRepository'; import type {UserRepository} from '../../user/UserRepository'; import {ClientEvent} from '../Client'; import {EventMiddleware, IncomingEvent} from '../EventProcessor'; diff --git a/src/script/event/processor/FederationEventProcessor/FederationEventProcessor.ts b/src/script/event/processor/FederationEventProcessor/FederationEventProcessor.ts index 30930899328..fb2cba70e82 100644 --- a/src/script/event/processor/FederationEventProcessor/FederationEventProcessor.ts +++ b/src/script/event/processor/FederationEventProcessor/FederationEventProcessor.ts @@ -21,9 +21,9 @@ import {FEDERATION_EVENT} from '@wireapp/api-client/lib/event'; import {container} from 'tsyringe'; import {debounce} from 'underscore'; -import {ConversationState} from 'src/script/conversation/ConversationState'; -import {ConversationStatus} from 'src/script/conversation/ConversationStatus'; -import {EventBuilder} from 'src/script/conversation/EventBuilder'; +import {ConversationState} from 'Repositories/conversation/ConversationState'; +import {ConversationStatus} from 'Repositories/conversation/ConversationStatus'; +import {EventBuilder} from 'Repositories/conversation/EventBuilder'; import {Conversation} from 'src/script/entity/Conversation'; import {User} from 'src/script/entity/User'; import {ServerTimeHandler} from 'src/script/time/serverTimeHandler'; diff --git a/src/script/integration/IntegrationRepository.ts b/src/script/integration/IntegrationRepository.ts index e6c7e3d213a..6e57b2b245d 100644 --- a/src/script/integration/IntegrationRepository.ts +++ b/src/script/integration/IntegrationRepository.ts @@ -21,6 +21,9 @@ import type {ConversationMemberJoinEvent} from '@wireapp/api-client/lib/event/'; import ko from 'knockout'; import {container} from 'tsyringe'; +import type {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; +import {ConversationState} from 'Repositories/conversation/ConversationState'; +import {MemberLeaveEvent} from 'Repositories/conversation/EventBuilder'; import {getLogger, Logger} from 'Util/Logger'; import {compareTransliteration, sortByPriority} from 'Util/StringUtil'; @@ -29,9 +32,6 @@ import type {IntegrationService} from './IntegrationService'; import {ProviderEntity} from './ProviderEntity'; import {ServiceEntity} from './ServiceEntity'; -import type {ConversationRepository} from '../conversation/ConversationRepository'; -import {ConversationState} from '../conversation/ConversationState'; -import {MemberLeaveEvent} from '../conversation/EventBuilder'; import type {Conversation} from '../entity/Conversation'; import type {User} from '../entity/User'; import type {TeamRepository} from '../team/TeamRepository'; diff --git a/src/script/legal-hold/LegalHoldWarning.ts b/src/script/legal-hold/LegalHoldWarning.ts index 43a9f415622..592084ce808 100644 --- a/src/script/legal-hold/LegalHoldWarning.ts +++ b/src/script/legal-hold/LegalHoldWarning.ts @@ -20,10 +20,10 @@ import {amplify} from 'amplify'; import {useLegalHoldModalState} from 'Components/Modals/LegalHoldModal/LegalHoldModal.state'; +import {PrimaryModal} from 'Components/Modals/PrimaryModal'; +import {ConversationVerificationState} from 'Repositories/conversation/ConversationVerificationState'; import {t} from 'Util/LocalizerUtil'; -import {PrimaryModal} from '../components/Modals/PrimaryModal'; -import {ConversationVerificationState} from '../conversation/ConversationVerificationState'; import type {Conversation} from '../entity/Conversation'; import {ConversationError} from '../error/ConversationError'; import {OPEN_CONVERSATION_DETAILS} from '../page/RightSidebar/RightSidebar'; diff --git a/src/script/main/app.ts b/src/script/main/app.ts index d2ea321694c..4f4415eafb6 100644 --- a/src/script/main/app.ts +++ b/src/script/main/app.ts @@ -42,6 +42,12 @@ import {ClientRepository, ClientService} from 'Repositories/client'; import {getClientMLSConfig} from 'Repositories/client/clientMLSConfig'; import {ConnectionRepository} from 'Repositories/connection/ConnectionRepository'; import {ConnectionService} from 'Repositories/connection/ConnectionService'; +import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; +import {ConversationService} from 'Repositories/conversation/ConversationService'; +import {ConversationVerificationState} from 'Repositories/conversation/ConversationVerificationState'; +import {OnConversationE2EIVerificationStateChange} from 'Repositories/conversation/ConversationVerificationStateHandler/shared'; +import {EventBuilder} from 'Repositories/conversation/EventBuilder'; +import {MessageRepository} from 'Repositories/conversation/MessageRepository'; import {initializeDataDog} from 'Util/DataDog'; import {DebugUtil} from 'Util/DebugUtil'; import {Environment} from 'Util/Environment'; @@ -56,12 +62,6 @@ import '../../style/default.less'; import {SIGN_OUT_REASON} from '../auth/SignOutReason'; import {URLParameter} from '../auth/URLParameter'; import {Configuration} from '../Config'; -import {ConversationRepository} from '../conversation/ConversationRepository'; -import {ConversationService} from '../conversation/ConversationService'; -import {ConversationVerificationState} from '../conversation/ConversationVerificationState'; -import {OnConversationE2EIVerificationStateChange} from '../conversation/ConversationVerificationStateHandler/shared'; -import {EventBuilder} from '../conversation/EventBuilder'; -import {MessageRepository} from '../conversation/MessageRepository'; import {CryptographyRepository} from '../cryptography/CryptographyRepository'; import {getModalOptions, ModalType} from '../E2EIdentity/Modals'; import {User} from '../entity/User'; diff --git a/src/script/mls/MLSConversations.test.ts b/src/script/mls/MLSConversations.test.ts index 1a702dfcc3c..cbdfd3cefe6 100644 --- a/src/script/mls/MLSConversations.test.ts +++ b/src/script/mls/MLSConversations.test.ts @@ -23,9 +23,10 @@ import {randomUUID} from 'crypto'; import {Account} from '@wireapp/core'; +import {MLSConversation} from 'Repositories/conversation/ConversationSelectors'; + import {initMLSGroupConversations, initialiseSelfAndTeamConversations} from './MLSConversations'; -import {MLSConversation} from '../conversation/ConversationSelectors'; import {Conversation} from '../entity/Conversation'; import {User} from '../entity/User'; diff --git a/src/script/mls/MLSConversations.ts b/src/script/mls/MLSConversations.ts index fea7dffbd8d..5ab7a63bce1 100644 --- a/src/script/mls/MLSConversations.ts +++ b/src/script/mls/MLSConversations.ts @@ -29,7 +29,8 @@ import { isTeamConversation, MLSCapableConversation, MLSConversation, -} from '../conversation/ConversationSelectors'; +} from 'Repositories/conversation/ConversationSelectors'; + import {Conversation} from '../entity/Conversation'; import {User} from '../entity/User'; diff --git a/src/script/mls/MLSMigration/migrationFinaliser/joinConversationsAfterMigrationFinalisation/joinConversationsAfterMigrationFinalisation.test.ts b/src/script/mls/MLSMigration/migrationFinaliser/joinConversationsAfterMigrationFinalisation/joinConversationsAfterMigrationFinalisation.test.ts index 75a5da929d8..6bf45b3fc99 100644 --- a/src/script/mls/MLSMigration/migrationFinaliser/joinConversationsAfterMigrationFinalisation/joinConversationsAfterMigrationFinalisation.test.ts +++ b/src/script/mls/MLSMigration/migrationFinaliser/joinConversationsAfterMigrationFinalisation/joinConversationsAfterMigrationFinalisation.test.ts @@ -25,7 +25,7 @@ import { } from '@wireapp/api-client/lib/conversation'; import {container} from 'tsyringe'; -import {ConversationDatabaseData, ConversationMapper} from 'src/script/conversation/ConversationMapper'; +import {ConversationDatabaseData, ConversationMapper} from 'Repositories/conversation/ConversationMapper'; import {User} from 'src/script/entity/User'; import {Core} from 'src/script/service/CoreSingleton'; import {createUuid} from 'Util/uuid'; diff --git a/src/script/mls/MLSMigration/migrationFinaliser/joinConversationsAfterMigrationFinalisation/joinConversationsAfterMigrationFinalisation.ts b/src/script/mls/MLSMigration/migrationFinaliser/joinConversationsAfterMigrationFinalisation/joinConversationsAfterMigrationFinalisation.ts index 59cfc1b2be1..6d232aceb26 100644 --- a/src/script/mls/MLSMigration/migrationFinaliser/joinConversationsAfterMigrationFinalisation/joinConversationsAfterMigrationFinalisation.ts +++ b/src/script/mls/MLSMigration/migrationFinaliser/joinConversationsAfterMigrationFinalisation/joinConversationsAfterMigrationFinalisation.ts @@ -21,7 +21,7 @@ import {ConversationProtocol} from '@wireapp/api-client/lib/conversation'; import {Account} from '@wireapp/core'; -import {MLSConversation, isMLSConversation} from 'src/script/conversation/ConversationSelectors'; +import {MLSConversation, isMLSConversation} from 'Repositories/conversation/ConversationSelectors'; import {Conversation} from 'src/script/entity/Conversation'; import {initMLSGroupConversations} from 'src/script/mls/MLSConversations'; diff --git a/src/script/mls/MLSMigration/migrationFinaliser/migrationFinaliser.test.ts b/src/script/mls/MLSMigration/migrationFinaliser/migrationFinaliser.test.ts index 72d56ad6482..062202de23c 100644 --- a/src/script/mls/MLSMigration/migrationFinaliser/migrationFinaliser.test.ts +++ b/src/script/mls/MLSMigration/migrationFinaliser/migrationFinaliser.test.ts @@ -20,7 +20,7 @@ import {ConversationProtocol, CONVERSATION_TYPE} from '@wireapp/api-client/lib/conversation'; import {FeatureStatus} from '@wireapp/api-client/lib/team'; -import {MixedConversation, MLSConversation} from 'src/script/conversation/ConversationSelectors'; +import {MixedConversation, MLSConversation} from 'Repositories/conversation/ConversationSelectors'; import {Conversation} from 'src/script/entity/Conversation'; import {TestFactory} from 'test/helper/TestFactory'; import {generateUser} from 'test/helper/UserGenerator'; diff --git a/src/script/mls/MLSMigration/migrationFinaliser/migrationFinaliser.ts b/src/script/mls/MLSMigration/migrationFinaliser/migrationFinaliser.ts index c12c1eaed3d..e22372b38ed 100644 --- a/src/script/mls/MLSMigration/migrationFinaliser/migrationFinaliser.ts +++ b/src/script/mls/MLSMigration/migrationFinaliser/migrationFinaliser.ts @@ -19,7 +19,11 @@ import {ConversationProtocol} from '@wireapp/api-client/lib/conversation'; -import {MixedConversation, isMLSConversation, isMixedConversation} from 'src/script/conversation/ConversationSelectors'; +import { + MixedConversation, + isMLSConversation, + isMixedConversation, +} from 'Repositories/conversation/ConversationSelectors'; import {Conversation} from 'src/script/entity/Conversation'; import {MLSMigrationStatus} from '../migrationStatus'; diff --git a/src/script/mls/MLSMigration/migrationInitialiser/joinUnestablishedMixedConversations/joinUnestablishedMixedConversations.test.ts b/src/script/mls/MLSMigration/migrationInitialiser/joinUnestablishedMixedConversations/joinUnestablishedMixedConversations.test.ts index 8b0ba54d462..f22c46bd4b8 100644 --- a/src/script/mls/MLSMigration/migrationInitialiser/joinUnestablishedMixedConversations/joinUnestablishedMixedConversations.test.ts +++ b/src/script/mls/MLSMigration/migrationInitialiser/joinUnestablishedMixedConversations/joinUnestablishedMixedConversations.test.ts @@ -20,7 +20,7 @@ import {ConversationProtocol, CONVERSATION_TYPE} from '@wireapp/api-client/lib/conversation'; import {container} from 'tsyringe'; -import {MixedConversation} from 'src/script/conversation/ConversationSelectors'; +import {MixedConversation} from 'Repositories/conversation/ConversationSelectors'; import {Conversation} from 'src/script/entity/Conversation'; import {User} from 'src/script/entity/User'; import {Core} from 'src/script/service/CoreSingleton'; diff --git a/src/script/mls/MLSMigration/migrationInitialiser/joinUnestablishedMixedConversations/joinUnestablishedMixedConversations.ts b/src/script/mls/MLSMigration/migrationInitialiser/joinUnestablishedMixedConversations/joinUnestablishedMixedConversations.ts index f56127f1b76..552140e713e 100644 --- a/src/script/mls/MLSMigration/migrationInitialiser/joinUnestablishedMixedConversations/joinUnestablishedMixedConversations.ts +++ b/src/script/mls/MLSMigration/migrationInitialiser/joinUnestablishedMixedConversations/joinUnestablishedMixedConversations.ts @@ -21,7 +21,7 @@ import {QualifiedId} from '@wireapp/api-client/lib/user'; import {Account} from '@wireapp/core'; -import {isMixedConversation, MixedConversation} from 'src/script/conversation/ConversationSelectors'; +import {isMixedConversation, MixedConversation} from 'Repositories/conversation/ConversationSelectors'; import {Conversation} from 'src/script/entity/Conversation'; import {initMLSGroupConversation} from 'src/script/mls/MLSConversations'; diff --git a/src/script/mls/MLSMigration/migrationInitialiser/migrationInitialiser.test.ts b/src/script/mls/MLSMigration/migrationInitialiser/migrationInitialiser.test.ts index 77cea1dc388..2b905cc7b53 100644 --- a/src/script/mls/MLSMigration/migrationInitialiser/migrationInitialiser.test.ts +++ b/src/script/mls/MLSMigration/migrationInitialiser/migrationInitialiser.test.ts @@ -21,7 +21,7 @@ import {ConversationProtocol, CONVERSATION_TYPE} from '@wireapp/api-client/lib/c import {QualifiedId} from '@wireapp/api-client/lib/user'; import {container} from 'tsyringe'; -import {MixedConversation, ProteusConversation} from 'src/script/conversation/ConversationSelectors'; +import {MixedConversation, ProteusConversation} from 'Repositories/conversation/ConversationSelectors'; import {Conversation} from 'src/script/entity/Conversation'; import {Core} from 'src/script/service/CoreSingleton'; import {TestFactory} from 'test/helper/TestFactory'; diff --git a/src/script/mls/MLSMigration/migrationInitialiser/migrationInitialiser.ts b/src/script/mls/MLSMigration/migrationInitialiser/migrationInitialiser.ts index 2de914c2e22..48243734e91 100644 --- a/src/script/mls/MLSMigration/migrationInitialiser/migrationInitialiser.ts +++ b/src/script/mls/MLSMigration/migrationInitialiser/migrationInitialiser.ts @@ -24,7 +24,7 @@ import { ProteusConversation, isMixedConversation, isProteusConversation, -} from 'src/script/conversation/ConversationSelectors'; +} from 'Repositories/conversation/ConversationSelectors'; import {Conversation} from 'src/script/entity/Conversation'; import {mlsMigrationLogger} from '../MLSMigrationLogger'; diff --git a/src/script/notification/NotificationRepository.test.ts b/src/script/notification/NotificationRepository.test.ts index 1f36487a212..0da471f86bd 100644 --- a/src/script/notification/NotificationRepository.test.ts +++ b/src/script/notification/NotificationRepository.test.ts @@ -34,8 +34,9 @@ import {CallingViewMode, CallState} from 'Repositories/calling/CallState'; import {TERMINATION_REASON} from 'Repositories/calling/enum/TerminationReason'; import {ConnectionEntity} from 'Repositories/connection/ConnectionEntity'; import {ConnectionMapper} from 'Repositories/connection/ConnectionMapper'; -import {ConversationMapper} from 'src/script/conversation/ConversationMapper'; -import {NOTIFICATION_STATE} from 'src/script/conversation/NotificationSetting'; +import {ConversationMapper} from 'Repositories/conversation/ConversationMapper'; +import {ConversationState} from 'Repositories/conversation/ConversationState'; +import {NOTIFICATION_STATE} from 'Repositories/conversation/NotificationSetting'; import {Conversation} from 'src/script/entity/Conversation'; import {CallMessage} from 'src/script/entity/message/CallMessage'; import {CompositeMessage} from 'src/script/entity/message/CompositeMessage'; @@ -63,7 +64,6 @@ import {createUuid} from 'Util/uuid'; import {NotificationRepository} from './NotificationRepository'; -import {ConversationState} from '../conversation/ConversationState'; import {Message} from '../entity/message/Message'; import {PermissionRepository} from '../permission/PermissionRepository'; import {UserMapper} from '../user/UserMapper'; diff --git a/src/script/notification/NotificationRepository.ts b/src/script/notification/NotificationRepository.ts index eba2070e32f..108f8d2e02d 100644 --- a/src/script/notification/NotificationRepository.ts +++ b/src/script/notification/NotificationRepository.ts @@ -34,6 +34,9 @@ import {CallingRepository} from 'Repositories/calling/CallingRepository'; import {CallingViewMode, CallState} from 'Repositories/calling/CallState'; import {TERMINATION_REASON} from 'Repositories/calling/enum/TerminationReason'; import type {ConnectionEntity} from 'Repositories/connection/ConnectionEntity'; +import {ConversationEphemeralHandler} from 'Repositories/conversation/ConversationEphemeralHandler'; +import type {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; +import {ConversationState} from 'Repositories/conversation/ConversationState'; import {Declension, t, getUserName} from 'Util/LocalizerUtil'; import {getLogger, Logger} from 'Util/Logger'; import {getRenderedTextContent} from 'Util/messageRenderer'; @@ -43,9 +46,6 @@ import {ValidationUtilError} from 'Util/ValidationUtil'; import {PermissionState} from './PermissionState'; -import {ConversationEphemeralHandler} from '../conversation/ConversationEphemeralHandler'; -import type {ConversationRepository} from '../conversation/ConversationRepository'; -import {ConversationState} from '../conversation/ConversationState'; import type {Conversation} from '../entity/Conversation'; import type {CallMessage} from '../entity/message/CallMessage'; import type {ContentMessage} from '../entity/message/ContentMessage'; diff --git a/src/script/page/AppMain.tsx b/src/script/page/AppMain.tsx index 7f6bb217d6e..55b9069338d 100644 --- a/src/script/page/AppMain.tsx +++ b/src/script/page/AppMain.tsx @@ -34,7 +34,10 @@ import {GroupCreationModal} from 'Components/Modals/GroupCreation/GroupCreationM import {LegalHoldModal} from 'Components/Modals/LegalHoldModal/LegalHoldModal'; import {PrimaryModal} from 'Components/Modals/PrimaryModal'; import {showUserModal, UserModal} from 'Components/Modals/UserModal'; +import {useActiveWindow} from 'Hooks/useActiveWindow'; +import {useInitializeRootFontSize} from 'Hooks/useRootFontSize'; import {CallingViewMode, CallState, DesktopScreenShareMenu} from 'Repositories/calling/CallState'; +import {ConversationState} from 'Repositories/conversation/ConversationState'; import {Config} from 'src/script/Config'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; @@ -49,10 +52,7 @@ import {RootProvider} from './RootProvider'; import {useAppMainState, ViewType} from './state'; import {useAppState, ContentState} from './useAppState'; -import {ConversationState} from '../conversation/ConversationState'; import {User} from '../entity/User'; -import {useActiveWindow} from '../hooks/useActiveWindow'; -import {useInitializeRootFontSize} from '../hooks/useRootFontSize'; import {App} from '../main/app'; import {initialiseMLSMigrationFlow} from '../mls/MLSMigration'; import {generateConversationUrl} from '../router/routeGenerator'; diff --git a/src/script/page/LeftSidebar/panels/Conversations/ConversationHeader/ConversationHeader.tsx b/src/script/page/LeftSidebar/panels/Conversations/ConversationHeader/ConversationHeader.tsx index ee068fc00cd..97dab1a5c23 100644 --- a/src/script/page/LeftSidebar/panels/Conversations/ConversationHeader/ConversationHeader.tsx +++ b/src/script/page/LeftSidebar/panels/Conversations/ConversationHeader/ConversationHeader.tsx @@ -25,7 +25,7 @@ import {CircleCloseIcon, IconButton, Input, SearchIcon} from '@wireapp/react-ui- import {WebAppEvents} from '@wireapp/webapp-events'; import * as Icon from 'Components/Icon'; -import {ConversationLabel} from 'src/script/conversation/ConversationLabelRepository'; +import {ConversationLabel} from 'Repositories/conversation/ConversationLabelRepository'; import {SidebarTabs} from 'src/script/page/LeftSidebar/panels/Conversations/useSidebarStore'; import {handleEnterDown, handleEscDown} from 'Util/KeyboardUtil'; import {t} from 'Util/LocalizerUtil'; diff --git a/src/script/page/LeftSidebar/panels/Conversations/ConversationSidebar/ConversationSidebar.tsx b/src/script/page/LeftSidebar/panels/Conversations/ConversationSidebar/ConversationSidebar.tsx index a23c2bd8eda..9f01a993d81 100644 --- a/src/script/page/LeftSidebar/panels/Conversations/ConversationSidebar/ConversationSidebar.tsx +++ b/src/script/page/LeftSidebar/panels/Conversations/ConversationSidebar/ConversationSidebar.tsx @@ -20,8 +20,8 @@ import {ChevronIcon, IconButton} from '@wireapp/react-ui-kit'; import {FadingScrollbar} from 'Components/FadingScrollbar'; -import {ConversationRepository} from 'src/script/conversation/ConversationRepository'; -import {ConversationState} from 'src/script/conversation/ConversationState'; +import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; +import {ConversationState} from 'Repositories/conversation/ConversationState'; import {Conversation} from 'src/script/entity/Conversation'; import { diff --git a/src/script/page/LeftSidebar/panels/Conversations/ConversationTab/ConversationFolderTab.test.tsx b/src/script/page/LeftSidebar/panels/Conversations/ConversationTab/ConversationFolderTab.test.tsx index dddb1387fdd..ae1538579b0 100644 --- a/src/script/page/LeftSidebar/panels/Conversations/ConversationTab/ConversationFolderTab.test.tsx +++ b/src/script/page/LeftSidebar/panels/Conversations/ConversationTab/ConversationFolderTab.test.tsx @@ -20,7 +20,7 @@ import {render} from '@testing-library/react'; import * as Icon from 'Components/Icon'; -import {createLabel, LabelType} from 'src/script/conversation/ConversationLabelRepository'; +import {createLabel, LabelType} from 'Repositories/conversation/ConversationLabelRepository'; import {Conversation} from 'src/script/entity/Conversation'; import {TestFactory} from 'test/helper/TestFactory'; diff --git a/src/script/page/LeftSidebar/panels/Conversations/ConversationTab/ConversationFolderTab.tsx b/src/script/page/LeftSidebar/panels/Conversations/ConversationTab/ConversationFolderTab.tsx index 419eefef21b..ce4dfaa4905 100644 --- a/src/script/page/LeftSidebar/panels/Conversations/ConversationTab/ConversationFolderTab.tsx +++ b/src/script/page/LeftSidebar/panels/Conversations/ConversationTab/ConversationFolderTab.tsx @@ -22,9 +22,9 @@ import {useMemo} from 'react'; import cx from 'classnames'; import * as Icons from 'Components/Icon'; +import {createLabel, LabelType} from 'Repositories/conversation/ConversationLabelRepository'; +import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; import {Config} from 'src/script/Config'; -import {createLabel, LabelType} from 'src/script/conversation/ConversationLabelRepository'; -import {ConversationRepository} from 'src/script/conversation/ConversationRepository'; import {Conversation} from 'src/script/entity/Conversation'; import {useFolderStore} from 'src/script/page/LeftSidebar/panels/Conversations/useFoldersStore'; import { diff --git a/src/script/page/LeftSidebar/panels/Conversations/ConversationTabs/ConversationTabs.tsx b/src/script/page/LeftSidebar/panels/Conversations/ConversationTabs/ConversationTabs.tsx index 2af54de52d2..3cbd6b1ee25 100644 --- a/src/script/page/LeftSidebar/panels/Conversations/ConversationTabs/ConversationTabs.tsx +++ b/src/script/page/LeftSidebar/panels/Conversations/ConversationTabs/ConversationTabs.tsx @@ -22,7 +22,7 @@ import {container} from 'tsyringe'; import {GroupIcon, MessageIcon, StarIcon, ExternalLinkIcon, Tooltip, SupportIcon} from '@wireapp/react-ui-kit'; import * as Icon from 'Components/Icon'; -import {ConversationRepository} from 'src/script/conversation/ConversationRepository'; +import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; import {User} from 'src/script/entity/User'; import {ConversationFolderTab} from 'src/script/page/LeftSidebar/panels/Conversations/ConversationTab/ConversationFolderTab'; import {SidebarTabs} from 'src/script/page/LeftSidebar/panels/Conversations/useSidebarStore'; diff --git a/src/script/page/LeftSidebar/panels/Conversations/Conversations.test.tsx b/src/script/page/LeftSidebar/panels/Conversations/Conversations.test.tsx index c9263510163..6a82cd6aa07 100644 --- a/src/script/page/LeftSidebar/panels/Conversations/Conversations.test.tsx +++ b/src/script/page/LeftSidebar/panels/Conversations/Conversations.test.tsx @@ -22,8 +22,8 @@ import React from 'react'; import {act, render} from '@testing-library/react'; import {observable} from 'knockout'; +import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; import {withTheme} from 'src/script/auth/util/test/TestUtil'; -import {ConversationRepository} from 'src/script/conversation/ConversationRepository'; import {User} from 'src/script/entity/User'; import {ListState} from 'src/script/page/useAppState'; import {SearchRepository} from 'src/script/search/SearchRepository'; diff --git a/src/script/page/LeftSidebar/panels/Conversations/Conversations.tsx b/src/script/page/LeftSidebar/panels/Conversations/Conversations.tsx index 89e4aa397ec..47887c3f5a4 100644 --- a/src/script/page/LeftSidebar/panels/Conversations/Conversations.tsx +++ b/src/script/page/LeftSidebar/panels/Conversations/Conversations.tsx @@ -25,7 +25,11 @@ import {container} from 'tsyringe'; import {useMatchMedia} from '@wireapp/react-ui-kit'; import {WebAppEvents} from '@wireapp/webapp-events'; +import {useConversationFocus} from 'Hooks/useConversationFocus'; import {CallState} from 'Repositories/calling/CallState'; +import {createLabel} from 'Repositories/conversation/ConversationLabelRepository'; +import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; +import {ConversationState} from 'Repositories/conversation/ConversationState'; import {IntegrationRepository} from 'src/script/integration/IntegrationRepository'; import {Preferences} from 'src/script/page/LeftSidebar/panels/Preferences'; import {StartUI} from 'src/script/page/LeftSidebar/panels/StartUI'; @@ -49,12 +53,8 @@ import {getTabConversations, scrollToConversation} from './helpers'; import {useFolderStore} from './useFoldersStore'; import {SidebarStatus, SidebarTabs, useSidebarStore} from './useSidebarStore'; -import {createLabel} from '../../../../conversation/ConversationLabelRepository'; -import {ConversationRepository} from '../../../../conversation/ConversationRepository'; -import {ConversationState} from '../../../../conversation/ConversationState'; import type {Conversation} from '../../../../entity/Conversation'; import {User} from '../../../../entity/User'; -import {useConversationFocus} from '../../../../hooks/useConversationFocus'; import {PreferenceNotificationRepository} from '../../../../notification/PreferenceNotificationRepository'; import {PropertiesRepository} from '../../../../properties/PropertiesRepository'; import {generateConversationUrl} from '../../../../router/routeGenerator'; diff --git a/src/script/page/LeftSidebar/panels/Conversations/ConversationsList.test.tsx b/src/script/page/LeftSidebar/panels/Conversations/ConversationsList.test.tsx index 2c6cdc33798..f650dcae1aa 100644 --- a/src/script/page/LeftSidebar/panels/Conversations/ConversationsList.test.tsx +++ b/src/script/page/LeftSidebar/panels/Conversations/ConversationsList.test.tsx @@ -22,8 +22,8 @@ import {ConversationProtocol, CONVERSATION_TYPE} from '@wireapp/api-client/lib/c import ko from 'knockout'; import {CallState} from 'Repositories/calling/CallState'; -import {ConversationLabel, ConversationLabelRepository} from 'src/script/conversation/ConversationLabelRepository'; -import {ConversationState} from 'src/script/conversation/ConversationState'; +import {ConversationLabel, ConversationLabelRepository} from 'Repositories/conversation/ConversationLabelRepository'; +import {ConversationState} from 'Repositories/conversation/ConversationState'; import {Conversation} from 'src/script/entity/Conversation'; import {User} from 'src/script/entity/User'; import {ListViewModel} from 'src/script/view_model/ListViewModel'; diff --git a/src/script/page/LeftSidebar/panels/Conversations/ConversationsList.tsx b/src/script/page/LeftSidebar/panels/Conversations/ConversationsList.tsx index 9f8e6636116..b84fdd8144d 100644 --- a/src/script/page/LeftSidebar/panels/Conversations/ConversationsList.tsx +++ b/src/script/page/LeftSidebar/panels/Conversations/ConversationsList.tsx @@ -22,7 +22,8 @@ import React, {MouseEvent as ReactMouseEvent, KeyboardEvent as ReactKeyBoardEven import {ConversationListCell} from 'Components/ConversationListCell'; import {Call} from 'Repositories/calling/Call'; import {CallState} from 'Repositories/calling/CallState'; -import {ConversationLabel, ConversationLabelRepository} from 'src/script/conversation/ConversationLabelRepository'; +import {ConversationLabel, ConversationLabelRepository} from 'Repositories/conversation/ConversationLabelRepository'; +import {ConversationState} from 'Repositories/conversation/ConversationState'; import {User} from 'src/script/entity/User'; import {SidebarTabs, useSidebarStore} from 'src/script/page/LeftSidebar/panels/Conversations/useSidebarStore'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; @@ -34,7 +35,6 @@ import {ConnectionRequests} from './ConnectionRequests'; import {conversationsList, headingTitle, noResultsMessage} from './ConversationsList.styles'; import {conversationSearchFilter, scrollToConversation} from './helpers'; -import {ConversationState} from '../../../../conversation/ConversationState'; import {Conversation} from '../../../../entity/Conversation'; import {generateConversationUrl} from '../../../../router/routeGenerator'; import {createNavigate, createNavigateKeyboard} from '../../../../router/routerBindings'; diff --git a/src/script/page/LeftSidebar/panels/Conversations/GroupedConversationHeader.tsx b/src/script/page/LeftSidebar/panels/Conversations/GroupedConversationHeader.tsx index 209a4365955..b566132365f 100644 --- a/src/script/page/LeftSidebar/panels/Conversations/GroupedConversationHeader.tsx +++ b/src/script/page/LeftSidebar/panels/Conversations/GroupedConversationHeader.tsx @@ -22,10 +22,9 @@ import React, {useEffect, useState} from 'react'; import cx from 'classnames'; import * as Icon from 'Components/Icon'; +import type {ConversationLabel} from 'Repositories/conversation/ConversationLabelRepository'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; -import type {ConversationLabel} from '../../../../conversation/ConversationLabelRepository'; - export interface GroupedConversationHeaderProps { conversationLabel: ConversationLabel; isOpen: boolean; diff --git a/src/script/page/LeftSidebar/panels/Conversations/getGroupParticipantsConversation.ts b/src/script/page/LeftSidebar/panels/Conversations/getGroupParticipantsConversation.ts index 91cb250d518..b7529755162 100644 --- a/src/script/page/LeftSidebar/panels/Conversations/getGroupParticipantsConversation.ts +++ b/src/script/page/LeftSidebar/panels/Conversations/getGroupParticipantsConversation.ts @@ -17,8 +17,8 @@ * */ -import {ConversationLabel} from 'src/script/conversation/ConversationLabelRepository'; -import {ConversationRepository} from 'src/script/conversation/ConversationRepository'; +import {ConversationLabel} from 'Repositories/conversation/ConversationLabelRepository'; +import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; import {Conversation} from 'src/script/entity/Conversation'; import {SearchRepository} from 'src/script/search/SearchRepository'; diff --git a/src/script/page/LeftSidebar/panels/StartUI/PeopleTab.tsx b/src/script/page/LeftSidebar/panels/StartUI/PeopleTab.tsx index 598082f6ace..fc0652aceca 100644 --- a/src/script/page/LeftSidebar/panels/StartUI/PeopleTab.tsx +++ b/src/script/page/LeftSidebar/panels/StartUI/PeopleTab.tsx @@ -25,6 +25,8 @@ import {partition} from 'underscore'; import * as Icon from 'Components/Icon'; import {UserList, UserlistMode} from 'Components/UserList'; +import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; +import {ConversationState} from 'Repositories/conversation/ConversationState'; import {UserRepository} from 'src/script/user/UserRepository'; import {t} from 'Util/LocalizerUtil'; import {getLogger} from 'Util/Logger'; @@ -34,8 +36,6 @@ import {isBackendError} from 'Util/TypePredicateUtil'; import {TopPeople} from './components/TopPeople'; -import {ConversationRepository} from '../../../../conversation/ConversationRepository'; -import {ConversationState} from '../../../../conversation/ConversationState'; import {User} from '../../../../entity/User'; import {getManageTeamUrl} from '../../../../externalRoute'; import {useDebounce} from '../../../../hooks/useDebounce'; diff --git a/src/script/page/LeftSidebar/panels/StartUI/StartUI.tsx b/src/script/page/LeftSidebar/panels/StartUI/StartUI.tsx index 4e88d55c14b..4fad0ee3a4e 100644 --- a/src/script/page/LeftSidebar/panels/StartUI/StartUI.tsx +++ b/src/script/page/LeftSidebar/panels/StartUI/StartUI.tsx @@ -26,6 +26,8 @@ import {showInviteModal} from 'Components/Modals/InviteModal'; import {showServiceModal} from 'Components/Modals/ServiceModal'; import {showUserModal} from 'Components/Modals/UserModal'; import {SearchInput} from 'Components/SearchInput'; +import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; +import {ConversationState} from 'Repositories/conversation/ConversationState'; import {User} from 'src/script/entity/User'; import {IntegrationRepository} from 'src/script/integration/IntegrationRepository'; import {ServiceEntity} from 'src/script/integration/ServiceEntity'; @@ -38,8 +40,6 @@ import {PeopleTab, SearchResultsData} from './PeopleTab'; import {ServicesTab} from './ServicesTab'; import {Config} from '../../../../Config'; -import {ConversationRepository} from '../../../../conversation/ConversationRepository'; -import {ConversationState} from '../../../../conversation/ConversationState'; import {SearchRepository} from '../../../../search/SearchRepository'; import {TeamRepository} from '../../../../team/TeamRepository'; import {TeamState} from '../../../../team/TeamState'; diff --git a/src/script/page/MainContent/MainContent.tsx b/src/script/page/MainContent/MainContent.tsx index f80bec2e2a2..6ecc5851f9b 100644 --- a/src/script/page/MainContent/MainContent.tsx +++ b/src/script/page/MainContent/MainContent.tsx @@ -30,6 +30,7 @@ import {HistoryImport} from 'Components/HistoryImport'; import * as Icon from 'Components/Icon'; import {useLegalHoldModalState} from 'Components/Modals/LegalHoldModal/LegalHoldModal.state'; import {ClientState} from 'Repositories/client/ClientState'; +import {ConversationState} from 'Repositories/conversation/ConversationState'; import {User} from 'src/script/entity/User'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; @@ -42,7 +43,6 @@ import {AVPreferences} from './panels/preferences/AVPreferences'; import {DevicesPreferences} from './panels/preferences/DevicesPreferences'; import {OptionPreferences} from './panels/preferences/OptionPreferences'; -import {ConversationState} from '../../conversation/ConversationState'; import {TeamState} from '../../team/TeamState'; import {UserState} from '../../user/UserState'; import {RightSidebarParams} from '../AppMain'; diff --git a/src/script/page/MainContent/panels/Collection/Collection.test.tsx b/src/script/page/MainContent/panels/Collection/Collection.test.tsx index 0e363e39783..9a8c4ffc01c 100644 --- a/src/script/page/MainContent/panels/Collection/Collection.test.tsx +++ b/src/script/page/MainContent/panels/Collection/Collection.test.tsx @@ -21,6 +21,7 @@ import {fireEvent, render, waitFor, act} from '@testing-library/react'; import {container} from 'tsyringe'; import {AssetRepository} from 'Repositories/assets/AssetRepository'; +import {MessageRepository} from 'Repositories/conversation/MessageRepository'; import {withTheme} from 'src/script/auth/util/test/TestUtil'; import {Conversation} from 'src/script/entity/Conversation'; import {ContentMessage} from 'src/script/entity/message/ContentMessage'; @@ -32,7 +33,6 @@ import {createUuid} from 'Util/uuid'; import {Collection} from './Collection'; -import {MessageRepository} from '../../../../conversation/MessageRepository'; import {Text} from '../../../../entity/message/Text'; import {User} from '../../../../entity/User'; diff --git a/src/script/page/MainContent/panels/Collection/Collection.tsx b/src/script/page/MainContent/panels/Collection/Collection.tsx index 3ff3a5943b5..8287f135f18 100644 --- a/src/script/page/MainContent/panels/Collection/Collection.tsx +++ b/src/script/page/MainContent/panels/Collection/Collection.tsx @@ -26,7 +26,8 @@ import {WebAppEvents} from '@wireapp/webapp-events'; import * as Icon from 'Components/Icon'; import {showDetailViewModal} from 'Components/Modals/DetailViewModal'; import {AssetRepository} from 'Repositories/assets/AssetRepository'; -import {ConversationRepository} from 'src/script/conversation/ConversationRepository'; +import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; +import {MessageRepository} from 'Repositories/conversation/MessageRepository'; import {ContentMessage} from 'src/script/entity/message/ContentMessage'; import {generateConversationUrl} from 'src/script/router/routeGenerator'; import {createNavigate} from 'src/script/router/routerBindings'; @@ -38,7 +39,6 @@ import {CollectionSection} from './CollectionSection'; import {FullSearch} from './FullSearch'; import {Category, isOfCategory} from './utils'; -import {MessageRepository} from '../../../../conversation/MessageRepository'; import {Conversation} from '../../../../entity/Conversation'; import {User} from '../../../../entity/User'; import {MessageCategory} from '../../../../message/MessageCategory'; diff --git a/src/script/page/MainContent/panels/preferences/AccountPreferences.tsx b/src/script/page/MainContent/panels/preferences/AccountPreferences.tsx index 5c8fe1fa067..414bed5a7cb 100644 --- a/src/script/page/MainContent/panels/preferences/AccountPreferences.tsx +++ b/src/script/page/MainContent/panels/preferences/AccountPreferences.tsx @@ -27,7 +27,8 @@ import {ErrorFallback} from 'Components/ErrorFallback'; import {PrimaryModal} from 'Components/Modals/PrimaryModal'; import {useEnrichedFields} from 'Components/panel/EnrichedFields'; import {ClientRepository} from 'Repositories/client'; -import {ConversationState} from 'src/script/conversation/ConversationState'; +import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; +import {ConversationState} from 'Repositories/conversation/ConversationState'; import {ContentState} from 'src/script/page/useAppState'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; @@ -49,7 +50,6 @@ import {PreferencesPage} from './components/PreferencesPage'; import {PreferencesSection} from './components/PreferencesSection'; import {Config} from '../../../../Config'; -import {ConversationRepository} from '../../../../conversation/ConversationRepository'; import {User} from '../../../../entity/User'; import {PropertiesRepository} from '../../../../properties/PropertiesRepository'; import {TeamState} from '../../../../team/TeamState'; diff --git a/src/script/page/MainContent/panels/preferences/DevicesPreferences/DevicesPreference.test.tsx b/src/script/page/MainContent/panels/preferences/DevicesPreferences/DevicesPreference.test.tsx index e806d71fc7c..a3b1ed3d57f 100644 --- a/src/script/page/MainContent/panels/preferences/DevicesPreferences/DevicesPreference.test.tsx +++ b/src/script/page/MainContent/panels/preferences/DevicesPreferences/DevicesPreference.test.tsx @@ -24,8 +24,8 @@ import {randomUUID} from 'crypto'; import {ClientEntity} from 'Repositories/client/ClientEntity'; import {ClientState} from 'Repositories/client/ClientState'; +import {ConversationState} from 'Repositories/conversation/ConversationState'; import {withTheme} from 'src/script/auth/util/test/TestUtil'; -import {ConversationState} from 'src/script/conversation/ConversationState'; import {CryptographyRepository} from 'src/script/cryptography/CryptographyRepository'; import {User} from 'src/script/entity/User'; import {createUuid} from 'Util/uuid'; diff --git a/src/script/page/MainContent/panels/preferences/DevicesPreferences/DevicesPreference.tsx b/src/script/page/MainContent/panels/preferences/DevicesPreferences/DevicesPreference.tsx index 6df896dd876..b4fd716a34c 100644 --- a/src/script/page/MainContent/panels/preferences/DevicesPreferences/DevicesPreference.tsx +++ b/src/script/page/MainContent/panels/preferences/DevicesPreferences/DevicesPreference.tsx @@ -24,6 +24,7 @@ import {container} from 'tsyringe'; import {ClientEntity} from 'Repositories/client/ClientEntity'; import {ClientState} from 'Repositories/client/ClientState'; +import {ConversationState} from 'Repositories/conversation/ConversationState'; import {CryptographyRepository} from 'src/script/cryptography/CryptographyRepository'; import {Conversation} from 'src/script/entity/Conversation'; import {User} from 'src/script/entity/User'; @@ -35,7 +36,6 @@ import {DetailedDevice} from './components/DetailedDevice'; import {Device} from './components/Device'; import {DeviceDetailsPreferences} from './components/DeviceDetailsPreferences'; -import {ConversationState} from '../../../../../conversation/ConversationState'; import {PreferencesPage} from '../components/PreferencesPage'; interface DevicesPreferencesProps { diff --git a/src/script/page/RightSidebar/AddParticipants/AddParticipants.tsx b/src/script/page/RightSidebar/AddParticipants/AddParticipants.tsx index 124b4d7d2e6..36399567eff 100644 --- a/src/script/page/RightSidebar/AddParticipants/AddParticipants.tsx +++ b/src/script/page/RightSidebar/AddParticipants/AddParticipants.tsx @@ -30,13 +30,13 @@ import * as Icon from 'Components/Icon'; import {SearchInput} from 'Components/SearchInput'; import {ServiceList} from 'Components/ServiceList/ServiceList'; import {UserSearchableList} from 'Components/UserSearchableList'; +import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {handleKeyDown} from 'Util/KeyboardUtil'; import {t} from 'Util/LocalizerUtil'; import {safeWindowOpen} from 'Util/SanitizationUtil'; import {sortUsersByPriority} from 'Util/StringUtil'; -import {ConversationRepository} from '../../../conversation/ConversationRepository'; import {Conversation} from '../../../entity/Conversation'; import {User} from '../../../entity/User'; import {getManageServicesUrl} from '../../../externalRoute'; diff --git a/src/script/page/RightSidebar/ConversationDetails/ConversationDetails.test.tsx b/src/script/page/RightSidebar/ConversationDetails/ConversationDetails.test.tsx index 952167a4afc..f5feb043808 100644 --- a/src/script/page/RightSidebar/ConversationDetails/ConversationDetails.test.tsx +++ b/src/script/page/RightSidebar/ConversationDetails/ConversationDetails.test.tsx @@ -21,15 +21,15 @@ import {act, render} from '@testing-library/react'; import {CONVERSATION_TYPE} from '@wireapp/api-client/lib/conversation'; import {ConnectionRepository} from 'Repositories/connection/ConnectionRepository'; +import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; +import {ConversationRoleRepository} from 'Repositories/conversation/ConversationRoleRepository'; +import {MessageRepository} from 'Repositories/conversation/MessageRepository'; import {Conversation} from 'src/script/entity/Conversation'; import {createUuid} from 'Util/uuid'; import {ConversationDetails} from './ConversationDetails'; import {TestFactory} from '../../../../../test/helper/TestFactory'; -import {ConversationRepository} from '../../../conversation/ConversationRepository'; -import {ConversationRoleRepository} from '../../../conversation/ConversationRoleRepository'; -import {MessageRepository} from '../../../conversation/MessageRepository'; import {User} from '../../../entity/User'; import {IntegrationRepository} from '../../../integration/IntegrationRepository'; import {SearchRepository} from '../../../search/SearchRepository'; diff --git a/src/script/page/RightSidebar/ConversationDetails/ConversationDetails.tsx b/src/script/page/RightSidebar/ConversationDetails/ConversationDetails.tsx index d3e8df1a8a1..71267e44e6c 100644 --- a/src/script/page/RightSidebar/ConversationDetails/ConversationDetails.tsx +++ b/src/script/page/RightSidebar/ConversationDetails/ConversationDetails.tsx @@ -28,6 +28,9 @@ import {ConversationProtocolDetails} from 'Components/panel/ConversationProtocol import {EnrichedFields} from 'Components/panel/EnrichedFields'; import {ServiceDetails} from 'Components/panel/ServiceDetails'; import {UserDetails} from 'Components/panel/UserDetails'; +import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; +import {ConversationVerificationState} from 'Repositories/conversation/ConversationVerificationState'; +import {getNotificationText} from 'Repositories/conversation/NotificationSetting'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; import {sortUsersByPriority} from 'Util/StringUtil'; @@ -37,9 +40,6 @@ import {ConversationDetailsHeader} from './components/ConversationDetailsHeader' import {ConversationDetailsOptions} from './components/ConversationDetailsOptions'; import {ConversationDetailsParticipants} from './components/ConversationDetailsParticipants'; -import {ConversationRepository} from '../../../conversation/ConversationRepository'; -import {ConversationVerificationState} from '../../../conversation/ConversationVerificationState'; -import {getNotificationText} from '../../../conversation/NotificationSetting'; import {Conversation} from '../../../entity/Conversation'; import {User} from '../../../entity/User'; import {isServiceEntity} from '../../../guards/Service'; diff --git a/src/script/page/RightSidebar/ConversationDetails/components/ConversationDetailsHeader/ConversationDetailsHeader.tsx b/src/script/page/RightSidebar/ConversationDetails/components/ConversationDetailsHeader/ConversationDetailsHeader.tsx index 959eedbebe4..46e5bbcb18a 100644 --- a/src/script/page/RightSidebar/ConversationDetails/components/ConversationDetailsHeader/ConversationDetailsHeader.tsx +++ b/src/script/page/RightSidebar/ConversationDetails/components/ConversationDetailsHeader/ConversationDetailsHeader.tsx @@ -21,12 +21,12 @@ import {ChangeEvent, FC, KeyboardEvent, useEffect, useRef, useState} from 'react import {ConversationVerificationBadges} from 'Components/Badge'; import * as Icon from 'Components/Icon'; +import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {isEnterKey} from 'Util/KeyboardUtil'; import {t} from 'Util/LocalizerUtil'; import {removeLineBreaks} from 'Util/StringUtil'; -import {ConversationRepository} from '../../../../../conversation/ConversationRepository'; import {Conversation} from '../../../../../entity/Conversation'; import {User} from '../../../../../entity/User'; import {ServiceEntity} from '../../../../../integration/ServiceEntity'; diff --git a/src/script/page/RightSidebar/ConversationDetails/components/ConversationDetailsOptions/ConversationDetailsOptions.tsx b/src/script/page/RightSidebar/ConversationDetails/components/ConversationDetailsOptions/ConversationDetailsOptions.tsx index 8ae761765b8..479fa6cf251 100644 --- a/src/script/page/RightSidebar/ConversationDetails/components/ConversationDetailsOptions/ConversationDetailsOptions.tsx +++ b/src/script/page/RightSidebar/ConversationDetails/components/ConversationDetailsOptions/ConversationDetailsOptions.tsx @@ -26,15 +26,15 @@ import {WebAppEvents} from '@wireapp/webapp-events'; import * as Icon from 'Components/Icon'; import {PanelActions} from 'Components/panel/PanelActions'; import {ReceiptModeToggle} from 'Components/toggle/ReceiptModeToggle'; +import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; +import {ConversationRoleRepository} from 'Repositories/conversation/ConversationRoleRepository'; +import {isMLSConversation} from 'Repositories/conversation/ConversationSelectors'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; import {replaceReactComponents} from 'Util/LocalizerUtil/ReactLocalizerUtil'; import {ConversationDetailsOption} from './ConversationDetailsOption'; -import {ConversationRepository} from '../../../../../conversation/ConversationRepository'; -import {ConversationRoleRepository} from '../../../../../conversation/ConversationRoleRepository'; -import {isMLSConversation} from '../../../../../conversation/ConversationSelectors'; import {Conversation} from '../../../../../entity/Conversation'; import {User} from '../../../../../entity/User'; import {TeamState} from '../../../../../team/TeamState'; diff --git a/src/script/page/RightSidebar/ConversationDetails/components/ConversationDetailsParticipants/ConversationDetailsParticipants.tsx b/src/script/page/RightSidebar/ConversationDetails/components/ConversationDetailsParticipants/ConversationDetailsParticipants.tsx index 010dd2f307c..313e6636b96 100644 --- a/src/script/page/RightSidebar/ConversationDetails/components/ConversationDetailsParticipants/ConversationDetailsParticipants.tsx +++ b/src/script/page/RightSidebar/ConversationDetails/components/ConversationDetailsParticipants/ConversationDetailsParticipants.tsx @@ -20,9 +20,9 @@ import * as Icon from 'Components/Icon'; import {ServiceList} from 'Components/ServiceList'; import {UserList} from 'Components/UserList'; +import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; import {t} from 'Util/LocalizerUtil'; -import {ConversationRepository} from '../../../../../conversation/ConversationRepository'; import {Conversation} from '../../../../../entity/Conversation'; import {User} from '../../../../../entity/User'; import {ServiceEntity} from '../../../../../integration/ServiceEntity'; diff --git a/src/script/page/RightSidebar/ConversationDetails/components/GroupDetails/GroupDetails.tsx b/src/script/page/RightSidebar/ConversationDetails/components/GroupDetails/GroupDetails.tsx index 3975f1bfac4..68e1e49c771 100644 --- a/src/script/page/RightSidebar/ConversationDetails/components/GroupDetails/GroupDetails.tsx +++ b/src/script/page/RightSidebar/ConversationDetails/components/GroupDetails/GroupDetails.tsx @@ -19,9 +19,9 @@ import {FC} from 'react'; +import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; import {t} from 'Util/LocalizerUtil'; -import {ConversationRepository} from '../../../../../conversation/ConversationRepository'; import {User} from '../../../../../entity/User'; import {ServiceEntity} from '../../../../../integration/ServiceEntity'; diff --git a/src/script/page/RightSidebar/ConversationDetails/utils/getConversationActions.ts b/src/script/page/RightSidebar/ConversationDetails/utils/getConversationActions.ts index 43751f9a409..b7b1334662d 100644 --- a/src/script/page/RightSidebar/ConversationDetails/utils/getConversationActions.ts +++ b/src/script/page/RightSidebar/ConversationDetails/utils/getConversationActions.ts @@ -23,9 +23,9 @@ import {WebAppEvents} from '@wireapp/webapp-events'; import * as Icon from 'Components/Icon'; import {MenuItem} from 'Components/panel/PanelActions'; +import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; import {t} from 'Util/LocalizerUtil'; -import {ConversationRepository} from '../../../../conversation/ConversationRepository'; import {Conversation} from '../../../../entity/Conversation'; import * as UserPermission from '../../../../user/UserPermission'; import {ActionsViewModel} from '../../../../view_model/ActionsViewModel'; diff --git a/src/script/page/RightSidebar/ConversationParticipants/ConversationParticipants.tsx b/src/script/page/RightSidebar/ConversationParticipants/ConversationParticipants.tsx index 84a40e23746..84b14e1110a 100644 --- a/src/script/page/RightSidebar/ConversationParticipants/ConversationParticipants.tsx +++ b/src/script/page/RightSidebar/ConversationParticipants/ConversationParticipants.tsx @@ -22,11 +22,11 @@ import {FC, useMemo, useState} from 'react'; import {FadingScrollbar} from 'Components/FadingScrollbar'; import {SearchInput} from 'Components/SearchInput'; import {UserSearchableList} from 'Components/UserSearchableList'; +import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; import {sortUsersByPriority} from 'Util/StringUtil'; -import {ConversationRepository} from '../../../conversation/ConversationRepository'; import {Conversation} from '../../../entity/Conversation'; import {User} from '../../../entity/User'; import {isServiceEntity} from '../../../guards/Service'; diff --git a/src/script/page/RightSidebar/GroupParticipantUser/GroupParticipantUser.tsx b/src/script/page/RightSidebar/GroupParticipantUser/GroupParticipantUser.tsx index 9cb9a7c3cab..ae0acf6cad1 100644 --- a/src/script/page/RightSidebar/GroupParticipantUser/GroupParticipantUser.tsx +++ b/src/script/page/RightSidebar/GroupParticipantUser/GroupParticipantUser.tsx @@ -31,12 +31,12 @@ import {EnrichedFields} from 'Components/panel/EnrichedFields'; import {UserActions, Actions} from 'Components/panel/UserActions'; import {UserDetails} from 'Components/panel/UserDetails'; import {BaseToggle} from 'Components/toggle/BaseToggle'; +import {ConversationRoleRepository} from 'Repositories/conversation/ConversationRoleRepository'; +import {MemberLeaveEvent, TeamMemberLeaveEvent} from 'Repositories/conversation/EventBuilder'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {handleKeyDown} from 'Util/KeyboardUtil'; import {t} from 'Util/LocalizerUtil'; -import {ConversationRoleRepository} from '../../../conversation/ConversationRoleRepository'; -import {MemberLeaveEvent, TeamMemberLeaveEvent} from '../../../conversation/EventBuilder'; import {Conversation} from '../../../entity/Conversation'; import {User} from '../../../entity/User'; import {ClientEvent} from '../../../event/Client'; diff --git a/src/script/page/RightSidebar/GuestServicesOptions/GuestServicesOptions.test.tsx b/src/script/page/RightSidebar/GuestServicesOptions/GuestServicesOptions.test.tsx index ae076927505..fc2fe2d185a 100644 --- a/src/script/page/RightSidebar/GuestServicesOptions/GuestServicesOptions.test.tsx +++ b/src/script/page/RightSidebar/GuestServicesOptions/GuestServicesOptions.test.tsx @@ -20,13 +20,13 @@ import {render, waitFor} from '@testing-library/react'; import ko from 'knockout'; +import {ACCESS_STATE} from 'Repositories/conversation/AccessState'; +import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; import {Conversation} from 'src/script/entity/Conversation'; import {GuestServicesOptions} from './GuestServicesOptions'; import {TestFactory} from '../../../../../test/helper/TestFactory'; -import {ACCESS_STATE} from '../../../conversation/AccessState'; -import {ConversationRepository} from '../../../conversation/ConversationRepository'; import {TeamRepository} from '../../../team/TeamRepository'; import {TeamState} from '../../../team/TeamState'; diff --git a/src/script/page/RightSidebar/GuestServicesOptions/GuestServicesOptions.tsx b/src/script/page/RightSidebar/GuestServicesOptions/GuestServicesOptions.tsx index 0bd28a9a47a..a44790572c6 100644 --- a/src/script/page/RightSidebar/GuestServicesOptions/GuestServicesOptions.tsx +++ b/src/script/page/RightSidebar/GuestServicesOptions/GuestServicesOptions.tsx @@ -21,14 +21,14 @@ import {FC, useState} from 'react'; import {FadingScrollbar} from 'Components/FadingScrollbar'; import {PrimaryModal} from 'Components/Modals/PrimaryModal'; +import {toggleFeature} from 'Repositories/conversation/ConversationAccessPermission'; +import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; import {GuestOptions} from './components/GuestOptions'; import {ServicesOptions} from './components/ServicesOptions'; -import {toggleFeature} from '../../../conversation/ConversationAccessPermission'; -import {ConversationRepository} from '../../../conversation/ConversationRepository'; import {Conversation} from '../../../entity/Conversation'; import {TeamRepository} from '../../../team/TeamRepository'; import {TeamState} from '../../../team/TeamState'; diff --git a/src/script/page/RightSidebar/GuestServicesOptions/components/GuestOptions/GuestOptions.tsx b/src/script/page/RightSidebar/GuestServicesOptions/components/GuestOptions/GuestOptions.tsx index fa64408d4bf..50731ee9cea 100644 --- a/src/script/page/RightSidebar/GuestServicesOptions/components/GuestOptions/GuestOptions.tsx +++ b/src/script/page/RightSidebar/GuestServicesOptions/components/GuestOptions/GuestOptions.tsx @@ -29,15 +29,15 @@ import {PrimaryModal} from 'Components/Modals/PrimaryModal'; import {RadioGroup} from 'Components/Radio'; import {SelectText} from 'Components/SelectText'; import {BaseToggle} from 'Components/toggle/BaseToggle'; +import {ACCESS_STATE} from 'Repositories/conversation/AccessState'; +import {teamPermissionsForAccessState} from 'Repositories/conversation/ConversationAccessPermission'; +import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; import {TeamState} from 'src/script/team/TeamState'; import {copyText} from 'Util/ClipboardUtil'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; import {Config} from '../../../../../Config'; -import {ACCESS_STATE} from '../../../../../conversation/AccessState'; -import {teamPermissionsForAccessState} from '../../../../../conversation/ConversationAccessPermission'; -import {ConversationRepository} from '../../../../../conversation/ConversationRepository'; import {Conversation} from '../../../../../entity/Conversation'; import {TeamRepository} from '../../../../../team/TeamRepository'; diff --git a/src/script/page/RightSidebar/GuestServicesOptions/components/ServicesOptions/ServicesOptions.tsx b/src/script/page/RightSidebar/GuestServicesOptions/components/ServicesOptions/ServicesOptions.tsx index db32dc2e290..d2031ee3ee2 100644 --- a/src/script/page/RightSidebar/GuestServicesOptions/components/ServicesOptions/ServicesOptions.tsx +++ b/src/script/page/RightSidebar/GuestServicesOptions/components/ServicesOptions/ServicesOptions.tsx @@ -20,10 +20,10 @@ import {FC} from 'react'; import {BaseToggle} from 'Components/toggle/BaseToggle'; +import {ACCESS_TYPES} from 'Repositories/conversation/ConversationAccessPermission'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; -import {ACCESS_TYPES} from '../../../../../conversation/ConversationAccessPermission'; import {Conversation} from '../../../../../entity/Conversation'; interface ServicesOptionsProps { diff --git a/src/script/page/RightSidebar/MessageDetails/MessageDetails.test.tsx b/src/script/page/RightSidebar/MessageDetails/MessageDetails.test.tsx index 6c01fe67082..e410c5a646b 100644 --- a/src/script/page/RightSidebar/MessageDetails/MessageDetails.test.tsx +++ b/src/script/page/RightSidebar/MessageDetails/MessageDetails.test.tsx @@ -20,13 +20,13 @@ import {render, waitFor} from '@testing-library/react'; import {QualifiedId} from '@wireapp/api-client/lib/user'; +import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; import {Conversation} from 'src/script/entity/Conversation'; import {createUuid} from 'Util/uuid'; import {MessageDetails} from './MessageDetails'; import {TestFactory} from '../../../../../test/helper/TestFactory'; -import {ConversationRepository} from '../../../conversation/ConversationRepository'; import {ContentMessage} from '../../../entity/message/ContentMessage'; import {User} from '../../../entity/User'; import {SearchRepository} from '../../../search/SearchRepository'; diff --git a/src/script/page/RightSidebar/MessageDetails/MessageDetails.tsx b/src/script/page/RightSidebar/MessageDetails/MessageDetails.tsx index 3be212bdda2..0e9087b2308 100644 --- a/src/script/page/RightSidebar/MessageDetails/MessageDetails.tsx +++ b/src/script/page/RightSidebar/MessageDetails/MessageDetails.tsx @@ -24,13 +24,13 @@ import cx from 'classnames'; import {FadingScrollbar} from 'Components/FadingScrollbar'; import * as Icon from 'Components/Icon'; import {UserList} from 'Components/UserList'; +import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; import {formatLocale} from 'Util/TimeUtil'; import {UsersReactions} from './UserReactions'; -import {ConversationRepository} from '../../../conversation/ConversationRepository'; import {Conversation} from '../../../entity/Conversation'; import {ContentMessage} from '../../../entity/message/ContentMessage'; import {User} from '../../../entity/User'; diff --git a/src/script/page/RightSidebar/Notifications/Notifications.test.tsx b/src/script/page/RightSidebar/Notifications/Notifications.test.tsx index 616e04ef832..11109aba73c 100644 --- a/src/script/page/RightSidebar/Notifications/Notifications.test.tsx +++ b/src/script/page/RightSidebar/Notifications/Notifications.test.tsx @@ -20,8 +20,8 @@ import {render, screen, fireEvent} from '@testing-library/react'; import ko from 'knockout'; -import {ConversationRepository} from 'src/script/conversation/ConversationRepository'; -import {NOTIFICATION_STATE} from 'src/script/conversation/NotificationSetting'; +import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; +import {NOTIFICATION_STATE} from 'Repositories/conversation/NotificationSetting'; import {Conversation} from 'src/script/entity/Conversation'; import {TestFactory} from 'test/helper/TestFactory'; diff --git a/src/script/page/RightSidebar/Notifications/Notifications.tsx b/src/script/page/RightSidebar/Notifications/Notifications.tsx index ebb05b91403..2b9f1b49c29 100644 --- a/src/script/page/RightSidebar/Notifications/Notifications.tsx +++ b/src/script/page/RightSidebar/Notifications/Notifications.tsx @@ -23,10 +23,10 @@ import {TabIndex} from '@wireapp/react-ui-kit/lib/types/enums'; import {FadingScrollbar} from 'Components/FadingScrollbar'; import {RadioGroup} from 'Components/Radio'; +import {NOTIFICATION_STATE, getNotificationText} from 'Repositories/conversation/NotificationSetting'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; -import {NOTIFICATION_STATE, getNotificationText} from '../../../conversation/NotificationSetting'; import {Conversation} from '../../../entity/Conversation'; import {ViewModelRepositories} from '../../../view_model/MainViewModel'; import {PanelHeader} from '../PanelHeader'; diff --git a/src/script/page/RightSidebar/RightSidebar.tsx b/src/script/page/RightSidebar/RightSidebar.tsx index a624574d7d9..7c96d0b608f 100644 --- a/src/script/page/RightSidebar/RightSidebar.tsx +++ b/src/script/page/RightSidebar/RightSidebar.tsx @@ -25,6 +25,7 @@ import {container} from 'tsyringe'; import {WebAppEvents} from '@wireapp/webapp-events'; +import {ConversationState} from 'Repositories/conversation/ConversationState'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {AddParticipants} from './AddParticipants'; @@ -38,7 +39,6 @@ import {Notifications} from './Notifications'; import {ParticipantDevices} from './ParticipantDevices'; import {TimedMessages} from './TimedMessages'; -import {ConversationState} from '../../conversation/ConversationState'; import {Conversation} from '../../entity/Conversation'; import {Message} from '../../entity/message/Message'; import {User} from '../../entity/User'; diff --git a/src/script/page/components/WindowTitleUpdater.ts b/src/script/page/components/WindowTitleUpdater.ts index 4ea0b445d56..0411e8f4d32 100644 --- a/src/script/page/components/WindowTitleUpdater.ts +++ b/src/script/page/components/WindowTitleUpdater.ts @@ -24,12 +24,12 @@ import {container} from 'tsyringe'; import {WebAppEvents} from '@wireapp/webapp-events'; +import {ConversationState} from 'Repositories/conversation/ConversationState'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; import {getLogger} from 'Util/Logger'; import {Config} from '../../Config'; -import {ConversationState} from '../../conversation/ConversationState'; import {NOTIFICATION_HANDLING_STATE} from '../../event/NotificationHandlingState'; import {UserState} from '../../user/UserState'; import {ContentState, useAppState} from '../useAppState'; diff --git a/src/script/repositories/backup/BackupRepository.ts b/src/script/repositories/backup/BackupRepository.ts index dd9d338d24e..1436a6a4266 100644 --- a/src/script/repositories/backup/BackupRepository.ts +++ b/src/script/repositories/backup/BackupRepository.ts @@ -20,6 +20,8 @@ import type Dexie from 'dexie'; import {omit} from 'underscore'; +import type {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; +import {isReadableConversation} from 'Repositories/conversation/ConversationSelectors'; import {chunk} from 'Util/ArrayUtil'; import {Logger, getLogger} from 'Util/Logger'; import {constructUserPrimaryKey} from 'Util/StorageUtil'; @@ -40,8 +42,6 @@ import { } from './Error'; import {preprocessConversations, preprocessEvents, preprocessUsers} from './recordPreprocessors'; -import type {ConversationRepository} from '../../conversation/ConversationRepository'; -import {isReadableConversation} from '../../conversation/ConversationSelectors'; import type {Conversation} from '../../entity/Conversation'; import {User} from '../../entity/User'; import {EventRecord, UserRecord} from '../../storage'; diff --git a/src/script/repositories/calling/CallingRepository.ts b/src/script/repositories/calling/CallingRepository.ts index 28cef1e1d16..9e23026943c 100644 --- a/src/script/repositories/calling/CallingRepository.ts +++ b/src/script/repositories/calling/CallingRepository.ts @@ -55,7 +55,13 @@ import {WebAppEvents} from '@wireapp/webapp-events'; import {showAppNotification} from 'Components/AppNotification'; import {useCallAlertState} from 'Components/calling/useCallAlertState'; +import {PrimaryModal} from 'Components/Modals/PrimaryModal'; import {CALL_QUALITY_FEEDBACK_KEY} from 'Components/Modals/QualityFeedbackModal/constants'; +import {isMLSConversation, MLSConversation} from 'Repositories/conversation/ConversationSelectors'; +import {ConversationState} from 'Repositories/conversation/ConversationState'; +import {ConversationVerificationState} from 'Repositories/conversation/ConversationVerificationState'; +import {EventBuilder} from 'Repositories/conversation/EventBuilder'; +import {CONSENT_TYPE, MessageRepository, MessageSendingOptions} from 'Repositories/conversation/MessageRepository'; import {flatten} from 'Util/ArrayUtil'; import {calculateChildWindowPosition} from 'Util/DOM/caculateChildWindowPosition'; import {isDetachedCallingFeatureEnabled} from 'Util/isDetachedCallingFeatureEnabled'; @@ -74,13 +80,7 @@ import {CALL_MESSAGE_TYPE} from './enum/CallMessageType'; import {LEAVE_CALL_REASON} from './enum/LeaveCallReason'; import {ClientId, Participant, UserId} from './Participant'; -import {PrimaryModal} from '../../components/Modals/PrimaryModal'; import {Config} from '../../Config'; -import {isMLSConversation, MLSConversation} from '../../conversation/ConversationSelectors'; -import {ConversationState} from '../../conversation/ConversationState'; -import {ConversationVerificationState} from '../../conversation/ConversationVerificationState'; -import {EventBuilder} from '../../conversation/EventBuilder'; -import {CONSENT_TYPE, MessageRepository, MessageSendingOptions} from '../../conversation/MessageRepository'; import {Conversation} from '../../entity/Conversation'; import type {User} from '../../entity/User'; import {NoAudioInputError} from '../../error/NoAudioInputError'; diff --git a/src/script/conversation/AbstractConversationEventHandler.ts b/src/script/repositories/conversation/AbstractConversationEventHandler.ts similarity index 97% rename from src/script/conversation/AbstractConversationEventHandler.ts rename to src/script/repositories/conversation/AbstractConversationEventHandler.ts index 06bfa81c67a..013f8038fc5 100644 --- a/src/script/conversation/AbstractConversationEventHandler.ts +++ b/src/script/repositories/conversation/AbstractConversationEventHandler.ts @@ -21,7 +21,7 @@ import {ConversationEvent, FederationEvent} from '@wireapp/api-client/lib/event' import {ClientConversationEvent} from './EventBuilder'; -import type {Conversation} from '../entity/Conversation'; +import type {Conversation} from '../../entity/Conversation'; export type EventHandlingConfig = {[eventId: string]: (conversationEntity: Conversation) => void | Promise}; diff --git a/src/script/conversation/AccessState.ts b/src/script/repositories/conversation/AccessState.ts similarity index 100% rename from src/script/conversation/AccessState.ts rename to src/script/repositories/conversation/AccessState.ts diff --git a/src/script/conversation/ClientMismatchUtil.test.ts b/src/script/repositories/conversation/ClientMismatchUtil.test.ts similarity index 99% rename from src/script/conversation/ClientMismatchUtil.test.ts rename to src/script/repositories/conversation/ClientMismatchUtil.test.ts index 2bac97c182c..7de025d58fe 100644 --- a/src/script/conversation/ClientMismatchUtil.test.ts +++ b/src/script/repositories/conversation/ClientMismatchUtil.test.ts @@ -21,7 +21,7 @@ import {ClientEntity} from 'Repositories/client/ClientEntity'; import {extractClientDiff, findDeletedClients} from './ClientMismatchUtil'; -import {User} from '../entity/User'; +import {User} from '../../entity/User'; describe('ClientMismatchUtil', () => { describe('findDeletedClients', () => { diff --git a/src/script/conversation/ClientMismatchUtil.ts b/src/script/repositories/conversation/ClientMismatchUtil.ts similarity index 99% rename from src/script/conversation/ClientMismatchUtil.ts rename to src/script/repositories/conversation/ClientMismatchUtil.ts index 5f3664b94d0..4d38922eb16 100644 --- a/src/script/conversation/ClientMismatchUtil.ts +++ b/src/script/repositories/conversation/ClientMismatchUtil.ts @@ -25,7 +25,7 @@ import {difference, intersection} from 'underscore'; import {matchQualifiedIds} from 'Util/QualifiedId'; -import {User} from '../entity/User'; +import {User} from '../../entity/User'; type UserClient = {clients: string[]; userId: QualifiedId}; diff --git a/src/script/conversation/ConversationAccessPermission.test.ts b/src/script/repositories/conversation/ConversationAccessPermission.test.ts similarity index 100% rename from src/script/conversation/ConversationAccessPermission.test.ts rename to src/script/repositories/conversation/ConversationAccessPermission.test.ts diff --git a/src/script/conversation/ConversationAccessPermission.ts b/src/script/repositories/conversation/ConversationAccessPermission.ts similarity index 98% rename from src/script/conversation/ConversationAccessPermission.ts rename to src/script/repositories/conversation/ConversationAccessPermission.ts index f13cafd4db7..3721cc95d9c 100644 --- a/src/script/conversation/ConversationAccessPermission.ts +++ b/src/script/repositories/conversation/ConversationAccessPermission.ts @@ -21,7 +21,7 @@ import {CONVERSATION_ACCESS_ROLE, CONVERSATION_ACCESS} from '@wireapp/api-client import {ACCESS_STATE, TEAM} from './AccessState'; -import {combinePermissions, hasPermissions} from '../user/UserPermission'; +import {combinePermissions, hasPermissions} from '../../user/UserPermission'; export const ACCESS_TYPES = { GUEST: 1 << 0, diff --git a/src/script/conversation/ConversationCellState.test.ts b/src/script/repositories/conversation/ConversationCellState.test.ts similarity index 93% rename from src/script/conversation/ConversationCellState.test.ts rename to src/script/repositories/conversation/ConversationCellState.test.ts index ed67ecd545a..a76ae6b6af2 100644 --- a/src/script/conversation/ConversationCellState.test.ts +++ b/src/script/repositories/conversation/ConversationCellState.test.ts @@ -19,9 +19,6 @@ import {CONVERSATION_TYPE} from '@wireapp/api-client/lib/conversation'; -import {generateCellState} from 'src/script/conversation/ConversationCellState'; -import {ConversationStatusIcon} from 'src/script/conversation/ConversationStatusIcon'; -import {NOTIFICATION_STATE} from 'src/script/conversation/NotificationSetting'; import {Conversation} from 'src/script/entity/Conversation'; import {ContentMessage} from 'src/script/entity/message/ContentMessage'; import {PingMessage} from 'src/script/entity/message/PingMessage'; @@ -30,8 +27,12 @@ import {User} from 'src/script/entity/User'; import {t} from 'Util/LocalizerUtil'; import {createUuid} from 'Util/uuid'; -import {CallMessage} from '../entity/message/CallMessage'; -import {CALL_MESSAGE_TYPE} from '../message/CallMessageType'; +import {generateCellState} from './ConversationCellState'; +import {ConversationStatusIcon} from './ConversationStatusIcon'; +import {NOTIFICATION_STATE} from './NotificationSetting'; + +import {CallMessage} from '../../entity/message/CallMessage'; +import {CALL_MESSAGE_TYPE} from '../../message/CallMessageType'; describe('ConversationCellState', () => { describe('Notification state icon', () => { diff --git a/src/script/conversation/ConversationCellState.ts b/src/script/repositories/conversation/ConversationCellState.ts similarity index 97% rename from src/script/conversation/ConversationCellState.ts rename to src/script/repositories/conversation/ConversationCellState.ts index 110c2c91bd7..16e474dd35b 100644 --- a/src/script/conversation/ConversationCellState.ts +++ b/src/script/repositories/conversation/ConversationCellState.ts @@ -24,13 +24,13 @@ import {matchQualifiedIds} from 'Util/QualifiedId'; import {ConversationStatusIcon} from './ConversationStatusIcon'; -import type {Conversation} from '../entity/Conversation'; -import type {FileAsset} from '../entity/message/FileAsset'; -import type {MemberMessage} from '../entity/message/MemberMessage'; -import type {SystemMessage} from '../entity/message/SystemMessage'; -import type {Text} from '../entity/message/Text'; -import {ConversationError} from '../error/ConversationError'; -import {E2EIVerificationMessageType} from '../message/E2EIVerificationMessageType'; +import type {Conversation} from '../../entity/Conversation'; +import type {FileAsset} from '../../entity/message/FileAsset'; +import type {MemberMessage} from '../../entity/message/MemberMessage'; +import type {SystemMessage} from '../../entity/message/SystemMessage'; +import type {Text} from '../../entity/message/Text'; +import {ConversationError} from '../../error/ConversationError'; +import {E2EIVerificationMessageType} from '../../message/E2EIVerificationMessageType'; enum ACTIVITY_TYPE { CALL = 'ConversationCellState.ACTIVITY_TYPE.CALL', diff --git a/src/script/conversation/ConversationEphemeralHandler.ts b/src/script/repositories/conversation/ConversationEphemeralHandler.ts similarity index 95% rename from src/script/conversation/ConversationEphemeralHandler.ts rename to src/script/repositories/conversation/ConversationEphemeralHandler.ts index c8b5f48e359..92e4006de47 100644 --- a/src/script/conversation/ConversationEphemeralHandler.ts +++ b/src/script/repositories/conversation/ConversationEphemeralHandler.ts @@ -31,15 +31,15 @@ import {arrayToBase64, noop} from 'Util/util'; import {AbstractConversationEventHandler} from './AbstractConversationEventHandler'; import {ConversationMapper} from './ConversationMapper'; -import type {Conversation} from '../entity/Conversation'; -import type {ContentMessage} from '../entity/message/ContentMessage'; -import {MediumImage} from '../entity/message/MediumImage'; -import type {Message} from '../entity/message/Message'; -import {Text} from '../entity/message/Text'; -import type {EventService} from '../event/EventService'; -import {EphemeralStatusType} from '../message/EphemeralStatusType'; -import {StatusType} from '../message/StatusType'; -import type {EventRecord} from '../storage'; +import type {Conversation} from '../../entity/Conversation'; +import type {ContentMessage} from '../../entity/message/ContentMessage'; +import {MediumImage} from '../../entity/message/MediumImage'; +import type {Message} from '../../entity/message/Message'; +import {Text} from '../../entity/message/Text'; +import type {EventService} from '../../event/EventService'; +import {EphemeralStatusType} from '../../message/EphemeralStatusType'; +import {StatusType} from '../../message/StatusType'; +import type {EventRecord} from '../../storage'; export class ConversationEphemeralHandler extends AbstractConversationEventHandler { eventListeners: Record void>; diff --git a/src/script/conversation/ConversationFilter.test.ts b/src/script/repositories/conversation/ConversationFilter.test.ts similarity index 99% rename from src/script/conversation/ConversationFilter.test.ts rename to src/script/repositories/conversation/ConversationFilter.test.ts index 059822b1b9b..a5b0f2e72c3 100644 --- a/src/script/conversation/ConversationFilter.test.ts +++ b/src/script/repositories/conversation/ConversationFilter.test.ts @@ -29,7 +29,7 @@ import {ConversationDatabaseData, ConversationMapper} from './ConversationMapper import {ConversationStatus} from './ConversationStatus'; import {ConversationVerificationState} from './ConversationVerificationState'; -import {Conversation} from '../entity/Conversation'; +import {Conversation} from '../../entity/Conversation'; describe('ConversationFilter', () => { describe('showCallControls', () => { diff --git a/src/script/conversation/ConversationFilter.ts b/src/script/repositories/conversation/ConversationFilter.ts similarity index 92% rename from src/script/conversation/ConversationFilter.ts rename to src/script/repositories/conversation/ConversationFilter.ts index 7268608f909..d5354aa1da7 100644 --- a/src/script/conversation/ConversationFilter.ts +++ b/src/script/repositories/conversation/ConversationFilter.ts @@ -17,8 +17,8 @@ * */ -import type {Conversation} from '../entity/Conversation'; -import type {User} from '../entity/User'; +import type {Conversation} from '../../entity/Conversation'; +import type {User} from '../../entity/User'; export class ConversationFilter { static isInTeam(conversationEntity: Conversation, userEntity: User): boolean { diff --git a/src/script/conversation/ConversationLabelRepository.ts b/src/script/repositories/conversation/ConversationLabelRepository.ts similarity index 98% rename from src/script/conversation/ConversationLabelRepository.ts rename to src/script/repositories/conversation/ConversationLabelRepository.ts index 27fc60ee936..59f4ae25bef 100644 --- a/src/script/conversation/ConversationLabelRepository.ts +++ b/src/script/repositories/conversation/ConversationLabelRepository.ts @@ -23,15 +23,15 @@ import ko from 'knockout'; import {WebAppEvents} from '@wireapp/webapp-events'; +import {PrimaryModal} from 'Components/Modals/PrimaryModal'; import {SidebarTabs, useSidebarStore} from 'src/script/page/LeftSidebar/panels/Conversations/useSidebarStore'; import {t} from 'Util/LocalizerUtil'; import {getLogger, Logger} from 'Util/Logger'; import {TypedEventTarget} from 'Util/TypedEventTarget'; import {createUuid} from 'Util/uuid'; -import {PrimaryModal} from '../components/Modals/PrimaryModal'; -import type {Conversation} from '../entity/Conversation'; -import type {PropertiesService} from '../properties/PropertiesService'; +import type {Conversation} from '../../entity/Conversation'; +import type {PropertiesService} from '../../properties/PropertiesService'; export enum LabelType { Custom = 0, diff --git a/src/script/conversation/ConversationMapper.test.ts b/src/script/repositories/conversation/ConversationMapper.test.ts similarity index 99% rename from src/script/conversation/ConversationMapper.test.ts rename to src/script/repositories/conversation/ConversationMapper.test.ts index 923de85cd50..2c09a23d5db 100644 --- a/src/script/conversation/ConversationMapper.test.ts +++ b/src/script/repositories/conversation/ConversationMapper.test.ts @@ -32,21 +32,17 @@ import {RECEIPT_MODE} from '@wireapp/api-client/lib/conversation/data'; import type {QualifiedId} from '@wireapp/api-client/lib/user/'; import ko from 'knockout'; -import { - ConversationDatabaseData, - ConversationMapper, - SelfStatusUpdateDatabaseData, -} from 'src/script/conversation/ConversationMapper'; -import {ConversationStatus} from 'src/script/conversation/ConversationStatus'; -import {NOTIFICATION_STATE} from 'src/script/conversation/NotificationSetting'; import {Conversation} from 'src/script/entity/Conversation'; import {BaseError} from 'src/script/error/BaseError'; import {createUuid} from 'Util/uuid'; import {ACCESS_STATE} from './AccessState'; +import {ConversationDatabaseData, ConversationMapper, SelfStatusUpdateDatabaseData} from './ConversationMapper'; +import {ConversationStatus} from './ConversationStatus'; import {ConversationVerificationState} from './ConversationVerificationState'; +import {NOTIFICATION_STATE} from './NotificationSetting'; -import {entities, payload} from '../../../test/api/payloads'; +import {entities, payload} from '../../../../test/api/payloads'; describe('ConversationMapper', () => { describe('mapConversations', () => { diff --git a/src/script/conversation/ConversationMapper.ts b/src/script/repositories/conversation/ConversationMapper.ts similarity index 98% rename from src/script/conversation/ConversationMapper.ts rename to src/script/repositories/conversation/ConversationMapper.ts index bd46b9436a0..79ec84a5105 100644 --- a/src/script/conversation/ConversationMapper.ts +++ b/src/script/repositories/conversation/ConversationMapper.ts @@ -36,10 +36,10 @@ import {ACCESS_STATE} from './AccessState'; import {ConversationStatus} from './ConversationStatus'; import {ConversationVerificationState} from './ConversationVerificationState'; -import {Conversation} from '../entity/Conversation'; -import {BaseError, BASE_ERROR_TYPE} from '../error/BaseError'; -import {ConversationError} from '../error/ConversationError'; -import {ConversationRecord} from '../storage/record/ConversationRecord'; +import {Conversation} from '../../entity/Conversation'; +import {BaseError, BASE_ERROR_TYPE} from '../../error/BaseError'; +import {ConversationError} from '../../error/ConversationError'; +import {ConversationRecord} from '../../storage/record/ConversationRecord'; /** Conversation self data from the database. */ export interface SelfStatusUpdateDatabaseData { diff --git a/src/script/conversation/ConversationRepository.test.ts b/src/script/repositories/conversation/ConversationRepository.test.ts similarity index 99% rename from src/script/conversation/ConversationRepository.test.ts rename to src/script/repositories/conversation/ConversationRepository.test.ts index 034db6e91ae..fb480907ec7 100644 --- a/src/script/conversation/ConversationRepository.test.ts +++ b/src/script/repositories/conversation/ConversationRepository.test.ts @@ -55,9 +55,6 @@ import {ClientEntity} from 'Repositories/client/ClientEntity'; import {ConnectionEntity} from 'Repositories/connection/ConnectionEntity'; import {ConnectionRepository} from 'Repositories/connection/ConnectionRepository'; import {Config} from 'src/script/Config'; -import {ConversationDatabaseData, ConversationMapper} from 'src/script/conversation/ConversationMapper'; -import {ConversationStatus} from 'src/script/conversation/ConversationStatus'; -import {DeleteEvent, EventBuilder, MessageHiddenEvent} from 'src/script/conversation/EventBuilder'; import {Conversation} from 'src/script/entity/Conversation'; import {Message} from 'src/script/entity/message/Message'; import {User} from 'src/script/entity/User'; @@ -75,23 +72,26 @@ import {matchQualifiedIds} from 'Util/QualifiedId'; import {escapeRegex} from 'Util/SanitizationUtil'; import {createUuid} from 'Util/uuid'; +import {ConversationDatabaseData, ConversationMapper} from './ConversationMapper'; import {CONVERSATION_READONLY_STATE, ConversationRepository} from './ConversationRepository'; import {ConversationService} from './ConversationService'; import {ConversationState} from './ConversationState'; +import {ConversationStatus} from './ConversationStatus'; +import {DeleteEvent, EventBuilder, MessageHiddenEvent} from './EventBuilder'; import {MessageRepository} from './MessageRepository'; - -import {entities, payload} from '../../../test/api/payloads'; -import {TestFactory} from '../../../test/helper/TestFactory'; -import {generateUser} from '../../../test/helper/UserGenerator'; -import {NOTIFICATION_STATE} from '../conversation/NotificationSetting'; -import {EventService} from '../event/EventService'; -import {SelfRepository} from '../self/SelfRepository'; -import {Core} from '../service/CoreSingleton'; -import {LegacyEventRecord, StorageService} from '../storage'; -import {TeamRepository} from '../team/TeamRepository'; -import {TeamState} from '../team/TeamState'; -import {UserRepository} from '../user/UserRepository'; -import {UserState} from '../user/UserState'; +import {NOTIFICATION_STATE} from './NotificationSetting'; + +import {entities, payload} from '../../../../test/api/payloads'; +import {TestFactory} from '../../../../test/helper/TestFactory'; +import {generateUser} from '../../../../test/helper/UserGenerator'; +import {EventService} from '../../event/EventService'; +import {SelfRepository} from '../../self/SelfRepository'; +import {Core} from '../../service/CoreSingleton'; +import {LegacyEventRecord, StorageService} from '../../storage'; +import {TeamRepository} from '../../team/TeamRepository'; +import {TeamState} from '../../team/TeamState'; +import {UserRepository} from '../../user/UserRepository'; +import {UserState} from '../../user/UserState'; function buildConversationRepository() { const teamState = new TeamState(); diff --git a/src/script/conversation/ConversationRepository.ts b/src/script/repositories/conversation/ConversationRepository.ts similarity index 98% rename from src/script/conversation/ConversationRepository.ts rename to src/script/repositories/conversation/ConversationRepository.ts index 75337a056ad..ece34b6e7e3 100644 --- a/src/script/conversation/ConversationRepository.ts +++ b/src/script/repositories/conversation/ConversationRepository.ts @@ -59,6 +59,7 @@ import {Asset as ProtobufAsset, Confirmation, LegalHoldStatus} from '@wireapp/pr import {WebAppEvents} from '@wireapp/webapp-events'; import {TYPING_TIMEOUT, useTypingIndicatorState} from 'Components/InputBar/components/TypingIndicator'; +import {PrimaryModal} from 'Components/Modals/PrimaryModal'; import {AssetTransferState} from 'Repositories/assets/AssetTransferState'; import {CallingRepository} from 'Repositories/calling/CallingRepository'; import {LEAVE_CALL_REASON} from 'Repositories/calling/enum/LeaveCallReason'; @@ -115,12 +116,6 @@ import { OnConversationE2EIVerificationStateChange, OnConversationVerificationStateChange, } from './ConversationVerificationStateHandler/shared'; -import {EventMapper} from './EventMapper'; -import {MessageRepository} from './MessageRepository'; -import {NOTIFICATION_STATE} from './NotificationSetting'; - -import {PrimaryModal} from '../components/Modals/PrimaryModal'; -import {Config} from '../Config'; import { AssetAddEvent, ButtonActionConfirmationEvent, @@ -132,37 +127,42 @@ import { MessageHiddenEvent, OneToOneCreationEvent, TeamMemberLeaveEvent, -} from '../conversation/EventBuilder'; -import {Conversation} from '../entity/Conversation'; -import {ContentMessage} from '../entity/message/ContentMessage'; -import {DeleteConversationMessage} from '../entity/message/DeleteConversationMessage'; -import {FileAsset} from '../entity/message/FileAsset'; -import {MemberMessage} from '../entity/message/MemberMessage'; -import {Message} from '../entity/message/Message'; -import {User} from '../entity/User'; -import {BaseError, BASE_ERROR_TYPE} from '../error/BaseError'; -import {ConversationError} from '../error/ConversationError'; -import {ClientEvent, CONVERSATION as CLIENT_CONVERSATION_EVENT} from '../event/Client'; -import {EventRepository} from '../event/EventRepository'; -import {EventService} from '../event/EventService'; -import {EventSource} from '../event/EventSource'; -import {NOTIFICATION_HANDLING_STATE} from '../event/NotificationHandlingState'; -import {isMemberMessage} from '../guards/Message'; -import * as LegalHoldEvaluator from '../legal-hold/LegalHoldEvaluator'; -import {MessageCategory} from '../message/MessageCategory'; -import {SystemMessageType} from '../message/SystemMessageType'; -import {addOtherSelfClientsToMLSConversation} from '../mls'; -import {PropertiesRepository} from '../properties/PropertiesRepository'; -import {SelfRepository} from '../self/SelfRepository'; -import {Core} from '../service/CoreSingleton'; -import type {EventRecord} from '../storage'; -import {ConversationRecord} from '../storage/record/ConversationRecord'; -import {TeamRepository} from '../team/TeamRepository'; -import {TeamState} from '../team/TeamState'; -import {ServerTimeHandler} from '../time/serverTimeHandler'; -import {UserFilter} from '../user/UserFilter'; -import {UserRepository} from '../user/UserRepository'; -import {UserState} from '../user/UserState'; +} from './EventBuilder'; +import {EventMapper} from './EventMapper'; +import {MessageRepository} from './MessageRepository'; +import {NOTIFICATION_STATE} from './NotificationSetting'; + +import {Config} from '../../Config'; +import {Conversation} from '../../entity/Conversation'; +import {ContentMessage} from '../../entity/message/ContentMessage'; +import {DeleteConversationMessage} from '../../entity/message/DeleteConversationMessage'; +import {FileAsset} from '../../entity/message/FileAsset'; +import {MemberMessage} from '../../entity/message/MemberMessage'; +import {Message} from '../../entity/message/Message'; +import {User} from '../../entity/User'; +import {BaseError, BASE_ERROR_TYPE} from '../../error/BaseError'; +import {ConversationError} from '../../error/ConversationError'; +import {ClientEvent, CONVERSATION as CLIENT_CONVERSATION_EVENT} from '../../event/Client'; +import {EventRepository} from '../../event/EventRepository'; +import {EventService} from '../../event/EventService'; +import {EventSource} from '../../event/EventSource'; +import {NOTIFICATION_HANDLING_STATE} from '../../event/NotificationHandlingState'; +import {isMemberMessage} from '../../guards/Message'; +import * as LegalHoldEvaluator from '../../legal-hold/LegalHoldEvaluator'; +import {MessageCategory} from '../../message/MessageCategory'; +import {SystemMessageType} from '../../message/SystemMessageType'; +import {addOtherSelfClientsToMLSConversation} from '../../mls'; +import {PropertiesRepository} from '../../properties/PropertiesRepository'; +import {SelfRepository} from '../../self/SelfRepository'; +import {Core} from '../../service/CoreSingleton'; +import type {EventRecord} from '../../storage'; +import {ConversationRecord} from '../../storage/record/ConversationRecord'; +import {TeamRepository} from '../../team/TeamRepository'; +import {TeamState} from '../../team/TeamState'; +import {ServerTimeHandler} from '../../time/serverTimeHandler'; +import {UserFilter} from '../../user/UserFilter'; +import {UserRepository} from '../../user/UserRepository'; +import {UserState} from '../../user/UserState'; type ConversationDBChange = {obj: EventRecord; oldObj: EventRecord}; type FetchPromise = {rejectFn: (error: ConversationError) => void; resolveFn: (conversation: Conversation) => void}; diff --git a/src/script/conversation/ConversationRoleRepository.test.ts b/src/script/repositories/conversation/ConversationRoleRepository.test.ts similarity index 93% rename from src/script/conversation/ConversationRoleRepository.test.ts rename to src/script/repositories/conversation/ConversationRoleRepository.test.ts index 629ca01f78c..ec7042ed51e 100644 --- a/src/script/conversation/ConversationRoleRepository.test.ts +++ b/src/script/repositories/conversation/ConversationRoleRepository.test.ts @@ -23,10 +23,10 @@ import {createUuid} from 'Util/uuid'; import {ConversationRoleRepository, Permissions} from './ConversationRoleRepository'; -import {TestFactory} from '../../../test/helper/TestFactory'; -import {Conversation} from '../entity/Conversation'; -import {User} from '../entity/User'; -import {TeamEntity} from '../team/TeamEntity'; +import {TestFactory} from '../../../../test/helper/TestFactory'; +import {Conversation} from '../../entity/Conversation'; +import {User} from '../../entity/User'; +import {TeamEntity} from '../../team/TeamEntity'; describe('ConversationRoleRepository', () => { const testFactory = new TestFactory(); diff --git a/src/script/conversation/ConversationRoleRepository.ts b/src/script/repositories/conversation/ConversationRoleRepository.ts similarity index 96% rename from src/script/conversation/ConversationRoleRepository.ts rename to src/script/repositories/conversation/ConversationRoleRepository.ts index 73361c11b9e..fb929af30d1 100644 --- a/src/script/conversation/ConversationRoleRepository.ts +++ b/src/script/repositories/conversation/ConversationRoleRepository.ts @@ -24,11 +24,11 @@ import {Logger, getLogger} from 'Util/Logger'; import type {ConversationService} from './ConversationService'; -import type {Conversation} from '../entity/Conversation'; -import type {User} from '../entity/User'; -import type {TeamRepository} from '../team/TeamRepository'; -import {TeamState} from '../team/TeamState'; -import {UserState} from '../user/UserState'; +import type {Conversation} from '../../entity/Conversation'; +import type {User} from '../../entity/User'; +import type {TeamRepository} from '../../team/TeamRepository'; +import {TeamState} from '../../team/TeamState'; +import {UserState} from '../../user/UserState'; export enum Permissions { addParticipants = 'add_conversation_member', diff --git a/src/script/conversation/ConversationSelectors.ts b/src/script/repositories/conversation/ConversationSelectors.ts similarity index 99% rename from src/script/conversation/ConversationSelectors.ts rename to src/script/repositories/conversation/ConversationSelectors.ts index 224172ec50c..c849fa14188 100644 --- a/src/script/conversation/ConversationSelectors.ts +++ b/src/script/repositories/conversation/ConversationSelectors.ts @@ -27,7 +27,7 @@ import {QualifiedId} from '@wireapp/api-client/lib/user/'; import {matchQualifiedIds} from 'Util/QualifiedId'; -import {Conversation} from '../entity/Conversation'; +import {Conversation} from '../../entity/Conversation'; export type ProteusConversation = Conversation & {protocol: ConversationProtocol.PROTEUS}; export type MixedConversation = Conversation & {groupId: string; protocol: ConversationProtocol.MIXED}; diff --git a/src/script/conversation/ConversationService.ts b/src/script/repositories/conversation/ConversationService.ts similarity index 96% rename from src/script/conversation/ConversationService.ts rename to src/script/repositories/conversation/ConversationService.ts index 03134d469c7..1b6eab9f847 100644 --- a/src/script/conversation/ConversationService.ts +++ b/src/script/repositories/conversation/ConversationService.ts @@ -47,15 +47,15 @@ import {container} from 'tsyringe'; import {MLSCapableConversation} from './ConversationSelectors'; -import type {Conversation as ConversationEntity} from '../entity/Conversation'; -import type {EventService} from '../event/EventService'; -import {MessageCategory} from '../message/MessageCategory'; -import {search as fullTextSearch} from '../search/FullTextSearch'; -import {APIClient} from '../service/APIClientSingleton'; -import {Core} from '../service/CoreSingleton'; -import {StorageService} from '../storage'; -import {ConversationRecord} from '../storage/record/ConversationRecord'; -import {StorageSchemata} from '../storage/StorageSchemata'; +import type {Conversation as ConversationEntity} from '../../entity/Conversation'; +import type {EventService} from '../../event/EventService'; +import {MessageCategory} from '../../message/MessageCategory'; +import {search as fullTextSearch} from '../../search/FullTextSearch'; +import {APIClient} from '../../service/APIClientSingleton'; +import {Core} from '../../service/CoreSingleton'; +import {StorageService} from '../../storage'; +import {ConversationRecord} from '../../storage/record/ConversationRecord'; +import {StorageSchemata} from '../../storage/StorageSchemata'; export class ConversationService { private readonly eventService: EventService; diff --git a/src/script/conversation/ConversationState.test.ts b/src/script/repositories/conversation/ConversationState.test.ts similarity index 97% rename from src/script/conversation/ConversationState.test.ts rename to src/script/repositories/conversation/ConversationState.test.ts index a2f33f3fc1c..fa81c0e5bde 100644 --- a/src/script/conversation/ConversationState.test.ts +++ b/src/script/repositories/conversation/ConversationState.test.ts @@ -23,9 +23,9 @@ import {randomUUID} from 'crypto'; import {ConversationState} from './ConversationState'; -import {Conversation} from '../entity/Conversation'; -import {TeamState} from '../team/TeamState'; -import {UserState} from '../user/UserState'; +import {Conversation} from '../../entity/Conversation'; +import {TeamState} from '../../team/TeamState'; +import {UserState} from '../../user/UserState'; function createConversationState() { return new ConversationState(new UserState(), new TeamState()); diff --git a/src/script/conversation/ConversationState.ts b/src/script/repositories/conversation/ConversationState.ts similarity index 98% rename from src/script/conversation/ConversationState.ts rename to src/script/repositories/conversation/ConversationState.ts index e73a5bafffb..945af439b2f 100644 --- a/src/script/conversation/ConversationState.ts +++ b/src/script/repositories/conversation/ConversationState.ts @@ -34,10 +34,10 @@ import { isReadableConversation, } from './ConversationSelectors'; -import {Conversation} from '../entity/Conversation'; -import {User} from '../entity/User'; -import {TeamState} from '../team/TeamState'; -import {UserState} from '../user/UserState'; +import {Conversation} from '../../entity/Conversation'; +import {User} from '../../entity/User'; +import {TeamState} from '../../team/TeamState'; +import {UserState} from '../../user/UserState'; @singleton() export class ConversationState { diff --git a/src/script/conversation/ConversationStateHandler.ts b/src/script/repositories/conversation/ConversationStateHandler.ts similarity index 98% rename from src/script/conversation/ConversationStateHandler.ts rename to src/script/repositories/conversation/ConversationStateHandler.ts index dc28daf24e6..75112a1261f 100644 --- a/src/script/conversation/ConversationStateHandler.ts +++ b/src/script/repositories/conversation/ConversationStateHandler.ts @@ -22,6 +22,7 @@ import {ConversationAccessUpdateData} from '@wireapp/api-client/lib/conversation import {CONVERSATION_EVENT} from '@wireapp/api-client/lib/event/'; import {StatusCodes as HTTP_STATUS} from 'http-status-codes'; +import {PrimaryModal} from 'Components/Modals/PrimaryModal'; import {t} from 'Util/LocalizerUtil'; import {AbstractConversationEventHandler, EventHandlingConfig} from './AbstractConversationEventHandler'; @@ -36,8 +37,7 @@ import {ConversationMapper} from './ConversationMapper'; import type {ConversationService} from './ConversationService'; import {ConversationEvent} from './EventBuilder'; -import {PrimaryModal} from '../components/Modals/PrimaryModal'; -import type {Conversation} from '../entity/Conversation'; +import type {Conversation} from '../../entity/Conversation'; export class ConversationStateHandler extends AbstractConversationEventHandler { private readonly conversationService: ConversationService; diff --git a/src/script/conversation/ConversationStatus.ts b/src/script/repositories/conversation/ConversationStatus.ts similarity index 100% rename from src/script/conversation/ConversationStatus.ts rename to src/script/repositories/conversation/ConversationStatus.ts diff --git a/src/script/conversation/ConversationStatusIcon.ts b/src/script/repositories/conversation/ConversationStatusIcon.ts similarity index 100% rename from src/script/conversation/ConversationStatusIcon.ts rename to src/script/repositories/conversation/ConversationStatusIcon.ts diff --git a/src/script/conversation/ConversationVerificationState.ts b/src/script/repositories/conversation/ConversationVerificationState.ts similarity index 100% rename from src/script/conversation/ConversationVerificationState.ts rename to src/script/repositories/conversation/ConversationVerificationState.ts diff --git a/src/script/conversation/ConversationVerificationStateHandler/MLS/MLSStateHandler.test.ts b/src/script/repositories/conversation/ConversationVerificationStateHandler/MLS/MLSStateHandler.test.ts similarity index 100% rename from src/script/conversation/ConversationVerificationStateHandler/MLS/MLSStateHandler.test.ts rename to src/script/repositories/conversation/ConversationVerificationStateHandler/MLS/MLSStateHandler.test.ts diff --git a/src/script/conversation/ConversationVerificationStateHandler/MLS/MLSStateHandler.ts b/src/script/repositories/conversation/ConversationVerificationStateHandler/MLS/MLSStateHandler.ts similarity index 100% rename from src/script/conversation/ConversationVerificationStateHandler/MLS/MLSStateHandler.ts rename to src/script/repositories/conversation/ConversationVerificationStateHandler/MLS/MLSStateHandler.ts diff --git a/src/script/conversation/ConversationVerificationStateHandler/MLS/index.ts b/src/script/repositories/conversation/ConversationVerificationStateHandler/MLS/index.ts similarity index 100% rename from src/script/conversation/ConversationVerificationStateHandler/MLS/index.ts rename to src/script/repositories/conversation/ConversationVerificationStateHandler/MLS/index.ts diff --git a/src/script/conversation/ConversationVerificationStateHandler/Proteus/ProteusStateHandler.test.ts b/src/script/repositories/conversation/ConversationVerificationStateHandler/Proteus/ProteusStateHandler.test.ts similarity index 98% rename from src/script/conversation/ConversationVerificationStateHandler/Proteus/ProteusStateHandler.test.ts rename to src/script/repositories/conversation/ConversationVerificationStateHandler/Proteus/ProteusStateHandler.test.ts index bfadbfe377f..fbb29190456 100644 --- a/src/script/conversation/ConversationVerificationStateHandler/Proteus/ProteusStateHandler.test.ts +++ b/src/script/repositories/conversation/ConversationVerificationStateHandler/Proteus/ProteusStateHandler.test.ts @@ -18,16 +18,16 @@ */ import {ClientEntity} from 'Repositories/client/ClientEntity'; -import {ConversationVerificationState} from 'src/script/conversation/ConversationVerificationState'; -import {EventBuilder} from 'src/script/conversation/EventBuilder'; import {Conversation} from 'src/script/entity/Conversation'; import {User} from 'src/script/entity/User'; import {createUuid} from 'Util/uuid'; import {ProteusConversationVerificationStateHandler} from './ProteusStateHandler'; -import {TestFactory} from '../../../../../test/helper/TestFactory'; +import {TestFactory} from '../../../../../../test/helper/TestFactory'; import {ConversationRepository} from '../../ConversationRepository'; +import {ConversationVerificationState} from '../../ConversationVerificationState'; +import {EventBuilder} from '../../EventBuilder'; describe('ProteusConversationVerificationStateHandler', () => { const testFactory = new TestFactory(); diff --git a/src/script/conversation/ConversationVerificationStateHandler/Proteus/ProteusStateHandler.ts b/src/script/repositories/conversation/ConversationVerificationStateHandler/Proteus/ProteusStateHandler.ts similarity index 100% rename from src/script/conversation/ConversationVerificationStateHandler/Proteus/ProteusStateHandler.ts rename to src/script/repositories/conversation/ConversationVerificationStateHandler/Proteus/ProteusStateHandler.ts diff --git a/src/script/conversation/ConversationVerificationStateHandler/Proteus/index.ts b/src/script/repositories/conversation/ConversationVerificationStateHandler/Proteus/index.ts similarity index 100% rename from src/script/conversation/ConversationVerificationStateHandler/Proteus/index.ts rename to src/script/repositories/conversation/ConversationVerificationStateHandler/Proteus/index.ts diff --git a/src/script/conversation/ConversationVerificationStateHandler/index.ts b/src/script/repositories/conversation/ConversationVerificationStateHandler/index.ts similarity index 100% rename from src/script/conversation/ConversationVerificationStateHandler/index.ts rename to src/script/repositories/conversation/ConversationVerificationStateHandler/index.ts diff --git a/src/script/conversation/ConversationVerificationStateHandler/shared/changeHandler/index.ts b/src/script/repositories/conversation/ConversationVerificationStateHandler/shared/changeHandler/index.ts similarity index 89% rename from src/script/conversation/ConversationVerificationStateHandler/shared/changeHandler/index.ts rename to src/script/repositories/conversation/ConversationVerificationStateHandler/shared/changeHandler/index.ts index 9c29750fd4f..614048052bf 100644 --- a/src/script/conversation/ConversationVerificationStateHandler/shared/changeHandler/index.ts +++ b/src/script/repositories/conversation/ConversationVerificationStateHandler/shared/changeHandler/index.ts @@ -19,11 +19,11 @@ import {QualifiedId} from '@wireapp/api-client/lib/user'; -import {ConversationVerificationState} from 'src/script/conversation/ConversationVerificationState'; import {Conversation} from 'src/script/entity/Conversation'; import {VerificationMessageType} from 'src/script/message/VerificationMessageType'; -import {E2EIVerificationMessageType} from '../../../../message/E2EIVerificationMessageType'; +import {E2EIVerificationMessageType} from '../../../../../message/E2EIVerificationMessageType'; +import {ConversationVerificationState} from '../../../ConversationVerificationState'; interface CommonOnConversationVerificationStateChangeParams { conversationEntity: Conversation; diff --git a/src/script/conversation/ConversationVerificationStateHandler/shared/conversation/index.ts b/src/script/repositories/conversation/ConversationVerificationStateHandler/shared/conversation/index.ts similarity index 95% rename from src/script/conversation/ConversationVerificationStateHandler/shared/conversation/index.ts rename to src/script/repositories/conversation/ConversationVerificationStateHandler/shared/conversation/index.ts index 3d66807acaf..df1c494af8f 100644 --- a/src/script/conversation/ConversationVerificationStateHandler/shared/conversation/index.ts +++ b/src/script/repositories/conversation/ConversationVerificationStateHandler/shared/conversation/index.ts @@ -19,14 +19,15 @@ import {QualifiedId} from '@wireapp/api-client/lib/user'; -import {isMLSCapableConversation, MLSCapableConversation} from 'src/script/conversation/ConversationSelectors'; -import {ConversationState} from 'src/script/conversation/ConversationState'; -import {ConversationVerificationState} from 'src/script/conversation/ConversationVerificationState'; import {Conversation} from 'src/script/entity/Conversation'; import {UserState} from 'src/script/user/UserState'; import {Logger} from 'Util/Logger'; import {matchQualifiedIds} from 'Util/QualifiedId'; +import {isMLSCapableConversation, MLSCapableConversation} from '../../../ConversationSelectors'; +import {ConversationState} from '../../../ConversationState'; +import {ConversationVerificationState} from '../../../ConversationVerificationState'; + interface GetActiveConversationsWithUsersParams { userIds: QualifiedId[]; conversationState: ConversationState; diff --git a/src/script/conversation/ConversationVerificationStateHandler/shared/index.ts b/src/script/repositories/conversation/ConversationVerificationStateHandler/shared/index.ts similarity index 100% rename from src/script/conversation/ConversationVerificationStateHandler/shared/index.ts rename to src/script/repositories/conversation/ConversationVerificationStateHandler/shared/index.ts diff --git a/src/script/conversation/EventBuilder.test.ts b/src/script/repositories/conversation/EventBuilder.test.ts similarity index 94% rename from src/script/conversation/EventBuilder.test.ts rename to src/script/repositories/conversation/EventBuilder.test.ts index 511e2cfa8ab..6091a2b10bc 100644 --- a/src/script/conversation/EventBuilder.test.ts +++ b/src/script/repositories/conversation/EventBuilder.test.ts @@ -19,8 +19,6 @@ import type {QualifiedId} from '@wireapp/api-client/lib/user/'; -import {EventBuilder} from 'src/script/conversation/EventBuilder'; -import {EventMapper} from 'src/script/conversation/EventMapper'; import {Conversation} from 'src/script/entity/Conversation'; import {User} from 'src/script/entity/User'; import {ClientEvent} from 'src/script/event/Client'; @@ -28,7 +26,10 @@ import {SuperType} from 'src/script/message/SuperType'; import {VerificationMessageType} from 'src/script/message/VerificationMessageType'; import {createUuid} from 'Util/uuid'; -import {VerificationMessage} from '../entity/message/VerificationMessage'; +import {EventBuilder} from './EventBuilder'; +import {EventMapper} from './EventMapper'; + +import {VerificationMessage} from '../../entity/message/VerificationMessage'; describe('EventBuilder', () => { let event_mapper: EventMapper = undefined; diff --git a/src/script/conversation/EventBuilder.ts b/src/script/repositories/conversation/EventBuilder.ts similarity index 97% rename from src/script/conversation/EventBuilder.ts rename to src/script/repositories/conversation/EventBuilder.ts index b07df955d5a..a6524beccd3 100644 --- a/src/script/conversation/EventBuilder.ts +++ b/src/script/repositories/conversation/EventBuilder.ts @@ -34,14 +34,14 @@ import type {Asset, LegalHoldStatus} from '@wireapp/protocol-messaging'; import {AssetTransferState} from 'Repositories/assets/AssetTransferState'; import {createUuid} from 'Util/uuid'; -import type {Conversation} from '../entity/Conversation'; -import type {Message} from '../entity/message/Message'; -import type {User} from '../entity/User'; -import {ClientEvent, CONVERSATION} from '../event/Client'; -import {E2EIVerificationMessageType} from '../message/E2EIVerificationMessageType'; -import {StatusType} from '../message/StatusType'; -import {VerificationMessageType} from '../message/VerificationMessageType'; -import {ReactionMap, ReadReceipt, UserReactionMap} from '../storage'; +import type {Conversation} from '../../entity/Conversation'; +import type {Message} from '../../entity/message/Message'; +import type {User} from '../../entity/User'; +import {ClientEvent, CONVERSATION} from '../../event/Client'; +import {E2EIVerificationMessageType} from '../../message/E2EIVerificationMessageType'; +import {StatusType} from '../../message/StatusType'; +import {VerificationMessageType} from '../../message/VerificationMessageType'; +import {ReactionMap, ReadReceipt, UserReactionMap} from '../../storage'; export interface BaseEvent { conversation: string; diff --git a/src/script/conversation/EventMapper.test.ts b/src/script/repositories/conversation/EventMapper.test.ts similarity index 100% rename from src/script/conversation/EventMapper.test.ts rename to src/script/repositories/conversation/EventMapper.test.ts diff --git a/src/script/conversation/EventMapper.ts b/src/script/repositories/conversation/EventMapper.ts similarity index 91% rename from src/script/conversation/EventMapper.ts rename to src/script/repositories/conversation/EventMapper.ts index bcd99536f99..9399b63b096 100644 --- a/src/script/conversation/EventMapper.ts +++ b/src/script/repositories/conversation/EventMapper.ts @@ -43,49 +43,49 @@ import { CompositeMessageAddEvent, } from './EventBuilder'; -import {AssetData} from '../cryptography/CryptographyMapper'; -import type {Conversation} from '../entity/Conversation'; -import {Button} from '../entity/message/Button'; -import {CallingTimeoutMessage} from '../entity/message/CallingTimeoutMessage'; -import {CallMessage} from '../entity/message/CallMessage'; -import {CompositeMessage} from '../entity/message/CompositeMessage'; -import {ContentMessage} from '../entity/message/ContentMessage'; -import {DecryptErrorMessage} from '../entity/message/DecryptErrorMessage'; -import {DeleteMessage} from '../entity/message/DeleteMessage'; -import {E2EIVerificationMessage} from '../entity/message/E2EIVerificationMessage'; -import {FailedToAddUsersMessage} from '../entity/message/FailedToAddUsersMessage'; -import {FederationStopMessage} from '../entity/message/FederationStopMessage'; -import {FileAsset} from '../entity/message/FileAsset'; -import {FileTypeRestrictedMessage} from '../entity/message/FileTypeRestrictedMessage'; -import {JoinedAfterMLSMigrationFinalisationMessage} from '../entity/message/JoinedAfterMLSMigrationFinalisationMessage'; -import {LegalHoldMessage} from '../entity/message/LegalHoldMessage'; -import {LinkPreview as LinkPreviewEntity, LinkPreviewData} from '../entity/message/LinkPreview'; -import {Location} from '../entity/message/Location'; -import {MediumImage} from '../entity/message/MediumImage'; -import {MemberMessage} from '../entity/message/MemberMessage'; -import type {Message} from '../entity/message/Message'; -import {MessageTimerUpdateMessage} from '../entity/message/MessageTimerUpdateMessage'; -import {MissedMessage} from '../entity/message/MissedMessage'; -import {MLSConversationRecoveredMessage} from '../entity/message/MLSConversationRecoveredMessage'; -import {MLSMigrationFinalisationOngoingCallMessage} from '../entity/message/MLSMigrationFinalisationOngoingCallMessage'; -import {OneToOneMigratedToMlsMessage} from '../entity/message/OneToOneMigratedToMlsMessage'; -import {PingMessage} from '../entity/message/PingMessage'; -import {ProtocolUpdateMessage} from '../entity/message/ProtocolUpdateMessage'; -import {ReceiptModeUpdateMessage} from '../entity/message/ReceiptModeUpdateMessage'; -import {RenameMessage} from '../entity/message/RenameMessage'; -import {Text} from '../entity/message/Text'; -import type {Text as TextAsset} from '../entity/message/Text'; -import {VerificationMessage} from '../entity/message/VerificationMessage'; -import {ConversationError} from '../error/ConversationError'; -import {ClientEvent} from '../event/Client'; -import {isContentMessage} from '../guards/Message'; -import {CALL_MESSAGE_TYPE} from '../message/CallMessageType'; -import {MentionEntity} from '../message/MentionEntity'; -import {QuoteEntity} from '../message/QuoteEntity'; -import {StatusType} from '../message/StatusType'; -import {SystemMessageType} from '../message/SystemMessageType'; -import {APIClient} from '../service/APIClientSingleton'; -import type {EventRecord, LegacyEventRecord} from '../storage'; +import {AssetData} from '../../cryptography/CryptographyMapper'; +import type {Conversation} from '../../entity/Conversation'; +import {Button} from '../../entity/message/Button'; +import {CallingTimeoutMessage} from '../../entity/message/CallingTimeoutMessage'; +import {CallMessage} from '../../entity/message/CallMessage'; +import {CompositeMessage} from '../../entity/message/CompositeMessage'; +import {ContentMessage} from '../../entity/message/ContentMessage'; +import {DecryptErrorMessage} from '../../entity/message/DecryptErrorMessage'; +import {DeleteMessage} from '../../entity/message/DeleteMessage'; +import {E2EIVerificationMessage} from '../../entity/message/E2EIVerificationMessage'; +import {FailedToAddUsersMessage} from '../../entity/message/FailedToAddUsersMessage'; +import {FederationStopMessage} from '../../entity/message/FederationStopMessage'; +import {FileAsset} from '../../entity/message/FileAsset'; +import {FileTypeRestrictedMessage} from '../../entity/message/FileTypeRestrictedMessage'; +import {JoinedAfterMLSMigrationFinalisationMessage} from '../../entity/message/JoinedAfterMLSMigrationFinalisationMessage'; +import {LegalHoldMessage} from '../../entity/message/LegalHoldMessage'; +import {LinkPreview as LinkPreviewEntity, LinkPreviewData} from '../../entity/message/LinkPreview'; +import {Location} from '../../entity/message/Location'; +import {MediumImage} from '../../entity/message/MediumImage'; +import {MemberMessage} from '../../entity/message/MemberMessage'; +import type {Message} from '../../entity/message/Message'; +import {MessageTimerUpdateMessage} from '../../entity/message/MessageTimerUpdateMessage'; +import {MissedMessage} from '../../entity/message/MissedMessage'; +import {MLSConversationRecoveredMessage} from '../../entity/message/MLSConversationRecoveredMessage'; +import {MLSMigrationFinalisationOngoingCallMessage} from '../../entity/message/MLSMigrationFinalisationOngoingCallMessage'; +import {OneToOneMigratedToMlsMessage} from '../../entity/message/OneToOneMigratedToMlsMessage'; +import {PingMessage} from '../../entity/message/PingMessage'; +import {ProtocolUpdateMessage} from '../../entity/message/ProtocolUpdateMessage'; +import {ReceiptModeUpdateMessage} from '../../entity/message/ReceiptModeUpdateMessage'; +import {RenameMessage} from '../../entity/message/RenameMessage'; +import {Text} from '../../entity/message/Text'; +import type {Text as TextAsset} from '../../entity/message/Text'; +import {VerificationMessage} from '../../entity/message/VerificationMessage'; +import {ConversationError} from '../../error/ConversationError'; +import {ClientEvent} from '../../event/Client'; +import {isContentMessage} from '../../guards/Message'; +import {CALL_MESSAGE_TYPE} from '../../message/CallMessageType'; +import {MentionEntity} from '../../message/MentionEntity'; +import {QuoteEntity} from '../../message/QuoteEntity'; +import {StatusType} from '../../message/StatusType'; +import {SystemMessageType} from '../../message/SystemMessageType'; +import {APIClient} from '../../service/APIClientSingleton'; +import type {EventRecord, LegacyEventRecord} from '../../storage'; // Event Mapper to convert all server side JSON events into core entities. export class EventMapper { diff --git a/src/script/conversation/MessageRepository.test.ts b/src/script/repositories/conversation/MessageRepository.test.ts similarity index 95% rename from src/script/conversation/MessageRepository.test.ts rename to src/script/repositories/conversation/MessageRepository.test.ts index 797aee4771a..f6aeac91c2b 100644 --- a/src/script/conversation/MessageRepository.test.ts +++ b/src/script/repositories/conversation/MessageRepository.test.ts @@ -30,7 +30,6 @@ import {AudioRepository} from 'Repositories/audio/AudioRepository'; import {ClientEntity} from 'Repositories/client/ClientEntity'; import {ClientState} from 'Repositories/client/ClientState'; import {ConnectionEntity} from 'Repositories/connection/ConnectionEntity'; -import {MessageRepository} from 'src/script/conversation/MessageRepository'; import {Conversation} from 'src/script/entity/Conversation'; import {Message} from 'src/script/entity/message/Message'; import {Text} from 'src/script/entity/message/Text'; @@ -41,18 +40,19 @@ import {createUuid} from 'Util/uuid'; import {ConversationRepository} from './ConversationRepository'; import {ConversationState} from './ConversationState'; - -import {CryptographyRepository} from '../cryptography/CryptographyRepository'; -import {ContentMessage} from '../entity/message/ContentMessage'; -import {EventRepository} from '../event/EventRepository'; -import {EventService} from '../event/EventService'; -import {StatusType} from '../message/StatusType'; -import {PropertiesRepository} from '../properties/PropertiesRepository'; -import {ReactionMap} from '../storage'; -import {TeamState} from '../team/TeamState'; -import {ServerTimeHandler, serverTimeHandler} from '../time/serverTimeHandler'; -import {UserRepository} from '../user/UserRepository'; -import {UserState} from '../user/UserState'; +import {MessageRepository} from './MessageRepository'; + +import {CryptographyRepository} from '../../cryptography/CryptographyRepository'; +import {ContentMessage} from '../../entity/message/ContentMessage'; +import {EventRepository} from '../../event/EventRepository'; +import {EventService} from '../../event/EventService'; +import {StatusType} from '../../message/StatusType'; +import {PropertiesRepository} from '../../properties/PropertiesRepository'; +import {ReactionMap} from '../../storage'; +import {TeamState} from '../../team/TeamState'; +import {ServerTimeHandler, serverTimeHandler} from '../../time/serverTimeHandler'; +import {UserRepository} from '../../user/UserRepository'; +import {UserState} from '../../user/UserState'; const selfUser = new User('selfid', ''); selfUser.isMe = true; diff --git a/src/script/conversation/MessageRepository.ts b/src/script/repositories/conversation/MessageRepository.ts similarity index 96% rename from src/script/conversation/MessageRepository.ts rename to src/script/repositories/conversation/MessageRepository.ts index d9c12c876d8..d5bef5a04e5 100644 --- a/src/script/conversation/MessageRepository.ts +++ b/src/script/repositories/conversation/MessageRepository.ts @@ -78,40 +78,40 @@ import {ConversationRepository} from './ConversationRepository'; import {isMLSConversation} from './ConversationSelectors'; import {ConversationState} from './ConversationState'; import {ConversationVerificationState} from './ConversationVerificationState'; +import {EventBuilder} from './EventBuilder'; import {EventMapper} from './EventMapper'; import {getLinkPreviewFromString} from './linkPreviews'; -import {EventBuilder} from '../conversation/EventBuilder'; -import {CryptographyRepository} from '../cryptography/CryptographyRepository'; -import {PROTO_MESSAGE_TYPE} from '../cryptography/ProtoMessageType'; -import {Conversation} from '../entity/Conversation'; -import {CompositeMessage} from '../entity/message/CompositeMessage'; -import {ContentMessage} from '../entity/message/ContentMessage'; -import {FileAsset} from '../entity/message/FileAsset'; -import {Message} from '../entity/message/Message'; -import {User} from '../entity/User'; -import {ConversationError} from '../error/ConversationError'; -import {EventRepository} from '../event/EventRepository'; -import {EventService} from '../event/EventService'; -import {EventTypeHandling} from '../event/EventTypeHandling'; -import {NOTIFICATION_HANDLING_STATE} from '../event/NotificationHandlingState'; -import {showLegalHoldWarningModal} from '../legal-hold/LegalHoldWarning'; -import {MentionEntity} from '../message/MentionEntity'; -import {QuoteEntity} from '../message/QuoteEntity'; -import {StatusType} from '../message/StatusType'; -import {PropertiesRepository} from '../properties/PropertiesRepository'; -import {PROPERTIES_TYPE} from '../properties/PropertiesType'; -import {Core} from '../service/CoreSingleton'; -import type {EventRecord, ReactionMap} from '../storage'; -import {TeamState} from '../team/TeamState'; -import {ServerTimeHandler} from '../time/serverTimeHandler'; -import {UserType} from '../tracking/attribute'; -import {EventName} from '../tracking/EventName'; -import * as trackingHelpers from '../tracking/Helpers'; -import {Segmentation} from '../tracking/Segmentation'; -import {protoFromType} from '../user/AvailabilityMapper'; -import {UserRepository} from '../user/UserRepository'; -import {UserState} from '../user/UserState'; +import {CryptographyRepository} from '../../cryptography/CryptographyRepository'; +import {PROTO_MESSAGE_TYPE} from '../../cryptography/ProtoMessageType'; +import {Conversation} from '../../entity/Conversation'; +import {CompositeMessage} from '../../entity/message/CompositeMessage'; +import {ContentMessage} from '../../entity/message/ContentMessage'; +import {FileAsset} from '../../entity/message/FileAsset'; +import {Message} from '../../entity/message/Message'; +import {User} from '../../entity/User'; +import {ConversationError} from '../../error/ConversationError'; +import {EventRepository} from '../../event/EventRepository'; +import {EventService} from '../../event/EventService'; +import {EventTypeHandling} from '../../event/EventTypeHandling'; +import {NOTIFICATION_HANDLING_STATE} from '../../event/NotificationHandlingState'; +import {showLegalHoldWarningModal} from '../../legal-hold/LegalHoldWarning'; +import {MentionEntity} from '../../message/MentionEntity'; +import {QuoteEntity} from '../../message/QuoteEntity'; +import {StatusType} from '../../message/StatusType'; +import {PropertiesRepository} from '../../properties/PropertiesRepository'; +import {PROPERTIES_TYPE} from '../../properties/PropertiesType'; +import {Core} from '../../service/CoreSingleton'; +import type {EventRecord, ReactionMap} from '../../storage'; +import {TeamState} from '../../team/TeamState'; +import {ServerTimeHandler} from '../../time/serverTimeHandler'; +import {UserType} from '../../tracking/attribute'; +import {EventName} from '../../tracking/EventName'; +import * as trackingHelpers from '../../tracking/Helpers'; +import {Segmentation} from '../../tracking/Segmentation'; +import {protoFromType} from '../../user/AvailabilityMapper'; +import {UserRepository} from '../../user/UserRepository'; +import {UserState} from '../../user/UserState'; export interface MessageSendingOptions { /** Send native push notification for message. Default is `true`. */ diff --git a/src/script/conversation/NotificationSetting.ts b/src/script/repositories/conversation/NotificationSetting.ts similarity index 100% rename from src/script/conversation/NotificationSetting.ts rename to src/script/repositories/conversation/NotificationSetting.ts diff --git a/src/script/conversation/linkPreviews/LinkPreviewError.ts b/src/script/repositories/conversation/linkPreviews/LinkPreviewError.ts similarity index 97% rename from src/script/conversation/linkPreviews/LinkPreviewError.ts rename to src/script/repositories/conversation/linkPreviews/LinkPreviewError.ts index 4410f71e5c1..6bbacae66d4 100644 --- a/src/script/conversation/linkPreviews/LinkPreviewError.ts +++ b/src/script/repositories/conversation/linkPreviews/LinkPreviewError.ts @@ -17,7 +17,7 @@ * */ -import {BaseError} from '../../error/BaseError'; +import {BaseError} from '../../../error/BaseError'; enum LINK_PREVIEW_ERROR_TYPE { BLACKLISTED = 'BLACKLISTED', diff --git a/src/script/conversation/linkPreviews/blackList.test.ts b/src/script/repositories/conversation/linkPreviews/blackList.test.ts similarity index 100% rename from src/script/conversation/linkPreviews/blackList.test.ts rename to src/script/repositories/conversation/linkPreviews/blackList.test.ts diff --git a/src/script/conversation/linkPreviews/blackList.ts b/src/script/repositories/conversation/linkPreviews/blackList.ts similarity index 100% rename from src/script/conversation/linkPreviews/blackList.ts rename to src/script/repositories/conversation/linkPreviews/blackList.ts diff --git a/src/script/conversation/linkPreviews/helpers.test.ts b/src/script/repositories/conversation/linkPreviews/helpers.test.ts similarity index 100% rename from src/script/conversation/linkPreviews/helpers.test.ts rename to src/script/repositories/conversation/linkPreviews/helpers.test.ts diff --git a/src/script/conversation/linkPreviews/helpers.ts b/src/script/repositories/conversation/linkPreviews/helpers.ts similarity index 100% rename from src/script/conversation/linkPreviews/helpers.ts rename to src/script/repositories/conversation/linkPreviews/helpers.ts diff --git a/src/script/conversation/linkPreviews/index.test.ts b/src/script/repositories/conversation/linkPreviews/index.test.ts similarity index 100% rename from src/script/conversation/linkPreviews/index.test.ts rename to src/script/repositories/conversation/linkPreviews/index.test.ts diff --git a/src/script/conversation/linkPreviews/index.ts b/src/script/repositories/conversation/linkPreviews/index.ts similarity index 99% rename from src/script/conversation/linkPreviews/index.ts rename to src/script/repositories/conversation/linkPreviews/index.ts index ce5fdb04dab..0bd47a65e2d 100644 --- a/src/script/conversation/linkPreviews/index.ts +++ b/src/script/repositories/conversation/linkPreviews/index.ts @@ -29,7 +29,7 @@ import {isBlacklisted} from './blackList'; import {getFirstLinkWithOffset} from './helpers'; import {LinkPreviewError} from './LinkPreviewError'; -import {Config} from '../../Config'; +import {Config} from '../../../Config'; type LinkPreviewContent = { image?: { diff --git a/src/script/conversation/userClientsUtils.test.ts b/src/script/repositories/conversation/userClientsUtils.test.ts similarity index 100% rename from src/script/conversation/userClientsUtils.test.ts rename to src/script/repositories/conversation/userClientsUtils.test.ts diff --git a/src/script/conversation/userClientsUtils.ts b/src/script/repositories/conversation/userClientsUtils.ts similarity index 100% rename from src/script/conversation/userClientsUtils.ts rename to src/script/repositories/conversation/userClientsUtils.ts diff --git a/src/script/storage/record/ConversationRecord.ts b/src/script/storage/record/ConversationRecord.ts index 0dc7ace4069..2bc9cd98ccc 100644 --- a/src/script/storage/record/ConversationRecord.ts +++ b/src/script/storage/record/ConversationRecord.ts @@ -30,10 +30,9 @@ import type {QualifiedId} from '@wireapp/api-client/lib/user/'; import {LegalHoldStatus} from '@wireapp/protocol-messaging'; -import {CONVERSATION_READONLY_STATE} from 'src/script/conversation/ConversationRepository'; - -import {ConversationStatus} from '../../conversation/ConversationStatus'; -import {ConversationVerificationState} from '../../conversation/ConversationVerificationState'; +import {CONVERSATION_READONLY_STATE} from 'Repositories/conversation/ConversationRepository'; +import {ConversationStatus} from 'Repositories/conversation/ConversationStatus'; +import {ConversationVerificationState} from 'Repositories/conversation/ConversationVerificationState'; export interface ConversationRecord { access_role: CONVERSATION_LEGACY_ACCESS_ROLE | CONVERSATION_ACCESS_ROLE[]; diff --git a/src/script/storage/record/EventRecord.ts b/src/script/storage/record/EventRecord.ts index ae3a6333383..eea5eb99373 100644 --- a/src/script/storage/record/EventRecord.ts +++ b/src/script/storage/record/EventRecord.ts @@ -22,7 +22,7 @@ import type {ConversationEvent} from '@wireapp/api-client/lib/event'; import type {QualifiedId} from '@wireapp/api-client/lib/user'; import type {ReactionType} from '@wireapp/core/lib/conversation/'; -import {ClientConversationEvent} from 'src/script/conversation/EventBuilder'; +import {ClientConversationEvent} from 'Repositories/conversation/EventBuilder'; import {StatusType} from '../../message/StatusType'; diff --git a/src/script/tracking/EventTrackingRepository.ts b/src/script/tracking/EventTrackingRepository.ts index 32df75de25b..4b1c9681d57 100644 --- a/src/script/tracking/EventTrackingRepository.ts +++ b/src/script/tracking/EventTrackingRepository.ts @@ -22,6 +22,7 @@ import {container} from 'tsyringe'; import {WebAppEvents} from '@wireapp/webapp-events'; +import type {ContributedSegmentations, MessageRepository} from 'Repositories/conversation/MessageRepository'; import {getLogger, Logger} from 'Util/Logger'; import {loadValue, storeValue, resetStoreValue} from 'Util/StorageUtil'; import {includesString} from 'Util/StringUtil'; @@ -40,7 +41,6 @@ import {UserData} from './UserData'; import {URLParameter} from '../auth/URLParameter'; import {Config} from '../Config'; -import type {ContributedSegmentations, MessageRepository} from '../conversation/MessageRepository'; import {ClientEvent} from '../event/Client'; import {TeamState} from '../team/TeamState'; diff --git a/src/script/tracking/countly-skd-web.d.ts b/src/script/tracking/countly-skd-web.d.ts index ef819722374..97c3d8395d3 100644 --- a/src/script/tracking/countly-skd-web.d.ts +++ b/src/script/tracking/countly-skd-web.d.ts @@ -17,9 +17,9 @@ * */ -import {Segmentation} from './Segmentation'; +import type {ContributedSegmentations} from 'Repositories/conversation/MessageRepository'; -import type {ContributedSegmentations} from '../conversation/MessageRepository'; +import {Segmentation} from './Segmentation'; type Keys = keyof typeof Segmentation; type Values = (typeof Segmentation)[Keys]; diff --git a/src/script/ui/LabelContextMenu.ts b/src/script/ui/LabelContextMenu.ts index a1385b80579..35bdbbfb9c3 100644 --- a/src/script/ui/LabelContextMenu.ts +++ b/src/script/ui/LabelContextMenu.ts @@ -18,11 +18,11 @@ */ import {PlusIcon} from 'Components/Icon'; +import type {ConversationLabelRepository} from 'Repositories/conversation/ConversationLabelRepository'; import {t} from 'Util/LocalizerUtil'; import {ContextMenuEntry, showContextMenu} from './ContextMenu'; -import type {ConversationLabelRepository} from '../conversation/ConversationLabelRepository'; import type {Conversation} from '../entity/Conversation'; export const showLabelContextMenu = ( diff --git a/src/script/user/UserRepository.ts b/src/script/user/UserRepository.ts index 48b2c4efb79..a1a178c8878 100644 --- a/src/script/user/UserRepository.ts +++ b/src/script/user/UserRepository.ts @@ -51,6 +51,7 @@ import type {ClientRepository, QualifiedUserClientEntityMap} from 'Repositories/ import {ClientEntity} from 'Repositories/client/ClientEntity'; import {ClientMapper} from 'Repositories/client/ClientMapper'; import type {ConnectionEntity} from 'Repositories/connection/ConnectionEntity'; +import {flattenUserClientsQualifiedIds} from 'Repositories/conversation/userClientsUtils'; import {chunk, partition} from 'Util/ArrayUtil'; import {t} from 'Util/LocalizerUtil'; import {getLogger, Logger} from 'Util/Logger'; @@ -66,7 +67,6 @@ import {UserState} from './UserState'; import {SIGN_OUT_REASON} from '../auth/SignOutReason'; import {Config} from '../Config'; -import {flattenUserClientsQualifiedIds} from '../conversation/userClientsUtils'; import {Conversation} from '../entity/Conversation'; import {User} from '../entity/User'; import {UserError} from '../error/UserError'; diff --git a/src/script/util/DebugUtil.ts b/src/script/util/DebugUtil.ts index 1593aae38d9..6c085f2d74a 100644 --- a/src/script/util/DebugUtil.ts +++ b/src/script/util/DebugUtil.ts @@ -44,16 +44,16 @@ import {Participant} from 'Repositories/calling/Participant'; import {ClientRepository} from 'Repositories/client'; import {ClientState} from 'Repositories/client/ClientState'; import {ConnectionRepository} from 'Repositories/connection/ConnectionRepository'; +import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; +import {isMLSCapableConversation} from 'Repositories/conversation/ConversationSelectors'; +import {ConversationState} from 'Repositories/conversation/ConversationState'; +import type {MessageRepository} from 'Repositories/conversation/MessageRepository'; import {getLogger, Logger} from 'Util/Logger'; import {KEY} from './KeyboardUtil'; import {TIME_IN_MILLIS} from './TimeUtil'; import {createUuid} from './uuid'; -import {ConversationRepository} from '../conversation/ConversationRepository'; -import {isMLSCapableConversation} from '../conversation/ConversationSelectors'; -import {ConversationState} from '../conversation/ConversationState'; -import type {MessageRepository} from '../conversation/MessageRepository'; import {E2EIHandler} from '../E2EIdentity'; import {Conversation} from '../entity/Conversation'; import {User} from '../entity/User'; diff --git a/src/script/view_model/ActionsViewModel.ts b/src/script/view_model/ActionsViewModel.ts index f4e1025a4fa..b78bf511028 100644 --- a/src/script/view_model/ActionsViewModel.ts +++ b/src/script/view_model/ActionsViewModel.ts @@ -28,14 +28,14 @@ import {WebAppEvents} from '@wireapp/webapp-events'; import {PrimaryModal, removeCurrentModal, usePrimaryModalState} from 'Components/Modals/PrimaryModal'; import type {ClientEntity} from 'Repositories/client'; import type {ConnectionRepository} from 'Repositories/connection/ConnectionRepository'; +import type {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; +import type {MessageRepository} from 'Repositories/conversation/MessageRepository'; +import {NOTIFICATION_STATE} from 'Repositories/conversation/NotificationSetting'; import {t} from 'Util/LocalizerUtil'; import {isBackendError} from 'Util/TypePredicateUtil'; import type {MainViewModel} from './MainViewModel'; -import type {ConversationRepository} from '../conversation/ConversationRepository'; -import type {MessageRepository} from '../conversation/MessageRepository'; -import {NOTIFICATION_STATE} from '../conversation/NotificationSetting'; import type {Conversation} from '../entity/Conversation'; import type {Message} from '../entity/message/Message'; import type {User} from '../entity/User'; diff --git a/src/script/view_model/CallingViewModel.ts b/src/script/view_model/CallingViewModel.ts index a5ecad82b94..f2c4d4090b3 100644 --- a/src/script/view_model/CallingViewModel.ts +++ b/src/script/view_model/CallingViewModel.ts @@ -28,20 +28,20 @@ import {WebAppEvents} from '@wireapp/webapp-events'; import {ButtonGroupTab} from 'Components/calling/ButtonGroup'; import 'Components/calling/ChooseScreen'; +import {PrimaryModal} from 'Components/Modals/PrimaryModal'; import type {AudioRepository} from 'Repositories/audio/AudioRepository'; import {AudioType} from 'Repositories/audio/AudioType'; import type {Call} from 'Repositories/calling/Call'; import {CallingRepository} from 'Repositories/calling/CallingRepository'; import {CallState, DesktopScreenShareMenu} from 'Repositories/calling/CallState'; import {LEAVE_CALL_REASON} from 'Repositories/calling/enum/LeaveCallReason'; +import {ConversationState} from 'Repositories/conversation/ConversationState'; +import {ConversationVerificationState} from 'Repositories/conversation/ConversationVerificationState'; import {replaceLink, t} from 'Util/LocalizerUtil'; import {matchQualifiedIds} from 'Util/QualifiedId'; import {safeWindowOpen} from 'Util/SanitizationUtil'; -import {PrimaryModal} from '../components/Modals/PrimaryModal'; import {Config} from '../Config'; -import {ConversationState} from '../conversation/ConversationState'; -import {ConversationVerificationState} from '../conversation/ConversationVerificationState'; import type {Conversation} from '../entity/Conversation'; import type {User} from '../entity/User'; import type {ElectronDesktopCapturerSource, MediaDevicesHandler} from '../media/MediaDevicesHandler'; diff --git a/src/script/view_model/ContentViewModel.ts b/src/script/view_model/ContentViewModel.ts index fb6641cd1ff..589008753b7 100644 --- a/src/script/view_model/ContentViewModel.ts +++ b/src/script/view_model/ContentViewModel.ts @@ -26,6 +26,9 @@ import {container} from 'tsyringe'; import {WebAppEvents} from '@wireapp/webapp-events'; import {PrimaryModal} from 'Components/Modals/PrimaryModal'; +import type {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; +import {ConversationState} from 'Repositories/conversation/ConversationState'; +import {MessageRepository} from 'Repositories/conversation/MessageRepository'; import {t} from 'Util/LocalizerUtil'; import {getLogger, Logger} from 'Util/Logger'; import {isConversationEntity} from 'Util/TypePredicateUtil'; @@ -33,9 +36,6 @@ import {isConversationEntity} from 'Util/TypePredicateUtil'; import type {MainViewModel, ViewModelRepositories} from './MainViewModel'; import {Config} from '../Config'; -import type {ConversationRepository} from '../conversation/ConversationRepository'; -import {ConversationState} from '../conversation/ConversationState'; -import {MessageRepository} from '../conversation/MessageRepository'; import {Conversation} from '../entity/Conversation'; import type {Message} from '../entity/message/Message'; import {ConversationError} from '../error/ConversationError'; diff --git a/src/script/view_model/ListViewModel.ts b/src/script/view_model/ListViewModel.ts index 605cec27635..fbdaaa0179d 100644 --- a/src/script/view_model/ListViewModel.ts +++ b/src/script/view_model/ListViewModel.ts @@ -26,6 +26,8 @@ import {WebAppEvents} from '@wireapp/webapp-events'; import {PrimaryModal, usePrimaryModalState} from 'Components/Modals/PrimaryModal'; import type {CallingRepository} from 'Repositories/calling/CallingRepository'; +import type {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; +import {ConversationState} from 'Repositories/conversation/ConversationState'; import {iterateItem} from 'Util/ArrayUtil'; import {isEscapeKey} from 'Util/KeyboardUtil'; import {t} from 'Util/LocalizerUtil'; @@ -35,8 +37,6 @@ import {CallingViewModel} from './CallingViewModel'; import {ContentViewModel} from './ContentViewModel'; import type {MainViewModel, ViewModelRepositories} from './MainViewModel'; -import type {ConversationRepository} from '../conversation/ConversationRepository'; -import {ConversationState} from '../conversation/ConversationState'; import type {Conversation} from '../entity/Conversation'; import type {User} from '../entity/User'; import {SidebarTabs, useSidebarStore} from '../page/LeftSidebar/panels/Conversations/useSidebarStore'; diff --git a/src/script/view_model/MainViewModel.ts b/src/script/view_model/MainViewModel.ts index 8132904edb5..bbbe87bddad 100644 --- a/src/script/view_model/MainViewModel.ts +++ b/src/script/view_model/MainViewModel.ts @@ -25,14 +25,14 @@ import type {BackupRepository} from 'Repositories/backup/BackupRepository'; import type {CallingRepository} from 'Repositories/calling/CallingRepository'; import type {ClientRepository} from 'Repositories/client'; import type {ConnectionRepository} from 'Repositories/connection/ConnectionRepository'; +import type {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; +import type {MessageRepository} from 'Repositories/conversation/MessageRepository'; import {ActionsViewModel} from './ActionsViewModel'; import {CallingViewModel} from './CallingViewModel'; import {ContentViewModel} from './ContentViewModel'; import {ListViewModel} from './ListViewModel'; -import type {ConversationRepository} from '../conversation/ConversationRepository'; -import type {MessageRepository} from '../conversation/MessageRepository'; import type {CryptographyRepository} from '../cryptography/CryptographyRepository'; import type {EventRepository} from '../event/EventRepository'; import type {GiphyRepository} from '../extension/GiphyRepository'; diff --git a/test/helper/ConversationGenerator.ts b/test/helper/ConversationGenerator.ts index ae5d1457717..f7291434256 100644 --- a/test/helper/ConversationGenerator.ts +++ b/test/helper/ConversationGenerator.ts @@ -30,9 +30,9 @@ import {QualifiedId} from '@wireapp/api-client/lib/user'; import {LegalHoldStatus} from '@wireapp/core/lib/conversation/content'; import {ConnectionEntity} from 'Repositories/connection/ConnectionEntity'; -import {ConversationDatabaseData, ConversationMapper} from 'src/script/conversation/ConversationMapper'; -import {ConversationStatus} from 'src/script/conversation/ConversationStatus'; -import {ConversationVerificationState} from 'src/script/conversation/ConversationVerificationState'; +import {ConversationDatabaseData, ConversationMapper} from 'Repositories/conversation/ConversationMapper'; +import {ConversationStatus} from 'Repositories/conversation/ConversationStatus'; +import {ConversationVerificationState} from 'Repositories/conversation/ConversationVerificationState'; import {Conversation} from 'src/script/entity/Conversation'; import {User} from 'src/script/entity/User'; import {createUuid} from 'Util/uuid'; diff --git a/test/helper/EventGenerator.ts b/test/helper/EventGenerator.ts index 2e7ac4f43c0..e11b2d3b7e3 100644 --- a/test/helper/EventGenerator.ts +++ b/test/helper/EventGenerator.ts @@ -29,7 +29,7 @@ import { MemberLeaveEvent, MessageAddEvent, ReactionEvent, -} from 'src/script/conversation/EventBuilder'; +} from 'Repositories/conversation/EventBuilder'; import {Conversation} from 'src/script/entity/Conversation'; import {CONVERSATION} from 'src/script/event/Client'; import {createUuid} from 'Util/uuid'; diff --git a/test/helper/TestFactory.js b/test/helper/TestFactory.js index f91d235aa1f..61c74d9ca27 100644 --- a/test/helper/TestFactory.js +++ b/test/helper/TestFactory.js @@ -37,10 +37,10 @@ import {ClientService} from 'Repositories/client/ClientService'; import {ClientState} from 'Repositories/client/ClientState'; import {ConnectionRepository} from 'Repositories/connection/ConnectionRepository'; import {ConnectionService} from 'Repositories/connection/ConnectionService'; -import {ConversationRepository} from 'src/script/conversation/ConversationRepository'; -import {ConversationService} from 'src/script/conversation/ConversationService'; -import {ConversationState} from 'src/script/conversation/ConversationState'; -import {MessageRepository} from 'src/script/conversation/MessageRepository'; +import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; +import {ConversationService} from 'Repositories/conversation/ConversationService'; +import {ConversationState} from 'Repositories/conversation/ConversationState'; +import {MessageRepository} from 'Repositories/conversation/MessageRepository'; import {CryptographyRepository} from 'src/script/cryptography/CryptographyRepository'; import {User} from 'src/script/entity/User'; import {EventRepository} from 'src/script/event/EventRepository'; diff --git a/test/unit_tests/conversation/ConversationEphemeralHandlerSpec.js b/test/unit_tests/conversation/ConversationEphemeralHandlerSpec.js index ececaed0853..a964855659d 100644 --- a/test/unit_tests/conversation/ConversationEphemeralHandlerSpec.js +++ b/test/unit_tests/conversation/ConversationEphemeralHandlerSpec.js @@ -17,7 +17,7 @@ * */ -import {ConversationEphemeralHandler} from 'src/script/conversation/ConversationEphemeralHandler'; +import {ConversationEphemeralHandler} from 'Repositories/conversation/ConversationEphemeralHandler'; import {Conversation} from 'src/script/entity/Conversation'; import {EventService} from 'src/script/event/EventService'; diff --git a/test/unit_tests/conversation/ConversationLabelSpec.js b/test/unit_tests/conversation/ConversationLabelSpec.js index c66d36c2833..94271dd6d09 100644 --- a/test/unit_tests/conversation/ConversationLabelSpec.js +++ b/test/unit_tests/conversation/ConversationLabelSpec.js @@ -17,7 +17,7 @@ * */ -import {ConversationLabelRepository} from 'src/script/conversation/ConversationLabelRepository'; +import {ConversationLabelRepository} from 'Repositories/conversation/ConversationLabelRepository'; import {Conversation} from 'src/script/entity/Conversation'; import {createUuid} from 'Util/uuid'; diff --git a/test/unit_tests/conversation/ConversationServiceSpec.js b/test/unit_tests/conversation/ConversationServiceSpec.js index 28cd5c7be28..c9efe422e85 100644 --- a/test/unit_tests/conversation/ConversationServiceSpec.js +++ b/test/unit_tests/conversation/ConversationServiceSpec.js @@ -17,7 +17,7 @@ * */ -import {ConversationMapper} from 'src/script/conversation/ConversationMapper'; +import {ConversationMapper} from 'Repositories/conversation/ConversationMapper'; import {StorageSchemata} from 'src/script/storage/StorageSchemata'; import {TestFactory} from '../../helper/TestFactory'; From 5f6b83244d4817a254dc12e247fef073e151fbdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20J=C3=B3=C5=BAwik?= Date: Thu, 31 Oct 2024 09:14:33 +0100 Subject: [PATCH 09/12] feat: Move GiphyRepository to new folder structure (#18245) * feat: Move ConversationRepository to new folder structure * feat: Move GiphyRepository to new folder structure --- src/script/components/Giphy/Giphy.test.tsx | 3 +-- src/script/components/Giphy/Giphy.tsx | 3 +-- .../Modals/LegalHoldModal/LegalHoldModal.test.tsx | 2 +- .../Modals/LegalHoldModal/LegalHoldModal.tsx | 2 +- src/script/components/UserDevices/UserDevices.tsx | 2 +- .../components/DeviceDetails/DeviceDetails.tsx | 2 +- .../components/SelfFingerprint/SelfFingerprint.tsx | 2 +- src/script/event/EventRepository.ts | 2 +- src/script/legal-hold/LegalHoldEvaluator.test.ts | 3 +-- src/script/main/app.ts | 6 +++--- src/script/message/MentionEntity.ts | 3 +-- .../DevicesPreferences/DevicesPreference.test.tsx | 2 +- .../DevicesPreferences/DevicesPreference.tsx | 2 +- src/script/repositories/client/ClientRepository.ts | 2 +- src/script/repositories/conversation/EventMapper.ts | 2 +- .../conversation/MessageRepository.test.ts | 2 +- .../repositories/conversation/MessageRepository.ts | 4 ++-- .../cryptography/CryptographyMapper.test.ts | 2 +- .../cryptography/CryptographyMapper.ts | 10 +++++----- .../cryptography/CryptographyRepository.ts | 2 +- .../cryptography/ProtoMessageType.ts | 0 .../giphy}/GiphyRepository.test.ts | 5 +++-- .../giphy}/GiphyRepository.ts | 2 +- .../{extension => repositories/giphy}/GiphyResult.ts | 0 .../{extension => repositories/giphy}/GiphyService.ts | 2 +- src/script/view_model/MainViewModel.ts | 4 ++-- test/helper/TestFactory.js | 2 +- 27 files changed, 35 insertions(+), 38 deletions(-) rename src/script/{ => repositories}/cryptography/CryptographyMapper.test.ts (99%) rename src/script/{ => repositories}/cryptography/CryptographyMapper.ts (98%) rename src/script/{ => repositories}/cryptography/CryptographyRepository.ts (97%) rename src/script/{ => repositories}/cryptography/ProtoMessageType.ts (100%) rename src/script/{extension => repositories/giphy}/GiphyRepository.test.ts (98%) rename src/script/{extension => repositories/giphy}/GiphyRepository.ts (98%) rename src/script/{extension => repositories/giphy}/GiphyResult.ts (100%) rename src/script/{extension => repositories/giphy}/GiphyService.ts (97%) diff --git a/src/script/components/Giphy/Giphy.test.tsx b/src/script/components/Giphy/Giphy.test.tsx index b246f3b8a56..1e332608e01 100644 --- a/src/script/components/Giphy/Giphy.test.tsx +++ b/src/script/components/Giphy/Giphy.test.tsx @@ -19,10 +19,9 @@ import {fireEvent, render, waitFor} from '@testing-library/react'; +import {GiphyRepository} from 'Repositories/giphy/GiphyRepository'; import {withTheme} from 'src/script/auth/util/test/TestUtil'; -import {GiphyRepository} from '../../extension/GiphyRepository'; - import {Giphy, GiphyState} from '.'; const inputValue = 'Yammy yammy'; diff --git a/src/script/components/Giphy/Giphy.tsx b/src/script/components/Giphy/Giphy.tsx index 3d359b1b24b..a51054cfc33 100644 --- a/src/script/components/Giphy/Giphy.tsx +++ b/src/script/components/Giphy/Giphy.tsx @@ -27,10 +27,9 @@ import {WebAppEvents} from '@wireapp/webapp-events'; import {GifImage} from 'Components/Giphy/GifImage'; import * as Icon from 'Components/Icon'; +import {Gif, GiphyRepository} from 'Repositories/giphy/GiphyRepository'; import {t} from 'Util/LocalizerUtil'; -import {Gif, GiphyRepository} from '../../extension/GiphyRepository'; - const GIPHY_CLOSE_TIMEOUT = 350; export enum GiphyState { diff --git a/src/script/components/Modals/LegalHoldModal/LegalHoldModal.test.tsx b/src/script/components/Modals/LegalHoldModal/LegalHoldModal.test.tsx index 1b685013edf..bd6987d260b 100644 --- a/src/script/components/Modals/LegalHoldModal/LegalHoldModal.test.tsx +++ b/src/script/components/Modals/LegalHoldModal/LegalHoldModal.test.tsx @@ -25,11 +25,11 @@ import {CallingRepository} from 'Repositories/calling/CallingRepository'; import {ClientRepository} from 'Repositories/client'; import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; import {MessageRepository} from 'Repositories/conversation/MessageRepository'; +import {CryptographyRepository} from 'Repositories/cryptography/CryptographyRepository'; import {LegalHoldModal, LegalHoldModalType} from './LegalHoldModal'; import {TestFactory} from '../../../../../test/helper/TestFactory'; -import {CryptographyRepository} from '../../../cryptography/CryptographyRepository'; import {Conversation} from '../../../entity/Conversation'; import {User} from '../../../entity/User'; import {SearchRepository} from '../../../search/SearchRepository'; diff --git a/src/script/components/Modals/LegalHoldModal/LegalHoldModal.tsx b/src/script/components/Modals/LegalHoldModal/LegalHoldModal.tsx index 01de0f2dd7f..2727ca926ad 100644 --- a/src/script/components/Modals/LegalHoldModal/LegalHoldModal.tsx +++ b/src/script/components/Modals/LegalHoldModal/LegalHoldModal.tsx @@ -32,12 +32,12 @@ import {useUserDevicesHistory} from 'Hooks/useUserDevicesHistory'; import {ClientRepository} from 'Repositories/client'; import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; import {MessageRepository} from 'Repositories/conversation/MessageRepository'; +import {CryptographyRepository} from 'Repositories/cryptography/CryptographyRepository'; import {handleEnterDown} from 'Util/KeyboardUtil'; import {t} from 'Util/LocalizerUtil'; import {useLegalHoldModalState} from './LegalHoldModal.state'; -import {CryptographyRepository} from '../../../cryptography/CryptographyRepository'; import {User} from '../../../entity/User'; import {SearchRepository} from '../../../search/SearchRepository'; import {TeamRepository} from '../../../team/TeamRepository'; diff --git a/src/script/components/UserDevices/UserDevices.tsx b/src/script/components/UserDevices/UserDevices.tsx index fbbe0f9b4e8..e60995ee898 100644 --- a/src/script/components/UserDevices/UserDevices.tsx +++ b/src/script/components/UserDevices/UserDevices.tsx @@ -24,6 +24,7 @@ import {ClientClassification} from '@wireapp/api-client/lib/client/'; import {useUserIdentity} from 'Hooks/useDeviceIdentities'; import {ClientRepository, ClientEntity} from 'Repositories/client'; import {MessageRepository} from 'Repositories/conversation/MessageRepository'; +import {CryptographyRepository} from 'Repositories/cryptography/CryptographyRepository'; import {partition} from 'Util/ArrayUtil'; import {t} from 'Util/LocalizerUtil'; import {getLogger} from 'Util/Logger'; @@ -35,7 +36,6 @@ import {NoDevicesFound} from './components/NoDevicesFound'; import {SelfFingerprint} from './components/SelfFingerprint'; import {FIND_MODE, UserDevicesState} from './UserDevices.types'; -import {CryptographyRepository} from '../../cryptography/CryptographyRepository'; import {User} from '../../entity/User'; export interface UserDevicesHistoryEntry { diff --git a/src/script/components/UserDevices/components/DeviceDetails/DeviceDetails.tsx b/src/script/components/UserDevices/components/DeviceDetails/DeviceDetails.tsx index 5756c577944..045412eef03 100644 --- a/src/script/components/UserDevices/components/DeviceDetails/DeviceDetails.tsx +++ b/src/script/components/UserDevices/components/DeviceDetails/DeviceDetails.tsx @@ -29,6 +29,7 @@ import type {ClientRepository, ClientEntity} from 'Repositories/client'; import {isMLSConversation} from 'Repositories/conversation/ConversationSelectors'; import {ConversationState} from 'Repositories/conversation/ConversationState'; import type {MessageRepository} from 'Repositories/conversation/MessageRepository'; +import type {CryptographyRepository} from 'Repositories/cryptography/CryptographyRepository'; import {WireIdentity} from 'src/script/E2EIdentity'; import {MLSDeviceDetails} from 'src/script/page/MainContent/panels/preferences/DevicesPreferences/components/MLSDeviceDetails'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; @@ -37,7 +38,6 @@ import type {Logger} from 'Util/Logger'; import {splitFingerprint} from 'Util/StringUtil'; import {Config} from '../../../../Config'; -import type {CryptographyRepository} from '../../../../cryptography/CryptographyRepository'; import type {User} from '../../../../entity/User'; import {MotionDuration} from '../../../../motion/MotionDuration'; import {FormattedId} from '../../../../page/MainContent/panels/preferences/DevicesPreferences/components/FormattedId'; diff --git a/src/script/components/UserDevices/components/SelfFingerprint/SelfFingerprint.tsx b/src/script/components/UserDevices/components/SelfFingerprint/SelfFingerprint.tsx index ae02252d243..46f81071e82 100644 --- a/src/script/components/UserDevices/components/SelfFingerprint/SelfFingerprint.tsx +++ b/src/script/components/UserDevices/components/SelfFingerprint/SelfFingerprint.tsx @@ -26,10 +26,10 @@ import {container} from 'tsyringe'; import {WebAppEvents} from '@wireapp/webapp-events'; import {ClientState} from 'Repositories/client/ClientState'; +import type {CryptographyRepository} from 'Repositories/cryptography/CryptographyRepository'; import {t} from 'Util/LocalizerUtil'; import {splitFingerprint} from 'Util/StringUtil'; -import type {CryptographyRepository} from '../../../../cryptography/CryptographyRepository'; import {FormattedId} from '../../../../page/MainContent/panels/preferences/DevicesPreferences/components/FormattedId'; import {DeviceCard} from '../DeviceCard'; diff --git a/src/script/event/EventRepository.ts b/src/script/event/EventRepository.ts index 894ae3f023f..93e41eb6da8 100644 --- a/src/script/event/EventRepository.ts +++ b/src/script/event/EventRepository.ts @@ -32,6 +32,7 @@ import {Account, ConnectionState, ProcessedEventPayload} from '@wireapp/core'; import {WebAppEvents} from '@wireapp/webapp-events'; import {ClientConversationEvent, EventBuilder} from 'Repositories/conversation/EventBuilder'; +import {CryptographyMapper} from 'Repositories/cryptography/CryptographyMapper'; import {getLogger, Logger} from 'Util/Logger'; import {queue} from 'Util/PromiseQueue'; import {TIME_IN_MILLIS} from 'Util/TimeUtil'; @@ -47,7 +48,6 @@ import {NOTIFICATION_HANDLING_STATE} from './NotificationHandlingState'; import type {NotificationService} from './NotificationService'; import {EventValidationError} from './preprocessor/EventStorageMiddleware/eventHandlers/EventValidationError'; -import {CryptographyMapper} from '../cryptography/CryptographyMapper'; import {CryptographyError} from '../error/CryptographyError'; import {EventError} from '../error/EventError'; import type {ServerTimeHandler} from '../time/serverTimeHandler'; diff --git a/src/script/legal-hold/LegalHoldEvaluator.test.ts b/src/script/legal-hold/LegalHoldEvaluator.test.ts index 7d334e538e4..8c3f1d6d1e7 100644 --- a/src/script/legal-hold/LegalHoldEvaluator.test.ts +++ b/src/script/legal-hold/LegalHoldEvaluator.test.ts @@ -21,13 +21,12 @@ import {GenericMessageType} from '@wireapp/core/lib/conversation'; import {GenericMessage, LegalHoldStatus, Text} from '@wireapp/protocol-messaging'; +import {CryptographyMapper} from 'Repositories/cryptography/CryptographyMapper'; import {createMessageAddEvent} from 'test/helper/EventGenerator'; import {createUuid} from 'Util/uuid'; import * as LegalHoldEvaluator from './LegalHoldEvaluator'; -import {CryptographyMapper} from '../cryptography/CryptographyMapper'; - describe('LegalHoldEvaluator', () => { describe('hasMessageLegalHoldFlag', () => { let cryptographyMapper: CryptographyMapper; diff --git a/src/script/main/app.ts b/src/script/main/app.ts index 4f4415eafb6..dd4cbd38a10 100644 --- a/src/script/main/app.ts +++ b/src/script/main/app.ts @@ -48,6 +48,9 @@ import {ConversationVerificationState} from 'Repositories/conversation/Conversat import {OnConversationE2EIVerificationStateChange} from 'Repositories/conversation/ConversationVerificationStateHandler/shared'; import {EventBuilder} from 'Repositories/conversation/EventBuilder'; import {MessageRepository} from 'Repositories/conversation/MessageRepository'; +import {CryptographyRepository} from 'Repositories/cryptography/CryptographyRepository'; +import {GiphyRepository} from 'Repositories/giphy/GiphyRepository'; +import {GiphyService} from 'Repositories/giphy/GiphyService'; import {initializeDataDog} from 'Util/DataDog'; import {DebugUtil} from 'Util/DebugUtil'; import {Environment} from 'Util/Environment'; @@ -62,7 +65,6 @@ import '../../style/default.less'; import {SIGN_OUT_REASON} from '../auth/SignOutReason'; import {URLParameter} from '../auth/URLParameter'; import {Configuration} from '../Config'; -import {CryptographyRepository} from '../cryptography/CryptographyRepository'; import {getModalOptions, ModalType} from '../E2EIdentity/Modals'; import {User} from '../entity/User'; import {AccessTokenError} from '../error/AccessTokenError'; @@ -79,8 +81,6 @@ import {ReceiptsMiddleware} from '../event/preprocessor/ReceiptsMiddleware'; import {RepliesUpdaterMiddleware} from '../event/preprocessor/RepliesUpdaterMiddleware'; import {ServiceMiddleware} from '../event/preprocessor/ServiceMiddleware'; import {FederationEventProcessor} from '../event/processor/FederationEventProcessor'; -import {GiphyRepository} from '../extension/GiphyRepository'; -import {GiphyService} from '../extension/GiphyService'; import {externalUrl} from '../externalRoute'; import {IntegrationRepository} from '../integration/IntegrationRepository'; import {IntegrationService} from '../integration/IntegrationService'; diff --git a/src/script/message/MentionEntity.ts b/src/script/message/MentionEntity.ts index 3de45a4145b..28fc51f3864 100644 --- a/src/script/message/MentionEntity.ts +++ b/src/script/message/MentionEntity.ts @@ -21,11 +21,10 @@ import {QualifiedId} from '@wireapp/api-client/lib/user'; import {IMention, Mention} from '@wireapp/protocol-messaging'; +import {PROTO_MESSAGE_TYPE} from 'Repositories/cryptography/ProtoMessageType'; import {matchQualifiedIds} from 'Util/QualifiedId'; import {isUUID} from 'Util/ValidationUtil'; -import {PROTO_MESSAGE_TYPE} from '../cryptography/ProtoMessageType'; - export enum ERROR { INVALID_LENGTH = 'Invalid mention: Invalid length', INVALID_START_CHAR = 'Invalid mention: Mention does not start with @', diff --git a/src/script/page/MainContent/panels/preferences/DevicesPreferences/DevicesPreference.test.tsx b/src/script/page/MainContent/panels/preferences/DevicesPreferences/DevicesPreference.test.tsx index a3b1ed3d57f..946f8d44cf2 100644 --- a/src/script/page/MainContent/panels/preferences/DevicesPreferences/DevicesPreference.test.tsx +++ b/src/script/page/MainContent/panels/preferences/DevicesPreferences/DevicesPreference.test.tsx @@ -25,8 +25,8 @@ import {randomUUID} from 'crypto'; import {ClientEntity} from 'Repositories/client/ClientEntity'; import {ClientState} from 'Repositories/client/ClientState'; import {ConversationState} from 'Repositories/conversation/ConversationState'; +import {CryptographyRepository} from 'Repositories/cryptography/CryptographyRepository'; import {withTheme} from 'src/script/auth/util/test/TestUtil'; -import {CryptographyRepository} from 'src/script/cryptography/CryptographyRepository'; import {User} from 'src/script/entity/User'; import {createUuid} from 'Util/uuid'; diff --git a/src/script/page/MainContent/panels/preferences/DevicesPreferences/DevicesPreference.tsx b/src/script/page/MainContent/panels/preferences/DevicesPreferences/DevicesPreference.tsx index b4fd716a34c..667ff200a08 100644 --- a/src/script/page/MainContent/panels/preferences/DevicesPreferences/DevicesPreference.tsx +++ b/src/script/page/MainContent/panels/preferences/DevicesPreferences/DevicesPreference.tsx @@ -25,7 +25,7 @@ import {container} from 'tsyringe'; import {ClientEntity} from 'Repositories/client/ClientEntity'; import {ClientState} from 'Repositories/client/ClientState'; import {ConversationState} from 'Repositories/conversation/ConversationState'; -import {CryptographyRepository} from 'src/script/cryptography/CryptographyRepository'; +import {CryptographyRepository} from 'Repositories/cryptography/CryptographyRepository'; import {Conversation} from 'src/script/entity/Conversation'; import {User} from 'src/script/entity/User'; import {useUserIdentity} from 'src/script/hooks/useDeviceIdentities'; diff --git a/src/script/repositories/client/ClientRepository.ts b/src/script/repositories/client/ClientRepository.ts index 7423a2da569..afcd49ef6f9 100644 --- a/src/script/repositories/client/ClientRepository.ts +++ b/src/script/repositories/client/ClientRepository.ts @@ -30,6 +30,7 @@ import {Runtime} from '@wireapp/commons'; import {WebAppEvents} from '@wireapp/webapp-events'; import {PrimaryModal} from 'Components/Modals/PrimaryModal'; +import type {CryptographyRepository} from 'Repositories/cryptography/CryptographyRepository'; import {t} from 'Util/LocalizerUtil'; import {getLogger, Logger} from 'Util/Logger'; import {matchQualifiedIds} from 'Util/QualifiedId'; @@ -43,7 +44,6 @@ import {ClientState} from './ClientState'; import {isClientMLSCapable, wasClientActiveWithinLast4Weeks} from './ClientUtils'; import {SIGN_OUT_REASON} from '../../auth/SignOutReason'; -import type {CryptographyRepository} from '../../cryptography/CryptographyRepository'; import type {User} from '../../entity/User'; import {ClientError} from '../../error/ClientError'; import {Core} from '../../service/CoreSingleton'; diff --git a/src/script/repositories/conversation/EventMapper.ts b/src/script/repositories/conversation/EventMapper.ts index 9399b63b096..f3a2bf76bc8 100644 --- a/src/script/repositories/conversation/EventMapper.ts +++ b/src/script/repositories/conversation/EventMapper.ts @@ -25,6 +25,7 @@ import {LinkPreview, Mention} from '@wireapp/protocol-messaging'; import {AssetRemoteData} from 'Repositories/assets/AssetRemoteData'; import {AssetTransferState} from 'Repositories/assets/AssetTransferState'; import {TERMINATION_REASON} from 'Repositories/calling/enum/TerminationReason'; +import {AssetData} from 'Repositories/cryptography/CryptographyMapper'; import {t} from 'Util/LocalizerUtil'; import {getLogger, Logger} from 'Util/Logger'; import {userReactionMapToReactionMap} from 'Util/ReactionUtil'; @@ -43,7 +44,6 @@ import { CompositeMessageAddEvent, } from './EventBuilder'; -import {AssetData} from '../../cryptography/CryptographyMapper'; import type {Conversation} from '../../entity/Conversation'; import {Button} from '../../entity/message/Button'; import {CallingTimeoutMessage} from '../../entity/message/CallingTimeoutMessage'; diff --git a/src/script/repositories/conversation/MessageRepository.test.ts b/src/script/repositories/conversation/MessageRepository.test.ts index f6aeac91c2b..3e9e923859b 100644 --- a/src/script/repositories/conversation/MessageRepository.test.ts +++ b/src/script/repositories/conversation/MessageRepository.test.ts @@ -30,6 +30,7 @@ import {AudioRepository} from 'Repositories/audio/AudioRepository'; import {ClientEntity} from 'Repositories/client/ClientEntity'; import {ClientState} from 'Repositories/client/ClientState'; import {ConnectionEntity} from 'Repositories/connection/ConnectionEntity'; +import {CryptographyRepository} from 'Repositories/cryptography/CryptographyRepository'; import {Conversation} from 'src/script/entity/Conversation'; import {Message} from 'src/script/entity/message/Message'; import {Text} from 'src/script/entity/message/Text'; @@ -42,7 +43,6 @@ import {ConversationRepository} from './ConversationRepository'; import {ConversationState} from './ConversationState'; import {MessageRepository} from './MessageRepository'; -import {CryptographyRepository} from '../../cryptography/CryptographyRepository'; import {ContentMessage} from '../../entity/message/ContentMessage'; import {EventRepository} from '../../event/EventRepository'; import {EventService} from '../../event/EventService'; diff --git a/src/script/repositories/conversation/MessageRepository.ts b/src/script/repositories/conversation/MessageRepository.ts index d5bef5a04e5..fc8d5797671 100644 --- a/src/script/repositories/conversation/MessageRepository.ts +++ b/src/script/repositories/conversation/MessageRepository.ts @@ -57,6 +57,8 @@ import {AssetTransferState} from 'Repositories/assets/AssetTransferState'; import {AudioRepository} from 'Repositories/audio/AudioRepository'; import {AudioType} from 'Repositories/audio/AudioType'; import {ClientState} from 'Repositories/client/ClientState'; +import {CryptographyRepository} from 'Repositories/cryptography/CryptographyRepository'; +import {PROTO_MESSAGE_TYPE} from 'Repositories/cryptography/ProtoMessageType'; import { cancelSendingLinkPreview, clearLinkPreviewSendingState, @@ -82,8 +84,6 @@ import {EventBuilder} from './EventBuilder'; import {EventMapper} from './EventMapper'; import {getLinkPreviewFromString} from './linkPreviews'; -import {CryptographyRepository} from '../../cryptography/CryptographyRepository'; -import {PROTO_MESSAGE_TYPE} from '../../cryptography/ProtoMessageType'; import {Conversation} from '../../entity/Conversation'; import {CompositeMessage} from '../../entity/message/CompositeMessage'; import {ContentMessage} from '../../entity/message/ContentMessage'; diff --git a/src/script/cryptography/CryptographyMapper.test.ts b/src/script/repositories/cryptography/CryptographyMapper.test.ts similarity index 99% rename from src/script/cryptography/CryptographyMapper.test.ts rename to src/script/repositories/cryptography/CryptographyMapper.test.ts index c9f3b118a6c..8061323ce23 100644 --- a/src/script/cryptography/CryptographyMapper.test.ts +++ b/src/script/repositories/cryptography/CryptographyMapper.test.ts @@ -38,13 +38,13 @@ import { Text, } from '@wireapp/protocol-messaging'; -import {PROTO_MESSAGE_TYPE} from 'src/script/cryptography/ProtoMessageType'; import {CryptographyError} from 'src/script/error/CryptographyError'; import {ClientEvent} from 'src/script/event/Client'; import {arrayToBase64} from 'Util/util'; import {createUuid} from 'Util/uuid'; import {CryptographyMapper} from './CryptographyMapper'; +import {PROTO_MESSAGE_TYPE} from './ProtoMessageType'; describe('CryptographyMapper', () => { const coreMock = { diff --git a/src/script/cryptography/CryptographyMapper.ts b/src/script/repositories/cryptography/CryptographyMapper.ts similarity index 98% rename from src/script/cryptography/CryptographyMapper.ts rename to src/script/repositories/cryptography/CryptographyMapper.ts index ac6523f075b..8331a18c079 100644 --- a/src/script/cryptography/CryptographyMapper.ts +++ b/src/script/repositories/cryptography/CryptographyMapper.ts @@ -56,15 +56,15 @@ import {AssetTransferState} from 'Repositories/assets/AssetTransferState'; import {CALL_MESSAGE_TYPE} from 'Repositories/calling/enum/CallMessageType'; import {ConversationEphemeralHandler} from 'Repositories/conversation/ConversationEphemeralHandler'; import {MessageAddEvent} from 'Repositories/conversation/EventBuilder'; +import {PROTO_MESSAGE_TYPE} from 'Repositories/cryptography/ProtoMessageType'; import {getLogger, Logger} from 'Util/Logger'; import {TIME_IN_MILLIS} from 'Util/TimeUtil'; import {base64ToArray, arrayToBase64} from 'Util/util'; -import {PROTO_MESSAGE_TYPE} from '../cryptography/ProtoMessageType'; -import {CryptographyError} from '../error/CryptographyError'; -import {ClientEvent, CONVERSATION} from '../event/Client'; -import {StatusType} from '../message/StatusType'; -import {Core} from '../service/CoreSingleton'; +import {CryptographyError} from '../../error/CryptographyError'; +import {ClientEvent, CONVERSATION} from '../../event/Client'; +import {StatusType} from '../../message/StatusType'; +import {Core} from '../../service/CoreSingleton'; export interface MappedText { data: {content: string; mentions: string[]; previews: string[]; quote?: string; replacing_message_id?: string}; diff --git a/src/script/cryptography/CryptographyRepository.ts b/src/script/repositories/cryptography/CryptographyRepository.ts similarity index 97% rename from src/script/cryptography/CryptographyRepository.ts rename to src/script/repositories/cryptography/CryptographyRepository.ts index 3d9b7bc5af8..27d9855f908 100644 --- a/src/script/cryptography/CryptographyRepository.ts +++ b/src/script/repositories/cryptography/CryptographyRepository.ts @@ -25,7 +25,7 @@ import {getLogger, Logger} from 'Util/Logger'; import {CryptographyMapper} from './CryptographyMapper'; -import {Core} from '../service/CoreSingleton'; +import {Core} from '../../service/CoreSingleton'; export interface SignalingKeys { enckey: string; diff --git a/src/script/cryptography/ProtoMessageType.ts b/src/script/repositories/cryptography/ProtoMessageType.ts similarity index 100% rename from src/script/cryptography/ProtoMessageType.ts rename to src/script/repositories/cryptography/ProtoMessageType.ts diff --git a/src/script/extension/GiphyRepository.test.ts b/src/script/repositories/giphy/GiphyRepository.test.ts similarity index 98% rename from src/script/extension/GiphyRepository.test.ts rename to src/script/repositories/giphy/GiphyRepository.test.ts index d8ba95a9169..fc464ad35a4 100644 --- a/src/script/extension/GiphyRepository.test.ts +++ b/src/script/repositories/giphy/GiphyRepository.test.ts @@ -20,10 +20,11 @@ import {GiphyResult} from '@wireapp/api-client/lib/giphy/GiphyResult'; import {container} from 'tsyringe'; -import {GiphyRepository} from 'src/script/extension/GiphyRepository'; -import {GiphyService} from 'src/script/extension/GiphyService'; import {APIClient} from 'src/script/service/APIClientSingleton'; +import {GiphyRepository} from './GiphyRepository'; +import {GiphyService} from './GiphyService'; + const randomFooGiphyResponse = { data: { fixed_height_downsampled_height: '200', diff --git a/src/script/extension/GiphyRepository.ts b/src/script/repositories/giphy/GiphyRepository.ts similarity index 98% rename from src/script/extension/GiphyRepository.ts rename to src/script/repositories/giphy/GiphyRepository.ts index 9347125d26a..26d1d759ee2 100644 --- a/src/script/extension/GiphyRepository.ts +++ b/src/script/repositories/giphy/GiphyRepository.ts @@ -19,7 +19,7 @@ import type {GiphyService} from './GiphyService'; -import {Logger, getLogger} from '../util/Logger'; +import {Logger, getLogger} from '../../util/Logger'; export interface Gif { animated: string; diff --git a/src/script/extension/GiphyResult.ts b/src/script/repositories/giphy/GiphyResult.ts similarity index 100% rename from src/script/extension/GiphyResult.ts rename to src/script/repositories/giphy/GiphyResult.ts diff --git a/src/script/extension/GiphyService.ts b/src/script/repositories/giphy/GiphyService.ts similarity index 97% rename from src/script/extension/GiphyService.ts rename to src/script/repositories/giphy/GiphyService.ts index e5031f2f744..95fc3c5202a 100644 --- a/src/script/extension/GiphyService.ts +++ b/src/script/repositories/giphy/GiphyService.ts @@ -25,7 +25,7 @@ import type { } from '@wireapp/api-client/lib/giphy'; import {container} from 'tsyringe'; -import {APIClient} from '../service/APIClientSingleton'; +import {APIClient} from '../../service/APIClientSingleton'; export class GiphyService { constructor(private readonly apiClient = container.resolve(APIClient)) {} diff --git a/src/script/view_model/MainViewModel.ts b/src/script/view_model/MainViewModel.ts index bbbe87bddad..3f697ad3160 100644 --- a/src/script/view_model/MainViewModel.ts +++ b/src/script/view_model/MainViewModel.ts @@ -27,15 +27,15 @@ import type {ClientRepository} from 'Repositories/client'; import type {ConnectionRepository} from 'Repositories/connection/ConnectionRepository'; import type {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; import type {MessageRepository} from 'Repositories/conversation/MessageRepository'; +import type {CryptographyRepository} from 'Repositories/cryptography/CryptographyRepository'; +import type {GiphyRepository} from 'Repositories/giphy/GiphyRepository'; import {ActionsViewModel} from './ActionsViewModel'; import {CallingViewModel} from './CallingViewModel'; import {ContentViewModel} from './ContentViewModel'; import {ListViewModel} from './ListViewModel'; -import type {CryptographyRepository} from '../cryptography/CryptographyRepository'; import type {EventRepository} from '../event/EventRepository'; -import type {GiphyRepository} from '../extension/GiphyRepository'; import type {IntegrationRepository} from '../integration/IntegrationRepository'; import type {MediaRepository} from '../media/MediaRepository'; import type {NotificationRepository} from '../notification/NotificationRepository'; diff --git a/test/helper/TestFactory.js b/test/helper/TestFactory.js index 61c74d9ca27..8fb9e30fc23 100644 --- a/test/helper/TestFactory.js +++ b/test/helper/TestFactory.js @@ -41,7 +41,7 @@ import {ConversationRepository} from 'Repositories/conversation/ConversationRepo import {ConversationService} from 'Repositories/conversation/ConversationService'; import {ConversationState} from 'Repositories/conversation/ConversationState'; import {MessageRepository} from 'Repositories/conversation/MessageRepository'; -import {CryptographyRepository} from 'src/script/cryptography/CryptographyRepository'; +import {CryptographyRepository} from 'Repositories/cryptography/CryptographyRepository'; import {User} from 'src/script/entity/User'; import {EventRepository} from 'src/script/event/EventRepository'; import {EventService} from 'src/script/event/EventService'; From 1c36af941f1416081d4de4149a49f933e158c3ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20J=C3=B3=C5=BAwik?= Date: Thu, 31 Oct 2024 09:18:36 +0100 Subject: [PATCH 10/12] feat: Move EventRepository to new folder structure (#18246) * feat: Move ConversationRepository to new folder structure * feat: Move GiphyRepository to new folder structure * feat: Move EventRepository to new folder structure * feat: Move IntegrationRepository to new folder structure (#18247) * feat: Move IntegrationRepository to new folder structure * feat: Move MediaRepository to new folder structure (#18248) --- src/script/auth/configureEnvironment.ts | 2 +- src/script/components/Avatar/Avatar.test.tsx | 3 +- src/script/components/Avatar/Avatar.tsx | 2 +- .../components/Avatar/ServiceAvatar.test.tsx | 3 +- .../components/Avatar/ServiceAvatar.tsx | 3 +- .../components/Conversation/Conversation.tsx | 2 +- .../ConversationListCell.tsx | 2 +- .../components/InputBar/InputBar.test.tsx | 2 +- src/script/components/InputBar/InputBar.tsx | 2 +- .../Message/ContentMessage/MessageHeader.tsx | 2 +- .../MessagesList/Message/DeleteMessage.tsx | 2 +- .../Message/MemberMessage/MessageContent.tsx | 2 +- .../components/MessagesList/Message/index.tsx | 2 +- .../components/MessagesList/MessageList.tsx | 2 +- .../MessagesList/utils/messagesFilter.ts | 2 +- .../Modals/ServiceModal/ServiceModal.tsx | 4 +-- .../ParticipantItemContent.tsx | 2 +- .../ServiceList/ServiceList.test.tsx | 3 +- .../components/ServiceList/ServiceList.tsx | 3 +- .../ServiceListItem/ServiceListItem.tsx | 3 +- .../calling/CallingCell/CallingCell.test.tsx | 2 +- .../calling/CallingOverlayContainer.tsx | 2 +- .../components/calling/ChooseScreen.tsx | 2 +- .../DetachedCallingCell.tsx | 2 +- .../calling/FullscreenVideoCall.tsx | 4 +-- .../calling/fullscreenVideoCall.test.tsx | 2 +- .../components/panel/ServiceDetails.test.tsx | 4 +-- .../components/panel/ServiceDetails.tsx | 3 +- src/script/entity/message/MemberMessage.ts | 2 +- src/script/entity/message/Text.ts | 2 +- src/script/guards/MediaDevice.ts | 2 +- src/script/guards/Panel.ts | 3 +- src/script/guards/Service.ts | 2 +- src/script/hooks/useInitializeMediaDevices.ts | 5 ++- src/script/legal-hold/LegalHoldEvaluator.ts | 3 +- src/script/main/app.ts | 31 +++++++++---------- src/script/message/MessageCategorization.ts | 3 +- src/script/message/MessageHasher.ts | 2 +- .../NotificationRepository.test.ts | 2 +- .../panels/Conversations/Conversations.tsx | 2 +- .../panels/StartUI/ServicesTab.tsx | 6 ++-- .../LeftSidebar/panels/StartUI/StartUI.tsx | 4 +-- .../panels/preferences/AVPreferences.tsx | 4 +-- .../avPreferences/AudioOutPreferences.tsx | 4 +-- .../preferences/avPreferences/CallOptions.tsx | 2 +- .../avPreferences/CameraPreferences.tsx | 8 ++--- .../avPreferences/MicrophonePreferences.tsx | 8 ++--- .../AddParticipants/AddParticipants.tsx | 4 +-- .../ConversationDetails.test.tsx | 2 +- .../ConversationDetails.tsx | 4 +-- .../ConversationDetailsHeader.test.tsx | 2 +- .../ConversationDetailsHeader.tsx | 2 +- .../ConversationDetailsParticipants.tsx | 2 +- .../components/GroupDetails/GroupDetails.tsx | 2 +- .../GroupParticipantService.tsx | 4 +-- .../GroupParticipantUser.tsx | 2 +- src/script/page/RightSidebar/RightSidebar.tsx | 2 +- .../page/components/WindowTitleUpdater.ts | 2 +- src/script/repositories/assets/AssetMapper.ts | 4 +-- .../audio/AudioRepository.test.ts | 4 +-- .../repositories/audio/AudioRepository.ts | 7 ++--- .../backup/BackupRepository.test.ts | 2 +- .../repositories/backup/BackupService.ts | 2 +- .../backup/recordPreprocessors.ts | 3 +- src/script/repositories/calling/Call.ts | 2 +- src/script/repositories/calling/CallState.ts | 2 +- .../calling/CallingRepository.test.ts | 10 +++--- .../repositories/calling/CallingRepository.ts | 12 +++---- .../repositories/calling/Participant.ts | 2 +- .../connection/ConnectionRepository.ts | 4 +-- .../ConversationEphemeralHandler.ts | 2 +- .../ConversationRepository.test.ts | 8 ++--- .../conversation/ConversationRepository.ts | 10 +++--- .../conversation/ConversationService.ts | 3 +- .../conversation/EventBuilder.test.ts | 2 +- .../repositories/conversation/EventBuilder.ts | 2 +- .../repositories/conversation/EventMapper.ts | 2 +- .../conversation/MessageRepository.test.ts | 4 +-- .../conversation/MessageRepository.ts | 8 ++--- .../cryptography/CryptographyMapper.test.ts | 2 +- .../cryptography/CryptographyMapper.ts | 2 +- .../{ => repositories}/event/CallingEvent.ts | 0 src/script/{ => repositories}/event/Client.ts | 0 .../event/EventProcessor.ts | 0 .../event/EventRepository.test.ts | 8 ++--- .../event/EventRepository.ts | 12 +++---- .../{ => repositories}/event/EventService.ts | 14 ++++----- .../{ => repositories}/event/EventSource.ts | 0 .../{ => repositories}/event/EventType.ts | 0 .../event/EventTypeHandling.ts | 0 .../event/EventValidation.ts | 0 .../event/EventValidator.test.ts | 0 .../event/EventValidator.ts | 0 .../event/NotificationHandlingState.ts | 0 .../event/NotificationService.ts | 4 +-- .../EventStorageMiddleware.test.ts | 0 .../EventStorageMiddleware.ts | 4 +-- .../eventHandlers/EventValidationError.ts | 0 .../eventHandlers/assetEventHandler.ts | 0 .../eventHandlers/editedEventHandler.ts | 0 .../getCommonMessageUpdates.test.ts | 0 .../eventHandlers/getCommonMessageUpdates.ts | 0 .../eventHandlers/index.ts | 0 .../eventHandlers/linkPreviewEventHandler.ts | 0 .../reactionEventHandler.test.ts | 0 .../eventHandlers/reactionEventHandler.ts | 0 .../EventStorageMiddleware/index.ts | 0 .../EventStorageMiddleware/types.ts | 0 .../QuoteDecoderMiddleware.test.ts | 0 .../preprocessor/QuoteDecoderMiddleware.ts | 4 +-- .../preprocessor/ReceiptsMiddleware.test.ts | 3 +- .../event/preprocessor/ReceiptsMiddleware.ts | 4 +-- .../RepliesUpdaterMiddleware.test.ts | 2 +- .../preprocessor/RepliesUpdaterMiddleware.ts | 4 +-- .../preprocessor/ServiceMiddleware.test.ts | 0 .../event/preprocessor/ServiceMiddleware.ts | 2 +- .../ConversationFederationUtils.test.ts | 2 +- .../ConversationFederationUtils.ts | 4 +-- .../FederationEventProcessor.ts | 0 .../FederationEventProcessor/index.ts | 0 .../integration/IntegrationMapper.ts | 0 .../integration/IntegrationRepository.ts | 8 ++--- .../integration/IntegrationService.ts | 2 +- .../integration/ProviderEntity.ts | 0 .../integration/ServiceEntity.ts | 0 .../integration/ServiceTag.ts | 0 .../BackgroundBlurrer/BackgroundBlurrer.ts | 0 .../BackgroundBlurrer/fragmentShader.glsl | 0 .../media/BackgroundBlurrer/index.ts | 0 .../media/BackgroundBlurrer/vertexShader.glsl | 0 .../media/MediaConstraintsHandler.test.ts | 4 +-- .../media/MediaConstraintsHandler.ts | 2 +- .../media/MediaDeviceType.ts | 0 .../media/MediaDevicesHandler.test.ts | 0 .../media/MediaDevicesHandler.ts | 2 +- .../media/MediaEmbeds.test.ts | 5 +-- .../{ => repositories}/media/MediaEmbeds.ts | 0 .../{ => repositories}/media/MediaParser.ts | 2 +- .../media/MediaRepository.ts | 2 +- .../media/MediaStreamError.ts | 0 .../media/MediaStreamErrorTypes.test.ts | 0 .../media/MediaStreamErrorTypes.ts | 0 .../media/MediaStreamHandler.test.ts | 6 ++-- .../media/MediaStreamHandler.ts | 14 ++++----- .../{ => repositories}/media/MediaType.ts | 0 .../media/VideoBackgroundBlur.ts | 0 .../media/VideoQualityMode.ts | 0 src/script/self/SelfRepository.ts | 2 +- src/script/team/TeamRepository.ts | 8 ++--- .../tracking/EventTrackingRepository.ts | 2 +- src/script/user/UserRepository.test.ts | 2 +- src/script/user/UserRepository.ts | 6 ++-- src/script/util/DebugUtil.ts | 2 +- src/script/view_model/ActionsViewModel.ts | 4 +-- .../view_model/CallingViewModel.mocks.ts | 2 +- src/script/view_model/CallingViewModel.ts | 4 +-- src/script/view_model/MainViewModel.ts | 6 ++-- test/helper/EventGenerator.ts | 2 +- test/helper/TestFactory.js | 8 ++--- .../ConversationEphemeralHandlerSpec.js | 2 +- test/unit_tests/message/MessageHasherSpec.js | 2 +- 161 files changed, 228 insertions(+), 229 deletions(-) rename src/script/{ => repositories}/event/CallingEvent.ts (100%) rename src/script/{ => repositories}/event/Client.ts (100%) rename src/script/{ => repositories}/event/EventProcessor.ts (100%) rename src/script/{ => repositories}/event/EventRepository.test.ts (95%) rename src/script/{ => repositories}/event/EventRepository.ts (98%) rename src/script/{ => repositories}/event/EventService.ts (97%) rename src/script/{ => repositories}/event/EventSource.ts (100%) rename src/script/{ => repositories}/event/EventType.ts (100%) rename src/script/{ => repositories}/event/EventTypeHandling.ts (100%) rename src/script/{ => repositories}/event/EventValidation.ts (100%) rename src/script/{ => repositories}/event/EventValidator.test.ts (100%) rename src/script/{ => repositories}/event/EventValidator.ts (100%) rename src/script/{ => repositories}/event/NotificationHandlingState.ts (100%) rename src/script/{ => repositories}/event/NotificationService.ts (96%) rename src/script/{ => repositories}/event/preprocessor/EventStorageMiddleware/EventStorageMiddleware.test.ts (100%) rename src/script/{ => repositories}/event/preprocessor/EventStorageMiddleware/EventStorageMiddleware.ts (98%) rename src/script/{ => repositories}/event/preprocessor/EventStorageMiddleware/eventHandlers/EventValidationError.ts (100%) rename src/script/{ => repositories}/event/preprocessor/EventStorageMiddleware/eventHandlers/assetEventHandler.ts (100%) rename src/script/{ => repositories}/event/preprocessor/EventStorageMiddleware/eventHandlers/editedEventHandler.ts (100%) rename src/script/{ => repositories}/event/preprocessor/EventStorageMiddleware/eventHandlers/getCommonMessageUpdates.test.ts (100%) rename src/script/{ => repositories}/event/preprocessor/EventStorageMiddleware/eventHandlers/getCommonMessageUpdates.ts (100%) rename src/script/{ => repositories}/event/preprocessor/EventStorageMiddleware/eventHandlers/index.ts (100%) rename src/script/{ => repositories}/event/preprocessor/EventStorageMiddleware/eventHandlers/linkPreviewEventHandler.ts (100%) rename src/script/{ => repositories}/event/preprocessor/EventStorageMiddleware/eventHandlers/reactionEventHandler.test.ts (100%) rename src/script/{ => repositories}/event/preprocessor/EventStorageMiddleware/eventHandlers/reactionEventHandler.ts (100%) rename src/script/{ => repositories}/event/preprocessor/EventStorageMiddleware/index.ts (100%) rename src/script/{ => repositories}/event/preprocessor/EventStorageMiddleware/types.ts (100%) rename src/script/{ => repositories}/event/preprocessor/QuoteDecoderMiddleware.test.ts (100%) rename src/script/{ => repositories}/event/preprocessor/QuoteDecoderMiddleware.ts (96%) rename src/script/{ => repositories}/event/preprocessor/ReceiptsMiddleware.test.ts (98%) rename src/script/{ => repositories}/event/preprocessor/ReceiptsMiddleware.ts (97%) rename src/script/{ => repositories}/event/preprocessor/RepliesUpdaterMiddleware.test.ts (98%) rename src/script/{ => repositories}/event/preprocessor/RepliesUpdaterMiddleware.ts (96%) rename src/script/{ => repositories}/event/preprocessor/ServiceMiddleware.test.ts (100%) rename src/script/{ => repositories}/event/preprocessor/ServiceMiddleware.ts (98%) rename src/script/{ => repositories}/event/processor/FederationEventProcessor/ConversationFederationUtils.test.ts (99%) rename src/script/{ => repositories}/event/processor/FederationEventProcessor/ConversationFederationUtils.ts (97%) rename src/script/{ => repositories}/event/processor/FederationEventProcessor/FederationEventProcessor.ts (100%) rename src/script/{ => repositories}/event/processor/FederationEventProcessor/index.ts (100%) rename src/script/{ => repositories}/integration/IntegrationMapper.ts (100%) rename src/script/{ => repositories}/integration/IntegrationRepository.ts (97%) rename src/script/{ => repositories}/integration/IntegrationService.ts (95%) rename src/script/{ => repositories}/integration/ProviderEntity.ts (100%) rename src/script/{ => repositories}/integration/ServiceEntity.ts (100%) rename src/script/{ => repositories}/integration/ServiceTag.ts (100%) rename src/script/{ => repositories}/media/BackgroundBlurrer/BackgroundBlurrer.ts (100%) rename src/script/{ => repositories}/media/BackgroundBlurrer/fragmentShader.glsl (100%) rename src/script/{ => repositories}/media/BackgroundBlurrer/index.ts (100%) rename src/script/{ => repositories}/media/BackgroundBlurrer/vertexShader.glsl (100%) rename src/script/{ => repositories}/media/MediaConstraintsHandler.test.ts (98%) rename src/script/{ => repositories}/media/MediaConstraintsHandler.ts (99%) rename src/script/{ => repositories}/media/MediaDeviceType.ts (100%) rename src/script/{ => repositories}/media/MediaDevicesHandler.test.ts (100%) rename src/script/{ => repositories}/media/MediaDevicesHandler.ts (99%) rename src/script/{ => repositories}/media/MediaEmbeds.test.ts (99%) rename src/script/{ => repositories}/media/MediaEmbeds.ts (100%) rename src/script/{ => repositories}/media/MediaParser.ts (98%) rename src/script/{ => repositories}/media/MediaRepository.ts (94%) rename src/script/{ => repositories}/media/MediaStreamError.ts (100%) rename src/script/{ => repositories}/media/MediaStreamErrorTypes.test.ts (100%) rename src/script/{ => repositories}/media/MediaStreamErrorTypes.ts (100%) rename src/script/{ => repositories}/media/MediaStreamHandler.test.ts (93%) rename src/script/{ => repositories}/media/MediaStreamHandler.ts (95%) rename src/script/{ => repositories}/media/MediaType.ts (100%) rename src/script/{ => repositories}/media/VideoBackgroundBlur.ts (100%) rename src/script/{ => repositories}/media/VideoQualityMode.ts (100%) diff --git a/src/script/auth/configureEnvironment.ts b/src/script/auth/configureEnvironment.ts index 8f1bf10c0de..2fd67617b0b 100644 --- a/src/script/auth/configureEnvironment.ts +++ b/src/script/auth/configureEnvironment.ts @@ -17,8 +17,8 @@ * */ -import '../event/Client'; import '../message/MessageCategorization'; import '../message/MessageCategory'; +import '../repositories/event/Client'; import '../service/BackendEnvironment'; import '../storage/StorageSchemata'; diff --git a/src/script/components/Avatar/Avatar.test.tsx b/src/script/components/Avatar/Avatar.test.tsx index 99a09a6c020..172cdba1afb 100644 --- a/src/script/components/Avatar/Avatar.test.tsx +++ b/src/script/components/Avatar/Avatar.test.tsx @@ -19,10 +19,11 @@ import {fireEvent, render} from '@testing-library/react'; +import {ServiceEntity} from 'Repositories/integration/ServiceEntity'; + import {Avatar} from './Avatar'; import {User} from '../../entity/User'; -import {ServiceEntity} from '../../integration/ServiceEntity'; describe('Avatar', () => { it('executes onClick with current participant', () => { diff --git a/src/script/components/Avatar/Avatar.tsx b/src/script/components/Avatar/Avatar.tsx index 62e12adb589..92af52b24ef 100644 --- a/src/script/components/Avatar/Avatar.tsx +++ b/src/script/components/Avatar/Avatar.tsx @@ -19,6 +19,7 @@ import {HTMLProps, MouseEvent as ReactMouseEvent, KeyboardEvent as ReactKeyBoardEvent} from 'react'; +import {ServiceEntity} from 'Repositories/integration/ServiceEntity'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {handleKeyDown, isKeyboardEvent} from 'Util/KeyboardUtil'; @@ -29,7 +30,6 @@ import {UserAvatar} from './UserAvatar'; import {User} from '../../entity/User'; import {isServiceEntity} from '../../guards/Service'; -import {ServiceEntity} from '../../integration/ServiceEntity'; export enum AVATAR_SIZE { LARGE = 'avatar-l', diff --git a/src/script/components/Avatar/ServiceAvatar.test.tsx b/src/script/components/Avatar/ServiceAvatar.test.tsx index 2e7a40078d2..2ebef1282aa 100644 --- a/src/script/components/Avatar/ServiceAvatar.test.tsx +++ b/src/script/components/Avatar/ServiceAvatar.test.tsx @@ -20,11 +20,10 @@ import {render} from '@testing-library/react'; import {AVATAR_SIZE} from 'Components/Avatar'; +import {ServiceEntity} from 'Repositories/integration/ServiceEntity'; import {ServiceAvatar} from './ServiceAvatar'; -import {ServiceEntity} from '../../integration/ServiceEntity'; - describe('ServiceAvatar', () => { it('shows a service icon', async () => { const service = new ServiceEntity({id: 'id'}); diff --git a/src/script/components/Avatar/ServiceAvatar.tsx b/src/script/components/Avatar/ServiceAvatar.tsx index 613e2e09dd5..e3a4a69a5e2 100644 --- a/src/script/components/Avatar/ServiceAvatar.tsx +++ b/src/script/components/Avatar/ServiceAvatar.tsx @@ -22,6 +22,7 @@ import React from 'react'; import ko from 'knockout'; import * as Icon from 'Components/Icon'; +import {ServiceEntity} from 'Repositories/integration/ServiceEntity'; import {CSS_FILL_PARENT} from 'Util/CSSMixin'; import {AvatarBackground} from './AvatarBackground'; @@ -29,8 +30,6 @@ import {AvatarBorder} from './AvatarBorder'; import {AvatarImage} from './AvatarImage'; import {AvatarWrapper} from './AvatarWrapper'; -import {ServiceEntity} from '../../integration/ServiceEntity'; - import {AVATAR_SIZE} from '.'; interface ServiceAvatarProps extends React.HTMLProps { diff --git a/src/script/components/Conversation/Conversation.tsx b/src/script/components/Conversation/Conversation.tsx index 82bed095a27..7530f28f99b 100644 --- a/src/script/components/Conversation/Conversation.tsx +++ b/src/script/components/Conversation/Conversation.tsx @@ -35,6 +35,7 @@ import {showWarningModal} from 'Components/Modals/utils/showWarningModal'; import {TitleBar} from 'Components/TitleBar'; import {CallState} from 'Repositories/calling/CallState'; import {ConversationState} from 'Repositories/conversation/ConversationState'; +import {ServiceEntity} from 'Repositories/integration/ServiceEntity'; import {Config} from 'src/script/Config'; import {PROPERTIES_TYPE} from 'src/script/properties/PropertiesType'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; @@ -59,7 +60,6 @@ import {User} from '../../entity/User'; import {UserError} from '../../error/UserError'; import {isMouseRightClickEvent, isAuxRightClickEvent} from '../../guards/Mouse'; import {isServiceEntity} from '../../guards/Service'; -import {ServiceEntity} from '../../integration/ServiceEntity'; import {MotionDuration} from '../../motion/MotionDuration'; import {RightSidebarParams} from '../../page/AppMain'; import {PanelState} from '../../page/RightSidebar'; diff --git a/src/script/components/ConversationListCell/ConversationListCell.tsx b/src/script/components/ConversationListCell/ConversationListCell.tsx index 9dd360dfb5e..222ce872464 100644 --- a/src/script/components/ConversationListCell/ConversationListCell.tsx +++ b/src/script/components/ConversationListCell/ConversationListCell.tsx @@ -33,6 +33,7 @@ import {Avatar, AVATAR_SIZE, GroupAvatar} from 'Components/Avatar'; import {UserBlockedBadge} from 'Components/Badge'; import {UserInfo} from 'Components/UserInfo'; import {generateCellState} from 'Repositories/conversation/ConversationCellState'; +import {MediaType} from 'Repositories/media/MediaType'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {isKey, isOneOfKeys, KEY} from 'Util/KeyboardUtil'; import {t} from 'Util/LocalizerUtil'; @@ -41,7 +42,6 @@ import {noop, setContextMenuPosition} from 'Util/util'; import {StatusIcon} from './components/StatusIcon'; import type {Conversation} from '../../entity/Conversation'; -import {MediaType} from '../../media/MediaType'; export interface ConversationListCellProps { conversation: Conversation; diff --git a/src/script/components/InputBar/InputBar.test.tsx b/src/script/components/InputBar/InputBar.test.tsx index e684e7ea933..196c0eb2452 100644 --- a/src/script/components/InputBar/InputBar.test.tsx +++ b/src/script/components/InputBar/InputBar.test.tsx @@ -23,6 +23,7 @@ import {InputBar} from 'Components/InputBar/index'; import {AssetRepository} from 'Repositories/assets/AssetRepository'; import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; import {MessageRepository} from 'Repositories/conversation/MessageRepository'; +import {EventRepository} from 'Repositories/event/EventRepository'; import {withTheme} from 'src/script/auth/util/test/TestUtil'; import {Config} from 'src/script/Config'; import {PropertiesService} from 'src/script/properties/PropertiesService'; @@ -32,7 +33,6 @@ import {createUuid} from 'Util/uuid'; import {TestFactory} from '../../../../test/helper/TestFactory'; import {Conversation} from '../../entity/Conversation'; import {User} from '../../entity/User'; -import {EventRepository} from '../../event/EventRepository'; import {PropertiesRepository} from '../../properties/PropertiesRepository'; import {SearchRepository} from '../../search/SearchRepository'; import {StorageRepository} from '../../storage'; diff --git a/src/script/components/InputBar/InputBar.tsx b/src/script/components/InputBar/InputBar.tsx index b874525575c..e53cf82f409 100644 --- a/src/script/components/InputBar/InputBar.tsx +++ b/src/script/components/InputBar/InputBar.tsx @@ -37,6 +37,7 @@ import {SendMessageButton} from 'Components/RichTextEditor/components/SendMessag import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; import {ConversationVerificationState} from 'Repositories/conversation/ConversationVerificationState'; import {MessageRepository, OutgoingQuote} from 'Repositories/conversation/MessageRepository'; +import {EventRepository} from 'Repositories/event/EventRepository'; import {useUserPropertyValue} from 'src/script/hooks/useUserProperty'; import {PropertiesRepository} from 'src/script/properties/PropertiesRepository'; import {PROPERTIES_TYPE} from 'src/script/properties/PropertiesType'; @@ -62,7 +63,6 @@ import {Conversation} from '../../entity/Conversation'; import {ContentMessage} from '../../entity/message/ContentMessage'; import {User} from '../../entity/User'; import {ConversationError} from '../../error/ConversationError'; -import {EventRepository} from '../../event/EventRepository'; import {MentionEntity} from '../../message/MentionEntity'; import {MessageHasher} from '../../message/MessageHasher'; import {QuoteEntity} from '../../message/QuoteEntity'; diff --git a/src/script/components/MessagesList/Message/ContentMessage/MessageHeader.tsx b/src/script/components/MessagesList/Message/ContentMessage/MessageHeader.tsx index 7369d2935b6..c33a9d56765 100644 --- a/src/script/components/MessagesList/Message/ContentMessage/MessageHeader.tsx +++ b/src/script/components/MessagesList/Message/ContentMessage/MessageHeader.tsx @@ -23,10 +23,10 @@ import {AVATAR_SIZE, Avatar} from 'Components/Avatar'; import {UserBlockedBadge} from 'Components/Badge'; import * as Icon from 'Components/Icon'; import {UserName} from 'Components/UserName'; +import {ServiceEntity} from 'Repositories/integration/ServiceEntity'; import {ContentMessage} from 'src/script/entity/message/ContentMessage'; import {DeleteMessage} from 'src/script/entity/message/DeleteMessage'; import {User} from 'src/script/entity/User'; -import {ServiceEntity} from 'src/script/integration/ServiceEntity'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; diff --git a/src/script/components/MessagesList/Message/DeleteMessage.tsx b/src/script/components/MessagesList/Message/DeleteMessage.tsx index 5014e9ab42d..ca87dc984b6 100644 --- a/src/script/components/MessagesList/Message/DeleteMessage.tsx +++ b/src/script/components/MessagesList/Message/DeleteMessage.tsx @@ -19,6 +19,7 @@ import React from 'react'; +import {ServiceEntity} from 'Repositories/integration/ServiceEntity'; import {User} from 'src/script/entity/User'; import {t} from 'Util/LocalizerUtil'; import {formatTimeShort, fromUnixTime, TIME_IN_MILLIS} from 'Util/TimeUtil'; @@ -27,7 +28,6 @@ import {MessageHeader} from './ContentMessage/MessageHeader'; import {MessageTime} from './MessageTime'; import {DeleteMessage as DeleteMessageEntity} from '../../../entity/message/DeleteMessage'; -import {ServiceEntity} from '../../../integration/ServiceEntity'; export interface DeleteMessageProps { message: DeleteMessageEntity; diff --git a/src/script/components/MessagesList/Message/MemberMessage/MessageContent.tsx b/src/script/components/MessagesList/Message/MemberMessage/MessageContent.tsx index e7aac550d5a..f387fa95bbf 100644 --- a/src/script/components/MessagesList/Message/MemberMessage/MessageContent.tsx +++ b/src/script/components/MessagesList/Message/MemberMessage/MessageContent.tsx @@ -20,10 +20,10 @@ import {MemberLeaveReason} from '@wireapp/api-client/lib/conversation/data/'; import {CONVERSATION_EVENT} from '@wireapp/api-client/lib/event/'; +import {ClientEvent} from 'Repositories/event/Client'; import {Config} from 'src/script/Config'; import {MemberMessage as MemberMessageEntity} from 'src/script/entity/message/MemberMessage'; import {User} from 'src/script/entity/User'; -import {ClientEvent} from 'src/script/event/Client'; import {SystemMessageType} from 'src/script/message/SystemMessageType'; import {Declension, joinNames, replaceLink, t} from 'Util/LocalizerUtil'; import {replaceReactComponents} from 'Util/LocalizerUtil/ReactLocalizerUtil'; diff --git a/src/script/components/MessagesList/Message/index.tsx b/src/script/components/MessagesList/Message/index.tsx index 8301f7acca3..26aca44a0a5 100644 --- a/src/script/components/MessagesList/Message/index.tsx +++ b/src/script/components/MessagesList/Message/index.tsx @@ -24,7 +24,7 @@ import cx from 'classnames'; import {InViewport} from 'Components/InViewport'; import type {MessageRepository} from 'Repositories/conversation/MessageRepository'; -import {ServiceEntity} from 'src/script/integration/ServiceEntity'; +import {ServiceEntity} from 'Repositories/integration/ServiceEntity'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {getAllFocusableElements, setElementsTabIndex} from 'Util/focusUtil'; import {isTabKey} from 'Util/KeyboardUtil'; diff --git a/src/script/components/MessagesList/MessageList.tsx b/src/script/components/MessagesList/MessageList.tsx index afb230b1ef3..04ac7f349e4 100644 --- a/src/script/components/MessagesList/MessageList.tsx +++ b/src/script/components/MessagesList/MessageList.tsx @@ -27,13 +27,13 @@ import {JumpToLastMessageButton} from 'Components/MessagesList/JumpToLastMessage import {filterMessages} from 'Components/MessagesList/utils/messagesFilter'; import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; import {MessageRepository} from 'Repositories/conversation/MessageRepository'; +import {ServiceEntity} from 'Repositories/integration/ServiceEntity'; import {ContentMessage} from 'src/script/entity/message/ContentMessage'; import {DecryptErrorMessage} from 'src/script/entity/message/DecryptErrorMessage'; import {MemberMessage} from 'src/script/entity/message/MemberMessage'; import {Message as MessageEntity} from 'src/script/entity/message/Message'; import {User} from 'src/script/entity/User'; import {useRoveFocus} from 'src/script/hooks/useRoveFocus'; -import {ServiceEntity} from 'src/script/integration/ServiceEntity'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {isLastReceivedMessage} from 'Util/conversationMessages'; import {onHitTopOrBottom} from 'Util/DOM/onHitTopOrBottom'; diff --git a/src/script/components/MessagesList/utils/messagesFilter.ts b/src/script/components/MessagesList/utils/messagesFilter.ts index 96fa9447061..acc69d09863 100644 --- a/src/script/components/MessagesList/utils/messagesFilter.ts +++ b/src/script/components/MessagesList/utils/messagesFilter.ts @@ -19,11 +19,11 @@ import {CONVERSATION_EVENT} from '@wireapp/api-client/lib/event/'; +import {ClientEvent} from 'Repositories/event/Client'; import {Message as MessageEntity} from 'src/script/entity/message/Message'; import {ProtocolUpdateMessage} from '../../../entity/message/ProtocolUpdateMessage'; import {SystemMessage} from '../../../entity/message/SystemMessage'; -import {ClientEvent} from '../../../event/Client'; import {isMemberMessage} from '../../../guards/Message'; /** diff --git a/src/script/components/Modals/ServiceModal/ServiceModal.tsx b/src/script/components/Modals/ServiceModal/ServiceModal.tsx index 421f27cc575..82464ec1c06 100644 --- a/src/script/components/Modals/ServiceModal/ServiceModal.tsx +++ b/src/script/components/Modals/ServiceModal/ServiceModal.tsx @@ -22,13 +22,13 @@ import React from 'react'; import {Avatar, AVATAR_SIZE} from 'Components/Avatar'; import * as Icon from 'Components/Icon'; import {ModalComponent} from 'Components/Modals/ModalComponent'; +import {IntegrationRepository} from 'Repositories/integration/IntegrationRepository'; +import {ServiceEntity} from 'Repositories/integration/ServiceEntity'; import {SidebarTabs, useSidebarStore} from 'src/script/page/LeftSidebar/panels/Conversations/useSidebarStore'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; import {renderElement} from 'Util/renderElement'; -import {IntegrationRepository} from '../../../integration/IntegrationRepository'; -import {ServiceEntity} from '../../../integration/ServiceEntity'; import {ActionsViewModel} from '../../../view_model/ActionsViewModel'; interface ServiceModalProps { diff --git a/src/script/components/ParticipantItemContent/ParticipantItemContent.tsx b/src/script/components/ParticipantItemContent/ParticipantItemContent.tsx index 9d8dc4e9379..1df677e7bda 100644 --- a/src/script/components/ParticipantItemContent/ParticipantItemContent.tsx +++ b/src/script/components/ParticipantItemContent/ParticipantItemContent.tsx @@ -24,8 +24,8 @@ import ko from 'knockout'; import {UserBlockedBadge, UserVerificationBadges} from 'Components/Badge'; import * as Icon from 'Components/Icon'; import {UserInfo} from 'Components/UserInfo'; +import {ServiceEntity} from 'Repositories/integration/ServiceEntity'; import {User} from 'src/script/entity/User'; -import {ServiceEntity} from 'src/script/integration/ServiceEntity'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import { diff --git a/src/script/components/ServiceList/ServiceList.test.tsx b/src/script/components/ServiceList/ServiceList.test.tsx index 21d41829861..edda37d3bd0 100644 --- a/src/script/components/ServiceList/ServiceList.test.tsx +++ b/src/script/components/ServiceList/ServiceList.test.tsx @@ -19,12 +19,11 @@ import {render} from '@testing-library/react'; +import {ServiceEntity} from 'Repositories/integration/ServiceEntity'; import {createUuid} from 'Util/uuid'; import {ServiceList} from './ServiceList'; -import {ServiceEntity} from '../../integration/ServiceEntity'; - describe('ServiceList', () => { it('lists the services', () => { const serviceEntity1 = new ServiceEntity({id: createUuid()}); diff --git a/src/script/components/ServiceList/ServiceList.tsx b/src/script/components/ServiceList/ServiceList.tsx index 005a6d4e446..7d7d2ddb685 100644 --- a/src/script/components/ServiceList/ServiceList.tsx +++ b/src/script/components/ServiceList/ServiceList.tsx @@ -22,10 +22,9 @@ import React from 'react'; import cx from 'classnames'; import {ServiceListItem} from 'Components/ServiceList/components/ServiceListItem'; +import type {ServiceEntity} from 'Repositories/integration/ServiceEntity'; import {t} from 'Util/LocalizerUtil'; -import type {ServiceEntity} from '../../integration/ServiceEntity'; - export enum MODE { COMPACT = 'ServiceList.MODE.COMPACT', DEFAULT = 'ServiceList.MODE.DEFAULT', diff --git a/src/script/components/ServiceList/components/ServiceListItem/ServiceListItem.tsx b/src/script/components/ServiceList/components/ServiceListItem/ServiceListItem.tsx index c20fbc7b5f7..c0e9a754698 100644 --- a/src/script/components/ServiceList/components/ServiceListItem/ServiceListItem.tsx +++ b/src/script/components/ServiceList/components/ServiceListItem/ServiceListItem.tsx @@ -22,12 +22,11 @@ import {TabIndex} from '@wireapp/react-ui-kit/lib/types/enums'; import {Avatar, AVATAR_SIZE} from 'Components/Avatar'; import {ParticipantItemContent} from 'Components/ParticipantItemContent'; import {listItem, listWrapper} from 'Components/ParticipantItemContent/ParticipantItem.styles'; +import {ServiceEntity} from 'Repositories/integration/ServiceEntity'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {handleKeyDown} from 'Util/KeyboardUtil'; import {t} from 'Util/LocalizerUtil'; -import {ServiceEntity} from '../../../../integration/ServiceEntity'; - export interface ServiceListItemProps { service: ServiceEntity; onClick: (service: ServiceEntity) => void; diff --git a/src/script/components/calling/CallingCell/CallingCell.test.tsx b/src/script/components/calling/CallingCell/CallingCell.test.tsx index db30fd42e98..7998a5da89a 100644 --- a/src/script/components/calling/CallingCell/CallingCell.test.tsx +++ b/src/script/components/calling/CallingCell/CallingCell.test.tsx @@ -26,9 +26,9 @@ import {CALL_TYPE, STATE as CALL_STATE} from '@wireapp/avs'; import {Call} from 'Repositories/calling/Call'; import {CallingRepository} from 'Repositories/calling/CallingRepository'; import {Participant} from 'Repositories/calling/Participant'; +import {MediaDevicesHandler} from 'Repositories/media/MediaDevicesHandler'; import {Conversation} from 'src/script/entity/Conversation'; import {User} from 'src/script/entity/User'; -import {MediaDevicesHandler} from 'src/script/media/MediaDevicesHandler'; import {TeamState} from 'src/script/team/TeamState'; import {CallActions} from 'src/script/view_model/CallingViewModel'; import {createUuid} from 'Util/uuid'; diff --git a/src/script/components/calling/CallingOverlayContainer.tsx b/src/script/components/calling/CallingOverlayContainer.tsx index 353fe5fb030..04343e9a466 100644 --- a/src/script/components/calling/CallingOverlayContainer.tsx +++ b/src/script/components/calling/CallingOverlayContainer.tsx @@ -28,12 +28,12 @@ import {CallingViewMode, CallState, DesktopScreenShareMenu, MuteState} from 'Rep import {LEAVE_CALL_REASON} from 'Repositories/calling/enum/LeaveCallReason'; import {Participant} from 'Repositories/calling/Participant'; import {useVideoGrid} from 'Repositories/calling/videoGridHandler'; +import {MediaRepository} from 'Repositories/media/MediaRepository'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {ChooseScreen} from './ChooseScreen'; import {FullscreenVideoCall} from './FullscreenVideoCall'; -import {MediaRepository} from '../../media/MediaRepository'; import {CallViewTab} from '../../view_model/CallingViewModel'; export interface CallingContainerProps { diff --git a/src/script/components/calling/ChooseScreen.tsx b/src/script/components/calling/ChooseScreen.tsx index 7d90b6fd694..9d9ae2388bd 100644 --- a/src/script/components/calling/ChooseScreen.tsx +++ b/src/script/components/calling/ChooseScreen.tsx @@ -22,7 +22,7 @@ import {Fragment, useCallback, useEffect} from 'react'; import {container} from 'tsyringe'; import {CallState} from 'Repositories/calling/CallState'; -import {ElectronDesktopCapturerSource} from 'src/script/media/MediaDevicesHandler'; +import {ElectronDesktopCapturerSource} from 'Repositories/media/MediaDevicesHandler'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; diff --git a/src/script/components/calling/DetachedCallingCell/DetachedCallingCell.tsx b/src/script/components/calling/DetachedCallingCell/DetachedCallingCell.tsx index 08aa0de1145..b5b10cf3769 100644 --- a/src/script/components/calling/DetachedCallingCell/DetachedCallingCell.tsx +++ b/src/script/components/calling/DetachedCallingCell/DetachedCallingCell.tsx @@ -22,7 +22,7 @@ import {container} from 'tsyringe'; import {Call} from 'Repositories/calling/Call'; import {CallingRepository} from 'Repositories/calling/CallingRepository'; import {CallState, CallingViewMode, DesktopScreenShareMenu} from 'Repositories/calling/CallState'; -import {MediaRepository} from 'src/script/media/MediaRepository'; +import {MediaRepository} from 'Repositories/media/MediaRepository'; import {UserState} from 'src/script/user/UserState'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; diff --git a/src/script/components/calling/FullscreenVideoCall.tsx b/src/script/components/calling/FullscreenVideoCall.tsx index 04abab01024..7af970c1a11 100644 --- a/src/script/components/calling/FullscreenVideoCall.tsx +++ b/src/script/components/calling/FullscreenVideoCall.tsx @@ -44,12 +44,13 @@ import {CallingRepository} from 'Repositories/calling/CallingRepository'; import {CallingViewMode, CallState, MuteState} from 'Repositories/calling/CallState'; import {Participant} from 'Repositories/calling/Participant'; import type {Grid} from 'Repositories/calling/videoGridHandler'; +import {ElectronDesktopCapturerSource, MediaDevicesHandler} from 'Repositories/media/MediaDevicesHandler'; +import {MediaDeviceType} from 'Repositories/media/MediaDeviceType'; import {Config} from 'src/script/Config'; import {isCallViewOption} from 'src/script/guards/CallView'; import {isMediaDevice} from 'src/script/guards/MediaDevice'; import {useActiveWindowMatchMedia} from 'src/script/hooks/useActiveWindowMatchMedia'; import {useToggleState} from 'src/script/hooks/useToggleState'; -import {MediaDeviceType} from 'src/script/media/MediaDeviceType'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {isDetachedCallingFeatureEnabled} from 'Util/isDetachedCallingFeatureEnabled'; import {handleKeyDown, isEscapeKey} from 'Util/KeyboardUtil'; @@ -72,7 +73,6 @@ import {GroupVideoGrid} from './GroupVideoGrid'; import {Pagination} from './Pagination'; import type {Conversation} from '../../entity/Conversation'; -import {ElectronDesktopCapturerSource, MediaDevicesHandler} from '../../media/MediaDevicesHandler'; import {TeamState} from '../../team/TeamState'; import {CallViewTab} from '../../view_model/CallingViewModel'; diff --git a/src/script/components/calling/fullscreenVideoCall.test.tsx b/src/script/components/calling/fullscreenVideoCall.test.tsx index 6e507a5edf4..ab72ff968db 100644 --- a/src/script/components/calling/fullscreenVideoCall.test.tsx +++ b/src/script/components/calling/fullscreenVideoCall.test.tsx @@ -23,10 +23,10 @@ import ko from 'knockout'; import {Call} from 'Repositories/calling/Call'; import {Participant} from 'Repositories/calling/Participant'; import {Grid} from 'Repositories/calling/videoGridHandler'; +import {MediaDevicesHandler} from 'Repositories/media/MediaDevicesHandler'; import {withTheme} from 'src/script/auth/util/test/TestUtil'; import {Conversation} from 'src/script/entity/Conversation'; import {User} from 'src/script/entity/User'; -import {MediaDevicesHandler} from 'src/script/media/MediaDevicesHandler'; import {FullscreenVideoCall, FullscreenVideoCallProps} from './FullscreenVideoCall'; diff --git a/src/script/components/panel/ServiceDetails.test.tsx b/src/script/components/panel/ServiceDetails.test.tsx index d14141ad74e..d26c5a5107f 100644 --- a/src/script/components/panel/ServiceDetails.test.tsx +++ b/src/script/components/panel/ServiceDetails.test.tsx @@ -19,9 +19,9 @@ import {render} from '@testing-library/react'; -import {ServiceDetails} from './ServiceDetails'; +import {ServiceEntity} from 'Repositories/integration/ServiceEntity'; -import {ServiceEntity} from '../../integration/ServiceEntity'; +import {ServiceDetails} from './ServiceDetails'; describe('ServiceDetails', () => { it('renders the correct infos for the service', () => { diff --git a/src/script/components/panel/ServiceDetails.tsx b/src/script/components/panel/ServiceDetails.tsx index 2eb3a6d041d..99879555b54 100644 --- a/src/script/components/panel/ServiceDetails.tsx +++ b/src/script/components/panel/ServiceDetails.tsx @@ -20,10 +20,9 @@ import React from 'react'; import {Avatar, AVATAR_SIZE} from 'Components/Avatar'; +import type {ServiceEntity} from 'Repositories/integration/ServiceEntity'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; -import type {ServiceEntity} from '../../integration/ServiceEntity'; - export interface ServiceDetailsProps { service: ServiceEntity; } diff --git a/src/script/entity/message/MemberMessage.ts b/src/script/entity/message/MemberMessage.ts index 08fa4b8c314..5502de448d2 100644 --- a/src/script/entity/message/MemberMessage.ts +++ b/src/script/entity/message/MemberMessage.ts @@ -22,13 +22,13 @@ import {CONVERSATION_EVENT} from '@wireapp/api-client/lib/event/'; import type {QualifiedId} from '@wireapp/api-client/lib/user/'; import ko from 'knockout'; +import {ClientEvent} from 'Repositories/event/Client'; import {Declension, getUserName, t} from 'Util/LocalizerUtil'; import {matchQualifiedIds} from 'Util/QualifiedId'; import {capitalizeFirstChar} from 'Util/StringUtil'; import {SystemMessage} from './SystemMessage'; -import {ClientEvent} from '../../event/Client'; import {SuperType} from '../../message/SuperType'; import {SystemMessageType} from '../../message/SystemMessageType'; import {User} from '../User'; diff --git a/src/script/entity/message/Text.ts b/src/script/entity/message/Text.ts index e9230e40d33..f82bfffe465 100644 --- a/src/script/entity/message/Text.ts +++ b/src/script/entity/message/Text.ts @@ -22,12 +22,12 @@ import ko from 'knockout'; import {AssetType} from 'Repositories/assets/AssetType'; import {containsOnlyLink} from 'Repositories/conversation/linkPreviews/helpers'; +import {mediaParser} from 'Repositories/media/MediaParser'; import {renderMessage} from 'Util/messageRenderer'; import {Asset} from './Asset'; import type {LinkPreview} from './LinkPreview'; -import {mediaParser} from '../../media/MediaParser'; import type {MentionEntity} from '../../message/MentionEntity'; export class Text extends Asset { diff --git a/src/script/guards/MediaDevice.ts b/src/script/guards/MediaDevice.ts index ce949c26563..93860a1f807 100644 --- a/src/script/guards/MediaDevice.ts +++ b/src/script/guards/MediaDevice.ts @@ -17,7 +17,7 @@ * */ -import {ElectronDesktopCapturerSource} from '../media/MediaDevicesHandler'; +import {ElectronDesktopCapturerSource} from 'Repositories/media/MediaDevicesHandler'; export const isMediaDevice = ( device: MediaDeviceInfo | ElectronDesktopCapturerSource | undefined, diff --git a/src/script/guards/Panel.ts b/src/script/guards/Panel.ts index 45847c76986..0e32e4bb0ba 100644 --- a/src/script/guards/Panel.ts +++ b/src/script/guards/Panel.ts @@ -17,8 +17,9 @@ * */ +import {ServiceEntity} from 'Repositories/integration/ServiceEntity'; + import {User} from '../entity/User'; -import {ServiceEntity} from '../integration/ServiceEntity'; import {PanelEntity} from '../page/RightSidebar/RightSidebar'; export const isServiceEntity = (entity: PanelEntity): entity is ServiceEntity => { diff --git a/src/script/guards/Service.ts b/src/script/guards/Service.ts index 8d8fca950c7..31770a93074 100644 --- a/src/script/guards/Service.ts +++ b/src/script/guards/Service.ts @@ -17,6 +17,6 @@ * */ -import {ServiceEntity} from '../integration/ServiceEntity'; +import {ServiceEntity} from 'Repositories/integration/ServiceEntity'; export const isServiceEntity = (entity: any): entity is ServiceEntity => 'isService' in entity && entity.isService; diff --git a/src/script/hooks/useInitializeMediaDevices.ts b/src/script/hooks/useInitializeMediaDevices.ts index cf9df747cba..f7c473e7ab4 100644 --- a/src/script/hooks/useInitializeMediaDevices.ts +++ b/src/script/hooks/useInitializeMediaDevices.ts @@ -19,11 +19,10 @@ import {useEffect, useState} from 'react'; +import {MediaDevicesHandler} from 'Repositories/media/MediaDevicesHandler'; +import {MediaStreamHandler} from 'Repositories/media/MediaStreamHandler'; import {getLogger} from 'Util/Logger'; -import {MediaDevicesHandler} from '../media/MediaDevicesHandler'; -import {MediaStreamHandler} from '../media/MediaStreamHandler'; - const logger = getLogger('useInitializeMediaDevices'); export const useInitializeMediaDevices = (devicesHandler: MediaDevicesHandler, streamHandler: MediaStreamHandler) => { diff --git a/src/script/legal-hold/LegalHoldEvaluator.ts b/src/script/legal-hold/LegalHoldEvaluator.ts index b0120b3fcb2..b0ef5327f20 100644 --- a/src/script/legal-hold/LegalHoldEvaluator.ts +++ b/src/script/legal-hold/LegalHoldEvaluator.ts @@ -21,9 +21,10 @@ import {CONVERSATION_EVENT} from '@wireapp/api-client/lib/event'; import {LegalHoldStatus} from '@wireapp/protocol-messaging'; +import {CONVERSATION} from 'Repositories/event/Client'; + import type {Conversation} from '../entity/Conversation'; import type {User} from '../entity/User'; -import {CONVERSATION} from '../event/Client'; export type MappedEvent = Record & { data?: MappedEventData | string; diff --git a/src/script/main/app.ts b/src/script/main/app.ts index dd4cbd38a10..010c5e7b22c 100644 --- a/src/script/main/app.ts +++ b/src/script/main/app.ts @@ -17,16 +17,15 @@ * */ -// Polyfill for "tsyringe" dependency injection -// eslint-disable-next-line import/order -import 'core-js/full/reflect'; - import {Context} from '@wireapp/api-client/lib/auth'; import {ClientClassification, ClientType} from '@wireapp/api-client/lib/client/'; import {EVENTS as CoreEvents} from '@wireapp/core/lib/Account'; import {amplify} from 'amplify'; import platform from 'platform'; import {container} from 'tsyringe'; +// Polyfill for "tsyringe" dependency injection +// eslint-disable-next-line import/order +import 'core-js/full/reflect'; import {Runtime} from '@wireapp/commons'; import {WebAppEvents} from '@wireapp/webapp-events'; @@ -49,8 +48,20 @@ import {OnConversationE2EIVerificationStateChange} from 'Repositories/conversati import {EventBuilder} from 'Repositories/conversation/EventBuilder'; import {MessageRepository} from 'Repositories/conversation/MessageRepository'; import {CryptographyRepository} from 'Repositories/cryptography/CryptographyRepository'; +import {EventRepository} from 'Repositories/event/EventRepository'; +import {EventService} from 'Repositories/event/EventService'; +import {NotificationService} from 'Repositories/event/NotificationService'; +import {EventStorageMiddleware} from 'Repositories/event/preprocessor/EventStorageMiddleware'; +import {QuotedMessageMiddleware} from 'Repositories/event/preprocessor/QuoteDecoderMiddleware'; +import {ReceiptsMiddleware} from 'Repositories/event/preprocessor/ReceiptsMiddleware'; +import {RepliesUpdaterMiddleware} from 'Repositories/event/preprocessor/RepliesUpdaterMiddleware'; +import {ServiceMiddleware} from 'Repositories/event/preprocessor/ServiceMiddleware'; +import {FederationEventProcessor} from 'Repositories/event/processor/FederationEventProcessor'; import {GiphyRepository} from 'Repositories/giphy/GiphyRepository'; import {GiphyService} from 'Repositories/giphy/GiphyService'; +import {IntegrationRepository} from 'Repositories/integration/IntegrationRepository'; +import {IntegrationService} from 'Repositories/integration/IntegrationService'; +import {MediaRepository} from 'Repositories/media/MediaRepository'; import {initializeDataDog} from 'Util/DataDog'; import {DebugUtil} from 'Util/DebugUtil'; import {Environment} from 'Util/Environment'; @@ -72,20 +83,8 @@ import {AuthError} from '../error/AuthError'; import {BaseError} from '../error/BaseError'; import {ClientError, CLIENT_ERROR_TYPE} from '../error/ClientError'; import {TeamError} from '../error/TeamError'; -import {EventRepository} from '../event/EventRepository'; -import {EventService} from '../event/EventService'; -import {NotificationService} from '../event/NotificationService'; -import {EventStorageMiddleware} from '../event/preprocessor/EventStorageMiddleware'; -import {QuotedMessageMiddleware} from '../event/preprocessor/QuoteDecoderMiddleware'; -import {ReceiptsMiddleware} from '../event/preprocessor/ReceiptsMiddleware'; -import {RepliesUpdaterMiddleware} from '../event/preprocessor/RepliesUpdaterMiddleware'; -import {ServiceMiddleware} from '../event/preprocessor/ServiceMiddleware'; -import {FederationEventProcessor} from '../event/processor/FederationEventProcessor'; import {externalUrl} from '../externalRoute'; -import {IntegrationRepository} from '../integration/IntegrationRepository'; -import {IntegrationService} from '../integration/IntegrationService'; import {startNewVersionPolling} from '../lifecycle/newVersionHandler'; -import {MediaRepository} from '../media/MediaRepository'; import {initMLSGroupConversations, initialiseSelfAndTeamConversations} from '../mls'; import {joinConversationsAfterMigrationFinalisation} from '../mls/MLSMigration/migrationFinaliser'; import {NotificationRepository} from '../notification/NotificationRepository'; diff --git a/src/script/message/MessageCategorization.ts b/src/script/message/MessageCategorization.ts index 2006011017f..3b0ec751857 100644 --- a/src/script/message/MessageCategorization.ts +++ b/src/script/message/MessageCategorization.ts @@ -19,9 +19,10 @@ import {isObject} from 'underscore'; +import {ClientEvent} from 'Repositories/event/Client'; + import {MessageCategory} from './MessageCategory'; -import {ClientEvent} from '../event/Client'; import {EventRecord} from '../storage/record/EventRecord'; const _checkAsset = (event: any): MessageCategory | void => { diff --git a/src/script/message/MessageHasher.ts b/src/script/message/MessageHasher.ts index ff70731ee43..cb31e087ca6 100644 --- a/src/script/message/MessageHasher.ts +++ b/src/script/message/MessageHasher.ts @@ -19,9 +19,9 @@ import Long from 'long'; +import {ClientEvent} from 'Repositories/event/Client'; import {utf8ToUtf16BE} from 'Util/StringUtil'; -import {ClientEvent} from '../event/Client'; import {LegacyEventRecord} from '../storage/record/EventRecord'; /** diff --git a/src/script/notification/NotificationRepository.test.ts b/src/script/notification/NotificationRepository.test.ts index 0da471f86bd..5bb802f445b 100644 --- a/src/script/notification/NotificationRepository.test.ts +++ b/src/script/notification/NotificationRepository.test.ts @@ -37,6 +37,7 @@ import {ConnectionMapper} from 'Repositories/connection/ConnectionMapper'; import {ConversationMapper} from 'Repositories/conversation/ConversationMapper'; import {ConversationState} from 'Repositories/conversation/ConversationState'; import {NOTIFICATION_STATE} from 'Repositories/conversation/NotificationSetting'; +import {NOTIFICATION_HANDLING_STATE} from 'Repositories/event/NotificationHandlingState'; import {Conversation} from 'src/script/entity/Conversation'; import {CallMessage} from 'src/script/entity/message/CallMessage'; import {CompositeMessage} from 'src/script/entity/message/CompositeMessage'; @@ -49,7 +50,6 @@ import {PingMessage} from 'src/script/entity/message/PingMessage'; import {RenameMessage} from 'src/script/entity/message/RenameMessage'; import {Text} from 'src/script/entity/message/Text'; import {User} from 'src/script/entity/User'; -import {NOTIFICATION_HANDLING_STATE} from 'src/script/event/NotificationHandlingState'; import 'src/script/localization/Localizer'; import {CALL_MESSAGE_TYPE} from 'src/script/message/CallMessageType'; import {MentionEntity} from 'src/script/message/MentionEntity'; diff --git a/src/script/page/LeftSidebar/panels/Conversations/Conversations.tsx b/src/script/page/LeftSidebar/panels/Conversations/Conversations.tsx index 47887c3f5a4..6cd69d4e61d 100644 --- a/src/script/page/LeftSidebar/panels/Conversations/Conversations.tsx +++ b/src/script/page/LeftSidebar/panels/Conversations/Conversations.tsx @@ -30,7 +30,7 @@ import {CallState} from 'Repositories/calling/CallState'; import {createLabel} from 'Repositories/conversation/ConversationLabelRepository'; import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; import {ConversationState} from 'Repositories/conversation/ConversationState'; -import {IntegrationRepository} from 'src/script/integration/IntegrationRepository'; +import {IntegrationRepository} from 'Repositories/integration/IntegrationRepository'; import {Preferences} from 'src/script/page/LeftSidebar/panels/Preferences'; import {StartUI} from 'src/script/page/LeftSidebar/panels/StartUI'; import {ANIMATED_PAGE_TRANSITION_DURATION} from 'src/script/page/MainContent'; diff --git a/src/script/page/LeftSidebar/panels/StartUI/ServicesTab.tsx b/src/script/page/LeftSidebar/panels/StartUI/ServicesTab.tsx index 2bf2d88eee9..9aff0d217a3 100644 --- a/src/script/page/LeftSidebar/panels/StartUI/ServicesTab.tsx +++ b/src/script/page/LeftSidebar/panels/StartUI/ServicesTab.tsx @@ -23,13 +23,13 @@ import {Button, ButtonVariant} from '@wireapp/react-ui-kit'; import * as Icon from 'Components/Icon'; import {ServiceList} from 'Components/ServiceList/ServiceList'; -import {IntegrationRepository} from 'src/script/integration/IntegrationRepository'; -import {ServiceEntity} from 'src/script/integration/ServiceEntity'; +import {useDebounce} from 'Hooks/useDebounce'; +import {IntegrationRepository} from 'Repositories/integration/IntegrationRepository'; +import {ServiceEntity} from 'Repositories/integration/ServiceEntity'; import {t} from 'Util/LocalizerUtil'; import {safeWindowOpen} from 'Util/SanitizationUtil'; import {getManageServicesUrl} from '../../../../externalRoute'; -import {useDebounce} from '../../../../hooks/useDebounce'; export const ServicesTab: React.FC<{ canManageServices: boolean; diff --git a/src/script/page/LeftSidebar/panels/StartUI/StartUI.tsx b/src/script/page/LeftSidebar/panels/StartUI/StartUI.tsx index 4fad0ee3a4e..90b6be5e732 100644 --- a/src/script/page/LeftSidebar/panels/StartUI/StartUI.tsx +++ b/src/script/page/LeftSidebar/panels/StartUI/StartUI.tsx @@ -28,9 +28,9 @@ import {showUserModal} from 'Components/Modals/UserModal'; import {SearchInput} from 'Components/SearchInput'; import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; import {ConversationState} from 'Repositories/conversation/ConversationState'; +import {IntegrationRepository} from 'Repositories/integration/IntegrationRepository'; +import {ServiceEntity} from 'Repositories/integration/ServiceEntity'; import {User} from 'src/script/entity/User'; -import {IntegrationRepository} from 'src/script/integration/IntegrationRepository'; -import {ServiceEntity} from 'src/script/integration/ServiceEntity'; import {SidebarTabs, useSidebarStore} from 'src/script/page/LeftSidebar/panels/Conversations/useSidebarStore'; import {UserRepository} from 'src/script/user/UserRepository'; import {MainViewModel} from 'src/script/view_model/MainViewModel'; diff --git a/src/script/page/MainContent/panels/preferences/AVPreferences.tsx b/src/script/page/MainContent/panels/preferences/AVPreferences.tsx index cac643984b6..5817aa7141d 100644 --- a/src/script/page/MainContent/panels/preferences/AVPreferences.tsx +++ b/src/script/page/MainContent/panels/preferences/AVPreferences.tsx @@ -19,7 +19,8 @@ import {useInitializeMediaDevices} from 'Hooks/useInitializeMediaDevices'; import type {CallingRepository} from 'Repositories/calling/CallingRepository'; -import {MediaDeviceType} from 'src/script/media/MediaDeviceType'; +import {MediaDeviceType} from 'Repositories/media/MediaDeviceType'; +import type {MediaRepository} from 'Repositories/media/MediaRepository'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; @@ -30,7 +31,6 @@ import {MicrophonePreferences} from './avPreferences/MicrophonePreferences'; import {SaveCallLogs} from './avPreferences/SaveCallLogs'; import {PreferencesPage} from './components/PreferencesPage'; -import type {MediaRepository} from '../../../../media/MediaRepository'; import type {PropertiesRepository} from '../../../../properties/PropertiesRepository'; interface AVPreferencesProps { diff --git a/src/script/page/MainContent/panels/preferences/avPreferences/AudioOutPreferences.tsx b/src/script/page/MainContent/panels/preferences/avPreferences/AudioOutPreferences.tsx index 011b54d9ca1..61f95889d03 100644 --- a/src/script/page/MainContent/panels/preferences/avPreferences/AudioOutPreferences.tsx +++ b/src/script/page/MainContent/panels/preferences/avPreferences/AudioOutPreferences.tsx @@ -20,13 +20,13 @@ import React from 'react'; import * as Icon from 'Components/Icon'; -import {MediaDeviceType} from 'src/script/media/MediaDeviceType'; +import {MediaDevicesHandler} from 'Repositories/media/MediaDevicesHandler'; +import {MediaDeviceType} from 'Repositories/media/MediaDeviceType'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; import {DeviceSelect} from './DeviceSelect'; -import {MediaDevicesHandler} from '../../../../../media/MediaDevicesHandler'; import {PreferencesSection} from '../components/PreferencesSection'; interface AudioOutPreferencesProps { diff --git a/src/script/page/MainContent/panels/preferences/avPreferences/CallOptions.tsx b/src/script/page/MainContent/panels/preferences/avPreferences/CallOptions.tsx index 95b3dd879a0..8ec3c87ca58 100644 --- a/src/script/page/MainContent/panels/preferences/avPreferences/CallOptions.tsx +++ b/src/script/page/MainContent/panels/preferences/avPreferences/CallOptions.tsx @@ -25,10 +25,10 @@ import {amplify} from 'amplify'; import {Checkbox, CheckboxLabel} from '@wireapp/react-ui-kit'; import {WebAppEvents} from '@wireapp/webapp-events'; +import type {MediaConstraintsHandler} from 'Repositories/media/MediaConstraintsHandler'; import {t} from 'Util/LocalizerUtil'; import {Config} from '../../../../../Config'; -import type {MediaConstraintsHandler} from '../../../../../media/MediaConstraintsHandler'; import type {PropertiesRepository} from '../../../../../properties/PropertiesRepository'; import {PROPERTIES_TYPE} from '../../../../../properties/PropertiesType'; import {PreferencesSection} from '../components/PreferencesSection'; diff --git a/src/script/page/MainContent/panels/preferences/avPreferences/CameraPreferences.tsx b/src/script/page/MainContent/panels/preferences/avPreferences/CameraPreferences.tsx index 3316ac0c075..1c9a3be2d6c 100644 --- a/src/script/page/MainContent/panels/preferences/avPreferences/CameraPreferences.tsx +++ b/src/script/page/MainContent/panels/preferences/avPreferences/CameraPreferences.tsx @@ -20,7 +20,10 @@ import React, {useEffect, useRef, useState} from 'react'; import * as Icon from 'Components/Icon'; -import {MediaDeviceType} from 'src/script/media/MediaDeviceType'; +import {MediaDevicesHandler} from 'Repositories/media/MediaDevicesHandler'; +import {MediaDeviceType} from 'Repositories/media/MediaDeviceType'; +import {MediaStreamHandler} from 'Repositories/media/MediaStreamHandler'; +import {MediaType} from 'Repositories/media/MediaType'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; import {getLogger} from 'Util/Logger'; @@ -28,9 +31,6 @@ import {getLogger} from 'Util/Logger'; import {DeviceSelect} from './DeviceSelect'; import {Config} from '../../../../../Config'; -import {MediaDevicesHandler} from '../../../../../media/MediaDevicesHandler'; -import {MediaStreamHandler} from '../../../../../media/MediaStreamHandler'; -import {MediaType} from '../../../../../media/MediaType'; import {PreferencesSection} from '../components/PreferencesSection'; const logger = getLogger('CameraPreferences'); diff --git a/src/script/page/MainContent/panels/preferences/avPreferences/MicrophonePreferences.tsx b/src/script/page/MainContent/panels/preferences/avPreferences/MicrophonePreferences.tsx index 64b049b502b..5862108ad9a 100644 --- a/src/script/page/MainContent/panels/preferences/avPreferences/MicrophonePreferences.tsx +++ b/src/script/page/MainContent/panels/preferences/avPreferences/MicrophonePreferences.tsx @@ -20,7 +20,10 @@ import React, {useEffect, useState} from 'react'; import * as Icon from 'Components/Icon'; -import {MediaDeviceType} from 'src/script/media/MediaDeviceType'; +import {MediaDevicesHandler} from 'Repositories/media/MediaDevicesHandler'; +import {MediaDeviceType} from 'Repositories/media/MediaDeviceType'; +import {MediaStreamHandler} from 'Repositories/media/MediaStreamHandler'; +import {MediaType} from 'Repositories/media/MediaType'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; import {getLogger} from 'Util/Logger'; @@ -29,9 +32,6 @@ import {DeviceSelect} from './DeviceSelect'; import {InputLevel} from './InputLevel'; import {Config} from '../../../../../Config'; -import {MediaDevicesHandler} from '../../../../../media/MediaDevicesHandler'; -import {MediaStreamHandler} from '../../../../../media/MediaStreamHandler'; -import {MediaType} from '../../../../../media/MediaType'; import {PreferencesSection} from '../components/PreferencesSection'; const logger = getLogger('MicrophonePreferences'); diff --git a/src/script/page/RightSidebar/AddParticipants/AddParticipants.tsx b/src/script/page/RightSidebar/AddParticipants/AddParticipants.tsx index 36399567eff..f276abc91ec 100644 --- a/src/script/page/RightSidebar/AddParticipants/AddParticipants.tsx +++ b/src/script/page/RightSidebar/AddParticipants/AddParticipants.tsx @@ -31,6 +31,8 @@ import {SearchInput} from 'Components/SearchInput'; import {ServiceList} from 'Components/ServiceList/ServiceList'; import {UserSearchableList} from 'Components/UserSearchableList'; import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; +import {IntegrationRepository} from 'Repositories/integration/IntegrationRepository'; +import {ServiceEntity} from 'Repositories/integration/ServiceEntity'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {handleKeyDown} from 'Util/KeyboardUtil'; import {t} from 'Util/LocalizerUtil'; @@ -40,8 +42,6 @@ import {sortUsersByPriority} from 'Util/StringUtil'; import {Conversation} from '../../../entity/Conversation'; import {User} from '../../../entity/User'; import {getManageServicesUrl} from '../../../externalRoute'; -import {IntegrationRepository} from '../../../integration/IntegrationRepository'; -import {ServiceEntity} from '../../../integration/ServiceEntity'; import {SearchRepository} from '../../../search/SearchRepository'; import {TeamRepository} from '../../../team/TeamRepository'; import {TeamState} from '../../../team/TeamState'; diff --git a/src/script/page/RightSidebar/ConversationDetails/ConversationDetails.test.tsx b/src/script/page/RightSidebar/ConversationDetails/ConversationDetails.test.tsx index f5feb043808..b9b0805a963 100644 --- a/src/script/page/RightSidebar/ConversationDetails/ConversationDetails.test.tsx +++ b/src/script/page/RightSidebar/ConversationDetails/ConversationDetails.test.tsx @@ -24,6 +24,7 @@ import {ConnectionRepository} from 'Repositories/connection/ConnectionRepository import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; import {ConversationRoleRepository} from 'Repositories/conversation/ConversationRoleRepository'; import {MessageRepository} from 'Repositories/conversation/MessageRepository'; +import {IntegrationRepository} from 'Repositories/integration/IntegrationRepository'; import {Conversation} from 'src/script/entity/Conversation'; import {createUuid} from 'Util/uuid'; @@ -31,7 +32,6 @@ import {ConversationDetails} from './ConversationDetails'; import {TestFactory} from '../../../../../test/helper/TestFactory'; import {User} from '../../../entity/User'; -import {IntegrationRepository} from '../../../integration/IntegrationRepository'; import {SearchRepository} from '../../../search/SearchRepository'; import {SelfRepository} from '../../../self/SelfRepository'; import {TeamEntity} from '../../../team/TeamEntity'; diff --git a/src/script/page/RightSidebar/ConversationDetails/ConversationDetails.tsx b/src/script/page/RightSidebar/ConversationDetails/ConversationDetails.tsx index 71267e44e6c..e860ad5d9dc 100644 --- a/src/script/page/RightSidebar/ConversationDetails/ConversationDetails.tsx +++ b/src/script/page/RightSidebar/ConversationDetails/ConversationDetails.tsx @@ -31,6 +31,8 @@ import {UserDetails} from 'Components/panel/UserDetails'; import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; import {ConversationVerificationState} from 'Repositories/conversation/ConversationVerificationState'; import {getNotificationText} from 'Repositories/conversation/NotificationSetting'; +import {IntegrationRepository} from 'Repositories/integration/IntegrationRepository'; +import {ServiceEntity} from 'Repositories/integration/ServiceEntity'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; import {sortUsersByPriority} from 'Util/StringUtil'; @@ -43,8 +45,6 @@ import {ConversationDetailsParticipants} from './components/ConversationDetailsP import {Conversation} from '../../../entity/Conversation'; import {User} from '../../../entity/User'; import {isServiceEntity} from '../../../guards/Service'; -import {IntegrationRepository} from '../../../integration/IntegrationRepository'; -import {ServiceEntity} from '../../../integration/ServiceEntity'; import {TeamRepository} from '../../../team/TeamRepository'; import {TeamState} from '../../../team/TeamState'; import {Shortcut} from '../../../ui/Shortcut'; diff --git a/src/script/page/RightSidebar/ConversationDetails/components/ConversationDetailsHeader/ConversationDetailsHeader.test.tsx b/src/script/page/RightSidebar/ConversationDetails/components/ConversationDetailsHeader/ConversationDetailsHeader.test.tsx index 1a6c5928d57..6057587b0be 100644 --- a/src/script/page/RightSidebar/ConversationDetails/components/ConversationDetailsHeader/ConversationDetailsHeader.test.tsx +++ b/src/script/page/RightSidebar/ConversationDetails/components/ConversationDetailsHeader/ConversationDetailsHeader.test.tsx @@ -20,8 +20,8 @@ import {render, fireEvent} from '@testing-library/react'; import {CONVERSATION_TYPE} from '@wireapp/api-client/lib/conversation'; +import {ServiceEntity} from 'Repositories/integration/ServiceEntity'; import {User} from 'src/script/entity/User'; -import {ServiceEntity} from 'src/script/integration/ServiceEntity'; import {createUuid} from 'Util/uuid'; import {ConversationDetailsHeader} from './ConversationDetailsHeader'; diff --git a/src/script/page/RightSidebar/ConversationDetails/components/ConversationDetailsHeader/ConversationDetailsHeader.tsx b/src/script/page/RightSidebar/ConversationDetails/components/ConversationDetailsHeader/ConversationDetailsHeader.tsx index 46e5bbcb18a..f4b3384e60c 100644 --- a/src/script/page/RightSidebar/ConversationDetails/components/ConversationDetailsHeader/ConversationDetailsHeader.tsx +++ b/src/script/page/RightSidebar/ConversationDetails/components/ConversationDetailsHeader/ConversationDetailsHeader.tsx @@ -22,6 +22,7 @@ import {ChangeEvent, FC, KeyboardEvent, useEffect, useRef, useState} from 'react import {ConversationVerificationBadges} from 'Components/Badge'; import * as Icon from 'Components/Icon'; import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; +import {ServiceEntity} from 'Repositories/integration/ServiceEntity'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {isEnterKey} from 'Util/KeyboardUtil'; import {t} from 'Util/LocalizerUtil'; @@ -29,7 +30,6 @@ import {removeLineBreaks} from 'Util/StringUtil'; import {Conversation} from '../../../../../entity/Conversation'; import {User} from '../../../../../entity/User'; -import {ServiceEntity} from '../../../../../integration/ServiceEntity'; import {GroupDetails} from '../GroupDetails/GroupDetails'; interface ConversationDetailsHeaderProps { diff --git a/src/script/page/RightSidebar/ConversationDetails/components/ConversationDetailsParticipants/ConversationDetailsParticipants.tsx b/src/script/page/RightSidebar/ConversationDetails/components/ConversationDetailsParticipants/ConversationDetailsParticipants.tsx index 313e6636b96..fe6d73e08b6 100644 --- a/src/script/page/RightSidebar/ConversationDetails/components/ConversationDetailsParticipants/ConversationDetailsParticipants.tsx +++ b/src/script/page/RightSidebar/ConversationDetails/components/ConversationDetailsParticipants/ConversationDetailsParticipants.tsx @@ -21,11 +21,11 @@ import * as Icon from 'Components/Icon'; import {ServiceList} from 'Components/ServiceList'; import {UserList} from 'Components/UserList'; import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; +import {ServiceEntity} from 'Repositories/integration/ServiceEntity'; import {t} from 'Util/LocalizerUtil'; import {Conversation} from '../../../../../entity/Conversation'; import {User} from '../../../../../entity/User'; -import {ServiceEntity} from '../../../../../integration/ServiceEntity'; interface ConversationDetailsParticipantsProps { activeConversation: Conversation; diff --git a/src/script/page/RightSidebar/ConversationDetails/components/GroupDetails/GroupDetails.tsx b/src/script/page/RightSidebar/ConversationDetails/components/GroupDetails/GroupDetails.tsx index 68e1e49c771..29db8291823 100644 --- a/src/script/page/RightSidebar/ConversationDetails/components/GroupDetails/GroupDetails.tsx +++ b/src/script/page/RightSidebar/ConversationDetails/components/GroupDetails/GroupDetails.tsx @@ -20,10 +20,10 @@ import {FC} from 'react'; import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; +import {ServiceEntity} from 'Repositories/integration/ServiceEntity'; import {t} from 'Util/LocalizerUtil'; import {User} from '../../../../../entity/User'; -import {ServiceEntity} from '../../../../../integration/ServiceEntity'; interface GroupDetailsProps { userParticipants: User[]; diff --git a/src/script/page/RightSidebar/GroupParticipantService/GroupParticipantService.tsx b/src/script/page/RightSidebar/GroupParticipantService/GroupParticipantService.tsx index 786c825bd31..36ca777f1d3 100644 --- a/src/script/page/RightSidebar/GroupParticipantService/GroupParticipantService.tsx +++ b/src/script/page/RightSidebar/GroupParticipantService/GroupParticipantService.tsx @@ -24,14 +24,14 @@ import {TabIndex} from '@wireapp/react-ui-kit/lib/types/enums'; import {FadingScrollbar} from 'Components/FadingScrollbar'; import * as Icon from 'Components/Icon'; import {ServiceDetails} from 'Components/panel/ServiceDetails'; +import {IntegrationRepository} from 'Repositories/integration/IntegrationRepository'; +import {ServiceEntity} from 'Repositories/integration/ServiceEntity'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {handleKeyDown} from 'Util/KeyboardUtil'; import {t} from 'Util/LocalizerUtil'; import {Conversation} from '../../../entity/Conversation'; import {User} from '../../../entity/User'; -import {IntegrationRepository} from '../../../integration/IntegrationRepository'; -import {ServiceEntity} from '../../../integration/ServiceEntity'; import {generatePermissionHelpers} from '../../../user/UserPermission'; import {ActionsViewModel} from '../../../view_model/ActionsViewModel'; import {PanelHeader} from '../PanelHeader'; diff --git a/src/script/page/RightSidebar/GroupParticipantUser/GroupParticipantUser.tsx b/src/script/page/RightSidebar/GroupParticipantUser/GroupParticipantUser.tsx index ae0acf6cad1..48a526c2faf 100644 --- a/src/script/page/RightSidebar/GroupParticipantUser/GroupParticipantUser.tsx +++ b/src/script/page/RightSidebar/GroupParticipantUser/GroupParticipantUser.tsx @@ -33,13 +33,13 @@ import {UserDetails} from 'Components/panel/UserDetails'; import {BaseToggle} from 'Components/toggle/BaseToggle'; import {ConversationRoleRepository} from 'Repositories/conversation/ConversationRoleRepository'; import {MemberLeaveEvent, TeamMemberLeaveEvent} from 'Repositories/conversation/EventBuilder'; +import {ClientEvent} from 'Repositories/event/Client'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {handleKeyDown} from 'Util/KeyboardUtil'; import {t} from 'Util/LocalizerUtil'; import {Conversation} from '../../../entity/Conversation'; import {User} from '../../../entity/User'; -import {ClientEvent} from '../../../event/Client'; import {TeamRepository} from '../../../team/TeamRepository'; import {TeamState} from '../../../team/TeamState'; import {ActionsViewModel} from '../../../view_model/ActionsViewModel'; diff --git a/src/script/page/RightSidebar/RightSidebar.tsx b/src/script/page/RightSidebar/RightSidebar.tsx index 7c96d0b608f..dcc2bfb6e10 100644 --- a/src/script/page/RightSidebar/RightSidebar.tsx +++ b/src/script/page/RightSidebar/RightSidebar.tsx @@ -26,6 +26,7 @@ import {container} from 'tsyringe'; import {WebAppEvents} from '@wireapp/webapp-events'; import {ConversationState} from 'Repositories/conversation/ConversationState'; +import {ServiceEntity} from 'Repositories/integration/ServiceEntity'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {AddParticipants} from './AddParticipants'; @@ -45,7 +46,6 @@ import {User} from '../../entity/User'; import {isReadableMessage} from '../../guards/Message'; import {isUserEntity, isUserServiceEntity} from '../../guards/Panel'; import {isServiceEntity} from '../../guards/Service'; -import {ServiceEntity} from '../../integration/ServiceEntity'; import {Core} from '../../service/CoreSingleton'; import {TeamState} from '../../team/TeamState'; import {UserState} from '../../user/UserState'; diff --git a/src/script/page/components/WindowTitleUpdater.ts b/src/script/page/components/WindowTitleUpdater.ts index 0411e8f4d32..4284f57295f 100644 --- a/src/script/page/components/WindowTitleUpdater.ts +++ b/src/script/page/components/WindowTitleUpdater.ts @@ -25,12 +25,12 @@ import {container} from 'tsyringe'; import {WebAppEvents} from '@wireapp/webapp-events'; import {ConversationState} from 'Repositories/conversation/ConversationState'; +import {NOTIFICATION_HANDLING_STATE} from 'Repositories/event/NotificationHandlingState'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; import {getLogger} from 'Util/Logger'; import {Config} from '../../Config'; -import {NOTIFICATION_HANDLING_STATE} from '../../event/NotificationHandlingState'; import {UserState} from '../../user/UserState'; import {ContentState, useAppState} from '../useAppState'; diff --git a/src/script/repositories/assets/AssetMapper.ts b/src/script/repositories/assets/AssetMapper.ts index 4753dcb3112..a9e33e496e9 100644 --- a/src/script/repositories/assets/AssetMapper.ts +++ b/src/script/repositories/assets/AssetMapper.ts @@ -21,10 +21,10 @@ import type {Picture as APIClientPicture} from '@wireapp/api-client/lib/self/'; import {QualifiedId} from '@wireapp/api-client/lib/user'; import type {UserAsset as APIClientUserAsset} from '@wireapp/api-client/lib/user/'; -import {AssetRemoteData} from './AssetRemoteData'; +import type {ServiceEntity} from 'Repositories/integration/ServiceEntity'; import type {User} from '../../entity/User'; -import type {ServiceEntity} from '../../integration/ServiceEntity'; +import {AssetRemoteData} from './AssetRemoteData'; export type MappedAsset = {[index: string]: AssetRemoteData}; diff --git a/src/script/repositories/audio/AudioRepository.test.ts b/src/script/repositories/audio/AudioRepository.test.ts index d8c9f6522ca..988d77574f7 100644 --- a/src/script/repositories/audio/AudioRepository.test.ts +++ b/src/script/repositories/audio/AudioRepository.test.ts @@ -20,12 +20,12 @@ import {AudioPreference} from '@wireapp/api-client/lib/user/data/'; import {difference} from 'underscore'; +import {NOTIFICATION_HANDLING_STATE} from 'Repositories/event/NotificationHandlingState'; + import {AudioPlayingType} from './AudioPlayingType'; import {AudioRepository} from './AudioRepository'; import {AudioType} from './AudioType'; -import {NOTIFICATION_HANDLING_STATE} from '../../event/NotificationHandlingState'; - describe('AudioRepository', () => { const audioRepository = new AudioRepository(); diff --git a/src/script/repositories/audio/AudioRepository.ts b/src/script/repositories/audio/AudioRepository.ts index a8138e165c8..72244403409 100644 --- a/src/script/repositories/audio/AudioRepository.ts +++ b/src/script/repositories/audio/AudioRepository.ts @@ -23,15 +23,14 @@ import ko from 'knockout'; import {WebAppEvents} from '@wireapp/webapp-events'; +import {NOTIFICATION_HANDLING_STATE} from 'Repositories/event/NotificationHandlingState'; +import {MediaDevicesHandler} from 'Repositories/media/MediaDevicesHandler'; +import {MediaDeviceType} from 'Repositories/media/MediaDeviceType'; import {Logger, getLogger} from 'Util/Logger'; import {AudioPlayingType} from './AudioPlayingType'; import {AudioType} from './AudioType'; -import {NOTIFICATION_HANDLING_STATE} from '../../event/NotificationHandlingState'; -import {MediaDevicesHandler} from '../../media/MediaDevicesHandler'; -import {MediaDeviceType} from '../../media/MediaDeviceType'; - enum AUDIO_PLAY_PERMISSION { ALLOWED = 0, DISALLOWED_BY_MUTE_STATE = 3, diff --git a/src/script/repositories/backup/BackupRepository.test.ts b/src/script/repositories/backup/BackupRepository.test.ts index 07d7594e438..c8ff911e278 100644 --- a/src/script/repositories/backup/BackupRepository.test.ts +++ b/src/script/repositories/backup/BackupRepository.test.ts @@ -21,6 +21,7 @@ import {CONVERSATION_TYPE} from '@wireapp/api-client/lib/conversation'; import {container} from 'tsyringe'; import {omit} from 'underscore'; +import {ClientEvent} from 'Repositories/event/Client'; import {generateConversation} from 'test/helper/ConversationGenerator'; import {TestFactory} from 'test/helper/TestFactory'; import {generateAPIUser} from 'test/helper/UserGenerator'; @@ -35,7 +36,6 @@ import {CancelError, DifferentAccountError, IncompatiblePlatformError} from './E import {handleZipEvent} from './zipWorker'; import {User} from '../../entity/User'; -import {ClientEvent} from '../../event/Client'; import {DatabaseTypes, createStorageEngine} from '../../service/StoreEngineProvider'; import {StorageService} from '../../storage'; import {StorageSchemata} from '../../storage/StorageSchemata'; diff --git a/src/script/repositories/backup/BackupService.ts b/src/script/repositories/backup/BackupService.ts index 40bfa814346..8591e6b2435 100644 --- a/src/script/repositories/backup/BackupService.ts +++ b/src/script/repositories/backup/BackupService.ts @@ -21,9 +21,9 @@ import Dexie from 'dexie'; import DexieBatch from 'dexie-batch'; import {container} from 'tsyringe'; +import {CONVERSATION} from 'Repositories/event/Client'; import {Logger, getLogger} from 'Util/Logger'; -import {CONVERSATION} from '../../event/Client'; import {StorageService} from '../../storage'; export class BackupService { diff --git a/src/script/repositories/backup/recordPreprocessors.ts b/src/script/repositories/backup/recordPreprocessors.ts index bd7f51709e6..34334b65514 100644 --- a/src/script/repositories/backup/recordPreprocessors.ts +++ b/src/script/repositories/backup/recordPreprocessors.ts @@ -17,7 +17,8 @@ * */ -import {ClientEvent} from '../../event/Client'; +import {ClientEvent} from 'Repositories/event/Client'; + import {ConversationRecord, EventRecord, UserRecord} from '../../storage'; export function preprocessEvents(events: EventRecord[]): EventRecord[] { diff --git a/src/script/repositories/calling/Call.ts b/src/script/repositories/calling/Call.ts index 4c09855fda0..27308290d0a 100644 --- a/src/script/repositories/calling/Call.ts +++ b/src/script/repositories/calling/Call.ts @@ -22,6 +22,7 @@ import ko from 'knockout'; import {CALL_TYPE, CONV_TYPE, STATE as CALL_STATE} from '@wireapp/avs'; +import type {MediaDevicesHandler} from 'Repositories/media/MediaDevicesHandler'; import {chunk, getDifference, partition} from 'Util/ArrayUtil'; import {matchQualifiedIds} from 'Util/QualifiedId'; import {sortUsersByPriority} from 'Util/StringUtil'; @@ -31,7 +32,6 @@ import type {ClientId, Participant} from './Participant'; import {Config} from '../../Config'; import {Conversation} from '../../entity/Conversation'; -import type {MediaDevicesHandler} from '../../media/MediaDevicesHandler'; export type SerializedConversationId = string; diff --git a/src/script/repositories/calling/CallState.ts b/src/script/repositories/calling/CallState.ts index dddb6f87d5b..dfa3c1eced3 100644 --- a/src/script/repositories/calling/CallState.ts +++ b/src/script/repositories/calling/CallState.ts @@ -25,12 +25,12 @@ import {singleton} from 'tsyringe'; import {REASON as CALL_REASON, STATE as CALL_STATE} from '@wireapp/avs'; import {WebAppEvents} from '@wireapp/webapp-events'; +import type {ElectronDesktopCapturerSource} from 'Repositories/media/MediaDevicesHandler'; import {matchQualifiedIds} from 'Util/QualifiedId'; import {Call} from './Call'; import {Config} from '../../Config'; -import type {ElectronDesktopCapturerSource} from '../../media/MediaDevicesHandler'; import {EventName} from '../../tracking/EventName'; import {Segmentation} from '../../tracking/Segmentation'; import {CallViewTab} from '../../view_model/CallingViewModel'; diff --git a/src/script/repositories/calling/CallingRepository.test.ts b/src/script/repositories/calling/CallingRepository.test.ts index 5e78731fb57..7dba914216d 100644 --- a/src/script/repositories/calling/CallingRepository.test.ts +++ b/src/script/repositories/calling/CallingRepository.test.ts @@ -30,10 +30,13 @@ import {container} from 'tsyringe'; import {CONV_TYPE, CALL_TYPE, STATE as CALL_STATE, REASON, Wcall} from '@wireapp/avs'; import {Runtime} from '@wireapp/commons'; +import {CallingEvent} from 'Repositories/event/CallingEvent'; +import {CALL} from 'Repositories/event/Client'; +import {EventRepository} from 'Repositories/event/EventRepository'; +import {MediaDevicesHandler} from 'Repositories/media/MediaDevicesHandler'; +import {MediaType} from 'Repositories/media/MediaType'; import {Conversation} from 'src/script/entity/Conversation'; import {User} from 'src/script/entity/User'; -import {EventRepository} from 'src/script/event/EventRepository'; -import {MediaType} from 'src/script/media/MediaType'; import {serverTimeHandler} from 'src/script/time/serverTimeHandler'; import {TestFactory} from 'test/helper/TestFactory'; import {createUuid} from 'Util/uuid'; @@ -45,9 +48,6 @@ import {CALL_MESSAGE_TYPE} from './enum/CallMessageType'; import {LEAVE_CALL_REASON} from './enum/LeaveCallReason'; import {Participant} from './Participant'; -import {CallingEvent} from '../../event/CallingEvent'; -import {CALL} from '../../event/Client'; -import {MediaDevicesHandler} from '../../media/MediaDevicesHandler'; import {Core} from '../../service/CoreSingleton'; import {UserRepository} from '../../user/UserRepository'; diff --git a/src/script/repositories/calling/CallingRepository.ts b/src/script/repositories/calling/CallingRepository.ts index 9e23026943c..35a0ff40cc7 100644 --- a/src/script/repositories/calling/CallingRepository.ts +++ b/src/script/repositories/calling/CallingRepository.ts @@ -62,6 +62,12 @@ import {ConversationState} from 'Repositories/conversation/ConversationState'; import {ConversationVerificationState} from 'Repositories/conversation/ConversationVerificationState'; import {EventBuilder} from 'Repositories/conversation/EventBuilder'; import {CONSENT_TYPE, MessageRepository, MessageSendingOptions} from 'Repositories/conversation/MessageRepository'; +import {CallingEvent} from 'Repositories/event/CallingEvent'; +import {EventRepository} from 'Repositories/event/EventRepository'; +import {EventSource} from 'Repositories/event/EventSource'; +import type {MediaDevicesHandler} from 'Repositories/media/MediaDevicesHandler'; +import type {MediaStreamHandler} from 'Repositories/media/MediaStreamHandler'; +import {MediaType} from 'Repositories/media/MediaType'; import {flatten} from 'Util/ArrayUtil'; import {calculateChildWindowPosition} from 'Util/DOM/caculateChildWindowPosition'; import {isDetachedCallingFeatureEnabled} from 'Util/isDetachedCallingFeatureEnabled'; @@ -84,12 +90,6 @@ import {Config} from '../../Config'; import {Conversation} from '../../entity/Conversation'; import type {User} from '../../entity/User'; import {NoAudioInputError} from '../../error/NoAudioInputError'; -import {CallingEvent} from '../../event/CallingEvent'; -import {EventRepository} from '../../event/EventRepository'; -import {EventSource} from '../../event/EventSource'; -import type {MediaDevicesHandler} from '../../media/MediaDevicesHandler'; -import type {MediaStreamHandler} from '../../media/MediaStreamHandler'; -import {MediaType} from '../../media/MediaType'; import {APIClient} from '../../service/APIClientSingleton'; import {Core} from '../../service/CoreSingleton'; import {TeamState} from '../../team/TeamState'; diff --git a/src/script/repositories/calling/Participant.ts b/src/script/repositories/calling/Participant.ts index 9d3df695094..70fbace6875 100644 --- a/src/script/repositories/calling/Participant.ts +++ b/src/script/repositories/calling/Participant.ts @@ -22,10 +22,10 @@ import ko, {observable, pureComputed} from 'knockout'; import {VIDEO_STATE} from '@wireapp/avs'; +import {applyBlur} from 'Repositories/media/VideoBackgroundBlur'; import {matchQualifiedIds} from 'Util/QualifiedId'; import {User} from '../../entity/User'; -import {applyBlur} from '../../media/VideoBackgroundBlur'; export type UserId = string; export type ClientId = string; diff --git a/src/script/repositories/connection/ConnectionRepository.ts b/src/script/repositories/connection/ConnectionRepository.ts index 3a4abbd0c93..4c4ed414600 100644 --- a/src/script/repositories/connection/ConnectionRepository.ts +++ b/src/script/repositories/connection/ConnectionRepository.ts @@ -29,6 +29,8 @@ import {container} from 'tsyringe'; import {WebAppEvents} from '@wireapp/webapp-events'; import {PrimaryModal} from 'Components/Modals/PrimaryModal'; +import {EventRepository} from 'Repositories/event/EventRepository'; +import type {EventSource} from 'Repositories/event/EventSource'; import {replaceLink, t} from 'Util/LocalizerUtil'; import {getLogger, Logger} from 'Util/Logger'; import {matchQualifiedIds} from 'Util/QualifiedId'; @@ -43,8 +45,6 @@ import {Config} from '../../Config'; import type {Conversation} from '../../entity/Conversation'; import {MemberMessage} from '../../entity/message/MemberMessage'; import type {User} from '../../entity/User'; -import {EventRepository} from '../../event/EventRepository'; -import type {EventSource} from '../../event/EventSource'; import {SystemMessageType} from '../../message/SystemMessageType'; import type {UserRepository} from '../../user/UserRepository'; diff --git a/src/script/repositories/conversation/ConversationEphemeralHandler.ts b/src/script/repositories/conversation/ConversationEphemeralHandler.ts index 92e4006de47..d752e741a70 100644 --- a/src/script/repositories/conversation/ConversationEphemeralHandler.ts +++ b/src/script/repositories/conversation/ConversationEphemeralHandler.ts @@ -22,6 +22,7 @@ import ko from 'knockout'; import {Article, LinkPreview} from '@wireapp/protocol-messaging'; +import type {EventService} from 'Repositories/event/EventService'; import {getLogger, Logger} from 'Util/Logger'; import {clamp} from 'Util/NumberUtil'; import {obfuscate} from 'Util/StringUtil'; @@ -36,7 +37,6 @@ import type {ContentMessage} from '../../entity/message/ContentMessage'; import {MediumImage} from '../../entity/message/MediumImage'; import type {Message} from '../../entity/message/Message'; import {Text} from '../../entity/message/Text'; -import type {EventService} from '../../event/EventService'; import {EphemeralStatusType} from '../../message/EphemeralStatusType'; import {StatusType} from '../../message/StatusType'; import type {EventRecord} from '../../storage'; diff --git a/src/script/repositories/conversation/ConversationRepository.test.ts b/src/script/repositories/conversation/ConversationRepository.test.ts index fb480907ec7..037a7a276b1 100644 --- a/src/script/repositories/conversation/ConversationRepository.test.ts +++ b/src/script/repositories/conversation/ConversationRepository.test.ts @@ -54,14 +54,15 @@ import {CallingRepository} from 'Repositories/calling/CallingRepository'; import {ClientEntity} from 'Repositories/client/ClientEntity'; import {ConnectionEntity} from 'Repositories/connection/ConnectionEntity'; import {ConnectionRepository} from 'Repositories/connection/ConnectionRepository'; +import {ClientEvent, CONVERSATION} from 'Repositories/event/Client'; +import {EventRepository} from 'Repositories/event/EventRepository'; +import {EventService} from 'Repositories/event/EventService'; +import {NOTIFICATION_HANDLING_STATE} from 'Repositories/event/NotificationHandlingState'; import {Config} from 'src/script/Config'; import {Conversation} from 'src/script/entity/Conversation'; import {Message} from 'src/script/entity/message/Message'; import {User} from 'src/script/entity/User'; import {ConversationError} from 'src/script/error/ConversationError'; -import {ClientEvent, CONVERSATION} from 'src/script/event/Client'; -import {EventRepository} from 'src/script/event/EventRepository'; -import {NOTIFICATION_HANDLING_STATE} from 'src/script/event/NotificationHandlingState'; import {StorageSchemata} from 'src/script/storage/StorageSchemata'; import { generateConversation as _generateConversation, @@ -84,7 +85,6 @@ import {NOTIFICATION_STATE} from './NotificationSetting'; import {entities, payload} from '../../../../test/api/payloads'; import {TestFactory} from '../../../../test/helper/TestFactory'; import {generateUser} from '../../../../test/helper/UserGenerator'; -import {EventService} from '../../event/EventService'; import {SelfRepository} from '../../self/SelfRepository'; import {Core} from '../../service/CoreSingleton'; import {LegacyEventRecord, StorageService} from '../../storage'; diff --git a/src/script/repositories/conversation/ConversationRepository.ts b/src/script/repositories/conversation/ConversationRepository.ts index ece34b6e7e3..d4a26b6b472 100644 --- a/src/script/repositories/conversation/ConversationRepository.ts +++ b/src/script/repositories/conversation/ConversationRepository.ts @@ -66,6 +66,11 @@ import {LEAVE_CALL_REASON} from 'Repositories/calling/enum/LeaveCallReason'; import {ConnectionEntity} from 'Repositories/connection/ConnectionEntity'; import {ConnectionRepository} from 'Repositories/connection/ConnectionRepository'; import {ConnectionState} from 'Repositories/connection/ConnectionState'; +import {ClientEvent, CONVERSATION as CLIENT_CONVERSATION_EVENT} from 'Repositories/event/Client'; +import {EventRepository} from 'Repositories/event/EventRepository'; +import {EventService} from 'Repositories/event/EventService'; +import {EventSource} from 'Repositories/event/EventSource'; +import {NOTIFICATION_HANDLING_STATE} from 'Repositories/event/NotificationHandlingState'; import {getNextItem} from 'Util/ArrayUtil'; import {allowsAllFiles, getFileExtensionOrName, isAllowedFile} from 'Util/FileTypeUtil'; import {replaceLink, t} from 'Util/LocalizerUtil'; @@ -142,11 +147,6 @@ import {Message} from '../../entity/message/Message'; import {User} from '../../entity/User'; import {BaseError, BASE_ERROR_TYPE} from '../../error/BaseError'; import {ConversationError} from '../../error/ConversationError'; -import {ClientEvent, CONVERSATION as CLIENT_CONVERSATION_EVENT} from '../../event/Client'; -import {EventRepository} from '../../event/EventRepository'; -import {EventService} from '../../event/EventService'; -import {EventSource} from '../../event/EventSource'; -import {NOTIFICATION_HANDLING_STATE} from '../../event/NotificationHandlingState'; import {isMemberMessage} from '../../guards/Message'; import * as LegalHoldEvaluator from '../../legal-hold/LegalHoldEvaluator'; import {MessageCategory} from '../../message/MessageCategory'; diff --git a/src/script/repositories/conversation/ConversationService.ts b/src/script/repositories/conversation/ConversationService.ts index 1b6eab9f847..e8a4eb6b266 100644 --- a/src/script/repositories/conversation/ConversationService.ts +++ b/src/script/repositories/conversation/ConversationService.ts @@ -45,10 +45,11 @@ import type { import {QualifiedId} from '@wireapp/api-client/lib/user'; import {container} from 'tsyringe'; +import type {EventService} from 'Repositories/event/EventService'; + import {MLSCapableConversation} from './ConversationSelectors'; import type {Conversation as ConversationEntity} from '../../entity/Conversation'; -import type {EventService} from '../../event/EventService'; import {MessageCategory} from '../../message/MessageCategory'; import {search as fullTextSearch} from '../../search/FullTextSearch'; import {APIClient} from '../../service/APIClientSingleton'; diff --git a/src/script/repositories/conversation/EventBuilder.test.ts b/src/script/repositories/conversation/EventBuilder.test.ts index 6091a2b10bc..d04d1fdca12 100644 --- a/src/script/repositories/conversation/EventBuilder.test.ts +++ b/src/script/repositories/conversation/EventBuilder.test.ts @@ -19,9 +19,9 @@ import type {QualifiedId} from '@wireapp/api-client/lib/user/'; +import {ClientEvent} from 'Repositories/event/Client'; import {Conversation} from 'src/script/entity/Conversation'; import {User} from 'src/script/entity/User'; -import {ClientEvent} from 'src/script/event/Client'; import {SuperType} from 'src/script/message/SuperType'; import {VerificationMessageType} from 'src/script/message/VerificationMessageType'; import {createUuid} from 'Util/uuid'; diff --git a/src/script/repositories/conversation/EventBuilder.ts b/src/script/repositories/conversation/EventBuilder.ts index a6524beccd3..7938f796856 100644 --- a/src/script/repositories/conversation/EventBuilder.ts +++ b/src/script/repositories/conversation/EventBuilder.ts @@ -32,12 +32,12 @@ import type {REASON as AVS_REASON} from '@wireapp/avs'; import type {Asset, LegalHoldStatus} from '@wireapp/protocol-messaging'; import {AssetTransferState} from 'Repositories/assets/AssetTransferState'; +import {ClientEvent, CONVERSATION} from 'Repositories/event/Client'; import {createUuid} from 'Util/uuid'; import type {Conversation} from '../../entity/Conversation'; import type {Message} from '../../entity/message/Message'; import type {User} from '../../entity/User'; -import {ClientEvent, CONVERSATION} from '../../event/Client'; import {E2EIVerificationMessageType} from '../../message/E2EIVerificationMessageType'; import {StatusType} from '../../message/StatusType'; import {VerificationMessageType} from '../../message/VerificationMessageType'; diff --git a/src/script/repositories/conversation/EventMapper.ts b/src/script/repositories/conversation/EventMapper.ts index f3a2bf76bc8..5c2100b689a 100644 --- a/src/script/repositories/conversation/EventMapper.ts +++ b/src/script/repositories/conversation/EventMapper.ts @@ -26,6 +26,7 @@ import {AssetRemoteData} from 'Repositories/assets/AssetRemoteData'; import {AssetTransferState} from 'Repositories/assets/AssetTransferState'; import {TERMINATION_REASON} from 'Repositories/calling/enum/TerminationReason'; import {AssetData} from 'Repositories/cryptography/CryptographyMapper'; +import {ClientEvent} from 'Repositories/event/Client'; import {t} from 'Util/LocalizerUtil'; import {getLogger, Logger} from 'Util/Logger'; import {userReactionMapToReactionMap} from 'Util/ReactionUtil'; @@ -77,7 +78,6 @@ import {Text} from '../../entity/message/Text'; import type {Text as TextAsset} from '../../entity/message/Text'; import {VerificationMessage} from '../../entity/message/VerificationMessage'; import {ConversationError} from '../../error/ConversationError'; -import {ClientEvent} from '../../event/Client'; import {isContentMessage} from '../../guards/Message'; import {CALL_MESSAGE_TYPE} from '../../message/CallMessageType'; import {MentionEntity} from '../../message/MentionEntity'; diff --git a/src/script/repositories/conversation/MessageRepository.test.ts b/src/script/repositories/conversation/MessageRepository.test.ts index 3e9e923859b..07d06cd18c5 100644 --- a/src/script/repositories/conversation/MessageRepository.test.ts +++ b/src/script/repositories/conversation/MessageRepository.test.ts @@ -31,6 +31,8 @@ import {ClientEntity} from 'Repositories/client/ClientEntity'; import {ClientState} from 'Repositories/client/ClientState'; import {ConnectionEntity} from 'Repositories/connection/ConnectionEntity'; import {CryptographyRepository} from 'Repositories/cryptography/CryptographyRepository'; +import {EventRepository} from 'Repositories/event/EventRepository'; +import {EventService} from 'Repositories/event/EventService'; import {Conversation} from 'src/script/entity/Conversation'; import {Message} from 'src/script/entity/message/Message'; import {Text} from 'src/script/entity/message/Text'; @@ -44,8 +46,6 @@ import {ConversationState} from './ConversationState'; import {MessageRepository} from './MessageRepository'; import {ContentMessage} from '../../entity/message/ContentMessage'; -import {EventRepository} from '../../event/EventRepository'; -import {EventService} from '../../event/EventService'; import {StatusType} from '../../message/StatusType'; import {PropertiesRepository} from '../../properties/PropertiesRepository'; import {ReactionMap} from '../../storage'; diff --git a/src/script/repositories/conversation/MessageRepository.ts b/src/script/repositories/conversation/MessageRepository.ts index fc8d5797671..c18421b5bbb 100644 --- a/src/script/repositories/conversation/MessageRepository.ts +++ b/src/script/repositories/conversation/MessageRepository.ts @@ -59,6 +59,10 @@ import {AudioType} from 'Repositories/audio/AudioType'; import {ClientState} from 'Repositories/client/ClientState'; import {CryptographyRepository} from 'Repositories/cryptography/CryptographyRepository'; import {PROTO_MESSAGE_TYPE} from 'Repositories/cryptography/ProtoMessageType'; +import {EventRepository} from 'Repositories/event/EventRepository'; +import {EventService} from 'Repositories/event/EventService'; +import {EventTypeHandling} from 'Repositories/event/EventTypeHandling'; +import {NOTIFICATION_HANDLING_STATE} from 'Repositories/event/NotificationHandlingState'; import { cancelSendingLinkPreview, clearLinkPreviewSendingState, @@ -91,10 +95,6 @@ import {FileAsset} from '../../entity/message/FileAsset'; import {Message} from '../../entity/message/Message'; import {User} from '../../entity/User'; import {ConversationError} from '../../error/ConversationError'; -import {EventRepository} from '../../event/EventRepository'; -import {EventService} from '../../event/EventService'; -import {EventTypeHandling} from '../../event/EventTypeHandling'; -import {NOTIFICATION_HANDLING_STATE} from '../../event/NotificationHandlingState'; import {showLegalHoldWarningModal} from '../../legal-hold/LegalHoldWarning'; import {MentionEntity} from '../../message/MentionEntity'; import {QuoteEntity} from '../../message/QuoteEntity'; diff --git a/src/script/repositories/cryptography/CryptographyMapper.test.ts b/src/script/repositories/cryptography/CryptographyMapper.test.ts index 8061323ce23..d409dff6e6a 100644 --- a/src/script/repositories/cryptography/CryptographyMapper.test.ts +++ b/src/script/repositories/cryptography/CryptographyMapper.test.ts @@ -38,8 +38,8 @@ import { Text, } from '@wireapp/protocol-messaging'; +import {ClientEvent} from 'Repositories/event/Client'; import {CryptographyError} from 'src/script/error/CryptographyError'; -import {ClientEvent} from 'src/script/event/Client'; import {arrayToBase64} from 'Util/util'; import {createUuid} from 'Util/uuid'; diff --git a/src/script/repositories/cryptography/CryptographyMapper.ts b/src/script/repositories/cryptography/CryptographyMapper.ts index 8331a18c079..80228fd7f0e 100644 --- a/src/script/repositories/cryptography/CryptographyMapper.ts +++ b/src/script/repositories/cryptography/CryptographyMapper.ts @@ -57,12 +57,12 @@ import {CALL_MESSAGE_TYPE} from 'Repositories/calling/enum/CallMessageType'; import {ConversationEphemeralHandler} from 'Repositories/conversation/ConversationEphemeralHandler'; import {MessageAddEvent} from 'Repositories/conversation/EventBuilder'; import {PROTO_MESSAGE_TYPE} from 'Repositories/cryptography/ProtoMessageType'; +import {ClientEvent, CONVERSATION} from 'Repositories/event/Client'; import {getLogger, Logger} from 'Util/Logger'; import {TIME_IN_MILLIS} from 'Util/TimeUtil'; import {base64ToArray, arrayToBase64} from 'Util/util'; import {CryptographyError} from '../../error/CryptographyError'; -import {ClientEvent, CONVERSATION} from '../../event/Client'; import {StatusType} from '../../message/StatusType'; import {Core} from '../../service/CoreSingleton'; diff --git a/src/script/event/CallingEvent.ts b/src/script/repositories/event/CallingEvent.ts similarity index 100% rename from src/script/event/CallingEvent.ts rename to src/script/repositories/event/CallingEvent.ts diff --git a/src/script/event/Client.ts b/src/script/repositories/event/Client.ts similarity index 100% rename from src/script/event/Client.ts rename to src/script/repositories/event/Client.ts diff --git a/src/script/event/EventProcessor.ts b/src/script/repositories/event/EventProcessor.ts similarity index 100% rename from src/script/event/EventProcessor.ts rename to src/script/repositories/event/EventProcessor.ts diff --git a/src/script/event/EventRepository.test.ts b/src/script/repositories/event/EventRepository.test.ts similarity index 95% rename from src/script/event/EventRepository.test.ts rename to src/script/repositories/event/EventRepository.test.ts index 5c41a95411b..2eb8ee6c9c8 100644 --- a/src/script/event/EventRepository.test.ts +++ b/src/script/repositories/event/EventRepository.test.ts @@ -20,13 +20,13 @@ import {BackendEvent, CONVERSATION_EVENT, USER_EVENT} from '@wireapp/api-client/lib/event/'; import {ClientConversationEvent} from 'Repositories/conversation/EventBuilder'; -import {ClientEvent} from 'src/script/event/Client'; -import {EventRepository} from 'src/script/event/EventRepository'; -import {NOTIFICATION_HANDLING_STATE} from 'src/script/event/NotificationHandlingState'; +import {ClientEvent} from './Client'; +import {EventRepository} from './EventRepository'; import {EventSource} from './EventSource'; +import {NOTIFICATION_HANDLING_STATE} from './NotificationHandlingState'; -import {TestFactory} from '../../../test/helper/TestFactory'; +import {TestFactory} from '../../../../test/helper/TestFactory'; const testFactory = new TestFactory(); diff --git a/src/script/event/EventRepository.ts b/src/script/repositories/event/EventRepository.ts similarity index 98% rename from src/script/event/EventRepository.ts rename to src/script/repositories/event/EventRepository.ts index 93e41eb6da8..864472f538a 100644 --- a/src/script/event/EventRepository.ts +++ b/src/script/repositories/event/EventRepository.ts @@ -48,12 +48,12 @@ import {NOTIFICATION_HANDLING_STATE} from './NotificationHandlingState'; import type {NotificationService} from './NotificationService'; import {EventValidationError} from './preprocessor/EventStorageMiddleware/eventHandlers/EventValidationError'; -import {CryptographyError} from '../error/CryptographyError'; -import {EventError} from '../error/EventError'; -import type {ServerTimeHandler} from '../time/serverTimeHandler'; -import {EventName} from '../tracking/EventName'; -import {UserState} from '../user/UserState'; -import {Warnings} from '../view_model/WarningsContainer'; +import {CryptographyError} from '../../error/CryptographyError'; +import {EventError} from '../../error/EventError'; +import type {ServerTimeHandler} from '../../time/serverTimeHandler'; +import {EventName} from '../../tracking/EventName'; +import {UserState} from '../../user/UserState'; +import {Warnings} from '../../view_model/WarningsContainer'; export class EventRepository { logger: Logger; diff --git a/src/script/event/EventService.ts b/src/script/repositories/event/EventService.ts similarity index 97% rename from src/script/event/EventService.ts rename to src/script/repositories/event/EventService.ts index b8c574db557..26450536d30 100644 --- a/src/script/event/EventService.ts +++ b/src/script/repositories/event/EventService.ts @@ -29,13 +29,13 @@ import {getLogger, Logger} from 'Util/Logger'; import {ClientEvent, CONVERSATION as CLIENT_CONVERSATION_EVENT} from './Client'; -import {BaseError, BASE_ERROR_TYPE} from '../error/BaseError'; -import {ConversationError} from '../error/ConversationError'; -import {StorageError} from '../error/StorageError'; -import {categoryFromEvent} from '../message/MessageCategorization'; -import {MessageCategory} from '../message/MessageCategory'; -import {StorageService, DatabaseListenerCallback, LegacyEventRecord, EventRecord} from '../storage'; -import {StorageSchemata} from '../storage/StorageSchemata'; +import {BaseError, BASE_ERROR_TYPE} from '../../error/BaseError'; +import {ConversationError} from '../../error/ConversationError'; +import {StorageError} from '../../error/StorageError'; +import {categoryFromEvent} from '../../message/MessageCategorization'; +import {MessageCategory} from '../../message/MessageCategory'; +import {StorageService, DatabaseListenerCallback, LegacyEventRecord, EventRecord} from '../../storage'; +import {StorageSchemata} from '../../storage/StorageSchemata'; export type Includes = {includeFrom: boolean; includeTo: boolean}; type DexieCollection = Dexie.Collection; diff --git a/src/script/event/EventSource.ts b/src/script/repositories/event/EventSource.ts similarity index 100% rename from src/script/event/EventSource.ts rename to src/script/repositories/event/EventSource.ts diff --git a/src/script/event/EventType.ts b/src/script/repositories/event/EventType.ts similarity index 100% rename from src/script/event/EventType.ts rename to src/script/repositories/event/EventType.ts diff --git a/src/script/event/EventTypeHandling.ts b/src/script/repositories/event/EventTypeHandling.ts similarity index 100% rename from src/script/event/EventTypeHandling.ts rename to src/script/repositories/event/EventTypeHandling.ts diff --git a/src/script/event/EventValidation.ts b/src/script/repositories/event/EventValidation.ts similarity index 100% rename from src/script/event/EventValidation.ts rename to src/script/repositories/event/EventValidation.ts diff --git a/src/script/event/EventValidator.test.ts b/src/script/repositories/event/EventValidator.test.ts similarity index 100% rename from src/script/event/EventValidator.test.ts rename to src/script/repositories/event/EventValidator.test.ts diff --git a/src/script/event/EventValidator.ts b/src/script/repositories/event/EventValidator.ts similarity index 100% rename from src/script/event/EventValidator.ts rename to src/script/repositories/event/EventValidator.ts diff --git a/src/script/event/NotificationHandlingState.ts b/src/script/repositories/event/NotificationHandlingState.ts similarity index 100% rename from src/script/event/NotificationHandlingState.ts rename to src/script/repositories/event/NotificationHandlingState.ts diff --git a/src/script/event/NotificationService.ts b/src/script/repositories/event/NotificationService.ts similarity index 96% rename from src/script/event/NotificationService.ts rename to src/script/repositories/event/NotificationService.ts index 8a358869502..5f7d7e674d7 100644 --- a/src/script/event/NotificationService.ts +++ b/src/script/repositories/event/NotificationService.ts @@ -21,8 +21,8 @@ import type {NotificationList} from '@wireapp/api-client/lib/notification/'; import {DatabaseKeys} from '@wireapp/core/lib/notification/NotificationDatabaseRepository'; import {container} from 'tsyringe'; -import {APIClient} from '../service/APIClientSingleton'; -import {StorageSchemata, StorageService} from '../storage/'; +import {APIClient} from '../../service/APIClientSingleton'; +import {StorageSchemata, StorageService} from '../../storage/'; export class NotificationService { private readonly AMPLIFY_STORE_NAME: string; diff --git a/src/script/event/preprocessor/EventStorageMiddleware/EventStorageMiddleware.test.ts b/src/script/repositories/event/preprocessor/EventStorageMiddleware/EventStorageMiddleware.test.ts similarity index 100% rename from src/script/event/preprocessor/EventStorageMiddleware/EventStorageMiddleware.test.ts rename to src/script/repositories/event/preprocessor/EventStorageMiddleware/EventStorageMiddleware.test.ts diff --git a/src/script/event/preprocessor/EventStorageMiddleware/EventStorageMiddleware.ts b/src/script/repositories/event/preprocessor/EventStorageMiddleware/EventStorageMiddleware.ts similarity index 98% rename from src/script/event/preprocessor/EventStorageMiddleware/EventStorageMiddleware.ts rename to src/script/repositories/event/preprocessor/EventStorageMiddleware/EventStorageMiddleware.ts index 2d29fb9fec8..2a53f991785 100644 --- a/src/script/event/preprocessor/EventStorageMiddleware/EventStorageMiddleware.ts +++ b/src/script/repositories/event/preprocessor/EventStorageMiddleware/EventStorageMiddleware.ts @@ -29,8 +29,8 @@ import {handleLinkPreviewEvent, handleEditEvent, handleAssetEvent, handleReactio import {EventValidationError} from './eventHandlers/EventValidationError'; import {HandledEvents, DBOperation} from './types'; -import {isEventRecordFailed, isEventRecordWithFederationError} from '../../../message/StatusType'; -import type {EventRecord} from '../../../storage'; +import {isEventRecordFailed, isEventRecordWithFederationError} from '../../../../message/StatusType'; +import type {EventRecord} from '../../../../storage'; import {CONVERSATION} from '../../Client'; import {EventMiddleware, IncomingEvent} from '../../EventProcessor'; import {EventService} from '../../EventService'; diff --git a/src/script/event/preprocessor/EventStorageMiddleware/eventHandlers/EventValidationError.ts b/src/script/repositories/event/preprocessor/EventStorageMiddleware/eventHandlers/EventValidationError.ts similarity index 100% rename from src/script/event/preprocessor/EventStorageMiddleware/eventHandlers/EventValidationError.ts rename to src/script/repositories/event/preprocessor/EventStorageMiddleware/eventHandlers/EventValidationError.ts diff --git a/src/script/event/preprocessor/EventStorageMiddleware/eventHandlers/assetEventHandler.ts b/src/script/repositories/event/preprocessor/EventStorageMiddleware/eventHandlers/assetEventHandler.ts similarity index 100% rename from src/script/event/preprocessor/EventStorageMiddleware/eventHandlers/assetEventHandler.ts rename to src/script/repositories/event/preprocessor/EventStorageMiddleware/eventHandlers/assetEventHandler.ts diff --git a/src/script/event/preprocessor/EventStorageMiddleware/eventHandlers/editedEventHandler.ts b/src/script/repositories/event/preprocessor/EventStorageMiddleware/eventHandlers/editedEventHandler.ts similarity index 100% rename from src/script/event/preprocessor/EventStorageMiddleware/eventHandlers/editedEventHandler.ts rename to src/script/repositories/event/preprocessor/EventStorageMiddleware/eventHandlers/editedEventHandler.ts diff --git a/src/script/event/preprocessor/EventStorageMiddleware/eventHandlers/getCommonMessageUpdates.test.ts b/src/script/repositories/event/preprocessor/EventStorageMiddleware/eventHandlers/getCommonMessageUpdates.test.ts similarity index 100% rename from src/script/event/preprocessor/EventStorageMiddleware/eventHandlers/getCommonMessageUpdates.test.ts rename to src/script/repositories/event/preprocessor/EventStorageMiddleware/eventHandlers/getCommonMessageUpdates.test.ts diff --git a/src/script/event/preprocessor/EventStorageMiddleware/eventHandlers/getCommonMessageUpdates.ts b/src/script/repositories/event/preprocessor/EventStorageMiddleware/eventHandlers/getCommonMessageUpdates.ts similarity index 100% rename from src/script/event/preprocessor/EventStorageMiddleware/eventHandlers/getCommonMessageUpdates.ts rename to src/script/repositories/event/preprocessor/EventStorageMiddleware/eventHandlers/getCommonMessageUpdates.ts diff --git a/src/script/event/preprocessor/EventStorageMiddleware/eventHandlers/index.ts b/src/script/repositories/event/preprocessor/EventStorageMiddleware/eventHandlers/index.ts similarity index 100% rename from src/script/event/preprocessor/EventStorageMiddleware/eventHandlers/index.ts rename to src/script/repositories/event/preprocessor/EventStorageMiddleware/eventHandlers/index.ts diff --git a/src/script/event/preprocessor/EventStorageMiddleware/eventHandlers/linkPreviewEventHandler.ts b/src/script/repositories/event/preprocessor/EventStorageMiddleware/eventHandlers/linkPreviewEventHandler.ts similarity index 100% rename from src/script/event/preprocessor/EventStorageMiddleware/eventHandlers/linkPreviewEventHandler.ts rename to src/script/repositories/event/preprocessor/EventStorageMiddleware/eventHandlers/linkPreviewEventHandler.ts diff --git a/src/script/event/preprocessor/EventStorageMiddleware/eventHandlers/reactionEventHandler.test.ts b/src/script/repositories/event/preprocessor/EventStorageMiddleware/eventHandlers/reactionEventHandler.test.ts similarity index 100% rename from src/script/event/preprocessor/EventStorageMiddleware/eventHandlers/reactionEventHandler.test.ts rename to src/script/repositories/event/preprocessor/EventStorageMiddleware/eventHandlers/reactionEventHandler.test.ts diff --git a/src/script/event/preprocessor/EventStorageMiddleware/eventHandlers/reactionEventHandler.ts b/src/script/repositories/event/preprocessor/EventStorageMiddleware/eventHandlers/reactionEventHandler.ts similarity index 100% rename from src/script/event/preprocessor/EventStorageMiddleware/eventHandlers/reactionEventHandler.ts rename to src/script/repositories/event/preprocessor/EventStorageMiddleware/eventHandlers/reactionEventHandler.ts diff --git a/src/script/event/preprocessor/EventStorageMiddleware/index.ts b/src/script/repositories/event/preprocessor/EventStorageMiddleware/index.ts similarity index 100% rename from src/script/event/preprocessor/EventStorageMiddleware/index.ts rename to src/script/repositories/event/preprocessor/EventStorageMiddleware/index.ts diff --git a/src/script/event/preprocessor/EventStorageMiddleware/types.ts b/src/script/repositories/event/preprocessor/EventStorageMiddleware/types.ts similarity index 100% rename from src/script/event/preprocessor/EventStorageMiddleware/types.ts rename to src/script/repositories/event/preprocessor/EventStorageMiddleware/types.ts diff --git a/src/script/event/preprocessor/QuoteDecoderMiddleware.test.ts b/src/script/repositories/event/preprocessor/QuoteDecoderMiddleware.test.ts similarity index 100% rename from src/script/event/preprocessor/QuoteDecoderMiddleware.test.ts rename to src/script/repositories/event/preprocessor/QuoteDecoderMiddleware.test.ts diff --git a/src/script/event/preprocessor/QuoteDecoderMiddleware.ts b/src/script/repositories/event/preprocessor/QuoteDecoderMiddleware.ts similarity index 96% rename from src/script/event/preprocessor/QuoteDecoderMiddleware.ts rename to src/script/repositories/event/preprocessor/QuoteDecoderMiddleware.ts index f072201602b..5666e106bcc 100644 --- a/src/script/event/preprocessor/QuoteDecoderMiddleware.ts +++ b/src/script/repositories/event/preprocessor/QuoteDecoderMiddleware.ts @@ -23,8 +23,8 @@ import {MessageAddEvent} from 'Repositories/conversation/EventBuilder'; import {getLogger, Logger} from 'Util/Logger'; import {base64ToArray} from 'Util/util'; -import {QuoteEntity} from '../../message/QuoteEntity'; -import {StoredEvent} from '../../storage/record/EventRecord'; +import {QuoteEntity} from '../../../message/QuoteEntity'; +import {StoredEvent} from '../../../storage/record/EventRecord'; import {ClientEvent} from '../Client'; import {EventMiddleware, IncomingEvent} from '../EventProcessor'; import type {EventService} from '../EventService'; diff --git a/src/script/event/preprocessor/ReceiptsMiddleware.test.ts b/src/script/repositories/event/preprocessor/ReceiptsMiddleware.test.ts similarity index 98% rename from src/script/event/preprocessor/ReceiptsMiddleware.test.ts rename to src/script/repositories/event/preprocessor/ReceiptsMiddleware.test.ts index b97ed49570d..f443500b062 100644 --- a/src/script/event/preprocessor/ReceiptsMiddleware.test.ts +++ b/src/script/repositories/event/preprocessor/ReceiptsMiddleware.test.ts @@ -19,12 +19,13 @@ import {ConfirmationEvent} from 'Repositories/conversation/EventBuilder'; import {User} from 'src/script/entity/User'; -import {ClientEvent} from 'src/script/event/Client'; import {StatusType} from 'src/script/message/StatusType'; import {createUuid} from 'Util/uuid'; import {ReceiptsMiddleware} from './ReceiptsMiddleware'; +import {ClientEvent} from '../Client'; + function buildReadReceiptMiddleware() { const selfUser = new User(createUuid()); const eventService = {loadEvents: jest.fn(() => []), replaceEvent: jest.fn()} as any; diff --git a/src/script/event/preprocessor/ReceiptsMiddleware.ts b/src/script/repositories/event/preprocessor/ReceiptsMiddleware.ts similarity index 97% rename from src/script/event/preprocessor/ReceiptsMiddleware.ts rename to src/script/repositories/event/preprocessor/ReceiptsMiddleware.ts index 0441f66c3bb..165884e4a3b 100644 --- a/src/script/event/preprocessor/ReceiptsMiddleware.ts +++ b/src/script/repositories/event/preprocessor/ReceiptsMiddleware.ts @@ -24,8 +24,8 @@ import {ConfirmationEvent} from 'Repositories/conversation/EventBuilder'; import {User} from 'src/script/entity/User'; import {getLogger, Logger} from 'Util/Logger'; -import {StatusType} from '../../message/StatusType'; -import type {EventRecord} from '../../storage/record/EventRecord'; +import {StatusType} from '../../../message/StatusType'; +import type {EventRecord} from '../../../storage/record/EventRecord'; import {ClientEvent} from '../Client'; import {EventMiddleware, IncomingEvent} from '../EventProcessor'; import type {EventService} from '../EventService'; diff --git a/src/script/event/preprocessor/RepliesUpdaterMiddleware.test.ts b/src/script/repositories/event/preprocessor/RepliesUpdaterMiddleware.test.ts similarity index 98% rename from src/script/event/preprocessor/RepliesUpdaterMiddleware.test.ts rename to src/script/repositories/event/preprocessor/RepliesUpdaterMiddleware.test.ts index af2993e6de2..923b3ccd205 100644 --- a/src/script/event/preprocessor/RepliesUpdaterMiddleware.test.ts +++ b/src/script/repositories/event/preprocessor/RepliesUpdaterMiddleware.test.ts @@ -19,13 +19,13 @@ import {Conversation} from 'src/script/entity/Conversation'; import {User} from 'src/script/entity/User'; -import {ClientEvent} from 'src/script/event/Client'; import {QuoteEntity} from 'src/script/message/QuoteEntity'; import {createMessageAddEvent, toSavedEvent} from 'test/helper/EventGenerator'; import {createUuid} from 'Util/uuid'; import {RepliesUpdaterMiddleware} from './RepliesUpdaterMiddleware'; +import {ClientEvent} from '../Client'; import {EventService} from '../EventService'; function buildRepliesUpdaterMiddleware() { diff --git a/src/script/event/preprocessor/RepliesUpdaterMiddleware.ts b/src/script/repositories/event/preprocessor/RepliesUpdaterMiddleware.ts similarity index 96% rename from src/script/event/preprocessor/RepliesUpdaterMiddleware.ts rename to src/script/repositories/event/preprocessor/RepliesUpdaterMiddleware.ts index 9efc233f7dc..a108effeb72 100644 --- a/src/script/event/preprocessor/RepliesUpdaterMiddleware.ts +++ b/src/script/repositories/event/preprocessor/RepliesUpdaterMiddleware.ts @@ -20,8 +20,8 @@ import {DeleteEvent, MessageAddEvent} from 'Repositories/conversation/EventBuilder'; import {getLogger, Logger} from 'Util/Logger'; -import {QuoteEntity} from '../../message/QuoteEntity'; -import {StoredEvent} from '../../storage/record/EventRecord'; +import {QuoteEntity} from '../../../message/QuoteEntity'; +import {StoredEvent} from '../../../storage/record/EventRecord'; import {ClientEvent} from '../Client'; import {EventMiddleware, IncomingEvent} from '../EventProcessor'; import type {EventService} from '../EventService'; diff --git a/src/script/event/preprocessor/ServiceMiddleware.test.ts b/src/script/repositories/event/preprocessor/ServiceMiddleware.test.ts similarity index 100% rename from src/script/event/preprocessor/ServiceMiddleware.test.ts rename to src/script/repositories/event/preprocessor/ServiceMiddleware.test.ts diff --git a/src/script/event/preprocessor/ServiceMiddleware.ts b/src/script/repositories/event/preprocessor/ServiceMiddleware.ts similarity index 98% rename from src/script/event/preprocessor/ServiceMiddleware.ts rename to src/script/repositories/event/preprocessor/ServiceMiddleware.ts index 31488653245..a8239c0af8e 100644 --- a/src/script/event/preprocessor/ServiceMiddleware.ts +++ b/src/script/repositories/event/preprocessor/ServiceMiddleware.ts @@ -26,7 +26,7 @@ import {User} from 'src/script/entity/User'; import {getLogger, Logger} from 'Util/Logger'; import {matchQualifiedIds} from 'Util/QualifiedId'; -import type {UserRepository} from '../../user/UserRepository'; +import type {UserRepository} from '../../../user/UserRepository'; import {ClientEvent} from '../Client'; import {EventMiddleware, IncomingEvent} from '../EventProcessor'; diff --git a/src/script/event/processor/FederationEventProcessor/ConversationFederationUtils.test.ts b/src/script/repositories/event/processor/FederationEventProcessor/ConversationFederationUtils.test.ts similarity index 99% rename from src/script/event/processor/FederationEventProcessor/ConversationFederationUtils.test.ts rename to src/script/repositories/event/processor/FederationEventProcessor/ConversationFederationUtils.test.ts index bbc27636a3e..48dd0b8690f 100644 --- a/src/script/event/processor/FederationEventProcessor/ConversationFederationUtils.test.ts +++ b/src/script/repositories/event/processor/FederationEventProcessor/ConversationFederationUtils.test.ts @@ -29,7 +29,7 @@ import { FederationConnectionRemovedResult, } from './ConversationFederationUtils'; -import {Conversation} from '../../../entity/Conversation'; +import {Conversation} from '../../../../entity/Conversation'; describe('ConversationFederationUtils', () => { describe('getFederationDeleteEventUpdates', () => { diff --git a/src/script/event/processor/FederationEventProcessor/ConversationFederationUtils.ts b/src/script/repositories/event/processor/FederationEventProcessor/ConversationFederationUtils.ts similarity index 97% rename from src/script/event/processor/FederationEventProcessor/ConversationFederationUtils.ts rename to src/script/repositories/event/processor/FederationEventProcessor/ConversationFederationUtils.ts index 56f7268923f..5931bc5e4af 100644 --- a/src/script/event/processor/FederationEventProcessor/ConversationFederationUtils.ts +++ b/src/script/repositories/event/processor/FederationEventProcessor/ConversationFederationUtils.ts @@ -17,8 +17,8 @@ * */ -import {Conversation} from '../../../entity/Conversation'; -import {User} from '../../../entity/User'; +import {Conversation} from '../../../../entity/Conversation'; +import {User} from '../../../../entity/User'; export interface FederationDeleteResult { /** diff --git a/src/script/event/processor/FederationEventProcessor/FederationEventProcessor.ts b/src/script/repositories/event/processor/FederationEventProcessor/FederationEventProcessor.ts similarity index 100% rename from src/script/event/processor/FederationEventProcessor/FederationEventProcessor.ts rename to src/script/repositories/event/processor/FederationEventProcessor/FederationEventProcessor.ts diff --git a/src/script/event/processor/FederationEventProcessor/index.ts b/src/script/repositories/event/processor/FederationEventProcessor/index.ts similarity index 100% rename from src/script/event/processor/FederationEventProcessor/index.ts rename to src/script/repositories/event/processor/FederationEventProcessor/index.ts diff --git a/src/script/integration/IntegrationMapper.ts b/src/script/repositories/integration/IntegrationMapper.ts similarity index 100% rename from src/script/integration/IntegrationMapper.ts rename to src/script/repositories/integration/IntegrationMapper.ts diff --git a/src/script/integration/IntegrationRepository.ts b/src/script/repositories/integration/IntegrationRepository.ts similarity index 97% rename from src/script/integration/IntegrationRepository.ts rename to src/script/repositories/integration/IntegrationRepository.ts index 6e57b2b245d..3fb1c7e82b3 100644 --- a/src/script/integration/IntegrationRepository.ts +++ b/src/script/repositories/integration/IntegrationRepository.ts @@ -32,10 +32,10 @@ import type {IntegrationService} from './IntegrationService'; import {ProviderEntity} from './ProviderEntity'; import {ServiceEntity} from './ServiceEntity'; -import type {Conversation} from '../entity/Conversation'; -import type {User} from '../entity/User'; -import type {TeamRepository} from '../team/TeamRepository'; -import {TeamState} from '../team/TeamState'; +import type {Conversation} from '../../entity/Conversation'; +import type {User} from '../../entity/User'; +import type {TeamRepository} from '../../team/TeamRepository'; +import {TeamState} from '../../team/TeamState'; export class IntegrationRepository { private readonly logger: Logger; diff --git a/src/script/integration/IntegrationService.ts b/src/script/repositories/integration/IntegrationService.ts similarity index 95% rename from src/script/integration/IntegrationService.ts rename to src/script/repositories/integration/IntegrationService.ts index 806d95cd3ec..316f0f4fffb 100644 --- a/src/script/integration/IntegrationService.ts +++ b/src/script/repositories/integration/IntegrationService.ts @@ -20,7 +20,7 @@ import type {Provider, Service} from '@wireapp/api-client/lib/team/service/'; import {container} from 'tsyringe'; -import {APIClient} from '../service/APIClientSingleton'; +import {APIClient} from '../../service/APIClientSingleton'; export class IntegrationService { constructor(private readonly apiClient = container.resolve(APIClient)) {} diff --git a/src/script/integration/ProviderEntity.ts b/src/script/repositories/integration/ProviderEntity.ts similarity index 100% rename from src/script/integration/ProviderEntity.ts rename to src/script/repositories/integration/ProviderEntity.ts diff --git a/src/script/integration/ServiceEntity.ts b/src/script/repositories/integration/ServiceEntity.ts similarity index 100% rename from src/script/integration/ServiceEntity.ts rename to src/script/repositories/integration/ServiceEntity.ts diff --git a/src/script/integration/ServiceTag.ts b/src/script/repositories/integration/ServiceTag.ts similarity index 100% rename from src/script/integration/ServiceTag.ts rename to src/script/repositories/integration/ServiceTag.ts diff --git a/src/script/media/BackgroundBlurrer/BackgroundBlurrer.ts b/src/script/repositories/media/BackgroundBlurrer/BackgroundBlurrer.ts similarity index 100% rename from src/script/media/BackgroundBlurrer/BackgroundBlurrer.ts rename to src/script/repositories/media/BackgroundBlurrer/BackgroundBlurrer.ts diff --git a/src/script/media/BackgroundBlurrer/fragmentShader.glsl b/src/script/repositories/media/BackgroundBlurrer/fragmentShader.glsl similarity index 100% rename from src/script/media/BackgroundBlurrer/fragmentShader.glsl rename to src/script/repositories/media/BackgroundBlurrer/fragmentShader.glsl diff --git a/src/script/media/BackgroundBlurrer/index.ts b/src/script/repositories/media/BackgroundBlurrer/index.ts similarity index 100% rename from src/script/media/BackgroundBlurrer/index.ts rename to src/script/repositories/media/BackgroundBlurrer/index.ts diff --git a/src/script/media/BackgroundBlurrer/vertexShader.glsl b/src/script/repositories/media/BackgroundBlurrer/vertexShader.glsl similarity index 100% rename from src/script/media/BackgroundBlurrer/vertexShader.glsl rename to src/script/repositories/media/BackgroundBlurrer/vertexShader.glsl diff --git a/src/script/media/MediaConstraintsHandler.test.ts b/src/script/repositories/media/MediaConstraintsHandler.test.ts similarity index 98% rename from src/script/media/MediaConstraintsHandler.test.ts rename to src/script/repositories/media/MediaConstraintsHandler.test.ts index b8e9d918b39..d85f4bd6e7c 100644 --- a/src/script/media/MediaConstraintsHandler.test.ts +++ b/src/script/repositories/media/MediaConstraintsHandler.test.ts @@ -24,8 +24,8 @@ import {createUuid} from 'Util/uuid'; import {MediaConstraintsHandler, ScreensharingMethods} from './MediaConstraintsHandler'; import {CurrentAvailableDeviceId} from './MediaDevicesHandler'; -import {User} from '../entity/User'; -import {UserState} from '../user/UserState'; +import {User} from '../../entity/User'; +import {UserState} from '../../user/UserState'; describe('MediaConstraintsHandler', () => { const createAvailableDevices = (deviceId?: string): CurrentAvailableDeviceId => ({ diff --git a/src/script/media/MediaConstraintsHandler.ts b/src/script/repositories/media/MediaConstraintsHandler.ts similarity index 99% rename from src/script/media/MediaConstraintsHandler.ts rename to src/script/repositories/media/MediaConstraintsHandler.ts index 5b0fadbc889..1ed5e81d8e0 100644 --- a/src/script/media/MediaConstraintsHandler.ts +++ b/src/script/repositories/media/MediaConstraintsHandler.ts @@ -24,7 +24,7 @@ import {Logger, getLogger} from 'Util/Logger'; import type {CurrentAvailableDeviceId} from './MediaDevicesHandler'; import {VIDEO_QUALITY_MODE} from './VideoQualityMode'; -import {UserState} from '../user/UserState'; +import {UserState} from '../../user/UserState'; interface Config { CONSTRAINTS: { diff --git a/src/script/media/MediaDeviceType.ts b/src/script/repositories/media/MediaDeviceType.ts similarity index 100% rename from src/script/media/MediaDeviceType.ts rename to src/script/repositories/media/MediaDeviceType.ts diff --git a/src/script/media/MediaDevicesHandler.test.ts b/src/script/repositories/media/MediaDevicesHandler.test.ts similarity index 100% rename from src/script/media/MediaDevicesHandler.test.ts rename to src/script/repositories/media/MediaDevicesHandler.test.ts diff --git a/src/script/media/MediaDevicesHandler.ts b/src/script/repositories/media/MediaDevicesHandler.ts similarity index 99% rename from src/script/media/MediaDevicesHandler.ts rename to src/script/repositories/media/MediaDevicesHandler.ts index 00912a5ba9c..3e97d4c81af 100644 --- a/src/script/media/MediaDevicesHandler.ts +++ b/src/script/repositories/media/MediaDevicesHandler.ts @@ -26,7 +26,7 @@ import {loadValue, storeValue} from 'Util/StorageUtil'; import {MediaDeviceType} from './MediaDeviceType'; -import {isMediaDevice} from '../guards/MediaDevice'; +import {isMediaDevice} from '../../guards/MediaDevice'; declare global { interface Window { diff --git a/src/script/media/MediaEmbeds.test.ts b/src/script/repositories/media/MediaEmbeds.test.ts similarity index 99% rename from src/script/media/MediaEmbeds.test.ts rename to src/script/repositories/media/MediaEmbeds.test.ts index b598e9bde41..9cb81517950 100644 --- a/src/script/media/MediaEmbeds.test.ts +++ b/src/script/repositories/media/MediaEmbeds.test.ts @@ -20,8 +20,9 @@ import type {TypeUtil} from '@wireapp/commons'; import {Configuration, Config} from 'src/script/Config'; -import {MediaEmbeds} from 'src/script/media/MediaEmbeds'; -import {MediaParser} from 'src/script/media/MediaParser'; + +import {MediaEmbeds} from './MediaEmbeds'; +import {MediaParser} from './MediaParser'; describe('MediaEmbeds', () => { // Will test all common link variations diff --git a/src/script/media/MediaEmbeds.ts b/src/script/repositories/media/MediaEmbeds.ts similarity index 100% rename from src/script/media/MediaEmbeds.ts rename to src/script/repositories/media/MediaEmbeds.ts diff --git a/src/script/media/MediaParser.ts b/src/script/repositories/media/MediaParser.ts similarity index 98% rename from src/script/media/MediaParser.ts rename to src/script/repositories/media/MediaParser.ts index fe9db0caf73..3a6113730c9 100644 --- a/src/script/media/MediaParser.ts +++ b/src/script/repositories/media/MediaParser.ts @@ -26,7 +26,7 @@ import {getLinksFromHtml} from 'Util/UrlUtil'; import {MediaEmbeds} from './MediaEmbeds'; -import {Config} from '../Config'; +import {Config} from '../../Config'; export class MediaParser { showEmbed: boolean; diff --git a/src/script/media/MediaRepository.ts b/src/script/repositories/media/MediaRepository.ts similarity index 94% rename from src/script/media/MediaRepository.ts rename to src/script/repositories/media/MediaRepository.ts index c87d9f02584..997c2fe7db2 100644 --- a/src/script/media/MediaRepository.ts +++ b/src/script/repositories/media/MediaRepository.ts @@ -21,7 +21,7 @@ import {MediaConstraintsHandler} from './MediaConstraintsHandler'; import {MediaDevicesHandler} from './MediaDevicesHandler'; import {MediaStreamHandler} from './MediaStreamHandler'; -import type {PermissionRepository} from '../permission/PermissionRepository'; +import type {PermissionRepository} from '../../permission/PermissionRepository'; export class MediaRepository { public constraintsHandler: MediaConstraintsHandler; diff --git a/src/script/media/MediaStreamError.ts b/src/script/repositories/media/MediaStreamError.ts similarity index 100% rename from src/script/media/MediaStreamError.ts rename to src/script/repositories/media/MediaStreamError.ts diff --git a/src/script/media/MediaStreamErrorTypes.test.ts b/src/script/repositories/media/MediaStreamErrorTypes.test.ts similarity index 100% rename from src/script/media/MediaStreamErrorTypes.test.ts rename to src/script/repositories/media/MediaStreamErrorTypes.test.ts diff --git a/src/script/media/MediaStreamErrorTypes.ts b/src/script/repositories/media/MediaStreamErrorTypes.ts similarity index 100% rename from src/script/media/MediaStreamErrorTypes.ts rename to src/script/repositories/media/MediaStreamErrorTypes.ts diff --git a/src/script/media/MediaStreamHandler.test.ts b/src/script/repositories/media/MediaStreamHandler.test.ts similarity index 93% rename from src/script/media/MediaStreamHandler.test.ts rename to src/script/repositories/media/MediaStreamHandler.test.ts index 187e7b7273e..ca7f070f590 100644 --- a/src/script/media/MediaStreamHandler.test.ts +++ b/src/script/repositories/media/MediaStreamHandler.test.ts @@ -17,13 +17,13 @@ * */ -import {MediaConstraintsHandler} from 'src/script/media/MediaConstraintsHandler'; -import {MediaStreamHandler} from 'src/script/media/MediaStreamHandler'; import {PermissionRepository} from 'src/script/permission/PermissionRepository'; +import {MediaConstraintsHandler} from './MediaConstraintsHandler'; import {CurrentAvailableDeviceId} from './MediaDevicesHandler'; +import {MediaStreamHandler} from './MediaStreamHandler'; -import {UserState} from '../user/UserState'; +import {UserState} from '../../user/UserState'; describe('MediaStreamHandler', () => { let streamHandler: MediaStreamHandler; diff --git a/src/script/media/MediaStreamHandler.ts b/src/script/repositories/media/MediaStreamHandler.ts similarity index 95% rename from src/script/media/MediaStreamHandler.ts rename to src/script/repositories/media/MediaStreamHandler.ts index 30ac8913e7f..45c069b7442 100644 --- a/src/script/media/MediaStreamHandler.ts +++ b/src/script/repositories/media/MediaStreamHandler.ts @@ -29,13 +29,13 @@ import {MEDIA_STREAM_ERROR} from './MediaStreamError'; import {isMediaStreamReadDeviceError, MEDIA_STREAM_ERROR_TYPES} from './MediaStreamErrorTypes'; import {MediaType} from './MediaType'; -import {MediaError} from '../error/MediaError'; -import {NoAudioInputError} from '../error/NoAudioInputError'; -import {PermissionError} from '../error/PermissionError'; -import type {PermissionRepository} from '../permission/PermissionRepository'; -import {PermissionStatusState} from '../permission/PermissionStatusState'; -import {PermissionType} from '../permission/PermissionType'; -import {Warnings} from '../view_model/WarningsContainer'; +import {MediaError} from '../../error/MediaError'; +import {NoAudioInputError} from '../../error/NoAudioInputError'; +import {PermissionError} from '../../error/PermissionError'; +import type {PermissionRepository} from '../../permission/PermissionRepository'; +import {PermissionStatusState} from '../../permission/PermissionStatusState'; +import {PermissionType} from '../../permission/PermissionType'; +import {Warnings} from '../../view_model/WarningsContainer'; export class MediaStreamHandler { static get CONFIG() { diff --git a/src/script/media/MediaType.ts b/src/script/repositories/media/MediaType.ts similarity index 100% rename from src/script/media/MediaType.ts rename to src/script/repositories/media/MediaType.ts diff --git a/src/script/media/VideoBackgroundBlur.ts b/src/script/repositories/media/VideoBackgroundBlur.ts similarity index 100% rename from src/script/media/VideoBackgroundBlur.ts rename to src/script/repositories/media/VideoBackgroundBlur.ts diff --git a/src/script/media/VideoQualityMode.ts b/src/script/repositories/media/VideoQualityMode.ts similarity index 100% rename from src/script/media/VideoQualityMode.ts rename to src/script/repositories/media/VideoQualityMode.ts diff --git a/src/script/self/SelfRepository.ts b/src/script/self/SelfRepository.ts index c4c491b1de6..df90634a52a 100644 --- a/src/script/self/SelfRepository.ts +++ b/src/script/self/SelfRepository.ts @@ -27,13 +27,13 @@ import {TypedEventEmitter} from '@wireapp/commons'; import {WebAppEvents} from '@wireapp/webapp-events'; import {ClientEntity, ClientRepository} from 'Repositories/client'; +import {EventSource} from 'Repositories/event/EventSource'; import {Logger, getLogger} from 'Util/Logger'; import {TIME_IN_MILLIS} from 'Util/TimeUtil'; import {SelfService} from './SelfService'; import {evaluateSelfSupportedProtocols} from './SelfSupportedProtocols/SelfSupportedProtocols'; -import {EventSource} from '../event/EventSource'; import {Core} from '../service/CoreSingleton'; import { FeatureUpdateType, diff --git a/src/script/team/TeamRepository.ts b/src/script/team/TeamRepository.ts index 736dbb591d3..2d37227e7fa 100644 --- a/src/script/team/TeamRepository.ts +++ b/src/script/team/TeamRepository.ts @@ -38,6 +38,10 @@ import {Availability} from '@wireapp/protocol-messaging'; import {WebAppEvents} from '@wireapp/webapp-events'; import {AssetRepository} from 'Repositories/assets/AssetRepository'; +import {EventSource} from 'Repositories/event/EventSource'; +import {NOTIFICATION_HANDLING_STATE} from 'Repositories/event/NotificationHandlingState'; +import {IntegrationMapper} from 'Repositories/integration/IntegrationMapper'; +import {ServiceEntity} from 'Repositories/integration/ServiceEntity'; import {Environment} from 'Util/Environment'; import {t} from 'Util/LocalizerUtil'; import {getLogger, Logger} from 'Util/Logger'; @@ -51,10 +55,6 @@ import {TeamService} from './TeamService'; import {TeamState} from './TeamState'; import {User} from '../entity/User'; -import {EventSource} from '../event/EventSource'; -import {NOTIFICATION_HANDLING_STATE} from '../event/NotificationHandlingState'; -import {IntegrationMapper} from '../integration/IntegrationMapper'; -import {ServiceEntity} from '../integration/ServiceEntity'; import {MLSMigrationStatus, getMLSMigrationStatus} from '../mls/MLSMigration/migrationStatus'; import {ROLE, ROLE as TEAM_ROLE, roleFromTeamPermissions} from '../user/UserPermission'; import {UserRepository} from '../user/UserRepository'; diff --git a/src/script/tracking/EventTrackingRepository.ts b/src/script/tracking/EventTrackingRepository.ts index 4b1c9681d57..c8ca7b372fe 100644 --- a/src/script/tracking/EventTrackingRepository.ts +++ b/src/script/tracking/EventTrackingRepository.ts @@ -23,6 +23,7 @@ import {container} from 'tsyringe'; import {WebAppEvents} from '@wireapp/webapp-events'; import type {ContributedSegmentations, MessageRepository} from 'Repositories/conversation/MessageRepository'; +import {ClientEvent} from 'Repositories/event/Client'; import {getLogger, Logger} from 'Util/Logger'; import {loadValue, storeValue, resetStoreValue} from 'Util/StorageUtil'; import {includesString} from 'Util/StringUtil'; @@ -41,7 +42,6 @@ import {UserData} from './UserData'; import {URLParameter} from '../auth/URLParameter'; import {Config} from '../Config'; -import {ClientEvent} from '../event/Client'; import {TeamState} from '../team/TeamState'; const CountlyConsentFeatures = [ diff --git a/src/script/user/UserRepository.test.ts b/src/script/user/UserRepository.test.ts index 023d246dd9b..d268683c4eb 100644 --- a/src/script/user/UserRepository.test.ts +++ b/src/script/user/UserRepository.test.ts @@ -32,6 +32,7 @@ import {AssetRepository} from 'Repositories/assets/AssetRepository'; import {ClientRepository} from 'Repositories/client'; import {ClientMapper} from 'Repositories/client/ClientMapper'; import {ConnectionEntity} from 'Repositories/connection/ConnectionEntity'; +import {EventRepository} from 'Repositories/event/EventRepository'; import {entities} from 'test/api/payloads'; import {TestFactory} from 'test/helper/TestFactory'; import {generateAPIUser} from 'test/helper/UserGenerator'; @@ -43,7 +44,6 @@ import {UserService} from './UserService'; import {UserState} from './UserState'; import {User} from '../entity/User'; -import {EventRepository} from '../event/EventRepository'; import {PropertiesRepository} from '../properties/PropertiesRepository'; import {SelfService} from '../self/SelfService'; import {TeamState} from '../team/TeamState'; diff --git a/src/script/user/UserRepository.ts b/src/script/user/UserRepository.ts index a1a178c8878..9db70119987 100644 --- a/src/script/user/UserRepository.ts +++ b/src/script/user/UserRepository.ts @@ -52,6 +52,9 @@ import {ClientEntity} from 'Repositories/client/ClientEntity'; import {ClientMapper} from 'Repositories/client/ClientMapper'; import type {ConnectionEntity} from 'Repositories/connection/ConnectionEntity'; import {flattenUserClientsQualifiedIds} from 'Repositories/conversation/userClientsUtils'; +import {USER} from 'Repositories/event/Client'; +import {EventRepository} from 'Repositories/event/EventRepository'; +import type {EventSource} from 'Repositories/event/EventSource'; import {chunk, partition} from 'Util/ArrayUtil'; import {t} from 'Util/LocalizerUtil'; import {getLogger, Logger} from 'Util/Logger'; @@ -70,9 +73,6 @@ import {Config} from '../Config'; import {Conversation} from '../entity/Conversation'; import {User} from '../entity/User'; import {UserError} from '../error/UserError'; -import {USER} from '../event/Client'; -import {EventRepository} from '../event/EventRepository'; -import type {EventSource} from '../event/EventSource'; import type {PropertiesRepository} from '../properties/PropertiesRepository'; import {PROPERTIES_TYPE} from '../properties/PropertiesType'; import type {SelfService} from '../self/SelfService'; diff --git a/src/script/util/DebugUtil.ts b/src/script/util/DebugUtil.ts index 6c085f2d74a..728f4afe41e 100644 --- a/src/script/util/DebugUtil.ts +++ b/src/script/util/DebugUtil.ts @@ -48,6 +48,7 @@ import {ConversationRepository} from 'Repositories/conversation/ConversationRepo import {isMLSCapableConversation} from 'Repositories/conversation/ConversationSelectors'; import {ConversationState} from 'Repositories/conversation/ConversationState'; import type {MessageRepository} from 'Repositories/conversation/MessageRepository'; +import {EventRepository} from 'Repositories/event/EventRepository'; import {getLogger, Logger} from 'Util/Logger'; import {KEY} from './KeyboardUtil'; @@ -57,7 +58,6 @@ import {createUuid} from './uuid'; import {E2EIHandler} from '../E2EIdentity'; import {Conversation} from '../entity/Conversation'; import {User} from '../entity/User'; -import {EventRepository} from '../event/EventRepository'; import {checkVersion} from '../lifecycle/newVersionHandler'; import {PropertiesRepository} from '../properties/PropertiesRepository'; import {PROPERTIES_TYPE} from '../properties/PropertiesType'; diff --git a/src/script/view_model/ActionsViewModel.ts b/src/script/view_model/ActionsViewModel.ts index b78bf511028..12ecd77b346 100644 --- a/src/script/view_model/ActionsViewModel.ts +++ b/src/script/view_model/ActionsViewModel.ts @@ -31,6 +31,8 @@ import type {ConnectionRepository} from 'Repositories/connection/ConnectionRepos import type {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; import type {MessageRepository} from 'Repositories/conversation/MessageRepository'; import {NOTIFICATION_STATE} from 'Repositories/conversation/NotificationSetting'; +import type {IntegrationRepository} from 'Repositories/integration/IntegrationRepository'; +import type {ServiceEntity} from 'Repositories/integration/ServiceEntity'; import {t} from 'Util/LocalizerUtil'; import {isBackendError} from 'Util/TypePredicateUtil'; @@ -39,8 +41,6 @@ import type {MainViewModel} from './MainViewModel'; import type {Conversation} from '../entity/Conversation'; import type {Message} from '../entity/message/Message'; import type {User} from '../entity/User'; -import type {IntegrationRepository} from '../integration/IntegrationRepository'; -import type {ServiceEntity} from '../integration/ServiceEntity'; import {SelfRepository} from '../self/SelfRepository'; import {UserState} from '../user/UserState'; diff --git a/src/script/view_model/CallingViewModel.mocks.ts b/src/script/view_model/CallingViewModel.mocks.ts index 172425aa369..50a10063637 100644 --- a/src/script/view_model/CallingViewModel.mocks.ts +++ b/src/script/view_model/CallingViewModel.mocks.ts @@ -25,11 +25,11 @@ import {CALL_TYPE, CONV_TYPE} from '@wireapp/avs'; import {Call} from 'Repositories/calling/Call'; import {CallingRepository} from 'Repositories/calling/CallingRepository'; import {CallState} from 'Repositories/calling/CallState'; +import {MediaDevicesHandler} from 'Repositories/media/MediaDevicesHandler'; import {CallingViewModel} from './CallingViewModel'; import {Conversation} from '../entity/Conversation'; -import {MediaDevicesHandler} from '../media/MediaDevicesHandler'; import {Core} from '../service/CoreSingleton'; export const mockCallingRepository = { diff --git a/src/script/view_model/CallingViewModel.ts b/src/script/view_model/CallingViewModel.ts index f2c4d4090b3..7c1a0285f4b 100644 --- a/src/script/view_model/CallingViewModel.ts +++ b/src/script/view_model/CallingViewModel.ts @@ -37,6 +37,8 @@ import {CallState, DesktopScreenShareMenu} from 'Repositories/calling/CallState' import {LEAVE_CALL_REASON} from 'Repositories/calling/enum/LeaveCallReason'; import {ConversationState} from 'Repositories/conversation/ConversationState'; import {ConversationVerificationState} from 'Repositories/conversation/ConversationVerificationState'; +import type {ElectronDesktopCapturerSource, MediaDevicesHandler} from 'Repositories/media/MediaDevicesHandler'; +import type {MediaStreamHandler} from 'Repositories/media/MediaStreamHandler'; import {replaceLink, t} from 'Util/LocalizerUtil'; import {matchQualifiedIds} from 'Util/QualifiedId'; import {safeWindowOpen} from 'Util/SanitizationUtil'; @@ -44,8 +46,6 @@ import {safeWindowOpen} from 'Util/SanitizationUtil'; import {Config} from '../Config'; import type {Conversation} from '../entity/Conversation'; import type {User} from '../entity/User'; -import type {ElectronDesktopCapturerSource, MediaDevicesHandler} from '../media/MediaDevicesHandler'; -import type {MediaStreamHandler} from '../media/MediaStreamHandler'; import type {PermissionRepository} from '../permission/PermissionRepository'; import {PermissionStatusState} from '../permission/PermissionStatusState'; import {PropertiesRepository} from '../properties/PropertiesRepository'; diff --git a/src/script/view_model/MainViewModel.ts b/src/script/view_model/MainViewModel.ts index 3f697ad3160..fe5db7f1850 100644 --- a/src/script/view_model/MainViewModel.ts +++ b/src/script/view_model/MainViewModel.ts @@ -28,16 +28,16 @@ import type {ConnectionRepository} from 'Repositories/connection/ConnectionRepos import type {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; import type {MessageRepository} from 'Repositories/conversation/MessageRepository'; import type {CryptographyRepository} from 'Repositories/cryptography/CryptographyRepository'; +import type {EventRepository} from 'Repositories/event/EventRepository'; import type {GiphyRepository} from 'Repositories/giphy/GiphyRepository'; +import type {IntegrationRepository} from 'Repositories/integration/IntegrationRepository'; +import type {MediaRepository} from 'Repositories/media/MediaRepository'; import {ActionsViewModel} from './ActionsViewModel'; import {CallingViewModel} from './CallingViewModel'; import {ContentViewModel} from './ContentViewModel'; import {ListViewModel} from './ListViewModel'; -import type {EventRepository} from '../event/EventRepository'; -import type {IntegrationRepository} from '../integration/IntegrationRepository'; -import type {MediaRepository} from '../media/MediaRepository'; import type {NotificationRepository} from '../notification/NotificationRepository'; import type {PreferenceNotificationRepository} from '../notification/PreferenceNotificationRepository'; import type {PermissionRepository} from '../permission/PermissionRepository'; diff --git a/test/helper/EventGenerator.ts b/test/helper/EventGenerator.ts index e11b2d3b7e3..5adf2101545 100644 --- a/test/helper/EventGenerator.ts +++ b/test/helper/EventGenerator.ts @@ -30,8 +30,8 @@ import { MessageAddEvent, ReactionEvent, } from 'Repositories/conversation/EventBuilder'; +import {CONVERSATION} from 'Repositories/event/Client'; import {Conversation} from 'src/script/entity/Conversation'; -import {CONVERSATION} from 'src/script/event/Client'; import {createUuid} from 'Util/uuid'; export function createMessageAddEvent({ diff --git a/test/helper/TestFactory.js b/test/helper/TestFactory.js index 8fb9e30fc23..fa61f5407bc 100644 --- a/test/helper/TestFactory.js +++ b/test/helper/TestFactory.js @@ -42,11 +42,11 @@ import {ConversationService} from 'Repositories/conversation/ConversationService import {ConversationState} from 'Repositories/conversation/ConversationState'; import {MessageRepository} from 'Repositories/conversation/MessageRepository'; import {CryptographyRepository} from 'Repositories/cryptography/CryptographyRepository'; +import {EventRepository} from 'Repositories/event/EventRepository'; +import {EventService} from 'Repositories/event/EventService'; +import {NotificationService} from 'Repositories/event/NotificationService'; +import {MediaRepository} from 'Repositories/media/MediaRepository'; import {User} from 'src/script/entity/User'; -import {EventRepository} from 'src/script/event/EventRepository'; -import {EventService} from 'src/script/event/EventService'; -import {NotificationService} from 'src/script/event/NotificationService'; -import {MediaRepository} from 'src/script/media/MediaRepository'; import {PermissionRepository} from 'src/script/permission/PermissionRepository'; import {PropertiesRepository} from 'src/script/properties/PropertiesRepository'; import {PropertiesService} from 'src/script/properties/PropertiesService'; diff --git a/test/unit_tests/conversation/ConversationEphemeralHandlerSpec.js b/test/unit_tests/conversation/ConversationEphemeralHandlerSpec.js index a964855659d..26f7fd13f4d 100644 --- a/test/unit_tests/conversation/ConversationEphemeralHandlerSpec.js +++ b/test/unit_tests/conversation/ConversationEphemeralHandlerSpec.js @@ -18,8 +18,8 @@ */ import {ConversationEphemeralHandler} from 'Repositories/conversation/ConversationEphemeralHandler'; +import {EventService} from 'Repositories/event/EventService'; import {Conversation} from 'src/script/entity/Conversation'; -import {EventService} from 'src/script/event/EventService'; const buildConversationEphemeralHandler = () => { const eventService = new EventService(null, null); diff --git a/test/unit_tests/message/MessageHasherSpec.js b/test/unit_tests/message/MessageHasherSpec.js index e85d732cee1..36a4411cd6b 100644 --- a/test/unit_tests/message/MessageHasherSpec.js +++ b/test/unit_tests/message/MessageHasherSpec.js @@ -17,7 +17,7 @@ * */ -import {ClientEvent} from 'src/script/event/Client'; +import {ClientEvent} from 'Repositories/event/Client'; import {MessageHasher} from 'src/script/message/MessageHasher'; import {bytesToHex} from 'Util/StringUtil'; From 86019fb8af9968299a4ed9d833d006927c96b1ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20J=C3=B3=C5=BAwik?= Date: Mon, 4 Nov 2024 14:03:01 +0100 Subject: [PATCH 11/12] feat: Move Notification & Permission & Properties Repositories to new folder structure (#18249) * feat: Move Notification & Permission & Properties Repositories to new folder structure * feat: Move Search and Self Repository to new folder structure (#18251) * feat: Move Search and Self Repository to new folder structure * feat: Move StorageRepository to new folder structure (#18252) * feat: Move StorageRepository to new folder structure * feat: Move TrackingRepository to new folder structure (#18268) --- .github/labeler.yml | 2 +- src/script/auth/configureEnvironment.ts | 2 +- .../components/AppContainer/AppContainer.tsx | 6 ++-- .../components/Conversation/Conversation.tsx | 2 +- .../components/InputBar/InputBar.test.tsx | 10 +++--- src/script/components/InputBar/InputBar.tsx | 8 ++--- .../InputBar/util/DraftStateUtil.ts | 2 +- .../MessageReactionsList.test.tsx | 2 +- .../MessageReactions/MessageReactionsList.tsx | 2 +- .../ContentMessage/asset/VideoAsset.tsx | 2 +- .../MessagesList/Message/PingMessage.test.tsx | 3 +- .../Message/ReadReceiptStatus.test.tsx | 2 +- .../LegalHoldModal/LegalHoldModal.test.tsx | 2 +- .../Modals/LegalHoldModal/LegalHoldModal.tsx | 2 +- .../Modals/PrimaryModal/PrimaryModalState.tsx | 2 +- .../Modals/PrimaryModal/PrimaryModalTypes.ts | 2 +- .../QualityFeedbackModal.test.tsx | 6 ++-- .../QualityFeedbackModal.tsx | 4 +-- .../EmojiPickerPlugin/EmojiPickerPlugin.tsx | 2 +- .../UserSearchableList/UserSearchableList.tsx | 2 +- src/script/entity/Conversation.ts | 2 +- src/script/entity/message/ContentMessage.ts | 2 +- src/script/entity/message/Message.ts | 2 +- src/script/hooks/useAppSoftLock.test.ts | 2 +- src/script/hooks/useAppSoftLock.ts | 2 +- src/script/hooks/useRootFontSize.ts | 2 +- src/script/localization/Localizer.ts | 2 +- src/script/main/app.ts | 20 +++++------ src/script/main/index.tsx | 2 +- src/script/message/MessageCategorization.ts | 3 +- src/script/message/MessageHasher.ts | 3 +- src/script/message/StatusType.ts | 2 +- .../ConversationCallingView.tsx | 4 +-- .../Conversations/Conversations.test.tsx | 2 +- .../panels/Conversations/Conversations.tsx | 8 ++--- .../getGroupParticipantsConversation.ts | 2 +- .../page/LeftSidebar/panels/Preferences.tsx | 10 +++--- .../LeftSidebar/panels/StartUI/PeopleTab.tsx | 4 +-- .../LeftSidebar/panels/StartUI/StartUI.tsx | 2 +- .../panels/TemporatyGuestConversations.tsx | 2 +- .../panels/Collection/FullSearch.tsx | 4 +-- .../panels/preferences/AVPreferences.tsx | 3 +- .../panels/preferences/AccountPreferences.tsx | 2 +- .../panels/preferences/OptionPreferences.tsx | 6 ++-- .../accountPreferences/DataUsageSection.tsx | 6 ++-- .../accountPreferences/PrivacySection.tsx | 2 +- .../preferences/avPreferences/CallOptions.tsx | 4 +-- .../AddParticipants/AddParticipants.tsx | 2 +- .../ConversationDetails.test.tsx | 4 +-- .../ConversationParticipants.tsx | 2 +- .../MessageDetails/MessageDetails.test.tsx | 2 +- .../MessageDetails/UserReactions.tsx | 2 +- .../backup/BackupRepository.test.ts | 3 +- .../repositories/backup/BackupRepository.ts | 4 +-- .../repositories/backup/BackupService.ts | 3 +- .../backup/recordPreprocessors.ts | 3 +- .../repositories/cache/CacheRepository.ts | 3 +- src/script/repositories/calling/CallState.ts | 4 +-- .../repositories/calling/CallingRepository.ts | 8 ++--- .../repositories/client/ClientEntity.ts | 3 +- .../repositories/client/ClientMapper.test.ts | 3 +- .../repositories/client/ClientMapper.ts | 3 +- .../client/ClientRepository.test.ts | 2 +- .../repositories/client/ClientRepository.ts | 3 +- .../repositories/client/ClientService.ts | 6 ++-- .../ConversationEphemeralHandler.ts | 2 +- .../ConversationLabelRepository.ts | 2 +- .../conversation/ConversationMapper.ts | 3 +- .../ConversationRepository.test.ts | 5 ++- .../conversation/ConversationRepository.ts | 8 ++--- .../conversation/ConversationService.ts | 6 ++-- .../repositories/conversation/EventBuilder.ts | 2 +- .../repositories/conversation/EventMapper.ts | 2 +- .../conversation/MessageRepository.test.ts | 4 +-- .../conversation/MessageRepository.ts | 14 ++++---- .../repositories/event/EventRepository.ts | 2 +- src/script/repositories/event/EventService.ts | 9 +++-- .../repositories/event/NotificationService.ts | 3 +- .../EventStorageMiddleware.ts | 2 +- .../eventHandlers/assetEventHandler.ts | 2 +- .../eventHandlers/editedEventHandler.ts | 2 +- .../eventHandlers/getCommonMessageUpdates.ts | 2 +- .../eventHandlers/linkPreviewEventHandler.ts | 2 +- .../eventHandlers/reactionEventHandler.ts | 2 +- .../EventStorageMiddleware/types.ts | 2 +- .../preprocessor/QuoteDecoderMiddleware.ts | 2 +- .../event/preprocessor/ReceiptsMiddleware.ts | 2 +- .../preprocessor/RepliesUpdaterMiddleware.ts | 2 +- .../repositories/media/MediaRepository.ts | 4 +-- .../media/MediaStreamHandler.test.ts | 2 +- .../repositories/media/MediaStreamHandler.ts | 6 ++-- .../NotificationRepository.test.ts | 10 +++--- .../notification/NotificationRepository.ts | 36 +++++++++---------- .../notification/PermissionState.ts | 0 .../PreferenceNotificationRepository.test.ts | 7 ++-- .../PreferenceNotificationRepository.ts | 4 +-- .../permission/PermissionRepository.ts | 3 +- .../permission/PermissionStatusState.ts | 0 .../permission/PermissionType.ts | 0 .../properties/PropertiesRepository.ts | 10 +++--- .../properties/PropertiesService.ts | 2 +- .../properties/PropertiesType.ts | 0 .../search/FullTextSearch.ts | 0 .../search/SearchRepository.test.ts | 10 +++--- .../search/SearchRepository.ts | 10 +++--- .../self/SelfRepository.test.ts | 2 +- .../{ => repositories}/self/SelfRepository.ts | 10 +++--- .../{ => repositories}/self/SelfService.ts | 4 +-- .../SelfSupportedProtocols.test.ts | 2 +- .../SelfSupportedProtocols.ts | 4 +-- .../storage/DexieDatabase.ts | 0 .../{ => repositories}/storage/StorageKey.ts | 0 .../storage/StorageRepository.ts | 0 .../storage/StorageSchemata.ts | 2 +- .../storage/StorageService.ts | 2 +- .../{ => repositories}/storage/index.ts | 0 .../storage/record/AmplifyRecord.ts | 0 .../storage/record/ClientRecord.ts | 0 .../storage/record/ConversationRecord.ts | 0 .../storage/record/CryptoboxRecord.ts | 0 .../storage/record/EventRecord.ts | 2 +- .../storage/record/GroupIdRecord.ts | 0 .../storage/record/UserRecord.ts | 0 .../storage/record/index.ts | 0 .../tracking/Countly.helpers.ts | 2 +- .../{ => repositories}/tracking/EventName.ts | 0 .../tracking/EventTrackingRepository.ts | 6 ++-- .../{ => repositories}/tracking/Helpers.ts | 4 +-- .../tracking/Segmentation.ts | 0 .../{ => repositories}/tracking/UserData.ts | 0 .../{ => repositories}/tracking/attribute.ts | 0 .../tracking/countly-skd-web.d.ts | 0 src/script/service/StoreEngineProvider.ts | 3 +- src/script/user/UserGuards.ts | 2 +- src/script/user/UserMapper.ts | 2 +- src/script/user/UserRepository.test.ts | 4 +-- src/script/user/UserRepository.ts | 8 ++--- src/script/user/UserService.ts | 5 ++- src/script/util/DebugUtil.ts | 8 ++--- src/script/util/ReactionUtil.test.ts | 3 +- src/script/util/ReactionUtil.ts | 4 +-- src/script/util/TypePredicateUtil.ts | 3 +- src/script/view_model/ActionsViewModel.ts | 2 +- src/script/view_model/CallingViewModel.ts | 8 ++--- src/script/view_model/ListViewModel.ts | 4 +-- src/script/view_model/MainViewModel.ts | 16 ++++----- .../WarningsContainer/WarningsState.ts | 2 +- test/helper/TestFactory.js | 17 +++++---- test/unit_tests/cache/CacheRepositorySpec.js | 2 +- .../conversation/ConversationServiceSpec.js | 2 +- test/unit_tests/event/EventServiceCommon.js | 4 +-- .../permission/PermissionRepositorySpec.js | 6 ++-- .../properties/PropertiesRepositorySpec.js | 6 ++-- test/unit_tests/search/FullTextSearchSpec.js | 2 +- test/unit_tests/storage/StorageServiceSpec.js | 2 +- test/unit_tests/tracking/HelpersSpec.js | 4 +-- test/unit_tests/util/ValidationUtilSpec.js | 2 +- 157 files changed, 283 insertions(+), 294 deletions(-) rename src/script/{ => repositories}/notification/NotificationRepository.test.ts (99%) rename src/script/{ => repositories}/notification/NotificationRepository.ts (96%) rename src/script/{ => repositories}/notification/PermissionState.ts (100%) rename src/script/{ => repositories}/notification/PreferenceNotificationRepository.test.ts (95%) rename src/script/{ => repositories}/notification/PreferenceNotificationRepository.ts (97%) rename src/script/{ => repositories}/permission/PermissionRepository.ts (97%) rename src/script/{ => repositories}/permission/PermissionStatusState.ts (100%) rename src/script/{ => repositories}/permission/PermissionType.ts (100%) rename src/script/{ => repositories}/properties/PropertiesRepository.ts (97%) rename src/script/{ => repositories}/properties/PropertiesService.ts (96%) rename src/script/{ => repositories}/properties/PropertiesType.ts (100%) rename src/script/{ => repositories}/search/FullTextSearch.ts (100%) rename src/script/{ => repositories}/search/SearchRepository.test.ts (97%) rename src/script/{ => repositories}/search/SearchRepository.ts (96%) rename src/script/{ => repositories}/self/SelfRepository.test.ts (99%) rename src/script/{ => repositories}/self/SelfRepository.ts (96%) rename src/script/{ => repositories}/self/SelfService.ts (96%) rename src/script/{ => repositories}/self/SelfSupportedProtocols/SelfSupportedProtocols.test.ts (99%) rename src/script/{ => repositories}/self/SelfSupportedProtocols/SelfSupportedProtocols.ts (96%) rename src/script/{ => repositories}/storage/DexieDatabase.ts (100%) rename src/script/{ => repositories}/storage/StorageKey.ts (100%) rename src/script/{ => repositories}/storage/StorageRepository.ts (100%) rename src/script/{ => repositories}/storage/StorageSchemata.ts (99%) rename src/script/{ => repositories}/storage/StorageService.ts (99%) rename src/script/{ => repositories}/storage/index.ts (100%) rename src/script/{ => repositories}/storage/record/AmplifyRecord.ts (100%) rename src/script/{ => repositories}/storage/record/ClientRecord.ts (100%) rename src/script/{ => repositories}/storage/record/ConversationRecord.ts (100%) rename src/script/{ => repositories}/storage/record/CryptoboxRecord.ts (100%) rename src/script/{ => repositories}/storage/record/EventRecord.ts (98%) rename src/script/{ => repositories}/storage/record/GroupIdRecord.ts (100%) rename src/script/{ => repositories}/storage/record/UserRecord.ts (100%) rename src/script/{ => repositories}/storage/record/index.ts (100%) rename src/script/{ => repositories}/tracking/Countly.helpers.ts (98%) rename src/script/{ => repositories}/tracking/EventName.ts (100%) rename src/script/{ => repositories}/tracking/EventTrackingRepository.ts (99%) rename src/script/{ => repositories}/tracking/Helpers.ts (96%) rename src/script/{ => repositories}/tracking/Segmentation.ts (100%) rename src/script/{ => repositories}/tracking/UserData.ts (100%) rename src/script/{ => repositories}/tracking/attribute.ts (100%) rename src/script/{ => repositories}/tracking/countly-skd-web.d.ts (100%) diff --git a/.github/labeler.yml b/.github/labeler.yml index 1f1ef0e3ad0..6afadbe3f10 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -36,7 +36,7 @@ - 'src/script/repositories/calling/.*' 'comp: preferences': files: - - 'src/script/properties/.*' + - 'src/script/repositories/properties/.*' 'comp: infrastructure': files: - '.elasticbeanstalk' diff --git a/src/script/auth/configureEnvironment.ts b/src/script/auth/configureEnvironment.ts index 2fd67617b0b..53d548bdf7c 100644 --- a/src/script/auth/configureEnvironment.ts +++ b/src/script/auth/configureEnvironment.ts @@ -20,5 +20,5 @@ import '../message/MessageCategorization'; import '../message/MessageCategory'; import '../repositories/event/Client'; +import '../repositories/storage/StorageSchemata'; import '../service/BackendEnvironment'; -import '../storage/StorageSchemata'; diff --git a/src/script/components/AppContainer/AppContainer.tsx b/src/script/components/AppContainer/AppContainer.tsx index 77bd87a2999..1deb5fd7907 100644 --- a/src/script/components/AppContainer/AppContainer.tsx +++ b/src/script/components/AppContainer/AppContainer.tsx @@ -27,10 +27,10 @@ import {StyledApp, THEME_ID} from '@wireapp/react-ui-kit'; import {DetachedCallingCell} from 'Components/calling/DetachedCallingCell'; import {PrimaryModalComponent} from 'Components/Modals/PrimaryModal/PrimaryModal'; import {QualityFeedbackModal} from 'Components/Modals/QualityFeedbackModal'; +import {useAppSoftLock} from 'Hooks/useAppSoftLock'; +import {useSingleInstance} from 'Hooks/useSingleInstance'; +import {PROPERTIES_TYPE} from 'Repositories/properties/PropertiesType'; import {SIGN_OUT_REASON} from 'src/script/auth/SignOutReason'; -import {useAppSoftLock} from 'src/script/hooks/useAppSoftLock'; -import {useSingleInstance} from 'src/script/hooks/useSingleInstance'; -import {PROPERTIES_TYPE} from 'src/script/properties/PropertiesType'; import {isDetachedCallingFeatureEnabled} from 'Util/isDetachedCallingFeatureEnabled'; import {useAccentColor} from './hooks/useAccentColor'; diff --git a/src/script/components/Conversation/Conversation.tsx b/src/script/components/Conversation/Conversation.tsx index 7530f28f99b..9e6ea52ec4c 100644 --- a/src/script/components/Conversation/Conversation.tsx +++ b/src/script/components/Conversation/Conversation.tsx @@ -36,8 +36,8 @@ import {TitleBar} from 'Components/TitleBar'; import {CallState} from 'Repositories/calling/CallState'; import {ConversationState} from 'Repositories/conversation/ConversationState'; import {ServiceEntity} from 'Repositories/integration/ServiceEntity'; +import {PROPERTIES_TYPE} from 'Repositories/properties/PropertiesType'; import {Config} from 'src/script/Config'; -import {PROPERTIES_TYPE} from 'src/script/properties/PropertiesType'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {isLastReceivedMessage} from 'Util/conversationMessages'; import {allowsAllFiles, getFileExtensionOrName, hasAllowedExtension} from 'Util/FileTypeUtil'; diff --git a/src/script/components/InputBar/InputBar.test.tsx b/src/script/components/InputBar/InputBar.test.tsx index 196c0eb2452..276ac57b51e 100644 --- a/src/script/components/InputBar/InputBar.test.tsx +++ b/src/script/components/InputBar/InputBar.test.tsx @@ -24,18 +24,18 @@ import {AssetRepository} from 'Repositories/assets/AssetRepository'; import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; import {MessageRepository} from 'Repositories/conversation/MessageRepository'; import {EventRepository} from 'Repositories/event/EventRepository'; +import {PropertiesRepository} from 'Repositories/properties/PropertiesRepository'; +import {PropertiesService} from 'Repositories/properties/PropertiesService'; +import {SearchRepository} from 'Repositories/search/SearchRepository'; +import {SelfService} from 'Repositories/self/SelfService'; +import {StorageRepository} from 'Repositories/storage'; import {withTheme} from 'src/script/auth/util/test/TestUtil'; import {Config} from 'src/script/Config'; -import {PropertiesService} from 'src/script/properties/PropertiesService'; -import {SelfService} from 'src/script/self/SelfService'; import {createUuid} from 'Util/uuid'; import {TestFactory} from '../../../../test/helper/TestFactory'; import {Conversation} from '../../entity/Conversation'; import {User} from '../../entity/User'; -import {PropertiesRepository} from '../../properties/PropertiesRepository'; -import {SearchRepository} from '../../search/SearchRepository'; -import {StorageRepository} from '../../storage'; import {TeamState} from '../../team/TeamState'; const testFactory = new TestFactory(); diff --git a/src/script/components/InputBar/InputBar.tsx b/src/script/components/InputBar/InputBar.tsx index e53cf82f409..780fa9b664b 100644 --- a/src/script/components/InputBar/InputBar.tsx +++ b/src/script/components/InputBar/InputBar.tsx @@ -38,9 +38,11 @@ import {ConversationRepository} from 'Repositories/conversation/ConversationRepo import {ConversationVerificationState} from 'Repositories/conversation/ConversationVerificationState'; import {MessageRepository, OutgoingQuote} from 'Repositories/conversation/MessageRepository'; import {EventRepository} from 'Repositories/event/EventRepository'; +import {PropertiesRepository} from 'Repositories/properties/PropertiesRepository'; +import {PROPERTIES_TYPE} from 'Repositories/properties/PropertiesType'; +import {SearchRepository} from 'Repositories/search/SearchRepository'; +import {StorageRepository} from 'Repositories/storage'; import {useUserPropertyValue} from 'src/script/hooks/useUserProperty'; -import {PropertiesRepository} from 'src/script/properties/PropertiesRepository'; -import {PROPERTIES_TYPE} from 'src/script/properties/PropertiesType'; import {CONVERSATION_TYPING_INDICATOR_MODE} from 'src/script/user/TypingIndicatorMode'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {KEY} from 'Util/KeyboardUtil'; @@ -67,8 +69,6 @@ import {MentionEntity} from '../../message/MentionEntity'; import {MessageHasher} from '../../message/MessageHasher'; import {QuoteEntity} from '../../message/QuoteEntity'; import {useAppMainState} from '../../page/state'; -import {SearchRepository} from '../../search/SearchRepository'; -import {StorageRepository} from '../../storage'; import {TeamState} from '../../team/TeamState'; const CONFIG = { diff --git a/src/script/components/InputBar/util/DraftStateUtil.ts b/src/script/components/InputBar/util/DraftStateUtil.ts index 0d238b222cc..51c56005a9c 100644 --- a/src/script/components/InputBar/util/DraftStateUtil.ts +++ b/src/script/components/InputBar/util/DraftStateUtil.ts @@ -18,10 +18,10 @@ */ import {MessageRepository} from 'Repositories/conversation/MessageRepository'; +import {StorageKey, StorageRepository} from 'Repositories/storage'; import {Conversation} from '../../../entity/Conversation'; import {ContentMessage} from '../../../entity/message/ContentMessage'; -import {StorageKey, StorageRepository} from '../../../storage'; export interface DraftState { editorState: string | null; diff --git a/src/script/components/MessagesList/Message/ContentMessage/MessageActions/MessageReactions/MessageReactionsList.test.tsx b/src/script/components/MessagesList/Message/ContentMessage/MessageActions/MessageReactions/MessageReactionsList.test.tsx index d38d6ba3fdf..4dbffe2d067 100644 --- a/src/script/components/MessagesList/Message/ContentMessage/MessageActions/MessageReactions/MessageReactionsList.test.tsx +++ b/src/script/components/MessagesList/Message/ContentMessage/MessageActions/MessageReactions/MessageReactionsList.test.tsx @@ -19,8 +19,8 @@ import {render, fireEvent, within} from '@testing-library/react'; +import {ReactionMap} from 'Repositories/storage'; import {withTheme} from 'src/script/auth/util/test/TestUtil'; -import {ReactionMap} from 'src/script/storage'; import {generateQualifiedId} from 'test/helper/UserGenerator'; import {MessageReactionsList, MessageReactionsListProps} from './MessageReactionsList'; diff --git a/src/script/components/MessagesList/Message/ContentMessage/MessageActions/MessageReactions/MessageReactionsList.tsx b/src/script/components/MessagesList/Message/ContentMessage/MessageActions/MessageReactions/MessageReactionsList.tsx index a97fd1101cd..14c31f2a4ee 100644 --- a/src/script/components/MessagesList/Message/ContentMessage/MessageActions/MessageReactions/MessageReactionsList.tsx +++ b/src/script/components/MessagesList/Message/ContentMessage/MessageActions/MessageReactions/MessageReactionsList.tsx @@ -19,7 +19,7 @@ import type {QualifiedId} from '@wireapp/api-client/lib/user/'; -import {ReactionMap} from 'src/script/storage'; +import {ReactionMap} from 'Repositories/storage'; import {getEmojiUnicode} from 'Util/EmojiUtil'; import {matchQualifiedIds} from 'Util/QualifiedId'; diff --git a/src/script/components/MessagesList/Message/ContentMessage/asset/VideoAsset.tsx b/src/script/components/MessagesList/Message/ContentMessage/asset/VideoAsset.tsx index 1333c812b10..9cd6bcf2ef1 100644 --- a/src/script/components/MessagesList/Message/ContentMessage/asset/VideoAsset.tsx +++ b/src/script/components/MessagesList/Message/ContentMessage/asset/VideoAsset.tsx @@ -30,7 +30,7 @@ import {WebAppEvents} from '@wireapp/webapp-events'; import {RestrictedVideo} from 'Components/asset/RestrictedVideo'; import {AssetRepository} from 'Repositories/assets/AssetRepository'; import {AssetTransferState} from 'Repositories/assets/AssetTransferState'; -import {EventName} from 'src/script/tracking/EventName'; +import {EventName} from 'Repositories/tracking/EventName'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; import {formatSeconds} from 'Util/TimeUtil'; diff --git a/src/script/components/MessagesList/Message/PingMessage.test.tsx b/src/script/components/MessagesList/Message/PingMessage.test.tsx index 7c2151edae4..2f71c472091 100644 --- a/src/script/components/MessagesList/Message/PingMessage.test.tsx +++ b/src/script/components/MessagesList/Message/PingMessage.test.tsx @@ -20,12 +20,11 @@ import {render} from '@testing-library/react'; import ko from 'knockout'; +import {ReadReceipt} from 'Repositories/storage'; import {PingMessage as PingMessageEntity} from 'src/script/entity/message/PingMessage'; import {PingMessage} from './PingMessage'; -import {ReadReceipt} from '../../../storage'; - const createPingMessage = (partialPingMessage: Partial) => { const callMessage: Partial = { caption: ko.pureComputed(() => ''), diff --git a/src/script/components/MessagesList/Message/ReadReceiptStatus.test.tsx b/src/script/components/MessagesList/Message/ReadReceiptStatus.test.tsx index 28ccea20482..79ee89a2b5f 100644 --- a/src/script/components/MessagesList/Message/ReadReceiptStatus.test.tsx +++ b/src/script/components/MessagesList/Message/ReadReceiptStatus.test.tsx @@ -20,8 +20,8 @@ import {render, fireEvent} from '@testing-library/react'; import ko from 'knockout'; +import {ReadReceipt} from 'Repositories/storage'; import {Message as MessageEntity} from 'src/script/entity/message/Message'; -import {ReadReceipt} from 'src/script/storage'; import {formatTimeShort} from 'Util/TimeUtil'; import {ReadReceiptStatus} from './ReadReceiptStatus'; diff --git a/src/script/components/Modals/LegalHoldModal/LegalHoldModal.test.tsx b/src/script/components/Modals/LegalHoldModal/LegalHoldModal.test.tsx index bd6987d260b..2a23570081d 100644 --- a/src/script/components/Modals/LegalHoldModal/LegalHoldModal.test.tsx +++ b/src/script/components/Modals/LegalHoldModal/LegalHoldModal.test.tsx @@ -26,13 +26,13 @@ import {ClientRepository} from 'Repositories/client'; import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; import {MessageRepository} from 'Repositories/conversation/MessageRepository'; import {CryptographyRepository} from 'Repositories/cryptography/CryptographyRepository'; +import {SearchRepository} from 'Repositories/search/SearchRepository'; import {LegalHoldModal, LegalHoldModalType} from './LegalHoldModal'; import {TestFactory} from '../../../../../test/helper/TestFactory'; import {Conversation} from '../../../entity/Conversation'; import {User} from '../../../entity/User'; -import {SearchRepository} from '../../../search/SearchRepository'; import {TeamRepository} from '../../../team/TeamRepository'; import {UserRepository} from '../../../user/UserRepository'; diff --git a/src/script/components/Modals/LegalHoldModal/LegalHoldModal.tsx b/src/script/components/Modals/LegalHoldModal/LegalHoldModal.tsx index 2727ca926ad..34c513f3069 100644 --- a/src/script/components/Modals/LegalHoldModal/LegalHoldModal.tsx +++ b/src/script/components/Modals/LegalHoldModal/LegalHoldModal.tsx @@ -33,13 +33,13 @@ import {ClientRepository} from 'Repositories/client'; import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; import {MessageRepository} from 'Repositories/conversation/MessageRepository'; import {CryptographyRepository} from 'Repositories/cryptography/CryptographyRepository'; +import {SearchRepository} from 'Repositories/search/SearchRepository'; import {handleEnterDown} from 'Util/KeyboardUtil'; import {t} from 'Util/LocalizerUtil'; import {useLegalHoldModalState} from './LegalHoldModal.state'; import {User} from '../../../entity/User'; -import {SearchRepository} from '../../../search/SearchRepository'; import {TeamRepository} from '../../../team/TeamRepository'; const DISABLE_SUBMIT_TEXT_LENGTH = 1; diff --git a/src/script/components/Modals/PrimaryModal/PrimaryModalState.tsx b/src/script/components/Modals/PrimaryModal/PrimaryModalState.tsx index 0f2768cff8a..b7343488310 100644 --- a/src/script/components/Modals/PrimaryModal/PrimaryModalState.tsx +++ b/src/script/components/Modals/PrimaryModal/PrimaryModalState.tsx @@ -21,6 +21,7 @@ import {isValid} from 'date-fns'; import {escape} from 'underscore'; import {create} from 'zustand'; +import {ClientNotificationData} from 'Repositories/notification/PreferenceNotificationRepository'; import {replaceLink, t} from 'Util/LocalizerUtil'; import {getLogger} from 'Util/Logger'; import {formatLocale} from 'Util/TimeUtil'; @@ -38,7 +39,6 @@ import { } from './PrimaryModalTypes'; import {Config} from '../../../Config'; -import {ClientNotificationData} from '../../../notification/PreferenceNotificationRepository'; type PrimaryModalState = { errorMessage: string | null; diff --git a/src/script/components/Modals/PrimaryModal/PrimaryModalTypes.ts b/src/script/components/Modals/PrimaryModal/PrimaryModalTypes.ts index aba2437d35d..2767117f0d5 100644 --- a/src/script/components/Modals/PrimaryModal/PrimaryModalTypes.ts +++ b/src/script/components/Modals/PrimaryModal/PrimaryModalTypes.ts @@ -19,7 +19,7 @@ import React from 'react'; -import {ClientNotificationData} from '../../../notification/PreferenceNotificationRepository'; +import {ClientNotificationData} from 'Repositories/notification/PreferenceNotificationRepository'; export interface ButtonAction { action?: Function; diff --git a/src/script/components/Modals/QualityFeedbackModal/QualityFeedbackModal.test.tsx b/src/script/components/Modals/QualityFeedbackModal/QualityFeedbackModal.test.tsx index dd1e906a575..f445f382394 100644 --- a/src/script/components/Modals/QualityFeedbackModal/QualityFeedbackModal.test.tsx +++ b/src/script/components/Modals/QualityFeedbackModal/QualityFeedbackModal.test.tsx @@ -26,16 +26,16 @@ import {WebAppEvents} from '@wireapp/webapp-events'; import {useCallAlertState} from 'Components/calling/useCallAlertState'; import {CALL_QUALITY_FEEDBACK_KEY} from 'Components/Modals/QualityFeedbackModal/constants'; import {RatingListLabel} from 'Components/Modals/QualityFeedbackModal/typings'; +import {EventName} from 'Repositories/tracking/EventName'; +import {Segmentation} from 'Repositories/tracking/Segmentation'; import {QualityFeedbackModal} from './QualityFeedbackModal'; import {withIntl, withTheme} from '../../../auth/util/test/TestUtil'; import {User} from '../../../entity/User'; -import {EventName} from '../../../tracking/EventName'; -import {Segmentation} from '../../../tracking/Segmentation'; import {UserState} from '../../../user/UserState'; -jest.mock('../../../tracking/Countly.helpers', () => ({ +jest.mock('Repositories/tracking/Countly.helpers', () => ({ isCountlyEnabledAtCurrentEnvironment: () => true, })); diff --git a/src/script/components/Modals/QualityFeedbackModal/QualityFeedbackModal.tsx b/src/script/components/Modals/QualityFeedbackModal/QualityFeedbackModal.tsx index 1605db52acd..2fcda059eed 100644 --- a/src/script/components/Modals/QualityFeedbackModal/QualityFeedbackModal.tsx +++ b/src/script/components/Modals/QualityFeedbackModal/QualityFeedbackModal.tsx @@ -29,6 +29,8 @@ import {showAppNotification} from 'Components/AppNotification'; import {useCallAlertState} from 'Components/calling/useCallAlertState'; import {ModalComponent} from 'Components/Modals/ModalComponent'; import {RatingListLabel} from 'Components/Modals/QualityFeedbackModal/typings'; +import {EventName} from 'Repositories/tracking/EventName'; +import {Segmentation} from 'Repositories/tracking/Segmentation'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; import {getLogger} from 'Util/Logger'; @@ -45,8 +47,6 @@ import { wrapper, } from './QualityFeedbackModal.styles'; -import {EventName} from '../../../tracking/EventName'; -import {Segmentation} from '../../../tracking/Segmentation'; import {UserState} from '../../../user/UserState'; const logger = getLogger('CallQualityFeedback'); diff --git a/src/script/components/RichTextEditor/plugins/EmojiPickerPlugin/EmojiPickerPlugin.tsx b/src/script/components/RichTextEditor/plugins/EmojiPickerPlugin/EmojiPickerPlugin.tsx index e9de730fce0..95621e16ed9 100644 --- a/src/script/components/RichTextEditor/plugins/EmojiPickerPlugin/EmojiPickerPlugin.tsx +++ b/src/script/components/RichTextEditor/plugins/EmojiPickerPlugin/EmojiPickerPlugin.tsx @@ -27,12 +27,12 @@ import {$createTextNode, TextNode} from 'lexical'; import * as ReactDOM from 'react-dom'; import {TypeaheadMenuPlugin} from 'Components/RichTextEditor/plugins/TypeaheadMenuPlugin'; +import {StorageKey} from 'Repositories/storage'; import {loadValue, storeValue} from 'Util/StorageUtil'; import {sortByPriority} from 'Util/StringUtil'; import {EmojiItem} from './EmojiItem'; -import {StorageKey} from '../../../../storage'; import {getDOMRangeRect} from '../../utils/getDomRangeRect'; import {getSelectionInfo} from '../../utils/getSelectionInfo'; diff --git a/src/script/components/UserSearchableList/UserSearchableList.tsx b/src/script/components/UserSearchableList/UserSearchableList.tsx index 5b2e9bbe8dc..253bfc1cc8c 100644 --- a/src/script/components/UserSearchableList/UserSearchableList.tsx +++ b/src/script/components/UserSearchableList/UserSearchableList.tsx @@ -25,13 +25,13 @@ import {debounce} from 'underscore'; import {UserList} from 'Components/UserList'; import {ConversationState} from 'Repositories/conversation/ConversationState'; +import {SearchRepository} from 'Repositories/search/SearchRepository'; import {partition} from 'Util/ArrayUtil'; import {t} from 'Util/LocalizerUtil'; import {matchQualifiedIds} from 'Util/QualifiedId'; import {sortByPriority} from 'Util/StringUtil'; import type {User} from '../../entity/User'; -import {SearchRepository} from '../../search/SearchRepository'; import type {TeamRepository} from '../../team/TeamRepository'; import {TeamState} from '../../team/TeamState'; diff --git a/src/script/entity/Conversation.ts b/src/script/entity/Conversation.ts index be4bbda804d..f4aec99d2cd 100644 --- a/src/script/entity/Conversation.ts +++ b/src/script/entity/Conversation.ts @@ -44,6 +44,7 @@ import {isProteusTeam1to1Conversation, isSelfConversation} from 'Repositories/co import {ConversationStatus} from 'Repositories/conversation/ConversationStatus'; import {ConversationVerificationState} from 'Repositories/conversation/ConversationVerificationState'; import {NOTIFICATION_STATE} from 'Repositories/conversation/NotificationSetting'; +import {ConversationRecord} from 'Repositories/storage'; import {t} from 'Util/LocalizerUtil'; import {getLogger, Logger} from 'Util/Logger'; import {matchQualifiedIds} from 'Util/QualifiedId'; @@ -60,7 +61,6 @@ import {ConversationError} from '../error/ConversationError'; import {isContentMessage, isDeleteMessage} from '../guards/Message'; import {StatusType} from '../message/StatusType'; import {ContentState, useAppState} from '../page/useAppState'; -import {ConversationRecord} from '../storage/record/ConversationRecord'; import {TeamState} from '../team/TeamState'; interface UnreadState { diff --git a/src/script/entity/message/ContentMessage.ts b/src/script/entity/message/ContentMessage.ts index 8ee7a32bb13..cf559f0cdbe 100644 --- a/src/script/entity/message/ContentMessage.ts +++ b/src/script/entity/message/ContentMessage.ts @@ -22,6 +22,7 @@ import {QualifiedId} from '@wireapp/api-client/lib/user'; import ko from 'knockout'; import {AssetRepository} from 'Repositories/assets/AssetRepository'; +import {ReactionMap, ReadReceipt} from 'Repositories/storage'; import {copyText} from 'Util/ClipboardUtil'; import {t} from 'Util/LocalizerUtil'; import {formatLocale, formatTimeShort} from 'Util/TimeUtil'; @@ -34,7 +35,6 @@ import {Text as TextAsset} from './Text'; import type {QuoteEntity} from '../../message/QuoteEntity'; import {SuperType} from '../../message/SuperType'; -import {ReactionMap, ReadReceipt} from '../../storage'; export class ContentMessage extends Message { public readonly assets: ko.ObservableArray = ko.observableArray(); diff --git a/src/script/entity/message/Message.ts b/src/script/entity/message/Message.ts index 9c973568490..4d7a31adcb4 100644 --- a/src/script/entity/message/Message.ts +++ b/src/script/entity/message/Message.ts @@ -24,6 +24,7 @@ import type {LegalHoldStatus} from '@wireapp/protocol-messaging'; import {AssetTransferState} from 'Repositories/assets/AssetTransferState'; import {AssetType} from 'Repositories/assets/AssetType'; +import type {ReadReceipt} from 'Repositories/storage'; import {t, getUserName} from 'Util/LocalizerUtil'; import {formatDateNumeral, formatDurationCaption, formatTimeShort, fromUnixTime, TIME_IN_MILLIS} from 'Util/TimeUtil'; @@ -50,7 +51,6 @@ import {EphemeralStatusType} from '../../message/EphemeralStatusType'; import type {MessageCategory} from '../../message/MessageCategory'; import {StatusType} from '../../message/StatusType'; import {SuperType} from '../../message/SuperType'; -import type {ReadReceipt} from '../../storage/record/EventRecord'; import {User} from '../User'; export class Message { diff --git a/src/script/hooks/useAppSoftLock.test.ts b/src/script/hooks/useAppSoftLock.test.ts index 2d44beb2efd..706d2890329 100644 --- a/src/script/hooks/useAppSoftLock.test.ts +++ b/src/script/hooks/useAppSoftLock.test.ts @@ -20,12 +20,12 @@ import {renderHook, waitFor} from '@testing-library/react'; import {CallingRepository} from 'Repositories/calling/CallingRepository'; +import {NotificationRepository} from 'Repositories/notification/NotificationRepository'; import {useAppSoftLock} from './useAppSoftLock'; import {E2EIHandler} from '../E2EIdentity'; import {isFreshMLSSelfClient} from '../E2EIdentity/E2EIdentityVerification'; -import {NotificationRepository} from '../notification/NotificationRepository'; const isFreshMLSSelfClientMock = isFreshMLSSelfClient as jest.MockedFn; const E2EIHandlerMock = E2EIHandler as jest.Mocked; diff --git a/src/script/hooks/useAppSoftLock.ts b/src/script/hooks/useAppSoftLock.ts index 468c4c02ac6..21843833834 100644 --- a/src/script/hooks/useAppSoftLock.ts +++ b/src/script/hooks/useAppSoftLock.ts @@ -20,9 +20,9 @@ import {useCallback, useEffect, useState} from 'react'; import {CallingRepository} from 'Repositories/calling/CallingRepository'; +import {NotificationRepository} from 'Repositories/notification/NotificationRepository'; import {E2EIHandler, E2EIDeviceStatus} from '../E2EIdentity'; -import {NotificationRepository} from '../notification/NotificationRepository'; export function useAppSoftLock(callingRepository: CallingRepository, notificationRepository: NotificationRepository) { const [softLockEnabled, setSoftLockEnabled] = useState(false); diff --git a/src/script/hooks/useRootFontSize.ts b/src/script/hooks/useRootFontSize.ts index cbb0d03a15d..86f66be1765 100644 --- a/src/script/hooks/useRootFontSize.ts +++ b/src/script/hooks/useRootFontSize.ts @@ -21,7 +21,7 @@ import {useEffect, useState} from 'react'; import useLocalStorage from 'beautiful-react-hooks/useLocalStorage'; -import {ROOT_FONT_SIZE_KEY} from '../storage'; +import {ROOT_FONT_SIZE_KEY} from 'Repositories/storage'; export enum RootFontSize { XXS = '10px', diff --git a/src/script/localization/Localizer.ts b/src/script/localization/Localizer.ts index c6633e30968..de3f3fb1042 100644 --- a/src/script/localization/Localizer.ts +++ b/src/script/localization/Localizer.ts @@ -40,13 +40,13 @@ import sk from 'I18n/sk-SK.json'; import sl from 'I18n/sl-SI.json'; import tr from 'I18n/tr-TR.json'; import uk from 'I18n/uk-UA.json'; +import {StorageKey} from 'Repositories/storage'; import {DEFAULT_LOCALE, setLocale, setStrings} from 'Util/LocalizerUtil'; import {loadValue, storeValue} from 'Util/StorageUtil'; import {setDateLocale, LocaleType} from 'Util/TimeUtil'; import {getParameter} from 'Util/UrlUtil'; import {URLParameter} from '../auth/URLParameter'; -import {StorageKey} from '../storage/StorageKey'; const strings = { cs, diff --git a/src/script/main/app.ts b/src/script/main/app.ts index 010c5e7b22c..97e475ddf33 100644 --- a/src/script/main/app.ts +++ b/src/script/main/app.ts @@ -62,6 +62,16 @@ import {GiphyService} from 'Repositories/giphy/GiphyService'; import {IntegrationRepository} from 'Repositories/integration/IntegrationRepository'; import {IntegrationService} from 'Repositories/integration/IntegrationService'; import {MediaRepository} from 'Repositories/media/MediaRepository'; +import {NotificationRepository} from 'Repositories/notification/NotificationRepository'; +import {PreferenceNotificationRepository} from 'Repositories/notification/PreferenceNotificationRepository'; +import {PermissionRepository} from 'Repositories/permission/PermissionRepository'; +import {PropertiesRepository} from 'Repositories/properties/PropertiesRepository'; +import {PropertiesService} from 'Repositories/properties/PropertiesService'; +import {SearchRepository} from 'Repositories/search/SearchRepository'; +import {SelfRepository} from 'Repositories/self/SelfRepository'; +import {SelfService} from 'Repositories/self/SelfService'; +import {StorageKey, StorageRepository, StorageService} from 'Repositories/storage'; +import {EventTrackingRepository} from 'Repositories/tracking/EventTrackingRepository'; import {initializeDataDog} from 'Util/DataDog'; import {DebugUtil} from 'Util/DebugUtil'; import {Environment} from 'Util/Environment'; @@ -87,25 +97,15 @@ import {externalUrl} from '../externalRoute'; import {startNewVersionPolling} from '../lifecycle/newVersionHandler'; import {initMLSGroupConversations, initialiseSelfAndTeamConversations} from '../mls'; import {joinConversationsAfterMigrationFinalisation} from '../mls/MLSMigration/migrationFinaliser'; -import {NotificationRepository} from '../notification/NotificationRepository'; -import {PreferenceNotificationRepository} from '../notification/PreferenceNotificationRepository'; import {configureDownloadPath} from '../page/components/FeatureConfigChange/FeatureConfigChangeHandler/Features/downloadPath'; import {configureE2EI} from '../page/components/FeatureConfigChange/FeatureConfigChangeHandler/Features/E2EIdentity'; -import {PermissionRepository} from '../permission/PermissionRepository'; -import {PropertiesRepository} from '../properties/PropertiesRepository'; -import {PropertiesService} from '../properties/PropertiesService'; -import {SearchRepository} from '../search/SearchRepository'; -import {SelfRepository} from '../self/SelfRepository'; -import {SelfService} from '../self/SelfService'; import {APIClient} from '../service/APIClientSingleton'; import {Core} from '../service/CoreSingleton'; -import {StorageKey, StorageRepository, StorageService} from '../storage'; import {TeamRepository} from '../team/TeamRepository'; import {AppInitStatisticsValue} from '../telemetry/app_init/AppInitStatisticsValue'; import {AppInitTelemetry} from '../telemetry/app_init/AppInitTelemetry'; import {AppInitTimingsStep} from '../telemetry/app_init/AppInitTimingsStep'; import {serverTimeHandler} from '../time/serverTimeHandler'; -import {EventTrackingRepository} from '../tracking/EventTrackingRepository'; import {WindowHandler} from '../ui/WindowHandler'; import {UserRepository} from '../user/UserRepository'; import {UserService} from '../user/UserService'; diff --git a/src/script/main/index.tsx b/src/script/main/index.tsx index 0d4b23ca8d5..d42a1267f27 100644 --- a/src/script/main/index.tsx +++ b/src/script/main/index.tsx @@ -27,6 +27,7 @@ import {createRoot} from 'react-dom/client'; import {Runtime} from '@wireapp/commons'; import {AppContainer} from 'Components/AppContainer/AppContainer'; +import {StorageKey} from 'Repositories/storage'; import {enableLogging} from 'Util/LoggerUtil'; import {loadValue} from 'Util/StorageUtil'; import {exposeWrapperGlobals} from 'Util/wrapper'; @@ -35,7 +36,6 @@ import {doRedirect} from './app'; import {SIGN_OUT_REASON} from '../auth/SignOutReason'; import {Config} from '../Config'; -import {StorageKey} from '../storage'; document.addEventListener('DOMContentLoaded', async () => { const config = Config.getConfig(); diff --git a/src/script/message/MessageCategorization.ts b/src/script/message/MessageCategorization.ts index 3b0ec751857..fc5caeeae7f 100644 --- a/src/script/message/MessageCategorization.ts +++ b/src/script/message/MessageCategorization.ts @@ -20,11 +20,10 @@ import {isObject} from 'underscore'; import {ClientEvent} from 'Repositories/event/Client'; +import {EventRecord} from 'Repositories/storage'; import {MessageCategory} from './MessageCategory'; -import {EventRecord} from '../storage/record/EventRecord'; - const _checkAsset = (event: any): MessageCategory | void => { const {data: eventData, type: eventType} = event; diff --git a/src/script/message/MessageHasher.ts b/src/script/message/MessageHasher.ts index cb31e087ca6..7fdf3cec834 100644 --- a/src/script/message/MessageHasher.ts +++ b/src/script/message/MessageHasher.ts @@ -20,10 +20,9 @@ import Long from 'long'; import {ClientEvent} from 'Repositories/event/Client'; +import {LegacyEventRecord} from 'Repositories/storage'; import {utf8ToUtf16BE} from 'Util/StringUtil'; -import {LegacyEventRecord} from '../storage/record/EventRecord'; - /** * @returns Promise with hashed string bytes */ diff --git a/src/script/message/StatusType.ts b/src/script/message/StatusType.ts index 6ee5451e790..1f104b4e3cb 100644 --- a/src/script/message/StatusType.ts +++ b/src/script/message/StatusType.ts @@ -17,7 +17,7 @@ * */ -import {EventRecord} from '../storage/record/EventRecord'; +import {EventRecord} from 'Repositories/storage'; /** Enum for different confirmation types */ export enum StatusType { diff --git a/src/script/page/LeftSidebar/panels/Conversations/ConversationCallingView/ConversationCallingView.tsx b/src/script/page/LeftSidebar/panels/Conversations/ConversationCallingView/ConversationCallingView.tsx index 2862e379100..7d488329abc 100644 --- a/src/script/page/LeftSidebar/panels/Conversations/ConversationCallingView/ConversationCallingView.tsx +++ b/src/script/page/LeftSidebar/panels/Conversations/ConversationCallingView/ConversationCallingView.tsx @@ -19,8 +19,8 @@ import {CallingCell} from 'Components/calling/CallingCell'; import {Call} from 'Repositories/calling/Call'; -import {PropertiesRepository} from 'src/script/properties/PropertiesRepository'; -import {PROPERTIES_TYPE} from 'src/script/properties/PropertiesType'; +import {PropertiesRepository} from 'Repositories/properties/PropertiesRepository'; +import {PROPERTIES_TYPE} from 'Repositories/properties/PropertiesType'; import {ListViewModel} from 'src/script/view_model/ListViewModel'; type ConversationCallingViewProps = { diff --git a/src/script/page/LeftSidebar/panels/Conversations/Conversations.test.tsx b/src/script/page/LeftSidebar/panels/Conversations/Conversations.test.tsx index 6a82cd6aa07..32b8e5caa43 100644 --- a/src/script/page/LeftSidebar/panels/Conversations/Conversations.test.tsx +++ b/src/script/page/LeftSidebar/panels/Conversations/Conversations.test.tsx @@ -23,10 +23,10 @@ import {act, render} from '@testing-library/react'; import {observable} from 'knockout'; import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; +import {SearchRepository} from 'Repositories/search/SearchRepository'; import {withTheme} from 'src/script/auth/util/test/TestUtil'; import {User} from 'src/script/entity/User'; import {ListState} from 'src/script/page/useAppState'; -import {SearchRepository} from 'src/script/search/SearchRepository'; import {UserRepository} from 'src/script/user/UserRepository'; import {TestFactory} from 'test/helper/TestFactory'; diff --git a/src/script/page/LeftSidebar/panels/Conversations/Conversations.tsx b/src/script/page/LeftSidebar/panels/Conversations/Conversations.tsx index 6cd69d4e61d..98e9d71594a 100644 --- a/src/script/page/LeftSidebar/panels/Conversations/Conversations.tsx +++ b/src/script/page/LeftSidebar/panels/Conversations/Conversations.tsx @@ -31,14 +31,16 @@ import {createLabel} from 'Repositories/conversation/ConversationLabelRepository import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; import {ConversationState} from 'Repositories/conversation/ConversationState'; import {IntegrationRepository} from 'Repositories/integration/IntegrationRepository'; +import {PreferenceNotificationRepository} from 'Repositories/notification/PreferenceNotificationRepository'; +import {PropertiesRepository} from 'Repositories/properties/PropertiesRepository'; +import {SearchRepository} from 'Repositories/search/SearchRepository'; +import {EventName} from 'Repositories/tracking/EventName'; import {Preferences} from 'src/script/page/LeftSidebar/panels/Preferences'; import {StartUI} from 'src/script/page/LeftSidebar/panels/StartUI'; import {ANIMATED_PAGE_TRANSITION_DURATION} from 'src/script/page/MainContent'; import {useAppMainState, ViewType} from 'src/script/page/state'; import {ContentState, ListState} from 'src/script/page/useAppState'; -import {SearchRepository} from 'src/script/search/SearchRepository'; import {TeamRepository} from 'src/script/team/TeamRepository'; -import {EventName} from 'src/script/tracking/EventName'; import {UserRepository} from 'src/script/user/UserRepository'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; @@ -55,8 +57,6 @@ import {SidebarStatus, SidebarTabs, useSidebarStore} from './useSidebarStore'; import type {Conversation} from '../../../../entity/Conversation'; import {User} from '../../../../entity/User'; -import {PreferenceNotificationRepository} from '../../../../notification/PreferenceNotificationRepository'; -import {PropertiesRepository} from '../../../../properties/PropertiesRepository'; import {generateConversationUrl} from '../../../../router/routeGenerator'; import {createNavigateKeyboard} from '../../../../router/routerBindings'; import {TeamState} from '../../../../team/TeamState'; diff --git a/src/script/page/LeftSidebar/panels/Conversations/getGroupParticipantsConversation.ts b/src/script/page/LeftSidebar/panels/Conversations/getGroupParticipantsConversation.ts index b7529755162..1382d978640 100644 --- a/src/script/page/LeftSidebar/panels/Conversations/getGroupParticipantsConversation.ts +++ b/src/script/page/LeftSidebar/panels/Conversations/getGroupParticipantsConversation.ts @@ -19,8 +19,8 @@ import {ConversationLabel} from 'Repositories/conversation/ConversationLabelRepository'; import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; +import {SearchRepository} from 'Repositories/search/SearchRepository'; import {Conversation} from 'src/script/entity/Conversation'; -import {SearchRepository} from 'src/script/search/SearchRepository'; import {SidebarTabs} from './useSidebarStore'; diff --git a/src/script/page/LeftSidebar/panels/Preferences.tsx b/src/script/page/LeftSidebar/panels/Preferences.tsx index 14ca8b4c7da..6d3fbdb7212 100644 --- a/src/script/page/LeftSidebar/panels/Preferences.tsx +++ b/src/script/page/LeftSidebar/panels/Preferences.tsx @@ -27,15 +27,15 @@ import {WebAppEvents} from '@wireapp/webapp-events'; import * as Icon from 'Components/Icon'; import {PrimaryModal} from 'Components/Modals/PrimaryModal'; -import {t} from 'Util/LocalizerUtil'; - -import {ListWrapper} from './ListWrapper'; - import { ClientNotificationData, Notification, PreferenceNotificationRepository, -} from '../../../notification/PreferenceNotificationRepository'; +} from 'Repositories/notification/PreferenceNotificationRepository'; +import {t} from 'Util/LocalizerUtil'; + +import {ListWrapper} from './ListWrapper'; + import {TeamRepository} from '../../../team/TeamRepository'; import {ContentState, useAppState} from '../../useAppState'; diff --git a/src/script/page/LeftSidebar/panels/StartUI/PeopleTab.tsx b/src/script/page/LeftSidebar/panels/StartUI/PeopleTab.tsx index fc0652aceca..8d07be83592 100644 --- a/src/script/page/LeftSidebar/panels/StartUI/PeopleTab.tsx +++ b/src/script/page/LeftSidebar/panels/StartUI/PeopleTab.tsx @@ -25,8 +25,10 @@ import {partition} from 'underscore'; import * as Icon from 'Components/Icon'; import {UserList, UserlistMode} from 'Components/UserList'; +import {useDebounce} from 'Hooks/useDebounce'; import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; import {ConversationState} from 'Repositories/conversation/ConversationState'; +import {SearchRepository} from 'Repositories/search/SearchRepository'; import {UserRepository} from 'src/script/user/UserRepository'; import {t} from 'Util/LocalizerUtil'; import {getLogger} from 'Util/Logger'; @@ -38,8 +40,6 @@ import {TopPeople} from './components/TopPeople'; import {User} from '../../../../entity/User'; import {getManageTeamUrl} from '../../../../externalRoute'; -import {useDebounce} from '../../../../hooks/useDebounce'; -import {SearchRepository} from '../../../../search/SearchRepository'; import {TeamRepository} from '../../../../team/TeamRepository'; import {TeamState} from '../../../../team/TeamState'; import {UserState} from '../../../../user/UserState'; diff --git a/src/script/page/LeftSidebar/panels/StartUI/StartUI.tsx b/src/script/page/LeftSidebar/panels/StartUI/StartUI.tsx index 90b6be5e732..b2cb41e7bbc 100644 --- a/src/script/page/LeftSidebar/panels/StartUI/StartUI.tsx +++ b/src/script/page/LeftSidebar/panels/StartUI/StartUI.tsx @@ -30,6 +30,7 @@ import {ConversationRepository} from 'Repositories/conversation/ConversationRepo import {ConversationState} from 'Repositories/conversation/ConversationState'; import {IntegrationRepository} from 'Repositories/integration/IntegrationRepository'; import {ServiceEntity} from 'Repositories/integration/ServiceEntity'; +import {SearchRepository} from 'Repositories/search/SearchRepository'; import {User} from 'src/script/entity/User'; import {SidebarTabs, useSidebarStore} from 'src/script/page/LeftSidebar/panels/Conversations/useSidebarStore'; import {UserRepository} from 'src/script/user/UserRepository'; @@ -40,7 +41,6 @@ import {PeopleTab, SearchResultsData} from './PeopleTab'; import {ServicesTab} from './ServicesTab'; import {Config} from '../../../../Config'; -import {SearchRepository} from '../../../../search/SearchRepository'; import {TeamRepository} from '../../../../team/TeamRepository'; import {TeamState} from '../../../../team/TeamState'; import {generatePermissionHelpers} from '../../../../user/UserPermission'; diff --git a/src/script/page/LeftSidebar/panels/TemporatyGuestConversations.tsx b/src/script/page/LeftSidebar/panels/TemporatyGuestConversations.tsx index d3b57a6e33e..e07473c1823 100644 --- a/src/script/page/LeftSidebar/panels/TemporatyGuestConversations.tsx +++ b/src/script/page/LeftSidebar/panels/TemporatyGuestConversations.tsx @@ -22,7 +22,7 @@ import React from 'react'; import {CallingCell} from 'Components/calling/CallingCell'; import * as Icon from 'Components/Icon'; import {PrimaryModal} from 'Components/Modals/PrimaryModal'; -import {PROPERTIES_TYPE} from 'src/script/properties/PropertiesType'; +import {PROPERTIES_TYPE} from 'Repositories/properties/PropertiesType'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; diff --git a/src/script/page/MainContent/panels/Collection/FullSearch.tsx b/src/script/page/MainContent/panels/Collection/FullSearch.tsx index 13744594b1e..6763207c675 100644 --- a/src/script/page/MainContent/panels/Collection/FullSearch.tsx +++ b/src/script/page/MainContent/panels/Collection/FullSearch.tsx @@ -21,6 +21,8 @@ import React, {useEffect, useMemo, useRef, useState} from 'react'; import {CloseIcon, Input, InputSubmitCombo, SearchIcon} from '@wireapp/react-ui-kit'; +import {useDebounce} from 'Hooks/useDebounce'; +import {getSearchRegex} from 'Repositories/search/FullTextSearch'; import {t} from 'Util/LocalizerUtil'; import {isScrolledBottom} from 'Util/scroll-helpers'; import {useEffectRef} from 'Util/useEffectRef'; @@ -30,8 +32,6 @@ import {FullSearchItem} from './fullSearch/FullSearchItem'; import {ContentMessage} from '../../../../entity/message/ContentMessage'; import type {Message} from '../../../../entity/message/Message'; -import {useDebounce} from '../../../../hooks/useDebounce'; -import {getSearchRegex} from '../../../../search/FullTextSearch'; const MAX_VISIBLE_MESSAGES = 30; const PRE_MARKED_OFFSET = 20; diff --git a/src/script/page/MainContent/panels/preferences/AVPreferences.tsx b/src/script/page/MainContent/panels/preferences/AVPreferences.tsx index 5817aa7141d..7b27d0c9406 100644 --- a/src/script/page/MainContent/panels/preferences/AVPreferences.tsx +++ b/src/script/page/MainContent/panels/preferences/AVPreferences.tsx @@ -21,6 +21,7 @@ import {useInitializeMediaDevices} from 'Hooks/useInitializeMediaDevices'; import type {CallingRepository} from 'Repositories/calling/CallingRepository'; import {MediaDeviceType} from 'Repositories/media/MediaDeviceType'; import type {MediaRepository} from 'Repositories/media/MediaRepository'; +import type {PropertiesRepository} from 'Repositories/properties/PropertiesRepository'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; @@ -31,8 +32,6 @@ import {MicrophonePreferences} from './avPreferences/MicrophonePreferences'; import {SaveCallLogs} from './avPreferences/SaveCallLogs'; import {PreferencesPage} from './components/PreferencesPage'; -import type {PropertiesRepository} from '../../../../properties/PropertiesRepository'; - interface AVPreferencesProps { callingRepository: CallingRepository; mediaRepository: MediaRepository; diff --git a/src/script/page/MainContent/panels/preferences/AccountPreferences.tsx b/src/script/page/MainContent/panels/preferences/AccountPreferences.tsx index 414bed5a7cb..496b0d4a67f 100644 --- a/src/script/page/MainContent/panels/preferences/AccountPreferences.tsx +++ b/src/script/page/MainContent/panels/preferences/AccountPreferences.tsx @@ -29,6 +29,7 @@ import {useEnrichedFields} from 'Components/panel/EnrichedFields'; import {ClientRepository} from 'Repositories/client'; import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; import {ConversationState} from 'Repositories/conversation/ConversationState'; +import {PropertiesRepository} from 'Repositories/properties/PropertiesRepository'; import {ContentState} from 'src/script/page/useAppState'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; @@ -51,7 +52,6 @@ import {PreferencesSection} from './components/PreferencesSection'; import {Config} from '../../../../Config'; import {User} from '../../../../entity/User'; -import {PropertiesRepository} from '../../../../properties/PropertiesRepository'; import {TeamState} from '../../../../team/TeamState'; import {RichProfileRepository} from '../../../../user/RichProfileRepository'; import type {UserRepository} from '../../../../user/UserRepository'; diff --git a/src/script/page/MainContent/panels/preferences/OptionPreferences.tsx b/src/script/page/MainContent/panels/preferences/OptionPreferences.tsx index 173d04a92a8..77bbc52a8b1 100644 --- a/src/script/page/MainContent/panels/preferences/OptionPreferences.tsx +++ b/src/script/page/MainContent/panels/preferences/OptionPreferences.tsx @@ -28,6 +28,9 @@ import {WebAppEvents} from '@wireapp/webapp-events'; import {Theme} from 'Components/AppContainer/hooks/useTheme'; import {RadioGroup} from 'Components/Radio'; +import {RootFontSize, useRootFontSize} from 'Hooks/useRootFontSize'; +import {PropertiesRepository} from 'Repositories/properties/PropertiesRepository'; +import {PROPERTIES_TYPE} from 'Repositories/properties/PropertiesType'; import {User} from 'src/script/entity/User'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; @@ -35,9 +38,6 @@ import {t} from 'Util/LocalizerUtil'; import {PreferencesPage} from './components/PreferencesPage'; import {PreferencesSection} from './components/PreferencesSection'; -import {RootFontSize, useRootFontSize} from '../../../../hooks/useRootFontSize'; -import {PropertiesRepository} from '../../../../properties/PropertiesRepository'; -import {PROPERTIES_TYPE} from '../../../../properties/PropertiesType'; interface OptionPreferencesProps { propertiesRepository: PropertiesRepository; selfUser: User; diff --git a/src/script/page/MainContent/panels/preferences/accountPreferences/DataUsageSection.tsx b/src/script/page/MainContent/panels/preferences/accountPreferences/DataUsageSection.tsx index c0c04020a55..2e1d7b67e92 100644 --- a/src/script/page/MainContent/panels/preferences/accountPreferences/DataUsageSection.tsx +++ b/src/script/page/MainContent/panels/preferences/accountPreferences/DataUsageSection.tsx @@ -25,11 +25,11 @@ import {amplify} from 'amplify'; import {Checkbox, CheckboxLabel} from '@wireapp/react-ui-kit'; import {WebAppEvents} from '@wireapp/webapp-events'; -import {getForcedErrorReportingStatus} from 'src/script/tracking/Countly.helpers'; +import {PropertiesRepository} from 'Repositories/properties/PropertiesRepository'; +import {PROPERTIES_TYPE} from 'Repositories/properties/PropertiesType'; +import {getForcedErrorReportingStatus} from 'Repositories/tracking/Countly.helpers'; import {t} from 'Util/LocalizerUtil'; -import {PropertiesRepository} from '../../../../../properties/PropertiesRepository'; -import {PROPERTIES_TYPE} from '../../../../../properties/PropertiesType'; import {TeamState} from '../../../../../team/TeamState'; import {ConsentValue} from '../../../../../user/ConsentValue'; import {PreferencesSection} from '../components/PreferencesSection'; diff --git a/src/script/page/MainContent/panels/preferences/accountPreferences/PrivacySection.tsx b/src/script/page/MainContent/panels/preferences/accountPreferences/PrivacySection.tsx index d210cf1ffd0..e93c04f9dd0 100644 --- a/src/script/page/MainContent/panels/preferences/accountPreferences/PrivacySection.tsx +++ b/src/script/page/MainContent/panels/preferences/accountPreferences/PrivacySection.tsx @@ -24,11 +24,11 @@ import {container} from 'tsyringe'; import {Checkbox, CheckboxLabel} from '@wireapp/react-ui-kit'; +import {PropertiesRepository} from 'Repositories/properties/PropertiesRepository'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; import {formatDurationCaption} from 'Util/TimeUtil'; -import {PropertiesRepository} from '../../../../../properties/PropertiesRepository'; import {AppLockRepository} from '../../../../../user/AppLockRepository'; import {AppLockState} from '../../../../../user/AppLockState'; import {CONVERSATION_TYPING_INDICATOR_MODE} from '../../../../../user/TypingIndicatorMode'; diff --git a/src/script/page/MainContent/panels/preferences/avPreferences/CallOptions.tsx b/src/script/page/MainContent/panels/preferences/avPreferences/CallOptions.tsx index 8ec3c87ca58..c7464efdb2e 100644 --- a/src/script/page/MainContent/panels/preferences/avPreferences/CallOptions.tsx +++ b/src/script/page/MainContent/panels/preferences/avPreferences/CallOptions.tsx @@ -26,11 +26,11 @@ import {Checkbox, CheckboxLabel} from '@wireapp/react-ui-kit'; import {WebAppEvents} from '@wireapp/webapp-events'; import type {MediaConstraintsHandler} from 'Repositories/media/MediaConstraintsHandler'; +import type {PropertiesRepository} from 'Repositories/properties/PropertiesRepository'; +import {PROPERTIES_TYPE} from 'Repositories/properties/PropertiesType'; import {t} from 'Util/LocalizerUtil'; import {Config} from '../../../../../Config'; -import type {PropertiesRepository} from '../../../../../properties/PropertiesRepository'; -import {PROPERTIES_TYPE} from '../../../../../properties/PropertiesType'; import {PreferencesSection} from '../components/PreferencesSection'; interface CallOptionsProps { diff --git a/src/script/page/RightSidebar/AddParticipants/AddParticipants.tsx b/src/script/page/RightSidebar/AddParticipants/AddParticipants.tsx index f276abc91ec..ade77a7518f 100644 --- a/src/script/page/RightSidebar/AddParticipants/AddParticipants.tsx +++ b/src/script/page/RightSidebar/AddParticipants/AddParticipants.tsx @@ -33,6 +33,7 @@ import {UserSearchableList} from 'Components/UserSearchableList'; import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; import {IntegrationRepository} from 'Repositories/integration/IntegrationRepository'; import {ServiceEntity} from 'Repositories/integration/ServiceEntity'; +import {SearchRepository} from 'Repositories/search/SearchRepository'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {handleKeyDown} from 'Util/KeyboardUtil'; import {t} from 'Util/LocalizerUtil'; @@ -42,7 +43,6 @@ import {sortUsersByPriority} from 'Util/StringUtil'; import {Conversation} from '../../../entity/Conversation'; import {User} from '../../../entity/User'; import {getManageServicesUrl} from '../../../externalRoute'; -import {SearchRepository} from '../../../search/SearchRepository'; import {TeamRepository} from '../../../team/TeamRepository'; import {TeamState} from '../../../team/TeamState'; import {generatePermissionHelpers} from '../../../user/UserPermission'; diff --git a/src/script/page/RightSidebar/ConversationDetails/ConversationDetails.test.tsx b/src/script/page/RightSidebar/ConversationDetails/ConversationDetails.test.tsx index b9b0805a963..f18298754e2 100644 --- a/src/script/page/RightSidebar/ConversationDetails/ConversationDetails.test.tsx +++ b/src/script/page/RightSidebar/ConversationDetails/ConversationDetails.test.tsx @@ -25,6 +25,8 @@ import {ConversationRepository} from 'Repositories/conversation/ConversationRepo import {ConversationRoleRepository} from 'Repositories/conversation/ConversationRoleRepository'; import {MessageRepository} from 'Repositories/conversation/MessageRepository'; import {IntegrationRepository} from 'Repositories/integration/IntegrationRepository'; +import {SearchRepository} from 'Repositories/search/SearchRepository'; +import {SelfRepository} from 'Repositories/self/SelfRepository'; import {Conversation} from 'src/script/entity/Conversation'; import {createUuid} from 'Util/uuid'; @@ -32,8 +34,6 @@ import {ConversationDetails} from './ConversationDetails'; import {TestFactory} from '../../../../../test/helper/TestFactory'; import {User} from '../../../entity/User'; -import {SearchRepository} from '../../../search/SearchRepository'; -import {SelfRepository} from '../../../self/SelfRepository'; import {TeamEntity} from '../../../team/TeamEntity'; import {TeamRepository} from '../../../team/TeamRepository'; import {TeamState} from '../../../team/TeamState'; diff --git a/src/script/page/RightSidebar/ConversationParticipants/ConversationParticipants.tsx b/src/script/page/RightSidebar/ConversationParticipants/ConversationParticipants.tsx index 84b14e1110a..28097bf9b1d 100644 --- a/src/script/page/RightSidebar/ConversationParticipants/ConversationParticipants.tsx +++ b/src/script/page/RightSidebar/ConversationParticipants/ConversationParticipants.tsx @@ -23,6 +23,7 @@ import {FadingScrollbar} from 'Components/FadingScrollbar'; import {SearchInput} from 'Components/SearchInput'; import {UserSearchableList} from 'Components/UserSearchableList'; import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; +import {SearchRepository} from 'Repositories/search/SearchRepository'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; import {sortUsersByPriority} from 'Util/StringUtil'; @@ -30,7 +31,6 @@ import {sortUsersByPriority} from 'Util/StringUtil'; import {Conversation} from '../../../entity/Conversation'; import {User} from '../../../entity/User'; import {isServiceEntity} from '../../../guards/Service'; -import {SearchRepository} from '../../../search/SearchRepository'; import {TeamRepository} from '../../../team/TeamRepository'; import {PanelHeader} from '../PanelHeader'; import {PanelEntity, PanelState} from '../RightSidebar'; diff --git a/src/script/page/RightSidebar/MessageDetails/MessageDetails.test.tsx b/src/script/page/RightSidebar/MessageDetails/MessageDetails.test.tsx index e410c5a646b..d4dfbe8f603 100644 --- a/src/script/page/RightSidebar/MessageDetails/MessageDetails.test.tsx +++ b/src/script/page/RightSidebar/MessageDetails/MessageDetails.test.tsx @@ -21,6 +21,7 @@ import {render, waitFor} from '@testing-library/react'; import {QualifiedId} from '@wireapp/api-client/lib/user'; import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; +import {SearchRepository} from 'Repositories/search/SearchRepository'; import {Conversation} from 'src/script/entity/Conversation'; import {createUuid} from 'Util/uuid'; @@ -29,7 +30,6 @@ import {MessageDetails} from './MessageDetails'; import {TestFactory} from '../../../../../test/helper/TestFactory'; import {ContentMessage} from '../../../entity/message/ContentMessage'; import {User} from '../../../entity/User'; -import {SearchRepository} from '../../../search/SearchRepository'; import {TeamRepository} from '../../../team/TeamRepository'; import {UserRepository} from '../../../user/UserRepository'; diff --git a/src/script/page/RightSidebar/MessageDetails/UserReactions.tsx b/src/script/page/RightSidebar/MessageDetails/UserReactions.tsx index f5bfa846fc0..bc3bcb65229 100644 --- a/src/script/page/RightSidebar/MessageDetails/UserReactions.tsx +++ b/src/script/page/RightSidebar/MessageDetails/UserReactions.tsx @@ -27,8 +27,8 @@ import { reactionsCountAlignment, } from 'Components/MessagesList/Message/ContentMessage/MessageActions/MessageReactions/MessageReactions.styles'; import {UserList} from 'Components/UserList'; +import {ReactionMap} from 'Repositories/storage'; import {User} from 'src/script/entity/User'; -import {ReactionMap} from 'src/script/storage'; import {getEmojiTitleFromEmojiUnicode, getEmojiUnicode} from 'Util/EmojiUtil'; import {capitalizeFirstChar} from 'Util/StringUtil'; diff --git a/src/script/repositories/backup/BackupRepository.test.ts b/src/script/repositories/backup/BackupRepository.test.ts index c8ff911e278..bcbaa870ad3 100644 --- a/src/script/repositories/backup/BackupRepository.test.ts +++ b/src/script/repositories/backup/BackupRepository.test.ts @@ -22,6 +22,7 @@ import {container} from 'tsyringe'; import {omit} from 'underscore'; import {ClientEvent} from 'Repositories/event/Client'; +import {StorageSchemata, StorageService} from 'Repositories/storage'; import {generateConversation} from 'test/helper/ConversationGenerator'; import {TestFactory} from 'test/helper/TestFactory'; import {generateAPIUser} from 'test/helper/UserGenerator'; @@ -37,8 +38,6 @@ import {handleZipEvent} from './zipWorker'; import {User} from '../../entity/User'; import {DatabaseTypes, createStorageEngine} from '../../service/StoreEngineProvider'; -import {StorageService} from '../../storage'; -import {StorageSchemata} from '../../storage/StorageSchemata'; const conversationId = '35a9a89d-70dc-4d9e-88a2-4d8758458a6a'; diff --git a/src/script/repositories/backup/BackupRepository.ts b/src/script/repositories/backup/BackupRepository.ts index 1436a6a4266..ae7a1ba9082 100644 --- a/src/script/repositories/backup/BackupRepository.ts +++ b/src/script/repositories/backup/BackupRepository.ts @@ -22,6 +22,7 @@ import {omit} from 'underscore'; import type {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; import {isReadableConversation} from 'Repositories/conversation/ConversationSelectors'; +import {ConversationRecord, EventRecord, StorageSchemata, UserRecord} from 'Repositories/storage'; import {chunk} from 'Util/ArrayUtil'; import {Logger, getLogger} from 'Util/Logger'; import {constructUserPrimaryKey} from 'Util/StorageUtil'; @@ -44,9 +45,6 @@ import {preprocessConversations, preprocessEvents, preprocessUsers} from './reco import type {Conversation} from '../../entity/Conversation'; import {User} from '../../entity/User'; -import {EventRecord, UserRecord} from '../../storage'; -import {ConversationRecord} from '../../storage/record/ConversationRecord'; -import {StorageSchemata} from '../../storage/StorageSchemata'; interface Metadata { client_id: string; diff --git a/src/script/repositories/backup/BackupService.ts b/src/script/repositories/backup/BackupService.ts index 8591e6b2435..df1c8c2b037 100644 --- a/src/script/repositories/backup/BackupService.ts +++ b/src/script/repositories/backup/BackupService.ts @@ -22,10 +22,9 @@ import DexieBatch from 'dexie-batch'; import {container} from 'tsyringe'; import {CONVERSATION} from 'Repositories/event/Client'; +import {StorageService} from 'Repositories/storage'; import {Logger, getLogger} from 'Util/Logger'; -import {StorageService} from '../../storage'; - export class BackupService { private readonly logger: Logger; diff --git a/src/script/repositories/backup/recordPreprocessors.ts b/src/script/repositories/backup/recordPreprocessors.ts index 34334b65514..95e13116aa8 100644 --- a/src/script/repositories/backup/recordPreprocessors.ts +++ b/src/script/repositories/backup/recordPreprocessors.ts @@ -18,8 +18,7 @@ */ import {ClientEvent} from 'Repositories/event/Client'; - -import {ConversationRecord, EventRecord, UserRecord} from '../../storage'; +import {ConversationRecord, EventRecord, UserRecord} from 'Repositories/storage'; export function preprocessEvents(events: EventRecord[]): EventRecord[] { // The verification message are not relevant for a new device (no conversation can be verified on a new device). diff --git a/src/script/repositories/cache/CacheRepository.ts b/src/script/repositories/cache/CacheRepository.ts index 2541254ad58..0ec07445411 100644 --- a/src/script/repositories/cache/CacheRepository.ts +++ b/src/script/repositories/cache/CacheRepository.ts @@ -19,10 +19,9 @@ import {amplify} from 'amplify'; +import {StorageKey} from 'Repositories/storage'; import {resetStoreValue} from 'Util/StorageUtil'; -import {StorageKey} from '../../storage/StorageKey'; - export class CacheRepository { public static CACHE_KEY = { // Redefine name from "sw.js" diff --git a/src/script/repositories/calling/CallState.ts b/src/script/repositories/calling/CallState.ts index dfa3c1eced3..1560075bde6 100644 --- a/src/script/repositories/calling/CallState.ts +++ b/src/script/repositories/calling/CallState.ts @@ -26,13 +26,13 @@ import {REASON as CALL_REASON, STATE as CALL_STATE} from '@wireapp/avs'; import {WebAppEvents} from '@wireapp/webapp-events'; import type {ElectronDesktopCapturerSource} from 'Repositories/media/MediaDevicesHandler'; +import {EventName} from 'Repositories/tracking/EventName'; +import {Segmentation} from 'Repositories/tracking/Segmentation'; import {matchQualifiedIds} from 'Util/QualifiedId'; import {Call} from './Call'; import {Config} from '../../Config'; -import {EventName} from '../../tracking/EventName'; -import {Segmentation} from '../../tracking/Segmentation'; import {CallViewTab} from '../../view_model/CallingViewModel'; export enum MuteState { diff --git a/src/script/repositories/calling/CallingRepository.ts b/src/script/repositories/calling/CallingRepository.ts index 35a0ff40cc7..6c88e64f474 100644 --- a/src/script/repositories/calling/CallingRepository.ts +++ b/src/script/repositories/calling/CallingRepository.ts @@ -68,6 +68,10 @@ import {EventSource} from 'Repositories/event/EventSource'; import type {MediaDevicesHandler} from 'Repositories/media/MediaDevicesHandler'; import type {MediaStreamHandler} from 'Repositories/media/MediaStreamHandler'; import {MediaType} from 'Repositories/media/MediaType'; +import {isCountlyEnabledAtCurrentEnvironment} from 'Repositories/tracking/Countly.helpers'; +import {EventName} from 'Repositories/tracking/EventName'; +import * as trackingHelpers from 'Repositories/tracking/Helpers'; +import {Segmentation} from 'Repositories/tracking/Segmentation'; import {flatten} from 'Util/ArrayUtil'; import {calculateChildWindowPosition} from 'Util/DOM/caculateChildWindowPosition'; import {isDetachedCallingFeatureEnabled} from 'Util/isDetachedCallingFeatureEnabled'; @@ -94,10 +98,6 @@ import {APIClient} from '../../service/APIClientSingleton'; import {Core} from '../../service/CoreSingleton'; import {TeamState} from '../../team/TeamState'; import type {ServerTimeHandler} from '../../time/serverTimeHandler'; -import {isCountlyEnabledAtCurrentEnvironment} from '../../tracking/Countly.helpers'; -import {EventName} from '../../tracking/EventName'; -import * as trackingHelpers from '../../tracking/Helpers'; -import {Segmentation} from '../../tracking/Segmentation'; import type {UserRepository} from '../../user/UserRepository'; import {Warnings} from '../../view_model/WarningsContainer'; diff --git a/src/script/repositories/client/ClientEntity.ts b/src/script/repositories/client/ClientEntity.ts index 1bb5548a25a..261a947e9a8 100644 --- a/src/script/repositories/client/ClientEntity.ts +++ b/src/script/repositories/client/ClientEntity.ts @@ -20,12 +20,11 @@ import {ClientClassification, ClientType} from '@wireapp/api-client/lib/client/'; import ko from 'knockout'; +import {ClientRecord} from 'Repositories/storage'; import {splitFingerprint} from 'Util/StringUtil'; import {ClientMapper} from './ClientMapper'; -import {ClientRecord} from '../../storage'; - export enum MLSPublicKeys { ED25519 = 'ed25519', } diff --git a/src/script/repositories/client/ClientMapper.test.ts b/src/script/repositories/client/ClientMapper.test.ts index c4419fafd7c..9547787a9df 100644 --- a/src/script/repositories/client/ClientMapper.test.ts +++ b/src/script/repositories/client/ClientMapper.test.ts @@ -19,12 +19,11 @@ import {ClientType, ClientClassification} from '@wireapp/api-client/lib/client/'; +import {ClientRecord} from 'Repositories/storage'; import {entities, payload} from 'test/api/payloads'; import {ClientMapper} from './ClientMapper'; -import {ClientRecord} from '../../storage'; - describe('ClientMapper', () => { describe('mapClient', () => { it('can map a permanent client payload from the backend', () => { diff --git a/src/script/repositories/client/ClientMapper.ts b/src/script/repositories/client/ClientMapper.ts index 794c1a44f73..96b1ac2aa85 100644 --- a/src/script/repositories/client/ClientMapper.ts +++ b/src/script/repositories/client/ClientMapper.ts @@ -19,10 +19,11 @@ import type {PublicClient, RegisteredClient} from '@wireapp/api-client/lib/client'; +import {ClientRecord} from 'Repositories/storage'; + import {ClientEntity} from './ClientEntity'; import {parseClientId} from './ClientIdUtil'; -import {ClientRecord} from '../../storage'; import {isClientRecord, isClientWithMLSPublicKeys} from '../../util/TypePredicateUtil'; export class ClientMapper { diff --git a/src/script/repositories/client/ClientRepository.test.ts b/src/script/repositories/client/ClientRepository.test.ts index 4fbd2f75f96..ec9cdadfe72 100644 --- a/src/script/repositories/client/ClientRepository.test.ts +++ b/src/script/repositories/client/ClientRepository.test.ts @@ -22,6 +22,7 @@ import {StatusCodes as HTTP_STATUS} from 'http-status-codes'; import {Runtime} from '@wireapp/commons'; +import {ClientRecord} from 'Repositories/storage'; import {User} from 'src/script/entity/User'; import {ClientError} from 'src/script/error/ClientError'; @@ -29,7 +30,6 @@ import {ClientRepository, ClientMapper, ClientEntity} from './.'; import {entities} from '../../../../test/api/payloads'; import {TestFactory} from '../../../../test/helper/TestFactory'; -import {ClientRecord} from '../../storage/record/ClientRecord'; describe('ClientRepository', () => { const testFactory = new TestFactory(); diff --git a/src/script/repositories/client/ClientRepository.ts b/src/script/repositories/client/ClientRepository.ts index afcd49ef6f9..730b256e0d1 100644 --- a/src/script/repositories/client/ClientRepository.ts +++ b/src/script/repositories/client/ClientRepository.ts @@ -31,6 +31,7 @@ import {WebAppEvents} from '@wireapp/webapp-events'; import {PrimaryModal} from 'Components/Modals/PrimaryModal'; import type {CryptographyRepository} from 'Repositories/cryptography/CryptographyRepository'; +import {ClientRecord, StorageKey} from 'Repositories/storage'; import {t} from 'Util/LocalizerUtil'; import {getLogger, Logger} from 'Util/Logger'; import {matchQualifiedIds} from 'Util/QualifiedId'; @@ -47,8 +48,6 @@ import {SIGN_OUT_REASON} from '../../auth/SignOutReason'; import type {User} from '../../entity/User'; import {ClientError} from '../../error/ClientError'; import {Core} from '../../service/CoreSingleton'; -import {ClientRecord} from '../../storage'; -import {StorageKey} from '../../storage/StorageKey'; export type UserClientEntityMap = {[userId: string]: ClientEntity[]}; export type QualifiedUserClientEntityMap = {[domain: string]: UserClientEntityMap}; diff --git a/src/script/repositories/client/ClientService.ts b/src/script/repositories/client/ClientService.ts index bffbccf4309..548ec70fa1e 100644 --- a/src/script/repositories/client/ClientService.ts +++ b/src/script/repositories/client/ClientService.ts @@ -21,10 +21,10 @@ import type {RegisteredClient, QualifiedUserClientMap, ClientCapabilityData} fro import type {QualifiedId} from '@wireapp/api-client/lib/user'; import {container} from 'tsyringe'; +import type {ClientRecord} from 'Repositories/storage'; +import {StorageSchemata, StorageService} from 'Repositories/storage'; + import {APIClient} from '../../service/APIClientSingleton'; -import type {ClientRecord} from '../../storage'; -import {StorageService} from '../../storage'; -import {StorageSchemata} from '../../storage/StorageSchemata'; export class ClientService { private readonly CLIENT_STORE_NAME: string; diff --git a/src/script/repositories/conversation/ConversationEphemeralHandler.ts b/src/script/repositories/conversation/ConversationEphemeralHandler.ts index d752e741a70..e13ee42131f 100644 --- a/src/script/repositories/conversation/ConversationEphemeralHandler.ts +++ b/src/script/repositories/conversation/ConversationEphemeralHandler.ts @@ -23,6 +23,7 @@ import ko from 'knockout'; import {Article, LinkPreview} from '@wireapp/protocol-messaging'; import type {EventService} from 'Repositories/event/EventService'; +import type {EventRecord} from 'Repositories/storage'; import {getLogger, Logger} from 'Util/Logger'; import {clamp} from 'Util/NumberUtil'; import {obfuscate} from 'Util/StringUtil'; @@ -39,7 +40,6 @@ import type {Message} from '../../entity/message/Message'; import {Text} from '../../entity/message/Text'; import {EphemeralStatusType} from '../../message/EphemeralStatusType'; import {StatusType} from '../../message/StatusType'; -import type {EventRecord} from '../../storage'; export class ConversationEphemeralHandler extends AbstractConversationEventHandler { eventListeners: Record void>; diff --git a/src/script/repositories/conversation/ConversationLabelRepository.ts b/src/script/repositories/conversation/ConversationLabelRepository.ts index 59f4ae25bef..95e6de226ca 100644 --- a/src/script/repositories/conversation/ConversationLabelRepository.ts +++ b/src/script/repositories/conversation/ConversationLabelRepository.ts @@ -24,6 +24,7 @@ import ko from 'knockout'; import {WebAppEvents} from '@wireapp/webapp-events'; import {PrimaryModal} from 'Components/Modals/PrimaryModal'; +import type {PropertiesService} from 'Repositories/properties/PropertiesService'; import {SidebarTabs, useSidebarStore} from 'src/script/page/LeftSidebar/panels/Conversations/useSidebarStore'; import {t} from 'Util/LocalizerUtil'; import {getLogger, Logger} from 'Util/Logger'; @@ -31,7 +32,6 @@ import {TypedEventTarget} from 'Util/TypedEventTarget'; import {createUuid} from 'Util/uuid'; import type {Conversation} from '../../entity/Conversation'; -import type {PropertiesService} from '../../properties/PropertiesService'; export enum LabelType { Custom = 0, diff --git a/src/script/repositories/conversation/ConversationMapper.ts b/src/script/repositories/conversation/ConversationMapper.ts index 79ec84a5105..e352344874b 100644 --- a/src/script/repositories/conversation/ConversationMapper.ts +++ b/src/script/repositories/conversation/ConversationMapper.ts @@ -32,6 +32,8 @@ import {isObject} from 'underscore'; import {LegalHoldStatus} from '@wireapp/protocol-messaging'; +import {ConversationRecord} from 'Repositories/storage'; + import {ACCESS_STATE} from './AccessState'; import {ConversationStatus} from './ConversationStatus'; import {ConversationVerificationState} from './ConversationVerificationState'; @@ -39,7 +41,6 @@ import {ConversationVerificationState} from './ConversationVerificationState'; import {Conversation} from '../../entity/Conversation'; import {BaseError, BASE_ERROR_TYPE} from '../../error/BaseError'; import {ConversationError} from '../../error/ConversationError'; -import {ConversationRecord} from '../../storage/record/ConversationRecord'; /** Conversation self data from the database. */ export interface SelfStatusUpdateDatabaseData { diff --git a/src/script/repositories/conversation/ConversationRepository.test.ts b/src/script/repositories/conversation/ConversationRepository.test.ts index 037a7a276b1..d6d96053015 100644 --- a/src/script/repositories/conversation/ConversationRepository.test.ts +++ b/src/script/repositories/conversation/ConversationRepository.test.ts @@ -58,12 +58,13 @@ import {ClientEvent, CONVERSATION} from 'Repositories/event/Client'; import {EventRepository} from 'Repositories/event/EventRepository'; import {EventService} from 'Repositories/event/EventService'; import {NOTIFICATION_HANDLING_STATE} from 'Repositories/event/NotificationHandlingState'; +import {SelfRepository} from 'Repositories/self/SelfRepository'; +import {LegacyEventRecord, StorageSchemata, StorageService} from 'Repositories/storage'; import {Config} from 'src/script/Config'; import {Conversation} from 'src/script/entity/Conversation'; import {Message} from 'src/script/entity/message/Message'; import {User} from 'src/script/entity/User'; import {ConversationError} from 'src/script/error/ConversationError'; -import {StorageSchemata} from 'src/script/storage/StorageSchemata'; import { generateConversation as _generateConversation, generateAPIConversation, @@ -85,9 +86,7 @@ import {NOTIFICATION_STATE} from './NotificationSetting'; import {entities, payload} from '../../../../test/api/payloads'; import {TestFactory} from '../../../../test/helper/TestFactory'; import {generateUser} from '../../../../test/helper/UserGenerator'; -import {SelfRepository} from '../../self/SelfRepository'; import {Core} from '../../service/CoreSingleton'; -import {LegacyEventRecord, StorageService} from '../../storage'; import {TeamRepository} from '../../team/TeamRepository'; import {TeamState} from '../../team/TeamState'; import {UserRepository} from '../../user/UserRepository'; diff --git a/src/script/repositories/conversation/ConversationRepository.ts b/src/script/repositories/conversation/ConversationRepository.ts index d4a26b6b472..335f02d7453 100644 --- a/src/script/repositories/conversation/ConversationRepository.ts +++ b/src/script/repositories/conversation/ConversationRepository.ts @@ -71,6 +71,10 @@ import {EventRepository} from 'Repositories/event/EventRepository'; import {EventService} from 'Repositories/event/EventService'; import {EventSource} from 'Repositories/event/EventSource'; import {NOTIFICATION_HANDLING_STATE} from 'Repositories/event/NotificationHandlingState'; +import {PropertiesRepository} from 'Repositories/properties/PropertiesRepository'; +import {SelfRepository} from 'Repositories/self/SelfRepository'; +import type {EventRecord} from 'Repositories/storage'; +import {ConversationRecord} from 'Repositories/storage'; import {getNextItem} from 'Util/ArrayUtil'; import {allowsAllFiles, getFileExtensionOrName, isAllowedFile} from 'Util/FileTypeUtil'; import {replaceLink, t} from 'Util/LocalizerUtil'; @@ -152,11 +156,7 @@ import * as LegalHoldEvaluator from '../../legal-hold/LegalHoldEvaluator'; import {MessageCategory} from '../../message/MessageCategory'; import {SystemMessageType} from '../../message/SystemMessageType'; import {addOtherSelfClientsToMLSConversation} from '../../mls'; -import {PropertiesRepository} from '../../properties/PropertiesRepository'; -import {SelfRepository} from '../../self/SelfRepository'; import {Core} from '../../service/CoreSingleton'; -import type {EventRecord} from '../../storage'; -import {ConversationRecord} from '../../storage/record/ConversationRecord'; import {TeamRepository} from '../../team/TeamRepository'; import {TeamState} from '../../team/TeamState'; import {ServerTimeHandler} from '../../time/serverTimeHandler'; diff --git a/src/script/repositories/conversation/ConversationService.ts b/src/script/repositories/conversation/ConversationService.ts index e8a4eb6b266..bc6d63b4475 100644 --- a/src/script/repositories/conversation/ConversationService.ts +++ b/src/script/repositories/conversation/ConversationService.ts @@ -46,17 +46,15 @@ import {QualifiedId} from '@wireapp/api-client/lib/user'; import {container} from 'tsyringe'; import type {EventService} from 'Repositories/event/EventService'; +import {search as fullTextSearch} from 'Repositories/search/FullTextSearch'; +import {ConversationRecord, StorageSchemata, StorageService} from 'Repositories/storage'; import {MLSCapableConversation} from './ConversationSelectors'; import type {Conversation as ConversationEntity} from '../../entity/Conversation'; import {MessageCategory} from '../../message/MessageCategory'; -import {search as fullTextSearch} from '../../search/FullTextSearch'; import {APIClient} from '../../service/APIClientSingleton'; import {Core} from '../../service/CoreSingleton'; -import {StorageService} from '../../storage'; -import {ConversationRecord} from '../../storage/record/ConversationRecord'; -import {StorageSchemata} from '../../storage/StorageSchemata'; export class ConversationService { private readonly eventService: EventService; diff --git a/src/script/repositories/conversation/EventBuilder.ts b/src/script/repositories/conversation/EventBuilder.ts index 7938f796856..18f92b1c612 100644 --- a/src/script/repositories/conversation/EventBuilder.ts +++ b/src/script/repositories/conversation/EventBuilder.ts @@ -33,6 +33,7 @@ import type {Asset, LegalHoldStatus} from '@wireapp/protocol-messaging'; import {AssetTransferState} from 'Repositories/assets/AssetTransferState'; import {ClientEvent, CONVERSATION} from 'Repositories/event/Client'; +import {ReactionMap, ReadReceipt, UserReactionMap} from 'Repositories/storage'; import {createUuid} from 'Util/uuid'; import type {Conversation} from '../../entity/Conversation'; @@ -41,7 +42,6 @@ import type {User} from '../../entity/User'; import {E2EIVerificationMessageType} from '../../message/E2EIVerificationMessageType'; import {StatusType} from '../../message/StatusType'; import {VerificationMessageType} from '../../message/VerificationMessageType'; -import {ReactionMap, ReadReceipt, UserReactionMap} from '../../storage'; export interface BaseEvent { conversation: string; diff --git a/src/script/repositories/conversation/EventMapper.ts b/src/script/repositories/conversation/EventMapper.ts index 5c2100b689a..631330333d4 100644 --- a/src/script/repositories/conversation/EventMapper.ts +++ b/src/script/repositories/conversation/EventMapper.ts @@ -27,6 +27,7 @@ import {AssetTransferState} from 'Repositories/assets/AssetTransferState'; import {TERMINATION_REASON} from 'Repositories/calling/enum/TerminationReason'; import {AssetData} from 'Repositories/cryptography/CryptographyMapper'; import {ClientEvent} from 'Repositories/event/Client'; +import type {EventRecord, LegacyEventRecord} from 'Repositories/storage'; import {t} from 'Util/LocalizerUtil'; import {getLogger, Logger} from 'Util/Logger'; import {userReactionMapToReactionMap} from 'Util/ReactionUtil'; @@ -85,7 +86,6 @@ import {QuoteEntity} from '../../message/QuoteEntity'; import {StatusType} from '../../message/StatusType'; import {SystemMessageType} from '../../message/SystemMessageType'; import {APIClient} from '../../service/APIClientSingleton'; -import type {EventRecord, LegacyEventRecord} from '../../storage'; // Event Mapper to convert all server side JSON events into core entities. export class EventMapper { diff --git a/src/script/repositories/conversation/MessageRepository.test.ts b/src/script/repositories/conversation/MessageRepository.test.ts index 07d06cd18c5..d9056bd42f2 100644 --- a/src/script/repositories/conversation/MessageRepository.test.ts +++ b/src/script/repositories/conversation/MessageRepository.test.ts @@ -33,6 +33,8 @@ import {ConnectionEntity} from 'Repositories/connection/ConnectionEntity'; import {CryptographyRepository} from 'Repositories/cryptography/CryptographyRepository'; import {EventRepository} from 'Repositories/event/EventRepository'; import {EventService} from 'Repositories/event/EventService'; +import {PropertiesRepository} from 'Repositories/properties/PropertiesRepository'; +import {ReactionMap} from 'Repositories/storage'; import {Conversation} from 'src/script/entity/Conversation'; import {Message} from 'src/script/entity/message/Message'; import {Text} from 'src/script/entity/message/Text'; @@ -47,8 +49,6 @@ import {MessageRepository} from './MessageRepository'; import {ContentMessage} from '../../entity/message/ContentMessage'; import {StatusType} from '../../message/StatusType'; -import {PropertiesRepository} from '../../properties/PropertiesRepository'; -import {ReactionMap} from '../../storage'; import {TeamState} from '../../team/TeamState'; import {ServerTimeHandler, serverTimeHandler} from '../../time/serverTimeHandler'; import {UserRepository} from '../../user/UserRepository'; diff --git a/src/script/repositories/conversation/MessageRepository.ts b/src/script/repositories/conversation/MessageRepository.ts index c18421b5bbb..2cbb2557aea 100644 --- a/src/script/repositories/conversation/MessageRepository.ts +++ b/src/script/repositories/conversation/MessageRepository.ts @@ -63,6 +63,13 @@ import {EventRepository} from 'Repositories/event/EventRepository'; import {EventService} from 'Repositories/event/EventService'; import {EventTypeHandling} from 'Repositories/event/EventTypeHandling'; import {NOTIFICATION_HANDLING_STATE} from 'Repositories/event/NotificationHandlingState'; +import {PropertiesRepository} from 'Repositories/properties/PropertiesRepository'; +import {PROPERTIES_TYPE} from 'Repositories/properties/PropertiesType'; +import type {EventRecord, ReactionMap} from 'Repositories/storage'; +import {UserType} from 'Repositories/tracking/attribute'; +import {EventName} from 'Repositories/tracking/EventName'; +import * as trackingHelpers from 'Repositories/tracking/Helpers'; +import {Segmentation} from 'Repositories/tracking/Segmentation'; import { cancelSendingLinkPreview, clearLinkPreviewSendingState, @@ -99,16 +106,9 @@ import {showLegalHoldWarningModal} from '../../legal-hold/LegalHoldWarning'; import {MentionEntity} from '../../message/MentionEntity'; import {QuoteEntity} from '../../message/QuoteEntity'; import {StatusType} from '../../message/StatusType'; -import {PropertiesRepository} from '../../properties/PropertiesRepository'; -import {PROPERTIES_TYPE} from '../../properties/PropertiesType'; import {Core} from '../../service/CoreSingleton'; -import type {EventRecord, ReactionMap} from '../../storage'; import {TeamState} from '../../team/TeamState'; import {ServerTimeHandler} from '../../time/serverTimeHandler'; -import {UserType} from '../../tracking/attribute'; -import {EventName} from '../../tracking/EventName'; -import * as trackingHelpers from '../../tracking/Helpers'; -import {Segmentation} from '../../tracking/Segmentation'; import {protoFromType} from '../../user/AvailabilityMapper'; import {UserRepository} from '../../user/UserRepository'; import {UserState} from '../../user/UserState'; diff --git a/src/script/repositories/event/EventRepository.ts b/src/script/repositories/event/EventRepository.ts index 864472f538a..af414b1b35b 100644 --- a/src/script/repositories/event/EventRepository.ts +++ b/src/script/repositories/event/EventRepository.ts @@ -33,6 +33,7 @@ import {WebAppEvents} from '@wireapp/webapp-events'; import {ClientConversationEvent, EventBuilder} from 'Repositories/conversation/EventBuilder'; import {CryptographyMapper} from 'Repositories/cryptography/CryptographyMapper'; +import {EventName} from 'Repositories/tracking/EventName'; import {getLogger, Logger} from 'Util/Logger'; import {queue} from 'Util/PromiseQueue'; import {TIME_IN_MILLIS} from 'Util/TimeUtil'; @@ -51,7 +52,6 @@ import {EventValidationError} from './preprocessor/EventStorageMiddleware/eventH import {CryptographyError} from '../../error/CryptographyError'; import {EventError} from '../../error/EventError'; import type {ServerTimeHandler} from '../../time/serverTimeHandler'; -import {EventName} from '../../tracking/EventName'; import {UserState} from '../../user/UserState'; import {Warnings} from '../../view_model/WarningsContainer'; diff --git a/src/script/repositories/event/EventService.ts b/src/script/repositories/event/EventService.ts index 26450536d30..0583c498bcd 100644 --- a/src/script/repositories/event/EventService.ts +++ b/src/script/repositories/event/EventService.ts @@ -25,6 +25,13 @@ import {container} from 'tsyringe'; import {Asset as ProtobufAsset} from '@wireapp/protocol-messaging'; import {AssetTransferState} from 'Repositories/assets/AssetTransferState'; +import { + StorageService, + StorageSchemata, + DatabaseListenerCallback, + LegacyEventRecord, + EventRecord, +} from 'Repositories/storage'; import {getLogger, Logger} from 'Util/Logger'; import {ClientEvent, CONVERSATION as CLIENT_CONVERSATION_EVENT} from './Client'; @@ -34,8 +41,6 @@ import {ConversationError} from '../../error/ConversationError'; import {StorageError} from '../../error/StorageError'; import {categoryFromEvent} from '../../message/MessageCategorization'; import {MessageCategory} from '../../message/MessageCategory'; -import {StorageService, DatabaseListenerCallback, LegacyEventRecord, EventRecord} from '../../storage'; -import {StorageSchemata} from '../../storage/StorageSchemata'; export type Includes = {includeFrom: boolean; includeTo: boolean}; type DexieCollection = Dexie.Collection; diff --git a/src/script/repositories/event/NotificationService.ts b/src/script/repositories/event/NotificationService.ts index 5f7d7e674d7..bed1d7915a6 100644 --- a/src/script/repositories/event/NotificationService.ts +++ b/src/script/repositories/event/NotificationService.ts @@ -21,8 +21,9 @@ import type {NotificationList} from '@wireapp/api-client/lib/notification/'; import {DatabaseKeys} from '@wireapp/core/lib/notification/NotificationDatabaseRepository'; import {container} from 'tsyringe'; +import {StorageSchemata, StorageService} from 'Repositories/storage'; + import {APIClient} from '../../service/APIClientSingleton'; -import {StorageSchemata, StorageService} from '../../storage/'; export class NotificationService { private readonly AMPLIFY_STORE_NAME: string; diff --git a/src/script/repositories/event/preprocessor/EventStorageMiddleware/EventStorageMiddleware.ts b/src/script/repositories/event/preprocessor/EventStorageMiddleware/EventStorageMiddleware.ts index 2a53f991785..651ad7e7c99 100644 --- a/src/script/repositories/event/preprocessor/EventStorageMiddleware/EventStorageMiddleware.ts +++ b/src/script/repositories/event/preprocessor/EventStorageMiddleware/EventStorageMiddleware.ts @@ -21,6 +21,7 @@ import {CONVERSATION_EVENT} from '@wireapp/api-client/lib/event'; import {container} from 'tsyringe'; import {ConversationState} from 'Repositories/conversation/ConversationState'; +import type {EventRecord} from 'Repositories/storage'; import {User} from 'src/script/entity/User'; import {UserFilter} from 'src/script/user/UserFilter'; import {matchQualifiedIds} from 'Util/QualifiedId'; @@ -30,7 +31,6 @@ import {EventValidationError} from './eventHandlers/EventValidationError'; import {HandledEvents, DBOperation} from './types'; import {isEventRecordFailed, isEventRecordWithFederationError} from '../../../../message/StatusType'; -import type {EventRecord} from '../../../../storage'; import {CONVERSATION} from '../../Client'; import {EventMiddleware, IncomingEvent} from '../../EventProcessor'; import {EventService} from '../../EventService'; diff --git a/src/script/repositories/event/preprocessor/EventStorageMiddleware/eventHandlers/assetEventHandler.ts b/src/script/repositories/event/preprocessor/EventStorageMiddleware/eventHandlers/assetEventHandler.ts index 52b543a4a67..aa4d592e6a8 100644 --- a/src/script/repositories/event/preprocessor/EventStorageMiddleware/eventHandlers/assetEventHandler.ts +++ b/src/script/repositories/event/preprocessor/EventStorageMiddleware/eventHandlers/assetEventHandler.ts @@ -21,7 +21,7 @@ import {Asset as ProtobufAsset} from '@wireapp/protocol-messaging'; import {AssetTransferState} from 'Repositories/assets/AssetTransferState'; import {AssetAddEvent} from 'Repositories/conversation/EventBuilder'; -import {StoredEvent} from 'src/script/storage'; +import {StoredEvent} from 'Repositories/storage'; import {EventValidationError} from './EventValidationError'; diff --git a/src/script/repositories/event/preprocessor/EventStorageMiddleware/eventHandlers/editedEventHandler.ts b/src/script/repositories/event/preprocessor/EventStorageMiddleware/eventHandlers/editedEventHandler.ts index 88395f41a8a..69b7504a839 100644 --- a/src/script/repositories/event/preprocessor/EventStorageMiddleware/eventHandlers/editedEventHandler.ts +++ b/src/script/repositories/event/preprocessor/EventStorageMiddleware/eventHandlers/editedEventHandler.ts @@ -18,8 +18,8 @@ */ import {MessageAddEvent} from 'Repositories/conversation/EventBuilder'; +import {StoredEvent} from 'Repositories/storage'; import {EventError} from 'src/script/error/EventError'; -import {StoredEvent} from 'src/script/storage'; import {getCommonMessageUpdates} from './getCommonMessageUpdates'; diff --git a/src/script/repositories/event/preprocessor/EventStorageMiddleware/eventHandlers/getCommonMessageUpdates.ts b/src/script/repositories/event/preprocessor/EventStorageMiddleware/eventHandlers/getCommonMessageUpdates.ts index 9c7a4f4fbce..b6de205eabf 100644 --- a/src/script/repositories/event/preprocessor/EventStorageMiddleware/eventHandlers/getCommonMessageUpdates.ts +++ b/src/script/repositories/event/preprocessor/EventStorageMiddleware/eventHandlers/getCommonMessageUpdates.ts @@ -18,7 +18,7 @@ */ import {MessageAddEvent} from 'Repositories/conversation/EventBuilder'; -import {StoredEvent} from 'src/script/storage'; +import {StoredEvent} from 'Repositories/storage'; export function getCommonMessageUpdates(originalEvent: StoredEvent, newEvent: MessageAddEvent) { return { diff --git a/src/script/repositories/event/preprocessor/EventStorageMiddleware/eventHandlers/linkPreviewEventHandler.ts b/src/script/repositories/event/preprocessor/EventStorageMiddleware/eventHandlers/linkPreviewEventHandler.ts index ff21a4ec22d..ed1ac575825 100644 --- a/src/script/repositories/event/preprocessor/EventStorageMiddleware/eventHandlers/linkPreviewEventHandler.ts +++ b/src/script/repositories/event/preprocessor/EventStorageMiddleware/eventHandlers/linkPreviewEventHandler.ts @@ -18,8 +18,8 @@ */ import {MessageAddEvent} from 'Repositories/conversation/EventBuilder'; +import {StoredEvent} from 'Repositories/storage'; import {categoryFromEvent} from 'src/script/message/MessageCategorization'; -import {StoredEvent} from 'src/script/storage'; import {EventValidationError} from './EventValidationError'; import {getCommonMessageUpdates} from './getCommonMessageUpdates'; diff --git a/src/script/repositories/event/preprocessor/EventStorageMiddleware/eventHandlers/reactionEventHandler.ts b/src/script/repositories/event/preprocessor/EventStorageMiddleware/eventHandlers/reactionEventHandler.ts index 966039a61f0..68109d1ca96 100644 --- a/src/script/repositories/event/preprocessor/EventStorageMiddleware/eventHandlers/reactionEventHandler.ts +++ b/src/script/repositories/event/preprocessor/EventStorageMiddleware/eventHandlers/reactionEventHandler.ts @@ -18,7 +18,7 @@ */ import {MessageAddEvent, ReactionEvent} from 'Repositories/conversation/EventBuilder'; -import {StoredEvent} from 'src/script/storage'; +import {StoredEvent} from 'Repositories/storage'; import {addReaction, userReactionMapToReactionMap} from 'Util/ReactionUtil'; import {EventValidationError} from './EventValidationError'; diff --git a/src/script/repositories/event/preprocessor/EventStorageMiddleware/types.ts b/src/script/repositories/event/preprocessor/EventStorageMiddleware/types.ts index f93355c42a7..ee36d8bb8d3 100644 --- a/src/script/repositories/event/preprocessor/EventStorageMiddleware/types.ts +++ b/src/script/repositories/event/preprocessor/EventStorageMiddleware/types.ts @@ -20,7 +20,7 @@ import {ConversationEvent} from '@wireapp/api-client/lib/event'; import {ClientConversationEvent} from 'Repositories/conversation/EventBuilder'; -import {EventRecord} from 'src/script/storage'; +import {EventRecord} from 'Repositories/storage'; import {IdentifiedUpdatePayload} from '../../EventService'; diff --git a/src/script/repositories/event/preprocessor/QuoteDecoderMiddleware.ts b/src/script/repositories/event/preprocessor/QuoteDecoderMiddleware.ts index 5666e106bcc..e12048fb96b 100644 --- a/src/script/repositories/event/preprocessor/QuoteDecoderMiddleware.ts +++ b/src/script/repositories/event/preprocessor/QuoteDecoderMiddleware.ts @@ -20,11 +20,11 @@ import {Quote} from '@wireapp/protocol-messaging'; import {MessageAddEvent} from 'Repositories/conversation/EventBuilder'; +import {StoredEvent} from 'Repositories/storage'; import {getLogger, Logger} from 'Util/Logger'; import {base64ToArray} from 'Util/util'; import {QuoteEntity} from '../../../message/QuoteEntity'; -import {StoredEvent} from '../../../storage/record/EventRecord'; import {ClientEvent} from '../Client'; import {EventMiddleware, IncomingEvent} from '../EventProcessor'; import type {EventService} from '../EventService'; diff --git a/src/script/repositories/event/preprocessor/ReceiptsMiddleware.ts b/src/script/repositories/event/preprocessor/ReceiptsMiddleware.ts index 165884e4a3b..df1a4271c61 100644 --- a/src/script/repositories/event/preprocessor/ReceiptsMiddleware.ts +++ b/src/script/repositories/event/preprocessor/ReceiptsMiddleware.ts @@ -21,11 +21,11 @@ import {RECEIPT_MODE} from '@wireapp/api-client/lib/conversation/data'; import type {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; import {ConfirmationEvent} from 'Repositories/conversation/EventBuilder'; +import type {EventRecord} from 'Repositories/storage'; import {User} from 'src/script/entity/User'; import {getLogger, Logger} from 'Util/Logger'; import {StatusType} from '../../../message/StatusType'; -import type {EventRecord} from '../../../storage/record/EventRecord'; import {ClientEvent} from '../Client'; import {EventMiddleware, IncomingEvent} from '../EventProcessor'; import type {EventService} from '../EventService'; diff --git a/src/script/repositories/event/preprocessor/RepliesUpdaterMiddleware.ts b/src/script/repositories/event/preprocessor/RepliesUpdaterMiddleware.ts index a108effeb72..5ade64e1f9b 100644 --- a/src/script/repositories/event/preprocessor/RepliesUpdaterMiddleware.ts +++ b/src/script/repositories/event/preprocessor/RepliesUpdaterMiddleware.ts @@ -18,10 +18,10 @@ */ import {DeleteEvent, MessageAddEvent} from 'Repositories/conversation/EventBuilder'; +import {StoredEvent} from 'Repositories/storage'; import {getLogger, Logger} from 'Util/Logger'; import {QuoteEntity} from '../../../message/QuoteEntity'; -import {StoredEvent} from '../../../storage/record/EventRecord'; import {ClientEvent} from '../Client'; import {EventMiddleware, IncomingEvent} from '../EventProcessor'; import type {EventService} from '../EventService'; diff --git a/src/script/repositories/media/MediaRepository.ts b/src/script/repositories/media/MediaRepository.ts index 997c2fe7db2..3ba15489d83 100644 --- a/src/script/repositories/media/MediaRepository.ts +++ b/src/script/repositories/media/MediaRepository.ts @@ -17,12 +17,12 @@ * */ +import type {PermissionRepository} from 'Repositories/permission/PermissionRepository'; + import {MediaConstraintsHandler} from './MediaConstraintsHandler'; import {MediaDevicesHandler} from './MediaDevicesHandler'; import {MediaStreamHandler} from './MediaStreamHandler'; -import type {PermissionRepository} from '../../permission/PermissionRepository'; - export class MediaRepository { public constraintsHandler: MediaConstraintsHandler; public devicesHandler: MediaDevicesHandler; diff --git a/src/script/repositories/media/MediaStreamHandler.test.ts b/src/script/repositories/media/MediaStreamHandler.test.ts index ca7f070f590..f9044f1f55f 100644 --- a/src/script/repositories/media/MediaStreamHandler.test.ts +++ b/src/script/repositories/media/MediaStreamHandler.test.ts @@ -17,7 +17,7 @@ * */ -import {PermissionRepository} from 'src/script/permission/PermissionRepository'; +import {PermissionRepository} from 'Repositories/permission/PermissionRepository'; import {MediaConstraintsHandler} from './MediaConstraintsHandler'; import {CurrentAvailableDeviceId} from './MediaDevicesHandler'; diff --git a/src/script/repositories/media/MediaStreamHandler.ts b/src/script/repositories/media/MediaStreamHandler.ts index 45c069b7442..4c73c1ab6f8 100644 --- a/src/script/repositories/media/MediaStreamHandler.ts +++ b/src/script/repositories/media/MediaStreamHandler.ts @@ -22,6 +22,9 @@ import {container} from 'tsyringe'; import {Runtime} from '@wireapp/commons'; import {CallingViewMode, CallState} from 'Repositories/calling/CallState'; +import type {PermissionRepository} from 'Repositories/permission/PermissionRepository'; +import {PermissionStatusState} from 'Repositories/permission/PermissionStatusState'; +import {PermissionType} from 'Repositories/permission/PermissionType'; import {getLogger, Logger} from 'Util/Logger'; import {MediaConstraintsHandler, ScreensharingMethods} from './MediaConstraintsHandler'; @@ -32,9 +35,6 @@ import {MediaType} from './MediaType'; import {MediaError} from '../../error/MediaError'; import {NoAudioInputError} from '../../error/NoAudioInputError'; import {PermissionError} from '../../error/PermissionError'; -import type {PermissionRepository} from '../../permission/PermissionRepository'; -import {PermissionStatusState} from '../../permission/PermissionStatusState'; -import {PermissionType} from '../../permission/PermissionType'; import {Warnings} from '../../view_model/WarningsContainer'; export class MediaStreamHandler { diff --git a/src/script/notification/NotificationRepository.test.ts b/src/script/repositories/notification/NotificationRepository.test.ts similarity index 99% rename from src/script/notification/NotificationRepository.test.ts rename to src/script/repositories/notification/NotificationRepository.test.ts index 5bb802f445b..96e8714c30b 100644 --- a/src/script/notification/NotificationRepository.test.ts +++ b/src/script/repositories/notification/NotificationRepository.test.ts @@ -38,6 +38,8 @@ import {ConversationMapper} from 'Repositories/conversation/ConversationMapper'; import {ConversationState} from 'Repositories/conversation/ConversationState'; import {NOTIFICATION_STATE} from 'Repositories/conversation/NotificationSetting'; import {NOTIFICATION_HANDLING_STATE} from 'Repositories/event/NotificationHandlingState'; +import {PermissionRepository} from 'Repositories/permission/PermissionRepository'; +import {PermissionStatusState} from 'Repositories/permission/PermissionStatusState'; import {Conversation} from 'src/script/entity/Conversation'; import {CallMessage} from 'src/script/entity/message/CallMessage'; import {CompositeMessage} from 'src/script/entity/message/CompositeMessage'; @@ -56,7 +58,6 @@ import {MentionEntity} from 'src/script/message/MentionEntity'; import {QuoteEntity} from 'src/script/message/QuoteEntity'; import {SystemMessageType} from 'src/script/message/SystemMessageType'; import {ContentState, useAppState} from 'src/script/page/useAppState'; -import {PermissionStatusState} from 'src/script/permission/PermissionStatusState'; import {entities, payload} from 'test/api/payloads'; import {t} from 'Util/LocalizerUtil'; import {truncate} from 'Util/StringUtil'; @@ -64,10 +65,9 @@ import {createUuid} from 'Util/uuid'; import {NotificationRepository} from './NotificationRepository'; -import {Message} from '../entity/message/Message'; -import {PermissionRepository} from '../permission/PermissionRepository'; -import {UserMapper} from '../user/UserMapper'; -import {UserState} from '../user/UserState'; +import {Message} from '../../entity/message/Message'; +import {UserMapper} from '../../user/UserMapper'; +import {UserState} from '../../user/UserState'; function buildNotificationRepository() { const userState = container.resolve(UserState); diff --git a/src/script/notification/NotificationRepository.ts b/src/script/repositories/notification/NotificationRepository.ts similarity index 96% rename from src/script/notification/NotificationRepository.ts rename to src/script/repositories/notification/NotificationRepository.ts index 108f8d2e02d..39d602aff09 100644 --- a/src/script/notification/NotificationRepository.ts +++ b/src/script/repositories/notification/NotificationRepository.ts @@ -37,6 +37,9 @@ import type {ConnectionEntity} from 'Repositories/connection/ConnectionEntity'; import {ConversationEphemeralHandler} from 'Repositories/conversation/ConversationEphemeralHandler'; import type {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; import {ConversationState} from 'Repositories/conversation/ConversationState'; +import type {PermissionRepository} from 'Repositories/permission/PermissionRepository'; +import {PermissionStatusState} from 'Repositories/permission/PermissionStatusState'; +import {PermissionType} from 'Repositories/permission/PermissionType'; import {Declension, t, getUserName} from 'Util/LocalizerUtil'; import {getLogger, Logger} from 'Util/Logger'; import {getRenderedTextContent} from 'Util/messageRenderer'; @@ -46,24 +49,21 @@ import {ValidationUtilError} from 'Util/ValidationUtil'; import {PermissionState} from './PermissionState'; -import type {Conversation} from '../entity/Conversation'; -import type {CallMessage} from '../entity/message/CallMessage'; -import type {ContentMessage} from '../entity/message/ContentMessage'; -import type {DeleteConversationMessage} from '../entity/message/DeleteConversationMessage'; -import type {MemberMessage} from '../entity/message/MemberMessage'; -import type {Message} from '../entity/message/Message'; -import type {MessageTimerUpdateMessage} from '../entity/message/MessageTimerUpdateMessage'; -import type {RenameMessage} from '../entity/message/RenameMessage'; -import type {SystemMessage} from '../entity/message/SystemMessage'; -import type {User} from '../entity/User'; -import {SuperType} from '../message/SuperType'; -import {SystemMessageType} from '../message/SystemMessageType'; -import {ContentState, useAppState} from '../page/useAppState'; -import type {PermissionRepository} from '../permission/PermissionRepository'; -import {PermissionStatusState} from '../permission/PermissionStatusState'; -import {PermissionType} from '../permission/PermissionType'; -import {UserState} from '../user/UserState'; -import {Warnings} from '../view_model/WarningsContainer'; +import type {Conversation} from '../../entity/Conversation'; +import type {CallMessage} from '../../entity/message/CallMessage'; +import type {ContentMessage} from '../../entity/message/ContentMessage'; +import type {DeleteConversationMessage} from '../../entity/message/DeleteConversationMessage'; +import type {MemberMessage} from '../../entity/message/MemberMessage'; +import type {Message} from '../../entity/message/Message'; +import type {MessageTimerUpdateMessage} from '../../entity/message/MessageTimerUpdateMessage'; +import type {RenameMessage} from '../../entity/message/RenameMessage'; +import type {SystemMessage} from '../../entity/message/SystemMessage'; +import type {User} from '../../entity/User'; +import {SuperType} from '../../message/SuperType'; +import {SystemMessageType} from '../../message/SystemMessageType'; +import {ContentState, useAppState} from '../../page/useAppState'; +import {UserState} from '../../user/UserState'; +import {Warnings} from '../../view_model/WarningsContainer'; type NotificationData = {conversationId?: QualifiedId; messageId?: string; messageType: string}; interface NotificationContent { diff --git a/src/script/notification/PermissionState.ts b/src/script/repositories/notification/PermissionState.ts similarity index 100% rename from src/script/notification/PermissionState.ts rename to src/script/repositories/notification/PermissionState.ts diff --git a/src/script/notification/PreferenceNotificationRepository.test.ts b/src/script/repositories/notification/PreferenceNotificationRepository.test.ts similarity index 95% rename from src/script/notification/PreferenceNotificationRepository.test.ts rename to src/script/repositories/notification/PreferenceNotificationRepository.test.ts index 9aec7c482c7..1e6aff044a3 100644 --- a/src/script/notification/PreferenceNotificationRepository.test.ts +++ b/src/script/repositories/notification/PreferenceNotificationRepository.test.ts @@ -24,11 +24,12 @@ import ko from 'knockout'; import {WebAppEvents} from '@wireapp/webapp-events'; import {ClientEntity} from 'Repositories/client/ClientEntity'; -import {Notification, PreferenceNotificationRepository} from 'src/script/notification/PreferenceNotificationRepository'; -import {PropertiesRepository} from 'src/script/properties/PropertiesRepository'; +import {PropertiesRepository} from 'Repositories/properties/PropertiesRepository'; import {createUuid} from 'Util/uuid'; -import {User} from '../entity/User'; +import {Notification, PreferenceNotificationRepository} from './PreferenceNotificationRepository'; + +import {User} from '../../entity/User'; describe('PreferenceNotificationRepository', () => { const user = new User(createUuid(), null); diff --git a/src/script/notification/PreferenceNotificationRepository.ts b/src/script/repositories/notification/PreferenceNotificationRepository.ts similarity index 97% rename from src/script/notification/PreferenceNotificationRepository.ts rename to src/script/repositories/notification/PreferenceNotificationRepository.ts index f20335a659e..de972f500b7 100644 --- a/src/script/notification/PreferenceNotificationRepository.ts +++ b/src/script/repositories/notification/PreferenceNotificationRepository.ts @@ -27,11 +27,11 @@ import {groupBy} from 'underscore'; import {WebAppEvents} from '@wireapp/webapp-events'; import type {ClientEntity} from 'Repositories/client/ClientEntity'; +import {PropertiesRepository} from 'Repositories/properties/PropertiesRepository'; import {matchQualifiedIds} from 'Util/QualifiedId'; import {loadValue, resetStoreValue, storeValue} from 'Util/StorageUtil'; -import type {User} from '../entity/User'; -import {PropertiesRepository} from '../properties/PropertiesRepository'; +import type {User} from '../../entity/User'; export type ClientNotificationData = { domain?: string; diff --git a/src/script/permission/PermissionRepository.ts b/src/script/repositories/permission/PermissionRepository.ts similarity index 97% rename from src/script/permission/PermissionRepository.ts rename to src/script/repositories/permission/PermissionRepository.ts index 4d5e6bc6ca6..8f3487d828c 100644 --- a/src/script/permission/PermissionRepository.ts +++ b/src/script/repositories/permission/PermissionRepository.ts @@ -19,13 +19,12 @@ import ko from 'knockout'; +import {PermissionState} from 'Repositories/notification/PermissionState'; import {Logger, getLogger} from 'Util/Logger'; import {PermissionStatusState} from './PermissionStatusState'; import {PermissionType} from './PermissionType'; -import {PermissionState} from '../notification/PermissionState'; - interface PermissionStateResult { state: PermissionState | PermissionStatusState; type: PermissionType; diff --git a/src/script/permission/PermissionStatusState.ts b/src/script/repositories/permission/PermissionStatusState.ts similarity index 100% rename from src/script/permission/PermissionStatusState.ts rename to src/script/repositories/permission/PermissionStatusState.ts diff --git a/src/script/permission/PermissionType.ts b/src/script/repositories/permission/PermissionType.ts similarity index 100% rename from src/script/permission/PermissionType.ts rename to src/script/repositories/permission/PermissionType.ts diff --git a/src/script/properties/PropertiesRepository.ts b/src/script/repositories/properties/PropertiesRepository.ts similarity index 97% rename from src/script/properties/PropertiesRepository.ts rename to src/script/repositories/properties/PropertiesRepository.ts index c0024413e14..979d6d6180c 100644 --- a/src/script/properties/PropertiesRepository.ts +++ b/src/script/repositories/properties/PropertiesRepository.ts @@ -27,6 +27,8 @@ import {WebAppEvents} from '@wireapp/webapp-events'; import {PrimaryModal} from 'Components/Modals/PrimaryModal'; import {PrimaryModalType} from 'Components/Modals/PrimaryModal/PrimaryModalTypes'; +import type {SelfService} from 'Repositories/self/SelfService'; +import {isCountlyEnabledAtCurrentEnvironment} from 'Repositories/tracking/Countly.helpers'; import {Config} from 'src/script/Config'; import {deepMerge} from 'Util/deepMerge'; import {Environment} from 'Util/Environment'; @@ -36,11 +38,9 @@ import {getLogger, Logger} from 'Util/Logger'; import type {PropertiesService} from './PropertiesService'; import {PROPERTIES_TYPE, UserConsentStatus} from './PropertiesType'; -import type {User} from '../entity/User'; -import type {SelfService} from '../self/SelfService'; -import {isCountlyEnabledAtCurrentEnvironment} from '../tracking/Countly.helpers'; -import {ConsentValue} from '../user/ConsentValue'; -import {CONVERSATION_TYPING_INDICATOR_MODE} from '../user/TypingIndicatorMode'; +import type {User} from '../../entity/User'; +import {ConsentValue} from '../../user/ConsentValue'; +import {CONVERSATION_TYPING_INDICATOR_MODE} from '../../user/TypingIndicatorMode'; export class PropertiesRepository { // Value names are specified by the protocol but key names can be changed. diff --git a/src/script/properties/PropertiesService.ts b/src/script/repositories/properties/PropertiesService.ts similarity index 96% rename from src/script/properties/PropertiesService.ts rename to src/script/repositories/properties/PropertiesService.ts index 9256c2443dc..12e2959b752 100644 --- a/src/script/properties/PropertiesService.ts +++ b/src/script/repositories/properties/PropertiesService.ts @@ -19,7 +19,7 @@ import {container} from 'tsyringe'; -import {APIClient} from '../service/APIClientSingleton'; +import {APIClient} from '../../service/APIClientSingleton'; export class PropertiesService { constructor(private readonly apiClient = container.resolve(APIClient)) {} diff --git a/src/script/properties/PropertiesType.ts b/src/script/repositories/properties/PropertiesType.ts similarity index 100% rename from src/script/properties/PropertiesType.ts rename to src/script/repositories/properties/PropertiesType.ts diff --git a/src/script/search/FullTextSearch.ts b/src/script/repositories/search/FullTextSearch.ts similarity index 100% rename from src/script/search/FullTextSearch.ts rename to src/script/repositories/search/FullTextSearch.ts diff --git a/src/script/search/SearchRepository.test.ts b/src/script/repositories/search/SearchRepository.test.ts similarity index 97% rename from src/script/search/SearchRepository.test.ts rename to src/script/repositories/search/SearchRepository.test.ts index 5c215db18a9..e01f631a773 100644 --- a/src/script/search/SearchRepository.test.ts +++ b/src/script/repositories/search/SearchRepository.test.ts @@ -23,11 +23,11 @@ import {createUuid} from 'Util/uuid'; import {SearchRepository} from './SearchRepository'; -import {randomInt} from '../auth/util/randomUtil'; -import {generateUsers} from '../auth/util/test/TestUtil'; -import {APIClient} from '../service/APIClientSingleton'; -import {Core} from '../service/CoreSingleton'; -import {UserRepository} from '../user/UserRepository'; +import {randomInt} from '../../auth/util/randomUtil'; +import {generateUsers} from '../../auth/util/test/TestUtil'; +import {APIClient} from '../../service/APIClientSingleton'; +import {Core} from '../../service/CoreSingleton'; +import {UserRepository} from '../../user/UserRepository'; function buildSearchRepository() { const userRepository = {getUsersById: jest.fn(() => [])} as unknown as jest.Mocked; diff --git a/src/script/search/SearchRepository.ts b/src/script/repositories/search/SearchRepository.ts similarity index 96% rename from src/script/search/SearchRepository.ts rename to src/script/repositories/search/SearchRepository.ts index 89424cffeb8..d6a7cb18979 100644 --- a/src/script/search/SearchRepository.ts +++ b/src/script/repositories/search/SearchRepository.ts @@ -29,11 +29,11 @@ import { transliterationIndex, } from 'Util/StringUtil'; -import type {User} from '../entity/User'; -import {APIClient} from '../service/APIClientSingleton'; -import {Core} from '../service/CoreSingleton'; -import {validateHandle} from '../user/UserHandleGenerator'; -import type {UserRepository} from '../user/UserRepository'; +import type {User} from '../../entity/User'; +import {APIClient} from '../../service/APIClientSingleton'; +import {Core} from '../../service/CoreSingleton'; +import {validateHandle} from '../../user/UserHandleGenerator'; +import type {UserRepository} from '../../user/UserRepository'; const CONFIG = { MAX_DIRECTORY_RESULTS: 30, diff --git a/src/script/self/SelfRepository.test.ts b/src/script/repositories/self/SelfRepository.test.ts similarity index 99% rename from src/script/self/SelfRepository.test.ts rename to src/script/repositories/self/SelfRepository.test.ts index 874f59fa9f9..084766d572a 100644 --- a/src/script/self/SelfRepository.test.ts +++ b/src/script/repositories/self/SelfRepository.test.ts @@ -30,7 +30,7 @@ import {TIME_IN_MILLIS} from 'Util/TimeUtil'; import {SelfRepository} from './SelfRepository'; import * as SelfSupportedProtocols from './SelfSupportedProtocols/SelfSupportedProtocols'; -import {Core} from '../service/CoreSingleton'; +import {Core} from '../../service/CoreSingleton'; const testFactory = new TestFactory(); diff --git a/src/script/self/SelfRepository.ts b/src/script/repositories/self/SelfRepository.ts similarity index 96% rename from src/script/self/SelfRepository.ts rename to src/script/repositories/self/SelfRepository.ts index df90634a52a..3401adaa5ab 100644 --- a/src/script/self/SelfRepository.ts +++ b/src/script/repositories/self/SelfRepository.ts @@ -34,14 +34,14 @@ import {TIME_IN_MILLIS} from 'Util/TimeUtil'; import {SelfService} from './SelfService'; import {evaluateSelfSupportedProtocols} from './SelfSupportedProtocols/SelfSupportedProtocols'; -import {Core} from '../service/CoreSingleton'; +import {Core} from '../../service/CoreSingleton'; import { FeatureUpdateType, detectTeamFeatureUpdate, -} from '../team/TeamFeatureConfigChangeDetector/TeamFeatureConfigChangeDetector'; -import {TeamRepository} from '../team/TeamRepository'; -import {UserRepository} from '../user/UserRepository'; -import {UserState} from '../user/UserState'; +} from '../../team/TeamFeatureConfigChangeDetector/TeamFeatureConfigChangeDetector'; +import {TeamRepository} from '../../team/TeamRepository'; +import {UserRepository} from '../../user/UserRepository'; +import {UserState} from '../../user/UserState'; type Events = {selfSupportedProtocolsUpdated: ConversationProtocol[]}; diff --git a/src/script/self/SelfService.ts b/src/script/repositories/self/SelfService.ts similarity index 96% rename from src/script/self/SelfService.ts rename to src/script/repositories/self/SelfService.ts index 19f0b8199c4..26f5d4a9858 100644 --- a/src/script/self/SelfService.ts +++ b/src/script/repositories/self/SelfService.ts @@ -23,8 +23,8 @@ import type {Consent, Self} from '@wireapp/api-client/lib/self/'; import type {UserUpdate} from '@wireapp/api-client/lib/user/'; import {container} from 'tsyringe'; -import {APIClient} from '../service/APIClientSingleton'; -import {Core} from '../service/CoreSingleton'; +import {APIClient} from '../../service/APIClientSingleton'; +import {Core} from '../../service/CoreSingleton'; export class SelfService { constructor( diff --git a/src/script/self/SelfSupportedProtocols/SelfSupportedProtocols.test.ts b/src/script/repositories/self/SelfSupportedProtocols/SelfSupportedProtocols.test.ts similarity index 99% rename from src/script/self/SelfSupportedProtocols/SelfSupportedProtocols.test.ts rename to src/script/repositories/self/SelfSupportedProtocols/SelfSupportedProtocols.test.ts index 4fb4c82e325..3bf2c3757e9 100644 --- a/src/script/self/SelfSupportedProtocols/SelfSupportedProtocols.test.ts +++ b/src/script/repositories/self/SelfSupportedProtocols/SelfSupportedProtocols.test.ts @@ -27,7 +27,7 @@ import {TIME_IN_MILLIS} from 'Util/TimeUtil'; import {evaluateSelfSupportedProtocols} from './SelfSupportedProtocols'; -import * as mlsSupport from '../../mls/isMLSSupportedByEnvironment'; +import * as mlsSupport from '../../../mls/isMLSSupportedByEnvironment'; const testFactory = new TestFactory(); diff --git a/src/script/self/SelfSupportedProtocols/SelfSupportedProtocols.ts b/src/script/repositories/self/SelfSupportedProtocols/SelfSupportedProtocols.ts similarity index 96% rename from src/script/self/SelfSupportedProtocols/SelfSupportedProtocols.ts rename to src/script/repositories/self/SelfSupportedProtocols/SelfSupportedProtocols.ts index 40763b3b62c..65f00448ae2 100644 --- a/src/script/self/SelfSupportedProtocols/SelfSupportedProtocols.ts +++ b/src/script/repositories/self/SelfSupportedProtocols/SelfSupportedProtocols.ts @@ -19,8 +19,8 @@ import {ConversationProtocol} from '@wireapp/api-client/lib/conversation'; -import {isMLSSupportedByEnvironment} from '../../mls/isMLSSupportedByEnvironment'; -import {MLSMigrationStatus} from '../../mls/MLSMigration/migrationStatus'; +import {isMLSSupportedByEnvironment} from '../../../mls/isMLSSupportedByEnvironment'; +import {MLSMigrationStatus} from '../../../mls/MLSMigration/migrationStatus'; interface SelfSupportedProtocolsTeamHandler { getTeamSupportedProtocols: () => ConversationProtocol[]; diff --git a/src/script/storage/DexieDatabase.ts b/src/script/repositories/storage/DexieDatabase.ts similarity index 100% rename from src/script/storage/DexieDatabase.ts rename to src/script/repositories/storage/DexieDatabase.ts diff --git a/src/script/storage/StorageKey.ts b/src/script/repositories/storage/StorageKey.ts similarity index 100% rename from src/script/storage/StorageKey.ts rename to src/script/repositories/storage/StorageKey.ts diff --git a/src/script/storage/StorageRepository.ts b/src/script/repositories/storage/StorageRepository.ts similarity index 100% rename from src/script/storage/StorageRepository.ts rename to src/script/repositories/storage/StorageRepository.ts diff --git a/src/script/storage/StorageSchemata.ts b/src/script/repositories/storage/StorageSchemata.ts similarity index 99% rename from src/script/storage/StorageSchemata.ts rename to src/script/repositories/storage/StorageSchemata.ts index 758394ede4c..63a7057b042 100644 --- a/src/script/storage/StorageSchemata.ts +++ b/src/script/repositories/storage/StorageSchemata.ts @@ -23,7 +23,7 @@ import {base64ToArray} from 'Util/util'; import {ConversationRecord} from './record'; -import {categoryFromEvent} from '../message/MessageCategorization'; +import {categoryFromEvent} from '../../message/MessageCategorization'; interface DexieSchema { schema: Record; diff --git a/src/script/storage/StorageService.ts b/src/script/repositories/storage/StorageService.ts similarity index 99% rename from src/script/storage/StorageService.ts rename to src/script/repositories/storage/StorageService.ts index eda9178f705..507d437609d 100644 --- a/src/script/storage/StorageService.ts +++ b/src/script/repositories/storage/StorageService.ts @@ -29,7 +29,7 @@ import {loadValue, storeValue} from 'Util/StorageUtil'; import {DexieDatabase} from './DexieDatabase'; import {StorageSchemata} from './StorageSchemata'; -import {StorageError} from '../error/StorageError'; +import {StorageError} from '../../error/StorageError'; interface DatabaseListener { callback: DatabaseListenerCallback; diff --git a/src/script/storage/index.ts b/src/script/repositories/storage/index.ts similarity index 100% rename from src/script/storage/index.ts rename to src/script/repositories/storage/index.ts diff --git a/src/script/storage/record/AmplifyRecord.ts b/src/script/repositories/storage/record/AmplifyRecord.ts similarity index 100% rename from src/script/storage/record/AmplifyRecord.ts rename to src/script/repositories/storage/record/AmplifyRecord.ts diff --git a/src/script/storage/record/ClientRecord.ts b/src/script/repositories/storage/record/ClientRecord.ts similarity index 100% rename from src/script/storage/record/ClientRecord.ts rename to src/script/repositories/storage/record/ClientRecord.ts diff --git a/src/script/storage/record/ConversationRecord.ts b/src/script/repositories/storage/record/ConversationRecord.ts similarity index 100% rename from src/script/storage/record/ConversationRecord.ts rename to src/script/repositories/storage/record/ConversationRecord.ts diff --git a/src/script/storage/record/CryptoboxRecord.ts b/src/script/repositories/storage/record/CryptoboxRecord.ts similarity index 100% rename from src/script/storage/record/CryptoboxRecord.ts rename to src/script/repositories/storage/record/CryptoboxRecord.ts diff --git a/src/script/storage/record/EventRecord.ts b/src/script/repositories/storage/record/EventRecord.ts similarity index 98% rename from src/script/storage/record/EventRecord.ts rename to src/script/repositories/storage/record/EventRecord.ts index eea5eb99373..41d7594342b 100644 --- a/src/script/storage/record/EventRecord.ts +++ b/src/script/repositories/storage/record/EventRecord.ts @@ -24,7 +24,7 @@ import type {ReactionType} from '@wireapp/core/lib/conversation/'; import {ClientConversationEvent} from 'Repositories/conversation/EventBuilder'; -import {StatusType} from '../../message/StatusType'; +import {StatusType} from '../../../message/StatusType'; export interface ReadReceipt { domain?: string; diff --git a/src/script/storage/record/GroupIdRecord.ts b/src/script/repositories/storage/record/GroupIdRecord.ts similarity index 100% rename from src/script/storage/record/GroupIdRecord.ts rename to src/script/repositories/storage/record/GroupIdRecord.ts diff --git a/src/script/storage/record/UserRecord.ts b/src/script/repositories/storage/record/UserRecord.ts similarity index 100% rename from src/script/storage/record/UserRecord.ts rename to src/script/repositories/storage/record/UserRecord.ts diff --git a/src/script/storage/record/index.ts b/src/script/repositories/storage/record/index.ts similarity index 100% rename from src/script/storage/record/index.ts rename to src/script/repositories/storage/record/index.ts diff --git a/src/script/tracking/Countly.helpers.ts b/src/script/repositories/tracking/Countly.helpers.ts similarity index 98% rename from src/script/tracking/Countly.helpers.ts rename to src/script/repositories/tracking/Countly.helpers.ts index de306455fbf..8e0675f1b6e 100644 --- a/src/script/tracking/Countly.helpers.ts +++ b/src/script/repositories/tracking/Countly.helpers.ts @@ -20,7 +20,7 @@ import {getWebEnvironment} from 'Util/Environment'; import {getLogger, Logger} from 'Util/Logger'; -import {Config} from '../Config'; +import {Config} from '../../Config'; const logger: Logger = getLogger('CountlyHelpers'); diff --git a/src/script/tracking/EventName.ts b/src/script/repositories/tracking/EventName.ts similarity index 100% rename from src/script/tracking/EventName.ts rename to src/script/repositories/tracking/EventName.ts diff --git a/src/script/tracking/EventTrackingRepository.ts b/src/script/repositories/tracking/EventTrackingRepository.ts similarity index 99% rename from src/script/tracking/EventTrackingRepository.ts rename to src/script/repositories/tracking/EventTrackingRepository.ts index c8ca7b372fe..75b8570be68 100644 --- a/src/script/tracking/EventTrackingRepository.ts +++ b/src/script/repositories/tracking/EventTrackingRepository.ts @@ -40,9 +40,9 @@ import {getPlatform} from './Helpers'; import {Segmentation} from './Segmentation'; import {UserData} from './UserData'; -import {URLParameter} from '../auth/URLParameter'; -import {Config} from '../Config'; -import {TeamState} from '../team/TeamState'; +import {URLParameter} from '../../auth/URLParameter'; +import {Config} from '../../Config'; +import {TeamState} from '../../team/TeamState'; const CountlyConsentFeatures = [ 'sessions', diff --git a/src/script/tracking/Helpers.ts b/src/script/repositories/tracking/Helpers.ts similarity index 96% rename from src/script/tracking/Helpers.ts rename to src/script/repositories/tracking/Helpers.ts index 7f20d1380b6..e3b118128e6 100644 --- a/src/script/tracking/Helpers.ts +++ b/src/script/repositories/tracking/Helpers.ts @@ -21,8 +21,8 @@ import {Runtime} from '@wireapp/commons'; import {ConversationType, UserType, PlatformType} from './attribute'; -import {Conversation} from '../entity/Conversation'; -import type {User} from '../entity/User'; +import {Conversation} from '../../entity/Conversation'; +import type {User} from '../../entity/User'; export interface GuestAttributes { is_allow_guests: boolean; diff --git a/src/script/tracking/Segmentation.ts b/src/script/repositories/tracking/Segmentation.ts similarity index 100% rename from src/script/tracking/Segmentation.ts rename to src/script/repositories/tracking/Segmentation.ts diff --git a/src/script/tracking/UserData.ts b/src/script/repositories/tracking/UserData.ts similarity index 100% rename from src/script/tracking/UserData.ts rename to src/script/repositories/tracking/UserData.ts diff --git a/src/script/tracking/attribute.ts b/src/script/repositories/tracking/attribute.ts similarity index 100% rename from src/script/tracking/attribute.ts rename to src/script/repositories/tracking/attribute.ts diff --git a/src/script/tracking/countly-skd-web.d.ts b/src/script/repositories/tracking/countly-skd-web.d.ts similarity index 100% rename from src/script/tracking/countly-skd-web.d.ts rename to src/script/repositories/tracking/countly-skd-web.d.ts diff --git a/src/script/service/StoreEngineProvider.ts b/src/script/service/StoreEngineProvider.ts index 08d0ae7bae9..c7feb7580ff 100644 --- a/src/script/service/StoreEngineProvider.ts +++ b/src/script/service/StoreEngineProvider.ts @@ -23,10 +23,9 @@ import type {CRUDEngine} from '@wireapp/store-engine'; import {MemoryEngine} from '@wireapp/store-engine'; import {IndexedDBEngine} from '@wireapp/store-engine-dexie'; +import {DexieDatabase} from 'Repositories/storage/DexieDatabase'; import {getLogger} from 'Util/Logger'; -import {DexieDatabase} from '../storage/DexieDatabase'; - const logger = getLogger('StoreEngineProvider'); export enum DatabaseTypes { diff --git a/src/script/user/UserGuards.ts b/src/script/user/UserGuards.ts index 6b09b5bb6cc..73d0fe37ba5 100644 --- a/src/script/user/UserGuards.ts +++ b/src/script/user/UserGuards.ts @@ -19,7 +19,7 @@ import type {Self as SelfAPIUser} from '@wireapp/api-client/lib/self'; -import {UserRecord} from '../storage'; +import {UserRecord} from 'Repositories/storage'; export function isSelfAPIUser(payload: Partial): payload is SelfAPIUser { return 'locale' in payload; diff --git a/src/script/user/UserMapper.ts b/src/script/user/UserMapper.ts index 69d20dc9382..95b9b06d0de 100644 --- a/src/script/user/UserMapper.ts +++ b/src/script/user/UserMapper.ts @@ -18,12 +18,12 @@ */ import {mapProfileAssets, mapProfileAssetsV1, updateUserEntityAssets} from 'Repositories/assets/AssetMapper'; +import {UserRecord} from 'Repositories/storage'; import {getLogger, Logger} from 'Util/Logger'; import {isSelfAPIUser} from './UserGuards'; import {User} from '../entity/User'; -import {UserRecord} from '../storage'; import type {ServerTimeHandler} from '../time/serverTimeHandler'; import '../view_model/bindings/CommonBindings'; diff --git a/src/script/user/UserRepository.test.ts b/src/script/user/UserRepository.test.ts index d268683c4eb..d87ec8c2245 100644 --- a/src/script/user/UserRepository.test.ts +++ b/src/script/user/UserRepository.test.ts @@ -33,6 +33,8 @@ import {ClientRepository} from 'Repositories/client'; import {ClientMapper} from 'Repositories/client/ClientMapper'; import {ConnectionEntity} from 'Repositories/connection/ConnectionEntity'; import {EventRepository} from 'Repositories/event/EventRepository'; +import {PropertiesRepository} from 'Repositories/properties/PropertiesRepository'; +import {SelfService} from 'Repositories/self/SelfService'; import {entities} from 'test/api/payloads'; import {TestFactory} from 'test/helper/TestFactory'; import {generateAPIUser} from 'test/helper/UserGenerator'; @@ -44,8 +46,6 @@ import {UserService} from './UserService'; import {UserState} from './UserState'; import {User} from '../entity/User'; -import {PropertiesRepository} from '../properties/PropertiesRepository'; -import {SelfService} from '../self/SelfService'; import {TeamState} from '../team/TeamState'; import {serverTimeHandler} from '../time/serverTimeHandler'; diff --git a/src/script/user/UserRepository.ts b/src/script/user/UserRepository.ts index 9db70119987..f2f36928381 100644 --- a/src/script/user/UserRepository.ts +++ b/src/script/user/UserRepository.ts @@ -55,6 +55,10 @@ import {flattenUserClientsQualifiedIds} from 'Repositories/conversation/userClie import {USER} from 'Repositories/event/Client'; import {EventRepository} from 'Repositories/event/EventRepository'; import type {EventSource} from 'Repositories/event/EventSource'; +import type {PropertiesRepository} from 'Repositories/properties/PropertiesRepository'; +import {PROPERTIES_TYPE} from 'Repositories/properties/PropertiesType'; +import type {SelfService} from 'Repositories/self/SelfService'; +import {UserRecord} from 'Repositories/storage'; import {chunk, partition} from 'Util/ArrayUtil'; import {t} from 'Util/LocalizerUtil'; import {getLogger, Logger} from 'Util/Logger'; @@ -73,10 +77,6 @@ import {Config} from '../Config'; import {Conversation} from '../entity/Conversation'; import {User} from '../entity/User'; import {UserError} from '../error/UserError'; -import type {PropertiesRepository} from '../properties/PropertiesRepository'; -import {PROPERTIES_TYPE} from '../properties/PropertiesType'; -import type {SelfService} from '../self/SelfService'; -import {UserRecord} from '../storage'; import {TeamState} from '../team/TeamState'; import type {ServerTimeHandler} from '../time/serverTimeHandler'; diff --git a/src/script/user/UserService.ts b/src/script/user/UserService.ts index 9d16b1350b0..4ea377d02f7 100644 --- a/src/script/user/UserService.ts +++ b/src/script/user/UserService.ts @@ -21,11 +21,10 @@ import {ConversationProtocol} from '@wireapp/api-client/lib/conversation'; import type {User as APIClientUser, QualifiedHandle, QualifiedId} from '@wireapp/api-client/lib/user'; import {container} from 'tsyringe'; +import {StorageSchemata, StorageService, UserRecord} from 'Repositories/storage'; + import {APIClient} from '../service/APIClientSingleton'; import {Core} from '../service/CoreSingleton'; -import {UserRecord} from '../storage'; -import {StorageSchemata} from '../storage/StorageSchemata'; -import {StorageService} from '../storage/StorageService'; import {constructUserPrimaryKey} from '../util/StorageUtil'; export class UserService { diff --git a/src/script/util/DebugUtil.ts b/src/script/util/DebugUtil.ts index 728f4afe41e..3eccbf1c56e 100644 --- a/src/script/util/DebugUtil.ts +++ b/src/script/util/DebugUtil.ts @@ -49,6 +49,10 @@ import {isMLSCapableConversation} from 'Repositories/conversation/ConversationSe import {ConversationState} from 'Repositories/conversation/ConversationState'; import type {MessageRepository} from 'Repositories/conversation/MessageRepository'; import {EventRepository} from 'Repositories/event/EventRepository'; +import {PropertiesRepository} from 'Repositories/properties/PropertiesRepository'; +import {PROPERTIES_TYPE} from 'Repositories/properties/PropertiesType'; +import {EventRecord, StorageRepository, StorageSchemata} from 'Repositories/storage'; +import {disableForcedErrorReporting} from 'Repositories/tracking/Countly.helpers'; import {getLogger, Logger} from 'Util/Logger'; import {KEY} from './KeyboardUtil'; @@ -59,13 +63,9 @@ import {E2EIHandler} from '../E2EIdentity'; import {Conversation} from '../entity/Conversation'; import {User} from '../entity/User'; import {checkVersion} from '../lifecycle/newVersionHandler'; -import {PropertiesRepository} from '../properties/PropertiesRepository'; -import {PROPERTIES_TYPE} from '../properties/PropertiesType'; import {APIClient} from '../service/APIClientSingleton'; import {Core} from '../service/CoreSingleton'; -import {EventRecord, StorageRepository, StorageSchemata} from '../storage'; import {TeamState} from '../team/TeamState'; -import {disableForcedErrorReporting} from '../tracking/Countly.helpers'; import {UserRepository} from '../user/UserRepository'; import {UserState} from '../user/UserState'; import {ViewModelRepositories} from '../view_model/MainViewModel'; diff --git a/src/script/util/ReactionUtil.test.ts b/src/script/util/ReactionUtil.test.ts index c95e5610b2c..88163df1f18 100644 --- a/src/script/util/ReactionUtil.test.ts +++ b/src/script/util/ReactionUtil.test.ts @@ -17,13 +17,12 @@ * */ +import {ReactionMap} from 'Repositories/storage'; import {generateQualifiedId} from 'test/helper/UserGenerator'; import {addReaction, userReactionMapToReactionMap} from './ReactionUtil'; import {createUuid} from './uuid'; -import {ReactionMap} from '../storage'; - describe('ReactionUtil', () => { describe('userReactionMapToReactionMap', () => { it('converts a user reaction map to a reaction map', () => { diff --git a/src/script/util/ReactionUtil.ts b/src/script/util/ReactionUtil.ts index 3957fb03c22..0d52fc37865 100644 --- a/src/script/util/ReactionUtil.ts +++ b/src/script/util/ReactionUtil.ts @@ -19,9 +19,9 @@ import type {QualifiedId} from '@wireapp/api-client/lib/user'; -import {matchQualifiedIds} from './QualifiedId'; +import {ReactionMap, UserReactionMap} from 'Repositories/storage'; -import {ReactionMap, UserReactionMap} from '../storage'; +import {matchQualifiedIds} from './QualifiedId'; function isReactionMap(reactions: UserReactionMap | ReactionMap): reactions is ReactionMap { return Array.isArray(reactions); diff --git a/src/script/util/TypePredicateUtil.ts b/src/script/util/TypePredicateUtil.ts index 19bb1c05754..db96d8463c0 100644 --- a/src/script/util/TypePredicateUtil.ts +++ b/src/script/util/TypePredicateUtil.ts @@ -21,10 +21,11 @@ import {RegisteredClient} from '@wireapp/api-client/lib/client'; import type {BackendError} from '@wireapp/api-client/lib/http'; import {AxiosError} from 'axios'; +import {ClientRecord} from 'Repositories/storage'; + import {Conversation} from '../entity/Conversation'; import {User} from '../entity/User'; import {isObject} from '../guards/common'; -import {ClientRecord} from '../storage/record/ClientRecord'; export function isAxiosError(errorCandidate: any): errorCandidate is AxiosError { return errorCandidate && errorCandidate.isAxiosError === true; diff --git a/src/script/view_model/ActionsViewModel.ts b/src/script/view_model/ActionsViewModel.ts index 12ecd77b346..9246b76c8d1 100644 --- a/src/script/view_model/ActionsViewModel.ts +++ b/src/script/view_model/ActionsViewModel.ts @@ -33,6 +33,7 @@ import type {MessageRepository} from 'Repositories/conversation/MessageRepositor import {NOTIFICATION_STATE} from 'Repositories/conversation/NotificationSetting'; import type {IntegrationRepository} from 'Repositories/integration/IntegrationRepository'; import type {ServiceEntity} from 'Repositories/integration/ServiceEntity'; +import {SelfRepository} from 'Repositories/self/SelfRepository'; import {t} from 'Util/LocalizerUtil'; import {isBackendError} from 'Util/TypePredicateUtil'; @@ -41,7 +42,6 @@ import type {MainViewModel} from './MainViewModel'; import type {Conversation} from '../entity/Conversation'; import type {Message} from '../entity/message/Message'; import type {User} from '../entity/User'; -import {SelfRepository} from '../self/SelfRepository'; import {UserState} from '../user/UserState'; export class ActionsViewModel { diff --git a/src/script/view_model/CallingViewModel.ts b/src/script/view_model/CallingViewModel.ts index 7c1a0285f4b..8c26dbcc635 100644 --- a/src/script/view_model/CallingViewModel.ts +++ b/src/script/view_model/CallingViewModel.ts @@ -39,6 +39,10 @@ import {ConversationState} from 'Repositories/conversation/ConversationState'; import {ConversationVerificationState} from 'Repositories/conversation/ConversationVerificationState'; import type {ElectronDesktopCapturerSource, MediaDevicesHandler} from 'Repositories/media/MediaDevicesHandler'; import type {MediaStreamHandler} from 'Repositories/media/MediaStreamHandler'; +import type {PermissionRepository} from 'Repositories/permission/PermissionRepository'; +import {PermissionStatusState} from 'Repositories/permission/PermissionStatusState'; +import {PropertiesRepository} from 'Repositories/properties/PropertiesRepository'; +import {PROPERTIES_TYPE} from 'Repositories/properties/PropertiesType'; import {replaceLink, t} from 'Util/LocalizerUtil'; import {matchQualifiedIds} from 'Util/QualifiedId'; import {safeWindowOpen} from 'Util/SanitizationUtil'; @@ -46,10 +50,6 @@ import {safeWindowOpen} from 'Util/SanitizationUtil'; import {Config} from '../Config'; import type {Conversation} from '../entity/Conversation'; import type {User} from '../entity/User'; -import type {PermissionRepository} from '../permission/PermissionRepository'; -import {PermissionStatusState} from '../permission/PermissionStatusState'; -import {PropertiesRepository} from '../properties/PropertiesRepository'; -import {PROPERTIES_TYPE} from '../properties/PropertiesType'; import type {TeamRepository} from '../team/TeamRepository'; import {TeamState} from '../team/TeamState'; import {ROLE} from '../user/UserPermission'; diff --git a/src/script/view_model/ListViewModel.ts b/src/script/view_model/ListViewModel.ts index fbdaaa0179d..9083612c770 100644 --- a/src/script/view_model/ListViewModel.ts +++ b/src/script/view_model/ListViewModel.ts @@ -28,6 +28,8 @@ import {PrimaryModal, usePrimaryModalState} from 'Components/Modals/PrimaryModal import type {CallingRepository} from 'Repositories/calling/CallingRepository'; import type {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; import {ConversationState} from 'Repositories/conversation/ConversationState'; +import {PropertiesRepository} from 'Repositories/properties/PropertiesRepository'; +import {SearchRepository} from 'Repositories/search/SearchRepository'; import {iterateItem} from 'Util/ArrayUtil'; import {isEscapeKey} from 'Util/KeyboardUtil'; import {t} from 'Util/LocalizerUtil'; @@ -43,8 +45,6 @@ import {SidebarTabs, useSidebarStore} from '../page/LeftSidebar/panels/Conversat import {PanelState} from '../page/RightSidebar'; import {useAppMainState} from '../page/state'; import {ContentState, ListState, useAppState} from '../page/useAppState'; -import {PropertiesRepository} from '../properties/PropertiesRepository'; -import {SearchRepository} from '../search/SearchRepository'; import type {TeamRepository} from '../team/TeamRepository'; import {TeamState} from '../team/TeamState'; import {showContextMenu} from '../ui/ContextMenu'; diff --git a/src/script/view_model/MainViewModel.ts b/src/script/view_model/MainViewModel.ts index fe5db7f1850..1067e538ec6 100644 --- a/src/script/view_model/MainViewModel.ts +++ b/src/script/view_model/MainViewModel.ts @@ -32,23 +32,23 @@ import type {EventRepository} from 'Repositories/event/EventRepository'; import type {GiphyRepository} from 'Repositories/giphy/GiphyRepository'; import type {IntegrationRepository} from 'Repositories/integration/IntegrationRepository'; import type {MediaRepository} from 'Repositories/media/MediaRepository'; +import type {NotificationRepository} from 'Repositories/notification/NotificationRepository'; +import type {PreferenceNotificationRepository} from 'Repositories/notification/PreferenceNotificationRepository'; +import type {PermissionRepository} from 'Repositories/permission/PermissionRepository'; +import type {PropertiesRepository} from 'Repositories/properties/PropertiesRepository'; +import type {SearchRepository} from 'Repositories/search/SearchRepository'; +import type {SelfRepository} from 'Repositories/self/SelfRepository'; +import type {StorageRepository} from 'Repositories/storage'; +import type {EventTrackingRepository} from 'Repositories/tracking/EventTrackingRepository'; import {ActionsViewModel} from './ActionsViewModel'; import {CallingViewModel} from './CallingViewModel'; import {ContentViewModel} from './ContentViewModel'; import {ListViewModel} from './ListViewModel'; -import type {NotificationRepository} from '../notification/NotificationRepository'; -import type {PreferenceNotificationRepository} from '../notification/PreferenceNotificationRepository'; -import type {PermissionRepository} from '../permission/PermissionRepository'; -import type {PropertiesRepository} from '../properties/PropertiesRepository'; -import type {SearchRepository} from '../search/SearchRepository'; -import type {SelfRepository} from '../self/SelfRepository'; import {Core} from '../service/CoreSingleton'; -import type {StorageRepository} from '../storage'; import type {TeamRepository} from '../team/TeamRepository'; import type {ServerTimeHandler} from '../time/serverTimeHandler'; -import type {EventTrackingRepository} from '../tracking/EventTrackingRepository'; import type {UserRepository} from '../user/UserRepository'; import {UserState} from '../user/UserState'; diff --git a/src/script/view_model/WarningsContainer/WarningsState.ts b/src/script/view_model/WarningsContainer/WarningsState.ts index db1d51697fc..f62c6cc05d9 100644 --- a/src/script/view_model/WarningsContainer/WarningsState.ts +++ b/src/script/view_model/WarningsContainer/WarningsState.ts @@ -23,13 +23,13 @@ import {create} from 'zustand'; import {WebAppEvents} from '@wireapp/webapp-events'; import {PrimaryModal} from 'Components/Modals/PrimaryModal'; +import {PermissionState} from 'Repositories/notification/PermissionState'; import {t} from 'Util/LocalizerUtil'; import {safeWindowOpen} from 'Util/SanitizationUtil'; import {TYPE} from './WarningsTypes'; import {Config} from '../../Config'; -import {PermissionState} from '../../notification/PermissionState'; type WarningsState = { name: string; diff --git a/test/helper/TestFactory.js b/test/helper/TestFactory.js index fa61f5407bc..d490828f50a 100644 --- a/test/helper/TestFactory.js +++ b/test/helper/TestFactory.js @@ -46,27 +46,26 @@ import {EventRepository} from 'Repositories/event/EventRepository'; import {EventService} from 'Repositories/event/EventService'; import {NotificationService} from 'Repositories/event/NotificationService'; import {MediaRepository} from 'Repositories/media/MediaRepository'; +import {PermissionRepository} from 'Repositories/permission/PermissionRepository'; +import {PropertiesRepository} from 'Repositories/properties/PropertiesRepository'; +import {PropertiesService} from 'Repositories/properties/PropertiesService'; +import {SearchRepository} from 'Repositories/search/SearchRepository'; +import {SelfService} from 'Repositories/self/SelfService'; +import {SelfRepository} from 'Repositories/self/SelfRepository'; +import {StorageRepository, StorageService} from 'Repositories/storage'; +import {EventTrackingRepository} from 'Repositories/tracking/EventTrackingRepository'; import {User} from 'src/script/entity/User'; -import {PermissionRepository} from 'src/script/permission/PermissionRepository'; -import {PropertiesRepository} from 'src/script/properties/PropertiesRepository'; -import {PropertiesService} from 'src/script/properties/PropertiesService'; -import {SearchRepository} from 'src/script/search/SearchRepository'; -import {SelfService} from 'src/script/self/SelfService'; import {Core} from 'src/script/service/CoreSingleton'; import {createStorageEngine, DatabaseTypes} from 'src/script/service/StoreEngineProvider'; -import {StorageService} from 'src/script/storage'; -import {StorageRepository} from 'src/script/storage/StorageRepository'; import {TeamRepository} from 'src/script/team/TeamRepository'; import {TeamService} from 'src/script/team/TeamService'; import {TeamState} from 'src/script/team/TeamState'; import {serverTimeHandler} from 'src/script/time/serverTimeHandler'; -import {EventTrackingRepository} from 'src/script/tracking/EventTrackingRepository'; import {UserRepository} from 'src/script/user/UserRepository'; import {UserService} from 'src/script/user/UserService'; import {UserState} from 'src/script/user/UserState'; import {entities} from '../api/payloads'; -import {SelfRepository} from 'src/script/self/SelfRepository'; export class TestFactory { constructor() { diff --git a/test/unit_tests/cache/CacheRepositorySpec.js b/test/unit_tests/cache/CacheRepositorySpec.js index 356379e7a13..c9894196c90 100644 --- a/test/unit_tests/cache/CacheRepositorySpec.js +++ b/test/unit_tests/cache/CacheRepositorySpec.js @@ -20,7 +20,7 @@ import {amplify} from 'amplify'; import {CacheRepository} from 'Repositories/cache/CacheRepository'; -import {StorageKey} from 'src/script/storage/StorageKey'; +import {StorageKey} from 'Repositories/storage'; import {createUuid} from 'Util/uuid'; describe('CacheRepository', () => { diff --git a/test/unit_tests/conversation/ConversationServiceSpec.js b/test/unit_tests/conversation/ConversationServiceSpec.js index c9efe422e85..979830f0f3f 100644 --- a/test/unit_tests/conversation/ConversationServiceSpec.js +++ b/test/unit_tests/conversation/ConversationServiceSpec.js @@ -18,7 +18,7 @@ */ import {ConversationMapper} from 'Repositories/conversation/ConversationMapper'; -import {StorageSchemata} from 'src/script/storage/StorageSchemata'; +import {StorageSchemata} from 'Repositories/storage'; import {TestFactory} from '../../helper/TestFactory'; import sinon from 'sinon'; diff --git a/test/unit_tests/event/EventServiceCommon.js b/test/unit_tests/event/EventServiceCommon.js index 7baed8d58c0..c98a3e2c0c0 100644 --- a/test/unit_tests/event/EventServiceCommon.js +++ b/test/unit_tests/event/EventServiceCommon.js @@ -17,11 +17,11 @@ * */ -import {AssetTransferState} from 'src/script/repositories/assets/AssetTransferState'; +import {AssetTransferState} from 'Repositories/assets/AssetTransferState'; +import {StorageSchemata} from 'Repositories/storage/StorageSchemata'; import {ConversationError} from 'src/script/error/ConversationError'; import {StorageError} from 'src/script/error/StorageError'; import {MessageCategory} from 'src/script/message/MessageCategory'; -import {StorageSchemata} from 'src/script/storage/StorageSchemata'; import {createUuid} from 'Util/uuid'; import {TestFactory} from '../../helper/TestFactory'; diff --git a/test/unit_tests/permission/PermissionRepositorySpec.js b/test/unit_tests/permission/PermissionRepositorySpec.js index ab3e9fd8c98..93a3d6ab7ff 100644 --- a/test/unit_tests/permission/PermissionRepositorySpec.js +++ b/test/unit_tests/permission/PermissionRepositorySpec.js @@ -17,9 +17,9 @@ * */ -import {PermissionRepository} from 'src/script/permission/PermissionRepository'; -import {PermissionStatusState} from 'src/script/permission/PermissionStatusState'; -import {PermissionType} from 'src/script/permission/PermissionType'; +import {PermissionRepository} from 'Repositories/permission/PermissionRepository'; +import {PermissionStatusState} from 'Repositories/permission/PermissionStatusState'; +import {PermissionType} from 'Repositories/permission/PermissionType'; describe('PermissionRepository', () => { describe('constructor', () => { diff --git a/test/unit_tests/properties/PropertiesRepositorySpec.js b/test/unit_tests/properties/PropertiesRepositorySpec.js index 88426a468bd..1c1a5a2fdb3 100644 --- a/test/unit_tests/properties/PropertiesRepositorySpec.js +++ b/test/unit_tests/properties/PropertiesRepositorySpec.js @@ -17,9 +17,9 @@ * */ -import {PropertiesRepository} from 'src/script/properties/PropertiesRepository'; -import {PropertiesService} from 'src/script/properties/PropertiesService'; -import {SelfService} from 'src/script/self/SelfService'; +import {PropertiesRepository} from 'Repositories/properties/PropertiesRepository'; +import {PropertiesService} from 'Repositories/properties/PropertiesService'; +import {SelfService} from 'Repositories/self/SelfService'; describe('PropertiesRepository', () => { let propertiesRepository = undefined; diff --git a/test/unit_tests/search/FullTextSearchSpec.js b/test/unit_tests/search/FullTextSearchSpec.js index 588d432fbf1..e18a5fa6c7d 100644 --- a/test/unit_tests/search/FullTextSearchSpec.js +++ b/test/unit_tests/search/FullTextSearchSpec.js @@ -17,7 +17,7 @@ * */ -import {search} from 'src/script/search/FullTextSearch'; +import {search} from 'Repositories/search/FullTextSearch'; describe('FullTextSearch', () => { describe('search', () => { diff --git a/test/unit_tests/storage/StorageServiceSpec.js b/test/unit_tests/storage/StorageServiceSpec.js index ccce6a8782a..5d394030cec 100644 --- a/test/unit_tests/storage/StorageServiceSpec.js +++ b/test/unit_tests/storage/StorageServiceSpec.js @@ -17,8 +17,8 @@ * */ +import {StorageSchemata, StorageService} from 'Repositories/storage'; import {StorageError} from 'src/script/error/StorageError'; -import {StorageSchemata, StorageService} from 'src/script/storage/'; describe('StorageRepository', () => { describe('save', () => { diff --git a/test/unit_tests/tracking/HelpersSpec.js b/test/unit_tests/tracking/HelpersSpec.js index a8ed1684076..6eafd758c2f 100644 --- a/test/unit_tests/tracking/HelpersSpec.js +++ b/test/unit_tests/tracking/HelpersSpec.js @@ -20,9 +20,9 @@ import {CONVERSATION_TYPE} from '@wireapp/api-client/lib/conversation/'; import {createUuid} from 'Util/uuid'; +import {ConversationType as ConversationTypeAttribute} from 'Repositories/tracking/attribute'; +import * as trackingHelpers from 'Repositories/tracking/Helpers'; import {Conversation} from 'src/script/entity/Conversation'; -import {ConversationType as ConversationTypeAttribute} from 'src/script/tracking/attribute'; -import * as trackingHelpers from 'src/script/tracking/Helpers'; describe('trackingHelpers', () => { describe('getConversationType', () => { diff --git a/test/unit_tests/util/ValidationUtilSpec.js b/test/unit_tests/util/ValidationUtilSpec.js index 951913853de..a01f08d260e 100644 --- a/test/unit_tests/util/ValidationUtilSpec.js +++ b/test/unit_tests/util/ValidationUtilSpec.js @@ -147,7 +147,7 @@ describe('ValidationUtil', () => { }); it('detects a invalid API path', async () => { - const path = '../../../search/contacts'; + const path = '../../../repositories/search/contacts'; expect(() => { isValidApiPath(path); From 6a478a9b2e18ecbabf3e4bfc4b57126d03ec7eda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20J=C3=B3=C5=BAwik?= Date: Tue, 5 Nov 2024 09:04:02 +0100 Subject: [PATCH 12/12] feat: Move UserRepository to new folder structure (#18269) * feat: Move Notification & Permission & Properties Repositories to new folder structure * feat: Move Search and Self Repository to new folder structure * feat: Move StorageRepository to new folder structure * feat: Move TrackingRepository to new folder structure * feat: Move UserRepository to new folder structure * feat: Move TeamRepository to new folder structure (#18270) --- .../E2EIdentity/E2EIdentityEnrollment.test.ts | 2 +- src/script/E2EIdentity/E2EIdentityEnrollment.ts | 2 +- .../AppContainer/hooks/useAccentColor.ts | 2 +- .../Avatar/UserAvatar/UserAvatar.test.tsx | 2 +- .../components/Avatar/UserAvatar/UserAvatar.tsx | 2 +- .../VerificationBadges/VerificationBadges.tsx | 4 ++-- .../ConnectRequests/ConnectionRequests.tsx | 4 ++-- .../components/Conversation/Conversation.tsx | 2 +- .../utils/checkFileSharingPermission.ts | 2 +- src/script/components/Image/Image.tsx | 2 +- src/script/components/InputBar/InputBar.test.tsx | 2 +- src/script/components/InputBar/InputBar.tsx | 4 ++-- .../MessageTimerButton/MessageTimerButton.test.tsx | 2 +- .../MessageTimerButton/MessageTimerButton.tsx | 2 +- .../Message/ContentMessage/asset/AudioAsset.tsx | 2 +- .../asset/FileAssetComponent.test.tsx | 2 +- .../ContentMessage/asset/FileAssetComponent.tsx | 2 +- .../Message/ContentMessage/asset/VideoAsset.tsx | 2 +- .../Message/FailedToAddUsersMessage.test.tsx | 2 +- .../Message/FailedToAddUsersMessage.tsx | 2 +- .../MessagesList/Message/MessageWrapper.tsx | 2 +- .../components/MessagesList/Message/index.tsx | 2 +- .../Modals/GroupCreation/GroupCreationModal.tsx | 4 ++-- .../Modals/LegalHoldModal/LegalHoldModal.test.tsx | 4 ++-- .../Modals/LegalHoldModal/LegalHoldModal.tsx | 2 +- .../QualityFeedbackModal.test.tsx | 2 +- .../QualityFeedbackModal/QualityFeedbackModal.tsx | 3 +-- .../components/Modals/UserModal/UserModal.test.tsx | 4 ++-- .../components/Modals/UserModal/UserModal.tsx | 4 ++-- src/script/components/SearchInput/SearchInput.tsx | 2 +- src/script/components/TitleBar/TitleBar.test.tsx | 2 +- src/script/components/TitleBar/TitleBar.tsx | 2 +- src/script/components/UserList/UserList.tsx | 2 +- .../UserSearchableList/UserSearchableList.tsx | 4 ++-- .../CallParticipantsListItem.test.tsx | 2 +- .../calling/CallingCell/CallingCell.test.tsx | 2 +- .../components/calling/CallingCell/CallingCell.tsx | 4 ++-- .../CallingControls/CallingControls.tsx | 2 +- .../DetachedCallingCell/DetachedCallingCell.tsx | 2 +- .../components/calling/FullscreenVideoCall.tsx | 2 +- .../components/panel/EnrichedFields.test.tsx | 2 +- src/script/components/panel/EnrichedFields.tsx | 2 +- src/script/components/panel/UserActions.test.tsx | 6 +++--- src/script/components/panel/UserActions.tsx | 2 +- src/script/entity/Conversation.ts | 2 +- src/script/entity/User/User.ts | 2 +- src/script/main/app.ts | 6 +++--- src/script/page/AppLock/AppLock.test.tsx | 9 ++++----- src/script/page/AppLock/AppLock.tsx | 4 ++-- src/script/page/AppMain.tsx | 6 +++--- .../ConversationHeader/ConversationHeader.tsx | 2 +- .../ConversationTabs/ConversationTabs.tsx | 2 +- .../panels/Conversations/Conversations.test.tsx | 2 +- .../panels/Conversations/Conversations.tsx | 8 ++++---- src/script/page/LeftSidebar/panels/Preferences.tsx | 2 +- .../page/LeftSidebar/panels/StartUI/PeopleTab.tsx | 8 ++++---- .../page/LeftSidebar/panels/StartUI/StartUI.tsx | 10 +++++----- src/script/page/MainContent/MainContent.tsx | 4 ++-- .../panels/preferences/AboutPreferences.tsx | 2 +- .../panels/preferences/AccountPreferences.tsx | 6 +++--- .../E2EICertificateDetails.test.tsx | 2 +- .../accountPreferences/AccountSecuritySection.tsx | 8 ++++---- .../preferences/accountPreferences/AvatarInput.tsx | 2 +- .../accountPreferences/DataUsageSection.tsx | 4 ++-- .../preferences/accountPreferences/EmailInput.tsx | 3 +-- .../preferences/accountPreferences/NameInput.tsx | 3 +-- .../accountPreferences/PrivacySection.tsx | 6 +++--- .../accountPreferences/UsernameInput.tsx | 4 ++-- .../preferences/avPreferences/SaveCallLogs.tsx | 2 +- .../AddParticipants/AddParticipants.tsx | 8 ++++---- .../ConversationDetails.test.tsx | 8 ++++---- .../ConversationDetails/ConversationDetails.tsx | 4 ++-- .../ConversationDetailsOptions.tsx | 2 +- .../utils/getConversationActions.ts | 2 +- .../ConversationParticipants.tsx | 2 +- .../GroupParticipantService.tsx | 2 +- .../GroupParticipantUser/GroupParticipantUser.tsx | 4 ++-- .../GuestServicesOptions.test.tsx | 4 ++-- .../GuestServicesOptions/GuestServicesOptions.tsx | 4 ++-- .../components/GuestOptions/GuestOptions.tsx | 4 ++-- .../MessageDetails/MessageDetails.test.tsx | 4 ++-- .../RightSidebar/MessageDetails/MessageDetails.tsx | 2 +- src/script/page/RightSidebar/RightSidebar.tsx | 4 ++-- .../RightSidebar/TimedMessages/TimedMessages.tsx | 2 +- .../Features/useE2EIFeatureConfigUpdate.ts | 4 ++-- .../FeatureConfigChangeNotifier.test.tsx | 3 +-- .../FeatureConfigChangeNotifier.ts | 2 +- src/script/page/components/WindowTitleUpdater.ts | 2 +- src/script/repositories/assets/AssetRepository.ts | 4 ++-- .../repositories/calling/CallingRepository.test.ts | 2 +- .../repositories/calling/CallingRepository.ts | 4 ++-- .../connection/ConnectionRepository.test.ts | 2 +- .../connection/ConnectionRepository.ts | 2 +- .../conversation/ConversationAccessPermission.ts | 4 ++-- .../conversation/ConversationRepository.test.ts | 8 ++++---- .../conversation/ConversationRepository.ts | 10 +++++----- .../ConversationRoleRepository.test.ts | 2 +- .../conversation/ConversationRoleRepository.ts | 6 +++--- .../conversation/ConversationState.test.ts | 5 +++-- .../repositories/conversation/ConversationState.ts | 4 ++-- .../Proteus/ProteusStateHandler.ts | 2 +- .../shared/conversation/index.ts | 2 +- .../conversation/MessageRepository.test.ts | 6 +++--- .../repositories/conversation/MessageRepository.ts | 8 ++++---- src/script/repositories/event/EventRepository.ts | 2 +- .../EventStorageMiddleware.ts | 2 +- .../event/preprocessor/ServiceMiddleware.test.ts | 2 +- .../event/preprocessor/ServiceMiddleware.ts | 2 +- .../integration/IntegrationRepository.ts | 4 ++-- .../media/MediaConstraintsHandler.test.ts | 2 +- .../repositories/media/MediaConstraintsHandler.ts | 3 +-- .../repositories/media/MediaStreamHandler.test.ts | 3 +-- .../notification/NotificationRepository.test.ts | 4 ++-- .../notification/NotificationRepository.ts | 2 +- .../properties/PropertiesRepository.ts | 4 ++-- .../repositories/search/SearchRepository.test.ts | 2 +- src/script/repositories/search/SearchRepository.ts | 4 ++-- src/script/repositories/self/SelfRepository.ts | 14 +++++++------- .../{ => repositories}/team/TeamEntity.test.ts | 0 src/script/{ => repositories}/team/TeamEntity.ts | 3 +-- .../TeamFeatureConfigChangeDetector.test.ts | 0 .../TeamFeatureConfigChangeDetector.ts | 0 src/script/{ => repositories}/team/TeamMapper.ts | 0 .../{ => repositories}/team/TeamMemberEntity.ts | 0 .../{ => repositories}/team/TeamRepository.test.ts | 11 +++++------ .../{ => repositories}/team/TeamRepository.ts | 10 +++++----- src/script/{ => repositories}/team/TeamService.ts | 2 +- src/script/{ => repositories}/team/TeamState.ts | 8 ++++---- .../tracking/EventTrackingRepository.ts | 2 +- .../{ => repositories}/user/AppLockRepository.ts | 0 src/script/{ => repositories}/user/AppLockState.ts | 2 +- .../{ => repositories}/user/AvailabilityMapper.ts | 4 ++-- .../{ => repositories}/user/AvailabilityModal.ts | 3 +-- src/script/{ => repositories}/user/ConsentValue.ts | 0 .../user/RichProfileRepository.ts | 2 +- .../{ => repositories}/user/TypingIndicatorMode.ts | 0 src/script/{ => repositories}/user/UserFilter.ts | 4 ++-- src/script/{ => repositories}/user/UserGuards.ts | 0 .../{ => repositories}/user/UserHandleGenerator.ts | 0 .../{ => repositories}/user/UserMapper.test.ts | 0 src/script/{ => repositories}/user/UserMapper.ts | 6 +++--- .../{ => repositories}/user/UserPermission.ts | 2 +- .../{ => repositories}/user/UserRepository.test.ts | 6 +++--- .../{ => repositories}/user/UserRepository.ts | 14 +++++++------- src/script/{ => repositories}/user/UserService.ts | 6 +++--- src/script/{ => repositories}/user/UserState.ts | 2 +- src/script/util/DebugUtil.ts | 6 +++--- src/script/util/wrapper.ts | 4 ++-- src/script/view_model/ActionsViewModel.ts | 2 +- src/script/view_model/CallingViewModel.ts | 6 +++--- src/script/view_model/ContentViewModel.ts | 4 ++-- src/script/view_model/ListViewModel.ts | 6 +++--- src/script/view_model/MainViewModel.ts | 6 +++--- test/helper/TestFactory.js | 12 ++++++------ test/helper/UserGenerator.ts | 2 +- test/unit_tests/user/RichProfileRepositorySpec.js | 2 +- test/unit_tests/user/UserHandleGeneratorSpec.js | 2 +- test/unit_tests/user/UserPermissionSpec.js | 2 +- 158 files changed, 270 insertions(+), 279 deletions(-) rename src/script/{ => repositories}/team/TeamEntity.test.ts (100%) rename src/script/{ => repositories}/team/TeamEntity.ts (96%) rename src/script/{ => repositories}/team/TeamFeatureConfigChangeDetector/TeamFeatureConfigChangeDetector.test.ts (100%) rename src/script/{ => repositories}/team/TeamFeatureConfigChangeDetector/TeamFeatureConfigChangeDetector.ts (100%) rename src/script/{ => repositories}/team/TeamMapper.ts (100%) rename src/script/{ => repositories}/team/TeamMemberEntity.ts (100%) rename src/script/{ => repositories}/team/TeamRepository.test.ts (96%) rename src/script/{ => repositories}/team/TeamRepository.ts (98%) rename src/script/{ => repositories}/team/TeamService.ts (98%) rename src/script/{ => repositories}/team/TeamState.ts (96%) rename src/script/{ => repositories}/user/AppLockRepository.ts (100%) rename src/script/{ => repositories}/user/AppLockState.ts (97%) rename src/script/{ => repositories}/user/AvailabilityMapper.ts (94%) rename src/script/{ => repositories}/user/AvailabilityModal.ts (97%) rename src/script/{ => repositories}/user/ConsentValue.ts (100%) rename src/script/{ => repositories}/user/RichProfileRepository.ts (94%) rename src/script/{ => repositories}/user/TypingIndicatorMode.ts (100%) rename src/script/{ => repositories}/user/UserFilter.ts (91%) rename src/script/{ => repositories}/user/UserGuards.ts (100%) rename src/script/{ => repositories}/user/UserHandleGenerator.ts (100%) rename src/script/{ => repositories}/user/UserMapper.test.ts (100%) rename src/script/{ => repositories}/user/UserMapper.ts (97%) rename src/script/{ => repositories}/user/UserPermission.ts (99%) rename src/script/{ => repositories}/user/UserRepository.test.ts (99%) rename src/script/{ => repositories}/user/UserRepository.ts (99%) rename src/script/{ => repositories}/user/UserService.ts (97%) rename src/script/{ => repositories}/user/UserState.ts (97%) diff --git a/src/script/E2EIdentity/E2EIdentityEnrollment.test.ts b/src/script/E2EIdentity/E2EIdentityEnrollment.test.ts index dc04ccc4260..d0013ec2fa6 100644 --- a/src/script/E2EIdentity/E2EIdentityEnrollment.test.ts +++ b/src/script/E2EIdentity/E2EIdentityEnrollment.test.ts @@ -25,8 +25,8 @@ import {container} from 'tsyringe'; import {PrimaryModal} from 'Components/Modals/PrimaryModal'; import {PrimaryModalType} from 'Components/Modals/PrimaryModal/PrimaryModalTypes'; import {ConversationState} from 'Repositories/conversation/ConversationState'; +import {UserState} from 'Repositories/user/UserState'; import {Core} from 'src/script/service/CoreSingleton'; -import {UserState} from 'src/script/user/UserState'; import * as util from 'Util/util'; import {E2EIHandler} from './E2EIdentityEnrollment'; diff --git a/src/script/E2EIdentity/E2EIdentityEnrollment.ts b/src/script/E2EIdentity/E2EIdentityEnrollment.ts index f1009876ce9..1866c1f1c2c 100644 --- a/src/script/E2EIdentity/E2EIdentityEnrollment.ts +++ b/src/script/E2EIdentity/E2EIdentityEnrollment.ts @@ -27,8 +27,8 @@ import {TypedEventEmitter} from '@wireapp/commons'; import {WebAppEvents} from '@wireapp/webapp-events'; import {PrimaryModal, removeCurrentModal} from 'Components/Modals/PrimaryModal'; +import {UserState} from 'Repositories/user/UserState'; import {Core} from 'src/script/service/CoreSingleton'; -import {UserState} from 'src/script/user/UserState'; import {getLogger} from 'Util/Logger'; import {formatDelayTime, TIME_IN_MILLIS} from 'Util/TimeUtil'; import {removeUrlParameters} from 'Util/UrlUtil'; diff --git a/src/script/components/AppContainer/hooks/useAccentColor.ts b/src/script/components/AppContainer/hooks/useAccentColor.ts index 44ef219062e..cbe6eeb3b20 100644 --- a/src/script/components/AppContainer/hooks/useAccentColor.ts +++ b/src/script/components/AppContainer/hooks/useAccentColor.ts @@ -22,7 +22,7 @@ import {useEffect} from 'react'; import ko from 'knockout'; import {container} from 'tsyringe'; -import {UserState} from 'src/script/user/UserState'; +import {UserState} from 'Repositories/user/UserState'; function setAccentColor(accentColor?: number) { if (!accentColor) { diff --git a/src/script/components/Avatar/UserAvatar/UserAvatar.test.tsx b/src/script/components/Avatar/UserAvatar/UserAvatar.test.tsx index 4a7c8154612..c0885eed0e6 100644 --- a/src/script/components/Avatar/UserAvatar/UserAvatar.test.tsx +++ b/src/script/components/Avatar/UserAvatar/UserAvatar.test.tsx @@ -21,8 +21,8 @@ import {render} from '@testing-library/react'; import {Availability} from '@wireapp/protocol-messaging'; +import {TeamState} from 'Repositories/team/TeamState'; import {User} from 'src/script/entity/User'; -import {TeamState} from 'src/script/team/TeamState'; import {UserAvatar} from './UserAvatar'; diff --git a/src/script/components/Avatar/UserAvatar/UserAvatar.tsx b/src/script/components/Avatar/UserAvatar/UserAvatar.tsx index 81a157b572a..76ef8967b89 100644 --- a/src/script/components/Avatar/UserAvatar/UserAvatar.tsx +++ b/src/script/components/Avatar/UserAvatar/UserAvatar.tsx @@ -26,11 +26,11 @@ import {COLOR} from '@wireapp/react-ui-kit'; import {AvailabilityIcon} from 'Components/AvailabilityIcon'; import {useUserName} from 'Components/UserName'; +import {TeamState} from 'Repositories/team/TeamState'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; import {User} from '../../../entity/User'; -import {TeamState} from '../../../team/TeamState'; import {AVATAR_SIZE, STATE} from '../Avatar'; import {AvatarBackground} from '../AvatarBackground'; import {AvatarBadge} from '../AvatarBadge'; diff --git a/src/script/components/Badge/components/VerificationBadges/VerificationBadges.tsx b/src/script/components/Badge/components/VerificationBadges/VerificationBadges.tsx index 27e7ccfa98c..d98a1a39550 100644 --- a/src/script/components/Badge/components/VerificationBadges/VerificationBadges.tsx +++ b/src/script/components/Badge/components/VerificationBadges/VerificationBadges.tsx @@ -34,14 +34,14 @@ import { Tooltip, } from '@wireapp/react-ui-kit'; +import {useUserIdentity} from 'Hooks/useDeviceIdentities'; import {ClientEntity} from 'Repositories/client'; import {ConversationVerificationState} from 'Repositories/conversation/ConversationVerificationState'; import {checkUserHandle} from 'Repositories/conversation/ConversationVerificationStateHandler'; +import {UserState} from 'Repositories/user/UserState'; import {MLSStatuses, WireIdentity} from 'src/script/E2EIdentity/E2EIdentityVerification'; import {Conversation} from 'src/script/entity/Conversation'; import {User} from 'src/script/entity/User'; -import {useUserIdentity} from 'src/script/hooks/useDeviceIdentities'; -import {UserState} from 'src/script/user/UserState'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {StringIdentifer, t} from 'Util/LocalizerUtil'; import {waitFor} from 'Util/waitFor'; diff --git a/src/script/components/ConnectRequests/ConnectionRequests.tsx b/src/script/components/ConnectRequests/ConnectionRequests.tsx index 1f91ee603f1..ed08e5a7f1e 100644 --- a/src/script/components/ConnectRequests/ConnectionRequests.tsx +++ b/src/script/components/ConnectRequests/ConnectionRequests.tsx @@ -27,6 +27,8 @@ import {Avatar, AVATAR_SIZE} from 'Components/Avatar'; import {UserClassifiedBar} from 'Components/ClassifiedBar/ClassifiedBar'; import {UnverifiedUserWarning} from 'Components/Modals/UserModal'; import {UserName} from 'Components/UserName'; +import {TeamState} from 'Repositories/team/TeamState'; +import {UserState} from 'Repositories/user/UserState'; import {SidebarTabs, useSidebarStore} from 'src/script/page/LeftSidebar/panels/Conversations/useSidebarStore'; import {useAppMainState, ViewType} from 'src/script/page/state'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; @@ -34,8 +36,6 @@ import {t} from 'Util/LocalizerUtil'; import {User} from '../../entity/User'; import {RootContext} from '../../page/RootProvider'; -import {TeamState} from '../../team/TeamState'; -import {UserState} from '../../user/UserState'; interface ConnectRequestsProps { readonly userState: UserState; diff --git a/src/script/components/Conversation/Conversation.tsx b/src/script/components/Conversation/Conversation.tsx index 9e6ea52ec4c..d068e988aab 100644 --- a/src/script/components/Conversation/Conversation.tsx +++ b/src/script/components/Conversation/Conversation.tsx @@ -37,6 +37,7 @@ import {CallState} from 'Repositories/calling/CallState'; import {ConversationState} from 'Repositories/conversation/ConversationState'; import {ServiceEntity} from 'Repositories/integration/ServiceEntity'; import {PROPERTIES_TYPE} from 'Repositories/properties/PropertiesType'; +import {TeamState} from 'Repositories/team/TeamState'; import {Config} from 'src/script/Config'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {isLastReceivedMessage} from 'Util/conversationMessages'; @@ -64,7 +65,6 @@ import {MotionDuration} from '../../motion/MotionDuration'; import {RightSidebarParams} from '../../page/AppMain'; import {PanelState} from '../../page/RightSidebar'; import {useMainViewModel} from '../../page/RootProvider'; -import {TeamState} from '../../team/TeamState'; import {ElementType, MessageDetails} from '../MessagesList/Message/ContentMessage/asset/TextMessageRenderer'; interface ConversationProps { diff --git a/src/script/components/Conversation/utils/checkFileSharingPermission.ts b/src/script/components/Conversation/utils/checkFileSharingPermission.ts index b322bf590f4..86ff71ba12d 100644 --- a/src/script/components/Conversation/utils/checkFileSharingPermission.ts +++ b/src/script/components/Conversation/utils/checkFileSharingPermission.ts @@ -20,7 +20,7 @@ import {container} from 'tsyringe'; import {showWarningModal} from 'Components/Modals/utils/showWarningModal'; -import {TeamState} from 'src/script/team/TeamState'; +import {TeamState} from 'Repositories/team/TeamState'; import {t} from 'Util/LocalizerUtil'; /** diff --git a/src/script/components/Image/Image.tsx b/src/script/components/Image/Image.tsx index 97578ec20e8..3db37899551 100644 --- a/src/script/components/Image/Image.tsx +++ b/src/script/components/Image/Image.tsx @@ -25,6 +25,7 @@ import {container} from 'tsyringe'; import {InViewport} from 'Components/InViewport'; import {AssetRemoteData} from 'Repositories/assets/AssetRemoteData'; +import {TeamState} from 'Repositories/team/TeamState'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {getImageStyle, getWrapperStyles} from './Image.styles'; @@ -32,7 +33,6 @@ import {RestrictedImage} from './RestrictedImage'; import {Config} from '../../Config'; import {MediumImage} from '../../entity/message/MediumImage'; -import {TeamState} from '../../team/TeamState'; import {AssetUrl, useAssetTransfer} from '../MessagesList/Message/ContentMessage/asset/useAssetTransfer'; interface BaseImageProps extends React.HTMLProps { diff --git a/src/script/components/InputBar/InputBar.test.tsx b/src/script/components/InputBar/InputBar.test.tsx index 276ac57b51e..d2f17c0cd1a 100644 --- a/src/script/components/InputBar/InputBar.test.tsx +++ b/src/script/components/InputBar/InputBar.test.tsx @@ -29,6 +29,7 @@ import {PropertiesService} from 'Repositories/properties/PropertiesService'; import {SearchRepository} from 'Repositories/search/SearchRepository'; import {SelfService} from 'Repositories/self/SelfService'; import {StorageRepository} from 'Repositories/storage'; +import {TeamState} from 'Repositories/team/TeamState'; import {withTheme} from 'src/script/auth/util/test/TestUtil'; import {Config} from 'src/script/Config'; import {createUuid} from 'Util/uuid'; @@ -36,7 +37,6 @@ import {createUuid} from 'Util/uuid'; import {TestFactory} from '../../../../test/helper/TestFactory'; import {Conversation} from '../../entity/Conversation'; import {User} from '../../entity/User'; -import {TeamState} from '../../team/TeamState'; const testFactory = new TestFactory(); diff --git a/src/script/components/InputBar/InputBar.tsx b/src/script/components/InputBar/InputBar.tsx index 780fa9b664b..f7c93ba2433 100644 --- a/src/script/components/InputBar/InputBar.tsx +++ b/src/script/components/InputBar/InputBar.tsx @@ -42,8 +42,9 @@ import {PropertiesRepository} from 'Repositories/properties/PropertiesRepository import {PROPERTIES_TYPE} from 'Repositories/properties/PropertiesType'; import {SearchRepository} from 'Repositories/search/SearchRepository'; import {StorageRepository} from 'Repositories/storage'; +import {TeamState} from 'Repositories/team/TeamState'; +import {CONVERSATION_TYPING_INDICATOR_MODE} from 'Repositories/user/TypingIndicatorMode'; import {useUserPropertyValue} from 'src/script/hooks/useUserProperty'; -import {CONVERSATION_TYPING_INDICATOR_MODE} from 'src/script/user/TypingIndicatorMode'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {KEY} from 'Util/KeyboardUtil'; import {t} from 'Util/LocalizerUtil'; @@ -69,7 +70,6 @@ import {MentionEntity} from '../../message/MentionEntity'; import {MessageHasher} from '../../message/MessageHasher'; import {QuoteEntity} from '../../message/QuoteEntity'; import {useAppMainState} from '../../page/state'; -import {TeamState} from '../../team/TeamState'; const CONFIG = { ...Config.getConfig(), diff --git a/src/script/components/InputBar/components/MessageTimerButton/MessageTimerButton.test.tsx b/src/script/components/InputBar/components/MessageTimerButton/MessageTimerButton.test.tsx index b202981697a..395e5a1c768 100644 --- a/src/script/components/InputBar/components/MessageTimerButton/MessageTimerButton.test.tsx +++ b/src/script/components/InputBar/components/MessageTimerButton/MessageTimerButton.test.tsx @@ -20,8 +20,8 @@ import {fireEvent, render} from '@testing-library/react'; import ko from 'knockout'; +import {TeamState} from 'Repositories/team/TeamState'; import type {Conversation} from 'src/script/entity/Conversation'; -import {TeamState} from 'src/script/team/TeamState'; import * as Context from 'src/script/ui/ContextMenu'; import {TIME_IN_MILLIS} from 'Util/TimeUtil'; diff --git a/src/script/components/InputBar/components/MessageTimerButton/MessageTimerButton.tsx b/src/script/components/InputBar/components/MessageTimerButton/MessageTimerButton.tsx index 994ff99b09a..1b23ed4fa18 100644 --- a/src/script/components/InputBar/components/MessageTimerButton/MessageTimerButton.tsx +++ b/src/script/components/InputBar/components/MessageTimerButton/MessageTimerButton.tsx @@ -23,9 +23,9 @@ import cx from 'classnames'; import {container} from 'tsyringe'; import * as Icon from 'Components/Icon'; +import {TeamState} from 'Repositories/team/TeamState'; import {Conversation} from 'src/script/entity/Conversation'; import {EphemeralTimings} from 'src/script/ephemeral/EphemeralTimings'; -import {TeamState} from 'src/script/team/TeamState'; import {showContextMenu} from 'src/script/ui/ContextMenu'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {isSpaceOrEnterKey} from 'Util/KeyboardUtil'; diff --git a/src/script/components/MessagesList/Message/ContentMessage/asset/AudioAsset.tsx b/src/script/components/MessagesList/Message/ContentMessage/asset/AudioAsset.tsx index 6967307dc1e..3f4f7b96ff8 100644 --- a/src/script/components/MessagesList/Message/ContentMessage/asset/AudioAsset.tsx +++ b/src/script/components/MessagesList/Message/ContentMessage/asset/AudioAsset.tsx @@ -25,6 +25,7 @@ import {container} from 'tsyringe'; import {RestrictedAudio} from 'Components/asset/RestrictedAudio'; import * as Icon from 'Components/Icon'; import {AssetTransferState} from 'Repositories/assets/AssetTransferState'; +import {TeamState} from 'Repositories/team/TeamState'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {getLogger} from 'Util/Logger'; import {formatSeconds} from 'Util/TimeUtil'; @@ -38,7 +39,6 @@ import {AssetUrl, useAssetTransfer} from './useAssetTransfer'; import type {ContentMessage} from '../../../../../entity/message/ContentMessage'; import type {FileAsset} from '../../../../../entity/message/FileAsset'; -import {TeamState} from '../../../../../team/TeamState'; const logger = getLogger('AudioAssetComponent'); diff --git a/src/script/components/MessagesList/Message/ContentMessage/asset/FileAssetComponent.test.tsx b/src/script/components/MessagesList/Message/ContentMessage/asset/FileAssetComponent.test.tsx index c2832c8f279..fcdcc4699cd 100644 --- a/src/script/components/MessagesList/Message/ContentMessage/asset/FileAssetComponent.test.tsx +++ b/src/script/components/MessagesList/Message/ContentMessage/asset/FileAssetComponent.test.tsx @@ -20,9 +20,9 @@ import {render} from '@testing-library/react'; import ko from 'knockout'; +import {TeamState} from 'Repositories/team/TeamState'; import {ContentMessage} from 'src/script/entity/message/ContentMessage'; import {FileAsset} from 'src/script/entity/message/FileAsset'; -import {TeamState} from 'src/script/team/TeamState'; import {FileAsset as FileAssetComponent} from './FileAssetComponent'; diff --git a/src/script/components/MessagesList/Message/ContentMessage/asset/FileAssetComponent.tsx b/src/script/components/MessagesList/Message/ContentMessage/asset/FileAssetComponent.tsx index 7d0ddb9e65f..4d83f4fde3d 100644 --- a/src/script/components/MessagesList/Message/ContentMessage/asset/FileAssetComponent.tsx +++ b/src/script/components/MessagesList/Message/ContentMessage/asset/FileAssetComponent.tsx @@ -24,6 +24,7 @@ import {container} from 'tsyringe'; import {RestrictedFile} from 'Components/asset/RestrictedFile'; import {AssetTransferState} from 'Repositories/assets/AssetTransferState'; +import {TeamState} from 'Repositories/team/TeamState'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {handleKeyDown} from 'Util/KeyboardUtil'; import {t} from 'Util/LocalizerUtil'; @@ -35,7 +36,6 @@ import {useAssetTransfer} from './useAssetTransfer'; import type {ContentMessage} from '../../../../../entity/message/ContentMessage'; import type {FileAsset as FileAssetType} from '../../../../../entity/message/FileAsset'; -import {TeamState} from '../../../../../team/TeamState'; import {useMessageFocusedTabIndex} from '../../util'; export interface FileAssetProps { diff --git a/src/script/components/MessagesList/Message/ContentMessage/asset/VideoAsset.tsx b/src/script/components/MessagesList/Message/ContentMessage/asset/VideoAsset.tsx index 9cd6bcf2ef1..76b23a3787e 100644 --- a/src/script/components/MessagesList/Message/ContentMessage/asset/VideoAsset.tsx +++ b/src/script/components/MessagesList/Message/ContentMessage/asset/VideoAsset.tsx @@ -30,6 +30,7 @@ import {WebAppEvents} from '@wireapp/webapp-events'; import {RestrictedVideo} from 'Components/asset/RestrictedVideo'; import {AssetRepository} from 'Repositories/assets/AssetRepository'; import {AssetTransferState} from 'Repositories/assets/AssetTransferState'; +import {TeamState} from 'Repositories/team/TeamState'; import {EventName} from 'Repositories/tracking/EventName'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; @@ -43,7 +44,6 @@ import {AssetUrl, useAssetTransfer} from './useAssetTransfer'; import type {ContentMessage} from '../../../../../entity/message/ContentMessage'; import type {FileAsset as FileAssetType} from '../../../../../entity/message/FileAsset'; -import {TeamState} from '../../../../../team/TeamState'; interface VideoAssetProps { assetRepository?: AssetRepository; diff --git a/src/script/components/MessagesList/Message/FailedToAddUsersMessage.test.tsx b/src/script/components/MessagesList/Message/FailedToAddUsersMessage.test.tsx index 0c0fd9d53a2..dda23bb1a97 100644 --- a/src/script/components/MessagesList/Message/FailedToAddUsersMessage.test.tsx +++ b/src/script/components/MessagesList/Message/FailedToAddUsersMessage.test.tsx @@ -22,10 +22,10 @@ import {QualifiedId} from '@wireapp/api-client/lib/user'; import {AddUsersFailure, AddUsersFailureReasons} from '@wireapp/core/lib/conversation'; import en from 'I18n/en-US.json'; +import {UserState} from 'Repositories/user/UserState'; import {withTheme, generateQualifiedIds} from 'src/script/auth/util/test/TestUtil'; import {FailedToAddUsersMessage as FailedToAddUsersMessageEntity} from 'src/script/entity/message/FailedToAddUsersMessage'; import {User} from 'src/script/entity/User'; -import {UserState} from 'src/script/user/UserState'; import {setStrings} from 'Util/LocalizerUtil'; import {FailedToAddUsersMessage} from './FailedToAddUsersMessage'; diff --git a/src/script/components/MessagesList/Message/FailedToAddUsersMessage.tsx b/src/script/components/MessagesList/Message/FailedToAddUsersMessage.tsx index d89ff4466ba..126d63ce4df 100644 --- a/src/script/components/MessagesList/Message/FailedToAddUsersMessage.tsx +++ b/src/script/components/MessagesList/Message/FailedToAddUsersMessage.tsx @@ -26,9 +26,9 @@ import {Button, ButtonVariant, Link, LinkVariant} from '@wireapp/react-ui-kit'; import * as Icon from 'Components/Icon'; import {getUserName} from 'Components/UserName'; +import {UserState} from 'Repositories/user/UserState'; import {Config} from 'src/script/Config'; import {User} from 'src/script/entity/User'; -import {UserState} from 'src/script/user/UserState'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; import {matchQualifiedIds} from 'Util/QualifiedId'; diff --git a/src/script/components/MessagesList/Message/MessageWrapper.tsx b/src/script/components/MessagesList/Message/MessageWrapper.tsx index 993603f5032..91395eeb6fe 100644 --- a/src/script/components/MessagesList/Message/MessageWrapper.tsx +++ b/src/script/components/MessagesList/Message/MessageWrapper.tsx @@ -29,6 +29,7 @@ import {WebAppEvents} from '@wireapp/webapp-events'; import {E2EIVerificationMessage} from 'Components/MessagesList/Message/E2EIVerificationMessage'; import {AssetRepository} from 'Repositories/assets/AssetRepository'; import {OutgoingQuote} from 'Repositories/conversation/MessageRepository'; +import {TeamState} from 'Repositories/team/TeamState'; import {ContentMessage} from 'src/script/entity/message/ContentMessage'; import {Text} from 'src/script/entity/message/Text'; import {QuoteEntity} from 'src/script/message/QuoteEntity'; @@ -52,7 +53,6 @@ import {VerificationMessage} from './VerificationMessage'; import {Conversation} from '../../../entity/Conversation'; import {CompositeMessage} from '../../../entity/message/CompositeMessage'; -import {TeamState} from '../../../team/TeamState'; import {ContextMenuEntry} from '../../../ui/ContextMenu'; import {MessageParams} from './index'; diff --git a/src/script/components/MessagesList/Message/index.tsx b/src/script/components/MessagesList/Message/index.tsx index 26aca44a0a5..117ad0903bc 100644 --- a/src/script/components/MessagesList/Message/index.tsx +++ b/src/script/components/MessagesList/Message/index.tsx @@ -25,6 +25,7 @@ import cx from 'classnames'; import {InViewport} from 'Components/InViewport'; import type {MessageRepository} from 'Repositories/conversation/MessageRepository'; import {ServiceEntity} from 'Repositories/integration/ServiceEntity'; +import {TeamState} from 'Repositories/team/TeamState'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {getAllFocusableElements, setElementsTabIndex} from 'Util/focusUtil'; import {isTabKey} from 'Util/KeyboardUtil'; @@ -40,7 +41,6 @@ import type {DecryptErrorMessage} from '../../../entity/message/DecryptErrorMess import type {MemberMessage as MemberMessageEntity} from '../../../entity/message/MemberMessage'; import {Message as BaseMessage} from '../../../entity/message/Message'; import type {User} from '../../../entity/User'; -import {TeamState} from '../../../team/TeamState'; export interface MessageActions { onClickAvatar: (user: User | ServiceEntity) => void; diff --git a/src/script/components/Modals/GroupCreation/GroupCreationModal.tsx b/src/script/components/Modals/GroupCreation/GroupCreationModal.tsx index b4a3341b178..6a158774420 100644 --- a/src/script/components/Modals/GroupCreation/GroupCreationModal.tsx +++ b/src/script/components/Modals/GroupCreation/GroupCreationModal.tsx @@ -44,6 +44,8 @@ import { toggleFeature, } from 'Repositories/conversation/ConversationAccessPermission'; import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; +import {TeamState} from 'Repositories/team/TeamState'; +import {UserState} from 'Repositories/user/UserState'; import {SidebarTabs, useSidebarStore} from 'src/script/page/LeftSidebar/panels/Conversations/useSidebarStore'; import {generateConversationUrl} from 'src/script/router/routeGenerator'; import {createNavigate, createNavigateKeyboard} from 'src/script/router/routerBindings'; @@ -56,8 +58,6 @@ import {Config} from '../../../Config'; import {User} from '../../../entity/User'; import {isProtocolOption, ProtocolOption} from '../../../guards/Protocol'; import {RootContext} from '../../../page/RootProvider'; -import {TeamState} from '../../../team/TeamState'; -import {UserState} from '../../../user/UserState'; import {PrimaryModal} from '../PrimaryModal'; interface GroupCreationModalProps { diff --git a/src/script/components/Modals/LegalHoldModal/LegalHoldModal.test.tsx b/src/script/components/Modals/LegalHoldModal/LegalHoldModal.test.tsx index 2a23570081d..cd2d5e9b7d6 100644 --- a/src/script/components/Modals/LegalHoldModal/LegalHoldModal.test.tsx +++ b/src/script/components/Modals/LegalHoldModal/LegalHoldModal.test.tsx @@ -27,14 +27,14 @@ import {ConversationRepository} from 'Repositories/conversation/ConversationRepo import {MessageRepository} from 'Repositories/conversation/MessageRepository'; import {CryptographyRepository} from 'Repositories/cryptography/CryptographyRepository'; import {SearchRepository} from 'Repositories/search/SearchRepository'; +import {TeamRepository} from 'Repositories/team/TeamRepository'; +import {UserRepository} from 'Repositories/user/UserRepository'; import {LegalHoldModal, LegalHoldModalType} from './LegalHoldModal'; import {TestFactory} from '../../../../../test/helper/TestFactory'; import {Conversation} from '../../../entity/Conversation'; import {User} from '../../../entity/User'; -import {TeamRepository} from '../../../team/TeamRepository'; -import {UserRepository} from '../../../user/UserRepository'; const userRepository = {} as UserRepository; const testFactory = new TestFactory(); diff --git a/src/script/components/Modals/LegalHoldModal/LegalHoldModal.tsx b/src/script/components/Modals/LegalHoldModal/LegalHoldModal.tsx index 34c513f3069..e1ea18164d4 100644 --- a/src/script/components/Modals/LegalHoldModal/LegalHoldModal.tsx +++ b/src/script/components/Modals/LegalHoldModal/LegalHoldModal.tsx @@ -34,13 +34,13 @@ import {ConversationRepository} from 'Repositories/conversation/ConversationRepo import {MessageRepository} from 'Repositories/conversation/MessageRepository'; import {CryptographyRepository} from 'Repositories/cryptography/CryptographyRepository'; import {SearchRepository} from 'Repositories/search/SearchRepository'; +import {TeamRepository} from 'Repositories/team/TeamRepository'; import {handleEnterDown} from 'Util/KeyboardUtil'; import {t} from 'Util/LocalizerUtil'; import {useLegalHoldModalState} from './LegalHoldModal.state'; import {User} from '../../../entity/User'; -import {TeamRepository} from '../../../team/TeamRepository'; const DISABLE_SUBMIT_TEXT_LENGTH = 1; diff --git a/src/script/components/Modals/QualityFeedbackModal/QualityFeedbackModal.test.tsx b/src/script/components/Modals/QualityFeedbackModal/QualityFeedbackModal.test.tsx index f445f382394..3131a38404f 100644 --- a/src/script/components/Modals/QualityFeedbackModal/QualityFeedbackModal.test.tsx +++ b/src/script/components/Modals/QualityFeedbackModal/QualityFeedbackModal.test.tsx @@ -28,12 +28,12 @@ import {CALL_QUALITY_FEEDBACK_KEY} from 'Components/Modals/QualityFeedbackModal/ import {RatingListLabel} from 'Components/Modals/QualityFeedbackModal/typings'; import {EventName} from 'Repositories/tracking/EventName'; import {Segmentation} from 'Repositories/tracking/Segmentation'; +import {UserState} from 'Repositories/user/UserState'; import {QualityFeedbackModal} from './QualityFeedbackModal'; import {withIntl, withTheme} from '../../../auth/util/test/TestUtil'; import {User} from '../../../entity/User'; -import {UserState} from '../../../user/UserState'; jest.mock('Repositories/tracking/Countly.helpers', () => ({ isCountlyEnabledAtCurrentEnvironment: () => true, diff --git a/src/script/components/Modals/QualityFeedbackModal/QualityFeedbackModal.tsx b/src/script/components/Modals/QualityFeedbackModal/QualityFeedbackModal.tsx index 2fcda059eed..223c897f9e1 100644 --- a/src/script/components/Modals/QualityFeedbackModal/QualityFeedbackModal.tsx +++ b/src/script/components/Modals/QualityFeedbackModal/QualityFeedbackModal.tsx @@ -31,6 +31,7 @@ import {ModalComponent} from 'Components/Modals/ModalComponent'; import {RatingListLabel} from 'Components/Modals/QualityFeedbackModal/typings'; import {EventName} from 'Repositories/tracking/EventName'; import {Segmentation} from 'Repositories/tracking/Segmentation'; +import {UserState} from 'Repositories/user/UserState'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; import {getLogger} from 'Util/Logger'; @@ -47,8 +48,6 @@ import { wrapper, } from './QualityFeedbackModal.styles'; -import {UserState} from '../../../user/UserState'; - const logger = getLogger('CallQualityFeedback'); export const QualityFeedbackModal = () => { diff --git a/src/script/components/Modals/UserModal/UserModal.test.tsx b/src/script/components/Modals/UserModal/UserModal.test.tsx index 3fe5c10320d..54d64121187 100644 --- a/src/script/components/Modals/UserModal/UserModal.test.tsx +++ b/src/script/components/Modals/UserModal/UserModal.test.tsx @@ -20,10 +20,10 @@ import {render, waitFor} from '@testing-library/react'; import {QualifiedId} from '@wireapp/api-client/lib/user'; +import {TeamState} from 'Repositories/team/TeamState'; +import {UserRepository} from 'Repositories/user/UserRepository'; import {User} from 'src/script/entity/User'; import {Core} from 'src/script/service/CoreSingleton'; -import {TeamState} from 'src/script/team/TeamState'; -import {UserRepository} from 'src/script/user/UserRepository'; import {UserModal, UserModalProps} from './UserModal'; import {showUserModal} from './UserModal.state'; diff --git a/src/script/components/Modals/UserModal/UserModal.tsx b/src/script/components/Modals/UserModal/UserModal.tsx index d485a54ae76..71080704c73 100644 --- a/src/script/components/Modals/UserModal/UserModal.tsx +++ b/src/script/components/Modals/UserModal/UserModal.tsx @@ -31,6 +31,8 @@ import {ModalComponent} from 'Components/Modals/ModalComponent'; import {EnrichedFields} from 'Components/panel/EnrichedFields'; import {UserActions} from 'Components/panel/UserActions'; import {UserDetails} from 'Components/panel/UserDetails'; +import {TeamState} from 'Repositories/team/TeamState'; +import {UserRepository} from 'Repositories/user/UserRepository'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {handleKeyDown} from 'Util/KeyboardUtil'; import {replaceLink, t} from 'Util/LocalizerUtil'; @@ -42,8 +44,6 @@ import {Config} from '../../../Config'; import {User} from '../../../entity/User'; import {RootContext} from '../../../page/RootProvider'; import {Core} from '../../../service/CoreSingleton'; -import {TeamState} from '../../../team/TeamState'; -import {UserRepository} from '../../../user/UserRepository'; export interface UserModalProps { userRepository: UserRepository; diff --git a/src/script/components/SearchInput/SearchInput.tsx b/src/script/components/SearchInput/SearchInput.tsx index c0635b92fd6..6b61efcf30c 100644 --- a/src/script/components/SearchInput/SearchInput.tsx +++ b/src/script/components/SearchInput/SearchInput.tsx @@ -21,11 +21,11 @@ import React, {useEffect, useLayoutEffect, useRef} from 'react'; import cx from 'classnames'; +import {MAX_HANDLE_LENGTH} from 'Repositories/user/UserHandleGenerator'; import {isEnterKey} from 'Util/KeyboardUtil'; import {t} from 'Util/LocalizerUtil'; import type {User} from '../../entity/User'; -import {MAX_HANDLE_LENGTH} from '../../user/UserHandleGenerator'; import * as Icon from '../Icon'; interface SearchInputProps { diff --git a/src/script/components/TitleBar/TitleBar.test.tsx b/src/script/components/TitleBar/TitleBar.test.tsx index 04856f29915..500deff91af 100644 --- a/src/script/components/TitleBar/TitleBar.test.tsx +++ b/src/script/components/TitleBar/TitleBar.test.tsx @@ -30,6 +30,7 @@ import {TitleBar} from 'Components/TitleBar'; import {CallingRepository} from 'Repositories/calling/CallingRepository'; import {CallState} from 'Repositories/calling/CallState'; import {ConversationVerificationState} from 'Repositories/conversation/ConversationVerificationState'; +import {TeamState} from 'Repositories/team/TeamState'; import {withTheme} from 'src/script/auth/util/test/TestUtil'; import {ContentState} from 'src/script/page/useAppState'; @@ -37,7 +38,6 @@ import {TestFactory} from '../../../../test/helper/TestFactory'; import {Conversation} from '../../entity/Conversation'; import {User} from '../../entity/User'; import {PanelState} from '../../page/RightSidebar/RightSidebar'; -import {TeamState} from '../../team/TeamState'; import {ViewModelRepositories} from '../../view_model/MainViewModel'; jest.mock('@wireapp/react-ui-kit', () => ({ diff --git a/src/script/components/TitleBar/TitleBar.tsx b/src/script/components/TitleBar/TitleBar.tsx index 08877985726..fff4af40705 100644 --- a/src/script/components/TitleBar/TitleBar.tsx +++ b/src/script/components/TitleBar/TitleBar.tsx @@ -33,6 +33,7 @@ import * as Icon from 'Components/Icon'; import {LegalHoldDot} from 'Components/LegalHoldDot'; import {CallState} from 'Repositories/calling/CallState'; import {ConversationFilter} from 'Repositories/conversation/ConversationFilter'; +import {TeamState} from 'Repositories/team/TeamState'; import {User} from 'src/script/entity/User'; import {useAppMainState, ViewType} from 'src/script/page/state'; import {ContentState} from 'src/script/page/useAppState'; @@ -45,7 +46,6 @@ import {TIME_IN_MILLIS} from 'Util/TimeUtil'; import {Conversation} from '../../entity/Conversation'; import {RightSidebarParams} from '../../page/AppMain'; import {PanelState} from '../../page/RightSidebar/RightSidebar'; -import {TeamState} from '../../team/TeamState'; import {Shortcut} from '../../ui/Shortcut'; import {ShortcutType} from '../../ui/ShortcutType'; import {CallActions} from '../../view_model/CallingViewModel'; diff --git a/src/script/components/UserList/UserList.tsx b/src/script/components/UserList/UserList.tsx index d944366bba5..89669c0be22 100644 --- a/src/script/components/UserList/UserList.tsx +++ b/src/script/components/UserList/UserList.tsx @@ -27,6 +27,7 @@ import {InViewport} from 'Components/InViewport'; import {collapseButton, collapseIcon} from 'Components/UserList/UserList.styles'; import type {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; import {ConversationState} from 'Repositories/conversation/ConversationState'; +import {TeamState} from 'Repositories/team/TeamState'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {isEnterKey, isSpaceKey} from 'Util/KeyboardUtil'; import {t} from 'Util/LocalizerUtil'; @@ -35,7 +36,6 @@ import {UserListItem} from './components/UserListItem'; import type {Conversation} from '../../entity/Conversation'; import type {User} from '../../entity/User'; -import {TeamState} from '../../team/TeamState'; export enum UserlistMode { COMPACT = 'UserlistMode.COMPACT', diff --git a/src/script/components/UserSearchableList/UserSearchableList.tsx b/src/script/components/UserSearchableList/UserSearchableList.tsx index 253bfc1cc8c..e9692380382 100644 --- a/src/script/components/UserSearchableList/UserSearchableList.tsx +++ b/src/script/components/UserSearchableList/UserSearchableList.tsx @@ -26,14 +26,14 @@ import {debounce} from 'underscore'; import {UserList} from 'Components/UserList'; import {ConversationState} from 'Repositories/conversation/ConversationState'; import {SearchRepository} from 'Repositories/search/SearchRepository'; +import type {TeamRepository} from 'Repositories/team/TeamRepository'; +import {TeamState} from 'Repositories/team/TeamState'; import {partition} from 'Util/ArrayUtil'; import {t} from 'Util/LocalizerUtil'; import {matchQualifiedIds} from 'Util/QualifiedId'; import {sortByPriority} from 'Util/StringUtil'; import type {User} from '../../entity/User'; -import type {TeamRepository} from '../../team/TeamRepository'; -import {TeamState} from '../../team/TeamState'; export type UserListProps = React.ComponentProps & { conversationState?: ConversationState; diff --git a/src/script/components/calling/CallParticipantsListItem/CallParticipantsListItem.test.tsx b/src/script/components/calling/CallParticipantsListItem/CallParticipantsListItem.test.tsx index 8798cd1092e..7fa56eb8137 100644 --- a/src/script/components/calling/CallParticipantsListItem/CallParticipantsListItem.test.tsx +++ b/src/script/components/calling/CallParticipantsListItem/CallParticipantsListItem.test.tsx @@ -22,8 +22,8 @@ import {render} from '@testing-library/react'; import {Availability} from '@wireapp/protocol-messaging'; import {Participant} from 'Repositories/calling/Participant'; +import {ROLE} from 'Repositories/user/UserPermission'; import {User} from 'src/script/entity/User'; -import {ROLE} from 'src/script/user/UserPermission'; import {createUuid} from 'Util/uuid'; import {CallParticipantsListItem} from './CallParticipantsListItem'; diff --git a/src/script/components/calling/CallingCell/CallingCell.test.tsx b/src/script/components/calling/CallingCell/CallingCell.test.tsx index 7998a5da89a..721aa122a31 100644 --- a/src/script/components/calling/CallingCell/CallingCell.test.tsx +++ b/src/script/components/calling/CallingCell/CallingCell.test.tsx @@ -27,9 +27,9 @@ import {Call} from 'Repositories/calling/Call'; import {CallingRepository} from 'Repositories/calling/CallingRepository'; import {Participant} from 'Repositories/calling/Participant'; import {MediaDevicesHandler} from 'Repositories/media/MediaDevicesHandler'; +import {TeamState} from 'Repositories/team/TeamState'; import {Conversation} from 'src/script/entity/Conversation'; import {User} from 'src/script/entity/User'; -import {TeamState} from 'src/script/team/TeamState'; import {CallActions} from 'src/script/view_model/CallingViewModel'; import {createUuid} from 'Util/uuid'; diff --git a/src/script/components/calling/CallingCell/CallingCell.tsx b/src/script/components/calling/CallingCell/CallingCell.tsx index 323d0ca8dd9..f99175d6162 100644 --- a/src/script/components/calling/CallingCell/CallingCell.tsx +++ b/src/script/components/calling/CallingCell/CallingCell.tsx @@ -31,19 +31,19 @@ import {GroupVideoGrid} from 'Components/calling/GroupVideoGrid'; import {useCallAlertState} from 'Components/calling/useCallAlertState'; import {ConversationClassifiedBar} from 'Components/ClassifiedBar/ClassifiedBar'; import * as Icon from 'Components/Icon'; +import {usePushToTalk} from 'Hooks/usePushToTalk/usePushToTalk'; import type {Call} from 'Repositories/calling/Call'; import type {CallingRepository} from 'Repositories/calling/CallingRepository'; import {CallingViewMode, CallState, MuteState} from 'Repositories/calling/CallState'; import type {Participant} from 'Repositories/calling/Participant'; import {useVideoGrid} from 'Repositories/calling/videoGridHandler'; -import {usePushToTalk} from 'src/script/hooks/usePushToTalk/usePushToTalk'; +import {TeamState} from 'Repositories/team/TeamState'; import {useAppMainState, ViewType} from 'src/script/page/state'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {isEnterKey, isSpaceOrEnterKey} from 'Util/KeyboardUtil'; import {t} from 'Util/LocalizerUtil'; import {generateConversationUrl} from '../../../router/routeGenerator'; -import {TeamState} from '../../../team/TeamState'; import {CallActions, CallViewTab} from '../../../view_model/CallingViewModel'; interface VideoCallProps { diff --git a/src/script/components/calling/CallingCell/CallingControls/CallingControls.tsx b/src/script/components/calling/CallingCell/CallingControls/CallingControls.tsx index 1854be76cc8..649b2ddb261 100644 --- a/src/script/components/calling/CallingCell/CallingControls/CallingControls.tsx +++ b/src/script/components/calling/CallingCell/CallingControls/CallingControls.tsx @@ -29,10 +29,10 @@ import * as Icon from 'Components/Icon'; import {Call} from 'Repositories/calling/Call'; import {DesktopScreenShareMenu} from 'Repositories/calling/CallState'; import {Participant} from 'Repositories/calling/Participant'; +import {TeamState} from 'Repositories/team/TeamState'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; -import {TeamState} from '../../../../team/TeamState'; import {CallActions} from '../../../../view_model/CallingViewModel'; interface CallingControlsProps { diff --git a/src/script/components/calling/DetachedCallingCell/DetachedCallingCell.tsx b/src/script/components/calling/DetachedCallingCell/DetachedCallingCell.tsx index b5b10cf3769..04e3fcdfb64 100644 --- a/src/script/components/calling/DetachedCallingCell/DetachedCallingCell.tsx +++ b/src/script/components/calling/DetachedCallingCell/DetachedCallingCell.tsx @@ -23,7 +23,7 @@ import {Call} from 'Repositories/calling/Call'; import {CallingRepository} from 'Repositories/calling/CallingRepository'; import {CallState, CallingViewMode, DesktopScreenShareMenu} from 'Repositories/calling/CallState'; import {MediaRepository} from 'Repositories/media/MediaRepository'; -import {UserState} from 'src/script/user/UserState'; +import {UserState} from 'Repositories/user/UserState'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {DetachedWindow} from './components/DetachedWindow'; diff --git a/src/script/components/calling/FullscreenVideoCall.tsx b/src/script/components/calling/FullscreenVideoCall.tsx index 7af970c1a11..6a627702099 100644 --- a/src/script/components/calling/FullscreenVideoCall.tsx +++ b/src/script/components/calling/FullscreenVideoCall.tsx @@ -46,6 +46,7 @@ import {Participant} from 'Repositories/calling/Participant'; import type {Grid} from 'Repositories/calling/videoGridHandler'; import {ElectronDesktopCapturerSource, MediaDevicesHandler} from 'Repositories/media/MediaDevicesHandler'; import {MediaDeviceType} from 'Repositories/media/MediaDeviceType'; +import {TeamState} from 'Repositories/team/TeamState'; import {Config} from 'src/script/Config'; import {isCallViewOption} from 'src/script/guards/CallView'; import {isMediaDevice} from 'src/script/guards/MediaDevice'; @@ -73,7 +74,6 @@ import {GroupVideoGrid} from './GroupVideoGrid'; import {Pagination} from './Pagination'; import type {Conversation} from '../../entity/Conversation'; -import {TeamState} from '../../team/TeamState'; import {CallViewTab} from '../../view_model/CallingViewModel'; enum BlurredBackgroundStatus { diff --git a/src/script/components/panel/EnrichedFields.test.tsx b/src/script/components/panel/EnrichedFields.test.tsx index e973347084b..b91d9f1dc69 100644 --- a/src/script/components/panel/EnrichedFields.test.tsx +++ b/src/script/components/panel/EnrichedFields.test.tsx @@ -20,8 +20,8 @@ import {render, waitFor} from '@testing-library/react'; import type {RichInfo} from '@wireapp/api-client/lib/user/'; +import {RichProfileRepository} from 'Repositories/user/RichProfileRepository'; import {User} from 'src/script/entity/User'; -import {RichProfileRepository} from 'src/script/user/RichProfileRepository'; import {createUuid} from 'Util/uuid'; import {EnrichedFields} from './EnrichedFields'; diff --git a/src/script/components/panel/EnrichedFields.tsx b/src/script/components/panel/EnrichedFields.tsx index 5d1654cd6b2..ce8dfae1e45 100644 --- a/src/script/components/panel/EnrichedFields.tsx +++ b/src/script/components/panel/EnrichedFields.tsx @@ -22,12 +22,12 @@ import React, {useEffect, useState} from 'react'; import type {RichInfoField} from '@wireapp/api-client/lib/user/RichInfo'; import {container} from 'tsyringe'; +import {RichProfileRepository} from 'Repositories/user/RichProfileRepository'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; import {noop} from 'Util/util'; import type {User} from '../../entity/User'; -import {RichProfileRepository} from '../../user/RichProfileRepository'; export interface EnrichedFieldsProps { onFieldsLoaded?: (richFields: RichInfoField[]) => void; diff --git a/src/script/components/panel/UserActions.test.tsx b/src/script/components/panel/UserActions.test.tsx index facc2d5e584..de04698bdf9 100644 --- a/src/script/components/panel/UserActions.test.tsx +++ b/src/script/components/panel/UserActions.test.tsx @@ -28,12 +28,12 @@ import {PrimaryModalComponent} from 'Components/Modals/PrimaryModal/PrimaryModal import {ConnectionEntity} from 'Repositories/connection/ConnectionEntity'; import {ConversationRoleRepository} from 'Repositories/conversation/ConversationRoleRepository'; import {ConversationState} from 'Repositories/conversation/ConversationState'; +import {TeamEntity} from 'Repositories/team/TeamEntity'; +import {TeamState} from 'Repositories/team/TeamState'; +import {UserState} from 'Repositories/user/UserState'; import {withTheme} from 'src/script/auth/util/test/TestUtil'; import {Conversation} from 'src/script/entity/Conversation'; import {User} from 'src/script/entity/User'; -import {TeamEntity} from 'src/script/team/TeamEntity'; -import {TeamState} from 'src/script/team/TeamState'; -import {UserState} from 'src/script/user/UserState'; import {ActionsViewModel} from 'src/script/view_model/ActionsViewModel'; import {noop} from 'Util/util'; diff --git a/src/script/components/panel/UserActions.tsx b/src/script/components/panel/UserActions.tsx index 3f5839e7a0b..90fd63cf250 100644 --- a/src/script/components/panel/UserActions.tsx +++ b/src/script/components/panel/UserActions.tsx @@ -33,8 +33,8 @@ import {listCSS} from 'Components/panel/PanelActions/PanelActions.styles'; import {ACCESS_STATE} from 'Repositories/conversation/AccessState'; import type {ConversationRoleRepository} from 'Repositories/conversation/ConversationRoleRepository'; import {ConversationState} from 'Repositories/conversation/ConversationState'; +import {TeamState} from 'Repositories/team/TeamState'; import {SidebarTabs, useSidebarStore} from 'src/script/page/LeftSidebar/panels/Conversations/useSidebarStore'; -import {TeamState} from 'src/script/team/TeamState'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; import {matchQualifiedIds} from 'Util/QualifiedId'; diff --git a/src/script/entity/Conversation.ts b/src/script/entity/Conversation.ts index f4aec99d2cd..6ac0f1bd037 100644 --- a/src/script/entity/Conversation.ts +++ b/src/script/entity/Conversation.ts @@ -45,6 +45,7 @@ import {ConversationStatus} from 'Repositories/conversation/ConversationStatus'; import {ConversationVerificationState} from 'Repositories/conversation/ConversationVerificationState'; import {NOTIFICATION_STATE} from 'Repositories/conversation/NotificationSetting'; import {ConversationRecord} from 'Repositories/storage'; +import {TeamState} from 'Repositories/team/TeamState'; import {t} from 'Util/LocalizerUtil'; import {getLogger, Logger} from 'Util/Logger'; import {matchQualifiedIds} from 'Util/QualifiedId'; @@ -61,7 +62,6 @@ import {ConversationError} from '../error/ConversationError'; import {isContentMessage, isDeleteMessage} from '../guards/Message'; import {StatusType} from '../message/StatusType'; import {ContentState, useAppState} from '../page/useAppState'; -import {TeamState} from '../team/TeamState'; interface UnreadState { allEvents: Message[]; diff --git a/src/script/entity/User/User.ts b/src/script/entity/User/User.ts index bc0fc2e6ade..76df72073cd 100644 --- a/src/script/entity/User/User.ts +++ b/src/script/entity/User/User.ts @@ -29,13 +29,13 @@ import {WebAppEvents} from '@wireapp/webapp-events'; import type {AssetRemoteData} from 'Repositories/assets/AssetRemoteData'; import type {ClientEntity} from 'Repositories/client/ClientEntity'; import {ConnectionEntity} from 'Repositories/connection/ConnectionEntity'; +import {ROLE as TEAM_ROLE} from 'Repositories/user/UserPermission'; import {t} from 'Util/LocalizerUtil'; import {clamp} from 'Util/NumberUtil'; import {getFirstChar} from 'Util/StringUtil'; import {TIME_IN_MILLIS} from 'Util/TimeUtil'; import {ACCENT_ID} from '../../Config'; -import {ROLE as TEAM_ROLE} from '../../user/UserPermission'; export class User { private expirationIntervalId?: number; diff --git a/src/script/main/app.ts b/src/script/main/app.ts index 97e475ddf33..6ffd2bf10ec 100644 --- a/src/script/main/app.ts +++ b/src/script/main/app.ts @@ -71,7 +71,10 @@ import {SearchRepository} from 'Repositories/search/SearchRepository'; import {SelfRepository} from 'Repositories/self/SelfRepository'; import {SelfService} from 'Repositories/self/SelfService'; import {StorageKey, StorageRepository, StorageService} from 'Repositories/storage'; +import {TeamRepository} from 'Repositories/team/TeamRepository'; import {EventTrackingRepository} from 'Repositories/tracking/EventTrackingRepository'; +import {UserRepository} from 'Repositories/user/UserRepository'; +import {UserService} from 'Repositories/user/UserService'; import {initializeDataDog} from 'Util/DataDog'; import {DebugUtil} from 'Util/DebugUtil'; import {Environment} from 'Util/Environment'; @@ -101,14 +104,11 @@ import {configureDownloadPath} from '../page/components/FeatureConfigChange/Feat import {configureE2EI} from '../page/components/FeatureConfigChange/FeatureConfigChangeHandler/Features/E2EIdentity'; import {APIClient} from '../service/APIClientSingleton'; import {Core} from '../service/CoreSingleton'; -import {TeamRepository} from '../team/TeamRepository'; import {AppInitStatisticsValue} from '../telemetry/app_init/AppInitStatisticsValue'; import {AppInitTelemetry} from '../telemetry/app_init/AppInitTelemetry'; import {AppInitTimingsStep} from '../telemetry/app_init/AppInitTimingsStep'; import {serverTimeHandler} from '../time/serverTimeHandler'; import {WindowHandler} from '../ui/WindowHandler'; -import {UserRepository} from '../user/UserRepository'; -import {UserService} from '../user/UserService'; import {ViewModelRepositories} from '../view_model/MainViewModel'; import {Warnings} from '../view_model/WarningsContainer'; diff --git a/src/script/page/AppLock/AppLock.test.tsx b/src/script/page/AppLock/AppLock.test.tsx index ba203ad734f..bcad06a5469 100644 --- a/src/script/page/AppLock/AppLock.test.tsx +++ b/src/script/page/AppLock/AppLock.test.tsx @@ -25,15 +25,14 @@ import ko from 'knockout'; import {WebAppEvents} from '@wireapp/webapp-events'; import type {ClientRepository} from 'Repositories/client'; +import {TeamState} from 'Repositories/team/TeamState'; +import {AppLockRepository} from 'Repositories/user/AppLockRepository'; +import {AppLockState} from 'Repositories/user/AppLockState'; +import {UserState} from 'Repositories/user/UserState'; import {createUuid} from 'Util/uuid'; import {AppLock, APPLOCK_STATE} from './AppLock'; -import {TeamState} from '../../team/TeamState'; -import {AppLockRepository} from '../../user/AppLockRepository'; -import {AppLockState} from '../../user/AppLockState'; -import {UserState} from '../../user/UserState'; - // https://github.com/jedisct1/libsodium.js/issues/235 jest.mock('libsodium-wrappers', () => ({ crypto_pwhash_str: (value: string) => value, diff --git a/src/script/page/AppLock/AppLock.tsx b/src/script/page/AppLock/AppLock.tsx index b1024d4a52f..5c2b3a21504 100644 --- a/src/script/page/AppLock/AppLock.tsx +++ b/src/script/page/AppLock/AppLock.tsx @@ -31,10 +31,10 @@ import * as Icon from 'Components/Icon'; import {ModalComponent} from 'Components/Modals/ModalComponent'; import {ClientRepository} from 'Repositories/client'; import {ClientState} from 'Repositories/client/ClientState'; +import {AppLockRepository} from 'Repositories/user/AppLockRepository'; +import {AppLockState} from 'Repositories/user/AppLockState'; import {SIGN_OUT_REASON} from 'src/script/auth/SignOutReason'; import {Config} from 'src/script/Config'; -import {AppLockRepository} from 'src/script/user/AppLockRepository'; -import {AppLockState} from 'src/script/user/AppLockState'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; diff --git a/src/script/page/AppMain.tsx b/src/script/page/AppMain.tsx index 55b9069338d..dbbcf0abd8f 100644 --- a/src/script/page/AppMain.tsx +++ b/src/script/page/AppMain.tsx @@ -38,6 +38,9 @@ import {useActiveWindow} from 'Hooks/useActiveWindow'; import {useInitializeRootFontSize} from 'Hooks/useRootFontSize'; import {CallingViewMode, CallState, DesktopScreenShareMenu} from 'Repositories/calling/CallState'; import {ConversationState} from 'Repositories/conversation/ConversationState'; +import {TeamState} from 'Repositories/team/TeamState'; +import {showInitialModal} from 'Repositories/user/AvailabilityModal'; +import {UserState} from 'Repositories/user/UserState'; import {Config} from 'src/script/Config'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; @@ -57,9 +60,6 @@ import {App} from '../main/app'; import {initialiseMLSMigrationFlow} from '../mls/MLSMigration'; import {generateConversationUrl} from '../router/routeGenerator'; import {configureRoutes, navigate} from '../router/Router'; -import {TeamState} from '../team/TeamState'; -import {showInitialModal} from '../user/AvailabilityModal'; -import {UserState} from '../user/UserState'; import {MainViewModel} from '../view_model/MainViewModel'; import {WarningsContainer} from '../view_model/WarningsContainer/WarningsContainer'; diff --git a/src/script/page/LeftSidebar/panels/Conversations/ConversationHeader/ConversationHeader.tsx b/src/script/page/LeftSidebar/panels/Conversations/ConversationHeader/ConversationHeader.tsx index 97dab1a5c23..5878da5bba3 100644 --- a/src/script/page/LeftSidebar/panels/Conversations/ConversationHeader/ConversationHeader.tsx +++ b/src/script/page/LeftSidebar/panels/Conversations/ConversationHeader/ConversationHeader.tsx @@ -26,6 +26,7 @@ import {WebAppEvents} from '@wireapp/webapp-events'; import * as Icon from 'Components/Icon'; import {ConversationLabel} from 'Repositories/conversation/ConversationLabelRepository'; +import {generatePermissionHelpers} from 'Repositories/user/UserPermission'; import {SidebarTabs} from 'src/script/page/LeftSidebar/panels/Conversations/useSidebarStore'; import {handleEnterDown, handleEscDown} from 'Util/KeyboardUtil'; import {t} from 'Util/LocalizerUtil'; @@ -41,7 +42,6 @@ import { } from './ConversationHeader.styles'; import {User} from '../../../../../entity/User'; -import {generatePermissionHelpers} from '../../../../../user/UserPermission'; interface ConversationHeaderProps { currentTab: SidebarTabs; diff --git a/src/script/page/LeftSidebar/panels/Conversations/ConversationTabs/ConversationTabs.tsx b/src/script/page/LeftSidebar/panels/Conversations/ConversationTabs/ConversationTabs.tsx index 3cbd6b1ee25..295d07889f5 100644 --- a/src/script/page/LeftSidebar/panels/Conversations/ConversationTabs/ConversationTabs.tsx +++ b/src/script/page/LeftSidebar/panels/Conversations/ConversationTabs/ConversationTabs.tsx @@ -23,10 +23,10 @@ import {GroupIcon, MessageIcon, StarIcon, ExternalLinkIcon, Tooltip, SupportIcon import * as Icon from 'Components/Icon'; import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; +import {TeamState} from 'Repositories/team/TeamState'; import {User} from 'src/script/entity/User'; import {ConversationFolderTab} from 'src/script/page/LeftSidebar/panels/Conversations/ConversationTab/ConversationFolderTab'; import {SidebarTabs} from 'src/script/page/LeftSidebar/panels/Conversations/useSidebarStore'; -import {TeamState} from 'src/script/team/TeamState'; import {isDataDogEnabled} from 'Util/DataDog'; import {getWebEnvironment} from 'Util/Environment'; import {replaceLink, t} from 'Util/LocalizerUtil'; diff --git a/src/script/page/LeftSidebar/panels/Conversations/Conversations.test.tsx b/src/script/page/LeftSidebar/panels/Conversations/Conversations.test.tsx index 32b8e5caa43..fa59d7f9445 100644 --- a/src/script/page/LeftSidebar/panels/Conversations/Conversations.test.tsx +++ b/src/script/page/LeftSidebar/panels/Conversations/Conversations.test.tsx @@ -24,10 +24,10 @@ import {observable} from 'knockout'; import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; import {SearchRepository} from 'Repositories/search/SearchRepository'; +import {UserRepository} from 'Repositories/user/UserRepository'; import {withTheme} from 'src/script/auth/util/test/TestUtil'; import {User} from 'src/script/entity/User'; import {ListState} from 'src/script/page/useAppState'; -import {UserRepository} from 'src/script/user/UserRepository'; import {TestFactory} from 'test/helper/TestFactory'; import {Conversations} from './'; diff --git a/src/script/page/LeftSidebar/panels/Conversations/Conversations.tsx b/src/script/page/LeftSidebar/panels/Conversations/Conversations.tsx index 98e9d71594a..8397e5d545a 100644 --- a/src/script/page/LeftSidebar/panels/Conversations/Conversations.tsx +++ b/src/script/page/LeftSidebar/panels/Conversations/Conversations.tsx @@ -34,14 +34,16 @@ import {IntegrationRepository} from 'Repositories/integration/IntegrationReposit import {PreferenceNotificationRepository} from 'Repositories/notification/PreferenceNotificationRepository'; import {PropertiesRepository} from 'Repositories/properties/PropertiesRepository'; import {SearchRepository} from 'Repositories/search/SearchRepository'; +import {TeamRepository} from 'Repositories/team/TeamRepository'; +import {TeamState} from 'Repositories/team/TeamState'; import {EventName} from 'Repositories/tracking/EventName'; +import {UserRepository} from 'Repositories/user/UserRepository'; +import {UserState} from 'Repositories/user/UserState'; import {Preferences} from 'src/script/page/LeftSidebar/panels/Preferences'; import {StartUI} from 'src/script/page/LeftSidebar/panels/StartUI'; import {ANIMATED_PAGE_TRANSITION_DURATION} from 'src/script/page/MainContent'; import {useAppMainState, ViewType} from 'src/script/page/state'; import {ContentState, ListState} from 'src/script/page/useAppState'; -import {TeamRepository} from 'src/script/team/TeamRepository'; -import {UserRepository} from 'src/script/user/UserRepository'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {ConversationCallingView} from './ConversationCallingView/ConversationCallingView'; @@ -59,8 +61,6 @@ import type {Conversation} from '../../../../entity/Conversation'; import {User} from '../../../../entity/User'; import {generateConversationUrl} from '../../../../router/routeGenerator'; import {createNavigateKeyboard} from '../../../../router/routerBindings'; -import {TeamState} from '../../../../team/TeamState'; -import {UserState} from '../../../../user/UserState'; import {ListViewModel} from '../../../../view_model/ListViewModel'; import {ListWrapper} from '../ListWrapper'; diff --git a/src/script/page/LeftSidebar/panels/Preferences.tsx b/src/script/page/LeftSidebar/panels/Preferences.tsx index 6d3fbdb7212..958ff09d0f7 100644 --- a/src/script/page/LeftSidebar/panels/Preferences.tsx +++ b/src/script/page/LeftSidebar/panels/Preferences.tsx @@ -32,11 +32,11 @@ import { Notification, PreferenceNotificationRepository, } from 'Repositories/notification/PreferenceNotificationRepository'; +import {TeamRepository} from 'Repositories/team/TeamRepository'; import {t} from 'Util/LocalizerUtil'; import {ListWrapper} from './ListWrapper'; -import {TeamRepository} from '../../../team/TeamRepository'; import {ContentState, useAppState} from '../../useAppState'; type PreferencesProps = { diff --git a/src/script/page/LeftSidebar/panels/StartUI/PeopleTab.tsx b/src/script/page/LeftSidebar/panels/StartUI/PeopleTab.tsx index 8d07be83592..003eef7818a 100644 --- a/src/script/page/LeftSidebar/panels/StartUI/PeopleTab.tsx +++ b/src/script/page/LeftSidebar/panels/StartUI/PeopleTab.tsx @@ -29,7 +29,10 @@ import {useDebounce} from 'Hooks/useDebounce'; import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; import {ConversationState} from 'Repositories/conversation/ConversationState'; import {SearchRepository} from 'Repositories/search/SearchRepository'; -import {UserRepository} from 'src/script/user/UserRepository'; +import {TeamRepository} from 'Repositories/team/TeamRepository'; +import {TeamState} from 'Repositories/team/TeamState'; +import {UserRepository} from 'Repositories/user/UserRepository'; +import {UserState} from 'Repositories/user/UserState'; import {t} from 'Util/LocalizerUtil'; import {getLogger} from 'Util/Logger'; import {safeWindowOpen} from 'Util/SanitizationUtil'; @@ -40,9 +43,6 @@ import {TopPeople} from './components/TopPeople'; import {User} from '../../../../entity/User'; import {getManageTeamUrl} from '../../../../externalRoute'; -import {TeamRepository} from '../../../../team/TeamRepository'; -import {TeamState} from '../../../../team/TeamState'; -import {UserState} from '../../../../user/UserState'; export type SearchResultsData = {contacts: User[]; others: User[]}; diff --git a/src/script/page/LeftSidebar/panels/StartUI/StartUI.tsx b/src/script/page/LeftSidebar/panels/StartUI/StartUI.tsx index b2cb41e7bbc..6df7c8d2269 100644 --- a/src/script/page/LeftSidebar/panels/StartUI/StartUI.tsx +++ b/src/script/page/LeftSidebar/panels/StartUI/StartUI.tsx @@ -31,9 +31,13 @@ import {ConversationState} from 'Repositories/conversation/ConversationState'; import {IntegrationRepository} from 'Repositories/integration/IntegrationRepository'; import {ServiceEntity} from 'Repositories/integration/ServiceEntity'; import {SearchRepository} from 'Repositories/search/SearchRepository'; +import {TeamRepository} from 'Repositories/team/TeamRepository'; +import {TeamState} from 'Repositories/team/TeamState'; +import {generatePermissionHelpers} from 'Repositories/user/UserPermission'; +import {UserRepository} from 'Repositories/user/UserRepository'; +import {UserState} from 'Repositories/user/UserState'; import {User} from 'src/script/entity/User'; import {SidebarTabs, useSidebarStore} from 'src/script/page/LeftSidebar/panels/Conversations/useSidebarStore'; -import {UserRepository} from 'src/script/user/UserRepository'; import {MainViewModel} from 'src/script/view_model/MainViewModel'; import {t} from 'Util/LocalizerUtil'; @@ -41,10 +45,6 @@ import {PeopleTab, SearchResultsData} from './PeopleTab'; import {ServicesTab} from './ServicesTab'; import {Config} from '../../../../Config'; -import {TeamRepository} from '../../../../team/TeamRepository'; -import {TeamState} from '../../../../team/TeamState'; -import {generatePermissionHelpers} from '../../../../user/UserPermission'; -import {UserState} from '../../../../user/UserState'; import {ListWrapper} from '../ListWrapper'; type StartUIProps = { diff --git a/src/script/page/MainContent/MainContent.tsx b/src/script/page/MainContent/MainContent.tsx index 6ecc5851f9b..54d4eb9cd81 100644 --- a/src/script/page/MainContent/MainContent.tsx +++ b/src/script/page/MainContent/MainContent.tsx @@ -31,6 +31,8 @@ import * as Icon from 'Components/Icon'; import {useLegalHoldModalState} from 'Components/Modals/LegalHoldModal/LegalHoldModal.state'; import {ClientState} from 'Repositories/client/ClientState'; import {ConversationState} from 'Repositories/conversation/ConversationState'; +import {TeamState} from 'Repositories/team/TeamState'; +import {UserState} from 'Repositories/user/UserState'; import {User} from 'src/script/entity/User'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; @@ -43,8 +45,6 @@ import {AVPreferences} from './panels/preferences/AVPreferences'; import {DevicesPreferences} from './panels/preferences/DevicesPreferences'; import {OptionPreferences} from './panels/preferences/OptionPreferences'; -import {TeamState} from '../../team/TeamState'; -import {UserState} from '../../user/UserState'; import {RightSidebarParams} from '../AppMain'; import {PanelState} from '../RightSidebar'; import {RootContext} from '../RootProvider'; diff --git a/src/script/page/MainContent/panels/preferences/AboutPreferences.tsx b/src/script/page/MainContent/panels/preferences/AboutPreferences.tsx index e86ff994bad..63812970eab 100644 --- a/src/script/page/MainContent/panels/preferences/AboutPreferences.tsx +++ b/src/script/page/MainContent/panels/preferences/AboutPreferences.tsx @@ -23,7 +23,7 @@ import {container} from 'tsyringe'; import {Link, LinkVariant} from '@wireapp/react-ui-kit'; -import {TeamState} from 'src/script/team/TeamState'; +import {TeamState} from 'Repositories/team/TeamState'; import {t} from 'Util/LocalizerUtil'; import {PreferencesPage} from './components/PreferencesPage'; diff --git a/src/script/page/MainContent/panels/preferences/AccountPreferences.tsx b/src/script/page/MainContent/panels/preferences/AccountPreferences.tsx index 496b0d4a67f..224ae4f4414 100644 --- a/src/script/page/MainContent/panels/preferences/AccountPreferences.tsx +++ b/src/script/page/MainContent/panels/preferences/AccountPreferences.tsx @@ -30,6 +30,9 @@ import {ClientRepository} from 'Repositories/client'; import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; import {ConversationState} from 'Repositories/conversation/ConversationState'; import {PropertiesRepository} from 'Repositories/properties/PropertiesRepository'; +import {TeamState} from 'Repositories/team/TeamState'; +import {RichProfileRepository} from 'Repositories/user/RichProfileRepository'; +import type {UserRepository} from 'Repositories/user/UserRepository'; import {ContentState} from 'src/script/page/useAppState'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; @@ -52,9 +55,6 @@ import {PreferencesSection} from './components/PreferencesSection'; import {Config} from '../../../../Config'; import {User} from '../../../../entity/User'; -import {TeamState} from '../../../../team/TeamState'; -import {RichProfileRepository} from '../../../../user/RichProfileRepository'; -import type {UserRepository} from '../../../../user/UserRepository'; import {AccentColorPicker} from '../../../AccentColorPicker'; interface AccountPreferencesProps { diff --git a/src/script/page/MainContent/panels/preferences/DevicesPreferences/components/E2EICertificateDetails/E2EICertificateDetails.test.tsx b/src/script/page/MainContent/panels/preferences/DevicesPreferences/components/E2EICertificateDetails/E2EICertificateDetails.test.tsx index 83940a4716a..6319e052541 100644 --- a/src/script/page/MainContent/panels/preferences/DevicesPreferences/components/E2EICertificateDetails/E2EICertificateDetails.test.tsx +++ b/src/script/page/MainContent/panels/preferences/DevicesPreferences/components/E2EICertificateDetails/E2EICertificateDetails.test.tsx @@ -22,11 +22,11 @@ import {CONVERSATION_TYPE, MLSConversation} from '@wireapp/api-client/lib/conver import {CredentialType} from '@wireapp/core/lib/messagingProtocols/mls'; import {container} from 'tsyringe'; +import {UserState} from 'Repositories/user/UserState'; import {withTheme} from 'src/script/auth/util/test/TestUtil'; import {E2EIHandler, MLSStatuses, WireIdentity} from 'src/script/E2EIdentity'; import {User} from 'src/script/entity/User'; import {Core} from 'src/script/service/CoreSingleton'; -import {UserState} from 'src/script/user/UserState'; import {generateAPIConversation} from 'test/helper/ConversationGenerator'; import {E2EICertificateDetails} from './E2EICertificateDetails'; diff --git a/src/script/page/MainContent/panels/preferences/accountPreferences/AccountSecuritySection.tsx b/src/script/page/MainContent/panels/preferences/accountPreferences/AccountSecuritySection.tsx index abcb64139ad..4ed00d12f9f 100644 --- a/src/script/page/MainContent/panels/preferences/accountPreferences/AccountSecuritySection.tsx +++ b/src/script/page/MainContent/panels/preferences/accountPreferences/AccountSecuritySection.tsx @@ -28,15 +28,15 @@ import {Link, LinkVariant} from '@wireapp/react-ui-kit'; import {WebAppEvents} from '@wireapp/webapp-events'; import {PrimaryModal} from 'Components/Modals/PrimaryModal'; +import {TeamState} from 'Repositories/team/TeamState'; +import {AppLockState} from 'Repositories/user/AppLockState'; +import {FEATURES, hasAccessToFeature} from 'Repositories/user/UserPermission'; +import {UserRepository} from 'Repositories/user/UserRepository'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; import {User} from '../../../../../entity/User'; import {externalUrl, getManageTeamUrl} from '../../../../../externalRoute'; -import {TeamState} from '../../../../../team/TeamState'; -import {AppLockState} from '../../../../../user/AppLockState'; -import {FEATURES, hasAccessToFeature} from '../../../../../user/UserPermission'; -import {UserRepository} from '../../../../../user/UserRepository'; import {PreferencesSection} from '../components/PreferencesSection'; interface AccountSecuritySectionProps { diff --git a/src/script/page/MainContent/panels/preferences/accountPreferences/AvatarInput.tsx b/src/script/page/MainContent/panels/preferences/accountPreferences/AvatarInput.tsx index b3f9d9c0903..c88b605136d 100644 --- a/src/script/page/MainContent/panels/preferences/accountPreferences/AvatarInput.tsx +++ b/src/script/page/MainContent/panels/preferences/accountPreferences/AvatarInput.tsx @@ -24,6 +24,7 @@ import cx from 'classnames'; import {Avatar, AVATAR_SIZE} from 'Components/Avatar'; import {PrimaryModal} from 'Components/Modals/PrimaryModal'; +import {UserRepository} from 'Repositories/user/UserRepository'; import {handleKeyDown} from 'Util/KeyboardUtil'; import {t} from 'Util/LocalizerUtil'; import {getLogger} from 'Util/Logger'; @@ -34,7 +35,6 @@ import {FileInput} from './FileInput'; import {Config} from '../../../../../Config'; import {User} from '../../../../../entity/User'; import {UserError} from '../../../../../error/UserError'; -import {UserRepository} from '../../../../../user/UserRepository'; interface AvatarInputProps { isActivatedAccount: boolean; diff --git a/src/script/page/MainContent/panels/preferences/accountPreferences/DataUsageSection.tsx b/src/script/page/MainContent/panels/preferences/accountPreferences/DataUsageSection.tsx index 2e1d7b67e92..decbffad7de 100644 --- a/src/script/page/MainContent/panels/preferences/accountPreferences/DataUsageSection.tsx +++ b/src/script/page/MainContent/panels/preferences/accountPreferences/DataUsageSection.tsx @@ -27,11 +27,11 @@ import {WebAppEvents} from '@wireapp/webapp-events'; import {PropertiesRepository} from 'Repositories/properties/PropertiesRepository'; import {PROPERTIES_TYPE} from 'Repositories/properties/PropertiesType'; +import {TeamState} from 'Repositories/team/TeamState'; import {getForcedErrorReportingStatus} from 'Repositories/tracking/Countly.helpers'; +import {ConsentValue} from 'Repositories/user/ConsentValue'; import {t} from 'Util/LocalizerUtil'; -import {TeamState} from '../../../../../team/TeamState'; -import {ConsentValue} from '../../../../../user/ConsentValue'; import {PreferencesSection} from '../components/PreferencesSection'; interface DataUsageSectionProps { diff --git a/src/script/page/MainContent/panels/preferences/accountPreferences/EmailInput.tsx b/src/script/page/MainContent/panels/preferences/accountPreferences/EmailInput.tsx index 97860a5b520..f079d9e8531 100644 --- a/src/script/page/MainContent/panels/preferences/accountPreferences/EmailInput.tsx +++ b/src/script/page/MainContent/panels/preferences/accountPreferences/EmailInput.tsx @@ -22,13 +22,12 @@ import React from 'react'; import {StatusCodes as HTTP_STATUS} from 'http-status-codes'; import {PrimaryModal} from 'Components/Modals/PrimaryModal'; +import {UserRepository} from 'Repositories/user/UserRepository'; import {t} from 'Util/LocalizerUtil'; import {getLogger} from 'Util/Logger'; import {AccountInput, useInputDone} from './AccountInput'; -import {UserRepository} from '../../../../../user/UserRepository'; - interface EmailInputProps { canEditProfile: boolean; email: string; diff --git a/src/script/page/MainContent/panels/preferences/accountPreferences/NameInput.tsx b/src/script/page/MainContent/panels/preferences/accountPreferences/NameInput.tsx index eee2f9aee80..778776ccbe9 100644 --- a/src/script/page/MainContent/panels/preferences/accountPreferences/NameInput.tsx +++ b/src/script/page/MainContent/panels/preferences/accountPreferences/NameInput.tsx @@ -19,13 +19,12 @@ import React from 'react'; +import {UserRepository} from 'Repositories/user/UserRepository'; import {t} from 'Util/LocalizerUtil'; import {getLogger} from 'Util/Logger'; import {AccountInput, useInputDone} from './AccountInput'; -import {UserRepository} from '../../../../../user/UserRepository'; - interface NameInputProps { canEditProfile: boolean; name: string; diff --git a/src/script/page/MainContent/panels/preferences/accountPreferences/PrivacySection.tsx b/src/script/page/MainContent/panels/preferences/accountPreferences/PrivacySection.tsx index e93c04f9dd0..3cdd14db009 100644 --- a/src/script/page/MainContent/panels/preferences/accountPreferences/PrivacySection.tsx +++ b/src/script/page/MainContent/panels/preferences/accountPreferences/PrivacySection.tsx @@ -25,13 +25,13 @@ import {container} from 'tsyringe'; import {Checkbox, CheckboxLabel} from '@wireapp/react-ui-kit'; import {PropertiesRepository} from 'Repositories/properties/PropertiesRepository'; +import {AppLockRepository} from 'Repositories/user/AppLockRepository'; +import {AppLockState} from 'Repositories/user/AppLockState'; +import {CONVERSATION_TYPING_INDICATOR_MODE} from 'Repositories/user/TypingIndicatorMode'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; import {formatDurationCaption} from 'Util/TimeUtil'; -import {AppLockRepository} from '../../../../../user/AppLockRepository'; -import {AppLockState} from '../../../../../user/AppLockState'; -import {CONVERSATION_TYPING_INDICATOR_MODE} from '../../../../../user/TypingIndicatorMode'; import {PreferencesSection} from '../components/PreferencesSection'; interface PrivacySectionProps { diff --git a/src/script/page/MainContent/panels/preferences/accountPreferences/UsernameInput.tsx b/src/script/page/MainContent/panels/preferences/accountPreferences/UsernameInput.tsx index 49bcf6b864a..afb471c34a1 100644 --- a/src/script/page/MainContent/panels/preferences/accountPreferences/UsernameInput.tsx +++ b/src/script/page/MainContent/panels/preferences/accountPreferences/UsernameInput.tsx @@ -21,13 +21,13 @@ import React, {FormEvent, useState} from 'react'; import cx from 'classnames'; +import {validateHandle} from 'Repositories/user/UserHandleGenerator'; +import {UserRepository} from 'Repositories/user/UserRepository'; import {t} from 'Util/LocalizerUtil'; import {AccountInput, useInputDone} from './AccountInput'; import {UserError} from '../../../../../error/UserError'; -import {validateHandle} from '../../../../../user/UserHandleGenerator'; -import {UserRepository} from '../../../../../user/UserRepository'; enum UserNameState { AVAILABLE = 'AVAILABLE', diff --git a/src/script/page/MainContent/panels/preferences/avPreferences/SaveCallLogs.tsx b/src/script/page/MainContent/panels/preferences/avPreferences/SaveCallLogs.tsx index ee7c6b415fd..1db49999c0e 100644 --- a/src/script/page/MainContent/panels/preferences/avPreferences/SaveCallLogs.tsx +++ b/src/script/page/MainContent/panels/preferences/avPreferences/SaveCallLogs.tsx @@ -25,12 +25,12 @@ import {Button, ButtonVariant} from '@wireapp/react-ui-kit'; import {PrimaryModal} from 'Components/Modals/PrimaryModal'; import type {CallingRepository} from 'Repositories/calling/CallingRepository'; +import {UserState} from 'Repositories/user/UserState'; import {t} from 'Util/LocalizerUtil'; import {getCurrentDate} from 'Util/TimeUtil'; import {downloadBlob} from 'Util/util'; import {Config} from '../../../../../Config'; -import {UserState} from '../../../../../user/UserState'; import {PreferencesSection} from '../components/PreferencesSection'; interface SaveCallLogsProps { diff --git a/src/script/page/RightSidebar/AddParticipants/AddParticipants.tsx b/src/script/page/RightSidebar/AddParticipants/AddParticipants.tsx index ade77a7518f..d3914bf3fca 100644 --- a/src/script/page/RightSidebar/AddParticipants/AddParticipants.tsx +++ b/src/script/page/RightSidebar/AddParticipants/AddParticipants.tsx @@ -34,6 +34,10 @@ import {ConversationRepository} from 'Repositories/conversation/ConversationRepo import {IntegrationRepository} from 'Repositories/integration/IntegrationRepository'; import {ServiceEntity} from 'Repositories/integration/ServiceEntity'; import {SearchRepository} from 'Repositories/search/SearchRepository'; +import {TeamRepository} from 'Repositories/team/TeamRepository'; +import {TeamState} from 'Repositories/team/TeamState'; +import {generatePermissionHelpers} from 'Repositories/user/UserPermission'; +import {UserState} from 'Repositories/user/UserState'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {handleKeyDown} from 'Util/KeyboardUtil'; import {t} from 'Util/LocalizerUtil'; @@ -43,10 +47,6 @@ import {sortUsersByPriority} from 'Util/StringUtil'; import {Conversation} from '../../../entity/Conversation'; import {User} from '../../../entity/User'; import {getManageServicesUrl} from '../../../externalRoute'; -import {TeamRepository} from '../../../team/TeamRepository'; -import {TeamState} from '../../../team/TeamState'; -import {generatePermissionHelpers} from '../../../user/UserPermission'; -import {UserState} from '../../../user/UserState'; import {PanelHeader} from '../PanelHeader'; import {PanelEntity, PanelState} from '../RightSidebar'; diff --git a/src/script/page/RightSidebar/ConversationDetails/ConversationDetails.test.tsx b/src/script/page/RightSidebar/ConversationDetails/ConversationDetails.test.tsx index f18298754e2..fcdde0d2b7f 100644 --- a/src/script/page/RightSidebar/ConversationDetails/ConversationDetails.test.tsx +++ b/src/script/page/RightSidebar/ConversationDetails/ConversationDetails.test.tsx @@ -27,6 +27,10 @@ import {MessageRepository} from 'Repositories/conversation/MessageRepository'; import {IntegrationRepository} from 'Repositories/integration/IntegrationRepository'; import {SearchRepository} from 'Repositories/search/SearchRepository'; import {SelfRepository} from 'Repositories/self/SelfRepository'; +import {TeamEntity} from 'Repositories/team/TeamEntity'; +import {TeamRepository} from 'Repositories/team/TeamRepository'; +import {TeamState} from 'Repositories/team/TeamState'; +import {UserState} from 'Repositories/user/UserState'; import {Conversation} from 'src/script/entity/Conversation'; import {createUuid} from 'Util/uuid'; @@ -34,10 +38,6 @@ import {ConversationDetails} from './ConversationDetails'; import {TestFactory} from '../../../../../test/helper/TestFactory'; import {User} from '../../../entity/User'; -import {TeamEntity} from '../../../team/TeamEntity'; -import {TeamRepository} from '../../../team/TeamRepository'; -import {TeamState} from '../../../team/TeamState'; -import {UserState} from '../../../user/UserState'; import {ActionsViewModel} from '../../../view_model/ActionsViewModel'; import {MainViewModel} from '../../../view_model/MainViewModel'; diff --git a/src/script/page/RightSidebar/ConversationDetails/ConversationDetails.tsx b/src/script/page/RightSidebar/ConversationDetails/ConversationDetails.tsx index e860ad5d9dc..75dfb9cba82 100644 --- a/src/script/page/RightSidebar/ConversationDetails/ConversationDetails.tsx +++ b/src/script/page/RightSidebar/ConversationDetails/ConversationDetails.tsx @@ -33,6 +33,8 @@ import {ConversationVerificationState} from 'Repositories/conversation/Conversat import {getNotificationText} from 'Repositories/conversation/NotificationSetting'; import {IntegrationRepository} from 'Repositories/integration/IntegrationRepository'; import {ServiceEntity} from 'Repositories/integration/ServiceEntity'; +import {TeamRepository} from 'Repositories/team/TeamRepository'; +import {TeamState} from 'Repositories/team/TeamState'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; import {sortUsersByPriority} from 'Util/StringUtil'; @@ -45,8 +47,6 @@ import {ConversationDetailsParticipants} from './components/ConversationDetailsP import {Conversation} from '../../../entity/Conversation'; import {User} from '../../../entity/User'; import {isServiceEntity} from '../../../guards/Service'; -import {TeamRepository} from '../../../team/TeamRepository'; -import {TeamState} from '../../../team/TeamState'; import {Shortcut} from '../../../ui/Shortcut'; import {ShortcutType} from '../../../ui/ShortcutType'; import {ActionsViewModel} from '../../../view_model/ActionsViewModel'; diff --git a/src/script/page/RightSidebar/ConversationDetails/components/ConversationDetailsOptions/ConversationDetailsOptions.tsx b/src/script/page/RightSidebar/ConversationDetails/components/ConversationDetailsOptions/ConversationDetailsOptions.tsx index 479fa6cf251..b92eaba1e95 100644 --- a/src/script/page/RightSidebar/ConversationDetails/components/ConversationDetailsOptions/ConversationDetailsOptions.tsx +++ b/src/script/page/RightSidebar/ConversationDetails/components/ConversationDetailsOptions/ConversationDetailsOptions.tsx @@ -29,6 +29,7 @@ import {ReceiptModeToggle} from 'Components/toggle/ReceiptModeToggle'; import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; import {ConversationRoleRepository} from 'Repositories/conversation/ConversationRoleRepository'; import {isMLSConversation} from 'Repositories/conversation/ConversationSelectors'; +import {TeamState} from 'Repositories/team/TeamState'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; import {replaceReactComponents} from 'Util/LocalizerUtil/ReactLocalizerUtil'; @@ -37,7 +38,6 @@ import {ConversationDetailsOption} from './ConversationDetailsOption'; import {Conversation} from '../../../../../entity/Conversation'; import {User} from '../../../../../entity/User'; -import {TeamState} from '../../../../../team/TeamState'; import {ActionsViewModel} from '../../../../../view_model/ActionsViewModel'; import {PanelEntity, PanelState} from '../../../RightSidebar'; import {getConversationActions} from '../../utils/getConversationActions'; diff --git a/src/script/page/RightSidebar/ConversationDetails/utils/getConversationActions.ts b/src/script/page/RightSidebar/ConversationDetails/utils/getConversationActions.ts index b7b1334662d..20d8b96c7fb 100644 --- a/src/script/page/RightSidebar/ConversationDetails/utils/getConversationActions.ts +++ b/src/script/page/RightSidebar/ConversationDetails/utils/getConversationActions.ts @@ -24,10 +24,10 @@ import {WebAppEvents} from '@wireapp/webapp-events'; import * as Icon from 'Components/Icon'; import {MenuItem} from 'Components/panel/PanelActions'; import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; +import * as UserPermission from 'Repositories/user/UserPermission'; import {t} from 'Util/LocalizerUtil'; import {Conversation} from '../../../../entity/Conversation'; -import * as UserPermission from '../../../../user/UserPermission'; import {ActionsViewModel} from '../../../../view_model/ActionsViewModel'; interface GetConversationActionsParams { diff --git a/src/script/page/RightSidebar/ConversationParticipants/ConversationParticipants.tsx b/src/script/page/RightSidebar/ConversationParticipants/ConversationParticipants.tsx index 28097bf9b1d..13218c6cfa8 100644 --- a/src/script/page/RightSidebar/ConversationParticipants/ConversationParticipants.tsx +++ b/src/script/page/RightSidebar/ConversationParticipants/ConversationParticipants.tsx @@ -24,6 +24,7 @@ import {SearchInput} from 'Components/SearchInput'; import {UserSearchableList} from 'Components/UserSearchableList'; import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; import {SearchRepository} from 'Repositories/search/SearchRepository'; +import {TeamRepository} from 'Repositories/team/TeamRepository'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; import {sortUsersByPriority} from 'Util/StringUtil'; @@ -31,7 +32,6 @@ import {sortUsersByPriority} from 'Util/StringUtil'; import {Conversation} from '../../../entity/Conversation'; import {User} from '../../../entity/User'; import {isServiceEntity} from '../../../guards/Service'; -import {TeamRepository} from '../../../team/TeamRepository'; import {PanelHeader} from '../PanelHeader'; import {PanelEntity, PanelState} from '../RightSidebar'; diff --git a/src/script/page/RightSidebar/GroupParticipantService/GroupParticipantService.tsx b/src/script/page/RightSidebar/GroupParticipantService/GroupParticipantService.tsx index 36ca777f1d3..cf43d9fe37d 100644 --- a/src/script/page/RightSidebar/GroupParticipantService/GroupParticipantService.tsx +++ b/src/script/page/RightSidebar/GroupParticipantService/GroupParticipantService.tsx @@ -26,13 +26,13 @@ import * as Icon from 'Components/Icon'; import {ServiceDetails} from 'Components/panel/ServiceDetails'; import {IntegrationRepository} from 'Repositories/integration/IntegrationRepository'; import {ServiceEntity} from 'Repositories/integration/ServiceEntity'; +import {generatePermissionHelpers} from 'Repositories/user/UserPermission'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {handleKeyDown} from 'Util/KeyboardUtil'; import {t} from 'Util/LocalizerUtil'; import {Conversation} from '../../../entity/Conversation'; import {User} from '../../../entity/User'; -import {generatePermissionHelpers} from '../../../user/UserPermission'; import {ActionsViewModel} from '../../../view_model/ActionsViewModel'; import {PanelHeader} from '../PanelHeader'; diff --git a/src/script/page/RightSidebar/GroupParticipantUser/GroupParticipantUser.tsx b/src/script/page/RightSidebar/GroupParticipantUser/GroupParticipantUser.tsx index 48a526c2faf..665d3e914e1 100644 --- a/src/script/page/RightSidebar/GroupParticipantUser/GroupParticipantUser.tsx +++ b/src/script/page/RightSidebar/GroupParticipantUser/GroupParticipantUser.tsx @@ -34,14 +34,14 @@ import {BaseToggle} from 'Components/toggle/BaseToggle'; import {ConversationRoleRepository} from 'Repositories/conversation/ConversationRoleRepository'; import {MemberLeaveEvent, TeamMemberLeaveEvent} from 'Repositories/conversation/EventBuilder'; import {ClientEvent} from 'Repositories/event/Client'; +import {TeamRepository} from 'Repositories/team/TeamRepository'; +import {TeamState} from 'Repositories/team/TeamState'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {handleKeyDown} from 'Util/KeyboardUtil'; import {t} from 'Util/LocalizerUtil'; import {Conversation} from '../../../entity/Conversation'; import {User} from '../../../entity/User'; -import {TeamRepository} from '../../../team/TeamRepository'; -import {TeamState} from '../../../team/TeamState'; import {ActionsViewModel} from '../../../view_model/ActionsViewModel'; import {PanelHeader} from '../PanelHeader'; import {PanelEntity} from '../RightSidebar'; diff --git a/src/script/page/RightSidebar/GuestServicesOptions/GuestServicesOptions.test.tsx b/src/script/page/RightSidebar/GuestServicesOptions/GuestServicesOptions.test.tsx index fc2fe2d185a..c3141502855 100644 --- a/src/script/page/RightSidebar/GuestServicesOptions/GuestServicesOptions.test.tsx +++ b/src/script/page/RightSidebar/GuestServicesOptions/GuestServicesOptions.test.tsx @@ -22,13 +22,13 @@ import ko from 'knockout'; import {ACCESS_STATE} from 'Repositories/conversation/AccessState'; import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; +import {TeamRepository} from 'Repositories/team/TeamRepository'; +import {TeamState} from 'Repositories/team/TeamState'; import {Conversation} from 'src/script/entity/Conversation'; import {GuestServicesOptions} from './GuestServicesOptions'; import {TestFactory} from '../../../../../test/helper/TestFactory'; -import {TeamRepository} from '../../../team/TeamRepository'; -import {TeamState} from '../../../team/TeamState'; const testFactory = new TestFactory(); let conversationRepository: ConversationRepository; diff --git a/src/script/page/RightSidebar/GuestServicesOptions/GuestServicesOptions.tsx b/src/script/page/RightSidebar/GuestServicesOptions/GuestServicesOptions.tsx index a44790572c6..c62092d8620 100644 --- a/src/script/page/RightSidebar/GuestServicesOptions/GuestServicesOptions.tsx +++ b/src/script/page/RightSidebar/GuestServicesOptions/GuestServicesOptions.tsx @@ -23,6 +23,8 @@ import {FadingScrollbar} from 'Components/FadingScrollbar'; import {PrimaryModal} from 'Components/Modals/PrimaryModal'; import {toggleFeature} from 'Repositories/conversation/ConversationAccessPermission'; import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; +import {TeamRepository} from 'Repositories/team/TeamRepository'; +import {TeamState} from 'Repositories/team/TeamState'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; @@ -30,8 +32,6 @@ import {GuestOptions} from './components/GuestOptions'; import {ServicesOptions} from './components/ServicesOptions'; import {Conversation} from '../../../entity/Conversation'; -import {TeamRepository} from '../../../team/TeamRepository'; -import {TeamState} from '../../../team/TeamState'; import {PanelHeader} from '../PanelHeader'; interface GuestServicesOptionsProps { diff --git a/src/script/page/RightSidebar/GuestServicesOptions/components/GuestOptions/GuestOptions.tsx b/src/script/page/RightSidebar/GuestServicesOptions/components/GuestOptions/GuestOptions.tsx index 50731ee9cea..f433fed8c6c 100644 --- a/src/script/page/RightSidebar/GuestServicesOptions/components/GuestOptions/GuestOptions.tsx +++ b/src/script/page/RightSidebar/GuestServicesOptions/components/GuestOptions/GuestOptions.tsx @@ -32,14 +32,14 @@ import {BaseToggle} from 'Components/toggle/BaseToggle'; import {ACCESS_STATE} from 'Repositories/conversation/AccessState'; import {teamPermissionsForAccessState} from 'Repositories/conversation/ConversationAccessPermission'; import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; -import {TeamState} from 'src/script/team/TeamState'; +import {TeamRepository} from 'Repositories/team/TeamRepository'; +import {TeamState} from 'Repositories/team/TeamState'; import {copyText} from 'Util/ClipboardUtil'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; import {Config} from '../../../../../Config'; import {Conversation} from '../../../../../entity/Conversation'; -import {TeamRepository} from '../../../../../team/TeamRepository'; const COPY_LINK_CONFIRM_DURATION = 1500; diff --git a/src/script/page/RightSidebar/MessageDetails/MessageDetails.test.tsx b/src/script/page/RightSidebar/MessageDetails/MessageDetails.test.tsx index d4dfbe8f603..31efa4040ec 100644 --- a/src/script/page/RightSidebar/MessageDetails/MessageDetails.test.tsx +++ b/src/script/page/RightSidebar/MessageDetails/MessageDetails.test.tsx @@ -22,6 +22,8 @@ import {QualifiedId} from '@wireapp/api-client/lib/user'; import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; import {SearchRepository} from 'Repositories/search/SearchRepository'; +import {TeamRepository} from 'Repositories/team/TeamRepository'; +import {UserRepository} from 'Repositories/user/UserRepository'; import {Conversation} from 'src/script/entity/Conversation'; import {createUuid} from 'Util/uuid'; @@ -30,8 +32,6 @@ import {MessageDetails} from './MessageDetails'; import {TestFactory} from '../../../../../test/helper/TestFactory'; import {ContentMessage} from '../../../entity/message/ContentMessage'; import {User} from '../../../entity/User'; -import {TeamRepository} from '../../../team/TeamRepository'; -import {UserRepository} from '../../../user/UserRepository'; const testFactory = new TestFactory(); let conversationRepository: ConversationRepository; diff --git a/src/script/page/RightSidebar/MessageDetails/MessageDetails.tsx b/src/script/page/RightSidebar/MessageDetails/MessageDetails.tsx index 0e9087b2308..ebb20893965 100644 --- a/src/script/page/RightSidebar/MessageDetails/MessageDetails.tsx +++ b/src/script/page/RightSidebar/MessageDetails/MessageDetails.tsx @@ -25,6 +25,7 @@ import {FadingScrollbar} from 'Components/FadingScrollbar'; import * as Icon from 'Components/Icon'; import {UserList} from 'Components/UserList'; import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; +import {UserRepository} from 'Repositories/user/UserRepository'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; import {formatLocale} from 'Util/TimeUtil'; @@ -35,7 +36,6 @@ import {Conversation} from '../../../entity/Conversation'; import {ContentMessage} from '../../../entity/message/ContentMessage'; import {User} from '../../../entity/User'; import {SuperType} from '../../../message/SuperType'; -import {UserRepository} from '../../../user/UserRepository'; import {PanelHeader} from '../PanelHeader'; import {PanelEntity, PanelState} from '../RightSidebar'; diff --git a/src/script/page/RightSidebar/RightSidebar.tsx b/src/script/page/RightSidebar/RightSidebar.tsx index dcc2bfb6e10..5afe59515a2 100644 --- a/src/script/page/RightSidebar/RightSidebar.tsx +++ b/src/script/page/RightSidebar/RightSidebar.tsx @@ -27,6 +27,8 @@ import {WebAppEvents} from '@wireapp/webapp-events'; import {ConversationState} from 'Repositories/conversation/ConversationState'; import {ServiceEntity} from 'Repositories/integration/ServiceEntity'; +import {TeamState} from 'Repositories/team/TeamState'; +import {UserState} from 'Repositories/user/UserState'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {AddParticipants} from './AddParticipants'; @@ -47,8 +49,6 @@ import {isReadableMessage} from '../../guards/Message'; import {isUserEntity, isUserServiceEntity} from '../../guards/Panel'; import {isServiceEntity} from '../../guards/Service'; import {Core} from '../../service/CoreSingleton'; -import {TeamState} from '../../team/TeamState'; -import {UserState} from '../../user/UserState'; import {ActionsViewModel} from '../../view_model/ActionsViewModel'; import {ViewModelRepositories} from '../../view_model/MainViewModel'; import {RightSidebarParams} from '../AppMain'; diff --git a/src/script/page/RightSidebar/TimedMessages/TimedMessages.tsx b/src/script/page/RightSidebar/TimedMessages/TimedMessages.tsx index 4521e44d239..c1d0fc37e71 100644 --- a/src/script/page/RightSidebar/TimedMessages/TimedMessages.tsx +++ b/src/script/page/RightSidebar/TimedMessages/TimedMessages.tsx @@ -23,13 +23,13 @@ import {TabIndex} from '@wireapp/react-ui-kit/lib/types/enums'; import {FadingScrollbar} from 'Components/FadingScrollbar'; import {RadioGroup} from 'Components/Radio'; +import {TeamState} from 'Repositories/team/TeamState'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; import {formatDuration} from 'Util/TimeUtil'; import {Conversation} from '../../../entity/Conversation'; import {EphemeralTimings} from '../../../ephemeral/EphemeralTimings'; -import {TeamState} from '../../../team/TeamState'; import {ViewModelRepositories} from '../../../view_model/MainViewModel'; import {PanelHeader} from '../PanelHeader'; diff --git a/src/script/page/components/FeatureConfigChange/FeatureConfigChangeHandler/Features/useE2EIFeatureConfigUpdate.ts b/src/script/page/components/FeatureConfigChange/FeatureConfigChangeHandler/Features/useE2EIFeatureConfigUpdate.ts index 6c71a0e5435..9aee4018c25 100644 --- a/src/script/page/components/FeatureConfigChange/FeatureConfigChangeHandler/Features/useE2EIFeatureConfigUpdate.ts +++ b/src/script/page/components/FeatureConfigChange/FeatureConfigChangeHandler/Features/useE2EIFeatureConfigUpdate.ts @@ -24,8 +24,8 @@ import {FEATURE_KEY, FeatureList} from '@wireapp/api-client/lib/team'; import { FeatureUpdateType, detectTeamFeatureUpdate, -} from 'src/script/team/TeamFeatureConfigChangeDetector/TeamFeatureConfigChangeDetector'; -import {TeamRepository} from 'src/script/team/TeamRepository'; +} from 'Repositories/team/TeamFeatureConfigChangeDetector/TeamFeatureConfigChangeDetector'; +import {TeamRepository} from 'Repositories/team/TeamRepository'; import {configureE2EI} from './E2EIdentity'; diff --git a/src/script/page/components/FeatureConfigChange/FeatureConfigChangeNotifier/FeatureConfigChangeNotifier.test.tsx b/src/script/page/components/FeatureConfigChange/FeatureConfigChangeNotifier/FeatureConfigChangeNotifier.test.tsx index 75f41e2c726..46c67068d61 100644 --- a/src/script/page/components/FeatureConfigChange/FeatureConfigChangeNotifier/FeatureConfigChangeNotifier.test.tsx +++ b/src/script/page/components/FeatureConfigChange/FeatureConfigChangeNotifier/FeatureConfigChangeNotifier.test.tsx @@ -23,12 +23,11 @@ import {Runtime} from '@wireapp/commons/lib/util/Runtime'; import {PrimaryModal} from 'Components/Modals/PrimaryModal'; import en from 'I18n/en-US.json'; +import {TeamState} from 'Repositories/team/TeamState'; import {setStrings} from 'Util/LocalizerUtil'; import {FeatureConfigChangeNotifier} from './FeatureConfigChangeNotifier'; -import {TeamState} from '../../../../team/TeamState'; - setStrings({en}); describe('FeatureConfigChangeNotifier', () => { diff --git a/src/script/page/components/FeatureConfigChange/FeatureConfigChangeNotifier/FeatureConfigChangeNotifier.ts b/src/script/page/components/FeatureConfigChange/FeatureConfigChangeNotifier/FeatureConfigChangeNotifier.ts index 04e1fea696d..9ca084778a6 100644 --- a/src/script/page/components/FeatureConfigChange/FeatureConfigChangeNotifier/FeatureConfigChangeNotifier.ts +++ b/src/script/page/components/FeatureConfigChange/FeatureConfigChangeNotifier/FeatureConfigChangeNotifier.ts @@ -33,6 +33,7 @@ import {WebAppEvents} from '@wireapp/webapp-events'; import {PrimaryModal} from 'Components/Modals/PrimaryModal'; import {ButtonAction} from 'Components/Modals/PrimaryModal/PrimaryModalTypes'; +import {TeamState} from 'Repositories/team/TeamState'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {StringIdentifer, replaceLink, t} from 'Util/LocalizerUtil'; import {getLogger} from 'Util/Logger'; @@ -41,7 +42,6 @@ import {formatDuration} from 'Util/TimeUtil'; import {loadFeatureConfig, saveFeatureConfig} from './FeatureConfigChangeNotifier.store'; import {Config} from '../../../../Config'; -import {TeamState} from '../../../../team/TeamState'; type FeatureMessageGenerator = { [K in keyof FeatureList]: ( diff --git a/src/script/page/components/WindowTitleUpdater.ts b/src/script/page/components/WindowTitleUpdater.ts index 4284f57295f..58ddde8f97a 100644 --- a/src/script/page/components/WindowTitleUpdater.ts +++ b/src/script/page/components/WindowTitleUpdater.ts @@ -26,12 +26,12 @@ import {WebAppEvents} from '@wireapp/webapp-events'; import {ConversationState} from 'Repositories/conversation/ConversationState'; import {NOTIFICATION_HANDLING_STATE} from 'Repositories/event/NotificationHandlingState'; +import {UserState} from 'Repositories/user/UserState'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; import {getLogger} from 'Util/Logger'; import {Config} from '../../Config'; -import {UserState} from '../../user/UserState'; import {ContentState, useAppState} from '../useAppState'; const windowTitleLogger = getLogger('WindowTitlesViewModel'); diff --git a/src/script/repositories/assets/AssetRepository.ts b/src/script/repositories/assets/AssetRepository.ts index 374e94186ed..a922d25e2dc 100644 --- a/src/script/repositories/assets/AssetRepository.ts +++ b/src/script/repositories/assets/AssetRepository.ts @@ -24,6 +24,8 @@ import {container, singleton} from 'tsyringe'; import {LegalHoldStatus} from '@wireapp/protocol-messaging'; +import {TeamState} from 'Repositories/team/TeamState'; +import {stripImageExifData} from 'Util/ImageUtil'; import {getLogger, Logger} from 'Util/Logger'; import {downloadBlob, loadFileBuffer, loadImage} from 'Util/util'; import {WebWorker} from 'Util/worker'; @@ -36,8 +38,6 @@ import {Conversation} from '../../entity/Conversation'; import {FileAsset} from '../../entity/message/FileAsset'; import type {User} from '../../entity/User'; import {Core} from '../../service/CoreSingleton'; -import {TeamState} from '../../team/TeamState'; -import {stripImageExifData} from '../../util/ImageUtil'; interface CompressedImage { compressedBytes: Uint8Array; diff --git a/src/script/repositories/calling/CallingRepository.test.ts b/src/script/repositories/calling/CallingRepository.test.ts index 7dba914216d..2a33a0366f2 100644 --- a/src/script/repositories/calling/CallingRepository.test.ts +++ b/src/script/repositories/calling/CallingRepository.test.ts @@ -35,6 +35,7 @@ import {CALL} from 'Repositories/event/Client'; import {EventRepository} from 'Repositories/event/EventRepository'; import {MediaDevicesHandler} from 'Repositories/media/MediaDevicesHandler'; import {MediaType} from 'Repositories/media/MediaType'; +import {UserRepository} from 'Repositories/user/UserRepository'; import {Conversation} from 'src/script/entity/Conversation'; import {User} from 'src/script/entity/User'; import {serverTimeHandler} from 'src/script/time/serverTimeHandler'; @@ -49,7 +50,6 @@ import {LEAVE_CALL_REASON} from './enum/LeaveCallReason'; import {Participant} from './Participant'; import {Core} from '../../service/CoreSingleton'; -import {UserRepository} from '../../user/UserRepository'; const createSelfParticipant = () => { const selfUser = new User(); diff --git a/src/script/repositories/calling/CallingRepository.ts b/src/script/repositories/calling/CallingRepository.ts index 6c88e64f474..974094a260f 100644 --- a/src/script/repositories/calling/CallingRepository.ts +++ b/src/script/repositories/calling/CallingRepository.ts @@ -68,10 +68,12 @@ import {EventSource} from 'Repositories/event/EventSource'; import type {MediaDevicesHandler} from 'Repositories/media/MediaDevicesHandler'; import type {MediaStreamHandler} from 'Repositories/media/MediaStreamHandler'; import {MediaType} from 'Repositories/media/MediaType'; +import {TeamState} from 'Repositories/team/TeamState'; import {isCountlyEnabledAtCurrentEnvironment} from 'Repositories/tracking/Countly.helpers'; import {EventName} from 'Repositories/tracking/EventName'; import * as trackingHelpers from 'Repositories/tracking/Helpers'; import {Segmentation} from 'Repositories/tracking/Segmentation'; +import type {UserRepository} from 'Repositories/user/UserRepository'; import {flatten} from 'Util/ArrayUtil'; import {calculateChildWindowPosition} from 'Util/DOM/caculateChildWindowPosition'; import {isDetachedCallingFeatureEnabled} from 'Util/isDetachedCallingFeatureEnabled'; @@ -96,9 +98,7 @@ import type {User} from '../../entity/User'; import {NoAudioInputError} from '../../error/NoAudioInputError'; import {APIClient} from '../../service/APIClientSingleton'; import {Core} from '../../service/CoreSingleton'; -import {TeamState} from '../../team/TeamState'; import type {ServerTimeHandler} from '../../time/serverTimeHandler'; -import type {UserRepository} from '../../user/UserRepository'; import {Warnings} from '../../view_model/WarningsContainer'; const avsLogger = getLogger('avs'); diff --git a/src/script/repositories/connection/ConnectionRepository.test.ts b/src/script/repositories/connection/ConnectionRepository.test.ts index 85996a60420..d146c7391c6 100644 --- a/src/script/repositories/connection/ConnectionRepository.test.ts +++ b/src/script/repositories/connection/ConnectionRepository.test.ts @@ -25,6 +25,7 @@ import {StatusCodes} from 'http-status-codes'; import {WebAppEvents} from '@wireapp/webapp-events'; +import {UserRepository} from 'Repositories/user/UserRepository'; import {generateUser} from 'test/helper/UserGenerator'; import {createUuid} from 'Util/uuid'; @@ -34,7 +35,6 @@ import {ConnectionService} from './ConnectionService'; import {ConnectionState} from './ConnectionState'; import {Conversation} from '../../entity/Conversation'; -import {UserRepository} from '../../user/UserRepository'; function buildConnectionRepository() { const connectionState = new ConnectionState(); diff --git a/src/script/repositories/connection/ConnectionRepository.ts b/src/script/repositories/connection/ConnectionRepository.ts index 4c4ed414600..12eaa487f48 100644 --- a/src/script/repositories/connection/ConnectionRepository.ts +++ b/src/script/repositories/connection/ConnectionRepository.ts @@ -31,6 +31,7 @@ import {WebAppEvents} from '@wireapp/webapp-events'; import {PrimaryModal} from 'Components/Modals/PrimaryModal'; import {EventRepository} from 'Repositories/event/EventRepository'; import type {EventSource} from 'Repositories/event/EventSource'; +import type {UserRepository} from 'Repositories/user/UserRepository'; import {replaceLink, t} from 'Util/LocalizerUtil'; import {getLogger, Logger} from 'Util/Logger'; import {matchQualifiedIds} from 'Util/QualifiedId'; @@ -46,7 +47,6 @@ import type {Conversation} from '../../entity/Conversation'; import {MemberMessage} from '../../entity/message/MemberMessage'; import type {User} from '../../entity/User'; import {SystemMessageType} from '../../message/SystemMessageType'; -import type {UserRepository} from '../../user/UserRepository'; export class ConnectionRepository { private readonly connectionService: ConnectionService; diff --git a/src/script/repositories/conversation/ConversationAccessPermission.ts b/src/script/repositories/conversation/ConversationAccessPermission.ts index 3721cc95d9c..2b240757782 100644 --- a/src/script/repositories/conversation/ConversationAccessPermission.ts +++ b/src/script/repositories/conversation/ConversationAccessPermission.ts @@ -19,9 +19,9 @@ import {CONVERSATION_ACCESS_ROLE, CONVERSATION_ACCESS} from '@wireapp/api-client/lib/conversation/'; -import {ACCESS_STATE, TEAM} from './AccessState'; +import {combinePermissions, hasPermissions} from 'Repositories/user/UserPermission'; -import {combinePermissions, hasPermissions} from '../../user/UserPermission'; +import {ACCESS_STATE, TEAM} from './AccessState'; export const ACCESS_TYPES = { GUEST: 1 << 0, diff --git a/src/script/repositories/conversation/ConversationRepository.test.ts b/src/script/repositories/conversation/ConversationRepository.test.ts index d6d96053015..a0a53c12969 100644 --- a/src/script/repositories/conversation/ConversationRepository.test.ts +++ b/src/script/repositories/conversation/ConversationRepository.test.ts @@ -60,6 +60,10 @@ import {EventService} from 'Repositories/event/EventService'; import {NOTIFICATION_HANDLING_STATE} from 'Repositories/event/NotificationHandlingState'; import {SelfRepository} from 'Repositories/self/SelfRepository'; import {LegacyEventRecord, StorageSchemata, StorageService} from 'Repositories/storage'; +import {TeamRepository} from 'Repositories/team/TeamRepository'; +import {TeamState} from 'Repositories/team/TeamState'; +import {UserRepository} from 'Repositories/user/UserRepository'; +import {UserState} from 'Repositories/user/UserState'; import {Config} from 'src/script/Config'; import {Conversation} from 'src/script/entity/Conversation'; import {Message} from 'src/script/entity/message/Message'; @@ -87,10 +91,6 @@ import {entities, payload} from '../../../../test/api/payloads'; import {TestFactory} from '../../../../test/helper/TestFactory'; import {generateUser} from '../../../../test/helper/UserGenerator'; import {Core} from '../../service/CoreSingleton'; -import {TeamRepository} from '../../team/TeamRepository'; -import {TeamState} from '../../team/TeamState'; -import {UserRepository} from '../../user/UserRepository'; -import {UserState} from '../../user/UserState'; function buildConversationRepository() { const teamState = new TeamState(); diff --git a/src/script/repositories/conversation/ConversationRepository.ts b/src/script/repositories/conversation/ConversationRepository.ts index 335f02d7453..f28c0f80847 100644 --- a/src/script/repositories/conversation/ConversationRepository.ts +++ b/src/script/repositories/conversation/ConversationRepository.ts @@ -75,6 +75,11 @@ import {PropertiesRepository} from 'Repositories/properties/PropertiesRepository import {SelfRepository} from 'Repositories/self/SelfRepository'; import type {EventRecord} from 'Repositories/storage'; import {ConversationRecord} from 'Repositories/storage'; +import {TeamRepository} from 'Repositories/team/TeamRepository'; +import {TeamState} from 'Repositories/team/TeamState'; +import {UserFilter} from 'Repositories/user/UserFilter'; +import {UserRepository} from 'Repositories/user/UserRepository'; +import {UserState} from 'Repositories/user/UserState'; import {getNextItem} from 'Util/ArrayUtil'; import {allowsAllFiles, getFileExtensionOrName, isAllowedFile} from 'Util/FileTypeUtil'; import {replaceLink, t} from 'Util/LocalizerUtil'; @@ -157,12 +162,7 @@ import {MessageCategory} from '../../message/MessageCategory'; import {SystemMessageType} from '../../message/SystemMessageType'; import {addOtherSelfClientsToMLSConversation} from '../../mls'; import {Core} from '../../service/CoreSingleton'; -import {TeamRepository} from '../../team/TeamRepository'; -import {TeamState} from '../../team/TeamState'; import {ServerTimeHandler} from '../../time/serverTimeHandler'; -import {UserFilter} from '../../user/UserFilter'; -import {UserRepository} from '../../user/UserRepository'; -import {UserState} from '../../user/UserState'; type ConversationDBChange = {obj: EventRecord; oldObj: EventRecord}; type FetchPromise = {rejectFn: (error: ConversationError) => void; resolveFn: (conversation: Conversation) => void}; diff --git a/src/script/repositories/conversation/ConversationRoleRepository.test.ts b/src/script/repositories/conversation/ConversationRoleRepository.test.ts index ec7042ed51e..a3fbefe05e3 100644 --- a/src/script/repositories/conversation/ConversationRoleRepository.test.ts +++ b/src/script/repositories/conversation/ConversationRoleRepository.test.ts @@ -19,6 +19,7 @@ import {DefaultConversationRoleName as DefaultRole} from '@wireapp/api-client/lib/conversation/'; +import {TeamEntity} from 'Repositories/team/TeamEntity'; import {createUuid} from 'Util/uuid'; import {ConversationRoleRepository, Permissions} from './ConversationRoleRepository'; @@ -26,7 +27,6 @@ import {ConversationRoleRepository, Permissions} from './ConversationRoleReposit import {TestFactory} from '../../../../test/helper/TestFactory'; import {Conversation} from '../../entity/Conversation'; import {User} from '../../entity/User'; -import {TeamEntity} from '../../team/TeamEntity'; describe('ConversationRoleRepository', () => { const testFactory = new TestFactory(); diff --git a/src/script/repositories/conversation/ConversationRoleRepository.ts b/src/script/repositories/conversation/ConversationRoleRepository.ts index fb929af30d1..093ac6f5380 100644 --- a/src/script/repositories/conversation/ConversationRoleRepository.ts +++ b/src/script/repositories/conversation/ConversationRoleRepository.ts @@ -20,15 +20,15 @@ import {DefaultConversationRoleName as DefaultRole, ConversationRole} from '@wireapp/api-client/lib/conversation/'; import {container} from 'tsyringe'; +import type {TeamRepository} from 'Repositories/team/TeamRepository'; +import {TeamState} from 'Repositories/team/TeamState'; +import {UserState} from 'Repositories/user/UserState'; import {Logger, getLogger} from 'Util/Logger'; import type {ConversationService} from './ConversationService'; import type {Conversation} from '../../entity/Conversation'; import type {User} from '../../entity/User'; -import type {TeamRepository} from '../../team/TeamRepository'; -import {TeamState} from '../../team/TeamState'; -import {UserState} from '../../user/UserState'; export enum Permissions { addParticipants = 'add_conversation_member', diff --git a/src/script/repositories/conversation/ConversationState.test.ts b/src/script/repositories/conversation/ConversationState.test.ts index fa81c0e5bde..18c5cb6243c 100644 --- a/src/script/repositories/conversation/ConversationState.test.ts +++ b/src/script/repositories/conversation/ConversationState.test.ts @@ -21,11 +21,12 @@ import {ConversationProtocol, CONVERSATION_TYPE} from '@wireapp/api-client/lib/c import {randomUUID} from 'crypto'; +import {TeamState} from 'Repositories/team/TeamState'; +import {UserState} from 'Repositories/user/UserState'; + import {ConversationState} from './ConversationState'; import {Conversation} from '../../entity/Conversation'; -import {TeamState} from '../../team/TeamState'; -import {UserState} from '../../user/UserState'; function createConversationState() { return new ConversationState(new UserState(), new TeamState()); diff --git a/src/script/repositories/conversation/ConversationState.ts b/src/script/repositories/conversation/ConversationState.ts index 945af439b2f..fd5b450d2e0 100644 --- a/src/script/repositories/conversation/ConversationState.ts +++ b/src/script/repositories/conversation/ConversationState.ts @@ -21,6 +21,8 @@ import {QualifiedId} from '@wireapp/api-client/lib/user'; import ko from 'knockout'; import {container, singleton} from 'tsyringe'; +import {TeamState} from 'Repositories/team/TeamState'; +import {UserState} from 'Repositories/user/UserState'; import {matchQualifiedIds} from 'Util/QualifiedId'; import {sortGroupsByLastEvent} from 'Util/util'; @@ -36,8 +38,6 @@ import { import {Conversation} from '../../entity/Conversation'; import {User} from '../../entity/User'; -import {TeamState} from '../../team/TeamState'; -import {UserState} from '../../user/UserState'; @singleton() export class ConversationState { diff --git a/src/script/repositories/conversation/ConversationVerificationStateHandler/Proteus/ProteusStateHandler.ts b/src/script/repositories/conversation/ConversationVerificationStateHandler/Proteus/ProteusStateHandler.ts index 560756c7348..5fefe899bd9 100644 --- a/src/script/repositories/conversation/ConversationVerificationStateHandler/Proteus/ProteusStateHandler.ts +++ b/src/script/repositories/conversation/ConversationVerificationStateHandler/Proteus/ProteusStateHandler.ts @@ -23,9 +23,9 @@ import {container} from 'tsyringe'; import {WebAppEvents} from '@wireapp/webapp-events'; +import {UserState} from 'Repositories/user/UserState'; import {Conversation} from 'src/script/entity/Conversation'; import {VerificationMessageType} from 'src/script/message/VerificationMessageType'; -import {UserState} from 'src/script/user/UserState'; import {getLogger, Logger} from 'Util/Logger'; import {isMixedConversation, isProteusConversation} from '../../ConversationSelectors'; diff --git a/src/script/repositories/conversation/ConversationVerificationStateHandler/shared/conversation/index.ts b/src/script/repositories/conversation/ConversationVerificationStateHandler/shared/conversation/index.ts index df1c494af8f..29f144af5b7 100644 --- a/src/script/repositories/conversation/ConversationVerificationStateHandler/shared/conversation/index.ts +++ b/src/script/repositories/conversation/ConversationVerificationStateHandler/shared/conversation/index.ts @@ -19,8 +19,8 @@ import {QualifiedId} from '@wireapp/api-client/lib/user'; +import {UserState} from 'Repositories/user/UserState'; import {Conversation} from 'src/script/entity/Conversation'; -import {UserState} from 'src/script/user/UserState'; import {Logger} from 'Util/Logger'; import {matchQualifiedIds} from 'Util/QualifiedId'; diff --git a/src/script/repositories/conversation/MessageRepository.test.ts b/src/script/repositories/conversation/MessageRepository.test.ts index d9056bd42f2..9533b7af760 100644 --- a/src/script/repositories/conversation/MessageRepository.test.ts +++ b/src/script/repositories/conversation/MessageRepository.test.ts @@ -35,6 +35,9 @@ import {EventRepository} from 'Repositories/event/EventRepository'; import {EventService} from 'Repositories/event/EventService'; import {PropertiesRepository} from 'Repositories/properties/PropertiesRepository'; import {ReactionMap} from 'Repositories/storage'; +import {TeamState} from 'Repositories/team/TeamState'; +import {UserRepository} from 'Repositories/user/UserRepository'; +import {UserState} from 'Repositories/user/UserState'; import {Conversation} from 'src/script/entity/Conversation'; import {Message} from 'src/script/entity/message/Message'; import {Text} from 'src/script/entity/message/Text'; @@ -49,10 +52,7 @@ import {MessageRepository} from './MessageRepository'; import {ContentMessage} from '../../entity/message/ContentMessage'; import {StatusType} from '../../message/StatusType'; -import {TeamState} from '../../team/TeamState'; import {ServerTimeHandler, serverTimeHandler} from '../../time/serverTimeHandler'; -import {UserRepository} from '../../user/UserRepository'; -import {UserState} from '../../user/UserState'; const selfUser = new User('selfid', ''); selfUser.isMe = true; diff --git a/src/script/repositories/conversation/MessageRepository.ts b/src/script/repositories/conversation/MessageRepository.ts index 2cbb2557aea..425c5e5a07c 100644 --- a/src/script/repositories/conversation/MessageRepository.ts +++ b/src/script/repositories/conversation/MessageRepository.ts @@ -66,10 +66,14 @@ import {NOTIFICATION_HANDLING_STATE} from 'Repositories/event/NotificationHandli import {PropertiesRepository} from 'Repositories/properties/PropertiesRepository'; import {PROPERTIES_TYPE} from 'Repositories/properties/PropertiesType'; import type {EventRecord, ReactionMap} from 'Repositories/storage'; +import {TeamState} from 'Repositories/team/TeamState'; import {UserType} from 'Repositories/tracking/attribute'; import {EventName} from 'Repositories/tracking/EventName'; import * as trackingHelpers from 'Repositories/tracking/Helpers'; import {Segmentation} from 'Repositories/tracking/Segmentation'; +import {protoFromType} from 'Repositories/user/AvailabilityMapper'; +import {UserRepository} from 'Repositories/user/UserRepository'; +import {UserState} from 'Repositories/user/UserState'; import { cancelSendingLinkPreview, clearLinkPreviewSendingState, @@ -107,11 +111,7 @@ import {MentionEntity} from '../../message/MentionEntity'; import {QuoteEntity} from '../../message/QuoteEntity'; import {StatusType} from '../../message/StatusType'; import {Core} from '../../service/CoreSingleton'; -import {TeamState} from '../../team/TeamState'; import {ServerTimeHandler} from '../../time/serverTimeHandler'; -import {protoFromType} from '../../user/AvailabilityMapper'; -import {UserRepository} from '../../user/UserRepository'; -import {UserState} from '../../user/UserState'; export interface MessageSendingOptions { /** Send native push notification for message. Default is `true`. */ diff --git a/src/script/repositories/event/EventRepository.ts b/src/script/repositories/event/EventRepository.ts index af414b1b35b..950e6af8fd3 100644 --- a/src/script/repositories/event/EventRepository.ts +++ b/src/script/repositories/event/EventRepository.ts @@ -34,6 +34,7 @@ import {WebAppEvents} from '@wireapp/webapp-events'; import {ClientConversationEvent, EventBuilder} from 'Repositories/conversation/EventBuilder'; import {CryptographyMapper} from 'Repositories/cryptography/CryptographyMapper'; import {EventName} from 'Repositories/tracking/EventName'; +import {UserState} from 'Repositories/user/UserState'; import {getLogger, Logger} from 'Util/Logger'; import {queue} from 'Util/PromiseQueue'; import {TIME_IN_MILLIS} from 'Util/TimeUtil'; @@ -52,7 +53,6 @@ import {EventValidationError} from './preprocessor/EventStorageMiddleware/eventH import {CryptographyError} from '../../error/CryptographyError'; import {EventError} from '../../error/EventError'; import type {ServerTimeHandler} from '../../time/serverTimeHandler'; -import {UserState} from '../../user/UserState'; import {Warnings} from '../../view_model/WarningsContainer'; export class EventRepository { diff --git a/src/script/repositories/event/preprocessor/EventStorageMiddleware/EventStorageMiddleware.ts b/src/script/repositories/event/preprocessor/EventStorageMiddleware/EventStorageMiddleware.ts index 651ad7e7c99..d7d136f3194 100644 --- a/src/script/repositories/event/preprocessor/EventStorageMiddleware/EventStorageMiddleware.ts +++ b/src/script/repositories/event/preprocessor/EventStorageMiddleware/EventStorageMiddleware.ts @@ -22,8 +22,8 @@ import {container} from 'tsyringe'; import {ConversationState} from 'Repositories/conversation/ConversationState'; import type {EventRecord} from 'Repositories/storage'; +import {UserFilter} from 'Repositories/user/UserFilter'; import {User} from 'src/script/entity/User'; -import {UserFilter} from 'src/script/user/UserFilter'; import {matchQualifiedIds} from 'Util/QualifiedId'; import {handleLinkPreviewEvent, handleEditEvent, handleAssetEvent, handleReactionEvent} from './eventHandlers'; diff --git a/src/script/repositories/event/preprocessor/ServiceMiddleware.test.ts b/src/script/repositories/event/preprocessor/ServiceMiddleware.test.ts index a5d9f46aab5..a2a6825a80f 100644 --- a/src/script/repositories/event/preprocessor/ServiceMiddleware.test.ts +++ b/src/script/repositories/event/preprocessor/ServiceMiddleware.test.ts @@ -19,9 +19,9 @@ import {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; import {EventBuilder} from 'Repositories/conversation/EventBuilder'; +import {UserRepository} from 'Repositories/user/UserRepository'; import {Conversation} from 'src/script/entity/Conversation'; import {User} from 'src/script/entity/User'; -import {UserRepository} from 'src/script/user/UserRepository'; import {createUuid} from 'Util/uuid'; import {ServiceMiddleware} from './ServiceMiddleware'; diff --git a/src/script/repositories/event/preprocessor/ServiceMiddleware.ts b/src/script/repositories/event/preprocessor/ServiceMiddleware.ts index a8239c0af8e..d28ee87ef25 100644 --- a/src/script/repositories/event/preprocessor/ServiceMiddleware.ts +++ b/src/script/repositories/event/preprocessor/ServiceMiddleware.ts @@ -22,11 +22,11 @@ import type {QualifiedId} from '@wireapp/api-client/lib/user/'; import type {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; import {MemberJoinEvent, OneToOneCreationEvent} from 'Repositories/conversation/EventBuilder'; +import type {UserRepository} from 'Repositories/user/UserRepository'; import {User} from 'src/script/entity/User'; import {getLogger, Logger} from 'Util/Logger'; import {matchQualifiedIds} from 'Util/QualifiedId'; -import type {UserRepository} from '../../../user/UserRepository'; import {ClientEvent} from '../Client'; import {EventMiddleware, IncomingEvent} from '../EventProcessor'; diff --git a/src/script/repositories/integration/IntegrationRepository.ts b/src/script/repositories/integration/IntegrationRepository.ts index 3fb1c7e82b3..e88ffbac46b 100644 --- a/src/script/repositories/integration/IntegrationRepository.ts +++ b/src/script/repositories/integration/IntegrationRepository.ts @@ -24,6 +24,8 @@ import {container} from 'tsyringe'; import type {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; import {ConversationState} from 'Repositories/conversation/ConversationState'; import {MemberLeaveEvent} from 'Repositories/conversation/EventBuilder'; +import type {TeamRepository} from 'Repositories/team/TeamRepository'; +import {TeamState} from 'Repositories/team/TeamState'; import {getLogger, Logger} from 'Util/Logger'; import {compareTransliteration, sortByPriority} from 'Util/StringUtil'; @@ -34,8 +36,6 @@ import {ServiceEntity} from './ServiceEntity'; import type {Conversation} from '../../entity/Conversation'; import type {User} from '../../entity/User'; -import type {TeamRepository} from '../../team/TeamRepository'; -import {TeamState} from '../../team/TeamState'; export class IntegrationRepository { private readonly logger: Logger; diff --git a/src/script/repositories/media/MediaConstraintsHandler.test.ts b/src/script/repositories/media/MediaConstraintsHandler.test.ts index d85f4bd6e7c..1a826929c88 100644 --- a/src/script/repositories/media/MediaConstraintsHandler.test.ts +++ b/src/script/repositories/media/MediaConstraintsHandler.test.ts @@ -19,13 +19,13 @@ import ko from 'knockout'; +import {UserState} from 'Repositories/user/UserState'; import {createUuid} from 'Util/uuid'; import {MediaConstraintsHandler, ScreensharingMethods} from './MediaConstraintsHandler'; import {CurrentAvailableDeviceId} from './MediaDevicesHandler'; import {User} from '../../entity/User'; -import {UserState} from '../../user/UserState'; describe('MediaConstraintsHandler', () => { const createAvailableDevices = (deviceId?: string): CurrentAvailableDeviceId => ({ diff --git a/src/script/repositories/media/MediaConstraintsHandler.ts b/src/script/repositories/media/MediaConstraintsHandler.ts index 1ed5e81d8e0..b5c930a37ad 100644 --- a/src/script/repositories/media/MediaConstraintsHandler.ts +++ b/src/script/repositories/media/MediaConstraintsHandler.ts @@ -19,13 +19,12 @@ import {container} from 'tsyringe'; +import {UserState} from 'Repositories/user/UserState'; import {Logger, getLogger} from 'Util/Logger'; import type {CurrentAvailableDeviceId} from './MediaDevicesHandler'; import {VIDEO_QUALITY_MODE} from './VideoQualityMode'; -import {UserState} from '../../user/UserState'; - interface Config { CONSTRAINTS: { SCREEN: { diff --git a/src/script/repositories/media/MediaStreamHandler.test.ts b/src/script/repositories/media/MediaStreamHandler.test.ts index f9044f1f55f..abfb3fe709f 100644 --- a/src/script/repositories/media/MediaStreamHandler.test.ts +++ b/src/script/repositories/media/MediaStreamHandler.test.ts @@ -18,13 +18,12 @@ */ import {PermissionRepository} from 'Repositories/permission/PermissionRepository'; +import {UserState} from 'Repositories/user/UserState'; import {MediaConstraintsHandler} from './MediaConstraintsHandler'; import {CurrentAvailableDeviceId} from './MediaDevicesHandler'; import {MediaStreamHandler} from './MediaStreamHandler'; -import {UserState} from '../../user/UserState'; - describe('MediaStreamHandler', () => { let streamHandler: MediaStreamHandler; diff --git a/src/script/repositories/notification/NotificationRepository.test.ts b/src/script/repositories/notification/NotificationRepository.test.ts index 96e8714c30b..ba8a45608f1 100644 --- a/src/script/repositories/notification/NotificationRepository.test.ts +++ b/src/script/repositories/notification/NotificationRepository.test.ts @@ -40,6 +40,8 @@ import {NOTIFICATION_STATE} from 'Repositories/conversation/NotificationSetting' import {NOTIFICATION_HANDLING_STATE} from 'Repositories/event/NotificationHandlingState'; import {PermissionRepository} from 'Repositories/permission/PermissionRepository'; import {PermissionStatusState} from 'Repositories/permission/PermissionStatusState'; +import {UserMapper} from 'Repositories/user/UserMapper'; +import {UserState} from 'Repositories/user/UserState'; import {Conversation} from 'src/script/entity/Conversation'; import {CallMessage} from 'src/script/entity/message/CallMessage'; import {CompositeMessage} from 'src/script/entity/message/CompositeMessage'; @@ -66,8 +68,6 @@ import {createUuid} from 'Util/uuid'; import {NotificationRepository} from './NotificationRepository'; import {Message} from '../../entity/message/Message'; -import {UserMapper} from '../../user/UserMapper'; -import {UserState} from '../../user/UserState'; function buildNotificationRepository() { const userState = container.resolve(UserState); diff --git a/src/script/repositories/notification/NotificationRepository.ts b/src/script/repositories/notification/NotificationRepository.ts index 39d602aff09..704c9b75f0e 100644 --- a/src/script/repositories/notification/NotificationRepository.ts +++ b/src/script/repositories/notification/NotificationRepository.ts @@ -40,6 +40,7 @@ import {ConversationState} from 'Repositories/conversation/ConversationState'; import type {PermissionRepository} from 'Repositories/permission/PermissionRepository'; import {PermissionStatusState} from 'Repositories/permission/PermissionStatusState'; import {PermissionType} from 'Repositories/permission/PermissionType'; +import {UserState} from 'Repositories/user/UserState'; import {Declension, t, getUserName} from 'Util/LocalizerUtil'; import {getLogger, Logger} from 'Util/Logger'; import {getRenderedTextContent} from 'Util/messageRenderer'; @@ -62,7 +63,6 @@ import type {User} from '../../entity/User'; import {SuperType} from '../../message/SuperType'; import {SystemMessageType} from '../../message/SystemMessageType'; import {ContentState, useAppState} from '../../page/useAppState'; -import {UserState} from '../../user/UserState'; import {Warnings} from '../../view_model/WarningsContainer'; type NotificationData = {conversationId?: QualifiedId; messageId?: string; messageType: string}; diff --git a/src/script/repositories/properties/PropertiesRepository.ts b/src/script/repositories/properties/PropertiesRepository.ts index 979d6d6180c..59584edbe0d 100644 --- a/src/script/repositories/properties/PropertiesRepository.ts +++ b/src/script/repositories/properties/PropertiesRepository.ts @@ -29,6 +29,8 @@ import {PrimaryModal} from 'Components/Modals/PrimaryModal'; import {PrimaryModalType} from 'Components/Modals/PrimaryModal/PrimaryModalTypes'; import type {SelfService} from 'Repositories/self/SelfService'; import {isCountlyEnabledAtCurrentEnvironment} from 'Repositories/tracking/Countly.helpers'; +import {ConsentValue} from 'Repositories/user/ConsentValue'; +import {CONVERSATION_TYPING_INDICATOR_MODE} from 'Repositories/user/TypingIndicatorMode'; import {Config} from 'src/script/Config'; import {deepMerge} from 'Util/deepMerge'; import {Environment} from 'Util/Environment'; @@ -39,8 +41,6 @@ import type {PropertiesService} from './PropertiesService'; import {PROPERTIES_TYPE, UserConsentStatus} from './PropertiesType'; import type {User} from '../../entity/User'; -import {ConsentValue} from '../../user/ConsentValue'; -import {CONVERSATION_TYPING_INDICATOR_MODE} from '../../user/TypingIndicatorMode'; export class PropertiesRepository { // Value names are specified by the protocol but key names can be changed. diff --git a/src/script/repositories/search/SearchRepository.test.ts b/src/script/repositories/search/SearchRepository.test.ts index e01f631a773..ec175157277 100644 --- a/src/script/repositories/search/SearchRepository.test.ts +++ b/src/script/repositories/search/SearchRepository.test.ts @@ -17,6 +17,7 @@ * */ +import {UserRepository} from 'Repositories/user/UserRepository'; import {User} from 'src/script/entity/User'; import {generateUser} from 'test/helper/UserGenerator'; import {createUuid} from 'Util/uuid'; @@ -27,7 +28,6 @@ import {randomInt} from '../../auth/util/randomUtil'; import {generateUsers} from '../../auth/util/test/TestUtil'; import {APIClient} from '../../service/APIClientSingleton'; import {Core} from '../../service/CoreSingleton'; -import {UserRepository} from '../../user/UserRepository'; function buildSearchRepository() { const userRepository = {getUsersById: jest.fn(() => [])} as unknown as jest.Mocked; diff --git a/src/script/repositories/search/SearchRepository.ts b/src/script/repositories/search/SearchRepository.ts index d6a7cb18979..9b37d457c5f 100644 --- a/src/script/repositories/search/SearchRepository.ts +++ b/src/script/repositories/search/SearchRepository.ts @@ -20,6 +20,8 @@ import type {QualifiedId, SearchResult} from '@wireapp/api-client/lib/user/'; import {container} from 'tsyringe'; +import {validateHandle} from 'Repositories/user/UserHandleGenerator'; +import type {UserRepository} from 'Repositories/user/UserRepository'; import {EMOJI_RANGES} from 'Util/EmojiUtil'; import { computeTransliteration, @@ -32,8 +34,6 @@ import { import type {User} from '../../entity/User'; import {APIClient} from '../../service/APIClientSingleton'; import {Core} from '../../service/CoreSingleton'; -import {validateHandle} from '../../user/UserHandleGenerator'; -import type {UserRepository} from '../../user/UserRepository'; const CONFIG = { MAX_DIRECTORY_RESULTS: 30, diff --git a/src/script/repositories/self/SelfRepository.ts b/src/script/repositories/self/SelfRepository.ts index 3401adaa5ab..48b5f1ea028 100644 --- a/src/script/repositories/self/SelfRepository.ts +++ b/src/script/repositories/self/SelfRepository.ts @@ -28,6 +28,13 @@ import {WebAppEvents} from '@wireapp/webapp-events'; import {ClientEntity, ClientRepository} from 'Repositories/client'; import {EventSource} from 'Repositories/event/EventSource'; +import { + FeatureUpdateType, + detectTeamFeatureUpdate, +} from 'Repositories/team/TeamFeatureConfigChangeDetector/TeamFeatureConfigChangeDetector'; +import {TeamRepository} from 'Repositories/team/TeamRepository'; +import {UserRepository} from 'Repositories/user/UserRepository'; +import {UserState} from 'Repositories/user/UserState'; import {Logger, getLogger} from 'Util/Logger'; import {TIME_IN_MILLIS} from 'Util/TimeUtil'; @@ -35,13 +42,6 @@ import {SelfService} from './SelfService'; import {evaluateSelfSupportedProtocols} from './SelfSupportedProtocols/SelfSupportedProtocols'; import {Core} from '../../service/CoreSingleton'; -import { - FeatureUpdateType, - detectTeamFeatureUpdate, -} from '../../team/TeamFeatureConfigChangeDetector/TeamFeatureConfigChangeDetector'; -import {TeamRepository} from '../../team/TeamRepository'; -import {UserRepository} from '../../user/UserRepository'; -import {UserState} from '../../user/UserState'; type Events = {selfSupportedProtocolsUpdated: ConversationProtocol[]}; diff --git a/src/script/team/TeamEntity.test.ts b/src/script/repositories/team/TeamEntity.test.ts similarity index 100% rename from src/script/team/TeamEntity.test.ts rename to src/script/repositories/team/TeamEntity.test.ts diff --git a/src/script/team/TeamEntity.ts b/src/script/repositories/team/TeamEntity.ts similarity index 96% rename from src/script/team/TeamEntity.ts rename to src/script/repositories/team/TeamEntity.ts index 22dde9cecc2..4e4d2bf856b 100644 --- a/src/script/team/TeamEntity.ts +++ b/src/script/repositories/team/TeamEntity.ts @@ -20,8 +20,7 @@ import ko from 'knockout'; import {AssetRemoteData} from 'Repositories/assets/AssetRemoteData'; - -import {assetV3} from '../util/ValidationUtil'; +import {assetV3} from 'Util/ValidationUtil'; export class TeamEntity { creator?: string; diff --git a/src/script/team/TeamFeatureConfigChangeDetector/TeamFeatureConfigChangeDetector.test.ts b/src/script/repositories/team/TeamFeatureConfigChangeDetector/TeamFeatureConfigChangeDetector.test.ts similarity index 100% rename from src/script/team/TeamFeatureConfigChangeDetector/TeamFeatureConfigChangeDetector.test.ts rename to src/script/repositories/team/TeamFeatureConfigChangeDetector/TeamFeatureConfigChangeDetector.test.ts diff --git a/src/script/team/TeamFeatureConfigChangeDetector/TeamFeatureConfigChangeDetector.ts b/src/script/repositories/team/TeamFeatureConfigChangeDetector/TeamFeatureConfigChangeDetector.ts similarity index 100% rename from src/script/team/TeamFeatureConfigChangeDetector/TeamFeatureConfigChangeDetector.ts rename to src/script/repositories/team/TeamFeatureConfigChangeDetector/TeamFeatureConfigChangeDetector.ts diff --git a/src/script/team/TeamMapper.ts b/src/script/repositories/team/TeamMapper.ts similarity index 100% rename from src/script/team/TeamMapper.ts rename to src/script/repositories/team/TeamMapper.ts diff --git a/src/script/team/TeamMemberEntity.ts b/src/script/repositories/team/TeamMemberEntity.ts similarity index 100% rename from src/script/team/TeamMemberEntity.ts rename to src/script/repositories/team/TeamMemberEntity.ts diff --git a/src/script/team/TeamRepository.test.ts b/src/script/repositories/team/TeamRepository.test.ts similarity index 96% rename from src/script/team/TeamRepository.test.ts rename to src/script/repositories/team/TeamRepository.test.ts index faec361d58b..27767ae193a 100644 --- a/src/script/team/TeamRepository.test.ts +++ b/src/script/repositories/team/TeamRepository.test.ts @@ -23,17 +23,16 @@ import {FeatureList, FeatureStatus} from '@wireapp/api-client/lib/team/feature/' import {randomUUID} from 'crypto'; import {AssetRepository} from 'Repositories/assets/AssetRepository'; +import {ROLE} from 'Repositories/user/UserPermission'; +import {UserRepository} from 'Repositories/user/UserRepository'; +import {UserState} from 'Repositories/user/UserState'; import {User} from 'src/script/entity/User'; -import {TeamRepository} from 'src/script/team/TeamRepository'; -import {TeamState} from 'src/script/team/TeamState'; -import {UserState} from 'src/script/user/UserState'; import {TeamEntity} from './TeamEntity'; import {TeamMemberEntity} from './TeamMemberEntity'; +import {TeamRepository} from './TeamRepository'; import {TeamService} from './TeamService'; - -import {ROLE} from '../user/UserPermission'; -import {UserRepository} from '../user/UserRepository'; +import {TeamState} from './TeamState'; function buildConnectionRepository() { const team = new TeamEntity(randomUUID()); diff --git a/src/script/team/TeamRepository.ts b/src/script/repositories/team/TeamRepository.ts similarity index 98% rename from src/script/team/TeamRepository.ts rename to src/script/repositories/team/TeamRepository.ts index 2d37227e7fa..4b160e7595e 100644 --- a/src/script/team/TeamRepository.ts +++ b/src/script/repositories/team/TeamRepository.ts @@ -42,6 +42,9 @@ import {EventSource} from 'Repositories/event/EventSource'; import {NOTIFICATION_HANDLING_STATE} from 'Repositories/event/NotificationHandlingState'; import {IntegrationMapper} from 'Repositories/integration/IntegrationMapper'; import {ServiceEntity} from 'Repositories/integration/ServiceEntity'; +import {ROLE, ROLE as TEAM_ROLE, roleFromTeamPermissions} from 'Repositories/user/UserPermission'; +import {UserRepository} from 'Repositories/user/UserRepository'; +import {UserState} from 'Repositories/user/UserState'; import {Environment} from 'Util/Environment'; import {t} from 'Util/LocalizerUtil'; import {getLogger, Logger} from 'Util/Logger'; @@ -54,11 +57,8 @@ import {TeamMemberEntity} from './TeamMemberEntity'; import {TeamService} from './TeamService'; import {TeamState} from './TeamState'; -import {User} from '../entity/User'; -import {MLSMigrationStatus, getMLSMigrationStatus} from '../mls/MLSMigration/migrationStatus'; -import {ROLE, ROLE as TEAM_ROLE, roleFromTeamPermissions} from '../user/UserPermission'; -import {UserRepository} from '../user/UserRepository'; -import {UserState} from '../user/UserState'; +import {User} from '../../entity/User'; +import {MLSMigrationStatus, getMLSMigrationStatus} from '../../mls/MLSMigration/migrationStatus'; export interface AccountInfo { accentID: number; diff --git a/src/script/team/TeamService.ts b/src/script/repositories/team/TeamService.ts similarity index 98% rename from src/script/team/TeamService.ts rename to src/script/repositories/team/TeamService.ts index 77c1bf99ada..85cd76e4f5c 100644 --- a/src/script/team/TeamService.ts +++ b/src/script/repositories/team/TeamService.ts @@ -26,7 +26,7 @@ import type {Services} from '@wireapp/api-client/lib/team/service/'; import type {TeamData} from '@wireapp/api-client/lib/team/team/'; import {container} from 'tsyringe'; -import {APIClient} from '../service/APIClientSingleton'; +import {APIClient} from '../../service/APIClientSingleton'; export class TeamService { constructor(private readonly apiClient = container.resolve(APIClient)) {} diff --git a/src/script/team/TeamState.ts b/src/script/repositories/team/TeamState.ts similarity index 96% rename from src/script/team/TeamState.ts rename to src/script/repositories/team/TeamState.ts index f2293502164..457ddf768c3 100644 --- a/src/script/team/TeamState.ts +++ b/src/script/repositories/team/TeamState.ts @@ -21,14 +21,14 @@ import {FeatureList, FeatureStatus, SelfDeletingTimeout} from '@wireapp/api-clie import ko from 'knockout'; import {container, singleton} from 'tsyringe'; +import {ROLE} from 'Repositories/user/UserPermission'; +import {UserState} from 'Repositories/user/UserState'; import {sortUsersByPriority} from 'Util/StringUtil'; import {TeamEntity} from './TeamEntity'; -import {Conversation} from '../entity/Conversation'; -import {User} from '../entity/User'; -import {ROLE} from '../user/UserPermission'; -import {UserState} from '../user/UserState'; +import {Conversation} from '../../entity/Conversation'; +import {User} from '../../entity/User'; @singleton() export class TeamState { diff --git a/src/script/repositories/tracking/EventTrackingRepository.ts b/src/script/repositories/tracking/EventTrackingRepository.ts index 75b8570be68..17b6e81930f 100644 --- a/src/script/repositories/tracking/EventTrackingRepository.ts +++ b/src/script/repositories/tracking/EventTrackingRepository.ts @@ -24,6 +24,7 @@ import {WebAppEvents} from '@wireapp/webapp-events'; import type {ContributedSegmentations, MessageRepository} from 'Repositories/conversation/MessageRepository'; import {ClientEvent} from 'Repositories/event/Client'; +import {TeamState} from 'Repositories/team/TeamState'; import {getLogger, Logger} from 'Util/Logger'; import {loadValue, storeValue, resetStoreValue} from 'Util/StorageUtil'; import {includesString} from 'Util/StringUtil'; @@ -42,7 +43,6 @@ import {UserData} from './UserData'; import {URLParameter} from '../../auth/URLParameter'; import {Config} from '../../Config'; -import {TeamState} from '../../team/TeamState'; const CountlyConsentFeatures = [ 'sessions', diff --git a/src/script/user/AppLockRepository.ts b/src/script/repositories/user/AppLockRepository.ts similarity index 100% rename from src/script/user/AppLockRepository.ts rename to src/script/repositories/user/AppLockRepository.ts diff --git a/src/script/user/AppLockState.ts b/src/script/repositories/user/AppLockState.ts similarity index 97% rename from src/script/user/AppLockState.ts rename to src/script/repositories/user/AppLockState.ts index 4149e6aa8fb..b64c09a92c4 100644 --- a/src/script/user/AppLockState.ts +++ b/src/script/repositories/user/AppLockState.ts @@ -21,7 +21,7 @@ import {FeatureStatus} from '@wireapp/api-client/lib/team/feature/'; import ko from 'knockout'; import {container, singleton} from 'tsyringe'; -import {TeamState} from '../team/TeamState'; +import {TeamState} from 'Repositories/team/TeamState'; const defaultEnabled = true; const defaultEnforced = false; diff --git a/src/script/user/AvailabilityMapper.ts b/src/script/repositories/user/AvailabilityMapper.ts similarity index 94% rename from src/script/user/AvailabilityMapper.ts rename to src/script/repositories/user/AvailabilityMapper.ts index f405908a11a..95456fdc14c 100644 --- a/src/script/user/AvailabilityMapper.ts +++ b/src/script/repositories/user/AvailabilityMapper.ts @@ -19,8 +19,8 @@ import {Availability} from '@wireapp/protocol-messaging'; -import {BaseError} from '../error/BaseError'; -import {UserError} from '../error/UserError'; +import {BaseError} from '../../error/BaseError'; +import {UserError} from '../../error/UserError'; const AVAILABILITY_VALUES: Record = { AVAILABLE: 'available', diff --git a/src/script/user/AvailabilityModal.ts b/src/script/repositories/user/AvailabilityModal.ts similarity index 97% rename from src/script/user/AvailabilityModal.ts rename to src/script/repositories/user/AvailabilityModal.ts index c640f242073..e2c034f63fb 100644 --- a/src/script/user/AvailabilityModal.ts +++ b/src/script/repositories/user/AvailabilityModal.ts @@ -19,11 +19,10 @@ import {Availability} from '@wireapp/protocol-messaging'; +import {PrimaryModal} from 'Components/Modals/PrimaryModal'; import {t} from 'Util/LocalizerUtil'; import {loadValue, storeValue} from 'Util/StorageUtil'; -import {PrimaryModal} from '../components/Modals/PrimaryModal'; - const initialKey = 'hide_initial_modal'; function showModal(storageKey: string, title: string, message: string): void { diff --git a/src/script/user/ConsentValue.ts b/src/script/repositories/user/ConsentValue.ts similarity index 100% rename from src/script/user/ConsentValue.ts rename to src/script/repositories/user/ConsentValue.ts diff --git a/src/script/user/RichProfileRepository.ts b/src/script/repositories/user/RichProfileRepository.ts similarity index 94% rename from src/script/user/RichProfileRepository.ts rename to src/script/repositories/user/RichProfileRepository.ts index 8c4fbfe7245..f090423a476 100644 --- a/src/script/user/RichProfileRepository.ts +++ b/src/script/repositories/user/RichProfileRepository.ts @@ -20,7 +20,7 @@ import type {RichInfo} from '@wireapp/api-client/lib/user/'; import {container, singleton} from 'tsyringe'; -import {APIClient} from '../service/APIClientSingleton'; +import {APIClient} from '../../service/APIClientSingleton'; @singleton() export class RichProfileRepository { diff --git a/src/script/user/TypingIndicatorMode.ts b/src/script/repositories/user/TypingIndicatorMode.ts similarity index 100% rename from src/script/user/TypingIndicatorMode.ts rename to src/script/repositories/user/TypingIndicatorMode.ts diff --git a/src/script/user/UserFilter.ts b/src/script/repositories/user/UserFilter.ts similarity index 91% rename from src/script/user/UserFilter.ts rename to src/script/repositories/user/UserFilter.ts index 20d726458dd..d1391e14c34 100644 --- a/src/script/user/UserFilter.ts +++ b/src/script/repositories/user/UserFilter.ts @@ -21,8 +21,8 @@ import {QualifiedId} from '@wireapp/api-client/lib/user'; import {matchQualifiedIds} from 'Util/QualifiedId'; -import {Conversation} from '../entity/Conversation'; -import {User} from '../entity/User'; +import {Conversation} from '../../entity/Conversation'; +import {User} from '../../entity/User'; export class UserFilter { static isParticipant(conversationEntity: Conversation, userId: QualifiedId) { diff --git a/src/script/user/UserGuards.ts b/src/script/repositories/user/UserGuards.ts similarity index 100% rename from src/script/user/UserGuards.ts rename to src/script/repositories/user/UserGuards.ts diff --git a/src/script/user/UserHandleGenerator.ts b/src/script/repositories/user/UserHandleGenerator.ts similarity index 100% rename from src/script/user/UserHandleGenerator.ts rename to src/script/repositories/user/UserHandleGenerator.ts diff --git a/src/script/user/UserMapper.test.ts b/src/script/repositories/user/UserMapper.test.ts similarity index 100% rename from src/script/user/UserMapper.test.ts rename to src/script/repositories/user/UserMapper.test.ts diff --git a/src/script/user/UserMapper.ts b/src/script/repositories/user/UserMapper.ts similarity index 97% rename from src/script/user/UserMapper.ts rename to src/script/repositories/user/UserMapper.ts index 95b9b06d0de..e70335e5f8d 100644 --- a/src/script/user/UserMapper.ts +++ b/src/script/repositories/user/UserMapper.ts @@ -23,9 +23,9 @@ import {getLogger, Logger} from 'Util/Logger'; import {isSelfAPIUser} from './UserGuards'; -import {User} from '../entity/User'; -import type {ServerTimeHandler} from '../time/serverTimeHandler'; -import '../view_model/bindings/CommonBindings'; +import {User} from '../../entity/User'; +import type {ServerTimeHandler} from '../../time/serverTimeHandler'; +import '../../view_model/bindings/CommonBindings'; export class UserMapper { private readonly logger: Logger; diff --git a/src/script/user/UserPermission.ts b/src/script/repositories/user/UserPermission.ts similarity index 99% rename from src/script/user/UserPermission.ts rename to src/script/repositories/user/UserPermission.ts index f8cc5d82a9d..f8708b53a87 100644 --- a/src/script/user/UserPermission.ts +++ b/src/script/repositories/user/UserPermission.ts @@ -21,7 +21,7 @@ import type {PermissionsData} from '@wireapp/api-client/lib/team/member/Permissi import {capitalizeFirstChar} from 'Util/StringUtil'; -import {TeamError} from '../error/TeamError'; +import {TeamError} from '../../error/TeamError'; /** * Enum for various team permissions. diff --git a/src/script/user/UserRepository.test.ts b/src/script/repositories/user/UserRepository.test.ts similarity index 99% rename from src/script/user/UserRepository.test.ts rename to src/script/repositories/user/UserRepository.test.ts index d87ec8c2245..e1c7d2c78d0 100644 --- a/src/script/user/UserRepository.test.ts +++ b/src/script/repositories/user/UserRepository.test.ts @@ -35,6 +35,7 @@ import {ConnectionEntity} from 'Repositories/connection/ConnectionEntity'; import {EventRepository} from 'Repositories/event/EventRepository'; import {PropertiesRepository} from 'Repositories/properties/PropertiesRepository'; import {SelfService} from 'Repositories/self/SelfService'; +import {TeamState} from 'Repositories/team/TeamState'; import {entities} from 'test/api/payloads'; import {TestFactory} from 'test/helper/TestFactory'; import {generateAPIUser} from 'test/helper/UserGenerator'; @@ -45,9 +46,8 @@ import {UserRepository} from './UserRepository'; import {UserService} from './UserService'; import {UserState} from './UserState'; -import {User} from '../entity/User'; -import {TeamState} from '../team/TeamState'; -import {serverTimeHandler} from '../time/serverTimeHandler'; +import {User} from '../../entity/User'; +import {serverTimeHandler} from '../../time/serverTimeHandler'; const testFactory = new TestFactory(); async function buildUserRepository() { diff --git a/src/script/user/UserRepository.ts b/src/script/repositories/user/UserRepository.ts similarity index 99% rename from src/script/user/UserRepository.ts rename to src/script/repositories/user/UserRepository.ts index f2f36928381..92332b26441 100644 --- a/src/script/user/UserRepository.ts +++ b/src/script/repositories/user/UserRepository.ts @@ -59,6 +59,7 @@ import type {PropertiesRepository} from 'Repositories/properties/PropertiesRepos import {PROPERTIES_TYPE} from 'Repositories/properties/PropertiesType'; import type {SelfService} from 'Repositories/self/SelfService'; import {UserRecord} from 'Repositories/storage'; +import {TeamState} from 'Repositories/team/TeamState'; import {chunk, partition} from 'Util/ArrayUtil'; import {t} from 'Util/LocalizerUtil'; import {getLogger, Logger} from 'Util/Logger'; @@ -72,13 +73,12 @@ import {UserMapper} from './UserMapper'; import type {UserService} from './UserService'; import {UserState} from './UserState'; -import {SIGN_OUT_REASON} from '../auth/SignOutReason'; -import {Config} from '../Config'; -import {Conversation} from '../entity/Conversation'; -import {User} from '../entity/User'; -import {UserError} from '../error/UserError'; -import {TeamState} from '../team/TeamState'; -import type {ServerTimeHandler} from '../time/serverTimeHandler'; +import {SIGN_OUT_REASON} from '../../auth/SignOutReason'; +import {Config} from '../../Config'; +import {Conversation} from '../../entity/Conversation'; +import {User} from '../../entity/User'; +import {UserError} from '../../error/UserError'; +import type {ServerTimeHandler} from '../../time/serverTimeHandler'; type GetUserOptions = { /** diff --git a/src/script/user/UserService.ts b/src/script/repositories/user/UserService.ts similarity index 97% rename from src/script/user/UserService.ts rename to src/script/repositories/user/UserService.ts index 4ea377d02f7..3883c02a61f 100644 --- a/src/script/user/UserService.ts +++ b/src/script/repositories/user/UserService.ts @@ -23,9 +23,9 @@ import {container} from 'tsyringe'; import {StorageSchemata, StorageService, UserRecord} from 'Repositories/storage'; -import {APIClient} from '../service/APIClientSingleton'; -import {Core} from '../service/CoreSingleton'; -import {constructUserPrimaryKey} from '../util/StorageUtil'; +import {APIClient} from '../../service/APIClientSingleton'; +import {Core} from '../../service/CoreSingleton'; +import {constructUserPrimaryKey} from '../../util/StorageUtil'; export class UserService { private readonly USER_STORE_NAME: string; diff --git a/src/script/user/UserState.ts b/src/script/repositories/user/UserState.ts similarity index 97% rename from src/script/user/UserState.ts rename to src/script/repositories/user/UserState.ts index 84dbbdc260a..29a5b339dc2 100644 --- a/src/script/user/UserState.ts +++ b/src/script/repositories/user/UserState.ts @@ -23,7 +23,7 @@ import {singleton} from 'tsyringe'; import {sortUsersByPriority} from 'Util/StringUtil'; import {TIME_IN_MILLIS} from 'Util/TimeUtil'; -import {User} from '../entity/User'; +import {User} from '../../entity/User'; @singleton() export class UserState { diff --git a/src/script/util/DebugUtil.ts b/src/script/util/DebugUtil.ts index 3eccbf1c56e..c53bf83bd56 100644 --- a/src/script/util/DebugUtil.ts +++ b/src/script/util/DebugUtil.ts @@ -52,7 +52,10 @@ import {EventRepository} from 'Repositories/event/EventRepository'; import {PropertiesRepository} from 'Repositories/properties/PropertiesRepository'; import {PROPERTIES_TYPE} from 'Repositories/properties/PropertiesType'; import {EventRecord, StorageRepository, StorageSchemata} from 'Repositories/storage'; +import {TeamState} from 'Repositories/team/TeamState'; import {disableForcedErrorReporting} from 'Repositories/tracking/Countly.helpers'; +import {UserRepository} from 'Repositories/user/UserRepository'; +import {UserState} from 'Repositories/user/UserState'; import {getLogger, Logger} from 'Util/Logger'; import {KEY} from './KeyboardUtil'; @@ -65,9 +68,6 @@ import {User} from '../entity/User'; import {checkVersion} from '../lifecycle/newVersionHandler'; import {APIClient} from '../service/APIClientSingleton'; import {Core} from '../service/CoreSingleton'; -import {TeamState} from '../team/TeamState'; -import {UserRepository} from '../user/UserRepository'; -import {UserState} from '../user/UserState'; import {ViewModelRepositories} from '../view_model/MainViewModel'; export class DebugUtil { diff --git a/src/script/util/wrapper.ts b/src/script/util/wrapper.ts index f68a8380482..681fa66d1c6 100644 --- a/src/script/util/wrapper.ts +++ b/src/script/util/wrapper.ts @@ -22,9 +22,9 @@ import {amplify} from 'amplify'; import {Runtime} from '@wireapp/commons'; import {WebAppEvents} from '@wireapp/webapp-events'; -import {Environment} from './Environment'; +import {ROLE} from 'Repositories/user/UserPermission'; -import {ROLE} from '../user/UserPermission'; +import {Environment} from './Environment'; export function exposeWrapperGlobals(): void { if (Runtime.isDesktopApp()) { diff --git a/src/script/view_model/ActionsViewModel.ts b/src/script/view_model/ActionsViewModel.ts index 9246b76c8d1..713b7925357 100644 --- a/src/script/view_model/ActionsViewModel.ts +++ b/src/script/view_model/ActionsViewModel.ts @@ -34,6 +34,7 @@ import {NOTIFICATION_STATE} from 'Repositories/conversation/NotificationSetting' import type {IntegrationRepository} from 'Repositories/integration/IntegrationRepository'; import type {ServiceEntity} from 'Repositories/integration/ServiceEntity'; import {SelfRepository} from 'Repositories/self/SelfRepository'; +import {UserState} from 'Repositories/user/UserState'; import {t} from 'Util/LocalizerUtil'; import {isBackendError} from 'Util/TypePredicateUtil'; @@ -42,7 +43,6 @@ import type {MainViewModel} from './MainViewModel'; import type {Conversation} from '../entity/Conversation'; import type {Message} from '../entity/message/Message'; import type {User} from '../entity/User'; -import {UserState} from '../user/UserState'; export class ActionsViewModel { constructor( diff --git a/src/script/view_model/CallingViewModel.ts b/src/script/view_model/CallingViewModel.ts index 8c26dbcc635..5c132b6f90d 100644 --- a/src/script/view_model/CallingViewModel.ts +++ b/src/script/view_model/CallingViewModel.ts @@ -43,6 +43,9 @@ import type {PermissionRepository} from 'Repositories/permission/PermissionRepos import {PermissionStatusState} from 'Repositories/permission/PermissionStatusState'; import {PropertiesRepository} from 'Repositories/properties/PropertiesRepository'; import {PROPERTIES_TYPE} from 'Repositories/properties/PropertiesType'; +import type {TeamRepository} from 'Repositories/team/TeamRepository'; +import {TeamState} from 'Repositories/team/TeamState'; +import {ROLE} from 'Repositories/user/UserPermission'; import {replaceLink, t} from 'Util/LocalizerUtil'; import {matchQualifiedIds} from 'Util/QualifiedId'; import {safeWindowOpen} from 'Util/SanitizationUtil'; @@ -50,9 +53,6 @@ import {safeWindowOpen} from 'Util/SanitizationUtil'; import {Config} from '../Config'; import type {Conversation} from '../entity/Conversation'; import type {User} from '../entity/User'; -import type {TeamRepository} from '../team/TeamRepository'; -import {TeamState} from '../team/TeamState'; -import {ROLE} from '../user/UserPermission'; export interface CallActions { answer: (call: Call) => Promise; diff --git a/src/script/view_model/ContentViewModel.ts b/src/script/view_model/ContentViewModel.ts index 589008753b7..b14a9c93005 100644 --- a/src/script/view_model/ContentViewModel.ts +++ b/src/script/view_model/ContentViewModel.ts @@ -29,6 +29,8 @@ import {PrimaryModal} from 'Components/Modals/PrimaryModal'; import type {ConversationRepository} from 'Repositories/conversation/ConversationRepository'; import {ConversationState} from 'Repositories/conversation/ConversationState'; import {MessageRepository} from 'Repositories/conversation/MessageRepository'; +import type {UserRepository} from 'Repositories/user/UserRepository'; +import {UserState} from 'Repositories/user/UserState'; import {t} from 'Util/LocalizerUtil'; import {getLogger, Logger} from 'Util/Logger'; import {isConversationEntity} from 'Util/TypePredicateUtil'; @@ -47,8 +49,6 @@ import {useAppMainState} from '../page/state'; import {ContentState, useAppState} from '../page/useAppState'; import {generateConversationUrl} from '../router/routeGenerator'; import {navigate, setHistoryParam} from '../router/Router'; -import type {UserRepository} from '../user/UserRepository'; -import {UserState} from '../user/UserState'; interface ShowConversationOptions { exposeMessage?: Message; diff --git a/src/script/view_model/ListViewModel.ts b/src/script/view_model/ListViewModel.ts index 9083612c770..61a0df9d85d 100644 --- a/src/script/view_model/ListViewModel.ts +++ b/src/script/view_model/ListViewModel.ts @@ -30,6 +30,9 @@ import type {ConversationRepository} from 'Repositories/conversation/Conversatio import {ConversationState} from 'Repositories/conversation/ConversationState'; import {PropertiesRepository} from 'Repositories/properties/PropertiesRepository'; import {SearchRepository} from 'Repositories/search/SearchRepository'; +import type {TeamRepository} from 'Repositories/team/TeamRepository'; +import {TeamState} from 'Repositories/team/TeamState'; +import {UserState} from 'Repositories/user/UserState'; import {iterateItem} from 'Util/ArrayUtil'; import {isEscapeKey} from 'Util/KeyboardUtil'; import {t} from 'Util/LocalizerUtil'; @@ -45,13 +48,10 @@ import {SidebarTabs, useSidebarStore} from '../page/LeftSidebar/panels/Conversat import {PanelState} from '../page/RightSidebar'; import {useAppMainState} from '../page/state'; import {ContentState, ListState, useAppState} from '../page/useAppState'; -import type {TeamRepository} from '../team/TeamRepository'; -import {TeamState} from '../team/TeamState'; import {showContextMenu} from '../ui/ContextMenu'; import {showLabelContextMenu} from '../ui/LabelContextMenu'; import {Shortcut} from '../ui/Shortcut'; import {ShortcutType} from '../ui/ShortcutType'; -import {UserState} from '../user/UserState'; export class ListViewModel { private readonly userState: UserState; diff --git a/src/script/view_model/MainViewModel.ts b/src/script/view_model/MainViewModel.ts index 1067e538ec6..2e5fb0d7245 100644 --- a/src/script/view_model/MainViewModel.ts +++ b/src/script/view_model/MainViewModel.ts @@ -39,7 +39,10 @@ import type {PropertiesRepository} from 'Repositories/properties/PropertiesRepos import type {SearchRepository} from 'Repositories/search/SearchRepository'; import type {SelfRepository} from 'Repositories/self/SelfRepository'; import type {StorageRepository} from 'Repositories/storage'; +import type {TeamRepository} from 'Repositories/team/TeamRepository'; import type {EventTrackingRepository} from 'Repositories/tracking/EventTrackingRepository'; +import type {UserRepository} from 'Repositories/user/UserRepository'; +import {UserState} from 'Repositories/user/UserState'; import {ActionsViewModel} from './ActionsViewModel'; import {CallingViewModel} from './CallingViewModel'; @@ -47,10 +50,7 @@ import {ContentViewModel} from './ContentViewModel'; import {ListViewModel} from './ListViewModel'; import {Core} from '../service/CoreSingleton'; -import type {TeamRepository} from '../team/TeamRepository'; import type {ServerTimeHandler} from '../time/serverTimeHandler'; -import type {UserRepository} from '../user/UserRepository'; -import {UserState} from '../user/UserState'; export interface ViewModelRepositories { asset: AssetRepository; diff --git a/test/helper/TestFactory.js b/test/helper/TestFactory.js index d490828f50a..bd33a9c86e2 100644 --- a/test/helper/TestFactory.js +++ b/test/helper/TestFactory.js @@ -53,17 +53,17 @@ import {SearchRepository} from 'Repositories/search/SearchRepository'; import {SelfService} from 'Repositories/self/SelfService'; import {SelfRepository} from 'Repositories/self/SelfRepository'; import {StorageRepository, StorageService} from 'Repositories/storage'; +import {TeamRepository} from 'Repositories/team/TeamRepository'; +import {TeamService} from 'Repositories/team/TeamService'; +import {TeamState} from 'Repositories/team/TeamState'; import {EventTrackingRepository} from 'Repositories/tracking/EventTrackingRepository'; +import {UserRepository} from 'Repositories/user/UserRepository'; +import {UserService} from 'Repositories/user/UserService'; +import {UserState} from 'Repositories/user/UserState'; import {User} from 'src/script/entity/User'; import {Core} from 'src/script/service/CoreSingleton'; import {createStorageEngine, DatabaseTypes} from 'src/script/service/StoreEngineProvider'; -import {TeamRepository} from 'src/script/team/TeamRepository'; -import {TeamService} from 'src/script/team/TeamService'; -import {TeamState} from 'src/script/team/TeamState'; import {serverTimeHandler} from 'src/script/time/serverTimeHandler'; -import {UserRepository} from 'src/script/user/UserRepository'; -import {UserService} from 'src/script/user/UserService'; -import {UserState} from 'src/script/user/UserState'; import {entities} from '../api/payloads'; diff --git a/test/helper/UserGenerator.ts b/test/helper/UserGenerator.ts index 71b04123ffa..d8c3ba6b03b 100644 --- a/test/helper/UserGenerator.ts +++ b/test/helper/UserGenerator.ts @@ -21,11 +21,11 @@ import {faker} from '@faker-js/faker'; import {QualifiedId, UserAssetType} from '@wireapp/api-client/lib/user'; import type {User as APIClientUser} from '@wireapp/api-client/lib/user'; +import {UserMapper} from 'Repositories/user/UserMapper'; import {createUuid} from 'Util/uuid'; import type {User} from '../../src/script/entity/User'; import {serverTimeHandler} from '../../src/script/time/serverTimeHandler'; -import {UserMapper} from '../../src/script/user/UserMapper'; export function generateQualifiedId(): QualifiedId { return { diff --git a/test/unit_tests/user/RichProfileRepositorySpec.js b/test/unit_tests/user/RichProfileRepositorySpec.js index d20bd621e59..09f8ea008b1 100644 --- a/test/unit_tests/user/RichProfileRepositorySpec.js +++ b/test/unit_tests/user/RichProfileRepositorySpec.js @@ -17,7 +17,7 @@ * */ -import {RichProfileRepository} from 'src/script/user/RichProfileRepository'; +import {RichProfileRepository} from 'Repositories/user/RichProfileRepository'; import {createUuid} from 'Util/uuid'; describe('RichProfileRepository', () => { diff --git a/test/unit_tests/user/UserHandleGeneratorSpec.js b/test/unit_tests/user/UserHandleGeneratorSpec.js index 4407fb34df0..e54d7b50d04 100644 --- a/test/unit_tests/user/UserHandleGeneratorSpec.js +++ b/test/unit_tests/user/UserHandleGeneratorSpec.js @@ -24,7 +24,7 @@ import { generateHandleVariations, appendRandomDigits, createSuggestions, -} from 'src/script/user/UserHandleGenerator'; +} from 'Repositories/user/UserHandleGenerator'; describe('UserHandleGenerator', () => { describe('generate_handle_variations', () => { diff --git a/test/unit_tests/user/UserPermissionSpec.js b/test/unit_tests/user/UserPermissionSpec.js index aa8ce643ac8..77ad1ab6953 100644 --- a/test/unit_tests/user/UserPermissionSpec.js +++ b/test/unit_tests/user/UserPermissionSpec.js @@ -23,7 +23,7 @@ import { roleFromTeamPermissions, hasAccessToFeature, generatePermissionHelpers, -} from 'src/script/user/UserPermission'; +} from 'Repositories/user/UserPermission'; const partnerPermissionBitmask = 0b10000000001; const memberPermissionBitmask = 0b11000110011;