Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Improve repositories folder structure #18235

Open
wants to merge 13 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
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
  • Loading branch information
przemvs authored Oct 30, 2024
commit 32166c5862856ae87115fba3cddb6b3c0d65a0cd
2 changes: 1 addition & 1 deletion .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
# Components
'comp: calling':
files:
- 'src/script/calling/.*'
- 'src/script/repositories/calling/.*'
'comp: preferences':
files:
- 'src/script/properties/.*'
Expand Down
2 changes: 1 addition & 1 deletion src/script/components/Conversation/Conversation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
4 changes: 2 additions & 2 deletions src/script/components/TitleBar/TitleBar.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion src/script/components/TitleBar/TitleBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
10 changes: 5 additions & 5 deletions src/script/components/calling/CallingCell/CallingCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
12 changes: 6 additions & 6 deletions src/script/components/calling/CallingOverlayContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
2 changes: 1 addition & 1 deletion src/script/components/calling/ChooseScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
10 changes: 5 additions & 5 deletions src/script/components/calling/FullscreenVideoCall.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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';
Expand Down
3 changes: 2 additions & 1 deletion src/script/components/calling/GroupVideoGrid.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = (
Expand Down
5 changes: 2 additions & 3 deletions src/script/components/calling/GroupVideoGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions src/script/components/calling/GroupVideoGridTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/script/components/calling/chooseScreen.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
6 changes: 3 additions & 3 deletions src/script/components/calling/fullscreenVideoCall.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion src/script/conversation/ConversationRepository.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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';
Expand Down
4 changes: 2 additions & 2 deletions src/script/conversation/ConversationRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion src/script/conversation/EventMapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion src/script/cryptography/CryptographyMapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion src/script/entity/message/CallMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
4 changes: 2 additions & 2 deletions src/script/event/CallingEvent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading
Loading