diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 12c458298fd..4b0e7780a7f 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -4010,6 +4010,10 @@ "message": "All message history and media will be kept from before the upgrade.", "description": "Shown on Migration popup before GV1 migration" }, + "GroupV1--Migration--info--invited--you": { + "message": "You will need to accept an invite to join this group again, and will not receive group messages until you accept.", + "description": "Shown on Learn More popup after GV1 migration" + }, "GroupV1--Migration--info--invited--many": { "message": "These members will need to accept an invite to join this group again, and will not receive group messages until they accept:", "description": "Shown on Learn More popup after or Migration popup before GV1 migration" @@ -4034,6 +4038,10 @@ "message": "This member was not capable of joining New Groups, and was removed from the group:", "description": "Shown on Learn More popup after or Migration popup before GV1 migration" }, + "GroupV1--Migration--invited--you": { + "message": "You couldn't be added to the New Group and have been invited to join.", + "description": "Shown in timeline when a group is upgraded and you were invited instead of added" + }, "GroupV1--Migration--invited--one": { "message": "$contact$ couldn’t be added to the New Group and has been invited to join.", "description": "Shown in timeline when a group is upgraded and one person was invited, instead of added", diff --git a/ts/components/GroupV1MigrationDialog.stories.tsx b/ts/components/GroupV1MigrationDialog.stories.tsx index 49b51b442ba..0741c614758 100644 --- a/ts/components/GroupV1MigrationDialog.stories.tsx +++ b/ts/components/GroupV1MigrationDialog.stories.tsx @@ -36,6 +36,10 @@ function booleanOr(value: boolean | undefined, defaultValue: boolean): boolean { } const createProps = (overrideProps: Partial = {}): PropsType => ({ + areWeInvited: boolean( + 'areWeInvited', + booleanOr(overrideProps.areWeInvited, false) + ), droppedMembers: overrideProps.droppedMembers || [contact1], hasMigrated: boolean( 'hasMigrated', @@ -63,6 +67,17 @@ stories.add('Migrated, basic', () => { ); }); +stories.add('Migrated, you are invited', () => { + return ( + + ); +}); + stories.add('Not yet migrated, multiple dropped and invited members', () => { return ( unknown; export type DataPropsType = { + readonly areWeInvited: boolean; readonly droppedMembers: Array; readonly hasMigrated: boolean; readonly invitedMembers: Array; @@ -37,6 +38,7 @@ function focusRef(el: HTMLElement | null) { export const GroupV1MigrationDialog = React.memo((props: PropsType) => { const { + areWeInvited, droppedMembers, hasMigrated, i18n, @@ -76,12 +78,23 @@ export const GroupV1MigrationDialog = React.memo((props: PropsType) => { {keepHistory} - {renderMembers( - invitedMembers, - 'GroupV1--Migration--info--invited', - i18n + {areWeInvited ? ( +
+
+
+ {i18n('GroupV1--Migration--info--invited--you')} +
+
+ ) : ( + <> + {renderMembers( + invitedMembers, + 'GroupV1--Migration--info--invited', + i18n + )} + {renderMembers(droppedMembers, droppedMembersKey, i18n)} + )} - {renderMembers(droppedMembers, droppedMembersKey, i18n)}
{renderButtons(hasMigrated, onClose, migrate, i18n)} diff --git a/ts/components/conversation/GroupV1Migration.stories.tsx b/ts/components/conversation/GroupV1Migration.stories.tsx index 4aabeec964f..7bd661c9c4f 100644 --- a/ts/components/conversation/GroupV1Migration.stories.tsx +++ b/ts/components/conversation/GroupV1Migration.stories.tsx @@ -4,6 +4,8 @@ /* eslint-disable-next-line max-classes-per-file */ import * as React from 'react'; import { storiesOf } from '@storybook/react'; +import { isBoolean } from 'lodash'; +import { boolean } from '@storybook/addon-knobs'; import { setup as setupI18n } from '../../../js/modules/i18n'; import enMessages from '../../../_locales/en/messages.json'; @@ -30,6 +32,10 @@ const contact2 = { }; const createProps = (overrideProps: Partial = {}): PropsType => ({ + areWeInvited: boolean( + 'areWeInvited', + isBoolean(overrideProps.areWeInvited) ? overrideProps.areWeInvited : false + ), droppedMembers: overrideProps.droppedMembers || [contact1], i18n, invitedMembers: overrideProps.invitedMembers || [contact2], @@ -37,6 +43,14 @@ const createProps = (overrideProps: Partial = {}): PropsType => ({ const stories = storiesOf('Components/Conversation/GroupV1Migration', module); +stories.add('You were invited', () => ( + +)); + stories.add('Single dropped and single invited member', () => ( )); diff --git a/ts/components/conversation/GroupV1Migration.tsx b/ts/components/conversation/GroupV1Migration.tsx index 8432f3829e4..6c39e1bc10e 100644 --- a/ts/components/conversation/GroupV1Migration.tsx +++ b/ts/components/conversation/GroupV1Migration.tsx @@ -11,6 +11,7 @@ import { ModalHost } from '../ModalHost'; import { GroupV1MigrationDialog } from '../GroupV1MigrationDialog'; export type PropsDataType = { + areWeInvited: boolean; droppedMembers: Array; invitedMembers: Array; }; @@ -22,7 +23,7 @@ export type PropsHousekeepingType = { export type PropsType = PropsDataType & PropsHousekeepingType; export function GroupV1Migration(props: PropsType): React.ReactElement { - const { droppedMembers, i18n, invitedMembers } = props; + const { areWeInvited, droppedMembers, i18n, invitedMembers } = props; const [showingDialog, setShowingDialog] = React.useState(false); const showDialog = React.useCallback(() => { @@ -39,8 +40,16 @@ export function GroupV1Migration(props: PropsType): React.ReactElement {
{i18n('GroupV1--Migration--was-upgraded')}
- {renderUsers(invitedMembers, i18n, 'GroupV1--Migration--invited')} - {renderUsers(droppedMembers, i18n, 'GroupV1--Migration--removed')} + {areWeInvited ? ( +
+ {i18n('GroupV1--Migration--invited--you')} +
+ ) : ( + <> + {renderUsers(invitedMembers, i18n, 'GroupV1--Migration--invited')} + {renderUsers(droppedMembers, i18n, 'GroupV1--Migration--removed')} + + )}