From 1063ece2cda2f17af87d9c407b86ef8eedb6606d Mon Sep 17 00:00:00 2001 From: Matt Grogan Date: Mon, 16 Sep 2024 17:05:03 +0100 Subject: [PATCH] Allow invites to be cancelled (#6393) --- .../home/ChannelOrCommunityMembers.svelte | 14 +- .../app/src/components/home/RightPanel.svelte | 68 +++-- .../components/home/addgroup/NewGroup.svelte | 2 +- .../home/communities/edit/Edit.svelte | 4 +- .../home/groupdetails/InvitedUser.svelte | 8 +- .../home/groupdetails/Members.svelte | 2 +- frontend/app/src/i18n/cn.json | 3 + frontend/app/src/i18n/de.json | 3 + frontend/app/src/i18n/en.json | 3 + frontend/app/src/i18n/es.json | 3 + frontend/app/src/i18n/fa.json | 3 + frontend/app/src/i18n/fr.json | 3 + frontend/app/src/i18n/hi.json | 3 + frontend/app/src/i18n/it.json | 3 + frontend/app/src/i18n/iw.json | 3 + frontend/app/src/i18n/jp.json | 3 + frontend/app/src/i18n/pl.json | 3 + frontend/app/src/i18n/ru.json | 3 + frontend/app/src/i18n/uk.json | 3 + frontend/app/src/i18n/vi.json | 3 + .../src/services/community/candid/idl.js | 14 + .../src/services/community/candid/types.d.ts | 8 + .../services/community/community.client.ts | 281 +++++++++--------- .../src/services/group/candid/idl.js | 10 + .../src/services/group/candid/types.d.ts | 4 + .../src/services/group/group.client.ts | 201 +++++++------ .../services/localUserIndex/candid/idl.d.ts | 2 - .../localUserIndex/localUserIndex.client.ts | 67 ++--- .../src/services/localUserIndex/mappers.ts | 28 +- .../src/services/openchatAgent.ts | 67 ++--- frontend/openchat-client/src/openchat.ts | 112 ++++--- .../openchat-shared/src/domain/chat/chat.ts | 2 - frontend/openchat-shared/src/domain/worker.ts | 27 +- frontend/openchat-worker/src/worker.ts | 22 +- 34 files changed, 550 insertions(+), 435 deletions(-) diff --git a/frontend/app/src/components/home/ChannelOrCommunityMembers.svelte b/frontend/app/src/components/home/ChannelOrCommunityMembers.svelte index 67c239d578..b8d5c9cec4 100644 --- a/frontend/app/src/components/home/ChannelOrCommunityMembers.svelte +++ b/frontend/app/src/components/home/ChannelOrCommunityMembers.svelte @@ -76,6 +76,14 @@ break; } } + + function onCancelCommunityInvite(ev: CustomEvent): void { + dispatch("cancelCommunityInvite", ev.detail); + } + + function onCancelGroupInvite(ev: CustomEvent): void { + dispatch("cancelGroupInvite", ev.detail); + } @@ -101,7 +109,8 @@ on:chatWith on:showInviteUsers={showInviteCommunityUsers} on:removeMember={onRemoveCommunityMember} - on:changeRole={onChangeCommunityRole} /> + on:changeRole={onChangeCommunityRole} + on:cancelInvite={onCancelCommunityInvite} /> + on:changeRole={onChangeGroupRole} + on:cancelInvite={onCancelGroupInvite} />