Skip to content

Commit

Permalink
fix: remove invite link (#53978)
Browse files Browse the repository at this point in the history
- changes the frontend to no longer display the invite link
- changes "resend invite" functionality to regenerate a new link
  • Loading branch information
mdtro authored Aug 4, 2023
1 parent f3f39ca commit 8682011
Showing 1 changed file with 5 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import Panel from 'sentry/components/panels/panel';
import PanelBody from 'sentry/components/panels/panelBody';
import PanelHeader from 'sentry/components/panels/panelHeader';
import PanelItem from 'sentry/components/panels/panelItem';
import TextCopyInput from 'sentry/components/textCopyInput';
import {Tooltip} from 'sentry/components/tooltip';
import {IconRefresh} from 'sentry/icons';
import {t, tct} from 'sentry/locale';
Expand Down Expand Up @@ -288,7 +287,7 @@ class OrganizationMemberDetail extends DeprecatedAsyncView<Props, State> {
const {access, orgRoleList} = organization;
const canEdit = access.includes('org:write') && !this.memberDeactivated;

const {email, expired, pending, invite_link: inviteLink} = member;
const {email, expired, pending} = member;
const canResend = !expired;
const showAuth = !pending;

Expand Down Expand Up @@ -330,35 +329,19 @@ class OrganizationMemberDetail extends DeprecatedAsyncView<Props, State> {
</Details>
</PanelItem>
<PanelItem>
{inviteLink && (
{(member.pending || member.expired) && (
<InviteSection>
<InviteField>
<DetailLabel>{t('Invite Link')}</DetailLabel>
<TextCopyInput>{inviteLink}</TextCopyInput>
<p className="help-block">
{t(
'This invite link can be used by anyone who knows it. Keep it secure!'
)}
</p>
</InviteField>
<ButtonBar gap={1}>
{canResend && (
<Button
data-test-id="resend-invite"
onClick={() => this.handleInvite(false)}
icon={<IconRefresh size="sm" />}
title={t('Generate a new invite link and send a new email.')}
onClick={() => this.handleInvite(true)}
>
{t('Resend Invite')}
</Button>
)}
<Button
onClick={() => this.handleInvite(true)}
title={t(
'Generate New Invite. This will invalidate the previous invite link!'
)}
priority="danger"
aria-label={t('Generate New Invite')}
icon={<IconRefresh size="sm" />}
/>
</ButtonBar>
</InviteSection>
)}
Expand Down Expand Up @@ -466,10 +449,6 @@ const DetailLabel = styled('div')`
color: ${p => p.theme.textColor};
`;

const InviteField = styled('div')`
flex-grow: 1;
`;

const InviteSection = styled('div')`
flex-grow: 1;
display: flex;
Expand Down

0 comments on commit 8682011

Please sign in to comment.