Browse Source

Coding style: consistency, jsdocs

These modification are not necessarily directly related to the
containing PR, I merely saw them while reviewing the containing PR.
master
Lyubo Marinov 7 years ago
parent
commit
d1e5e6b93b

+ 22
- 22
react/features/base/jwt/components/CallOverlay.js View File

1
-/* @flow */
1
+// @flow
2
 
2
 
3
 import PropTypes from 'prop-types';
3
 import PropTypes from 'prop-types';
4
 import React, { Component } from 'react';
4
 import React, { Component } from 'react';
22
  * @extends Component
22
  * @extends Component
23
  */
23
  */
24
 class CallOverlay extends Component<*, *> {
24
 class CallOverlay extends Component<*, *> {
25
+    /**
26
+     * {@code CallOverlay} component's property types.
27
+     *
28
+     * @static
29
+     */
30
+    static propTypes = {
31
+        _callee: PropTypes.object
32
+    };
33
+
34
+    /**
35
+     * Determines whether this overlay needs to be rendered (according to a
36
+     * specific redux state). Called by {@link OverlayContainer}.
37
+     *
38
+     * @param {Object} state - The redux state.
39
+     * @returns {boolean} - If this overlay needs to be rendered, {@code true};
40
+     * {@code false}, otherwise.
41
+     */
42
+    static needsRender(state) {
43
+        return state['features/base/jwt'].callOverlayVisible;
44
+    }
45
+
25
     /**
46
     /**
26
      * The (reference to the) {@link Audio} which plays/renders the audio
47
      * The (reference to the) {@link Audio} which plays/renders the audio
27
      * depicting the ringing phase of the call establishment represented by this
48
      * depicting the ringing phase of the call establishment represented by this
68
         ringing: boolean
89
         ringing: boolean
69
     }
90
     }
70
 
91
 
71
-    /**
72
-     * {@code CallOverlay} component's property types.
73
-     *
74
-     * @static
75
-     */
76
-    static propTypes = {
77
-        _callee: PropTypes.object
78
-    };
79
-
80
-    /**
81
-     * Check if this overlay needs to be rendered. This function will be called
82
-     * by the {@code OverlayContainer}.
83
-     *
84
-     * @param {Object} state - The redux state.
85
-     * @returns {boolean} - True if this overlay needs to be rendered, false
86
-     * otherwise.
87
-     */
88
-    static needsRender(state) {
89
-        return state['features/base/jwt'].callOverlayVisible;
90
-    }
91
-
92
     /**
92
     /**
93
      * Initializes a new {@code CallOverlay} instance.
93
      * Initializes a new {@code CallOverlay} instance.
94
      *
94
      *

+ 18
- 16
react/features/base/lib-jitsi-meet/functions.js View File

1
-/* @flow */
1
+// @flow
2
 
2
 
3
-import { setConfigFromURLParams } from '../../base/config';
4
-import { toState } from '../../base/redux';
5
-import { loadScript } from '../../base/util';
3
+import { setConfigFromURLParams } from '../config';
4
+import { toState } from '../redux';
5
+import { loadScript } from '../util';
6
 
6
 
7
 import JitsiMeetJS from './_';
7
 import JitsiMeetJS from './_';
8
 
8
 
54
 }
54
 }
55
 
55
 
56
 /**
56
 /**
57
- * Determines whether a specific JitsiConferenceErrors instance indicates a
58
- * fatal JitsiConference error.
57
+ * Determines whether a specific {@link JitsiConferenceErrors} instance
58
+ * indicates a fatal {@link JitsiConference} error.
59
  *
59
  *
60
  * FIXME Figure out the category of errors defined by the function and describe
60
  * FIXME Figure out the category of errors defined by the function and describe
61
  * that category. I've currently named the category fatal because it appears to
61
  * that category. I've currently named the category fatal because it appears to
62
  * be used in the cases of unrecoverable errors that necessitate a reload.
62
  * be used in the cases of unrecoverable errors that necessitate a reload.
63
  *
63
  *
64
- * @param {Object|string} error - The JitsiConferenceErrors instance to
65
- * categorize/classify or an Error-like object.
66
- * @returns {boolean} True if the specified JitsiConferenceErrors instance
67
- * indicates a fatal JitsiConference error; otherwise, false.
64
+ * @param {Object|string} error - The {@code JitsiConferenceErrors} instance to
65
+ * categorize/classify or an {@link Error}-like object.
66
+ * @returns {boolean} If the specified {@code JitsiConferenceErrors} instance
67
+ * indicates a fatal {@code JitsiConference} error, {@code true}; otherwise,
68
+ * {@code false}.
68
  */
