signal-desktop/ts/components/conversation/GroupV2Change.stories.tsx

1455 lines
31 KiB
TypeScript
Raw Normal View History

2021-06-17 17:15:51 +00:00
// Copyright 2020-2021 Signal Messenger, LLC
2020-10-30 20:34:04 +00:00
// SPDX-License-Identifier: AGPL-3.0-only
2020-09-14 19:51:27 +00:00
/* eslint-disable-next-line max-classes-per-file */
2020-09-09 02:25:05 +00:00
import * as React from 'react';
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';
2020-09-09 02:25:05 +00:00
import enMessages from '../../../_locales/en/messages.json';
import type { GroupV2ChangeType } from '../../groups';
2021-07-09 19:36:10 +00:00
import { SignalService as Proto } from '../../protobuf';
import type { SmartContactRendererType } from '../../groupChange';
2020-09-09 02:25:05 +00:00
import { GroupV2Change } from './GroupV2Change';
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
const renderContact: SmartContactRendererType = (conversationId: string) => (
<React.Fragment key={conversationId}>
{`Conversation(${conversationId})`}
</React.Fragment>
);
const renderChange = (change: GroupV2ChangeType, groupName?: string) => (
2020-09-09 02:25:05 +00:00
<GroupV2Change
change={change}
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,
},
],
})}
</>
);
})
.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
},
],
})}
</>
);
})
.add('Member Add (from invited)', () => {
2020-09-09 02:25:05 +00:00
return (
<>
{/* 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,
inviter: CONTACT_B,
},
],
})}
{renderChange({
details: [
{
type: 'member-add-from-invite',
2021-10-26 22:59:08 +00:00
uuid: OUR_ID,
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,
inviter: CONTACT_B,
},
],
})}
{renderChange({
from: CONTACT_A,
details: [
{
type: 'member-add-from-invite',
2021-10-26 22:59:08 +00:00
uuid: CONTACT_B,
inviter: CONTACT_C,
},
],
})}
{renderChange({
details: [
{
type: 'member-add-from-invite',
2021-10-26 22:59:08 +00:00
uuid: CONTACT_A,
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({
from: OUR_ID,
details: [
{
type: 'member-add-from-invite',
2021-10-26 22:59:08 +00:00
uuid: OUR_ID,
},
],
})}
{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({
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,
},
],
})}
{renderChange({
from: CONTACT_A,
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
</>
);
})
.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,
},
],
})}
{renderChange({
from: CONTACT_A,
details: [
{
type: 'member-add-from-link',
2021-10-26 22:59:08 +00:00
uuid: CONTACT_A,
},
],
})}
{renderChange({
details: [
{
type: 'member-add-from-link',
2021-10-26 22:59:08 +00:00
uuid: CONTACT_A,
},
],
})}
</>
);
})
.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,
},
],
})}
{renderChange({
details: [
{
type: 'member-add-from-admin-approval',
2021-10-26 22:59:08 +00:00
uuid: OUR_ID,
},
],
})}
{renderChange({
from: OUR_ID,
details: [
{
type: 'member-add-from-admin-approval',
2021-10-26 22:59:08 +00:00
uuid: CONTACT_A,
},
],
})}
{renderChange({
from: ADMIN_A,
details: [
{
type: 'member-add-from-admin-approval',
2021-10-26 22:59:08 +00:00
uuid: CONTACT_A,
},
],
})}
{renderChange({
details: [
{
type: 'member-add-from-admin-approval',
2021-10-26 22:59:08 +00:00
uuid: CONTACT_A,
},
],
})}
</>
);
})
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,
},
],
})}
</>
);
})
.add('Admin Approval (Add)', () => {
return (
<>
{renderChange({
details: [
{
type: 'admin-approval-add-one',
2021-10-26 22:59:08 +00:00
uuid: OUR_ID,
},
],
})}
{renderChange({
details: [
{
type: 'admin-approval-add-one',
2021-10-26 22:59:08 +00:00
uuid: CONTACT_A,
},
],
})}
</>
);
})
.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,
},
],
})}
{renderChange({
details: [
{
type: 'admin-approval-remove-one',
2021-10-26 22:59:08 +00:00
uuid: OUR_ID,
},
],
})}
{renderChange({
from: OUR_ID,
details: [
{
type: 'admin-approval-remove-one',
2021-10-26 22:59:08 +00:00
uuid: CONTACT_A,
},
],
})}
{renderChange({
from: CONTACT_A,
details: [
{
type: 'admin-approval-remove-one',
2021-10-26 22:59:08 +00:00
uuid: CONTACT_A,
},
],
})}
{renderChange({
from: ADMIN_A,
details: [
{
type: 'admin-approval-remove-one',
2021-10-26 22:59:08 +00:00
uuid: CONTACT_A,
},
],
})}
{renderChange({
details: [
{
type: 'admin-approval-remove-one',
2021-10-26 22:59:08 +00:00
uuid: CONTACT_A,
},
],
})}
</>
);
})
.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 (
<>
{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',
},
],
},
'We do hikes 🌲'
)}
{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',
},
],
},
'We do hikes 🌲'
)}
{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',
},
],
},
'We do hikes 🌲'
)}
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
});