agora-appbuilder-core 4.1.8-beta.5 → 4.1.8-beta.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agora-appbuilder-core",
3
- "version": "4.1.8-beta.5",
3
+ "version": "4.1.8-beta.6",
4
4
  "description": "React Native template for RTE app builder",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -77,8 +77,8 @@ const DefaultConfig = {
77
77
  CHAT_ORG_NAME: '',
78
78
  CHAT_APP_NAME: '',
79
79
  CHAT_URL: '',
80
- CLI_VERSION: '3.1.8-beta.5',
81
- CORE_VERSION: '4.1.8-beta.5',
80
+ CLI_VERSION: '3.1.8-beta.6',
81
+ CORE_VERSION: '4.1.8-beta.6',
82
82
  DISABLE_LANDSCAPE_MODE: false,
83
83
  STT_AUTO_START: false,
84
84
  CLOUD_RECORDING_AUTO_START: false,
@@ -103,7 +103,7 @@ import {
103
103
  toolbarItemTranscriptText,
104
104
  toolbarItemVirtualBackgroundText,
105
105
  toolbarItemWhiteboardText,
106
- toolbarItemManageTranscriptText,
106
+ toolbarItemManageTextTracksText,
107
107
  } from '../language/default-labels/videoCallScreenLabels';
108
108
  import {LogSource, logger} from '../logger/AppBuilderLogger';
109
109
  import {useModal} from '../utils/useModal';
@@ -116,7 +116,7 @@ import {
116
116
  InviteToolbarItem,
117
117
  ScreenshareToolbarItem,
118
118
  } from './controls/toolbar-items';
119
- import ViewSTTTranscriptModal from './stt-transcript/ViewSTTTranscriptModal';
119
+ import ViewTextTracksModal from './text-tracks/ViewTextTracksModal';
120
120
 
121
121
  export const useToggleWhiteboard = () => {
122
122
  const {
@@ -278,7 +278,9 @@ const MoreButton = (props: {fields: ToolbarMoreButtonDefaultFields}) => {
278
278
  const viewRecordingsLabel = useString<boolean>(
279
279
  toolbarItemViewRecordingText,
280
280
  )();
281
- const viewSTTLabel = useString<boolean>(toolbarItemManageTranscriptText)();
281
+ const viewTextTracksLabel = useString<boolean>(
282
+ toolbarItemManageTextTracksText,
283
+ )();
282
284
  const moreButtonLabel = useString(toolbarItemMoreText)();
283
285
  const virtualBackgroundLabel = useString(toolbarItemVirtualBackgroundText)();
284
286
  const chatLabel = useString(toolbarItemChatText)();
@@ -297,9 +299,9 @@ const MoreButton = (props: {fields: ToolbarMoreButtonDefaultFields}) => {
297
299
  toggle: toggleVRModal,
298
300
  } = useModal();
299
301
  const {
300
- modalOpen: isSTTTranscriptModalOpen,
301
- setModalOpen: setSTTTranscriptModalOpen,
302
- toggle: toggleSTTTranscriptModal,
302
+ modalOpen: isTextTrackModalOpen,
303
+ setModalOpen: setTextTrackModalOpen,
304
+ toggle: toggleTextTrackModal,
303
305
  } = useModal();
304
306
  const moreBtnRef = useRef(null);
305
307
  const {width: globalWidth, height: globalHeight} = useWindowDimensions();
@@ -814,20 +816,20 @@ const MoreButton = (props: {fields: ToolbarMoreButtonDefaultFields}) => {
814
816
  });
815
817
  }
816
818
 
817
- // 13. Transcripts to download
818
- const canAccessAllTranscripts =
819
- useControlPermissionMatrix('viewAllTranscripts');
819
+ // 13. Text-tracks to download
820
+ const canAccessAllTextTracks =
821
+ useControlPermissionMatrix('viewAllTextTracks');
820
822
 
821
- if (canAccessAllTranscripts) {
823
+ if (canAccessAllTextTracks) {
822
824
  actionMenuitems.push({
823
- componentName: 'view-all-transcripts',
825
+ componentName: 'view-all-text-tracks',
824
826
  order: 13,
825
827
  icon: 'transcript',
826
828
  iconColor: $config.SECONDARY_ACTION_COLOR,
827
829
  textColor: $config.FONT_COLOR,
828
- title: viewSTTLabel,
830
+ title: viewTextTracksLabel,
829
831
  onPress: () => {
830
- toggleSTTTranscriptModal();
832
+ toggleTextTrackModal();
831
833
  },
832
834
  });
833
835
  }
@@ -978,8 +980,8 @@ const MoreButton = (props: {fields: ToolbarMoreButtonDefaultFields}) => {
978
980
  )}
979
981
  </>
980
982
  )}