69
  */
69
 export function isFatalJitsiConferenceError(error: Object | string) {
70
 export function isFatalJitsiConferenceError(error: Object | string) {
70
     if (typeof error !== 'string') {
71
     if (typeof error !== 'string') {
78
 }
79
 }
79
 
80
 
80
 /**
81
 /**
81
- * Determines whether a specific JitsiConnectionErrors instance indicates a
82
- * fatal JitsiConnection error.
82
+ * Determines whether a specific {@link JitsiConnectionErrors} instance
83
+ * indicates a fatal {@link JitsiConnection} error.
83
  *
84
  *
84
  * FIXME Figure out the category of errors defined by the function and describe
85
  * FIXME Figure out the category of errors defined by the function and describe
85
  * that category. I've currently named the category fatal because it appears to
86
  * that category. I've currently named the category fatal because it appears to
86
  * be used in the cases of unrecoverable errors that necessitate a reload.
87
  * be used in the cases of unrecoverable errors that necessitate a reload.
87
  *
88
  *
88
- * @param {Object|string} error - The JitsiConnectionErrors instance to
89
- * categorize/classify or an Error-like object.
90
- * @returns {boolean} True if the specified JitsiConnectionErrors instance
91
- * indicates a fatal JitsiConnection error; otherwise, false.
89
+ * @param {Object|string} error - The {@code JitsiConnectionErrors} instance to
90
+ * categorize/classify or an {@link Error}-like object.
91
+ * @returns {boolean} If the specified {@code JitsiConnectionErrors} instance
92
+ * indicates a fatal {@code JitsiConnection} error, {@code true}; otherwise,
93
+ * {@code false}.
92
  */
94
  */
93
 export function isFatalJitsiConnectionError(error: Object | string) {
95
 export function isFatalJitsiConnectionError(error: Object | string) {
94
     if (typeof error !== 'string') {
96
     if (typeof error !== 'string') {

+ 29
- 31
react/features/overlay/components/AbstractPageReloadOverlay.js View File

1
-/* @flow */
1
+// @flow
2
 
2
 
3
 import PropTypes from 'prop-types';
3
 import PropTypes from 'prop-types';
4
 import React, { Component } from 'react';
4
 import React, { Component } from 'react';
17
 const logger = require('jitsi-meet-logger').getLogger(__filename);
17
 const logger = require('jitsi-meet-logger').getLogger(__filename);
18
 
18
 
19
 /**
19
 /**
20
- * Implements abstract React Component for the page reload overlays.
20
+ * Implements an abstract React {@link Component} for the page reload overlays.
21
  */
21
  */
22
 export default class AbstractPageReloadOverlay extends Component<*, *> {
22
 export default class AbstractPageReloadOverlay extends Component<*, *> {
23
     /**
23
     /**
24
-     * AbstractPageReloadOverlay component's property types.
24
+     * {@code AbstractPageReloadOverlay} component's property types.
25
      *
25
      *
26
      * @static
26
      * @static
27
      */
27
      */
55
         t: PropTypes.func
55
         t: PropTypes.func
56
     };
56
     };
57
 
57
 
58
+    /**
59
+     * Determines whether this overlay needs to be rendered (according to a
60
+     * specific redux state). Called by {@link OverlayContainer}.
61
+     *
62
+     * @param {Object} state - The redux state.
63
+     * @returns {boolean} - If this overlay needs to be rendered, {@code true};
64
+     * {@code false}, otherwise.
65
+     */
66
+    static needsRender(state) {
67
+        const conferenceError = state['features/base/conference'].error;
68
+        const connectionError = state['features/base/connection'].error;
69
+
70
+        return (
71
+            (connectionError && isFatalJitsiConnectionError(connectionError))
72
+                || (conferenceError
73
+                    && isFatalJitsiConferenceError(conferenceError))
74
+        );
75
+    }
76
+
58
     _interval: ?number
77
     _interval: ?number
59
 
78
 
60
     state: {
79
     state: {
89
         title: string
108
         title: string
90
     }
109
     }
91
 
110
 
92
-    /**
93
-     * Check if this overlay needs to be rendered. This function will be called
94
-     * by the {@code OverlayContainer}.
95
-     *
96
-     * @param {Object} state - The redux state.
97
-     * @returns {boolean} - True if this overlay needs to be rendered, false
98
-     * otherwise.
99
-     */
100
-    static needsRender(state) {
101
-        const conferenceError = state['features/base/conference'].error;
102
-        const connectionError = state['features/base/connection'].error;
103
-
104
-        return (
105
-            (connectionError && isFatalJitsiConnectionError(connectionError))
106
-                || (conferenceError
107
-                    && isFatalJitsiConferenceError(conferenceError))
108
-        );
109
-    }
110
-
111
     /**
111
     /**
112
      * Initializes a new AbstractPageReloadOverlay instance.
112
      * Initializes a new AbstractPageReloadOverlay instance.
113
      *
113
      *
220
      * @returns {ReactElement}
220
      * @returns {ReactElement}
221
      */
221
      */
222
     _renderProgressBar() {
222
     _renderProgressBar() {
223
-        const { timeoutSeconds, timeLeft } = this.state;
223
+        const { timeLeft, timeoutSeconds } = this.state;
224
         const timeRemaining = timeoutSeconds - timeLeft;
224
         const timeRemaining = timeoutSeconds - timeLeft;
225
-        const percentageComplete = Math.floor(
226
-            (timeRemaining / timeoutSeconds) * 100);
225
+        const percentageComplete
226
+            = Math.floor((timeRemaining / timeoutSeconds) * 100);
227
 
227
 
228
         return (
228
         return (
229
             <div
229
             <div
231
                 id = 'reloadProgressBar'>
231
                 id = 'reloadProgressBar'>
232
                 <div
232
                 <div
233
                     className = 'progress-indicator-fill'
233
                     className = 'progress-indicator-fill'
234
-                    style = {{
235
-                        width: `${percentageComplete}%`
236
-                    }} />
234
+                    style = {{ width: `${percentageComplete}%` }} />
237
             </div>
235
             </div>
238
         );
236
         );
239
     }
237
     }
243
  * Maps (parts of) the redux state to the associated component's props.
241
  * Maps (parts of) the redux state to the associated component's props.
244
  *
242
  *
245
  * @param {Object} state - The redux state.
243
  * @param {Object} state - The redux state.
244
+ * @protected
246
  * @returns {{
245
  * @returns {{
247
- *      isNetworkFailure: boolean,
248
- *      reason: string
246
+ *     isNetworkFailure: boolean,
247
+ *     reason: string
249
  * }}
248
  * }}
250
- * @protected
251
  */
249
  */
252
 export function abstractMapStateToProps(state: Object) {
250
 export function abstractMapStateToProps(state: Object) {
253
     const conferenceError = state['features/base/conference'].error;
251
     const conferenceError = state['features/base/conference'].error;

+ 7
- 17
react/features/overlay/components/AbstractSuspendedOverlay.js View File

2
 import { Component } from 'react';
2
 import { Component } from 'react';
3
 
3
 
4
 /**
4
 /**
5
- * Implements a React Component for suspended overlay. Shown when a suspend is
6
- * detected.
5
+ * Implements a React {@link Component} for suspended overlay. Shown when a
6
+ * suspend is detected.
7
  */
7
  */
8
 export default class AbstractSuspendedOverlay extends Component {
8
 export default class AbstractSuspendedOverlay extends Component {
9
     /**
9
     /**
10
-     * SuspendedOverlay component's property types.
10
+     * {@code AbstractSuspendedOverlay} component's property types.
11
      *
11
      *
12
      * @static
12
      * @static
13
      */
13
      */
22
     };
22
     };
23
 
23
 
24
     /**
24
     /**
25
-     * Check if this overlay needs to be rendered. This function will be called
26
-     * by the {@code OverlayContainer}.
25
+     * Determines whether this overlay needs to be rendered (according to a
26
+     * specific redux state). Called by {@link OverlayContainer}.
27
      *
27
      *
28
      * @param {Object} state - The redux state.
28
      * @param {Object} state - The redux state.
29
-     * @returns {boolean} - True if this overlay needs to be rendered, false
30
-     * otherwise.
29
+     * @returns {boolean} - If this overlay needs to be rendered, {@code true};
30
+     * {@code false}, otherwise.
31
      */
31
      */
32
     static needsRender(state) {
32
     static needsRender(state) {
33
         return state['features/overlay'].suspendDetected;
33
         return state['features/overlay'].suspendDetected;
34
     }
34
     }
35
-
36
-    /**
37
-     * Implements React's {@link Component#render()}.
38
-     *
39
-     * @inheritdoc
40
-     * @returns {ReactElement|null}
41
-     */
42
-    render() {
43
-        return null;
44
-    }
45
 }
35
 }

+ 9
- 20
react/features/overlay/components/AbstractUserMediaPermissionsOverlay.js View File

1
 import PropTypes from 'prop-types';
1
 import PropTypes from 'prop-types';
2
 import { Component } from 'react';
2
 import { Component } from 'react';
3
 
3
 
4
-
5
 /**
4
 /**
6
- * Implements a React Component for overlay with guidance how to proceed with
7
- * gUM prompt.
5
+ * Implements a React {@link Component} for overlay with guidance how to proceed
6
+ * with gUM prompt.
8
  */
7
  */
9
 export default class AbstractUserMediaPermissionsOverlay extends Component {
8
 export default class AbstractUserMediaPermissionsOverlay extends Component {
10
     /**
9
     /**
11
-     * UserMediaPermissionsOverlay component's property types.
10
+     * {@code AbstractUserMediaPermissionsOverlay} component's property types.
12
      *
11
      *
13
      * @static
12
      * @static
14
      */
13
      */
32
     };
31
     };
33
 
32
 
34
     /**
33
     /**
35
-     * Check if this overlay needs to be rendered. This function will be called
36
-     * by the {@code OverlayContainer}.
34
+     * Determines whether this overlay needs to be rendered (according to a
35
+     * specific redux state). Called by {@link OverlayContainer}.
37
      *
36
      *
38
      * @param {Object} state - The redux state.
37
      * @param {Object} state - The redux state.
39
-     * @returns {boolean} - True if this overlay needs to be rendered, false
40
-     * otherwise.
38
+     * @returns {boolean} - If this overlay needs to be rendered, {@code true};
39
+     * {@code false}, otherwise.
41
      */
40
      */
42
     static needsRender(state) {
41
     static needsRender(state) {
43
         return state['features/overlay'].isMediaPermissionPromptVisible;
42
         return state['features/overlay'].isMediaPermissionPromptVisible;
44
     }
43
     }
45
-
46
-    /**
47
-     * Implements React's {@link Component#render()}.
48
-     *
49
-     * @inheritdoc
50
-     * @returns {ReactElement|null}
51
-     */
52
-    render() {
53
-        return null;
54
-    }
55
 }
44
 }
56
 
45
 
57
 /**
46
 /**
58
  * Maps (parts of) the redux state to the associated component's props.
47
  * Maps (parts of) the redux state to the associated component's props.
59
  *
48
  *
60
  * @param {Object} state - The redux state.
49
  * @param {Object} state - The redux state.
50
+ * @protected
61
  * @returns {{
51
  * @returns {{
62
- *      browser: string
52
+ *     browser: string
63
  * }}
53
  * }}
64
- * @protected
65
  */
54
  */
66
 export function abstractMapStateToProps(state) {
55
 export function abstractMapStateToProps(state) {
67
     const { browser } = state['features/overlay'];
56
     const { browser } = state['features/overlay'];

+ 1
- 1
react/features/overlay/components/FilmstripOnlyOverlayFrame.js View File

82
      * Implements React's {@link Component#render()}.
82
      * Implements React's {@link Component#render()}.
83
      *
83
      *
84
      * @inheritdoc
84
      * @inheritdoc
85
-     * @returns {ReactElement|null}
85
+     * @returns {ReactElement}
86
      */
86
      */
87
     render() {
87
     render() {
88
         return (
88
         return (

+ 7
- 6
react/features/overlay/components/OverlayContainer.js View File

51
 }
51
 }
52
 
52
 
53
 /**
53
 /**
54
- * Implements a React Component that will display the correct overlay when
55
- * needed.
54
+ * Implements a React {@link Component} that will display the correct overlay
55
+ * when needed.
56
  */
56
  */
57
 class OverlayContainer extends Component {
57
 class OverlayContainer extends Component {
58
     /**
58
     /**
71
      * Implements React's {@link Component#render()}.
71
      * Implements React's {@link Component#render()}.
72
      *
72
      *
73
      * @inheritdoc
73
      * @inheritdoc
74
-     * @returns {ReactElement|null}
75
      * @public
74
      * @public
75
+     * @returns {ReactElement|null}
76
      */
76
      */
77
     render() {
77
     render() {
78
         const { overlay } = this.props;
78
         const { overlay } = this.props;
82
 }
82
 }
83
 
83
 
84
 /**
84
 /**
85
- * Maps (parts of) the redux state to the associated OverlayContainer's props.
85
+ * Maps (parts of) the redux state to the associated {@code OverlayContainer}'s
86
+ * props.
86
  *
87
  *
87
  * @param {Object} state - The redux state.
88
  * @param {Object} state - The redux state.
89
+ * @private
88
  * @returns {{
90
  * @returns {{
89
- *      overlay: ?Object
91
+ *     overlay: ?Object
90
  * }}
92
  * }}
91
- * @private
92
  */
93
  */
93
 function _mapStateToProps(state) {
94
 function _mapStateToProps(state) {
94
     let overlay;
95
     let overlay;

+ 1
- 1
react/features/overlay/components/OverlayFrame.js View File

4
 import React, { Component } from 'react';
4
 import React, { Component } from 'react';
5
 
5
 
6
 /**
6
 /**
7
- * Implements a React Component for the frame of the overlays.
7
+ * Implements a React {@link Component} for the frame of the overlays.
8
  */
8
  */
9
 export default class OverlayFrame extends Component {
9
 export default class OverlayFrame extends Component {
10
     /**
10
     /**

+ 1
- 2
react/features/overlay/components/SuspendedFilmstripOnlyOverlay.js View File

15
      * Implements React's {@link Component#render()}.
15
      * Implements React's {@link Component#render()}.
16
      *
16
      *
17
      * @inheritdoc
17
      * @inheritdoc
18
-     * @override
19
-     * @returns {ReactElement|null}
18
+     * @returns {ReactElement}
20
      */
19
      */
21
     render() {
20
     render() {
22
         const { t } = this.props;
21
         const { t } = this.props;

+ 1
- 2
react/features/overlay/components/SuspendedOverlay.js View File

15
      * Implements React's {@link Component#render()}.
15
      * Implements React's {@link Component#render()}.
16
      *
16
      *
17
      * @inheritdoc
17
      * @inheritdoc
18
-     * @override
19
-     * @returns {ReactElement|null}
18
+     * @returns {ReactElement}
20
      */
19
      */
21
     render() {
20
     render() {
22
         const { t } = this.props;
21
         const { t } = this.props;

+ 2
- 2
react/features/overlay/components/UserMediaPermissionsFilmstripOnlyOverlay.js View File

13
  */
13
  */
14
 class UserMediaPermissionsFilmstripOnlyOverlay
14
 class UserMediaPermissionsFilmstripOnlyOverlay
15
     extends AbstractUserMediaPermissionsOverlay {
15
     extends AbstractUserMediaPermissionsOverlay {
16
+
16
     /**
17
     /**
17
      * Implements React's {@link Component#render()}.
18
      * Implements React's {@link Component#render()}.
18
      *
19
      *
19
      * @inheritdoc
20
      * @inheritdoc
20
-     * @override
21
-     * @returns {ReactElement|null}
21
+     * @returns {ReactElement}
22
      */
22
      */
23
     render() {
23
     render() {
24
         const { t } = this.props;
24
         const { t } = this.props;

+ 2
- 3
react/features/overlay/components/UserMediaPermissionsOverlay.js View File

38
      * Implements React's {@link Component#render()}.
38
      * Implements React's {@link Component#render()}.
39
      *
39
      *
40
      * @inheritdoc
40
      * @inheritdoc
41
-     * @override
42
-     * @returns {ReactElement|null}
41
+     * @returns {ReactElement}
43
      */
42
      */
44
     render() {
43
     render() {
45
         const { browser, t } = this.props;
44
         const { browser, t } = this.props;
77
     /**
76
     /**
78
      * Renders the policy logo.
77
      * Renders the policy logo.
79
      *
78
      *
80
-     * @returns {ReactElement|null}
81
      * @private
79
      * @private
80
+     * @returns {ReactElement|null}
82
      */
81
      */
83
     _renderPolicyLogo() {
82
     _renderPolicyLogo() {
84
         const { policyLogoSrc } = this.state;
83
         const { policyLogoSrc } = this.state;

Loading…
Cancel
Save