Token based features (#3075)

* Adds an option to disable features based on token data.

Reverts changes from b84e910086, removes disableDesktopSharing option and an interface_config option.

* Disable recording button based on token features data.

Hide recording if local participant isGuest and roles based on token.
When enableUserRolesBasedOnToken is enabled we were not hiding the record button for guests.

* Adds filtering of jibri iqs and rayo based on features.

Moves feature checking in separate utility function.
Renames utility method.

* Adds a footer text when outbound-call is not feature enabled.

* Fixes comments.
This commit is contained in:
Дамян Минков
2018-06-15 13:10:22 -05:00
committed by GitHub
parent 0cf585860b
commit ac834326e7
18 changed files with 402 additions and 108 deletions

View File

@@ -1,3 +1,4 @@
import Tooltip from '@atlaskit/tooltip';
import PropTypes from 'prop-types';
import React, { Component } from 'react';
@@ -8,6 +9,16 @@ import React, { Component } from 'react';
* @extends Component
*/
class OverflowMenuItem extends Component {
/**
* Default values for {@code OverflowMenuItem} component's properties.
*
* @static
*/
static defaultProps = {
tooltipPosition: 'left',
disabled: false
};
/**
* {@code OverflowMenuItem} component's property types.
*
@@ -20,6 +31,11 @@ class OverflowMenuItem extends Component {
*/
accessibilityLabel: PropTypes.string,
/**
* Whether menu item is disabled or not.
*/
disabled: PropTypes.bool,
/**
* The icon class to use for displaying an icon before the link text.
*/
@@ -33,7 +49,18 @@ class OverflowMenuItem extends Component {
/**
* The text to display in the {@code OverflowMenuItem}.
*/
text: PropTypes.string
text: PropTypes.string,
/**
* The text to display in the tooltip.
*/
tooltip: PropTypes.string,
/**
* From which direction the tooltip should appear, relative to the
* button.
*/
tooltipPosition: PropTypes.string
};
/**
@@ -43,15 +70,25 @@ class OverflowMenuItem extends Component {
* @returns {ReactElement}
*/
render() {
let className = 'overflow-menu-item';
className += this.props.disabled ? ' disabled' : '';
return (
<li
aria-label = { this.props.accessibilityLabel }
className = 'overflow-menu-item'
onClick = { this.props.onClick }>
className = { className }
onClick = { this.props.disabled ? null : this.props.onClick }>
<span className = 'overflow-menu-item-icon'>
<i className = { this.props.icon } />
</span>
{ this.props.text }
{ this.props.tooltip
? <Tooltip
content = { this.props.tooltip }
position = { this.props.tooltipPosition }>
<span>{ this.props.text }</span>
</Tooltip>
: this.props.text }
</li>
);
}