981
- {canAccessAllTranscripts && isSTTTranscriptModalOpen ? (
982
- <ViewSTTTranscriptModal setModalOpen={setSTTTranscriptModalOpen} />
983
+ {canAccessAllTextTracks && isTextTrackModalOpen ? (
984
+ <ViewTextTracksModal setModalOpen={setTextTrackModalOpen} />
983
985
  ) : (
984
986
  <></>
985
987
  )}
@@ -51,7 +51,6 @@ const GenericPopup: React.FC<ConfirmationModalProps> = ({
51
51
  onCancel && onCancel();
52
52
  };
53
53
  const handleConfirm = () => {
54
- setVisible(false);
55
54
  onConfirm();
56
55
  };
57
56
 
@@ -15,7 +15,7 @@ export type ControlPermissionKey =
15
15
  | 'participantControl'
16
16
  | 'screenshareControl'
17
17
  | 'settingsControl'
18
- | 'viewAllTranscripts';
18
+ | 'viewAllTextTracks';
19
19
 
20
20
  /**
21
21
  * ControlPermissionRule defines the properties used to evaluate permission rules.
@@ -36,7 +36,7 @@ export const controlPermissionMatrix: Record<
36
36
  settingsControl: ({preference}) => !preference.disableSettings,
37
37
  screenshareControl: ({preference}) =>
38
38
  $config.SCREEN_SHARING && !preference.disableScreenShare,
39
- viewAllTranscripts: ({isHost}) =>
39
+ viewAllTextTracks: ({isHost}) =>
40
40
  isHost &&
41
41
  $config.ENABLE_STT &&
42
42
  $config.ENABLE_MEETING_TRANSCRIPT &&
@@ -22,20 +22,24 @@ import PlatformWrapper from '../../utils/PlatformWrapper';
22
22
 
23
23
  const headers = ['Date', 'Time', 'Status', 'Actions'];
24
24
 
25
- interface STTItemRowProps {
25
+ interface TextTrackItemRowProps {
26
26
  item: FetchSTTTranscriptResponse['stts'][0];
27
27
  onDeleteAction: (id: string) => void;
28
28
  onDownloadAction: (link: string) => void;
29
29
  }
30
30
 
31
- function STTItemRow({item, onDeleteAction, onDownloadAction}: STTItemRowProps) {
31
+ function TextTrackItemRow({
32
+ item,
33
+ onDeleteAction,
34
+ onDownloadAction,
35
+ }: TextTrackItemRowProps) {
32
36
  const [date, time] = getFormattedDateTime(item.created_at);
33
- const sttStatus = item.status;
37
+ const textTrackStatus = item.status;
34
38
 
35
39
  if (
36
- sttStatus === 'STOPPING' ||
37
- sttStatus === 'STARTED' ||
38
- (sttStatus === 'INPROGRESS' && !item?.download_url)
40
+ textTrackStatus === 'STOPPING' ||
41
+ textTrackStatus === 'STARTED' ||
42
+ (textTrackStatus === 'INPROGRESS' && !item?.download_url)
39
43
  ) {
40
44
  return (
41
45
  <View key={item.id} style={style.pt12}>
@@ -63,12 +67,14 @@ function STTItemRow({item, onDeleteAction, onDownloadAction}: STTItemRowProps) {
63
67
  <Text style={style.ttime}>{time}</Text>
64
68
  </View>
65
69
  <View style={[style.td]}>
66
- <Text style={style.ttime}>{capitalizeFirstLetter(sttStatus)}</Text>
70
+ <Text style={style.ttime}>
71
+ {capitalizeFirstLetter(textTrackStatus)}
72
+ </Text>
67
73
  </View>
68
74
  <View style={style.td}>
69
75
  {!item.download_url ? (
70
76
  <View style={[style.tactions, {marginTop: 0}]}>
71
- <Text style={style.placeHolder}>{'No transcripts found'}</Text>
77
+ <Text style={style.placeHolder}>{'No text-tracks found'}</Text>
72
78
  </View>
73
79
  ) : item?.download_url?.length > 0 ? (
74
80
  <View style={style.tactions}>
@@ -165,7 +171,7 @@ function STTItemRow({item, onDeleteAction, onDownloadAction}: STTItemRowProps) {
165
171
  </View>
166
172
  ) : (
167
173
  <View style={(style.tactions, {marginTop: 0})}>
168
- <Text style={style.placeHolder}>No transcripts found</Text>
174
+ <Text style={style.placeHolder}>No text-tracks found</Text>
169
175
  </View>
170
176
  )}
171
177
  </View>
@@ -173,7 +179,7 @@ function STTItemRow({item, onDeleteAction, onDownloadAction}: STTItemRowProps) {
173
179
  );
174
180
  }
175
181
 
176
- function EmptyTranscriptState() {
182
+ function EmptyTextTrackState() {
177
183
  return (
178
184
  <View style={style.infotextContainer}>
179
185
  <View>
@@ -186,49 +192,47 @@ function EmptyTranscriptState() {
186
192
  </View>
187
193
  <View>
188
194
  <Text style={[style.infoText, style.pt10, style.pl10]}>
189
- No transcripts found for this meeting
195
+ No text-tracks found for this meeting
190
196
  </Text>
191
197
  </View>
192
198
  </View>
193
199
  );
194
200
  }
195
201
 
196
- function ErrorTranscriptState({message}: {message: string}) {
202
+ function ErrorTextTrackState({message}: {message: string}) {
197
203
  return <Text style={[style.ttime, style.pv10, style.ph20]}>{message}</Text>;
198
204
  }
199
205
 
200
- function STTTranscriptTable() {
206
+ function TextTracksTable() {
201
207
  const {
202
208
  status,
203
209
  stts,
204
210
  pagination,
205
- error,
211
+ error: fetchTranscriptError,
206
212
  currentPage,
207
213
  setCurrentPage,
208
214
  deleteTranscript,
209
215
  } = useFetchSTTTranscript();
210
216
 
211
- // id of STT transcript to delete
212
- const [sttIdToDelete, setSTTIdToDelete] = React.useState<string | undefined>(
213
- undefined,
214
- );
217
+ // id of text-tracj to delete
218
+ const [textTrackIdToDelete, setTextTrackIdToDelete] = React.useState<
219
+ string | undefined
220
+ >(undefined);
215
221
 
216
222
  // message for any download‐error popup
217
- const [downloadError, setDownloadError] = React.useState<
218
- string | undefined
219
- >();
223
+ const [errorSnack, setErrorSnack] = React.useState<string | undefined>();
220
224
 
221
225
  if (status === 'rejected') {
222
- return <ErrorTranscriptState message={error?.message} />;
226
+ return <ErrorTextTrackState message={fetchTranscriptError?.message} />;
223
227
  }
224
228
 
225
- const onDeleteSTTRecord = async () => {
229
+ const onDeleteTextTrackRecord = async (trackId: string) => {
226
230
  try {
227
- await deleteTranscript(sttIdToDelete!);
231
+ await deleteTranscript(trackId!);
228
232
  } catch (err: any) {
229
- setDownloadError(err.message);
233
+ setErrorSnack(err.message);
230
234
  } finally {
231
- setSTTIdToDelete(undefined);
235
+ setTextTrackIdToDelete(undefined);
232
236
  }
233
237
  };
234
238
 
@@ -240,23 +244,23 @@ function STTTranscriptTable() {
240
244
  status={status}
241
245
  items={stts}
242
246
  loadingComponent={
243
- <Loading background="transparent" text="Fetching transcripts.." />
247
+ <Loading background="transparent" text="Fetching text-tracks.." />
244
248
  }
245
249
  renderRow={item => (
246
- <STTItemRow
250
+ <TextTrackItemRow
247
251
  key={item.id}
248
252
  item={item}
249
253
  onDeleteAction={id => {
250
- setSTTIdToDelete(id);
254
+ setTextTrackIdToDelete(id);
251
255
  }}
252
256
  onDownloadAction={link => {
253
257
  downloadS3Link(link).catch((err: Error) => {
254
- setDownloadError(err.message || 'Download failed');
258
+ setErrorSnack(err.message || 'Download failed');
255
259
  });
256
260
  }}
257
261
  />
258
262
  )}
259
- emptyComponent={<EmptyTranscriptState />}
263
+ emptyComponent={<EmptyTextTrackState />}
260
264
  />
261
265
  <TableFooter
262
266
  currentPage={currentPage}
@@ -264,32 +268,36 @@ function STTTranscriptTable() {
264
268
  pagination={pagination}
265
269
  />
266
270
  </View>
267
- {sttIdToDelete && (
271
+ {textTrackIdToDelete && (
268
272
  <GenericPopup
269
273
  title="Delete ? "
270
274
  variant="error"
271
- message="Are you sure want to delete the transcript ? This action can't be undone."
272
- visible={!!sttIdToDelete}
273
- setVisible={() => setSTTIdToDelete(undefined)}
274
- onConfirm={onDeleteSTTRecord}
275
+ message="Are you sure want to delete the text-track ? This action can't be undone."
276
+ visible={!!textTrackIdToDelete}
277
+ setVisible={() => setTextTrackIdToDelete(undefined)}
278
+ onConfirm={() => {
279
+ const idToDelete = textTrackIdToDelete;
280
+ setTextTrackIdToDelete(undefined);
281
+ onDeleteTextTrackRecord(idToDelete);
282
+ }}
275
283
  onCancel={() => {
276
- setSTTIdToDelete(undefined);
284
+ setTextTrackIdToDelete(undefined);
277
285
  }}
278
286
  />
279
287
  )}
280
288
  {/** DOWNLOAD ERROR POPUP **/}
281
- {downloadError && (
289
+ {errorSnack && (
282
290
  <GenericPopup
283
- title="Download Error"
291
+ title="Error"
284
292
  variant="error"
285
- message={downloadError}
293
+ message={errorSnack}
286
294
  visible={true}
287
- setVisible={() => setDownloadError(undefined)}
288
- onConfirm={() => setDownloadError(undefined)}
295
+ setVisible={() => setErrorSnack(undefined)}
296
+ onConfirm={() => setErrorSnack(undefined)}
289
297
  />
290
298
  )}
291
299
  </>
292
300
  );
293
301
  }
294
302
 
295
- export default STTTranscriptTable;
303
+ export default TextTracksTable;
@@ -1,29 +1,29 @@
1
1
  import React, {SetStateAction, Dispatch} from 'react';
2
2
  import {View, StyleSheet} from 'react-native';
3
3
  import {useString} from '../../utils/useString';
4
- import {transcriptModalTitleIntn} from '../../language/default-labels/videoCallScreenLabels';
4
+ import {textTrackModalTitleIntn} from '../../language/default-labels/videoCallScreenLabels';
5
5
  import GenericModal from '../common/GenericModal';
6
- import STTTranscriptTable from './STTTranscriptTable';
6
+ import TextTracksTable from './TextTracksTable';
7
7
 
8
- interface ViewSTTModalProps {
8
+ interface ViewTextTracksModalProps {
9
9
  setModalOpen: Dispatch<SetStateAction<boolean>>;
10
10
  }
11
11
 
12
- export default function ViewSTTTranscriptModal(props: ViewSTTModalProps) {
12
+ export default function ViewTextTracksModal(props: ViewTextTracksModalProps) {
13
13
  const {setModalOpen} = props;
14
14
 
15
- const transcriptModalTitle = useString(transcriptModalTitleIntn)();
15
+ const textTrackModalTitle = useString(textTrackModalTitleIntn)();
16
16
 
17
17
  return (
18
18
  <GenericModal
19
19
  visible={true}
20
20
  onRequestClose={() => setModalOpen(false)}
21
21
  showCloseIcon={true}
22
- title={transcriptModalTitle}
22
+ title={textTrackModalTitle}
23
23
  cancelable={false}
24
24
  contentContainerStyle={style.contentContainer}>
25
25
  <View style={style.fullBody}>
26
- <STTTranscriptTable />
26
+ <TextTracksTable />
27
27
  </View>
28
28
  </GenericModal>
29
29
  );
@@ -134,6 +134,9 @@ export function useFetchSTTTranscript(defaultLimit = 10) {
134
134
 
135
135
  const deleteTranscript = useCallback(
136
136
  async (id: string) => {
137
+ const requestId = getUniqueID();
138
+ const start = Date.now();
139
+
137
140
  const res = await fetch(
138
141
  `${
139
142
  $config.BACKEND_ENDPOINT
@@ -142,15 +145,43 @@ export function useFetchSTTTranscript(defaultLimit = 10) {
142
145
  )}`,
143
146
  {
144
147
  method: 'DELETE',
145
- headers: {'Content-Type': 'application/json'},
148
+ headers: {
149
+ 'Content-Type': 'application/json',
150
+ authorization: store.token ? `Bearer ${store.token}` : '',
151
+ 'X-Request-Id': requestId,
152
+ 'X-Session-Id': logger.getSessionId(),
153
+ },
146
154
  },
147
155
  );
156
+ const end = Date.now();
157
+
148
158
  if (!res.ok) {
149
- const body = await res.json();
150
- throw new Error(
151
- body?.error?.message ?? `Delete failed (${res.status})`,
159
+ logger.error(
160
+ LogSource.NetworkRest,
161
+ 'stt-transcript',
162
+ 'Deleting STT transcripts failed',
163
+ {
164
+ json: '',
165
+ start,
166
+ end,
167
+ latency: end - start,
168
+ requestId,
169
+ },
152
170
  );
171
+ throw new Error(`Delete failed (${res.status})`);
153
172
  }
173
+ logger.debug(
174
+ LogSource.NetworkRest,
175
+ 'stt-transcript',
176
+ 'Deleted STT transcripts',
177
+ {
178
+ json: '',
179
+ start,
180
+ end,
181
+ latency: end - start,
182
+ requestId,
183
+ },
184
+ );
154
185
  // optimistic update local state:
155
186
  setState(prev => {
156
187
  // remove the deleted item
@@ -175,7 +206,7 @@ export function useFetchSTTTranscript(defaultLimit = 10) {
175
206
  };
176
207
  });
177
208
  },
178
- [roomId.host],
209
+ [roomId.host, store?.token],
179
210
  );
180
211
 
181
212
  useEffect(() => {
@@ -109,8 +109,8 @@ export const toolbarItemNoiseCancellationText =
109
109
  export const toolbarItemWhiteboardText = 'toolbarItemWhiteboardText';
110
110
  export const toolbarItemCaptionText = 'toolbarItemCaptionText';
111
111
  export const toolbarItemTranscriptText = 'toolbarItemTranscriptText';
112
- export const toolbarItemManageTranscriptText =
113
- 'toolbarItemManageTranscriptText';
112
+ export const toolbarItemManageTextTracksText =
113
+ 'toolbarItemManageTextTracksText';
114
114
  export const toolbarItemVirtualBackgroundText =
115
115
  'toolbarItemVirtualBackgroundText';
116
116
  export const toolbarItemViewRecordingText = 'toolbarItemViewRecordingText';
@@ -151,7 +151,7 @@ export const nativeStopScreensharePopupPrimaryBtnText =
151
151
  'nativeStopScreensharePopupPrimaryBtnText';
152
152
 
153
153
  export const recordingModalTitleIntn = 'recordingModalTitleIntn';
154
- export const transcriptModalTitleIntn = 'transcriptModalTitleIntn';
154
+ export const textTrackModalTitleIntn = 'textTrackModalTitleIntn';
155
155
  export const stopRecordingPopupHeading = 'stopRecordingPopupHeading';
156
156
  export const stopRecordingPopupSubHeading = 'stopRecordingPopupSubHeading';
157
157
  export const stopRecordingPopupPrimaryBtnText =
@@ -573,7 +573,7 @@ export interface I18nVideoCallScreenLabelsInterface {
573
573
  [toolbarItemWhiteboardText]?: I18nConditionalType;
574
574
  [toolbarItemCaptionText]?: I18nConditionalType;
575
575
  [toolbarItemTranscriptText]?: I18nConditionalType;
576
- [toolbarItemManageTranscriptText]?: I18nConditionalType;
576
+ [toolbarItemManageTextTracksText]?: I18nConditionalType;
577
577
  [toolbarItemVirtualBackgroundText]?: I18nBaseType;
578
578
  [toolbarItemViewRecordingText]?: I18nConditionalType;
579
579
 
@@ -609,7 +609,7 @@ export interface I18nVideoCallScreenLabelsInterface {
609
609
  [nativeStopScreensharePopupPrimaryBtnText]?: I18nBaseType;
610
610
 
611
611
  [recordingModalTitleIntn]?: I18nBaseType;
612
- [transcriptModalTitleIntn]?: I18nBaseType;
612
+ [textTrackModalTitleIntn]?: I18nBaseType;
613
613
  [stopRecordingPopupHeading]?: I18nBaseType;
614
614
  [stopRecordingPopupSubHeading]?: I18nBaseType;
615
615
  [stopRecordingPopupPrimaryBtnText]?: I18nBaseType;
@@ -942,7 +942,7 @@ export const VideoCallScreenLabels: I18nVideoCallScreenLabelsInterface = {
942
942
  [toolbarItemTranscriptText]: active =>
943
943
  active ? 'Hide Transcript' : 'Show Transcript',
944
944
  [toolbarItemViewRecordingText]: 'View Recordings',
945
- [toolbarItemManageTranscriptText]: 'View Transcripts',
945
+ [toolbarItemManageTextTracksText]: 'View Text-tracks',
946
946
 
947
947
  [toolbarItemRaiseHandText]: active => (active ? 'Lower Hand' : 'Raise Hand'),
948
948
  [toolbarItemSwitchCameraText]: 'Switch Camera',
@@ -1025,7 +1025,7 @@ export const VideoCallScreenLabels: I18nVideoCallScreenLabelsInterface = {
1025
1025
  `Once removed, ${name} will still be able to screen share later.`,
1026
1026
  [removeScreenshareFromRoomPopupPrimaryBtnText]: 'REMOVE',
1027
1027
 
1028
- [transcriptModalTitleIntn]: 'View Transcripts',
1028
+ [textTrackModalTitleIntn]: 'Text Tracks',
1029
1029
  [sttChangeLanguagePopupHeading]: isFirstTimeOpened =>
1030
1030
  isFirstTimeOpened ? 'Set Spoken Language' : 'Change Spoken Language',
1031
1031
  [sttChangeLanguagePopupSubHeading]: