Bladeren bron

feat(notifications): Make all error notifications sticky.

There are many cases where the error disappears and users easily miss the information.
factor2
damencho 4 maanden geleden
bovenliggende
commit
0387cdc888

+ 2
- 2
conference.js Bestand weergeven

287
                 },
287
                 },
288
                 descriptionKey: 'dialog.reservationErrorMsg',
288
                 descriptionKey: 'dialog.reservationErrorMsg',
289
                 titleKey: 'dialog.reservationError'
289
                 titleKey: 'dialog.reservationError'
290
-            }, NOTIFICATION_TIMEOUT_TYPE.LONG));
290
+            }));
291
             break;
291
             break;
292
         }
292
         }
293
 
293
 
295
             APP.store.dispatch(showErrorNotification({
295
             APP.store.dispatch(showErrorNotification({
296
                 descriptionKey: 'dialog.gracefulShutdown',
296
                 descriptionKey: 'dialog.gracefulShutdown',
297
                 titleKey: 'dialog.serviceUnavailable'
297
                 titleKey: 'dialog.serviceUnavailable'
298
-            }, NOTIFICATION_TIMEOUT_TYPE.LONG));
298
+            }));
299
             break;
299
             break;
300
 
300
 
301
         // FIXME FOCUS_DISCONNECTED is a confusing event name.
301
         // FIXME FOCUS_DISCONNECTED is a confusing event name.

+ 5
- 5
react/features/base/conference/middleware.any.ts Bestand weergeven

177
             dispatch(showErrorNotification({
177
             dispatch(showErrorNotification({
178
                 description: 'Restart initiated because of a bridge failure',
178
                 description: 'Restart initiated because of a bridge failure',
179
                 titleKey: 'dialog.sessionRestarted'
179
                 titleKey: 'dialog.sessionRestarted'
180
-            }, NOTIFICATION_TIMEOUT_TYPE.LONG));
180
+            }));
181
         }
181
         }
182
 
182
 
183
         break;
183
         break;
190
             descriptionArguments: { msg },
190
             descriptionArguments: { msg },
191
             descriptionKey: msg ? 'dialog.connectErrorWithMsg' : 'dialog.connectError',
191
             descriptionKey: msg ? 'dialog.connectErrorWithMsg' : 'dialog.connectError',
192
             titleKey: 'connection.CONNFAIL'
192
             titleKey: 'connection.CONNFAIL'
193
-        }, NOTIFICATION_TIMEOUT_TYPE.LONG));
193
+        }));
194
 
194
 
195
         break;
195
         break;
196
     }
196
     }
199
             hideErrorSupportLink: true,
199
             hideErrorSupportLink: true,
200
             descriptionKey: 'dialog.maxUsersLimitReached',
200
             descriptionKey: 'dialog.maxUsersLimitReached',
201
             titleKey: 'dialog.maxUsersLimitReachedTitle'
201
             titleKey: 'dialog.maxUsersLimitReachedTitle'
202
-        }, NOTIFICATION_TIMEOUT_TYPE.LONG));
202
+        }));
203
 
203
 
204
         // In case of max users(it can be from a visitor node), let's restore
204
         // In case of max users(it can be from a visitor node), let's restore
205
         // oldConfig if any as we will be back to the main prosody.
205
         // oldConfig if any as we will be back to the main prosody.
236
             descriptionKey,
236
             descriptionKey,
237
             hideErrorSupportLink: true,
237
             hideErrorSupportLink: true,
238
             titleKey
238
             titleKey
239
-        }, NOTIFICATION_TIMEOUT_TYPE.STICKY));
239
+        }));
240
 
240
 
241
         sendAnalytics(createNotAllowedErrorEvent(type, msg));
241
         sendAnalytics(createNotAllowedErrorEvent(type, msg));
242
 
242
 
416
                 descriptionKey: errors ? 'dialog.tokenAuthFailedWithReasons' : 'dialog.tokenAuthFailed',
416
                 descriptionKey: errors ? 'dialog.tokenAuthFailedWithReasons' : 'dialog.tokenAuthFailed',
417
                 descriptionArguments: { reason: errors },
417
                 descriptionArguments: { reason: errors },
418
                 titleKey: 'dialog.tokenAuthFailedTitle'
418
                 titleKey: 'dialog.tokenAuthFailedTitle'
419
-            }, NOTIFICATION_TIMEOUT_TYPE.STICKY));
419
+            }));
420
         }
420
         }
421
     }
421
     }
422
 
422
 

+ 1
- 1
react/features/base/tracks/actions.any.ts Bestand weergeven

