Browse Source

feat(notification): Add suboptimal browser exp notification.

master
hristoterezov 7 years ago
parent
commit
a357b0cf14

+ 3
- 1
lang/main.json View File

223
         "grantedToUnknown": "Moderator rights granted to $t(notify.somebody)!",
223
         "grantedToUnknown": "Moderator rights granted to $t(notify.somebody)!",
224
         "muted": "You have started the conversation muted.",
224
         "muted": "You have started the conversation muted.",
225
         "mutedTitle": "You're muted!",
225
         "mutedTitle": "You're muted!",
226
-        "raisedHand": "Would like to speak."
226
+        "raisedHand": "Would like to speak.",
227
+        "suboptimalExperienceTitle": "Browser Warning",
228
+        "suboptimalExperienceDescription": "Eer... we are afraid your experience with __appName__ isn't going to be that great here. We are looking for ways to improve this but, until then, please try using one of the <a href='/static/recommendedBrowsers.html' target='_blank'>fully supported browsers</a>."
227
     },
229
     },
228
     "dialog": {
230
     "dialog": {
229
         "add": "Add",
231
         "add": "Add",

+ 3035
- 2526
package-lock.json
File diff suppressed because it is too large
View File


+ 1
- 1
package.json View File

44
     "jquery-i18next": "1.2.0",
44
     "jquery-i18next": "1.2.0",
45
     "js-md5": "0.6.1",
45
     "js-md5": "0.6.1",
46
     "jwt-decode": "2.2.0",
46
     "jwt-decode": "2.2.0",
47
-    "lib-jitsi-meet": "github:jitsi/lib-jitsi-meet#2aa85ad1719f81541ac1a3582f1369e2f4d1f5c2",
47
+    "lib-jitsi-meet": "github:jitsi/lib-jitsi-meet#8f7a604653584f24b73894466049baf699904745",
48
     "lodash": "4.17.4",
48
     "lodash": "4.17.4",
49
     "moment": "2.19.4",
49
     "moment": "2.19.4",
50
     "nuclear-js": "1.4.0",
50
     "nuclear-js": "1.4.0",

+ 5
- 5
react/features/base/lib-jitsi-meet/index.js View File

3
 import JitsiMeetJS from './_';
3
 import JitsiMeetJS from './_';
4
 export { JitsiMeetJS as default };
4
 export { JitsiMeetJS as default };
5
 
5
 
6
-// XXX Re-export the types exported by JitsiMeetJS in order to prevent undefined
7
-// imported JitsiMeetJS. It may be caused by import cycles but I have not
8
-// confirmed the theory.
6
+// XXX Re-export the properties exported by JitsiMeetJS in order to prevent
7
+// undefined imported JitsiMeetJS. It may be caused by import cycles but I have
8
+// not confirmed the theory.
9
+export const analytics = JitsiMeetJS.analytics;
10
+export const RTCBrowserType = JitsiMeetJS.util.RTCBrowserType;
9
 export const JitsiConferenceErrors = JitsiMeetJS.errors.conference;
11
 export const JitsiConferenceErrors = JitsiMeetJS.errors.conference;
10
 export const JitsiConferenceEvents = JitsiMeetJS.events.conference;
12
 export const JitsiConferenceEvents = JitsiMeetJS.events.conference;
11
 export const JitsiConnectionErrors = JitsiMeetJS.errors.connection;
13
 export const JitsiConnectionErrors = JitsiMeetJS.errors.connection;
20
 export const JitsiTrackErrors = JitsiMeetJS.errors.track;
22
 export const JitsiTrackErrors = JitsiMeetJS.errors.track;
21
 export const JitsiTrackEvents = JitsiMeetJS.events.track;
23
 export const JitsiTrackEvents = JitsiMeetJS.events.track;
22
 
24
 
23
-export const analytics = JitsiMeetJS.analytics;
24
-
25
 export * from './actions';
25
 export * from './actions';
26
 export * from './actionTypes';
26
 export * from './actionTypes';
27
 export * from './constants';
27
 export * from './constants';

+ 10
- 3
react/features/conference/components/Conference.web.js View File

6
 
6
 
7
 import { connect, disconnect } from '../../base/connection';
7
 import { connect, disconnect } from '../../base/connection';
8
 import { DialogContainer } from '../../base/dialog';
8
 import { DialogContainer } from '../../base/dialog';
9
+import { translate } from '../../base/i18n';
9
 import { CalleeInfoContainer } from '../../base/jwt';
10
 import { CalleeInfoContainer } from '../../base/jwt';
10
 import { Filmstrip } from '../../filmstrip';
11
 import { Filmstrip } from '../../filmstrip';
11
 import { LargeVideo } from '../../large-video';
12
 import { LargeVideo } from '../../large-video';
13
 import { showToolbox, Toolbox } from '../../toolbox';
14
 import { showToolbox, Toolbox } from '../../toolbox';
14
 import { HideNotificationBarStyle } from '../../unsupported-browser';
15
 import { HideNotificationBarStyle } from '../../unsupported-browser';
15
 
16
 
17
+import { maybeShowSuboptimalExperienceNotification } from '../functions';
18
+
16
 declare var APP: Object;
19
 declare var APP: Object;
17
 declare var interfaceConfig: Object;
20
 declare var interfaceConfig: Object;
18
 
21
 
26
      */
29
      */
27
     _isRecording: boolean,
30
     _isRecording: boolean,
28
 
31
 
29
-    dispatch: Function
32
+    dispatch: Function,
33
+    t: Function
30
 }
34
 }
31
 
35
 
32
 /**
36
 /**
70
         APP.UI.registerListeners();
74
         APP.UI.registerListeners();
71
         APP.UI.bindEvents();
75
         APP.UI.bindEvents();
72
 
76
 
73
-        this.props.dispatch(connect());
77
+        const { dispatch, t } = this.props;
78
+
79
+        dispatch(connect());
80
+        maybeShowSuboptimalExperienceNotification(dispatch, t);
74
     }
81
     }
75
 
82
 
76
     /**
83
     /**
161
     };
168
     };
162
 }
169
 }
163
 
170
 
164
-export default reactReduxConnect(_mapStateToProps)(Conference);
171
+export default reactReduxConnect(_mapStateToProps)(translate(Conference));

+ 38
- 0
react/features/conference/functions.js View File

1
+import { getName } from '../app';
2
+import { translateToHTML } from '../base/i18n';
3
+import { RTCBrowserType } from '../base/lib-jitsi-meet';
4
+import { showWarningNotification } from '../notifications';
5
+
6
+/**
7
+ * Shows the suboptimal experience notification if needed.
8
+ *
9
+ * @param {Function} dispatch - The dispatch method.
10
+ * @param {Function} t - The translation function.
11
+ * @returns {void}
12
+ */
13
+export function maybeShowSuboptimalExperienceNotification(dispatch, t) {
14
+    if (!RTCBrowserType.isChrome()
15
+            && !RTCBrowserType.isFirefox()
16
+            && !RTCBrowserType.isNWJS()
17
+            && !RTCBrowserType.isElectron()
18
+
19
+            // Adding react native to the list of recommended browsers is not
20
+            // necessary for now because the function won't be executed at all
21
+            // in this case but I'm adding it for completeness.
22
+            && !RTCBrowserType.isReactNative()
23
+    ) {
24
+        dispatch(
25
+            showWarningNotification(
26
+                {
27
+                    titleKey: 'notify.suboptimalExperienceTitle',
28
+                    description: translateToHTML(
29
+                        t,
30
+                        'notify.suboptimalExperienceDescription',
31
+                        {
32
+                            appName: getName()
33
+                        })
34
+                }
35
+            )
36
+        );
37
+    }
38
+}

+ 1
- 3
react/features/notifications/components/NotificationsContainer.web.js View File

71
         if (_notifications.length) {
71
         if (_notifications.length) {
72
             const notification = _notifications[0];
72
             const notification = _notifications[0];
73
 
73
 
74
-            if (!_showNotifications) {
75
-                this._onDismissed(notification.uid);
76
-            } else if (this._notificationDismissTimeout) {
74
+            if (!_showNotifications || this._notificationDismissTimeout) {
77
 
75
 
78
                 // No-op because there should already be a notification that
76
                 // No-op because there should already be a notification that
79
                 // is waiting for dismissal.
77
                 // is waiting for dismissal.

+ 25
- 0
static/recommendedBrowsers.html View File

1
+<html>
2
+<head>
3
+    <link rel="stylesheet" href="../css/all.css"/>
4
+    <!--#include virtual="/title.html" -->
5
+</head>
6
+<body>
7
+    <div class = 'unsupported-desktop-browser'>
8
+        <h2 class = 'unsupported-desktop-browser__title'>
9
+            It looks like you're using a browser we don't fully support.
10
+        </h2>
11
+        <p class ='unsupported-desktop-browser__description'>
12
+            We recommend to try with the latest version of&nbsp;
13
+            <a
14
+                className = 'unsupported-desktop-browser__link'
15
+                href = 'http://google.com/chrome' >Chrome</a>,&nbsp;
16
+            <a
17
+                class = 'unsupported-desktop-browser__link'
18
+                href = 'http://www.getfirefox.com/'>Firefox</a>&nbsp;or&nbsp;
19
+            <a
20
+                class = 'unsupported-desktop-browser__link'
21
+                href = 'http://www.chromium.org/'>Chromium</a>
22
+        </p>
23
+    </div>
24
+</body>
25
+</html>

Loading…
Cancel
Save