quickblox-react-ui-kit 0.3.1-beta.1 → 0.3.1-beta.3
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/CommonTypes/CommonTypes.d.ts +1 -1
- package/dist/Data/Stubs.d.ts +1 -1
- package/dist/Data/dto/dialog/RemoteDialogDTO.d.ts +1 -1
- package/dist/Data/dto/user/LocalUserDTO.d.ts +1 -1
- package/dist/Data/dto/user/RemoteUserDTO.d.ts +1 -1
- package/dist/Data/source/remote/RemoteDataSource.d.ts +1 -1
- package/dist/Domain/entity/UserEntity.d.ts +1 -1
- package/dist/Presentation/ui-components/TextField/TextField.d.ts +1 -1
- package/dist/index-ui.js +147 -260
- package/dist/index-ui.js.map +1 -1
- package/dist/qb-api-calls/index.d.ts +2 -1
- package/global.d.ts +29 -29
- package/package.json +2 -2
- package/src/CommonTypes/CommonTypes.ts +1 -0
- package/src/Data/DefaultConfigurations.ts +4 -4
- package/src/Data/Stubs.ts +17 -18
- package/src/Data/dto/dialog/RemoteDialogDTO.ts +2 -2
- package/src/Data/dto/user/LocalUserDTO.ts +2 -2
- package/src/Data/dto/user/RemoteUserDTO.ts +2 -2
- package/src/Data/mapper/DialogRemoteDTOMapper.ts +13 -13
- package/src/Data/mapper/UserLocalDTOMapper.ts +2 -2
- package/src/Data/mapper/UserRemoteDTOMapper.ts +2 -2
- package/src/Data/source/remote/Mapper/DialogDTOMapper.ts +9 -9
- package/src/Data/source/remote/RemoteDataSource.ts +45 -2
- package/src/Domain/entity/UserEntity.ts +1 -1
- package/src/Presentation/Views/Dialog/MessageItem/MessageItem.tsx +2 -2
- package/src/Presentation/Views/Dialog/useDialogViewModel.ts +37 -151
- package/src/Presentation/Views/DialogInfo/DialogInfo.tsx +1 -0
- package/src/Presentation/Views/DialogList/useDialogListViewModel.ts +3 -0
- package/src/Presentation/Views/InviteMembers/useInviteMembersViewModel.ts +11 -1
- package/src/Presentation/layouts/Desktop/QuickBloxUIKitDesktopLayout.tsx +11 -42
- package/src/QBconfig.ts +4 -4
- package/src/qb-api-calls/index.ts +5 -0
- package/storybook-static/{703.1137fb37.iframe.bundle.js → 703.2cbec951.iframe.bundle.js} +2 -2
- package/storybook-static/{703.1137fb37.iframe.bundle.js.map → 703.2cbec951.iframe.bundle.js.map} +1 -1
- package/storybook-static/Presentation-ui-components-MessageInput-MessageInput-stories.bf8a24d1.iframe.bundle.js +1 -0
- package/storybook-static/iframe.html +1 -1
- package/storybook-static/project.json +1 -1
- package/storybook-static/{runtime~main.8d5710fb.iframe.bundle.js → runtime~main.af13ca55.iframe.bundle.js} +1 -1
- package/storybook-static/Presentation-ui-components-MessageInput-MessageInput-stories.0c6310aa.iframe.bundle.js +0 -1
package/dist/index-ui.js
CHANGED
|
@@ -10415,10 +10415,10 @@ var DefaultConfigurations = /** @class */ (function () {
|
|
|
10415
10415
|
DefaultConfigurations.getDefaultQBConfig = function () {
|
|
10416
10416
|
return {
|
|
10417
10417
|
credentials: {
|
|
10418
|
-
appId:
|
|
10419
|
-
accountKey: '
|
|
10420
|
-
authKey: '
|
|
10421
|
-
authSecret: '
|
|
10418
|
+
appId: -1,
|
|
10419
|
+
accountKey: '',
|
|
10420
|
+
authKey: '',
|
|
10421
|
+
authSecret: '',
|
|
10422
10422
|
sessionToken: '',
|
|
10423
10423
|
},
|
|
10424
10424
|
configAIApi: {
|
|
@@ -11020,7 +11020,7 @@ var Stubs = /** @class */ (function () {
|
|
|
11020
11020
|
dto.id = '111';
|
|
11021
11021
|
dto.lastMessageDateSent = 0;
|
|
11022
11022
|
dto.lastMessageText = 'text test';
|
|
11023
|
-
dto.lastMessageUserId =
|
|
11023
|
+
dto.lastMessageUserId = 777;
|
|
11024
11024
|
dto.ownerId = '999';
|
|
11025
11025
|
dto.type = dialogType;
|
|
11026
11026
|
dto.unreadMessageCount = 555;
|
|
@@ -11031,7 +11031,7 @@ var Stubs = /** @class */ (function () {
|
|
|
11031
11031
|
dto.id = '111';
|
|
11032
11032
|
dto.lastMessageDateSent = 0;
|
|
11033
11033
|
dto.lastMessageText = 'text test';
|
|
11034
|
-
dto.lastMessageUserId =
|
|
11034
|
+
dto.lastMessageUserId = 777;
|
|
11035
11035
|
dto.ownerId = '999';
|
|
11036
11036
|
dto.type = dialogType;
|
|
11037
11037
|
dto.unreadMessageCount = 555;
|
|
@@ -11043,7 +11043,7 @@ var Stubs = /** @class */ (function () {
|
|
|
11043
11043
|
dto.id = '111';
|
|
11044
11044
|
dto.lastMessageDateSent = 0;
|
|
11045
11045
|
dto.lastMessageText = 'text test';
|
|
11046
|
-
dto.lastMessageUserId =
|
|
11046
|
+
dto.lastMessageUserId = 777;
|
|
11047
11047
|
dto.ownerId = '999';
|
|
11048
11048
|
dto.type = dialogType;
|
|
11049
11049
|
dto.unreadMessageCount = 555;
|
|
@@ -11078,7 +11078,7 @@ var Stubs = /** @class */ (function () {
|
|
|
11078
11078
|
participantsIds: [],
|
|
11079
11079
|
lastMessageText: '',
|
|
11080
11080
|
lastMessageDateSent: 0,
|
|
11081
|
-
lastMessageUserId:
|
|
11081
|
+
lastMessageUserId: 0,
|
|
11082
11082
|
lastMessageId: '',
|
|
11083
11083
|
unreadMessageCount: 0,
|
|
11084
11084
|
updatedAt: '',
|
|
@@ -11093,7 +11093,7 @@ var Stubs = /** @class */ (function () {
|
|
|
11093
11093
|
participantsIds: [],
|
|
11094
11094
|
lastMessageText: '',
|
|
11095
11095
|
lastMessageDateSent: 0,
|
|
11096
|
-
lastMessageUserId:
|
|
11096
|
+
lastMessageUserId: 0,
|
|
11097
11097
|
lastMessageId: '',
|
|
11098
11098
|
unreadMessageCount: 0,
|
|
11099
11099
|
updatedAt: '',
|
|
@@ -11108,7 +11108,7 @@ var Stubs = /** @class */ (function () {
|
|
|
11108
11108
|
participantsIds: [],
|
|
11109
11109
|
lastMessageText: '',
|
|
11110
11110
|
lastMessageDateSent: 0,
|
|
11111
|
-
lastMessageUserId:
|
|
11111
|
+
lastMessageUserId: 0,
|
|
11112
11112
|
lastMessageId: '',
|
|
11113
11113
|
unreadMessageCount: 0,
|
|
11114
11114
|
updatedAt: '',
|
|
@@ -11123,7 +11123,7 @@ var Stubs = /** @class */ (function () {
|
|
|
11123
11123
|
participantsIds: [],
|
|
11124
11124
|
lastMessageText: '',
|
|
11125
11125
|
lastMessageDateSent: 0,
|
|
11126
|
-
lastMessageUserId:
|
|
11126
|
+
lastMessageUserId: 0,
|
|
11127
11127
|
lastMessageId: '',
|
|
11128
11128
|
unreadMessageCount: 0,
|
|
11129
11129
|
updatedAt: '',
|
|
@@ -11138,7 +11138,7 @@ var Stubs = /** @class */ (function () {
|
|
|
11138
11138
|
participantsIds: [],
|
|
11139
11139
|
lastMessageText: '',
|
|
11140
11140
|
lastMessageDateSent: 0,
|
|
11141
|
-
lastMessageUserId:
|
|
11141
|
+
lastMessageUserId: 0,
|
|
11142
11142
|
lastMessageId: '',
|
|
11143
11143
|
unreadMessageCount: 0,
|
|
11144
11144
|
updatedAt: '',
|
|
@@ -11153,7 +11153,7 @@ var Stubs = /** @class */ (function () {
|
|
|
11153
11153
|
participantsIds: [],
|
|
11154
11154
|
lastMessageText: '',
|
|
11155
11155
|
lastMessageDateSent: 0,
|
|
11156
|
-
lastMessageUserId:
|
|
11156
|
+
lastMessageUserId: 0,
|
|
11157
11157
|
lastMessageId: '',
|
|
11158
11158
|
unreadMessageCount: 0,
|
|
11159
11159
|
updatedAt: '',
|
|
@@ -11168,7 +11168,7 @@ var Stubs = /** @class */ (function () {
|
|
|
11168
11168
|
participantsIds: [],
|
|
11169
11169
|
lastMessageText: '',
|
|
11170
11170
|
lastMessageDateSent: 0,
|
|
11171
|
-
lastMessageUserId:
|
|
11171
|
+
lastMessageUserId: 0,
|
|
11172
11172
|
lastMessageId: '',
|
|
11173
11173
|
unreadMessageCount: 0,
|
|
11174
11174
|
updatedAt: '',
|
|
@@ -11323,9 +11323,9 @@ var Stubs = /** @class */ (function () {
|
|
|
11323
11323
|
};
|
|
11324
11324
|
Stubs.createUsersForTest = function () {
|
|
11325
11325
|
var users = new Array();
|
|
11326
|
-
var user11 = Stubs.createUserEntityWithParams(11, 'fl_user11', 'fl_user11@q.ua', 'login_user11', '31.03.2023', '31.03.2023',
|
|
11327
|
-
var user12 = Stubs.createUserEntityWithParams(12, 'fl_user12', 'fl_user12@q.ua', 'login_user12', '31.03.2023', '31.03.2023',
|
|
11328
|
-
var user13 = Stubs.createUserEntityWithParams(13, 'fl_user13', 'fl_user13@q.ua', 'login_user13', '31.03.2023', '31.03.2023',
|
|
11326
|
+
var user11 = Stubs.createUserEntityWithParams(11, 'fl_user11', 'fl_user11@q.ua', 'login_user11', '31.03.2023', '31.03.2023', '');
|
|
11327
|
+
var user12 = Stubs.createUserEntityWithParams(12, 'fl_user12', 'fl_user12@q.ua', 'login_user12', '31.03.2023', '31.03.2023', '');
|
|
11328
|
+
var user13 = Stubs.createUserEntityWithParams(13, 'fl_user13', 'fl_user13@q.ua', 'login_user13', '31.03.2023', '31.03.2023', '');
|
|
11329
11329
|
users.push(user11);
|
|
11330
11330
|
users.push(user12);
|
|
11331
11331
|
users.push(user13);
|
|
@@ -11514,7 +11514,7 @@ var RemoteDialogDTO = /** @class */ (function () {
|
|
|
11514
11514
|
this.participantsIds = [];
|
|
11515
11515
|
this.updatedAt = '';
|
|
11516
11516
|
this.lastMessageText = '';
|
|
11517
|
-
this.lastMessageUserId =
|
|
11517
|
+
this.lastMessageUserId = 0;
|
|
11518
11518
|
this.lastMessageDateSent = 0;
|
|
11519
11519
|
this.lastMessageId = '';
|
|
11520
11520
|
this.unreadMessageCount = 0;
|
|
@@ -11782,7 +11782,7 @@ var LocalUserDTO = /** @class */ (function () {
|
|
|
11782
11782
|
this.login = '';
|
|
11783
11783
|
this.created_at = '';
|
|
11784
11784
|
this.updated_at = '';
|
|
11785
|
-
this.last_request_at =
|
|
11785
|
+
this.last_request_at = '';
|
|
11786
11786
|
this.custom_data = '';
|
|
11787
11787
|
this.user_tags = '';
|
|
11788
11788
|
this.blob_id = '';
|
|
@@ -11814,7 +11814,7 @@ var RemoteUserDTO = /** @class */ (function () {
|
|
|
11814
11814
|
this.login = '';
|
|
11815
11815
|
this.created_at = '';
|
|
11816
11816
|
this.updated_at = '';
|
|
11817
|
-
this.last_request_at =
|
|
11817
|
+
this.last_request_at = '';
|
|
11818
11818
|
this.custom_data = '';
|
|
11819
11819
|
this.user_tags = '';
|
|
11820
11820
|
this.blob_id = 0;
|
|
@@ -12339,7 +12339,7 @@ var DialogRemoteDTOMapper = /** @class */ (function () {
|
|
|
12339
12339
|
}
|
|
12340
12340
|
dialog.updatedAt = dialogEntity.updatedAt;
|
|
12341
12341
|
dialog.lastMessageText = dialogEntity.lastMessage.text;
|
|
12342
|
-
dialog.lastMessageUserId = dialogEntity.lastMessage.userId
|
|
12342
|
+
dialog.lastMessageUserId = dialogEntity.lastMessage.userId;
|
|
12343
12343
|
dialog.lastMessageDateSent = dialogEntity.lastMessage.dateSent;
|
|
12344
12344
|
dialog.unreadMessageCount = dialogEntity.unreadMessageCount;
|
|
12345
12345
|
dialog.name = DialogRemoteDTOMapper.getDialogName(dialogEntity);
|
|
@@ -12352,9 +12352,13 @@ var DialogRemoteDTOMapper = /** @class */ (function () {
|
|
|
12352
12352
|
DialogRemoteDTOMapper.validateRemoteDTO(dialog);
|
|
12353
12353
|
var entity = DialogRemoteDTOMapper.createDefaultDialogEntity(dialog.ownerId);
|
|
12354
12354
|
function formatPhotoUrl() {
|
|
12355
|
-
if (dialog.photo
|
|
12355
|
+
if (!dialog.photo.includes('https') &&
|
|
12356
|
+
dialog.photo &&
|
|
12357
|
+
dialog.photo !== 'null') {
|
|
12356
12358
|
return dialog.photo && quickblox_quickblox__WEBPACK_IMPORTED_MODULE_0___default().content.privateUrl(dialog.photo);
|
|
12357
12359
|
}
|
|
12360
|
+
if (dialog.photo.includes('https'))
|
|
12361
|
+
return dialog.photo;
|
|
12358
12362
|
return '';
|
|
12359
12363
|
}
|
|
12360
12364
|
switch (dialog.type) {
|
|
@@ -12362,21 +12366,21 @@ var DialogRemoteDTOMapper = /** @class */ (function () {
|
|
|
12362
12366
|
entity = new _Domain_entity_PrivateDialogEntity__WEBPACK_IMPORTED_MODULE_4__.PrivateDialogEntity({ todo: '' }, dialog.id, dialog.name, {
|
|
12363
12367
|
dateSent: dialog.lastMessageDateSent,
|
|
12364
12368
|
text: dialog.lastMessageText ? dialog.lastMessageText : '',
|
|
12365
|
-
userId:
|
|
12369
|
+
userId: dialog.lastMessageUserId,
|
|
12366
12370
|
}, dialog.ownerId, dialog.type, dialog.unreadMessageCount, dialog.updatedAt, parseInt(dialog.participantId, 10));
|
|
12367
12371
|
break;
|
|
12368
12372
|
case _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_1__.DialogType["public"]:
|
|
12369
12373
|
entity = new _Domain_entity_PublicDialogEntity__WEBPACK_IMPORTED_MODULE_3__.PublicDialogEntity({ todo: '' }, dialog.id, {
|
|
12370
12374
|
dateSent: dialog.lastMessageDateSent,
|
|
12371
12375
|
text: dialog.lastMessageText ? dialog.lastMessageText : '',
|
|
12372
|
-
userId:
|
|
12376
|
+
userId: dialog.lastMessageUserId,
|
|
12373
12377
|
}, dialog.ownerId, dialog.type, dialog.unreadMessageCount, dialog.updatedAt, dialog.name, formatPhotoUrl());
|
|
12374
12378
|
break;
|
|
12375
12379
|
case _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_1__.DialogType.group:
|
|
12376
12380
|
entity = new _Domain_entity_GroupDialogEntity__WEBPACK_IMPORTED_MODULE_5__.GroupDialogEntity({ todo: '' }, dialog.id, {
|
|
12377
12381
|
dateSent: dialog.lastMessageDateSent,
|
|
12378
12382
|
text: dialog.lastMessageText ? dialog.lastMessageText : '',
|
|
12379
|
-
userId:
|
|
12383
|
+
userId: dialog.lastMessageUserId,
|
|
12380
12384
|
}, dialog.ownerId, dialog.type, dialog.unreadMessageCount, dialog.updatedAt, dialog.participantsIds, dialog.name, formatPhotoUrl());
|
|
12381
12385
|
break;
|
|
12382
12386
|
default:
|
|
@@ -12619,16 +12623,10 @@ var DialogRemoteDTOMapper = /** @class */ (function () {
|
|
|
12619
12623
|
var dialogType = entity.type;
|
|
12620
12624
|
switch (dialogType) {
|
|
12621
12625
|
case _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_1__.DialogType["private"]:
|
|
12622
|
-
dialogEntity =
|
|
12623
|
-
entity instanceof _Domain_entity_PrivateDialogEntity__WEBPACK_IMPORTED_MODULE_4__.PrivateDialogEntity
|
|
12624
|
-
? entity
|
|
12625
|
-
: null;
|
|
12626
|
+
dialogEntity = entity;
|
|
12626
12627
|
break;
|
|
12627
12628
|
case _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_1__.DialogType["public"]:
|
|
12628
|
-
dialogEntity =
|
|
12629
|
-
entity instanceof _Domain_entity_PublicDialogEntity__WEBPACK_IMPORTED_MODULE_3__.PublicDialogEntity
|
|
12630
|
-
? entity
|
|
12631
|
-
: null;
|
|
12629
|
+
dialogEntity = entity;
|
|
12632
12630
|
break;
|
|
12633
12631
|
case _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_1__.DialogType.group:
|
|
12634
12632
|
dialogEntity = entity;
|
|
@@ -13700,7 +13698,7 @@ var UserLocalDTOMapper = /** @class */ (function () {
|
|
|
13700
13698
|
var last_request_at = v.last_request_at;
|
|
13701
13699
|
return (last_request_at !== undefined &&
|
|
13702
13700
|
last_request_at !== null &&
|
|
13703
|
-
last_request_at > 0);
|
|
13701
|
+
last_request_at.length > 0);
|
|
13704
13702
|
},
|
|
13705
13703
|
login: function (v) {
|
|
13706
13704
|
var login = v.login;
|
|
@@ -13817,7 +13815,7 @@ var UserLocalDTOMapper = /** @class */ (function () {
|
|
|
13817
13815
|
email: '',
|
|
13818
13816
|
full_name: '',
|
|
13819
13817
|
id: 0,
|
|
13820
|
-
last_request_at:
|
|
13818
|
+
last_request_at: '',
|
|
13821
13819
|
login: '',
|
|
13822
13820
|
updated_at: '',
|
|
13823
13821
|
user_tags: '',
|
|
@@ -13978,7 +13976,7 @@ var UserRemoteDTOMapper = /** @class */ (function () {
|
|
|
13978
13976
|
var last_request_at = v.last_request_at;
|
|
13979
13977
|
return (last_request_at !== undefined &&
|
|
13980
13978
|
last_request_at !== null &&
|
|
13981
|
-
last_request_at > 0);
|
|
13979
|
+
last_request_at.length > 0);
|
|
13982
13980
|
},
|
|
13983
13981
|
login: function (v) {
|
|
13984
13982
|
var login = v.login;
|
|
@@ -14095,7 +14093,7 @@ var UserRemoteDTOMapper = /** @class */ (function () {
|
|
|
14095
14093
|
email: '',
|
|
14096
14094
|
full_name: '',
|
|
14097
14095
|
id: 0,
|
|
14098
|
-
last_request_at:
|
|
14096
|
+
last_request_at: '',
|
|
14099
14097
|
login: '',
|
|
14100
14098
|
updated_at: '',
|
|
14101
14099
|
user_tags: '',
|
|
@@ -16577,7 +16575,7 @@ var DialogDTOMapper = /** @class */ (function () {
|
|
|
16577
16575
|
last_message: DialogDTOMapper.formatLastMessageText(dialogDTO.lastMessageText),
|
|
16578
16576
|
last_message_date_sent: dialogDTO.lastMessageDateSent,
|
|
16579
16577
|
last_message_id: null,
|
|
16580
|
-
last_message_user_id:
|
|
16578
|
+
last_message_user_id: dialogDTO.lastMessageUserId,
|
|
16581
16579
|
name: dialogDTO.name,
|
|
16582
16580
|
occupants_ids: dialogDTO.participantsIds,
|
|
16583
16581
|
new_occupants_ids: dialogDTO.newParticipantsIds
|
|
@@ -16604,9 +16602,9 @@ var DialogDTOMapper = /** @class */ (function () {
|
|
|
16604
16602
|
dto.lastMessageDateSent = qbDialog.last_message_date_sent || 0;
|
|
16605
16603
|
dto.lastMessageUserId =
|
|
16606
16604
|
qbDialog.last_message_user_id === null
|
|
16607
|
-
?
|
|
16605
|
+
? 0
|
|
16608
16606
|
: // eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
16609
|
-
qbDialog.last_message_user_id
|
|
16607
|
+
qbDialog.last_message_user_id;
|
|
16610
16608
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
16611
16609
|
dto.ownerId = qbDialog.user_id.toString();
|
|
16612
16610
|
dto.type = qbDialog.type;
|
|
@@ -16634,9 +16632,9 @@ var DialogDTOMapper = /** @class */ (function () {
|
|
|
16634
16632
|
dto.lastMessageDateSent = qbDialog.last_message_date_sent || 0;
|
|
16635
16633
|
dto.lastMessageUserId =
|
|
16636
16634
|
qbDialog.last_message_user_id === null
|
|
16637
|
-
?
|
|
16635
|
+
? 0
|
|
16638
16636
|
: // eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
16639
|
-
qbDialog.last_message_user_id
|
|
16637
|
+
qbDialog.last_message_user_id;
|
|
16640
16638
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
16641
16639
|
dto.ownerId = qbDialog.user_id.toString();
|
|
16642
16640
|
dto.type = qbDialog.type;
|
|
@@ -16652,9 +16650,9 @@ var DialogDTOMapper = /** @class */ (function () {
|
|
|
16652
16650
|
dto.lastMessageDateSent = qbDialog.last_message_date_sent || 0;
|
|
16653
16651
|
dto.lastMessageUserId =
|
|
16654
16652
|
qbDialog.last_message_user_id === null
|
|
16655
|
-
?
|
|
16653
|
+
? 0
|
|
16656
16654
|
: // eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
16657
|
-
qbDialog.last_message_user_id
|
|
16655
|
+
qbDialog.last_message_user_id;
|
|
16658
16656
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
16659
16657
|
dto.ownerId = qbDialog.user_id.toString();
|
|
16660
16658
|
dto.type = qbDialog.type;
|
|
@@ -16674,9 +16672,9 @@ var DialogDTOMapper = /** @class */ (function () {
|
|
|
16674
16672
|
dto.lastMessageDateSent = qbDialog.last_message_date_sent || 0;
|
|
16675
16673
|
dto.lastMessageUserId =
|
|
16676
16674
|
qbDialog.last_message_user_id === null
|
|
16677
|
-
?
|
|
16675
|
+
? 0
|
|
16678
16676
|
: // eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
16679
|
-
qbDialog.last_message_user_id
|
|
16677
|
+
qbDialog.last_message_user_id;
|
|
16680
16678
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
16681
16679
|
dto.ownerId = qbDialog.user_id.toString();
|
|
16682
16680
|
dto.type = qbDialog.type;
|
|
@@ -17834,7 +17832,38 @@ var RemoteDataSource = /** @class */ (function () {
|
|
|
17834
17832
|
return dialogDTOMapper;
|
|
17835
17833
|
};
|
|
17836
17834
|
RemoteDataSource.prototype.updateCurrentDialog = function (dto) {
|
|
17837
|
-
|
|
17835
|
+
var _a;
|
|
17836
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
17837
|
+
var dialogsDTOtoEntityMapper, dialogEntity, userId, dialogId, messageId, resultMessage;
|
|
17838
|
+
return __generator(this, function (_b) {
|
|
17839
|
+
switch (_b.label) {
|
|
17840
|
+
case 0:
|
|
17841
|
+
this.currentDialog = dto;
|
|
17842
|
+
dialogsDTOtoEntityMapper = new _mapper_DialogRemoteDTOMapper__WEBPACK_IMPORTED_MODULE_12__.DialogRemoteDTOMapper();
|
|
17843
|
+
return [4 /*yield*/, dialogsDTOtoEntityMapper.toEntity(this.currentDialog)];
|
|
17844
|
+
case 1:
|
|
17845
|
+
dialogEntity = _b.sent();
|
|
17846
|
+
userId = ((_a = this._authInformation) === null || _a === void 0 ? void 0 : _a.userId) || -1;
|
|
17847
|
+
dialogId = this.currentDialog.id;
|
|
17848
|
+
messageId = this.currentDialog.lastMessageId;
|
|
17849
|
+
resultMessage = {
|
|
17850
|
+
eventMessageType: _Domain_entity_EventMessageType__WEBPACK_IMPORTED_MODULE_16__["default"].LocalMessage,
|
|
17851
|
+
dialogInfo: dialogEntity,
|
|
17852
|
+
messageInfo: undefined,
|
|
17853
|
+
messageStatus: {
|
|
17854
|
+
isTyping: false,
|
|
17855
|
+
userId: userId,
|
|
17856
|
+
dialogId: dialogId,
|
|
17857
|
+
messageId: messageId,
|
|
17858
|
+
deliveryStatus: 'delivered',
|
|
17859
|
+
},
|
|
17860
|
+
notificationTypes: undefined,
|
|
17861
|
+
};
|
|
17862
|
+
this.subscriptionOnMessageStatus.informSubscribers(resultMessage, _Domain_entity_EventMessageType__WEBPACK_IMPORTED_MODULE_16__["default"].LocalMessage);
|
|
17863
|
+
return [2 /*return*/];
|
|
17864
|
+
}
|
|
17865
|
+
});
|
|
17866
|
+
});
|
|
17838
17867
|
};
|
|
17839
17868
|
RemoteDataSource.prototype.setUpMockStorage = function () {
|
|
17840
17869
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -18105,22 +18134,20 @@ var RemoteDataSource = /** @class */ (function () {
|
|
|
18105
18134
|
console.log("EVENT: receive delivered message id: ".concat(messageId, ", dialogid: ").concat(dialogId, " userid: ").concat(userId));
|
|
18106
18135
|
(0,_qb_api_calls__WEBPACK_IMPORTED_MODULE_9__.QBGetDialogById)(dialogId)
|
|
18107
18136
|
.then(function (result) { return __awaiter(_this, void 0, void 0, function () {
|
|
18108
|
-
var
|
|
18137
|
+
var dialogs, current, dialogDTO, dialogsDTOtoEntityMapper, dialogEntity, resultMessage;
|
|
18109
18138
|
var _this = this;
|
|
18110
|
-
|
|
18111
|
-
|
|
18112
|
-
switch (_b.label) {
|
|
18139
|
+
return __generator(this, function (_a) {
|
|
18140
|
+
switch (_a.label) {
|
|
18113
18141
|
case 0:
|
|
18114
|
-
currentUserId = (_a = this._authInformation) === null || _a === void 0 ? void 0 : _a.userId;
|
|
18115
18142
|
dialogs = result === null || result === void 0 ? void 0 : result.items.filter(function (v) { return v._id === dialogId; });
|
|
18116
18143
|
current = dialogs && dialogs.length > 0 ? dialogs[0] : undefined;
|
|
18117
18144
|
return [4 /*yield*/, this.getCurrentDialogDTOMapper().toTDO(current)];
|
|
18118
18145
|
case 1:
|
|
18119
|
-
dialogDTO =
|
|
18146
|
+
dialogDTO = _a.sent();
|
|
18120
18147
|
dialogsDTOtoEntityMapper = new _mapper_DialogRemoteDTOMapper__WEBPACK_IMPORTED_MODULE_12__.DialogRemoteDTOMapper();
|
|
18121
18148
|
return [4 /*yield*/, dialogsDTOtoEntityMapper.toEntity(dialogDTO)];
|
|
18122
18149
|
case 2:
|
|
18123
|
-
dialogEntity =
|
|
18150
|
+
dialogEntity = _a.sent();
|
|
18124
18151
|
resultMessage = {
|
|
18125
18152
|
eventMessageType: _Domain_entity_EventMessageType__WEBPACK_IMPORTED_MODULE_16__["default"].LocalMessage,
|
|
18126
18153
|
dialogInfo: dialogEntity,
|
|
@@ -18327,10 +18354,11 @@ var RemoteDataSource = /** @class */ (function () {
|
|
|
18327
18354
|
});
|
|
18328
18355
|
};
|
|
18329
18356
|
RemoteDataSource.prototype.getDialogs = function (pagination) {
|
|
18357
|
+
var _a;
|
|
18330
18358
|
return __awaiter(this, void 0, void 0, function () {
|
|
18331
|
-
var currentPagination, pageNumber, perPage, params, dialogsDTO, qbDialogs, _i,
|
|
18332
|
-
return __generator(this, function (
|
|
18333
|
-
switch (
|
|
18359
|
+
var currentPagination, pageNumber, perPage, params, dialogsDTO, qbDialogs, _i, _b, item, qbEntity, newDTO, currentUserId, statusMessageParams;
|
|
18360
|
+
return __generator(this, function (_c) {
|
|
18361
|
+
switch (_c.label) {
|
|
18334
18362
|
case 0:
|
|
18335
18363
|
currentPagination = pagination || new _Domain_repository_Pagination__WEBPACK_IMPORTED_MODULE_6__.Pagination();
|
|
18336
18364
|
console.log('call getDialogs in RemoteDataSourceMock param pagination: ', JSON.stringify(pagination));
|
|
@@ -18357,24 +18385,24 @@ var RemoteDataSource = /** @class */ (function () {
|
|
|
18357
18385
|
dialogsDTO = [];
|
|
18358
18386
|
return [4 /*yield*/, (0,_qb_api_calls__WEBPACK_IMPORTED_MODULE_9__.QBGetDialogs)(params)];
|
|
18359
18387
|
case 1:
|
|
18360
|
-
qbDialogs =
|
|
18388
|
+
qbDialogs = _c.sent();
|
|
18361
18389
|
if (!qbDialogs) return [3 /*break*/, 7];
|
|
18362
18390
|
console.log("request completed. have: total_entries ".concat(qbDialogs.total_entries, ", limit: ").concat(qbDialogs.limit, ", skip: ").concat(qbDialogs.skip, " items: ").concat(JSON.stringify(qbDialogs.items)));
|
|
18363
18391
|
currentPagination = new _Domain_repository_Pagination__WEBPACK_IMPORTED_MODULE_6__.Pagination(0, perPage);
|
|
18364
18392
|
currentPagination.totalPages = qbDialogs.total_entries / perPage;
|
|
18365
18393
|
currentPagination.setCurrentPage(pageNumber);
|
|
18366
|
-
_i = 0,
|
|
18367
|
-
|
|
18394
|
+
_i = 0, _b = qbDialogs.items;
|
|
18395
|
+
_c.label = 2;
|
|
18368
18396
|
case 2:
|
|
18369
|
-
if (!(_i <
|
|
18370
|
-
item =
|
|
18397
|
+
if (!(_i < _b.length)) return [3 /*break*/, 7];
|
|
18398
|
+
item = _b[_i];
|
|
18371
18399
|
qbEntity = item;
|
|
18372
18400
|
// eslint-disable-next-line no-await-in-loop
|
|
18373
18401
|
return [4 /*yield*/, this.getCurrentDialogDTOMapper().toTDO(qbEntity)];
|
|
18374
18402
|
case 3:
|
|
18375
18403
|
newDTO =
|
|
18376
18404
|
// eslint-disable-next-line no-await-in-loop
|
|
18377
|
-
|
|
18405
|
+
_c.sent();
|
|
18378
18406
|
if (!(newDTO.type === _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_14__.DialogType.group)) return [3 /*break*/, 5];
|
|
18379
18407
|
// eslint-disable-next-line no-await-in-loop
|
|
18380
18408
|
return [4 /*yield*/, (0,_qb_api_calls__WEBPACK_IMPORTED_MODULE_9__.QBJoinGroupDialog)(newDTO.id).catch(function () {
|
|
@@ -18382,12 +18410,19 @@ var RemoteDataSource = /** @class */ (function () {
|
|
|
18382
18410
|
})];
|
|
18383
18411
|
case 4:
|
|
18384
18412
|
// eslint-disable-next-line no-await-in-loop
|
|
18385
|
-
|
|
18386
|
-
|
|
18413
|
+
_c.sent();
|
|
18414
|
+
_c.label = 5;
|
|
18387
18415
|
case 5:
|
|
18388
|
-
|
|
18416
|
+
currentUserId = ((_a = this._authInformation) === null || _a === void 0 ? void 0 : _a.userId) || 0;
|
|
18417
|
+
statusMessageParams = {
|
|
18418
|
+
userId: newDTO.lastMessageUserId || currentUserId,
|
|
18419
|
+
dialogId: newDTO.id,
|
|
18420
|
+
messageId: newDTO.lastMessageId,
|
|
18421
|
+
};
|
|
18422
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
18423
|
+
(0,_qb_api_calls__WEBPACK_IMPORTED_MODULE_9__.QBChatMarkMessageDelivered)(statusMessageParams);
|
|
18389
18424
|
dialogsDTO.push(newDTO);
|
|
18390
|
-
|
|
18425
|
+
_c.label = 6;
|
|
18391
18426
|
case 6:
|
|
18392
18427
|
_i++;
|
|
18393
18428
|
return [3 /*break*/, 2];
|
|
@@ -23701,7 +23736,7 @@ function MessageItem(_a) {
|
|
|
23701
23736
|
}
|
|
23702
23737
|
function renderAdditionalPart(currentMessageType, item) {
|
|
23703
23738
|
var _a;
|
|
23704
|
-
return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", __assign({ className: "message-item-additional-part__actions" }, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_MessageContextMenu_MessageContextMenu__WEBPACK_IMPORTED_MODULE_7__["default"], { message: message, onReply: onReply, onForward: onForward, enableReplying: enableReplying, enableForwarding: enableForwarding, disableActions: disableAction }), currentMessageType === 'incoming' && ((_a = state[item.id]) === null || _a === void 0 ? void 0 : _a.loading) && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_ui_components_Loader_Loader__WEBPACK_IMPORTED_MODULE_9__["default"], { size: "sm", className: "message-item-additional-part__loader" })), currentMessageType === 'incoming' &&
|
|
23739
|
+
return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", __assign({ className: "message-item-additional-part__actions" }, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_MessageContextMenu_MessageContextMenu__WEBPACK_IMPORTED_MODULE_7__["default"], { message: message, onReply: function () { return onReply(item); }, onForward: function () { return onForward(item); }, enableReplying: enableReplying, enableForwarding: enableForwarding, disableActions: disableAction }), currentMessageType === 'incoming' && ((_a = state[item.id]) === null || _a === void 0 ? void 0 : _a.loading) && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_ui_components_Loader_Loader__WEBPACK_IMPORTED_MODULE_9__["default"], { size: "sm", className: "message-item-additional-part__loader" })), currentMessageType === 'incoming' &&
|
|
23705
23740
|
!(item.attachments && item.attachments.length > 0) &&
|
|
23706
23741
|
AIAssistWidget && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_AIComponents_AIAssist_AIAssist__WEBPACK_IMPORTED_MODULE_6__["default"], { disableAction: disableAction, AIAssistWidget: AIAssistWidget, loading: state[item.id] && state[item.id].loading
|
|
23707
23742
|
? state[item.id].loading
|
|
@@ -23804,6 +23839,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
23804
23839
|
/* harmony import */ var _Data_Creator__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../../../Data/Creator */ "./src/Data/Creator.ts");
|
|
23805
23840
|
/* harmony import */ var _Data_DefaultConfigurations__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../../../Data/DefaultConfigurations */ "./src/Data/DefaultConfigurations.ts");
|
|
23806
23841
|
/* harmony import */ var _Data_source_remote_Mapper_MessageDTOMapper__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../../../Data/source/remote/Mapper/MessageDTOMapper */ "./src/Data/source/remote/Mapper/MessageDTOMapper.ts");
|
|
23842
|
+
/* harmony import */ var _Domain_use_cases_UpdateCurrentDialogInDataSourceUseCase__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../../../Domain/use_cases/UpdateCurrentDialogInDataSourceUseCase */ "./src/Domain/use_cases/UpdateCurrentDialogInDataSourceUseCase.ts");
|
|
23807
23843
|
var __assign = (undefined && undefined.__assign) || function () {
|
|
23808
23844
|
__assign = Object.assign || function(t) {
|
|
23809
23845
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
@@ -23882,6 +23918,7 @@ var __spreadArray = (undefined && undefined.__spreadArray) || function (to, from
|
|
|
23882
23918
|
|
|
23883
23919
|
|
|
23884
23920
|
|
|
23921
|
+
|
|
23885
23922
|
|
|
23886
23923
|
|
|
23887
23924
|
function useDialogViewModel(dialogType, dialogEntity) {
|
|
@@ -23897,6 +23934,7 @@ function useDialogViewModel(dialogType, dialogEntity) {
|
|
|
23897
23934
|
var _f = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(dialogEntity), dialog = _f[0], setDialog = _f[1];
|
|
23898
23935
|
// const [dialogsParticipants, setDialogsParticipants] = useState<number[]>([]);
|
|
23899
23936
|
var currentContext = (0,_providers_QuickBloxUIKitProvider_useQbInitializedDataContext__WEBPACK_IMPORTED_MODULE_2__["default"])();
|
|
23937
|
+
var remoteDataSourceMock = currentContext.storage.REMOTE_DATA_SOURCE;
|
|
23900
23938
|
var QBConfig = currentContext.InitParams.qbConfig ||
|
|
23901
23939
|
_Data_DefaultConfigurations__WEBPACK_IMPORTED_MODULE_22__.DefaultConfigurations.getDefaultQBConfig();
|
|
23902
23940
|
var regexUserName = QBConfig.appConfig.regexUserName;
|
|
@@ -24048,11 +24086,10 @@ function useDialogViewModel(dialogType, dialogEntity) {
|
|
|
24048
24086
|
var newState = __spreadArray([], prevState, true);
|
|
24049
24087
|
if (newState.find(function (it) { return it.id === dialogInfo.messageStatus.messageId; })) {
|
|
24050
24088
|
newState = newState.map(function (elem) {
|
|
24051
|
-
var
|
|
24052
|
-
|
|
24053
|
-
|
|
24054
|
-
dialogInfo.messageStatus.userId,
|
|
24055
|
-
], false) });
|
|
24089
|
+
var _a, _b;
|
|
24090
|
+
var v = __assign(__assign({}, elem), { read_ids: ((_a = dialogInfo.messageStatus) === null || _a === void 0 ? void 0 : _a.deliveryStatus) === 'read'
|
|
24091
|
+
? __spreadArray(__spreadArray([], elem.read_ids, true), [dialogInfo.messageStatus.userId], false) : __spreadArray([], elem.read_ids, true), delivered_ids: ((_b = dialogInfo.messageStatus) === null || _b === void 0 ? void 0 : _b.deliveryStatus) === 'delivered'
|
|
24092
|
+
? __spreadArray(__spreadArray([], elem.delivered_ids, true), [dialogInfo.messageStatus.userId], false) : __spreadArray([], elem.delivered_ids, true) });
|
|
24056
24093
|
return v;
|
|
24057
24094
|
});
|
|
24058
24095
|
}
|
|
@@ -24151,6 +24188,14 @@ function useDialogViewModel(dialogType, dialogEntity) {
|
|
|
24151
24188
|
}
|
|
24152
24189
|
});
|
|
24153
24190
|
}); };
|
|
24191
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/no-empty-function
|
|
24192
|
+
function informDataSources(item) {
|
|
24193
|
+
var updateCurrentDialogInDataSourceUseCase = new _Domain_use_cases_UpdateCurrentDialogInDataSourceUseCase__WEBPACK_IMPORTED_MODULE_24__.UpdateCurrentDialogInDataSourceUseCase(new _Data_repository_DialogsRepository__WEBPACK_IMPORTED_MODULE_17__["default"](currentContext.storage.LOCAL_DATA_SOURCE, remoteDataSourceMock), item);
|
|
24194
|
+
updateCurrentDialogInDataSourceUseCase.execute().catch(function (e) {
|
|
24195
|
+
console.log('useDialogViewModel Error updateCurrentDialogInDataSourceUseCase: ', (0,_utils_parse__WEBPACK_IMPORTED_MODULE_10__.stringifyError)(e));
|
|
24196
|
+
throw new Error((0,_utils_parse__WEBPACK_IMPORTED_MODULE_10__.stringifyError)(e));
|
|
24197
|
+
});
|
|
24198
|
+
}
|
|
24154
24199
|
var sendMessage = function (messageToSend) {
|
|
24155
24200
|
var sendTextMessageUseCase = new _Domain_use_cases_SendTextMessageUseCase__WEBPACK_IMPORTED_MODULE_11__.SendTextMessageUseCase(new _Data_repository_MessagesRepository__WEBPACK_IMPORTED_MODULE_6__["default"](LOCAL_DATA_SOURCE, REMOTE_DATA_SOURCE), messageToSend);
|
|
24156
24201
|
// eslint-disable-next-line promise/catch-or-return
|
|
@@ -24173,10 +24218,14 @@ function useDialogViewModel(dialogType, dialogEntity) {
|
|
|
24173
24218
|
});
|
|
24174
24219
|
if ((dialog === null || dialog === void 0 ? void 0 : dialog.type) === _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_1__.DialogType["private"]) {
|
|
24175
24220
|
var updDialog = __assign({}, dialog);
|
|
24176
|
-
updDialog.lastMessage.dateSent = messageEntity.date_sent;
|
|
24221
|
+
updDialog.lastMessage.dateSent = messageEntity.date_sent / 1000;
|
|
24177
24222
|
updDialog.lastMessage.text = messageEntity.message;
|
|
24178
24223
|
updDialog.lastMessage.userId = messageEntity.sender_id;
|
|
24224
|
+
updDialog.unreadMessageCount = 0;
|
|
24179
24225
|
setDialog(updDialog);
|
|
24226
|
+
//
|
|
24227
|
+
informDataSources(updDialog);
|
|
24228
|
+
//
|
|
24180
24229
|
}
|
|
24181
24230
|
});
|
|
24182
24231
|
//
|
|
@@ -24268,72 +24317,6 @@ function useDialogViewModel(dialogType, dialogEntity) {
|
|
|
24268
24317
|
}
|
|
24269
24318
|
});
|
|
24270
24319
|
}); };
|
|
24271
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
24272
|
-
// const sendAttachmentMessage = async (newMessage: File): Promise<boolean> => {
|
|
24273
|
-
// console.log('call sendTextMessage');
|
|
24274
|
-
// setLoading(true);
|
|
24275
|
-
// const currentUserId = REMOTE_DATA_SOURCE.authInformation?.userId || 0;
|
|
24276
|
-
//
|
|
24277
|
-
// try {
|
|
24278
|
-
// await uploadFile(newMessage)
|
|
24279
|
-
// // eslint-disable-next-line promise/always-return
|
|
24280
|
-
// .then((fileMessage: FileEntity) => {
|
|
24281
|
-
// console.log(JSON.stringify(fileMessage));
|
|
24282
|
-
//
|
|
24283
|
-
// const recipientId =
|
|
24284
|
-
// dialog.type === DialogType.private
|
|
24285
|
-
// ? (dialog as PrivateDialogEntity).participantId
|
|
24286
|
-
// : currentUserId;
|
|
24287
|
-
//
|
|
24288
|
-
// // eslint-disable-next-line promise/always-return
|
|
24289
|
-
// const messageBody = fileMessage.name || '[attachment]';
|
|
24290
|
-
// //
|
|
24291
|
-
// const messageEntityParams: MessageEntityParams = {
|
|
24292
|
-
// dialogId: dialog.id,
|
|
24293
|
-
// message: messageBody,
|
|
24294
|
-
// sender_id: currentUserId,
|
|
24295
|
-
// recipient_id: recipientId,
|
|
24296
|
-
// dialog_type: DialogType.group,
|
|
24297
|
-
// };
|
|
24298
|
-
// const messageToSend: MessageEntity =
|
|
24299
|
-
// Creator.createMessageEntity(messageEntityParams);
|
|
24300
|
-
// //
|
|
24301
|
-
//
|
|
24302
|
-
// messageToSend.dialogType = dialog.type;
|
|
24303
|
-
// const attachments: ChatMessageAttachmentEntity[] = [
|
|
24304
|
-
// {
|
|
24305
|
-
// id: fileMessage.id as string,
|
|
24306
|
-
// uid: fileMessage.uid,
|
|
24307
|
-
// type: fileMessage.type!,
|
|
24308
|
-
// file: fileMessage,
|
|
24309
|
-
// name: fileMessage.name,
|
|
24310
|
-
// size: fileMessage.size,
|
|
24311
|
-
// url: fileMessage.url,
|
|
24312
|
-
// },
|
|
24313
|
-
// ];
|
|
24314
|
-
//
|
|
24315
|
-
// messageToSend.attachments = attachments;
|
|
24316
|
-
//
|
|
24317
|
-
// messageToSend.message = `MediaContentEntity|${messageBody}|${
|
|
24318
|
-
// fileMessage.uid
|
|
24319
|
-
// }|${fileMessage.type!.toString()}`;
|
|
24320
|
-
// sendMessage(messageToSend);
|
|
24321
|
-
// //
|
|
24322
|
-
// })
|
|
24323
|
-
// .catch((reason) => {
|
|
24324
|
-
// setLoading(false);
|
|
24325
|
-
// const errorMessage = stringifyError(reason);
|
|
24326
|
-
//
|
|
24327
|
-
// console.log('EXCEPTION in sendAttachmentMessage', errorMessage);
|
|
24328
|
-
//
|
|
24329
|
-
// throw new Error(errorMessage);
|
|
24330
|
-
// });
|
|
24331
|
-
// } catch (e) {
|
|
24332
|
-
// return false;
|
|
24333
|
-
// }
|
|
24334
|
-
//
|
|
24335
|
-
// return true;
|
|
24336
|
-
// };
|
|
24337
24320
|
var forwardMessage = function (targetDialogs, messagesToForward, relatedMessage) { return __awaiter(_this, void 0, void 0, function () {
|
|
24338
24321
|
var userName, forwardMessagesUseCase;
|
|
24339
24322
|
var _a;
|
|
@@ -24504,80 +24487,6 @@ function useDialogViewModel(dialogType, dialogEntity) {
|
|
|
24504
24487
|
}
|
|
24505
24488
|
});
|
|
24506
24489
|
}); };
|
|
24507
|
-
// const sendReplyMessages = async (
|
|
24508
|
-
// replyData: ReplyMessagesParams,
|
|
24509
|
-
// // eslint-disable-next-line @typescript-eslint/require-await
|
|
24510
|
-
// ): Promise<boolean> => {
|
|
24511
|
-
// setLoading(true);
|
|
24512
|
-
// const currentUserId = REMOTE_DATA_SOURCE.authInformation?.userId || 0;
|
|
24513
|
-
// const messageEntityParams: MessageEntityParams = {
|
|
24514
|
-
// dialogId: dialog.id,
|
|
24515
|
-
// message: replyData.relatedTextMessage || '',
|
|
24516
|
-
// sender_id: currentUserId,
|
|
24517
|
-
// recipient_id:
|
|
24518
|
-
// // eslint-disable-next-line promise/always-return
|
|
24519
|
-
// dialog.type === DialogType.private
|
|
24520
|
-
// ? (dialog as PrivateDialogEntity).participantId
|
|
24521
|
-
// : currentUserId,
|
|
24522
|
-
// dialog_type: DialogType.group,
|
|
24523
|
-
// };
|
|
24524
|
-
// const relatedMessage: MessageEntity =
|
|
24525
|
-
// Creator.createMessageEntity(messageEntityParams);
|
|
24526
|
-
//
|
|
24527
|
-
// relatedMessage.dialogType = dialog.type;
|
|
24528
|
-
//
|
|
24529
|
-
// let resultOperation = true;
|
|
24530
|
-
//
|
|
24531
|
-
// if (replyData.relatedFileMessage) {
|
|
24532
|
-
// try {
|
|
24533
|
-
// await uploadFile(replyData.relatedFileMessage)
|
|
24534
|
-
// .then(async (fileMessage: FileEntity) => {
|
|
24535
|
-
// const attachments: ChatMessageAttachmentEntity[] = [
|
|
24536
|
-
// {
|
|
24537
|
-
// id: fileMessage.id as string,
|
|
24538
|
-
// uid: fileMessage.uid,
|
|
24539
|
-
// type: fileMessage.type!,
|
|
24540
|
-
// file: fileMessage,
|
|
24541
|
-
// name: fileMessage.name,
|
|
24542
|
-
// size: fileMessage.size,
|
|
24543
|
-
// url: fileMessage.url,
|
|
24544
|
-
// },
|
|
24545
|
-
// ];
|
|
24546
|
-
//
|
|
24547
|
-
// relatedMessage.attachments = attachments;
|
|
24548
|
-
//
|
|
24549
|
-
// await replyMessage(replyData.messagesToReply, relatedMessage);
|
|
24550
|
-
// resultOperation = true;
|
|
24551
|
-
//
|
|
24552
|
-
// return resultOperation;
|
|
24553
|
-
// //
|
|
24554
|
-
// })
|
|
24555
|
-
// .catch((reason) => {
|
|
24556
|
-
// setLoading(false);
|
|
24557
|
-
// const errorMessage = stringifyError(reason);
|
|
24558
|
-
//
|
|
24559
|
-
// console.log('EXCEPTION in sendAttachmentMessage', errorMessage);
|
|
24560
|
-
// resultOperation = false;
|
|
24561
|
-
// throw new Error(errorMessage);
|
|
24562
|
-
// });
|
|
24563
|
-
// } catch (e) {
|
|
24564
|
-
// resultOperation = false;
|
|
24565
|
-
//
|
|
24566
|
-
// return resultOperation;
|
|
24567
|
-
// }
|
|
24568
|
-
// } else {
|
|
24569
|
-
// await replyMessage(replyData.messagesToReply, relatedMessage).catch(
|
|
24570
|
-
// () => {
|
|
24571
|
-
// resultOperation = false;
|
|
24572
|
-
//
|
|
24573
|
-
// return resultOperation;
|
|
24574
|
-
// },
|
|
24575
|
-
// );
|
|
24576
|
-
// }
|
|
24577
|
-
//
|
|
24578
|
-
// return resultOperation;
|
|
24579
|
-
// };
|
|
24580
|
-
//
|
|
24581
24490
|
return {
|
|
24582
24491
|
get entity() {
|
|
24583
24492
|
return dialog;
|
|
@@ -24738,6 +24647,7 @@ var DialogInfo = function (_a) {
|
|
|
24738
24647
|
if (!result) {
|
|
24739
24648
|
(0,react_toastify__WEBPACK_IMPORTED_MODULE_3__.toast)('Dialog have not been left');
|
|
24740
24649
|
}
|
|
24650
|
+
leaveModal.toggleModal();
|
|
24741
24651
|
})
|
|
24742
24652
|
.catch(function (e) {
|
|
24743
24653
|
console.log(e);
|
|
@@ -25955,6 +25865,9 @@ function useDialogListViewModel(currentContext, initPagination) {
|
|
|
25955
25865
|
})];
|
|
25956
25866
|
case 1:
|
|
25957
25867
|
leaveResult = _b.sent();
|
|
25868
|
+
if (leaveResult) {
|
|
25869
|
+
setNewDialog(undefined);
|
|
25870
|
+
}
|
|
25958
25871
|
return [3 /*break*/, 4];
|
|
25959
25872
|
case 2:
|
|
25960
25873
|
usersForDeleteFromDialog = new Array();
|
|
@@ -26899,7 +26812,7 @@ function useInviteMembersViewModel() {
|
|
|
26899
26812
|
};
|
|
26900
26813
|
return {
|
|
26901
26814
|
get entity() {
|
|
26902
|
-
return _Data_Stubs__WEBPACK_IMPORTED_MODULE_5__.Stubs.createUserEntityWithParams(0, '', '', '', '', '',
|
|
26815
|
+
return _Data_Stubs__WEBPACK_IMPORTED_MODULE_5__.Stubs.createUserEntityWithParams(0, '', '', '', '', '', '', '', '');
|
|
26903
26816
|
},
|
|
26904
26817
|
// id: Date.now(),
|
|
26905
26818
|
// name: '',
|
|
@@ -29565,11 +29478,16 @@ var QuickBloxUIKitDesktopLayout = function (_a) {
|
|
|
29565
29478
|
.participantId,
|
|
29566
29479
|
]
|
|
29567
29480
|
: [];
|
|
29481
|
+
if (!(participants.length > 0)) return [3 /*break*/, 2];
|
|
29568
29482
|
return [4 /*yield*/, userViewModel.getUserById(participants[0])];
|
|
29569
29483
|
case 1:
|
|
29570
29484
|
senderUser = _a.sent();
|
|
29571
29485
|
result = (senderUser === null || senderUser === void 0 ? void 0 : senderUser.photo) || '';
|
|
29572
|
-
return [
|
|
29486
|
+
return [3 /*break*/, 3];
|
|
29487
|
+
case 2:
|
|
29488
|
+
result = '';
|
|
29489
|
+
_a.label = 3;
|
|
29490
|
+
case 3: return [2 /*return*/, result];
|
|
29573
29491
|
}
|
|
29574
29492
|
});
|
|
29575
29493
|
}); };
|
|
@@ -29584,6 +29502,9 @@ var QuickBloxUIKitDesktopLayout = function (_a) {
|
|
|
29584
29502
|
if (tmpFileUrl && tmpFileUrl.length > 0) {
|
|
29585
29503
|
setDialogAvatarUrl(tmpFileUrl);
|
|
29586
29504
|
}
|
|
29505
|
+
else {
|
|
29506
|
+
setDialogAvatarUrl('');
|
|
29507
|
+
}
|
|
29587
29508
|
return [2 /*return*/];
|
|
29588
29509
|
}
|
|
29589
29510
|
});
|
|
@@ -29877,51 +29798,13 @@ var QuickBloxUIKitDesktopLayout = function (_a) {
|
|
|
29877
29798
|
});
|
|
29878
29799
|
}
|
|
29879
29800
|
};
|
|
29880
|
-
// // eslint-disable-next-line react/prop-types,@typescript-eslint/no-unused-vars
|
|
29881
|
-
// const defaultGetSenderName: GetUserNameFct = async (props: {
|
|
29882
|
-
// userId?: number;
|
|
29883
|
-
// sender?: UserEntity;
|
|
29884
|
-
// }): Promise<string | undefined> => {
|
|
29885
|
-
// let result = 'undefined user';
|
|
29886
|
-
//
|
|
29887
|
-
// // eslint-disable-next-line react/prop-types
|
|
29888
|
-
// if (!props.sender) {
|
|
29889
|
-
// // eslint-disable-next-line react/prop-types
|
|
29890
|
-
// if (props.userId && props.userId > 0) {
|
|
29891
|
-
// // eslint-disable-next-line react/prop-types,@typescript-eslint/no-unsafe-call
|
|
29892
|
-
// const senderUser = await userViewModel.getUserById(props.userId);
|
|
29893
|
-
//
|
|
29894
|
-
// if (!senderUser) {
|
|
29895
|
-
// return result;
|
|
29896
|
-
// }
|
|
29897
|
-
// result =
|
|
29898
|
-
// senderUser.full_name ||
|
|
29899
|
-
// senderUser.login ||
|
|
29900
|
-
// senderUser.email ||
|
|
29901
|
-
// // eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
29902
|
-
// senderUser.id.toString();
|
|
29903
|
-
// } else return result;
|
|
29904
|
-
// } else {
|
|
29905
|
-
// result =
|
|
29906
|
-
// // eslint-disable-next-line react/prop-types
|
|
29907
|
-
// props.sender.full_name ||
|
|
29908
|
-
// // eslint-disable-next-line react/prop-types
|
|
29909
|
-
// props.sender.login ||
|
|
29910
|
-
// // eslint-disable-next-line react/prop-types
|
|
29911
|
-
// props.sender.email ||
|
|
29912
|
-
// // eslint-disable-next-line react/prop-types
|
|
29913
|
-
// props.sender.id.toString();
|
|
29914
|
-
// }
|
|
29915
|
-
//
|
|
29916
|
-
// return result;
|
|
29917
|
-
// };
|
|
29918
29801
|
var createDialogHandler = function () {
|
|
29919
29802
|
if (isOnline) {
|
|
29920
29803
|
newModal.toggleModal();
|
|
29921
29804
|
}
|
|
29922
29805
|
};
|
|
29923
29806
|
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
|
|
29924
|
-
var codeVersion = '0.3.
|
|
29807
|
+
var codeVersion = '0.3.1';
|
|
29925
29808
|
console.log("React UIKit CODE VERSION IS ".concat(codeVersion));
|
|
29926
29809
|
if (isAuthProcessed()) {
|
|
29927
29810
|
var pagination = new _Domain_repository_Pagination__WEBPACK_IMPORTED_MODULE_11__.Pagination();
|
|
@@ -30004,8 +29887,8 @@ var QuickBloxUIKitDesktopLayout = function (_a) {
|
|
|
30004
29887
|
}
|
|
30005
29888
|
}, [isOnline]);
|
|
30006
29889
|
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
|
|
30007
|
-
getDialogPhotoFileForPreview();
|
|
30008
29890
|
if (dialogsViewModel.entity) {
|
|
29891
|
+
getDialogPhotoFileForPreview().catch();
|
|
30009
29892
|
userViewModel.entity = dialogsViewModel.entity;
|
|
30010
29893
|
}
|
|
30011
29894
|
return function () {
|
|
@@ -32601,10 +32484,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
32601
32484
|
/* harmony export */ });
|
|
32602
32485
|
var QBConfig = {
|
|
32603
32486
|
credentials: {
|
|
32604
|
-
appId:
|
|
32605
|
-
accountKey: '
|
|
32606
|
-
authKey: '
|
|
32607
|
-
authSecret: '
|
|
32487
|
+
appId: -1,
|
|
32488
|
+
accountKey: '',
|
|
32489
|
+
authKey: '',
|
|
32490
|
+
authSecret: '',
|
|
32608
32491
|
sessionToken: '',
|
|
32609
32492
|
},
|
|
32610
32493
|
configAIApi: {
|
|
@@ -32781,6 +32664,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
32781
32664
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
32782
32665
|
/* harmony export */ "QBChatConnect": () => (/* binding */ QBChatConnect),
|
|
32783
32666
|
/* harmony export */ "QBChatDisconnect": () => (/* binding */ QBChatDisconnect),
|
|
32667
|
+
/* harmony export */ "QBChatMarkMessageDelivered": () => (/* binding */ QBChatMarkMessageDelivered),
|
|
32784
32668
|
/* harmony export */ "QBChatMarkMessageRead": () => (/* binding */ QBChatMarkMessageRead),
|
|
32785
32669
|
/* harmony export */ "QBChatSendMessage": () => (/* binding */ QBChatSendMessage),
|
|
32786
32670
|
/* harmony export */ "QBChatSendSystemMessage": () => (/* binding */ QBChatSendSystemMessage),
|
|
@@ -33298,6 +33182,9 @@ function QBChatSendSystemMessage(to, message) {
|
|
|
33298
33182
|
function QBChatMarkMessageRead(params) {
|
|
33299
33183
|
quickblox_quickblox__WEBPACK_IMPORTED_MODULE_0___default().chat.sendReadStatus(params);
|
|
33300
33184
|
}
|
|
33185
|
+
function QBChatMarkMessageDelivered(params) {
|
|
33186
|
+
quickblox_quickblox__WEBPACK_IMPORTED_MODULE_0___default().chat.sendDeliveredStatus(params);
|
|
33187
|
+
}
|
|
33301
33188
|
function QBWebRTCSessionGetUserMedia(session, params) {
|
|
33302
33189
|
return new Promise(function (resolve, reject) {
|
|
33303
33190
|
session.getUserMedia(__assign({}, params), function (error, stream) {
|