fix(jaas) hide support link in invite error for jaas users

This commit is contained in:
Tudor-Ovidiu Avram 2021-03-17 11:53:05 +02:00
parent aef0287605
commit 3a073d9af4
3 changed files with 27 additions and 7 deletions

View File

@ -20,7 +20,12 @@ type Props = {
/** /**
* Invoked to obtain translated strings. * Invoked to obtain translated strings.
*/ */
t: Function t: Function,
/**
* Indicates whether the support link should be shown in case of an error
*/
showSupportLink: Boolean,
}; };
/** /**
@ -33,12 +38,12 @@ class InlineDialogFailure extends Component<Props> {
* @returns {ReactElement} * @returns {ReactElement}
*/ */
render() { render() {
const { t } = this.props; const { t, showSupportLink } = this.props;
const supportLink = interfaceConfig.SUPPORT_URL; const supportLink = interfaceConfig.SUPPORT_URL;
const supportString = t('inlineDialogFailure.supportMsg'); const supportString = t('inlineDialogFailure.supportMsg');
const supportLinkElem const supportLinkElem
= supportLink = supportLink && showSupportLink
? ( ? (
<div className = 'inline-dialog-error-text'> <div className = 'inline-dialog-error-text'>
<span>{ supportString.padEnd(supportString.length + 1) } <span>{ supportString.padEnd(supportString.length + 1) }

View File

@ -70,7 +70,12 @@ type Props = {
/** /**
* Indicates if we should focus. * Indicates if we should focus.
*/ */
shouldFocus: boolean shouldFocus: boolean,
/**
* Indicates whether the support link should be shown in case of an error
*/
showSupportLink: Boolean,
}; };
/** /**
@ -263,7 +268,8 @@ class MultiSelectAutocomplete extends Component<Props, State> {
const content = ( const content = (
<div className = 'autocomplete-error'> <div className = 'autocomplete-error'>
<InlineDialogFailure <InlineDialogFailure
onRetry = { this._onRetry } /> onRetry = { this._onRetry }
showSupportLink = { this.props.showSupportLink } />
</div> </div>
); );

View File

@ -10,6 +10,7 @@ import { Icon, IconPhone } from '../../../../base/icons';
import { getLocalParticipant } from '../../../../base/participants'; import { getLocalParticipant } from '../../../../base/participants';
import { MultiSelectAutocomplete } from '../../../../base/react'; import { MultiSelectAutocomplete } from '../../../../base/react';
import { connect } from '../../../../base/redux'; import { connect } from '../../../../base/redux';
import { isVpaasMeeting } from '../../../../billing-counter/functions';
import { hideAddPeopleDialog } from '../../../actions'; import { hideAddPeopleDialog } from '../../../actions';
import AbstractAddPeopleDialog, { import AbstractAddPeopleDialog, {
type Props as AbstractProps, type Props as AbstractProps,
@ -31,6 +32,11 @@ type Props = AbstractProps & {
*/ */
_footerTextEnabled: boolean, _footerTextEnabled: boolean,
/**
* Whether the meeting belongs to JaaS user
*/
_isVpaas: boolean,
/** /**
* The redux {@code dispatch} function. * The redux {@code dispatch} function.
*/ */
@ -110,6 +116,7 @@ class InviteContactsForm extends AbstractAddPeopleDialog<Props, State> {
const { const {
_addPeopleEnabled, _addPeopleEnabled,
_dialOutEnabled, _dialOutEnabled,
_isVpaas,
t t
} = this.props; } = this.props;
const footerText = this._renderFooterText(); const footerText = this._renderFooterText();
@ -152,7 +159,8 @@ class InviteContactsForm extends AbstractAddPeopleDialog<Props, State> {
ref = { this._setMultiSelectElement } ref = { this._setMultiSelectElement }
resourceClient = { this._resourceClient } resourceClient = { this._resourceClient }
shouldFitContainer = { true } shouldFitContainer = { true }
shouldFocus = { true } /> shouldFocus = { true }
showSupportLink = { !_isVpaas } />
{ this._renderFormActions() } { this._renderFormActions() }
</div> </div>
); );
@ -516,7 +524,8 @@ function _mapStateToProps(state) {
return { return {
..._abstractMapStateToProps(state), ..._abstractMapStateToProps(state),
_footerTextEnabled: footerTextEnabled _footerTextEnabled: footerTextEnabled,
_isVpaas: isVpaasMeeting(state)
}; };
} }