[MM-51098] Hide "copy invite link" when selecting guest - migrated from webapp (#22745)

Этот коммит содержится в:
Julien Tant
2023-04-03 09:20:44 -07:00
коммит произвёл GitHub
родитель c3b32de46e
Коммит 72cd7ac4e0
3 изменённых файлов: 18 добавлений и 2 удалений

Просмотреть файл

@@ -223,4 +223,15 @@ describe('Guest Account - Guest User Invitation Flow', () => {
// * Verify invite more button is present
cy.findByTestId('invite-more').should('be.visible');
});
it('hides the copy link button when inviting guests', () => {
// # Open team menu and click 'Invite People'
cy.uiOpenTeamMenu('Invite People');
// # Select Guest
cy.findByTestId('inviteGuestLink').should('be.visible').click();
// * The button "Copy invite link" should not exist
cy.findByTestId('InviteView__copyInviteLink').should('not.exist');
});
});

Просмотреть файл

@@ -51,6 +51,10 @@ button.InviteView__copyLink.tertiary-button:focus {
display: none;
}
&-guest {
justify-content: flex-end;
}
.btn {
font-weight: 600;
}

Просмотреть файл

@@ -4,6 +4,7 @@
import React, {useEffect, useMemo} from 'react';
import {Modal} from 'react-bootstrap';
import {FormattedMessage, useIntl} from 'react-intl';
import classNames from 'classnames';
import deepFreeze from 'mattermost-redux/utils/deep_freeze';
import {Channel} from '@mattermost/types/channels';
@@ -259,8 +260,8 @@ export default function InviteView(props: Props) {
)}
<OverageUsersBannerNotice/>
</Modal.Body>
<Modal.Footer className={'InviteView__footer ' + props.footerClass}>
{copyButton}
<Modal.Footer className={classNames('InviteView__footer', props.footerClass, {'InviteView__footer-guest': props.inviteType === InviteType.GUEST})}>
{props.inviteType === InviteType.MEMBER && copyButton}
<button
disabled={!isInviteValid}
onClick={props.invite}