quickblox-react-ui-kit 0.3.0-beta.2 → 0.3.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Data/Stubs.d.ts +1 -1
- package/dist/Data/dto/file/RemoteFileDTO.d.ts +1 -1
- package/dist/Data/dto/message/RemoteMessageDTO.d.ts +1 -1
- package/dist/Data/dto/user/LocalUserDTO.d.ts +1 -1
- package/dist/Data/dto/user/RemoteUserDTO.d.ts +2 -2
- package/dist/Data/repository/DialogsRepository.d.ts +1 -0
- package/dist/Data/source/remote/IRemoteDataSource.d.ts +1 -0
- package/dist/Data/source/remote/RemoteDataSource.d.ts +2 -0
- package/dist/Domain/entity/DialogEventInfo.d.ts +4 -0
- package/dist/Domain/entity/FileEntity.d.ts +1 -1
- package/dist/Domain/entity/UserEntity.d.ts +1 -1
- package/dist/Domain/use_cases/GetAllMessagesForDialog.d.ts +3 -3
- package/dist/Domain/use_cases/UpdateCurrentDialogInDataSourceUseCase.d.ts +10 -0
- package/dist/Presentation/Views/Dialog/AIComponents/AIAssist/AIAssist.d.ts +2 -1
- package/dist/Presentation/Views/Dialog/AIComponents/AITranslate/AITranslate.d.ts +2 -1
- package/dist/Presentation/Views/Dialog/AIWidgets/AIRephraseWidget/AIRephraseWidget.d.ts +1 -0
- package/dist/Presentation/Views/Dialog/DialogViewModel.d.ts +2 -0
- package/dist/Presentation/Views/Dialog/ForwardMessageFlow/ForwardMessageFlow.d.ts +1 -0
- package/dist/Presentation/Views/Dialog/ForwardMessageFlow/InputForForwarding/InputForForwarding.d.ts +2 -2
- package/dist/Presentation/Views/Dialog/MessageContextMenu/MessageContextMenu.d.ts +2 -1
- package/dist/Presentation/Views/Dialog/MessageItem/MessageItem.d.ts +3 -2
- package/dist/Presentation/Views/DialogInfo/DialogInfo.d.ts +1 -0
- package/dist/Presentation/Views/DialogList/DialogList.d.ts +1 -0
- package/dist/Presentation/Views/EditDialog/EditDialog.d.ts +2 -1
- package/dist/Presentation/Views/Flow/CreateDialogFlow/CreateNewDialogFlow.d.ts +1 -0
- package/dist/Presentation/Views/PreviewDialog/PreviewDialog.d.ts +1 -0
- package/dist/Presentation/providers/QuickBloxUIKitProvider/useQBConnection.d.ts +1 -0
- package/dist/Presentation/ui-components/DialogWindow/DialogWindow.d.ts +3 -2
- package/dist/Presentation/ui-components/Dropdown/DropdownOption.d.ts +2 -1
- package/dist/Presentation/ui-components/MessageInput/AttachmentUploader/AttachmentUploader.d.ts +1 -0
- package/dist/Presentation/ui-components/MessageInput/MessageInput.d.ts +1 -0
- package/dist/Presentation/ui-components/MessageInput/MessageInput.stories.d.ts +4 -4
- package/dist/index-ui.js +1054 -771
- package/dist/index-ui.js.map +1 -1
- package/dist/qb-api-calls/index.d.ts +9 -7
- package/global.d.ts +2513 -546
- package/package.json +1 -1
- package/src/App.scss +3 -0
- package/src/App.tsx +1 -1
- package/src/Data/Creator.ts +1 -2
- package/src/Data/DefaultConfigurations.ts +4 -4
- package/src/Data/Stubs.ts +4 -5
- package/src/Data/dto/file/RemoteFileDTO.ts +2 -2
- package/src/Data/dto/message/RemoteMessageDTO.ts +1 -1
- package/src/Data/dto/user/LocalUserDTO.ts +2 -2
- package/src/Data/dto/user/RemoteUserDTO.ts +4 -4
- package/src/Data/mapper/FileRemoteDTOMapper.ts +8 -6
- package/src/Data/mapper/MessageRemoteDTOMapper.ts +1 -1
- package/src/Data/mapper/UserLocalDTOMapper.ts +2 -2
- package/src/Data/mapper/UserRemoteDTOMapper.ts +2 -2
- package/src/Data/repository/DialogsRepository.ts +16 -0
- package/src/Data/repository/MessagesRepository.ts +2 -2
- package/src/Data/repository/UsersRepository.ts +1 -1
- package/src/Data/source/remote/IRemoteDataSource.ts +2 -0
- package/src/Data/source/remote/Mapper/FileDTOMapper.ts +23 -23
- package/src/Data/source/remote/Mapper/MessageDTOMapper.ts +2 -2
- package/src/Data/source/remote/Mapper/UserDTOMapper.ts +0 -2
- package/src/Data/source/remote/RemoteDataSource.ts +136 -15
- package/src/Domain/entity/DialogEventInfo.ts +4 -0
- package/src/Domain/entity/FileEntity.ts +1 -1
- package/src/Domain/entity/UserEntity.ts +1 -11
- package/src/Domain/use_cases/GetAllMessagesForDialog.ts +3 -3
- package/src/Domain/use_cases/GetDialogByIdUseCase.ts +5 -1
- package/src/Domain/use_cases/UpdateCurrentDialogInDataSourceUseCase.ts +31 -0
- package/src/Domain/use_cases/UpdateDialogUseCase.ts +6 -1
- package/src/Domain/use_cases/base/Subscribable/SubscriptionPerformer.ts +1 -1
- package/src/Presentation/Views/Dialog/AIComponents/AIAssist/AIAssist.scss +5 -0
- package/src/Presentation/Views/Dialog/AIComponents/AIAssist/AIAssist.tsx +9 -2
- package/src/Presentation/Views/Dialog/AIComponents/AITranslate/AITranslate.scss +10 -0
- package/src/Presentation/Views/Dialog/AIComponents/AITranslate/AITranslate.tsx +16 -7
- package/src/Presentation/Views/Dialog/AIWidgets/AIRephraseWidget/AIRephraseWidget.scss +7 -2
- package/src/Presentation/Views/Dialog/AIWidgets/AIRephraseWidget/AIRephraseWidget.tsx +12 -3
- package/src/Presentation/Views/Dialog/DialogViewModel.ts +2 -0
- package/src/Presentation/Views/Dialog/ForwardMessageFlow/DialogsWithSearch/DialogListItem/DialogListItem.scss +1 -1
- package/src/Presentation/Views/Dialog/ForwardMessageFlow/DialogsWithSearch/DialogsWithSearch.scss +10 -0
- package/src/Presentation/Views/Dialog/ForwardMessageFlow/DialogsWithSearch/DialogsWithSearch.tsx +12 -13
- package/src/Presentation/Views/Dialog/ForwardMessageFlow/ForwardMessageFlow.tsx +9 -5
- package/src/Presentation/Views/Dialog/ForwardMessageFlow/InputForForwarding/InputForForwarding.scss +31 -1
- package/src/Presentation/Views/Dialog/ForwardMessageFlow/InputForForwarding/InputForForwarding.tsx +7 -7
- package/src/Presentation/Views/Dialog/MessageContextMenu/MessageContextMenu.tsx +17 -6
- package/src/Presentation/Views/Dialog/MessageItem/MessageItem.tsx +23 -9
- package/src/Presentation/Views/Dialog/useDialogViewModel.ts +65 -32
- package/src/Presentation/Views/DialogInfo/DialogInfo.scss +14 -12
- package/src/Presentation/Views/DialogInfo/DialogInfo.tsx +36 -18
- package/src/Presentation/Views/DialogInfo/MembersList/MembersList.scss +8 -99
- package/src/Presentation/Views/DialogInfo/MembersList/MembersList.tsx +9 -29
- package/src/Presentation/Views/DialogInfo/UsersList/useUsersListViewModel.ts +1 -0
- package/src/Presentation/Views/DialogList/DialogList.scss +5 -0
- package/src/Presentation/Views/DialogList/DialogList.tsx +12 -2
- package/src/Presentation/Views/DialogList/useDialogListViewModel.ts +108 -11
- package/src/Presentation/Views/EditDialog/EditDialog.scss +12 -40
- package/src/Presentation/Views/EditDialog/EditDialog.tsx +18 -15
- package/src/Presentation/Views/Flow/CreateDialogFlow/CreateNewDialogFlow.tsx +14 -0
- package/src/Presentation/Views/InviteMembers/InviteMembers.tsx +14 -15
- package/src/Presentation/Views/InviteMembers/useInviteMembersViewModel.ts +1 -11
- package/src/Presentation/Views/PreviewDialog/PreviewDialog.tsx +4 -0
- package/src/Presentation/layouts/Desktop/DesktopLayout.scss +8 -8
- package/src/Presentation/layouts/Desktop/QuickBloxUIKitDesktopLayout.tsx +218 -141
- package/src/Presentation/providers/QuickBloxUIKitProvider/useQBConnection.ts +16 -0
- package/src/Presentation/ui-components/Avatar/avatar.stories.tsx +1 -1
- package/src/Presentation/ui-components/Badge/Badge.stories.ts +1 -1
- package/src/Presentation/ui-components/Button/Button.stories.ts +1 -1
- package/src/Presentation/ui-components/DialogBanner/DialogBanner.stories.ts +2 -1
- package/src/Presentation/ui-components/DialogItemPreview/DialogItemPreview.stories.tsx +29 -1
- package/src/Presentation/ui-components/DialogItemPreview/DialogItemPreview.tsx +4 -1
- package/src/Presentation/ui-components/DialogWindow/DialogWindow.scss +11 -0
- package/src/Presentation/ui-components/DialogWindow/DialogWindow.stories.tsx +2 -1
- package/src/Presentation/ui-components/DialogWindow/DialogWindow.tsx +4 -1
- package/src/Presentation/ui-components/Dropdown/Dropdown.scss +4 -0
- package/src/Presentation/ui-components/Dropdown/Dropdown.stories.tsx +2 -1
- package/src/Presentation/ui-components/Dropdown/Dropdown.tsx +5 -2
- package/src/Presentation/ui-components/Dropdown/DropdownOption.tsx +9 -1
- package/src/Presentation/ui-components/Header/Header.stories.tsx +2 -1
- package/src/Presentation/ui-components/Loader/Loader.stories.ts +1 -1
- package/src/Presentation/ui-components/Message/Bubble/AttachmentBubble/AttachmentBubble.tsx +6 -1
- package/src/Presentation/ui-components/Message/Bubble/AudioBubble/AudioBubble.scss +13 -0
- package/src/Presentation/ui-components/Message/Bubble/AudioBubble/AudioBubble.tsx +16 -2
- package/src/Presentation/ui-components/Message/Bubble/VideoBubble/VideoBubble.scss +9 -0
- package/src/Presentation/ui-components/Message/Bubble/VideoBubble/VideoBubble.tsx +15 -17
- package/src/Presentation/ui-components/Message/Message.stories.tsx +80 -1
- package/src/Presentation/ui-components/MessageInput/AttachmentUploader/AttachmentUploader.tsx +3 -0
- package/src/Presentation/ui-components/MessageInput/MessageInput.scss +18 -4
- package/src/Presentation/ui-components/MessageInput/MessageInput.stories.tsx +16 -8
- package/src/Presentation/ui-components/MessageInput/MessageInput.tsx +8 -2
- package/src/Presentation/ui-components/MessageSeparator/MessageSeparator.stories.ts +3 -1
- package/src/Presentation/ui-components/Placeholder/Placeholder.stories.tsx +2 -6
- package/src/Presentation/ui-components/PreviewFileMessage/PreviewFileMessage.stories.ts +12 -1
- package/src/Presentation/ui-components/PreviewFileMessage/PreviewFileMessage.tsx +2 -2
- package/src/Presentation/ui-components/SettingsItem/SettingsItem.stories.tsx +7 -1
- package/src/Presentation/ui-components/TextField/TextField.stories.ts +7 -2
- package/src/Presentation/ui-components/Toast/Toast.stories.tsx +1 -1
- package/src/Presentation/ui-components/UserListItem/UserListItem.stories.tsx +3 -1
- package/src/QBconfig.ts +4 -4
- package/src/index.scss +3 -2
- package/src/qb-api-calls/index.ts +59 -49
- package/storybook-static/433.dffc897e.iframe.bundle.js +1 -0
- package/storybook-static/603.4cf0423b.iframe.bundle.js +1 -0
- package/storybook-static/{758.d99b0166.iframe.bundle.js → 758.53b4954a.iframe.bundle.js} +3 -3
- package/storybook-static/{758.d99b0166.iframe.bundle.js.map → 758.53b4954a.iframe.bundle.js.map} +1 -1
- package/storybook-static/{472.3c9e81e6.iframe.bundle.js → 768.e44c05aa.iframe.bundle.js} +3 -3
- package/storybook-static/{472.3c9e81e6.iframe.bundle.js.map → 768.e44c05aa.iframe.bundle.js.map} +1 -1
- package/storybook-static/{926.f14bb932.iframe.bundle.js → 926.f5308089.iframe.bundle.js} +2 -2
- package/storybook-static/{926.f14bb932.iframe.bundle.js.map → 926.f5308089.iframe.bundle.js.map} +1 -1
- package/storybook-static/Presentation-ui-components-Avatar-avatar-stories.cf806856.iframe.bundle.js +1 -0
- package/storybook-static/Presentation-ui-components-Badge-Badge-stories.9449e470.iframe.bundle.js +14 -0
- package/storybook-static/{Presentation-ui-components-Badge-Badge-stories.fea53429.iframe.bundle.js.map → Presentation-ui-components-Badge-Badge-stories.9449e470.iframe.bundle.js.map} +1 -1
- package/storybook-static/Presentation-ui-components-Button-Button-stories.4fac7996.iframe.bundle.js +1 -0
- package/storybook-static/Presentation-ui-components-DialogBanner-DialogBanner-stories.fa91d2c7.iframe.bundle.js +10 -0
- package/storybook-static/{Presentation-ui-components-DialogBanner-DialogBanner-stories.6b2a3f72.iframe.bundle.js.map → Presentation-ui-components-DialogBanner-DialogBanner-stories.fa91d2c7.iframe.bundle.js.map} +1 -1
- package/storybook-static/Presentation-ui-components-DialogItemPreview-DialogItemPreview-stories.6665bbfb.iframe.bundle.js +1 -0
- package/storybook-static/Presentation-ui-components-DialogWindow-DialogWindow-stories.cf340397.iframe.bundle.js +1 -0
- package/storybook-static/Presentation-ui-components-Dropdown-Dropdown-stories.b32a1e17.iframe.bundle.js +1 -0
- package/storybook-static/Presentation-ui-components-Header-Header-stories.073c4507.iframe.bundle.js +1 -0
- package/storybook-static/Presentation-ui-components-Loader-Loader-stories.9bf3fb63.iframe.bundle.js +1 -0
- package/storybook-static/{Presentation-ui-components-Message-Message-stories.63bec01b.iframe.bundle.js → Presentation-ui-components-Message-Message-stories.343dfae0.iframe.bundle.js} +1 -1
- package/storybook-static/Presentation-ui-components-MessageInput-MessageInput-stories.c2ead6a5.iframe.bundle.js +1 -0
- package/storybook-static/{Presentation-ui-components-MessageSeparator-MessageSeparator-stories.82483823.iframe.bundle.js → Presentation-ui-components-MessageSeparator-MessageSeparator-stories.a7d43c0b.iframe.bundle.js} +3 -3
- package/storybook-static/{Presentation-ui-components-MessageSeparator-MessageSeparator-stories.82483823.iframe.bundle.js.map → Presentation-ui-components-MessageSeparator-MessageSeparator-stories.a7d43c0b.iframe.bundle.js.map} +1 -1
- package/storybook-static/Presentation-ui-components-Placeholder-Placeholder-stories.871f508c.iframe.bundle.js +1 -0
- package/storybook-static/Presentation-ui-components-PreviewFileMessage-PreviewFileMessage-stories.527e000e.iframe.bundle.js +1 -0
- package/storybook-static/Presentation-ui-components-SettingsItem-SettingsItem-stories.2ff75703.iframe.bundle.js +1 -0
- package/storybook-static/Presentation-ui-components-TextField-TextField-stories.4a2eef3e.iframe.bundle.js +1 -0
- package/storybook-static/{Presentation-ui-components-Toast-Toast-stories.e26b2e07.iframe.bundle.js → Presentation-ui-components-Toast-Toast-stories.55e63162.iframe.bundle.js} +1 -1
- package/storybook-static/{Presentation-ui-components-UserListItem-UserListItem-stories.e88f4206.iframe.bundle.js → Presentation-ui-components-UserListItem-UserListItem-stories.04d3eefe.iframe.bundle.js} +1 -1
- package/storybook-static/docs-Introduction-mdx.ac401482.iframe.bundle.js +10 -0
- package/storybook-static/docs-Introduction-mdx.ac401482.iframe.bundle.js.map +1 -0
- package/storybook-static/docs-Styling-mdx.1d6c1212.iframe.bundle.js +10 -0
- package/storybook-static/docs-Styling-mdx.1d6c1212.iframe.bundle.js.map +1 -0
- package/storybook-static/iframe.html +4 -4
- package/storybook-static/index.json +1 -1
- package/storybook-static/main.597d432b.iframe.bundle.js +1 -0
- package/storybook-static/project.json +1 -1
- package/storybook-static/runtime~main.12da9712.iframe.bundle.js +1 -0
- package/storybook-static/static/css/{Presentation-ui-components-DialogItemPreview-DialogItemPreview-stories.e720ff21.chunk.css → Presentation-ui-components-DialogItemPreview-DialogItemPreview-stories.bee082ca.chunk.css} +2 -2
- package/storybook-static/static/css/{Presentation-ui-components-DialogItemPreview-DialogItemPreview-stories.e720ff21.chunk.css.map → Presentation-ui-components-DialogItemPreview-DialogItemPreview-stories.bee082ca.chunk.css.map} +1 -1
- package/storybook-static/static/css/{Presentation-ui-components-DialogWindow-DialogWindow-stories.6fb3af8d.chunk.css → Presentation-ui-components-DialogWindow-DialogWindow-stories.4f813450.chunk.css} +2 -2
- package/storybook-static/static/css/Presentation-ui-components-DialogWindow-DialogWindow-stories.4f813450.chunk.css.map +1 -0
- package/storybook-static/static/css/{Presentation-ui-components-Dropdown-Dropdown-stories.66965d64.chunk.css → Presentation-ui-components-Dropdown-Dropdown-stories.e37f549d.chunk.css} +2 -2
- package/storybook-static/static/css/Presentation-ui-components-Dropdown-Dropdown-stories.e37f549d.chunk.css.map +1 -0
- package/storybook-static/static/css/{Presentation-ui-components-Message-Message-stories.a518b61a.chunk.css → Presentation-ui-components-Message-Message-stories.0e129b10.chunk.css} +3 -3
- package/storybook-static/static/css/{Presentation-ui-components-Message-Message-stories.a518b61a.chunk.css.map → Presentation-ui-components-Message-Message-stories.0e129b10.chunk.css.map} +1 -1
- package/storybook-static/static/css/{Presentation-ui-components-MessageInput-MessageInput-stories.0e99d80b.chunk.css → Presentation-ui-components-MessageInput-MessageInput-stories.7eb916fc.chunk.css} +2 -2
- package/storybook-static/static/css/Presentation-ui-components-MessageInput-MessageInput-stories.7eb916fc.chunk.css.map +1 -0
- package/storybook-static/static/css/{Presentation-ui-components-Placeholder-Placeholder-stories.1ebf88ab.chunk.css → Presentation-ui-components-Placeholder-Placeholder-stories.cb7fb80a.chunk.css} +1 -2
- package/storybook-static/static/css/Presentation-ui-components-Placeholder-Placeholder-stories.cb7fb80a.chunk.css.map +1 -0
- package/storybook-static/static/css/{main.4e852eef.css → main.a921485c.css} +2 -2
- package/storybook-static/static/css/{main.4e852eef.css.map → main.a921485c.css.map} +1 -1
- package/storybook-static/stories.json +1 -1
- package/storybook-static/312.0aa0e670.iframe.bundle.js +0 -1
- package/storybook-static/341.bea6d0bd.iframe.bundle.js +0 -1
- package/storybook-static/Presentation-ui-components-Avatar-avatar-stories.2fb23ae6.iframe.bundle.js +0 -1
- package/storybook-static/Presentation-ui-components-Badge-Badge-stories.fea53429.iframe.bundle.js +0 -14
- package/storybook-static/Presentation-ui-components-Button-Button-stories.f6c6437b.iframe.bundle.js +0 -1
- package/storybook-static/Presentation-ui-components-DialogBanner-DialogBanner-stories.6b2a3f72.iframe.bundle.js +0 -10
- package/storybook-static/Presentation-ui-components-DialogItemPreview-DialogItemPreview-stories.f1cb9d40.iframe.bundle.js +0 -1
- package/storybook-static/Presentation-ui-components-DialogWindow-DialogWindow-stories.0ad17c54.iframe.bundle.js +0 -1
- package/storybook-static/Presentation-ui-components-Dropdown-Dropdown-stories.3b620239.iframe.bundle.js +0 -1
- package/storybook-static/Presentation-ui-components-Header-Header-stories.45503161.iframe.bundle.js +0 -1
- package/storybook-static/Presentation-ui-components-Loader-Loader-stories.8b53bb33.iframe.bundle.js +0 -1
- package/storybook-static/Presentation-ui-components-MessageInput-MessageInput-stories.728a66ad.iframe.bundle.js +0 -1
- package/storybook-static/Presentation-ui-components-Placeholder-Placeholder-stories.0898ead6.iframe.bundle.js +0 -1
- package/storybook-static/Presentation-ui-components-PreviewFileMessage-PreviewFileMessage-stories.973cdb64.iframe.bundle.js +0 -1
- package/storybook-static/Presentation-ui-components-SettingsItem-SettingsItem-stories.0af0b8a8.iframe.bundle.js +0 -1
- package/storybook-static/Presentation-ui-components-TextField-TextField-stories.5987d2bb.iframe.bundle.js +0 -1
- package/storybook-static/main.0332574c.iframe.bundle.js +0 -1
- package/storybook-static/runtime~main.16726a14.iframe.bundle.js +0 -1
- package/storybook-static/static/css/Presentation-ui-components-DialogWindow-DialogWindow-stories.6fb3af8d.chunk.css.map +0 -1
- package/storybook-static/static/css/Presentation-ui-components-Dropdown-Dropdown-stories.66965d64.chunk.css.map +0 -1
- package/storybook-static/static/css/Presentation-ui-components-MessageInput-MessageInput-stories.0e99d80b.chunk.css.map +0 -1
- package/storybook-static/static/css/Presentation-ui-components-Placeholder-Placeholder-stories.1ebf88ab.chunk.css.map +0 -1
package/src/Presentation/Views/Dialog/ForwardMessageFlow/DialogsWithSearch/DialogsWithSearch.scss
CHANGED
|
@@ -9,6 +9,16 @@
|
|
|
9
9
|
position: relative;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
+
.dialogs-with-search-icon {
|
|
13
|
+
width: 24px;
|
|
14
|
+
height: 24px;
|
|
15
|
+
fill: var(--tertiary-elements);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.dialogs-with-search-text-field {
|
|
19
|
+
width: 100%;
|
|
20
|
+
}
|
|
21
|
+
|
|
12
22
|
.dialogs-with-search-list {
|
|
13
23
|
display: flex;
|
|
14
24
|
flex-direction: column;
|
package/src/Presentation/Views/Dialog/ForwardMessageFlow/DialogsWithSearch/DialogsWithSearch.tsx
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
2
|
import './DialogsWithSearch.scss';
|
|
3
3
|
import { DialogEntity } from '../../../../../Domain/entity/DialogEntity';
|
|
4
|
-
// eslint-disable-next-line import/named
|
|
5
4
|
import { FunctionTypeStringToVoid } from '../../../../../CommonTypes/BaseViewModel';
|
|
6
|
-
import SearchComponent from './SearchComponent/SearchComponent';
|
|
7
5
|
import DialogListItem from './DialogListItem/DialogListItem';
|
|
8
6
|
import ScrollableContainer from '../../../../components/containers/ScrollableContainer/ScrollableContainer';
|
|
9
7
|
import { DialogType } from '../../../../../Domain/entity/DialogTypes';
|
|
10
8
|
import { PublicDialogEntity } from '../../../../../Domain/entity/PublicDialogEntity';
|
|
9
|
+
import { TextField } from '../../../../ui-components';
|
|
10
|
+
import { SearchSvg } from '../../../../icons';
|
|
11
11
|
|
|
12
12
|
type DialogsWithSearchProps = {
|
|
13
13
|
dialogs: DialogEntity[];
|
|
@@ -46,9 +46,6 @@ const DialogsWithSearch: React.FC<DialogsWithSearchProps> = ({
|
|
|
46
46
|
return [...dialogs.filter((u) => u.id !== currentDialog.id)];
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
useEffect(() => {
|
|
50
|
-
setFilteredDialogs(filterDialogsByName(stringForFilter, currentDialog.id));
|
|
51
|
-
}, [stringForFilter]);
|
|
52
49
|
const renderItem = (item: DialogEntity) => {
|
|
53
50
|
return (
|
|
54
51
|
<div className="dialogs-with-search-list-item" key={item.id}>
|
|
@@ -73,16 +70,19 @@ const DialogsWithSearch: React.FC<DialogsWithSearchProps> = ({
|
|
|
73
70
|
);
|
|
74
71
|
};
|
|
75
72
|
|
|
76
|
-
|
|
73
|
+
useEffect(() => {
|
|
74
|
+
setFilteredDialogs(filterDialogsByName(stringForFilter, currentDialog.id));
|
|
75
|
+
}, [stringForFilter]);
|
|
76
|
+
|
|
77
77
|
return (
|
|
78
78
|
<div className="dialogs-with-search-body">
|
|
79
|
-
<
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
79
|
+
<TextField
|
|
80
|
+
icon={<SearchSvg className="dialogs-with-search-icon" />}
|
|
81
|
+
value={stringForFilter}
|
|
82
|
+
onChange={(value) => setStringForFilter(value)}
|
|
83
|
+
placeholder="Search"
|
|
84
|
+
className="dialogs-with-search-text-field"
|
|
83
85
|
/>
|
|
84
|
-
|
|
85
|
-
{/* <div className="dialogs-with-search-list"> */}
|
|
86
86
|
<ScrollableContainer
|
|
87
87
|
className="dialogs-with-search-list"
|
|
88
88
|
data={filteredDialogs}
|
|
@@ -90,7 +90,6 @@ const DialogsWithSearch: React.FC<DialogsWithSearchProps> = ({
|
|
|
90
90
|
onEndReachedThreshold={0.8}
|
|
91
91
|
refreshing={false}
|
|
92
92
|
/>
|
|
93
|
-
{/* </div> */}
|
|
94
93
|
</div>
|
|
95
94
|
);
|
|
96
95
|
};
|
|
@@ -17,6 +17,7 @@ type ForwardMessageFlowProps = {
|
|
|
17
17
|
messages: MessageEntity[],
|
|
18
18
|
relatedText: string,
|
|
19
19
|
) => void;
|
|
20
|
+
disableActions: boolean;
|
|
20
21
|
};
|
|
21
22
|
|
|
22
23
|
// eslint-disable-next-line react/function-component-definition
|
|
@@ -26,6 +27,7 @@ const ForwardMessageFlow: React.FC<ForwardMessageFlowProps> = ({
|
|
|
26
27
|
currentDialog,
|
|
27
28
|
currentUserName,
|
|
28
29
|
onSendData,
|
|
30
|
+
disableActions,
|
|
29
31
|
}: ForwardMessageFlowProps) => {
|
|
30
32
|
const [activeChatsTab, setActiveChatsTab] = useState(true);
|
|
31
33
|
const [selectedDialogs, setSelectedDialogs] = useState<string[]>([]);
|
|
@@ -33,11 +35,13 @@ const ForwardMessageFlow: React.FC<ForwardMessageFlowProps> = ({
|
|
|
33
35
|
|
|
34
36
|
const userName = currentUserName;
|
|
35
37
|
const sendMessageHandler = () => {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
if (!disableActions) {
|
|
39
|
+
const dialogsForSend: DialogEntity[] = dialogs.filter((item) =>
|
|
40
|
+
selectedDialogs.includes(item.id),
|
|
41
|
+
);
|
|
39
42
|
|
|
40
|
-
|
|
43
|
+
onSendData(dialogsForSend, messages, inputText);
|
|
44
|
+
}
|
|
41
45
|
};
|
|
42
46
|
|
|
43
47
|
return (
|
|
@@ -108,7 +112,7 @@ const ForwardMessageFlow: React.FC<ForwardMessageFlowProps> = ({
|
|
|
108
112
|
inputText={inputText}
|
|
109
113
|
onChange={(s) => setInputText(s)}
|
|
110
114
|
onSend={sendMessageHandler}
|
|
111
|
-
disabled={selectedDialogs.length === 0}
|
|
115
|
+
disabled={selectedDialogs.length === 0 || disableActions}
|
|
112
116
|
/>
|
|
113
117
|
</div>
|
|
114
118
|
</div>
|
package/src/Presentation/Views/Dialog/ForwardMessageFlow/InputForForwarding/InputForForwarding.scss
CHANGED
|
@@ -47,7 +47,6 @@
|
|
|
47
47
|
|
|
48
48
|
.forwarding-message-input-icon-send {
|
|
49
49
|
border-radius: 4px;
|
|
50
|
-
padding: 4px;
|
|
51
50
|
display: flex;
|
|
52
51
|
flex-direction: row;
|
|
53
52
|
gap: 0px;
|
|
@@ -57,6 +56,37 @@
|
|
|
57
56
|
width: 24px;
|
|
58
57
|
height: 44px;
|
|
59
58
|
position: relative;
|
|
59
|
+
|
|
60
|
+
&__icon{
|
|
61
|
+
width: 24px;
|
|
62
|
+
height: 24px;
|
|
63
|
+
cursor: pointer;
|
|
64
|
+
fill: var(--secondary-elements);
|
|
65
|
+
&__send {
|
|
66
|
+
width: 24px;
|
|
67
|
+
height: 24px;
|
|
68
|
+
cursor: pointer;
|
|
69
|
+
fill: var(--main-elements);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
svg path{
|
|
73
|
+
width: 24px;
|
|
74
|
+
height: 24px;
|
|
75
|
+
fill: var(--main-elements);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
&__icon--disable{
|
|
79
|
+
fill: var(--disabled-elements);
|
|
80
|
+
cursor: default;
|
|
81
|
+
width: 24px;
|
|
82
|
+
height: 24px;
|
|
83
|
+
svg path{
|
|
84
|
+
width: 24px;
|
|
85
|
+
height: 24px;
|
|
86
|
+
fill: var(--disabled-elements);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
60
90
|
}
|
|
61
91
|
.actions-send {
|
|
62
92
|
flex-shrink: 0;
|
package/src/Presentation/Views/Dialog/ForwardMessageFlow/InputForForwarding/InputForForwarding.tsx
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import './InputForForwarding.scss';
|
|
1
|
+
import cn from 'classnames';
|
|
3
2
|
import {
|
|
4
3
|
FunctionTypeStringToVoid,
|
|
5
4
|
FunctionTypeVoidToVoid,
|
|
6
5
|
} from '../../../../../CommonTypes/BaseViewModel';
|
|
7
|
-
import
|
|
8
|
-
import
|
|
6
|
+
import { SendSvg } from '../../../../icons';
|
|
7
|
+
import './InputForForwarding.scss';
|
|
9
8
|
|
|
10
9
|
type InputForForwardingProps = {
|
|
11
10
|
inputText: string;
|
|
@@ -34,10 +33,11 @@ const InputForForwarding: React.FC<InputForForwardingProps> = ({
|
|
|
34
33
|
/>
|
|
35
34
|
</div>
|
|
36
35
|
<div className="forwarding-message-input-icon-send">
|
|
37
|
-
<
|
|
38
|
-
|
|
36
|
+
<SendSvg
|
|
37
|
+
className={cn('forwarding-message-input-icon-send__icon__send', {
|
|
38
|
+
'forwarding-message-input-icon-send__icon--disable': disabled,
|
|
39
|
+
})}
|
|
39
40
|
onClick={onSend}
|
|
40
|
-
disabled={disabled}
|
|
41
41
|
/>
|
|
42
42
|
</div>
|
|
43
43
|
</div>
|
|
@@ -11,6 +11,7 @@ export type MessageContextMenuProps = {
|
|
|
11
11
|
enableReplying: boolean;
|
|
12
12
|
onReply: FunctionTypeMessageEntityToVoid;
|
|
13
13
|
onForward: FunctionTypeMessageEntityToVoid;
|
|
14
|
+
disableActions?: boolean;
|
|
14
15
|
};
|
|
15
16
|
|
|
16
17
|
export default function MessageContextMenu({
|
|
@@ -19,22 +20,32 @@ export default function MessageContextMenu({
|
|
|
19
20
|
enableForwarding,
|
|
20
21
|
onReply,
|
|
21
22
|
onForward,
|
|
23
|
+
disableActions = false,
|
|
22
24
|
}: MessageContextMenuProps) {
|
|
23
25
|
function selectHandler(value: string) {
|
|
24
|
-
if (
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
if (!disableActions) {
|
|
27
|
+
if (value === 'Reply' && enableReplying) {
|
|
28
|
+
onReply(message);
|
|
29
|
+
}
|
|
30
|
+
if (value === 'Forward' && enableForwarding) {
|
|
31
|
+
onForward(message);
|
|
32
|
+
}
|
|
29
33
|
}
|
|
30
34
|
}
|
|
31
35
|
|
|
36
|
+
// const [disabled, setDisabled] = useState(disableActions);
|
|
37
|
+
|
|
38
|
+
// useEffect(() => {
|
|
39
|
+
// setDisabled(disableActions);
|
|
40
|
+
// }, [disableActions]);
|
|
41
|
+
|
|
32
42
|
const options: Option[] = [];
|
|
33
43
|
|
|
34
44
|
if (enableReplying) {
|
|
35
45
|
options.push({
|
|
36
46
|
value: 'Reply',
|
|
37
47
|
label: 'Reply',
|
|
48
|
+
disabled: disableActions,
|
|
38
49
|
});
|
|
39
50
|
}
|
|
40
51
|
|
|
@@ -50,7 +61,7 @@ export default function MessageContextMenu({
|
|
|
50
61
|
{enableForwarding || enableReplying ? (
|
|
51
62
|
<Dropdown
|
|
52
63
|
options={options}
|
|
53
|
-
disabled={
|
|
64
|
+
disabled={disableActions}
|
|
54
65
|
onSelect={(value) => selectHandler(value)}
|
|
55
66
|
>
|
|
56
67
|
<div className="message-context-menu-actions">
|
|
@@ -18,7 +18,7 @@ import './MessageItem.scss';
|
|
|
18
18
|
|
|
19
19
|
export type MessageItemProps = {
|
|
20
20
|
message: MessageEntity;
|
|
21
|
-
|
|
21
|
+
currentUserId?: number;
|
|
22
22
|
AITranslateWidget?: AIMessageWidget;
|
|
23
23
|
AIAssistWidget?: AIMessageWidget;
|
|
24
24
|
maxTokens: number;
|
|
@@ -32,6 +32,7 @@ export type MessageItemProps = {
|
|
|
32
32
|
listRef?: RefObject<HTMLDivElement>;
|
|
33
33
|
messagesToView: MessageEntity[];
|
|
34
34
|
onError: (messageError: string) => void;
|
|
35
|
+
disableAction?: boolean;
|
|
35
36
|
};
|
|
36
37
|
|
|
37
38
|
interface MessageStates {
|
|
@@ -65,7 +66,7 @@ function reducer(
|
|
|
65
66
|
|
|
66
67
|
export default function MessageItem({
|
|
67
68
|
message,
|
|
68
|
-
|
|
69
|
+
currentUserId,
|
|
69
70
|
enableForwarding,
|
|
70
71
|
enableReplying,
|
|
71
72
|
onReply,
|
|
@@ -79,6 +80,7 @@ export default function MessageItem({
|
|
|
79
80
|
defaultTranslationLanguage,
|
|
80
81
|
languagesForAITranslate,
|
|
81
82
|
onError,
|
|
83
|
+
disableAction = false,
|
|
82
84
|
}: MessageItemProps) {
|
|
83
85
|
const messageStates: Record<string, MessageStates> = {};
|
|
84
86
|
|
|
@@ -103,8 +105,8 @@ export default function MessageItem({
|
|
|
103
105
|
return TypeSystemMessage;
|
|
104
106
|
}
|
|
105
107
|
if (
|
|
106
|
-
(m.sender && m.sender.id.toString() !==
|
|
107
|
-
m.sender_id.toString() !==
|
|
108
|
+
(m.sender && m.sender.id.toString() !== currentUserId?.toString()) ||
|
|
109
|
+
m.sender_id.toString() !== currentUserId?.toString()
|
|
108
110
|
) {
|
|
109
111
|
return TypeIncomingMessage;
|
|
110
112
|
}
|
|
@@ -121,8 +123,16 @@ export default function MessageItem({
|
|
|
121
123
|
}
|
|
122
124
|
|
|
123
125
|
function getStatusMessage(messageEntity: MessageEntity) {
|
|
124
|
-
if (
|
|
125
|
-
|
|
126
|
+
if (
|
|
127
|
+
messageEntity.delivered_ids &&
|
|
128
|
+
messageEntity.delivered_ids.length > 0 &&
|
|
129
|
+
messageEntity.delivered_ids.some((id) => id !== currentUserId)
|
|
130
|
+
) {
|
|
131
|
+
if (
|
|
132
|
+
messageEntity.read_ids &&
|
|
133
|
+
messageEntity.read_ids.length > 0 &&
|
|
134
|
+
messageEntity.read_ids.some((id) => id !== currentUserId)
|
|
135
|
+
) {
|
|
126
136
|
return 'viewed';
|
|
127
137
|
}
|
|
128
138
|
|
|
@@ -144,6 +154,7 @@ export default function MessageItem({
|
|
|
144
154
|
onForward={onForward}
|
|
145
155
|
enableReplying={enableReplying}
|
|
146
156
|
enableForwarding={enableForwarding}
|
|
157
|
+
disableActions={disableAction}
|
|
147
158
|
/>
|
|
148
159
|
{currentMessageType === 'incoming' && state[item.id]?.loading && (
|
|
149
160
|
<Loader size="sm" className="message-item-additional-part__loader" />
|
|
@@ -152,6 +163,7 @@ export default function MessageItem({
|
|
|
152
163
|
!(item.attachments && item.attachments.length > 0) &&
|
|
153
164
|
AIAssistWidget && (
|
|
154
165
|
<AIAssist
|
|
166
|
+
disableAction={disableAction}
|
|
155
167
|
AIAssistWidget={AIAssistWidget}
|
|
156
168
|
loading={
|
|
157
169
|
state[item.id] && state[item.id].loading
|
|
@@ -164,7 +176,7 @@ export default function MessageItem({
|
|
|
164
176
|
onError={onError}
|
|
165
177
|
messageToAssist={item}
|
|
166
178
|
messageHistory={messagesToView}
|
|
167
|
-
currentUserId={
|
|
179
|
+
currentUserId={currentUserId}
|
|
168
180
|
maxTokens={maxTokens}
|
|
169
181
|
/>
|
|
170
182
|
)}
|
|
@@ -196,6 +208,7 @@ export default function MessageItem({
|
|
|
196
208
|
nestedMessage.attachments.length > 0
|
|
197
209
|
) && AITranslateWidget ? (
|
|
198
210
|
<AITranslate
|
|
211
|
+
disableAction={disableAction}
|
|
199
212
|
AITranslateWidget={AITranslateWidget}
|
|
200
213
|
defaultLanguage={defaultTranslationLanguage}
|
|
201
214
|
languages={languagesForAITranslate}
|
|
@@ -217,7 +230,7 @@ export default function MessageItem({
|
|
|
217
230
|
onError={onError}
|
|
218
231
|
messageToTranslate={nestedMessage}
|
|
219
232
|
messageHistory={messagesToView}
|
|
220
|
-
currentUserId={
|
|
233
|
+
currentUserId={currentUserId}
|
|
221
234
|
maxTokens={maxTokens}
|
|
222
235
|
onTranslated={(id, textTranslated) =>
|
|
223
236
|
translatedHandler(id, textTranslated)
|
|
@@ -298,6 +311,7 @@ export default function MessageItem({
|
|
|
298
311
|
!(message.attachments && message.attachments.length > 0) &&
|
|
299
312
|
AITranslateWidget ? (
|
|
300
313
|
<AITranslate
|
|
314
|
+
disableAction={disableAction}
|
|
301
315
|
AITranslateWidget={AITranslateWidget}
|
|
302
316
|
defaultLanguage={defaultTranslationLanguage}
|
|
303
317
|
languages={languagesForAITranslate}
|
|
@@ -317,7 +331,7 @@ export default function MessageItem({
|
|
|
317
331
|
onError={onError}
|
|
318
332
|
messageToTranslate={message}
|
|
319
333
|
messageHistory={messagesToView}
|
|
320
|
-
currentUserId={
|
|
334
|
+
currentUserId={currentUserId}
|
|
321
335
|
maxTokens={maxTokens}
|
|
322
336
|
onTranslated={(id, textTranslated) =>
|
|
323
337
|
translatedHandler(id, textTranslated)
|
|
@@ -42,9 +42,9 @@ export default function useDialogViewModel(
|
|
|
42
42
|
): DialogViewModel {
|
|
43
43
|
console.log('useDialogViewModel');
|
|
44
44
|
const [loading, setLoading] = useState(false);
|
|
45
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
46
45
|
const [error, setError] = useState('');
|
|
47
|
-
|
|
46
|
+
const startPagination: Pagination = new Pagination(0, 0);
|
|
47
|
+
const [pagination, setPagination] = useState<Pagination>(startPagination);
|
|
48
48
|
const [messages, setMessages] = useState<MessageEntity[]>([]);
|
|
49
49
|
// const [users, setUsers] = useState<Record<number, UserEntity>>();
|
|
50
50
|
const [dialog, setDialog] = useState<DialogEntity>(dialogEntity);
|
|
@@ -64,14 +64,9 @@ export default function useDialogViewModel(
|
|
|
64
64
|
|
|
65
65
|
const [typingText, setTypingText] = useState<string>('');
|
|
66
66
|
|
|
67
|
-
async function getMessages(
|
|
68
|
-
console.log(
|
|
69
|
-
'call getMessages in MessagesViewModelWithMockUseCase for dialog: ',
|
|
70
|
-
JSON.stringify(dialog),
|
|
71
|
-
);
|
|
67
|
+
async function getMessages(currentPagination?: Pagination) {
|
|
72
68
|
setLoading(true);
|
|
73
|
-
|
|
74
|
-
//
|
|
69
|
+
|
|
75
70
|
let participants: Array<number> = [];
|
|
76
71
|
let userDictionary: Record<number, UserEntity> = {};
|
|
77
72
|
|
|
@@ -93,12 +88,6 @@ export default function useDialogViewModel(
|
|
|
93
88
|
.execute()
|
|
94
89
|
// eslint-disable-next-line promise/always-return
|
|
95
90
|
.then((data) => {
|
|
96
|
-
console.log(
|
|
97
|
-
`use Message have dialog: ${JSON.stringify(
|
|
98
|
-
dialogEntity,
|
|
99
|
-
)} getUsers:${JSON.stringify(data)}`,
|
|
100
|
-
);
|
|
101
|
-
console.log('have users ids :', JSON.stringify(participants));
|
|
102
91
|
userDictionary = data.reduce((acc, item) => {
|
|
103
92
|
const obj = acc;
|
|
104
93
|
|
|
@@ -109,10 +98,6 @@ export default function useDialogViewModel(
|
|
|
109
98
|
return obj;
|
|
110
99
|
}, {});
|
|
111
100
|
|
|
112
|
-
console.log(
|
|
113
|
-
'have dictionary of users:',
|
|
114
|
-
JSON.stringify(userDictionary),
|
|
115
|
-
);
|
|
116
101
|
setLoading(false);
|
|
117
102
|
setError('');
|
|
118
103
|
})
|
|
@@ -122,13 +107,12 @@ export default function useDialogViewModel(
|
|
|
122
107
|
setError((e as unknown as Error).message);
|
|
123
108
|
});
|
|
124
109
|
|
|
125
|
-
//
|
|
126
110
|
//
|
|
127
111
|
const getDialogMessages: GetAllMessagesForDialogMock =
|
|
128
112
|
new GetAllMessagesForDialogMock(
|
|
129
113
|
new MessagesRepository(LOCAL_DATA_SOURCE, REMOTE_DATA_SOURCE),
|
|
130
114
|
dialog.id,
|
|
131
|
-
|
|
115
|
+
currentPagination || startPagination || new Pagination(),
|
|
132
116
|
);
|
|
133
117
|
|
|
134
118
|
//
|
|
@@ -138,11 +122,11 @@ export default function useDialogViewModel(
|
|
|
138
122
|
.then((data) => {
|
|
139
123
|
console.log(
|
|
140
124
|
`DIALOG: ${JSON.stringify(dialogEntity)} WITH ${
|
|
141
|
-
data.length
|
|
125
|
+
data.ResultData.length
|
|
142
126
|
} messages:${JSON.stringify(data)}`,
|
|
143
127
|
);
|
|
144
128
|
|
|
145
|
-
const ResultMessages = data.map((message) => {
|
|
129
|
+
const ResultMessages = data.ResultData.map((message) => {
|
|
146
130
|
const obj = { ...message };
|
|
147
131
|
|
|
148
132
|
console.log('have sender id:', message.sender_id);
|
|
@@ -163,8 +147,18 @@ export default function useDialogViewModel(
|
|
|
163
147
|
});
|
|
164
148
|
|
|
165
149
|
console.log(`result messages:${JSON.stringify(ResultMessages)}`);
|
|
166
|
-
setMessages(ResultMessages);
|
|
150
|
+
// setMessages(ResultMessages);
|
|
151
|
+
setMessages((prevState) => {
|
|
152
|
+
const newItems: MessageEntity[] =
|
|
153
|
+
currentPagination === undefined ||
|
|
154
|
+
currentPagination?.getCurrentPage() === 0
|
|
155
|
+
? [...ResultMessages]
|
|
156
|
+
: [...prevState, ...ResultMessages];
|
|
157
|
+
|
|
158
|
+
return newItems;
|
|
159
|
+
});
|
|
167
160
|
setLoading(false);
|
|
161
|
+
setPagination(data.CurrentPagination);
|
|
168
162
|
setError('');
|
|
169
163
|
})
|
|
170
164
|
.catch((e) => {
|
|
@@ -207,7 +201,10 @@ export default function useDialogViewModel(
|
|
|
207
201
|
|
|
208
202
|
if (dialogInfo.eventMessageType === EventMessageType.LocalMessage) {
|
|
209
203
|
if (dialogInfo.messageStatus) {
|
|
210
|
-
if (
|
|
204
|
+
if (
|
|
205
|
+
dialogInfo.messageStatus.isTyping &&
|
|
206
|
+
dialogInfo.messageStatus.dialogId === dialog?.id
|
|
207
|
+
) {
|
|
211
208
|
// eslint-disable-next-line promise/catch-or-return
|
|
212
209
|
getSender(dialogInfo.messageStatus.userId).then((senderUser) => {
|
|
213
210
|
const typingMessage = `User ${
|
|
@@ -224,6 +221,41 @@ export default function useDialogViewModel(
|
|
|
224
221
|
} else {
|
|
225
222
|
setTypingText('');
|
|
226
223
|
}
|
|
224
|
+
if (
|
|
225
|
+
(dialogInfo.messageStatus.deliveryStatus === 'read' ||
|
|
226
|
+
dialogInfo.messageStatus.deliveryStatus === 'delivered') &&
|
|
227
|
+
dialogInfo.messageStatus.messageId?.length > 0 &&
|
|
228
|
+
dialogInfo.messageStatus.dialogId === dialog?.id
|
|
229
|
+
) {
|
|
230
|
+
setTypingText('');
|
|
231
|
+
setMessages((prevState) => {
|
|
232
|
+
let newState = [...prevState];
|
|
233
|
+
|
|
234
|
+
if (
|
|
235
|
+
newState.find(
|
|
236
|
+
(it) => it.id === dialogInfo.messageStatus!.messageId,
|
|
237
|
+
)
|
|
238
|
+
) {
|
|
239
|
+
newState = newState.map((elem) => {
|
|
240
|
+
const v: MessageEntity = {
|
|
241
|
+
...elem,
|
|
242
|
+
read_ids: [
|
|
243
|
+
...elem.read_ids,
|
|
244
|
+
dialogInfo.messageStatus!.userId,
|
|
245
|
+
],
|
|
246
|
+
delivered_ids: [
|
|
247
|
+
...elem.delivered_ids,
|
|
248
|
+
dialogInfo.messageStatus!.userId,
|
|
249
|
+
],
|
|
250
|
+
};
|
|
251
|
+
|
|
252
|
+
return v;
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
return newState; // delivered message
|
|
257
|
+
});
|
|
258
|
+
}
|
|
227
259
|
}
|
|
228
260
|
}
|
|
229
261
|
if (dialogInfo.eventMessageType === EventMessageType.RegularMessage) {
|
|
@@ -231,7 +263,7 @@ export default function useDialogViewModel(
|
|
|
231
263
|
dialogInfo.messageInfo &&
|
|
232
264
|
dialogInfo.messageInfo.message &&
|
|
233
265
|
dialogInfo.messageInfo.id &&
|
|
234
|
-
dialogInfo.messageInfo.dialogId === dialog
|
|
266
|
+
dialogInfo.messageInfo.dialogId === dialog?.id
|
|
235
267
|
) {
|
|
236
268
|
const messageId = dialogInfo.messageInfo.id;
|
|
237
269
|
const messageText = dialogInfo.messageInfo.message;
|
|
@@ -256,7 +288,11 @@ export default function useDialogViewModel(
|
|
|
256
288
|
newState = newState.map((elem) => {
|
|
257
289
|
const v: MessageEntity = {
|
|
258
290
|
...elem,
|
|
259
|
-
|
|
291
|
+
read_ids: [...elem.read_ids, ...ResultMessage.read_ids],
|
|
292
|
+
delivered_ids: [
|
|
293
|
+
...elem.delivered_ids,
|
|
294
|
+
...ResultMessage.delivered_ids,
|
|
295
|
+
],
|
|
260
296
|
};
|
|
261
297
|
|
|
262
298
|
return v;
|
|
@@ -265,14 +301,10 @@ export default function useDialogViewModel(
|
|
|
265
301
|
newState.push(ResultMessage);
|
|
266
302
|
}
|
|
267
303
|
|
|
268
|
-
return newState;
|
|
304
|
+
return newState; // regular message
|
|
269
305
|
});
|
|
270
306
|
});
|
|
271
307
|
}
|
|
272
|
-
// else {
|
|
273
|
-
// // загрузить все сообщения заново
|
|
274
|
-
// getMessages().catch();
|
|
275
|
-
// }
|
|
276
308
|
}
|
|
277
309
|
if (dialogInfo.eventMessageType === EventMessageType.SystemMessage) {
|
|
278
310
|
if (dialogInfo.notificationTypes === NotificationTypes.UPDATE_DIALOG) {
|
|
@@ -823,6 +855,7 @@ export default function useDialogViewModel(
|
|
|
823
855
|
setMessages([]);
|
|
824
856
|
},
|
|
825
857
|
messages,
|
|
858
|
+
pagination,
|
|
826
859
|
loading,
|
|
827
860
|
error,
|
|
828
861
|
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
@@ -31,17 +31,9 @@ $dialog-information-container-dialog-information-height: 64px;
|
|
|
31
31
|
position: relative;
|
|
32
32
|
}
|
|
33
33
|
.header-dialog-info-icon {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
flex-direction: row;
|
|
38
|
-
gap: 0px;
|
|
39
|
-
align-items: center;
|
|
40
|
-
justify-content: center;
|
|
41
|
-
flex-shrink: 0;
|
|
42
|
-
width: 32px;
|
|
43
|
-
height: 32px;
|
|
44
|
-
position: relative;
|
|
34
|
+
width: 24px;
|
|
35
|
+
height: 24px;
|
|
36
|
+
fill: var(--secondary-elements);
|
|
45
37
|
}
|
|
46
38
|
|
|
47
39
|
.dialog-information-profile,
|
|
@@ -120,6 +112,11 @@ $dialog-information-container-dialog-information-height: 64px;
|
|
|
120
112
|
text-align: left;
|
|
121
113
|
font: var(--button-default);
|
|
122
114
|
position: relative;
|
|
115
|
+
|
|
116
|
+
&--disable {
|
|
117
|
+
color: var(--disabled-elements);
|
|
118
|
+
cursor: default;
|
|
119
|
+
}
|
|
123
120
|
}
|
|
124
121
|
|
|
125
122
|
.dialog-info-action-wrapper-settings,
|
|
@@ -210,8 +207,13 @@ $dialog-information-container-dialog-information-height: 64px;
|
|
|
210
207
|
|
|
211
208
|
.dialog-info-leave {
|
|
212
209
|
fill: var(--error);
|
|
213
|
-
|
|
214
210
|
border-bottom: 1px solid var(--divider);
|
|
211
|
+
cursor: pointer;
|
|
212
|
+
|
|
213
|
+
&--disable {
|
|
214
|
+
fill: var(--disabled-elements);
|
|
215
|
+
cursor: default;
|
|
216
|
+
}
|
|
215
217
|
}
|
|
216
218
|
|
|
217
219
|
.dialog-info-members {
|