2022-06-03 21:07:51 +00:00
|
|
|
// Copyright 2020-2022 Signal Messenger, LLC
|
2020-10-30 20:34:04 +00:00
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2020-09-09 02:25:05 +00:00
|
|
|
import * as React from 'react';
|
2022-03-16 00:11:28 +00:00
|
|
|
import { action } from '@storybook/addon-actions';
|
2020-09-14 19:51:27 +00:00
|
|
|
import { storiesOf } from '@storybook/react';
|
2020-09-09 02:25:05 +00:00
|
|
|
|
2021-09-18 00:30:08 +00:00
|
|
|
import { setupI18n } from '../../util/setupI18n';
|
2021-10-26 22:59:08 +00:00
|
|
|
import { UUID } from '../../types/UUID';
|
2022-03-16 00:11:28 +00:00
|
|
|
import type { UUIDStringType } from '../../types/UUID';
|
2020-09-09 02:25:05 +00:00
|
|
|
import enMessages from '../../../_locales/en/messages.json';
|
2021-10-26 19:15:33 +00:00
|
|
|
import type { GroupV2ChangeType } from '../../groups';
|
2021-07-09 19:36:10 +00:00
|
|
|
import { SignalService as Proto } from '../../protobuf';
|
2021-10-26 19:15:33 +00:00
|
|
|
import type { SmartContactRendererType } from '../../groupChange';
|
2020-09-09 02:25:05 +00:00
|
|
|
import { GroupV2Change } from './GroupV2Change';
|
2021-12-16 17:44:54 +00:00
|
|
|
import type { FullJSXType } from '../Intl';
|
2020-09-09 02:25:05 +00:00
|
|
|
|
|
|
|
const i18n = setupI18n('en', enMessages);
|
|
|
|
|
2021-10-26 22:59:08 +00:00
|
|
|
const OUR_ID = UUID.generate().toString();
|
|
|
|
const CONTACT_A = UUID.generate().toString();
|
|
|
|
const CONTACT_B = UUID.generate().toString();
|
|
|
|
const CONTACT_C = UUID.generate().toString();
|
|
|
|
const ADMIN_A = UUID.generate().toString();
|
|
|
|
const INVITEE_A = UUID.generate().toString();
|
2020-09-09 02:25:05 +00:00
|
|
|
|
2021-07-09 19:36:10 +00:00
|
|
|
const AccessControlEnum = Proto.AccessControl.AccessRequired;
|
|
|
|
const RoleEnum = Proto.Member.Role;
|
2020-09-09 02:25:05 +00:00
|
|
|
|
2021-12-16 17:44:54 +00:00
|
|
|
const renderContact: SmartContactRendererType<FullJSXType> = (
|
|
|
|
conversationId: string
|
|
|
|
) => (
|
2020-09-09 02:25:05 +00:00
|
|
|
<React.Fragment key={conversationId}>
|
|
|
|
{`Conversation(${conversationId})`}
|
|
|
|
</React.Fragment>
|
|
|
|
);
|
|
|
|
|
2022-03-16 00:11:28 +00:00
|
|
|
const renderChange = (
|
|
|
|
change: GroupV2ChangeType,
|
|
|
|
{
|
|
|
|
groupBannedMemberships,
|
|
|
|
groupMemberships,
|
|
|
|
groupName,
|
|
|
|
areWeAdmin = true,
|
|
|
|
}: {
|
|
|
|
groupMemberships?: Array<{
|
|
|
|
uuid: UUIDStringType;
|
|
|
|
isAdmin: boolean;
|
|
|
|
}>;
|
|
|
|
groupBannedMemberships?: Array<UUIDStringType>;
|
|
|
|
groupName?: string;
|
|
|
|
areWeAdmin?: boolean;
|
|
|
|
} = {}
|
|
|
|
) => (
|
2020-09-09 02:25:05 +00:00
|
|
|
<GroupV2Change
|
2022-03-16 00:11:28 +00:00
|
|
|
areWeAdmin={areWeAdmin ?? true}
|
|
|
|
blockGroupLinkRequests={action('blockGroupLinkRequests')}
|
2020-09-09 02:25:05 +00:00
|
|
|
change={change}
|
2022-03-16 00:11:28 +00:00
|
|
|
groupBannedMemberships={groupBannedMemberships}
|
|
|
|
groupMemberships={groupMemberships}
|
2021-06-04 16:27:04 +00:00
|
|
|
groupName={groupName}
|
2020-09-09 02:25:05 +00:00
|
|
|
i18n={i18n}
|
2021-10-26 22:59:08 +00:00
|
|
|
ourUuid={OUR_ID}
|
2020-09-09 02:25:05 +00:00
|
|
|
renderContact={renderContact}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
|
|
|
|
storiesOf('Components/Conversation/GroupV2Change', module)
|
|
|
|
.add('Multiple', () => {
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
{renderChange({
|
|
|
|
from: CONTACT_A,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'title',
|
|
|
|
newTitle: 'Saturday Running',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: 'avatar',
|
|
|
|
removed: false,
|
|
|
|
},
|
2021-08-26 20:51:55 +00:00
|
|
|
{
|
|
|
|
type: 'description',
|
|
|
|
description:
|
|
|
|
'This is a long description.\n\nWe need a dialog to view it all!\n\nIt has a link to https://example.com',
|
|
|
|
},
|
2020-09-09 02:25:05 +00:00
|
|
|
{
|
|
|
|
type: 'member-add',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: OUR_ID,
|
2020-09-09 02:25:05 +00:00
|
|
|
},
|
2021-08-26 20:51:55 +00:00
|
|
|
{
|
|
|
|
type: 'description',
|
|
|
|
description: 'Another description',
|
|
|
|
},
|
2020-09-09 02:25:05 +00:00
|
|
|
{
|
|
|
|
type: 'member-privilege',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: OUR_ID,
|
2020-09-09 02:25:05 +00:00
|
|
|
newPrivilege: RoleEnum.ADMINISTRATOR,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
})
|
2020-10-06 17:06:34 +00:00
|
|
|
.add('Create', () => {
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
{renderChange({
|
|
|
|
from: OUR_ID,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'create',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
from: CONTACT_A,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'create',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'create',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
})
|
2020-09-09 02:25:05 +00:00
|
|
|
.add('Title', () => {
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
{renderChange({
|
|
|
|
from: OUR_ID,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'title',
|
|
|
|
newTitle: 'Saturday Running',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
from: CONTACT_A,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'title',
|
|
|
|
newTitle: 'Saturday Running',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'title',
|
|
|
|
newTitle: 'Saturday Running',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
from: OUR_ID,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'title',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
from: CONTACT_A,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'title',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'title',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
})
|
|
|
|
.add('Avatar', () => {
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
{renderChange({
|
|
|
|
from: OUR_ID,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'avatar',
|
|
|
|
removed: false,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
from: CONTACT_A,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'avatar',
|
|
|
|
removed: false,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'avatar',
|
|
|
|
removed: false,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
from: OUR_ID,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'avatar',
|
|
|
|
removed: true,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
from: CONTACT_A,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'avatar',
|
|
|
|
removed: true,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'avatar',
|
|
|
|
removed: true,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
})
|
|
|
|
.add('Access (Attributes)', () => {
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
{renderChange({
|
|
|
|
from: OUR_ID,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'access-attributes',
|
|
|
|
newPrivilege: AccessControlEnum.ADMINISTRATOR,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
from: ADMIN_A,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'access-attributes',
|
|
|
|
newPrivilege: AccessControlEnum.ADMINISTRATOR,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'access-attributes',
|
|
|
|
newPrivilege: AccessControlEnum.ADMINISTRATOR,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
from: OUR_ID,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'access-attributes',
|
|
|
|
newPrivilege: AccessControlEnum.MEMBER,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
from: ADMIN_A,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'access-attributes',
|
|
|
|
newPrivilege: AccessControlEnum.MEMBER,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'access-attributes',
|
|
|
|
newPrivilege: AccessControlEnum.MEMBER,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
})
|
|
|
|
.add('Access (Members)', () => {
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
{renderChange({
|
|
|
|
from: OUR_ID,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'access-members',
|
|
|
|
newPrivilege: AccessControlEnum.ADMINISTRATOR,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
from: ADMIN_A,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'access-members',
|
|
|
|
newPrivilege: AccessControlEnum.ADMINISTRATOR,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'access-members',
|
|
|
|
newPrivilege: AccessControlEnum.ADMINISTRATOR,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
from: OUR_ID,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'access-members',
|
|
|
|
newPrivilege: AccessControlEnum.MEMBER,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
from: ADMIN_A,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'access-members',
|
|
|
|
newPrivilege: AccessControlEnum.MEMBER,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'access-members',
|
|
|
|
newPrivilege: AccessControlEnum.MEMBER,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
})
|
2020-12-18 19:27:43 +00:00
|
|
|
.add('Access (Invite Link)', () => {
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
{renderChange({
|
|
|
|
from: OUR_ID,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'access-invite-link',
|
|
|
|
newPrivilege: AccessControlEnum.ANY,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
from: ADMIN_A,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'access-invite-link',
|
|
|
|
newPrivilege: AccessControlEnum.ANY,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'access-invite-link',
|
|
|
|
newPrivilege: AccessControlEnum.ANY,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
from: OUR_ID,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'access-invite-link',
|
|
|
|
newPrivilege: AccessControlEnum.ADMINISTRATOR,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
from: ADMIN_A,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'access-invite-link',
|
|
|
|
newPrivilege: AccessControlEnum.ADMINISTRATOR,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'access-invite-link',
|
|
|
|
newPrivilege: AccessControlEnum.ADMINISTRATOR,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
})
|
2020-09-09 02:25:05 +00:00
|
|
|
.add('Member Add', () => {
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
{renderChange({
|
|
|
|
from: OUR_ID,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'member-add',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: OUR_ID,
|
2020-09-09 02:25:05 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
from: CONTACT_A,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'member-add',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: OUR_ID,
|
2020-09-09 02:25:05 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'member-add',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: OUR_ID,
|
2020-09-09 02:25:05 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
from: OUR_ID,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'member-add',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: CONTACT_A,
|
2020-09-09 02:25:05 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
from: CONTACT_B,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'member-add',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: CONTACT_A,
|
2020-09-09 02:25:05 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'member-add',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: CONTACT_A,
|
2020-09-09 02:25:05 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
})
|
2020-12-18 19:27:43 +00:00
|
|
|
.add('Member Add (from invited)', () => {
|
2020-09-09 02:25:05 +00:00
|
|
|
return (
|
|
|
|
<>
|
2020-09-28 17:22:57 +00:00
|
|
|
{/* the strings where someone added you - shown like a normal add */}
|
|
|
|
{renderChange({
|
|
|
|
from: CONTACT_A,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'member-add-from-invite',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: OUR_ID,
|
2020-09-28 17:22:57 +00:00
|
|
|
inviter: CONTACT_B,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'member-add-from-invite',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: OUR_ID,
|
2020-09-28 17:22:57 +00:00
|
|
|
inviter: CONTACT_A,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{/* the rest of the 'someone added someone else' checks */}
|
|
|
|
{renderChange({
|
|
|
|
from: OUR_ID,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'member-add-from-invite',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: CONTACT_A,
|
2020-09-28 17:22:57 +00:00
|
|
|
inviter: CONTACT_B,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
from: CONTACT_A,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'member-add-from-invite',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: CONTACT_B,
|
2020-09-28 17:22:57 +00:00
|
|
|
inviter: CONTACT_C,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'member-add-from-invite',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: CONTACT_A,
|
2020-09-28 17:22:57 +00:00
|
|
|
inviter: CONTACT_B,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{/* in all of these we know the user has accepted the invite */}
|
2020-09-09 02:25:05 +00:00
|
|
|
{renderChange({
|
|
|
|
from: OUR_ID,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'member-add-from-invite',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: OUR_ID,
|
2020-09-09 02:25:05 +00:00
|
|
|
inviter: CONTACT_A,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
2020-09-28 17:22:57 +00:00
|
|
|
from: OUR_ID,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'member-add-from-invite',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: OUR_ID,
|
2020-09-28 17:22:57 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
from: CONTACT_A,
|
2020-09-09 02:25:05 +00:00
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'member-add-from-invite',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: CONTACT_A,
|
2020-09-09 02:25:05 +00:00
|
|
|
inviter: OUR_ID,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
2020-09-28 17:22:57 +00:00
|
|
|
from: CONTACT_A,
|
2020-09-09 02:25:05 +00:00
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'member-add-from-invite',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: CONTACT_A,
|
2020-09-09 02:25:05 +00:00
|
|
|
inviter: CONTACT_B,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
2020-09-28 17:22:57 +00:00
|
|
|
{renderChange({
|
|
|
|
from: CONTACT_A,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'member-add-from-invite',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: CONTACT_A,
|
2020-09-28 17:22:57 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
2020-09-09 02:25:05 +00:00
|
|
|
</>
|
|
|
|
);
|
|
|
|
})
|
2020-12-18 19:27:43 +00:00
|
|
|
.add('Member Add (from link)', () => {
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
{renderChange({
|
|
|
|
from: OUR_ID,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'member-add-from-link',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: OUR_ID,
|
2020-12-18 19:27:43 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
from: CONTACT_A,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'member-add-from-link',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: CONTACT_A,
|
2020-12-18 19:27:43 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'member-add-from-link',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: CONTACT_A,
|
2020-12-18 19:27:43 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
})
|
|
|
|
.add('Member Add (from admin approval)', () => {
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
{renderChange({
|
|
|
|
from: ADMIN_A,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'member-add-from-admin-approval',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: OUR_ID,
|
2020-12-18 19:27:43 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'member-add-from-admin-approval',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: OUR_ID,
|
2020-12-18 19:27:43 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
from: OUR_ID,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'member-add-from-admin-approval',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: CONTACT_A,
|
2020-12-18 19:27:43 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
from: ADMIN_A,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'member-add-from-admin-approval',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: CONTACT_A,
|
2020-12-18 19:27:43 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'member-add-from-admin-approval',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: CONTACT_A,
|
2020-12-18 19:27:43 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
})
|
2020-09-09 02:25:05 +00:00
|
|
|
.add('Member Remove', () => {
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
{renderChange({
|
|
|
|
from: OUR_ID,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'member-remove',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: OUR_ID,
|
2020-09-09 02:25:05 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
from: CONTACT_A,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'member-remove',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: OUR_ID,
|
2020-09-09 02:25:05 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'member-remove',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: OUR_ID,
|
2020-09-09 02:25:05 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
from: OUR_ID,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'member-remove',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: CONTACT_A,
|
2020-09-09 02:25:05 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
from: CONTACT_A,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'member-remove',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: CONTACT_A,
|
2020-09-09 02:25:05 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
from: CONTACT_B,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'member-remove',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: CONTACT_A,
|
2020-09-09 02:25:05 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'member-remove',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: CONTACT_A,
|
2020-09-09 02:25:05 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
})
|
|
|
|
.add('Member Privilege', () => {
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
{renderChange({
|
|
|
|
from: CONTACT_A,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'member-privilege',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: OUR_ID,
|
2020-09-09 02:25:05 +00:00
|
|
|
newPrivilege: RoleEnum.ADMINISTRATOR,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'member-privilege',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: OUR_ID,
|
2020-09-09 02:25:05 +00:00
|
|
|
newPrivilege: RoleEnum.ADMINISTRATOR,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
from: OUR_ID,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'member-privilege',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: CONTACT_A,
|
2020-09-09 02:25:05 +00:00
|
|
|
newPrivilege: RoleEnum.ADMINISTRATOR,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
from: ADMIN_A,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'member-privilege',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: CONTACT_A,
|
2020-09-09 02:25:05 +00:00
|
|
|
newPrivilege: RoleEnum.ADMINISTRATOR,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'member-privilege',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: CONTACT_A,
|
2020-09-09 02:25:05 +00:00
|
|
|
newPrivilege: RoleEnum.ADMINISTRATOR,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
from: CONTACT_A,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'member-privilege',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: OUR_ID,
|
2020-09-09 02:25:05 +00:00
|
|
|
newPrivilege: RoleEnum.DEFAULT,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'member-privilege',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: OUR_ID,
|
2020-09-09 02:25:05 +00:00
|
|
|
newPrivilege: RoleEnum.DEFAULT,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
from: OUR_ID,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'member-privilege',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: CONTACT_A,
|
2020-09-09 02:25:05 +00:00
|
|
|
newPrivilege: RoleEnum.DEFAULT,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
from: ADMIN_A,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'member-privilege',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: CONTACT_A,
|
2020-09-09 02:25:05 +00:00
|
|
|
newPrivilege: RoleEnum.DEFAULT,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'member-privilege',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: CONTACT_A,
|
2020-09-09 02:25:05 +00:00
|
|
|
newPrivilege: RoleEnum.DEFAULT,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
})
|
|
|
|
.add('Pending Add - one', () => {
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
{renderChange({
|
|
|
|
from: CONTACT_A,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'pending-add-one',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: OUR_ID,
|
2020-09-09 02:25:05 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'pending-add-one',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: OUR_ID,
|
2020-09-09 02:25:05 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
from: OUR_ID,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'pending-add-one',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: INVITEE_A,
|
2020-09-09 02:25:05 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
from: CONTACT_B,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'pending-add-one',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: INVITEE_A,
|
2020-09-09 02:25:05 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'pending-add-one',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: INVITEE_A,
|
2020-09-09 02:25:05 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
})
|
|
|
|
.add('Pending Add - many', () => {
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
{renderChange({
|
|
|
|
from: OUR_ID,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'pending-add-many',
|
|
|
|
count: 5,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
from: CONTACT_A,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'pending-add-many',
|
|
|
|
count: 5,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'pending-add-many',
|
|
|
|
count: 5,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
})
|
|
|
|
.add('Pending Remove - one', () => {
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
{renderChange({
|
|
|
|
from: INVITEE_A,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'pending-remove-one',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: INVITEE_A,
|
2020-09-09 02:25:05 +00:00
|
|
|
inviter: OUR_ID,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
from: OUR_ID,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'pending-remove-one',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: INVITEE_A,
|
2020-09-09 02:25:05 +00:00
|
|
|
inviter: OUR_ID,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
from: ADMIN_A,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'pending-remove-one',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: INVITEE_A,
|
2020-09-09 02:25:05 +00:00
|
|
|
inviter: OUR_ID,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'pending-remove-one',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: INVITEE_A,
|
2020-09-09 02:25:05 +00:00
|
|
|
inviter: OUR_ID,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
from: INVITEE_A,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'pending-remove-one',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: INVITEE_A,
|
2020-09-09 02:25:05 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
from: INVITEE_A,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'pending-remove-one',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: INVITEE_A,
|
2020-09-09 02:25:05 +00:00
|
|
|
inviter: CONTACT_B,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
2020-10-06 17:06:34 +00:00
|
|
|
|
|
|
|
{renderChange({
|
|
|
|
from: CONTACT_B,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'pending-remove-one',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: OUR_ID,
|
2020-10-06 17:06:34 +00:00
|
|
|
inviter: CONTACT_B,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
from: CONTACT_A,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'pending-remove-one',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: CONTACT_B,
|
2020-10-06 17:06:34 +00:00
|
|
|
inviter: CONTACT_A,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
|
2020-09-09 02:25:05 +00:00
|
|
|
{renderChange({
|
|
|
|
from: CONTACT_C,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'pending-remove-one',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: INVITEE_A,
|
2020-09-09 02:25:05 +00:00
|
|
|
inviter: CONTACT_B,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
from: OUR_ID,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'pending-remove-one',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: INVITEE_A,
|
2020-09-09 02:25:05 +00:00
|
|
|
inviter: CONTACT_B,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'pending-remove-one',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: INVITEE_A,
|
2020-09-09 02:25:05 +00:00
|
|
|
inviter: CONTACT_B,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
|
|
|
|
{renderChange({
|
|
|
|
from: OUR_ID,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'pending-remove-one',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: INVITEE_A,
|
2020-09-09 02:25:05 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
from: CONTACT_B,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'pending-remove-one',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: INVITEE_A,
|
2020-09-09 02:25:05 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'pending-remove-one',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: INVITEE_A,
|
2020-09-09 02:25:05 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
})
|
|
|
|
.add('Pending Remove - many', () => {
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
{renderChange({
|
|
|
|
from: OUR_ID,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'pending-remove-many',
|
|
|
|
count: 5,
|
|
|
|
inviter: OUR_ID,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
from: ADMIN_A,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'pending-remove-many',
|
|
|
|
count: 5,
|
|
|
|
inviter: OUR_ID,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'pending-remove-many',
|
|
|
|
count: 5,
|
|
|
|
inviter: OUR_ID,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
from: OUR_ID,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'pending-remove-many',
|
|
|
|
count: 5,
|
|
|
|
inviter: CONTACT_A,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
from: ADMIN_A,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'pending-remove-many',
|
|
|
|
count: 5,
|
|
|
|
inviter: CONTACT_A,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'pending-remove-many',
|
|
|
|
count: 5,
|
|
|
|
inviter: CONTACT_A,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
from: OUR_ID,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'pending-remove-many',
|
|
|
|
count: 5,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
|
|
|
|
{renderChange({
|
|
|
|
from: CONTACT_A,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'pending-remove-many',
|
|
|
|
count: 5,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'pending-remove-many',
|
|
|
|
count: 5,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
</>
|
|
|
|
);
|
2020-12-18 19:27:43 +00:00
|
|
|
})
|
|
|
|
.add('Admin Approval (Add)', () => {
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
{renderChange({
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'admin-approval-add-one',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: OUR_ID,
|
2020-12-18 19:27:43 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'admin-approval-add-one',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: CONTACT_A,
|
2020-12-18 19:27:43 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
})
|
|
|
|
.add('Admin Approval (Remove)', () => {
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
{renderChange({
|
|
|
|
from: OUR_ID,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'admin-approval-remove-one',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: OUR_ID,
|
2020-12-18 19:27:43 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'admin-approval-remove-one',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: OUR_ID,
|
2020-12-18 19:27:43 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
from: OUR_ID,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'admin-approval-remove-one',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: CONTACT_A,
|
2020-12-18 19:27:43 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
2022-03-16 00:11:28 +00:00
|
|
|
Should show button:
|
|
|
|
{renderChange(
|
|
|
|
{
|
|
|
|
from: CONTACT_A,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'admin-approval-remove-one',
|
|
|
|
uuid: CONTACT_A,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
groupMemberships: [{ uuid: CONTACT_C, isAdmin: false }],
|
|
|
|
groupBannedMemberships: [CONTACT_B],
|
|
|
|
}
|
|
|
|
)}
|
2020-12-18 19:27:43 +00:00
|
|
|
{renderChange({
|
|
|
|
from: ADMIN_A,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'admin-approval-remove-one',
|
2021-10-26 22:59:08 +00:00
|
|
|
uuid: CONTACT_A,
|
2020-12-18 19:27:43 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
2022-03-16 00:11:28 +00:00
|
|
|
Should show button:
|
|
|
|
{renderChange(
|
|
|
|
{
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'admin-approval-remove-one',
|
|
|
|
uuid: CONTACT_A,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
groupMemberships: [{ uuid: CONTACT_C, isAdmin: false }],
|
|
|
|
groupBannedMemberships: [CONTACT_B],
|
|
|
|
}
|
|
|
|
)}
|
|
|
|
Would show button, but we're not admin:
|
|
|
|
{renderChange(
|
|
|
|
{
|
|
|
|
from: CONTACT_A,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'admin-approval-remove-one',
|
|
|
|
uuid: CONTACT_A,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
|
|
|
|
{ areWeAdmin: false, groupName: 'Group 1' }
|
|
|
|
)}
|
|
|
|
Would show button, but user is a group member:
|
|
|
|
{renderChange(
|
|
|
|
{
|
|
|
|
from: CONTACT_A,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'admin-approval-remove-one',
|
|
|
|
uuid: CONTACT_A,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{ groupMemberships: [{ uuid: CONTACT_A, isAdmin: false }] }
|
|
|
|
)}
|
|
|
|
Would show button, but user is already banned:
|
|
|
|
{renderChange(
|
|
|
|
{
|
|
|
|
from: CONTACT_A,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'admin-approval-remove-one',
|
|
|
|
uuid: CONTACT_A,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
|
|
|
|
{ groupBannedMemberships: [CONTACT_A] }
|
|
|
|
)}
|
2020-12-18 19:27:43 +00:00
|
|
|
</>
|
|
|
|
);
|
|
|
|
})
|
|
|
|
.add('Group Link (Add)', () => {
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
{renderChange({
|
|
|
|
from: OUR_ID,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'group-link-add',
|
|
|
|
privilege: AccessControlEnum.ANY,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
from: ADMIN_A,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'group-link-add',
|
|
|
|
privilege: AccessControlEnum.ANY,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'group-link-add',
|
|
|
|
privilege: AccessControlEnum.ANY,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
from: OUR_ID,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'group-link-add',
|
|
|
|
privilege: AccessControlEnum.ADMINISTRATOR,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
from: ADMIN_A,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'group-link-add',
|
|
|
|
privilege: AccessControlEnum.ADMINISTRATOR,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'group-link-add',
|
|
|
|
privilege: AccessControlEnum.ADMINISTRATOR,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
})
|
|
|
|
.add('Group Link (Reset)', () => {
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
{renderChange({
|
|
|
|
from: OUR_ID,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'group-link-reset',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
from: ADMIN_A,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'group-link-reset',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'group-link-reset',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
})
|
|
|
|
.add('Group Link (Remove)', () => {
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
{renderChange({
|
|
|
|
from: OUR_ID,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'group-link-remove',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
from: ADMIN_A,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'group-link-remove',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'group-link-remove',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
</>
|
|
|
|
);
|
2021-06-02 00:24:28 +00:00
|
|
|
})
|
|
|
|
.add('Description (Remove)', () => {
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
{renderChange({
|
|
|
|
from: OUR_ID,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
removed: true,
|
|
|
|
type: 'description',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
from: ADMIN_A,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
removed: true,
|
|
|
|
type: 'description',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
removed: true,
|
|
|
|
type: 'description',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
})
|
|
|
|
.add('Description (Change)', () => {
|
|
|
|
return (
|
|
|
|
<>
|
2021-06-04 16:27:04 +00:00
|
|
|
{renderChange(
|
|
|
|
{
|
|
|
|
from: OUR_ID,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'description',
|
|
|
|
description:
|
2021-06-17 17:15:51 +00:00
|
|
|
'This is a long description.\n\nWe need a dialog to view it all!\n\nIt has a link to https://example.com',
|
2021-06-04 16:27:04 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2022-03-16 00:11:28 +00:00
|
|
|
{ groupName: 'We do hikes 🌲' }
|
2021-06-04 16:27:04 +00:00
|
|
|
)}
|
|
|
|
{renderChange(
|
|
|
|
{
|
|
|
|
from: ADMIN_A,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'description',
|
|
|
|
description:
|
2021-06-17 17:15:51 +00:00
|
|
|
'This is a long description.\n\nWe need a dialog to view it all!\n\nIt has a link to https://example.com',
|
2021-06-04 16:27:04 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2022-03-16 00:11:28 +00:00
|
|
|
{ groupName: 'We do hikes 🌲' }
|
2021-06-04 16:27:04 +00:00
|
|
|
)}
|
|
|
|
{renderChange(
|
|
|
|
{
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'description',
|
|
|
|
description:
|
2021-06-17 17:15:51 +00:00
|
|
|
'This is a long description.\n\nWe need a dialog to view it all!\n\nIt has a link to https://example.com',
|
2021-06-04 16:27:04 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2022-03-16 00:11:28 +00:00
|
|
|
{ groupName: 'We do hikes 🌲' }
|
2021-06-04 16:27:04 +00:00
|
|
|
)}
|
2021-06-02 00:24:28 +00:00
|
|
|
</>
|
|
|
|
);
|
2021-07-20 20:18:35 +00:00
|
|
|
})
|
|
|
|
.add('Announcement Group (Change)', () => {
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
{renderChange({
|
|
|
|
from: OUR_ID,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'announcements-only',
|
|
|
|
announcementsOnly: true,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
from: ADMIN_A,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'announcements-only',
|
|
|
|
announcementsOnly: true,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'announcements-only',
|
|
|
|
announcementsOnly: true,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
from: OUR_ID,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'announcements-only',
|
|
|
|
announcementsOnly: false,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
from: ADMIN_A,
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'announcements-only',
|
|
|
|
announcementsOnly: false,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
{renderChange({
|
|
|
|
details: [
|
|
|
|
{
|
|
|
|
type: 'announcements-only',
|
|
|
|
announcementsOnly: false,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})}
|
|
|
|
</>
|
|
|
|
);
|
2020-09-09 02:25:05 +00:00
|
|
|
});
|