fix(authentication): removed cancel event from overlay effect (#9274)

* fix(authentication) resolved #9263 issue

* fix(authentication) hide dialog close icon

* fix(authentication) fixed lint error about missing prop
This commit is contained in:
Calinteodor 2021-05-26 19:15:35 +03:00 committed by GitHub
parent 2fdf1a9165
commit c4677be87a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 41 additions and 7 deletions

View File

@ -10,7 +10,10 @@ import { Dialog } from '../../../base/dialog';
import { translate, translateToHTML } from '../../../base/i18n'; import { translate, translateToHTML } from '../../../base/i18n';
import { JitsiConnectionErrors } from '../../../base/lib-jitsi-meet'; import { JitsiConnectionErrors } from '../../../base/lib-jitsi-meet';
import { connect as reduxConnect } from '../../../base/redux'; import { connect as reduxConnect } from '../../../base/redux';
import { authenticateAndUpgradeRole, cancelLogin } from '../../actions.web'; import {
authenticateAndUpgradeRole,
cancelLogin
} from '../../actions.web';
/** /**
* The type of the React {@code Component} props of {@link LoginDialog}. * The type of the React {@code Component} props of {@link LoginDialog}.
@ -121,8 +124,15 @@ class LoginDialog extends Component<Props, State> {
*/ */
_onCancelLogin() { _onCancelLogin() {
const { dispatch } = this.props; const { dispatch } = this.props;
const cancelButton = document.getElementById('modal-dialog-cancel-button');
dispatch(cancelLogin()); if (cancelButton) {
cancelButton.onclick = () => {
dispatch(cancelLogin());
};
}
return false;
} }
_onLogin: () => void; _onLogin: () => void;
@ -242,6 +252,7 @@ class LoginDialog extends Component<Props, State> {
return ( return (
<Dialog <Dialog
hideCloseIconButton = { true }
okDisabled = { okDisabled = {
connecting connecting
|| loginStarted || loginStarted

View File

@ -63,8 +63,15 @@ class WaitForOwnerDialog extends PureComponent<Props> {
*/ */
_onCancelWaitForOwner() { _onCancelWaitForOwner() {
const { dispatch } = this.props; const { dispatch } = this.props;
const cancelButton = document.getElementById('modal-dialog-cancel-button');
dispatch(cancelWaitForOwner()); if (cancelButton) {
cancelButton.onclick = () => {
dispatch(cancelWaitForOwner());
};
}
return false;
} }
_onIAmHost: () => void; _onIAmHost: () => void;
@ -94,6 +101,7 @@ class WaitForOwnerDialog extends PureComponent<Props> {
return ( return (
<Dialog <Dialog
hideCloseIconButton = { true }
okKey = { t('dialog.IamHost') } okKey = { t('dialog.IamHost') }
onCancel = { this._onCancelWaitForOwner } onCancel = { this._onCancelWaitForOwner }
onSubmit = { this._onIAmHost } onSubmit = { this._onIAmHost }

View File

@ -30,6 +30,7 @@ type Props = {
id: string, id: string,
appearance?: 'danger' | 'warning', appearance?: 'danger' | 'warning',
heading: string, heading: string,
hideCloseIconButton: boolean,
onClose: Function, onClose: Function,
showKeyline: boolean, showKeyline: boolean,
isHeadingMultiline: boolean, isHeadingMultiline: boolean,
@ -60,6 +61,7 @@ export default class ModalHeader extends React.Component<Props> {
id, id,
appearance, appearance,
heading, heading,
hideCloseIconButton,
onClose, onClose,
showKeyline, showKeyline,
isHeadingMultiline, isHeadingMultiline,
@ -81,9 +83,11 @@ export default class ModalHeader extends React.Component<Props> {
{heading} {heading}
</TitleText> </TitleText>
</Title> </Title>
<Icon {
onClick = { onClose } !hideCloseIconButton && <Icon
src = { IconClose } /> onClick = { onClose }
src = { IconClose } />
}
</Header> </Header>
); );
} }

View File

@ -53,6 +53,11 @@ type Props = {
*/ */
hideCancelButton: boolean, hideCancelButton: boolean,
/**
* If true, the close icon button will not be displayed.
*/
hideCloseIconButton: boolean,
/** /**
* If true, no footer will be displayed. * If true, no footer will be displayed.
*/ */
@ -90,6 +95,10 @@ type Props = {
* Web dialog that uses atlaskit modal-dialog to display dialogs. * Web dialog that uses atlaskit modal-dialog to display dialogs.
*/ */
class StatelessDialog extends Component<Props> { class StatelessDialog extends Component<Props> {
static defaultProps = {
hideCloseIconButton: false
};
/** /**
* The functional component to be used for rendering the modal footer. * The functional component to be used for rendering the modal footer.
*/ */
@ -125,6 +134,7 @@ class StatelessDialog extends Component<Props> {
const { const {
customHeader, customHeader,
children, children,
hideCloseIconButton,
t /* The following fixes a flow error: */ = _.identity, t /* The following fixes a flow error: */ = _.identity,
titleString, titleString,
titleKey, titleKey,
@ -138,7 +148,8 @@ class StatelessDialog extends Component<Props> {
Header: customHeader ? customHeader : props => ( Header: customHeader ? customHeader : props => (
<ModalHeader <ModalHeader
{ ...props } { ...props }
heading = { titleString || t(titleKey) } /> heading = { titleString || t(titleKey) }
hideCloseIconButton = { hideCloseIconButton } />
) )
}} }}
footer = { this._renderFooter } footer = { this._renderFooter }