Coding style: consistency, jsdocs
These modification are not necessarily directly related to the containing PR, I merely saw them while reviewing the containing PR.
This commit is contained in:
parent
38629b437d
commit
d1e5e6b93b
|
@ -1,4 +1,4 @@
|
|||
/* @flow */
|
||||
// @flow
|
||||
|
||||
import PropTypes from 'prop-types';
|
||||
import React, { Component } from 'react';
|
||||
|
@ -22,6 +22,27 @@ declare var interfaceConfig: Object;
|
|||
* @extends Component
|
||||
*/
|
||||
class CallOverlay extends Component<*, *> {
|
||||
/**
|
||||
* {@code CallOverlay} component's property types.
|
||||
*
|
||||
* @static
|
||||
*/
|
||||
static propTypes = {
|
||||
_callee: PropTypes.object
|
||||
};
|
||||
|
||||
/**
|
||||
* Determines whether this overlay needs to be rendered (according to a
|
||||
* specific redux state). Called by {@link OverlayContainer}.
|
||||
*
|
||||
* @param {Object} state - The redux state.
|
||||
* @returns {boolean} - If this overlay needs to be rendered, {@code true};
|
||||
* {@code false}, otherwise.
|
||||
*/
|
||||
static needsRender(state) {
|
||||
return state['features/base/jwt'].callOverlayVisible;
|
||||
}
|
||||
|
||||
/**
|
||||
* The (reference to the) {@link Audio} which plays/renders the audio
|
||||
* depicting the ringing phase of the call establishment represented by this
|
||||
|
@ -68,27 +89,6 @@ class CallOverlay extends Component<*, *> {
|
|||
ringing: boolean
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code CallOverlay} component's property types.
|
||||
*
|
||||
* @static
|
||||
*/
|
||||
static propTypes = {
|
||||
_callee: PropTypes.object
|
||||
};
|
||||
|
||||
/**
|
||||
* Check if this overlay needs to be rendered. This function will be called
|
||||
* by the {@code OverlayContainer}.
|
||||
*
|
||||
* @param {Object} state - The redux state.
|
||||
* @returns {boolean} - True if this overlay needs to be rendered, false
|
||||
* otherwise.
|
||||
*/
|
||||
static needsRender(state) {
|
||||
return state['features/base/jwt'].callOverlayVisible;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes a new {@code CallOverlay} instance.
|
||||
*
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/* @flow */
|
||||
// @flow
|
||||
|
||||
import { setConfigFromURLParams } from '../../base/config';
|
||||
import { toState } from '../../base/redux';
|
||||
import { loadScript } from '../../base/util';
|
||||
import { setConfigFromURLParams } from '../config';
|
||||
import { toState } from '../redux';
|
||||
import { loadScript } from '../util';
|
||||
|
||||
import JitsiMeetJS from './_';
|
||||
|
||||
|
@ -54,17 +54,18 @@ export function isAnalyticsEnabled(stateful: Function | Object) {
|
|||
}
|
||||
|
||||
/**
|
||||
* Determines whether a specific JitsiConferenceErrors instance indicates a
|
||||
* fatal JitsiConference error.
|
||||
* Determines whether a specific {@link JitsiConferenceErrors} instance
|
||||
* indicates a fatal {@link JitsiConference} error.
|
||||
*
|
||||
* FIXME Figure out the category of errors defined by the function and describe
|
||||
* that category. I've currently named the category fatal because it appears to
|
||||
* be used in the cases of unrecoverable errors that necessitate a reload.
|
||||
*
|
||||
* @param {Object|string} error - The JitsiConferenceErrors instance to
|
||||
* categorize/classify or an Error-like object.
|
||||
* @returns {boolean} True if the specified JitsiConferenceErrors instance
|
||||
* indicates a fatal JitsiConference error; otherwise, false.
|
||||
* @param {Object|string} error - The {@code JitsiConferenceErrors} instance to
|
||||
* categorize/classify or an {@link Error}-like object.
|
||||
* @returns {boolean} If the specified {@code JitsiConferenceErrors} instance
|
||||
* indicates a fatal {@code JitsiConference} error, {@code true}; otherwise,
|
||||
* {@code false}.
|
||||
*/
|
||||
export function isFatalJitsiConferenceError(error: Object | string) {
|
||||
if (typeof error !== 'string') {
|
||||
|
@ -78,17 +79,18 @@ export function isFatalJitsiConferenceError(error: Object | string) {
|
|||
}
|
||||
|
||||
/**
|
||||
* Determines whether a specific JitsiConnectionErrors instance indicates a
|
||||
* fatal JitsiConnection error.
|
||||
* Determines whether a specific {@link JitsiConnectionErrors} instance
|
||||
* indicates a fatal {@link JitsiConnection} error.
|
||||
*
|
||||
* FIXME Figure out the category of errors defined by the function and describe
|
||||
* that category. I've currently named the category fatal because it appears to
|
||||
* be used in the cases of unrecoverable errors that necessitate a reload.
|
||||
*
|
||||
* @param {Object|string} error - The JitsiConnectionErrors instance to
|
||||
* categorize/classify or an Error-like object.
|
||||
* @returns {boolean} True if the specified JitsiConnectionErrors instance
|
||||
* indicates a fatal JitsiConnection error; otherwise, false.
|
||||
* @param {Object|string} error - The {@code JitsiConnectionErrors} instance to
|
||||
* categorize/classify or an {@link Error}-like object.
|
||||
* @returns {boolean} If the specified {@code JitsiConnectionErrors} instance
|
||||
* indicates a fatal {@code JitsiConnection} error, {@code true}; otherwise,
|
||||
* {@code false}.
|
||||
*/
|
||||
export function isFatalJitsiConnectionError(error: Object | string) {
|
||||
if (typeof error !== 'string') {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* @flow */
|
||||
// @flow
|
||||
|
||||
import PropTypes from 'prop-types';
|
||||
import React, { Component } from 'react';
|
||||
|
@ -17,11 +17,11 @@ declare var APP: Object;
|
|||
const logger = require('jitsi-meet-logger').getLogger(__filename);
|
||||
|
||||
/**
|
||||
* Implements abstract React Component for the page reload overlays.
|
||||
* Implements an abstract React {@link Component} for the page reload overlays.
|
||||
*/
|
||||
export default class AbstractPageReloadOverlay extends Component<*, *> {
|
||||
/**
|
||||
* AbstractPageReloadOverlay component's property types.
|
||||
* {@code AbstractPageReloadOverlay} component's property types.
|
||||
*
|
||||
* @static
|
||||
*/
|
||||
|
@ -55,6 +55,25 @@ export default class AbstractPageReloadOverlay extends Component<*, *> {
|
|||
t: PropTypes.func
|
||||
};
|
||||
|
||||
/**
|
||||
* Determines whether this overlay needs to be rendered (according to a
|
||||
* specific redux state). Called by {@link OverlayContainer}.
|
||||
*
|
||||
* @param {Object} state - The redux state.
|
||||
* @returns {boolean} - If this overlay needs to be rendered, {@code true};
|
||||
* {@code false}, otherwise.
|
||||
*/
|
||||
static needsRender(state) {
|
||||
const conferenceError = state['features/base/conference'].error;
|
||||
const connectionError = state['features/base/connection'].error;
|
||||
|
||||
return (
|
||||
(connectionError && isFatalJitsiConnectionError(connectionError))
|
||||
|| (conferenceError
|
||||
&& isFatalJitsiConferenceError(conferenceError))
|
||||
);
|
||||
}
|
||||
|
||||
_interval: ?number
|
||||
|
||||
state: {
|
||||
|
@ -89,25 +108,6 @@ export default class AbstractPageReloadOverlay extends Component<*, *> {
|
|||
title: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if this overlay needs to be rendered. This function will be called
|
||||
* by the {@code OverlayContainer}.
|
||||
*
|
||||
* @param {Object} state - The redux state.
|
||||
* @returns {boolean} - True if this overlay needs to be rendered, false
|
||||
* otherwise.
|
||||
*/
|
||||
static needsRender(state) {
|
||||
const conferenceError = state['features/base/conference'].error;
|
||||
const connectionError = state['features/base/connection'].error;
|
||||
|
||||
return (
|
||||
(connectionError && isFatalJitsiConnectionError(connectionError))
|
||||
|| (conferenceError
|
||||
&& isFatalJitsiConferenceError(conferenceError))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes a new AbstractPageReloadOverlay instance.
|
||||
*
|
||||
|
@ -220,10 +220,10 @@ export default class AbstractPageReloadOverlay extends Component<*, *> {
|
|||
* @returns {ReactElement}
|
||||
*/
|
||||
_renderProgressBar() {
|
||||
const { timeoutSeconds, timeLeft } = this.state;
|
||||
const { timeLeft, timeoutSeconds } = this.state;
|
||||
const timeRemaining = timeoutSeconds - timeLeft;
|
||||
const percentageComplete = Math.floor(
|
||||
(timeRemaining / timeoutSeconds) * 100);
|
||||
const percentageComplete
|
||||
= Math.floor((timeRemaining / timeoutSeconds) * 100);
|
||||
|
||||
return (
|
||||
<div
|
||||
|
@ -231,9 +231,7 @@ export default class AbstractPageReloadOverlay extends Component<*, *> {
|
|||
id = 'reloadProgressBar'>
|
||||
<div
|
||||
className = 'progress-indicator-fill'
|
||||
style = {{
|
||||
width: `${percentageComplete}%`
|
||||
}} />
|
||||
style = {{ width: `${percentageComplete}%` }} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
@ -243,11 +241,11 @@ export default class AbstractPageReloadOverlay extends Component<*, *> {
|
|||
* Maps (parts of) the redux state to the associated component's props.
|
||||
*
|
||||
* @param {Object} state - The redux state.
|
||||
* @returns {{
|
||||
* isNetworkFailure: boolean,
|
||||
* reason: string
|
||||
* }}
|
||||
* @protected
|
||||
* @returns {{
|
||||
* isNetworkFailure: boolean,
|
||||
* reason: string
|
||||
* }}
|
||||
*/
|
||||
export function abstractMapStateToProps(state: Object) {
|
||||
const conferenceError = state['features/base/conference'].error;
|
||||
|
|
|
@ -2,12 +2,12 @@ import PropTypes from 'prop-types';
|
|||
import { Component } from 'react';
|
||||
|
||||
/**
|
||||
* Implements a React Component for suspended overlay. Shown when a suspend is
|
||||
* detected.
|
||||
* Implements a React {@link Component} for suspended overlay. Shown when a
|
||||
* suspend is detected.
|
||||
*/
|
||||
export default class AbstractSuspendedOverlay extends Component {
|
||||
/**
|
||||
* SuspendedOverlay component's property types.
|
||||
* {@code AbstractSuspendedOverlay} component's property types.
|
||||
*
|
||||
* @static
|
||||
*/
|
||||
|
@ -22,24 +22,14 @@ export default class AbstractSuspendedOverlay extends Component {
|
|||
};
|
||||
|
||||
/**
|
||||
* Check if this overlay needs to be rendered. This function will be called
|
||||
* by the {@code OverlayContainer}.
|
||||
* Determines whether this overlay needs to be rendered (according to a
|
||||
* specific redux state). Called by {@link OverlayContainer}.
|
||||
*
|
||||
* @param {Object} state - The redux state.
|
||||
* @returns {boolean} - True if this overlay needs to be rendered, false
|
||||
* otherwise.
|
||||
* @returns {boolean} - If this overlay needs to be rendered, {@code true};
|
||||
* {@code false}, otherwise.
|
||||
*/
|
||||
static needsRender(state) {
|
||||
return state['features/overlay'].suspendDetected;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements React's {@link Component#render()}.
|
||||
*
|
||||
* @inheritdoc
|
||||
* @returns {ReactElement|null}
|
||||
*/
|
||||
render() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
import PropTypes from 'prop-types';
|
||||
import { Component } from 'react';
|
||||
|
||||
|
||||
/**
|
||||
* Implements a React Component for overlay with guidance how to proceed with
|
||||
* gUM prompt.
|
||||
* Implements a React {@link Component} for overlay with guidance how to proceed
|
||||
* with gUM prompt.
|
||||
*/
|
||||
export default class AbstractUserMediaPermissionsOverlay extends Component {
|
||||
/**
|
||||
* UserMediaPermissionsOverlay component's property types.
|
||||
* {@code AbstractUserMediaPermissionsOverlay} component's property types.
|
||||
*
|
||||
* @static
|
||||
*/
|
||||
|
@ -32,36 +31,26 @@ export default class AbstractUserMediaPermissionsOverlay extends Component {
|
|||
};
|
||||
|
||||
/**
|
||||
* Check if this overlay needs to be rendered. This function will be called
|
||||
* by the {@code OverlayContainer}.
|
||||
* Determines whether this overlay needs to be rendered (according to a
|
||||
* specific redux state). Called by {@link OverlayContainer}.
|
||||
*
|
||||
* @param {Object} state - The redux state.
|
||||
* @returns {boolean} - True if this overlay needs to be rendered, false
|
||||
* otherwise.
|
||||
* @returns {boolean} - If this overlay needs to be rendered, {@code true};
|
||||
* {@code false}, otherwise.
|
||||
*/
|
||||
static needsRender(state) {
|
||||
return state['features/overlay'].isMediaPermissionPromptVisible;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements React's {@link Component#render()}.
|
||||
*
|
||||
* @inheritdoc
|
||||
* @returns {ReactElement|null}
|
||||
*/
|
||||
render() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Maps (parts of) the redux state to the associated component's props.
|
||||
*
|
||||
* @param {Object} state - The redux state.
|
||||
* @returns {{
|
||||
* browser: string
|
||||
* }}
|
||||
* @protected
|
||||
* @returns {{
|
||||
* browser: string
|
||||
* }}
|
||||
*/
|
||||
export function abstractMapStateToProps(state) {
|
||||
const { browser } = state['features/overlay'];
|
||||
|
|
|
@ -82,7 +82,7 @@ class FilmstripOnlyOverlayFrame extends Component {
|
|||
* Implements React's {@link Component#render()}.
|
||||
*
|
||||
* @inheritdoc
|
||||
* @returns {ReactElement|null}
|
||||
* @returns {ReactElement}
|
||||
*/
|
||||
render() {
|
||||
return (
|
||||
|
|
|
@ -51,8 +51,8 @@ function getOverlays() {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements a React Component that will display the correct overlay when
|
||||
* needed.
|
||||
* Implements a React {@link Component} that will display the correct overlay
|
||||
* when needed.
|
||||
*/
|
||||
class OverlayContainer extends Component {
|
||||
/**
|
||||
|
@ -71,8 +71,8 @@ class OverlayContainer extends Component {
|
|||
* Implements React's {@link Component#render()}.
|
||||
*
|
||||
* @inheritdoc
|
||||
* @returns {ReactElement|null}
|
||||
* @public
|
||||
* @returns {ReactElement|null}
|
||||
*/
|
||||
render() {
|
||||
const { overlay } = this.props;
|
||||
|
@ -82,13 +82,14 @@ class OverlayContainer extends Component {
|
|||
}
|
||||
|
||||
/**
|
||||
* Maps (parts of) the redux state to the associated OverlayContainer's props.
|
||||
* Maps (parts of) the redux state to the associated {@code OverlayContainer}'s
|
||||
* props.
|
||||
*
|
||||
* @param {Object} state - The redux state.
|
||||
* @returns {{
|
||||
* overlay: ?Object
|
||||
* }}
|
||||
* @private
|
||||
* @returns {{
|
||||
* overlay: ?Object
|
||||
* }}
|
||||
*/
|
||||
function _mapStateToProps(state) {
|
||||
let overlay;
|
||||
|
|
|
@ -4,7 +4,7 @@ import PropTypes from 'prop-types';
|
|||
import React, { Component } from 'react';
|
||||
|
||||
/**
|
||||
* Implements a React Component for the frame of the overlays.
|
||||
* Implements a React {@link Component} for the frame of the overlays.
|
||||
*/
|
||||
export default class OverlayFrame extends Component {
|
||||
/**
|
||||
|
|
|
@ -15,8 +15,7 @@ class SuspendedFilmstripOnlyOverlay extends AbstractSuspendedOverlay {
|
|||
* Implements React's {@link Component#render()}.
|
||||
*
|
||||
* @inheritdoc
|
||||
* @override
|
||||
* @returns {ReactElement|null}
|
||||
* @returns {ReactElement}
|
||||
*/
|
||||
render() {
|
||||
const { t } = this.props;
|
||||
|
|
|
@ -15,8 +15,7 @@ class SuspendedOverlay extends AbstractSuspendedOverlay {
|
|||
* Implements React's {@link Component#render()}.
|
||||
*
|
||||
* @inheritdoc
|
||||
* @override
|
||||
* @returns {ReactElement|null}
|
||||
* @returns {ReactElement}
|
||||
*/
|
||||
render() {
|
||||
const { t } = this.props;
|
||||
|
|
|
@ -13,12 +13,12 @@ import FilmstripOnlyOverlayFrame from './FilmstripOnlyOverlayFrame';
|
|||
*/
|
||||
class UserMediaPermissionsFilmstripOnlyOverlay
|
||||
extends AbstractUserMediaPermissionsOverlay {
|
||||
|
||||
/**
|
||||
* Implements React's {@link Component#render()}.
|
||||
*
|
||||
* @inheritdoc
|
||||
* @override
|
||||
* @returns {ReactElement|null}
|
||||
* @returns {ReactElement}
|
||||
*/
|
||||
render() {
|
||||
const { t } = this.props;
|
||||
|
|
|
@ -38,8 +38,7 @@ class UserMediaPermissionsOverlay extends AbstractUserMediaPermissionsOverlay {
|
|||
* Implements React's {@link Component#render()}.
|
||||
*
|
||||
* @inheritdoc
|
||||
* @override
|
||||
* @returns {ReactElement|null}
|
||||
* @returns {ReactElement}
|
||||
*/
|
||||
render() {
|
||||
const { browser, t } = this.props;
|
||||
|
@ -77,8 +76,8 @@ class UserMediaPermissionsOverlay extends AbstractUserMediaPermissionsOverlay {
|
|||
/**
|
||||
* Renders the policy logo.
|
||||
*
|
||||
* @returns {ReactElement|null}
|
||||
* @private
|
||||
* @returns {ReactElement|null}
|
||||
*/
|
||||
_renderPolicyLogo() {
|
||||
const { policyLogoSrc } = this.state;
|
||||
|
|
Loading…
Reference in New Issue