291
             const notificationAction = dispatch(showErrorNotification({
291
             const notificationAction = dispatch(showErrorNotification({
292
                 descriptionKey: 'dialog.cameraNotSendingData',
292
                 descriptionKey: 'dialog.cameraNotSendingData',
293
                 titleKey: 'dialog.cameraNotSendingDataTitle'
293
                 titleKey: 'dialog.cameraNotSendingDataTitle'
294
-            }, NOTIFICATION_TIMEOUT_TYPE.LONG));
294
+            }));
295
 
295
 
296
             notificationInfo = {
296
             notificationInfo = {
297
                 uid: notificationAction?.uid
297
                 uid: notificationAction?.uid

+ 5
- 7
react/features/base/tracks/actions.web.ts Bestand weergeven

157
             try {
157
             try {
158
                 tracks = await createLocalTracksF(options) as any[];
158
                 tracks = await createLocalTracksF(options) as any[];
159
             } catch (error) {
159
             } catch (error) {
160
-                dispatch(handleScreenSharingError(error, NOTIFICATION_TIMEOUT_TYPE.MEDIUM));
160
+                dispatch(handleScreenSharingError(error));
161
 
161
 
162
                 throw error;
162
                 throw error;
163
             }
163
             }
171
             desktopVideoTrack.dispose();
171
             desktopVideoTrack.dispose();
172
 
172
 
173
             if (!desktopAudioTrack) {
173
             if (!desktopAudioTrack) {
174
-                dispatch(handleScreenSharingError(AUDIO_ONLY_SCREEN_SHARE_NO_TRACK, NOTIFICATION_TIMEOUT_TYPE.MEDIUM));
174
+                dispatch(handleScreenSharingError(AUDIO_ONLY_SCREEN_SHARE_NO_TRACK));
175
 
175
 
176
                 throw new Error(AUDIO_ONLY_SCREEN_SHARE_NO_TRACK);
176
                 throw new Error(AUDIO_ONLY_SCREEN_SHARE_NO_TRACK);
177
             }
177
             }
457
         } = errors;
457
         } = errors;
458
 
458
 
459
         if (screenSharingError) {
459
         if (screenSharingError) {
460
-            dispatch(handleScreenSharingError(screenSharingError, NOTIFICATION_TIMEOUT_TYPE.LONG));
460
+            dispatch(handleScreenSharingError(screenSharingError));
461
         }
461
         }
462
         if (audioOnlyError || videoOnlyError) {
462
         if (audioOnlyError || videoOnlyError) {
463
             if (audioOnlyError) {
463
             if (audioOnlyError) {
476
  *
476
  *
477
  * @private
477
  * @private
478
  * @param {Error | AUDIO_ONLY_SCREEN_SHARE_NO_TRACK} error - The error.
478
  * @param {Error | AUDIO_ONLY_SCREEN_SHARE_NO_TRACK} error - The error.
479
- * @param {NOTIFICATION_TIMEOUT_TYPE} timeout - The time for showing the notification.
480
  * @returns {Function}
479
  * @returns {Function}
481
  */
480
  */
482
 export function handleScreenSharingError(
481
 export function handleScreenSharingError(
483
-        error: Error | AUDIO_ONLY_SCREEN_SHARE_NO_TRACK,
484
-        timeout: NOTIFICATION_TIMEOUT_TYPE) {
482
+        error: Error | AUDIO_ONLY_SCREEN_SHARE_NO_TRACK) {
485
     return (dispatch: IStore['dispatch']) => {
483
     return (dispatch: IStore['dispatch']) => {
486
         logger.error('failed to share local desktop', error);
484
         logger.error('failed to share local desktop', error);
487
 
485
 
508
         dispatch(showErrorNotification({
506
         dispatch(showErrorNotification({
509
             descriptionKey,
507
             descriptionKey,
510
             titleKey
508
             titleKey
511
-        }, timeout));
509
+        }));
512
     };
510
     };
513
 }
511
 }

+ 1
- 1
react/features/invite/components/add-people-dialog/AbstractAddPeopleDialog.tsx Bestand weergeven

190
                         }));
190
                         }));
