Skip to content

Commit

Permalink
chore(onboarding): remove members invite members ff from frontend (#8…
Browse files Browse the repository at this point in the history
…2797)

remove `members-invite-teammates` feature flag from frontend
  • Loading branch information
ameliahsu authored Dec 31, 2024
1 parent 1cc1306 commit 8f5df00
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ function defaultInvite(): InviteRow {
function canInvite(organization: Organization) {
return (
organization.access?.includes('member:write') ||
(organization.features.includes('members-invite-teammates') &&
organization.allowMemberInvite &&
organization.access?.includes('member:invite'))
(organization.allowMemberInvite && organization.access?.includes('member:invite'))
);
}

Expand Down
4 changes: 1 addition & 3 deletions static/app/components/roleSelectControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ type Props = Omit<ControlProps<OptionType>, 'onChange' | 'value'> & {
function RoleSelectControl({roles, disableUnallowed, ...props}: Props) {
const organization = useOrganization();
const isMemberInvite =
organization.features.includes('members-invite-teammates') &&
organization.allowMemberInvite &&
organization.access?.includes('member:invite');
organization.allowMemberInvite && organization.access?.includes('member:invite');

return (
<SelectControl
Expand Down
1 change: 0 additions & 1 deletion static/app/data/forms/organizationMembershipSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ const formGroups: JsonFormObject[] = [
help: t(
'Allow organization members to invite other members via email without needing org owner or manager approval.'
),
visible: ({features}) => features.has('members-invite-teammates'),
},
{
name: 'allowMemberProjectCreation',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ describe('OrganizationMemberRow', function () {

it('has "Resend Invite" button if invite was sent from curr user and feature is on', function () {
const org = OrganizationFixture({
features: ['members-invite-teammates'],
access: ['member:invite'],
});
render(<OrganizationMemberRow {...props} organization={org} />);
Expand All @@ -131,7 +130,6 @@ describe('OrganizationMemberRow', function () {

it('does not have "Resend Invite" button if invite was sent from other user and feature is on', function () {
const org = OrganizationFixture({
features: ['members-invite-teammates'],
access: ['member:invite'],
});
render(
Expand Down Expand Up @@ -175,7 +173,6 @@ describe('OrganizationMemberRow', function () {

it('has Remove button if invite was sent from curr user and feature is on', function () {
const org = OrganizationFixture({
features: ['members-invite-teammates'],
access: ['member:invite'],
});
render(<OrganizationMemberRow {...props} organization={org} />);
Expand All @@ -185,7 +182,6 @@ describe('OrganizationMemberRow', function () {

it('has disabled Remove button if invite was sent from other user and feature is on', function () {
const org = OrganizationFixture({
features: ['members-invite-teammates'],
access: ['member:invite'],
});
render(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,7 @@ export default class OrganizationMemberRow extends PureComponent<Props, State> {
const showRemoveButton = !isCurrentUser;
const showLeaveButton = isCurrentUser;
const isInviteFromCurrentUser = pending && inviterName === currentUser.name;
const canInvite =
organization.features?.includes('members-invite-teammates') &&
organization.allowMemberInvite &&
access.includes('member:invite');
const canInvite = organization.allowMemberInvite && access.includes('member:invite');
// members can remove invites they sent if allowMemberInvite is true
const canEditInvite = canInvite && isInviteFromCurrentUser;
const canRemoveMember =
Expand Down

0 comments on commit 8f5df00

Please sign in to comment.