From 363142569b1f07121ec379820a7859b2e39ebf85 Mon Sep 17 00:00:00 2001 From: trevor-signal <131492920+trevor-signal@users.noreply.github.com> Date: Fri, 6 Oct 2023 11:45:43 -0400 Subject: [PATCH] Disable selecting existing group members in add members modal --- stylesheets/components/CircleCheckbox.scss | 4 +++- stylesheets/components/ListTile.scss | 4 ---- .../conversation-details/AddGroupMembersModal.stories.tsx | 2 +- .../AddGroupMembersModal/ChooseGroupMembersModal.tsx | 1 + ts/test-mock/pnp/accept_gv2_invite_test.ts | 7 ++----- ts/test-mock/pnp/send_gv2_invite_test.ts | 4 +--- ts/test-mock/storage/archive_test.ts | 2 +- ts/test-mock/storage/pin_unpin_test.ts | 6 ++---- 8 files changed, 11 insertions(+), 19 deletions(-) diff --git a/stylesheets/components/CircleCheckbox.scss b/stylesheets/components/CircleCheckbox.scss index 7e0ab395e..8c8c932c7 100644 --- a/stylesheets/components/CircleCheckbox.scss +++ b/stylesheets/components/CircleCheckbox.scss @@ -52,6 +52,7 @@ &:disabled:checked { &::before { background: $color-gray-15; + border-color: $color-gray-15; } } } @@ -65,6 +66,7 @@ &:disabled:checked { &::before { background: $color-gray-45; + border-color: $color-gray-45; } } } @@ -80,7 +82,7 @@ input[type='checkbox'] { &:checked { - &::before { + &:not([disabled])::before { background: $color-ultramarine; border: 1.5px solid $color-ultramarine; } diff --git a/stylesheets/components/ListTile.scss b/stylesheets/components/ListTile.scss index 8f2368aea..7c7fff92c 100644 --- a/stylesheets/components/ListTile.scss +++ b/stylesheets/components/ListTile.scss @@ -34,10 +34,6 @@ button.ListTile { display: flex; flex-direction: column; font-family: $inter; - - .ListTile[aria-disabled='true'] & { - opacity: 0.5; - } } &__title { diff --git a/ts/components/conversation/conversation-details/AddGroupMembersModal.stories.tsx b/ts/components/conversation/conversation-details/AddGroupMembersModal.stories.tsx index a26821cfe..dd24b2463 100644 --- a/ts/components/conversation/conversation-details/AddGroupMembersModal.stories.tsx +++ b/ts/components/conversation/conversation-details/AddGroupMembersModal.stories.tsx @@ -40,7 +40,7 @@ type PropsType = ComponentProps; const createProps = ( overrideProps: Partial = {}, - candidateContacts: Array = [] + candidateContacts: Array = allCandidateContacts ): PropsType => ({ clearRequestError: action('clearRequestError'), conversationIdsAlreadyInGroup: new Set(), diff --git a/ts/components/conversation/conversation-details/AddGroupMembersModal/ChooseGroupMembersModal.tsx b/ts/components/conversation/conversation-details/AddGroupMembersModal/ChooseGroupMembersModal.tsx index f275d44a2..2d4125a24 100644 --- a/ts/components/conversation/conversation-details/AddGroupMembersModal/ChooseGroupMembersModal.tsx +++ b/ts/components/conversation/conversation-details/AddGroupMembersModal/ChooseGroupMembersModal.tsx @@ -329,6 +329,7 @@ export function ChooseGroupMembersModal({ onClick={handleContactClick} isChecked={row.isChecked} badge={undefined} + disabledReason={row.disabledReason} /> ); break; diff --git a/ts/test-mock/pnp/accept_gv2_invite_test.ts b/ts/test-mock/pnp/accept_gv2_invite_test.ts index c47c89f0d..e10817a8e 100644 --- a/ts/test-mock/pnp/accept_gv2_invite_test.ts +++ b/ts/test-mock/pnp/accept_gv2_invite_test.ts @@ -110,14 +110,11 @@ describe('pnp/accept gv2 invite', function needsName() { .waitFor({ state: 'hidden' }); debug('Leave the group through settings'); - - await conversationStack + await window .locator('button.module-ConversationHeader__button--more') .click(); - await conversationStack - .locator('.react-contextmenu-item >> "Group settings"') - .click(); + await window.locator('.react-contextmenu-item >> "Group settings"').click(); await conversationStack .locator('.conversation-details-panel >> "Leave group"') diff --git a/ts/test-mock/pnp/send_gv2_invite_test.ts b/ts/test-mock/pnp/send_gv2_invite_test.ts index a4f751d69..7925a2adb 100644 --- a/ts/test-mock/pnp/send_gv2_invite_test.ts +++ b/ts/test-mock/pnp/send_gv2_invite_test.ts @@ -166,9 +166,7 @@ describe('pnp/send gv2 invite', function needsName() { .locator('button.module-ConversationHeader__button--more') .click(); - await conversationStack - .locator('.react-contextmenu-item >> "Group settings"') - .click(); + await window.locator('.react-contextmenu-item >> "Group settings"').click(); debug('editing group title'); { diff --git a/ts/test-mock/storage/archive_test.ts b/ts/test-mock/storage/archive_test.ts index fae722afc..7947eeb08 100644 --- a/ts/test-mock/storage/archive_test.ts +++ b/ts/test-mock/storage/archive_test.ts @@ -98,7 +98,7 @@ describe('storage service', function needsName() { ); await moreButton.click(); - const archiveButton = conversationStack.locator( + const archiveButton = window.locator( '.react-contextmenu-item >> "Archive"' ); await archiveButton.click(); diff --git a/ts/test-mock/storage/pin_unpin_test.ts b/ts/test-mock/storage/pin_unpin_test.ts index 91091eb3e..dda379f61 100644 --- a/ts/test-mock/storage/pin_unpin_test.ts +++ b/ts/test-mock/storage/pin_unpin_test.ts @@ -67,9 +67,7 @@ describe('storage service', function needsName() { ); await moreButton.click(); - const pinButton = conversationStack.locator( - '.react-contextmenu-item >> "Pin chat"' - ); + const pinButton = window.locator('.react-contextmenu-item >> "Pin chat"'); await pinButton.click(); const newState = await phone.waitForStorageState({ @@ -111,7 +109,7 @@ describe('storage service', function needsName() { ); await moreButton.click(); - const pinButton = conversationStack.locator( + const pinButton = window.locator( '.react-contextmenu-item >> "Pin chat"' ); await pinButton.click();