191
                     dispatch(showErrorNotification({
191
                     dispatch(showErrorNotification({
192
                         titleKey: 'addPeople.failedToAdd'
192
                         titleKey: 'addPeople.failedToAdd'
193
-                    }, NOTIFICATION_TIMEOUT_TYPE.MEDIUM));
193
+                    }));
194
                 } else if (!_callFlowsEnabled) {
194
                 } else if (!_callFlowsEnabled) {
195
                     const invitedCount = invitees.length;
195
                     const invitedCount = invitees.length;
196
                     let notificationProps: INotificationProps | undefined;
196
                     let notificationProps: INotificationProps | undefined;

+ 1
- 2
react/features/noise-suppression/actions.ts Bestand weergeven

1
 import { IStore } from '../app/types';
1
 import { IStore } from '../app/types';
2
 import { getLocalJitsiAudioTrack } from '../base/tracks/functions';
2
 import { getLocalJitsiAudioTrack } from '../base/tracks/functions';
3
 import { showErrorNotification } from '../notifications/actions';
3
 import { showErrorNotification } from '../notifications/actions';
4
-import { NOTIFICATION_TIMEOUT_TYPE } from '../notifications/constants';
5
 import { NoiseSuppressionEffect } from '../stream-effects/noise-suppression/NoiseSuppressionEffect';
4
 import { NoiseSuppressionEffect } from '../stream-effects/noise-suppression/NoiseSuppressionEffect';
6
 
5
 
7
 import { SET_NOISE_SUPPRESSION_ENABLED } from './actionTypes';
6
 import { SET_NOISE_SUPPRESSION_ENABLED } from './actionTypes';
93
 
92
 
94
             dispatch(showErrorNotification({
93
             dispatch(showErrorNotification({
95
                 titleKey: 'notify.noiseSuppressionFailedTitle'
94
                 titleKey: 'notify.noiseSuppressionFailedTitle'
96
-            }, NOTIFICATION_TIMEOUT_TYPE.MEDIUM));
95
+            }));
97
         }
96
         }
98
     };
97
     };
99
 }
98
 }

+ 1
- 1
react/features/notifications/actions.ts Bestand weergeven

97
  * @param {string} type - Notification type.
97
  * @param {string} type - Notification type.
98
  * @returns {Object}
98
  * @returns {Object}
99
  */
99
  */
100
-export function showErrorNotification(props: INotificationProps, type?: string) {
100
+export function showErrorNotification(props: INotificationProps, type = NOTIFICATION_TIMEOUT_TYPE.STICKY) {
101
     return showNotification({
101
     return showNotification({
102
         ...props,
102
         ...props,
103
         appearance: NOTIFICATION_TYPE.ERROR
103
         appearance: NOTIFICATION_TYPE.ERROR

+ 1
- 2
react/features/old-client-notification/middleware.tsx Bestand weergeven

5
 import { APP_WILL_MOUNT } from '../base/app/actionTypes';
5
 import { APP_WILL_MOUNT } from '../base/app/actionTypes';
6
 import MiddlewareRegistry from '../base/redux/MiddlewareRegistry';
6
 import MiddlewareRegistry from '../base/redux/MiddlewareRegistry';
7
 import { showErrorNotification } from '../notifications/actions';
7
 import { showErrorNotification } from '../notifications/actions';
8
-import { NOTIFICATION_TIMEOUT_TYPE } from '../notifications/constants';
9
 
8
 
10
 import OldElectronAPPNotificationDescription from './components/OldElectronAPPNotificationDescription';
9
 import OldElectronAPPNotificationDescription from './components/OldElectronAPPNotificationDescription';
11
 import { isOldJitsiMeetElectronApp } from './functions';
10
 import { isOldJitsiMeetElectronApp } from './functions';
35
         dispatch(showErrorNotification({
34
         dispatch(showErrorNotification({
36
             titleKey: 'notify.OldElectronAPPTitle',
35
             titleKey: 'notify.OldElectronAPPTitle',
37
             description: <OldElectronAPPNotificationDescription />
36
             description: <OldElectronAPPNotificationDescription />
38
-        }, NOTIFICATION_TIMEOUT_TYPE.LONG));
37
+        }));
39
     }
38
     }
40
 
39
 
41
     return next(action);
40
     return next(action);

+ 4
- 5
react/features/prejoin/actions.web.ts Bestand weergeven

16
 import { openURLInBrowser } from '../base/util/openURLInBrowser';
16
 import { openURLInBrowser } from '../base/util/openURLInBrowser';
17
 import { executeDialOutRequest, executeDialOutStatusRequest, getDialInfoPageURL } from '../invite/functions';
17
 import { executeDialOutRequest, executeDialOutStatusRequest, getDialInfoPageURL } from '../invite/functions';
18
 import { showErrorNotification } from '../notifications/actions';
18
 import { showErrorNotification } from '../notifications/actions';
19
-import { NOTIFICATION_TIMEOUT_TYPE } from '../notifications/constants';
20
 import { INotificationProps } from '../notifications/types';
19
 import { INotificationProps } from '../notifications/types';
21
 
20
 
22
 import {
21
 import {
108
             case DIAL_OUT_STATUS.DISCONNECTED: {
107
             case DIAL_OUT_STATUS.DISCONNECTED: {
109
                 dispatch(showErrorNotification({
108
                 dispatch(showErrorNotification({
110
                     titleKey: 'prejoin.errorDialOutDisconnected'
109
                     titleKey: 'prejoin.errorDialOutDisconnected'
111
-                }, NOTIFICATION_TIMEOUT_TYPE.LONG));
110
+                }));
112
 
111
 
113
                 return onFail();
112
                 return onFail();
114
             }
113
             }
116
             case DIAL_OUT_STATUS.FAILED: {
115
             case DIAL_OUT_STATUS.FAILED: {
117
                 dispatch(showErrorNotification({
116
                 dispatch(showErrorNotification({
118
                     titleKey: 'prejoin.errorDialOutFailed'
117
                     titleKey: 'prejoin.errorDialOutFailed'
119
-                }, NOTIFICATION_TIMEOUT_TYPE.LONG));
118
+                }));
120
 
119
 
121
                 return onFail();
120
                 return onFail();
122
             }
121
             }
124
         } catch (err) {
123
         } catch (err) {
125
             dispatch(showErrorNotification({
124
             dispatch(showErrorNotification({
126
                 titleKey: 'prejoin.errorDialOutStatus'
125
                 titleKey: 'prejoin.errorDialOutStatus'
127
-            }, NOTIFICATION_TIMEOUT_TYPE.LONG));
126
+            }));
128
             logger.error('Error getting dial out status', err);
127
             logger.error('Error getting dial out status', err);
129
             onFail();
128
             onFail();
130
         }
129
         }
177
                 }
176
                 }
178
             }
177
             }
