From 8a33a9adb5883412d484a63fc0b3fbe84cf232c0 Mon Sep 17 00:00:00 2001 From: Wu Tianwei <30284043+WTW0313@users.noreply.github.com> Date: Wed, 19 Aug 2026 02:50:07 +0000 Subject: [PATCH] fix(web): remove only-me resource access option (#40956) --- .../access-rules-editor/__tests__/index.spec.tsx | 12 ++++-------- .../access-rules-editor/open-scope-section.tsx | 10 +--------- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/web/app/components/access-rules-editor/__tests__/index.spec.tsx b/web/app/components/access-rules-editor/__tests__/index.spec.tsx index 6ef223cdee3..9652987e7f2 100644 --- a/web/app/components/access-rules-editor/__tests__/index.spec.tsx +++ b/web/app/components/access-rules-editor/__tests__/index.spec.tsx @@ -143,15 +143,12 @@ describe('AccessRulesEditor', () => { const allMembersButton = screen.getByRole('button', { name: /permission\.accessRule\.allPermittedMembers/, }) - const onlyMeButton = screen.getByRole('button', { name: /permission\.accessRule\.onlyMe/ }) const specificMembersButton = screen.getByRole('button', { name: /permission\.accessRule\.specificMembersOnly/, }) expect(allMembersButton).toBeDisabled() - expect(onlyMeButton).toBeDisabled() expect(specificMembersButton).toBeDisabled() expect(allMembersButton).toHaveAttribute('aria-pressed', 'false') - expect(onlyMeButton).toHaveAttribute('aria-pressed', 'false') expect(specificMembersButton).toHaveAttribute('aria-pressed', 'false') }) @@ -201,7 +198,7 @@ describe('AccessRulesEditor', () => { expect(onRemoveAccessPolicyMemberBinding).toHaveBeenCalledWith('account-1', 'app-policy-id') }) - it('should render and update the only-me resource access scope', () => { + it('should hide the only-me option and allow changing a legacy only-me scope', () => { const onOpenScopeChange = vi.fn() render( @@ -217,10 +214,9 @@ describe('AccessRulesEditor', () => { />, ) - expect(screen.getByRole('button', { name: /permission\.accessRule\.onlyMe/ })).toHaveAttribute( - 'aria-pressed', - 'true', - ) + expect( + screen.queryByRole('button', { name: /permission\.accessRule\.onlyMe/ }), + ).not.toBeInTheDocument() fireEvent.click( screen.getByRole('button', { name: /permission\.accessRule\.specificMembersOnly/ }), diff --git a/web/app/components/access-rules-editor/open-scope-section.tsx b/web/app/components/access-rules-editor/open-scope-section.tsx index 8c24653dc50..8f3ecfe9a76 100644 --- a/web/app/components/access-rules-editor/open-scope-section.tsx +++ b/web/app/components/access-rules-editor/open-scope-section.tsx @@ -48,7 +48,7 @@ function ResourceOpenScopeSection({ value, disabled, onChange }: ResourceOpenSco -
+
- $['accessRule.onlyMe'], { ns: 'permission' })} - description={t(($) => $['accessRule.onlyMeDescription'], { ns: 'permission' })} - onChange={onChange ? handleRequestChange : undefined} - />