179
 
178
 
180
-            dispatch(showErrorNotification(notification, NOTIFICATION_TIMEOUT_TYPE.LONG));
179
+            dispatch(showErrorNotification(notification));
181
             logger.error('Error dialing out', err);
180
             logger.error('Error dialing out', err);
182
             onFail();
181
             onFail();
183
         }
182
         }

+ 2
- 2
react/features/recording/actions.any.ts Bestand weergeven

189
  * @returns {showErrorNotification}
189
  * @returns {showErrorNotification}
190
  */
190
  */
191
 export function showRecordingError(props: Object) {
191
 export function showRecordingError(props: Object) {
192
-    return showErrorNotification(props, NOTIFICATION_TIMEOUT_TYPE.LONG);
192
+    return showErrorNotification(props);
193
 }
193
 }
194
 
194
 
195
 /**
195
 /**
301
                 } catch (err) {
301
                 } catch (err) {
302
                     dispatch(showErrorNotification({
302
                     dispatch(showErrorNotification({
303
                         titleKey: 'recording.errorFetchingLink'
303
                         titleKey: 'recording.errorFetchingLink'
304
-                    }, NOTIFICATION_TIMEOUT_TYPE.MEDIUM));
304
+                    }));
305
 
305
 
306
                     return logger.error('Could not fetch recording link', err);
306
                     return logger.error('Could not fetch recording link', err);
307
                 }
307
                 }

+ 1
- 2
react/features/recording/components/Recording/AbstractStartRecordingDialog.ts Bestand weergeven

9
 import { updateDropboxToken } from '../../../dropbox/actions';
9
 import { updateDropboxToken } from '../../../dropbox/actions';
10
 import { getDropboxData, getNewAccessToken, isEnabled as isDropboxEnabled } from '../../../dropbox/functions.any';
10
 import { getDropboxData, getNewAccessToken, isEnabled as isDropboxEnabled } from '../../../dropbox/functions.any';
11
 import { showErrorNotification } from '../../../notifications/actions';
11
 import { showErrorNotification } from '../../../notifications/actions';
12
-import { NOTIFICATION_TIMEOUT_TYPE } from '../../../notifications/constants';
13
 import { setRequestingSubtitles } from '../../../subtitles/actions.any';
12
 import { setRequestingSubtitles } from '../../../subtitles/actions.any';
14
 import { setSelectedRecordingService, startLocalVideoRecording } from '../../actions';
13
 import { setSelectedRecordingService, startLocalVideoRecording } from '../../actions';
15
 import { RECORDING_METADATA_ID, RECORDING_TYPES } from '../../constants';
14
 import { RECORDING_METADATA_ID, RECORDING_TYPES } from '../../constants';
381
                 } else {
380
                 } else {
382
                     dispatch(showErrorNotification({
381
                     dispatch(showErrorNotification({
383
                         titleKey: 'dialog.noDropboxToken'
382
                         titleKey: 'dialog.noDropboxToken'
384
-                    }, NOTIFICATION_TIMEOUT_TYPE.LONG));
383
+                    }));
385
 
384
 
386
                     return;
385
                     return;
387
                 }
386
                 }

+ 1
- 1
react/features/recording/middleware.ts Bestand weergeven

162
                     false, 'local', err.message, isRecorderTranscriptionsRunning(getState()));
162
                     false, 'local', err.message, isRecorderTranscriptionsRunning(getState()));
163
             }
163
             }
164
 
164
 
165
-            dispatch(showErrorNotification(props, NOTIFICATION_TIMEOUT_TYPE.MEDIUM));
165
+            dispatch(showErrorNotification(props));
166
         });
166
         });
167
         break;
167
         break;
168
     }
168
     }

+ 1
- 1
react/features/room-lock/middleware.ts Bestand weergeven

142
         APP.store.dispatch(showErrorNotification({
142
         APP.store.dispatch(showErrorNotification({
143
             descriptionKey,
143
             descriptionKey,
144
             titleKey
144
             titleKey
145
-        }, NOTIFICATION_TIMEOUT_TYPE.LONG));
145
+        }));
146
     }
146
     }
147
 
147
 
148
     return next(action);
148
     return next(action);

+ 1
- 2
react/features/transcribing/middleware.ts Bestand weergeven

1
 import MiddlewareRegistry from '../base/redux/MiddlewareRegistry';
1
 import MiddlewareRegistry from '../base/redux/MiddlewareRegistry';
2
 import { showErrorNotification } from '../notifications/actions';
2
 import { showErrorNotification } from '../notifications/actions';
3
-import { NOTIFICATION_TIMEOUT_TYPE } from '../notifications/constants';
4
 
3
 
5
 import { TRANSCRIBER_LEFT } from './actionTypes';
4
 import { TRANSCRIBER_LEFT } from './actionTypes';
6
 import './subscriber';
5
 import './subscriber';
17
         if (action.abruptly) {
16
         if (action.abruptly) {
18
             dispatch(showErrorNotification({
17
             dispatch(showErrorNotification({
19
                 titleKey: 'transcribing.failed'
18
                 titleKey: 'transcribing.failed'
20
-            }, NOTIFICATION_TIMEOUT_TYPE.LONG));
19
+            }));
21
         }
20
         }
22
         break;
21
         break;
23
     }
22
     }

+ 3
- 3
react/features/videosipgw/middleware.ts Bestand weergeven

105
                     dispatch(showErrorNotification({
105
                     dispatch(showErrorNotification({
106
                         descriptionKey: 'videoSIPGW.errorInvite',
106
                         descriptionKey: 'videoSIPGW.errorInvite',
107
                         titleKey: 'videoSIPGW.errorInviteTitle'
107
                         titleKey: 'videoSIPGW.errorInviteTitle'
108
-                    }, NOTIFICATION_TIMEOUT_TYPE.LONG));
108
+                    }));
109
 
109
 
110
                     return;
110
                     return;
111
                 }
111
                 }
159
                 displayName: event.displayName
159
                 displayName: event.displayName
160
             },
160
             },
161
             descriptionKey: 'videoSIPGW.errorInviteFailed'
161
             descriptionKey: 'videoSIPGW.errorInviteFailed'
162
-        }, NOTIFICATION_TIMEOUT_TYPE.LONG);
162
+        });
163
     }
163
     }
164
     case JitsiSIPVideoGWStatus.STATE_OFF: {
164
     case JitsiSIPVideoGWStatus.STATE_OFF: {
165
         if (event.failureReason === JitsiSIPVideoGWStatus.STATUS_BUSY) {
165
         if (event.failureReason === JitsiSIPVideoGWStatus.STATUS_BUSY) {
166
             return showErrorNotification({
166
             return showErrorNotification({
167
                 descriptionKey: 'videoSIPGW.busy',
167
                 descriptionKey: 'videoSIPGW.busy',
168
                 titleKey: 'videoSIPGW.busyTitle'
168
                 titleKey: 'videoSIPGW.busyTitle'
169
-            }, NOTIFICATION_TIMEOUT_TYPE.LONG);
169
+            });
170
         } else if (event.failureReason) {
170
         } else if (event.failureReason) {
171
             logger.error(`Unknown sip videogw error ${event.newState} ${
171
             logger.error(`Unknown sip videogw error ${event.newState} ${
172
                 event.failureReason}`);
172
                 event.failureReason}`);

Laden…
Annuleren
Opslaan