@pega/cosmos-react-demos 3.0.0-dev.26.0 → 3.0.0-dev.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/jsx/core/FieldGroup/FieldGroup.stories.d.ts +2 -0
- package/jsx/core/FieldGroup/FieldGroup.stories.d.ts.map +1 -1
- package/jsx/core/FieldGroup/FieldGroup.stories.jsx +12 -4
- package/jsx/core/FieldGroup/FieldGroup.stories.jsx.map +1 -1
- package/jsx/core/ListToolbar/ListToolbar.stories.d.ts +2 -1
- package/jsx/core/ListToolbar/ListToolbar.stories.d.ts.map +1 -1
- package/jsx/core/ListToolbar/ListToolbar.stories.jsx +9 -5
- package/jsx/core/ListToolbar/ListToolbar.stories.jsx.map +1 -1
- package/jsx/core/Tree/Tree.stories.d.ts.map +1 -1
- package/jsx/core/Tree/Tree.stories.jsx +14 -0
- package/jsx/core/Tree/Tree.stories.jsx.map +1 -1
- package/jsx/social/Email/Email.mocks.d.ts +0 -1
- package/jsx/social/Email/Email.mocks.d.ts.map +1 -1
- package/jsx/social/Email/Email.mocks.jsx +0 -13
- package/jsx/social/Email/Email.mocks.jsx.map +1 -1
- package/jsx/social/Email/Email.stories.d.ts +14 -1
- package/jsx/social/Email/Email.stories.d.ts.map +1 -1
- package/jsx/social/Email/Email.stories.jsx +141 -63
- package/jsx/social/Email/Email.stories.jsx.map +1 -1
- package/jsx/work/SearchResults/SearchResults.mocks.d.ts +6 -0
- package/jsx/work/SearchResults/SearchResults.mocks.d.ts.map +1 -1
- package/jsx/work/SearchResults/SearchResults.mocks.jsx +39 -38
- package/jsx/work/SearchResults/SearchResults.mocks.jsx.map +1 -1
- package/jsx/work/SearchResults/SearchResults.stories.d.ts.map +1 -1
- package/jsx/work/SearchResults/SearchResults.stories.jsx +71 -43
- package/jsx/work/SearchResults/SearchResults.stories.jsx.map +1 -1
- package/lib/core/FieldGroup/FieldGroup.stories.d.ts +2 -0
- package/lib/core/FieldGroup/FieldGroup.stories.d.ts.map +1 -1
- package/lib/core/FieldGroup/FieldGroup.stories.js +11 -3
- package/lib/core/FieldGroup/FieldGroup.stories.js.map +1 -1
- package/lib/core/ListToolbar/ListToolbar.stories.d.ts +2 -1
- package/lib/core/ListToolbar/ListToolbar.stories.d.ts.map +1 -1
- package/lib/core/ListToolbar/ListToolbar.stories.js +9 -5
- package/lib/core/ListToolbar/ListToolbar.stories.js.map +1 -1
- package/lib/core/Tree/Tree.stories.d.ts.map +1 -1
- package/lib/core/Tree/Tree.stories.js +16 -0
- package/lib/core/Tree/Tree.stories.js.map +1 -1
- package/lib/social/Email/Email.mocks.d.ts +0 -1
- package/lib/social/Email/Email.mocks.d.ts.map +1 -1
- package/lib/social/Email/Email.mocks.js +0 -13
- package/lib/social/Email/Email.mocks.js.map +1 -1
- package/lib/social/Email/Email.stories.d.ts +14 -1
- package/lib/social/Email/Email.stories.d.ts.map +1 -1
- package/lib/social/Email/Email.stories.js +109 -44
- package/lib/social/Email/Email.stories.js.map +1 -1
- package/lib/work/SearchResults/SearchResults.mocks.d.ts +6 -0
- package/lib/work/SearchResults/SearchResults.mocks.d.ts.map +1 -1
- package/lib/work/SearchResults/SearchResults.mocks.js +39 -38
- package/lib/work/SearchResults/SearchResults.mocks.js.map +1 -1
- package/lib/work/SearchResults/SearchResults.stories.d.ts.map +1 -1
- package/lib/work/SearchResults/SearchResults.stories.js +71 -43
- package/lib/work/SearchResults/SearchResults.stories.js.map +1 -1
- package/package.json +9 -9
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { useState, useRef, useCallback, useEffect, createRef } from 'react';
|
|
2
2
|
import { action } from '@storybook/addon-actions';
|
|
3
|
-
import {
|
|
4
|
-
import { Card, CardContent, createUID, MenuButton, Icon, registerIcon, Flex, Button, menuHelpers, CardHeader, Text, SummaryList, Grid, FieldValueList, StyledLabel, EmptyState, Modal, useModalManager, useModalContext, useToaster } from '@pega/cosmos-react-core';
|
|
3
|
+
import { Card, CardContent, createUID, MenuButton, Icon, registerIcon, Flex, Button, menuHelpers, CardHeader, Text, SummaryList, Grid, FieldValueList, StyledLabel, Modal, useModalManager, useModalContext, useToaster, Banner } from '@pega/cosmos-react-core';
|
|
5
4
|
import * as filterIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/filter.icon';
|
|
6
|
-
import { Email as EmailComponent, EmailConversation, EmailComposer, EmailShell, EmailSummaryItem, EmailSummaryList, EntityList, EmailManager } from '@pega/cosmos-react-social';
|
|
5
|
+
import { Email as EmailComponent, EmailConversation, EmailComposer, EmailShell, EmailSummaryItem, EmailSummaryList, EntityList, EmailManager, EmailCaseView } from '@pega/cosmos-react-social';
|
|
7
6
|
import { AppShellDemo } from '../../core/AppShell/AppShell.stories';
|
|
8
|
-
import { bccParticipants, ccParticipants, emailBodyContent, participants, toParticipants, emailAttachments, EntityListMockData, viewAnalysisEmailHeaderMock, topicListMock,
|
|
7
|
+
import { bccParticipants, ccParticipants, emailBodyContent, participants, toParticipants, emailAttachments, EntityListMockData, viewAnalysisEmailHeaderMock, topicListMock, generateEmailConversationParticipants, templates, handleExternalEntry, emailDemoActions, LaunchAction, baseComposerProps, sentiment, emailSummaryItems, mockEmails, mockSuggestedReplies, mockEmailBodyTemplates, forwardedContent, getCompositeId, emptyFieldErrorMessage, fieldValidation, emailWorklistItemsMock, contextMenuItemsMock, highlightedEntitiesMock, mockUploadImage, mailDeliverySystemEmail, supportTeamEmail } from './Email.mocks';
|
|
9
8
|
import { StyledEmailCardContent } from './Email.styles';
|
|
10
9
|
registerIcon(filterIcon);
|
|
11
10
|
export default {
|
|
@@ -49,9 +48,9 @@ export const Email = (args) => {
|
|
|
49
48
|
'550 5.1.1 The email account that you tried to reach does not exist. Please try double-checking the recipients email address for typos or unnecessary spaces. Learn more at https://support.google.com/mail/?p=NoSuchUser k24-20020aa790d8000000b0050dd7e3b84csor451330pfk.28'
|
|
50
49
|
]
|
|
51
50
|
}
|
|
52
|
-
: undefined} onReply={action('On reply')} onReplyAll={action('On reply all')} onForward={action('On forward')} onSuggestionClick={action('On Suggested reply clicked')} sentiment={{
|
|
51
|
+
: undefined} onReply={args.showDraft ? undefined : action('On reply')} onReplyAll={args.showDraft ? undefined : action('On reply all')} onForward={args.showDraft ? undefined : action('On forward')} onEditDraft={args.showDraft ? action('On forward') : undefined} onDeleteDraft={args.showDraft ? action('On forward') : undefined} onSuggestionClick={action('On Suggested reply clicked')} sentiment={{
|
|
53
52
|
variant: 'neutral'
|
|
54
|
-
}}
|
|
53
|
+
}} status={args.showDraft ? 'draft' : undefined} suggestions={mockSuggestedReplies} contextMenu={{
|
|
55
54
|
onItemClick: (selectedValue) => {
|
|
56
55
|
action('onItemClick')(selectedValue);
|
|
57
56
|
contextMenuHandle.current?.setOpen(false);
|
|
@@ -83,13 +82,15 @@ Email.args = {
|
|
|
83
82
|
enableEntityHighlighting: false,
|
|
84
83
|
enableContextMenu: false,
|
|
85
84
|
forwardedContent,
|
|
86
|
-
showEmailBanner: false
|
|
85
|
+
showEmailBanner: false,
|
|
86
|
+
showDraft: false
|
|
87
87
|
};
|
|
88
88
|
Email.argTypes = {
|
|
89
89
|
enableEntityHighlighting: { control: { type: 'boolean' } },
|
|
90
90
|
enableContextMenu: { control: { type: 'boolean' } },
|
|
91
91
|
forwardedContent: { control: { type: 'text' } },
|
|
92
|
-
showEmailBanner: { control: { type: 'boolean' } }
|
|
92
|
+
showEmailBanner: { control: { type: 'boolean' } },
|
|
93
|
+
showDraft: { control: { type: 'boolean' } }
|
|
93
94
|
};
|
|
94
95
|
export const Composer = () => {
|
|
95
96
|
const [composerProgress, setComposerProgress] = useState(false);
|
|
@@ -256,7 +257,6 @@ export const Conversation = () => {
|
|
|
256
257
|
onReply: action('On reply'),
|
|
257
258
|
onForward: action('On forward'),
|
|
258
259
|
onSuggestionClick: action('On Suggested reply clicked'),
|
|
259
|
-
actions: emailActions,
|
|
260
260
|
suggestions: mockSuggestedReplies
|
|
261
261
|
},
|
|
262
262
|
{
|
|
@@ -269,8 +269,7 @@ export const Conversation = () => {
|
|
|
269
269
|
body: '<div> Hi, <br /> <br /> <div>I’m still at the airport, I need help now!! </div> <br /><br /> Regards, <br /> Sara Davis </div>',
|
|
270
270
|
onReply: action('On reply'),
|
|
271
271
|
onForward: action('On forward'),
|
|
272
|
-
onSuggestionClick: action('On Suggested reply clicked')
|
|
273
|
-
actions: emailActions
|
|
272
|
+
onSuggestionClick: action('On Suggested reply clicked')
|
|
274
273
|
}
|
|
275
274
|
];
|
|
276
275
|
return (<EmailConversation participants={generateEmailConversationParticipants(emailArr)} from={generateEmailConversationParticipants(emailArr, ['from'])[0]} to={generateEmailConversationParticipants(emailArr, ['to'])} id={createUID()} timeStamp={emailArr[0].timeStamp} unReadEmailCount={emailArr.filter(item => item.unRead).length} emails={emailArr}/>);
|
|
@@ -632,6 +631,7 @@ export const EmailShellDemo = (args) => {
|
|
|
632
631
|
[
|
|
633
632
|
{
|
|
634
633
|
...emailsData[1],
|
|
634
|
+
id: 'item0',
|
|
635
635
|
from: mailDeliverySystemEmail,
|
|
636
636
|
to: [supportTeamEmail],
|
|
637
637
|
body: '<div>Hi, <br /> <br /><div>Your address change request is approved.</div> <br /> <br />Regards, <br />Support team </div>',
|
|
@@ -643,8 +643,7 @@ export const EmailShellDemo = (args) => {
|
|
|
643
643
|
]
|
|
644
644
|
},
|
|
645
645
|
onReply: undefined,
|
|
646
|
-
onForward: undefined
|
|
647
|
-
actions: undefined
|
|
646
|
+
onForward: undefined
|
|
648
647
|
},
|
|
649
648
|
{ ...emailsData[1], unRead: false }
|
|
650
649
|
],
|
|
@@ -653,11 +652,20 @@ export const EmailShellDemo = (args) => {
|
|
|
653
652
|
...emailsData[0],
|
|
654
653
|
id: 'item2',
|
|
655
654
|
status: 'draft',
|
|
655
|
+
onEditDraft: (id) => createOrActivateComposer(id, LaunchAction.REPLY, {
|
|
656
|
+
...baseComposerProps,
|
|
657
|
+
data: {
|
|
658
|
+
...baseComposerProps.data,
|
|
659
|
+
responseType: 'reply',
|
|
660
|
+
subject: { value: `Re-${emailsData[0].subject}` || '' },
|
|
661
|
+
bodyContent: { defaultValue: emailsData[0].body || '' }
|
|
662
|
+
}
|
|
663
|
+
}),
|
|
664
|
+
onDeleteDraft: (id) => deleteEmail(id),
|
|
656
665
|
onReply: undefined,
|
|
657
666
|
onForward: undefined,
|
|
658
667
|
suggestions: undefined,
|
|
659
668
|
unRead: false,
|
|
660
|
-
actions: emailDemoActions('item2', emailsData[0].subject, createOrActivateComposer, true, '<div>Hi, <br /> <br /><div>Sure, Our executive will come and check your connection in 24hrs. </div> <br />Regards, <br />Hugh Phillips </div>', deleteEmail),
|
|
661
669
|
timeStamp: '2021-01-03T17:15',
|
|
662
670
|
from: mockEmails['Hugh Phillips'],
|
|
663
671
|
to: [mockEmails['Mystery Rey'], ...emailsData[0].to],
|
|
@@ -669,10 +677,19 @@ export const EmailShellDemo = (args) => {
|
|
|
669
677
|
...emailsData[1],
|
|
670
678
|
id: 'item3',
|
|
671
679
|
status: 'draft',
|
|
680
|
+
onEditDraft: (id) => createOrActivateComposer(id, LaunchAction.REPLY, {
|
|
681
|
+
...baseComposerProps,
|
|
682
|
+
data: {
|
|
683
|
+
...baseComposerProps.data,
|
|
684
|
+
responseType: 'reply',
|
|
685
|
+
subject: { value: `Re-${emailsData[0].subject}` || '' },
|
|
686
|
+
bodyContent: { defaultValue: emailsData[0].body || '' }
|
|
687
|
+
}
|
|
688
|
+
}),
|
|
689
|
+
onDeleteDraft: (id) => deleteEmail(id),
|
|
672
690
|
onReply: undefined,
|
|
673
691
|
onForward: undefined,
|
|
674
692
|
suggestions: undefined,
|
|
675
|
-
actions: emailDemoActions('item3', emailsData[0].subject, createOrActivateComposer, true, '<div>Hi, <br /> <br /><div>Can you fix my internet connection. </div> <br /> <br />Regards, <br />Rey Mystery </div>', deleteEmail),
|
|
676
693
|
unRead: false,
|
|
677
694
|
timeStamp: '2021-01-02T14:16',
|
|
678
695
|
from: mockEmails['Mystery Rey'],
|
|
@@ -730,6 +747,7 @@ export const EmailShellDemo = (args) => {
|
|
|
730
747
|
emails: [
|
|
731
748
|
{
|
|
732
749
|
...emailsData[1],
|
|
750
|
+
id: 'item0',
|
|
733
751
|
from: mailDeliverySystemEmail,
|
|
734
752
|
to: [supportTeamEmail],
|
|
735
753
|
body: '<div>Hi, <br /> <br /><div>Your address change request is approved.</div> <br /> <br />Regards, <br />Support team </div>',
|
|
@@ -741,26 +759,27 @@ export const EmailShellDemo = (args) => {
|
|
|
741
759
|
]
|
|
742
760
|
},
|
|
743
761
|
onReply: undefined,
|
|
744
|
-
onForward: undefined
|
|
745
|
-
actions: undefined
|
|
762
|
+
onForward: undefined
|
|
746
763
|
},
|
|
747
764
|
{ ...emailsData[1], unRead: false }
|
|
748
765
|
]
|
|
749
766
|
}
|
|
750
767
|
];
|
|
751
768
|
return (<>
|
|
752
|
-
<EmailShell headerProps={
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
769
|
+
<EmailShell headerProps={args.showHeader
|
|
770
|
+
? {
|
|
771
|
+
actions: (<Flex container={{
|
|
772
|
+
alignItems: 'center',
|
|
773
|
+
gap: 0
|
|
774
|
+
}}>
|
|
775
|
+
<Button variant='simple' icon>
|
|
776
|
+
<Icon name='filter'/>
|
|
777
|
+
</Button>
|
|
778
|
+
<MenuButton variant='simple' text='More actions' icon='more' iconOnly portal menu={{ items: actions }}/>
|
|
779
|
+
</Flex>),
|
|
780
|
+
subject: 'Pause service'
|
|
781
|
+
}
|
|
782
|
+
: undefined} autoCollapse={args.autoCollapse} conversations={args.singleConversation ? singleEmailConversation : emailConversations}/>
|
|
764
783
|
<>
|
|
765
784
|
{Object.keys(composersData).map(guid => {
|
|
766
785
|
return <EmailComposer key={guid} {...composersData[guid]}/>;
|
|
@@ -771,12 +790,14 @@ export const EmailShellDemo = (args) => {
|
|
|
771
790
|
EmailShellDemo.args = {
|
|
772
791
|
autoCollapse: true,
|
|
773
792
|
hideSuggestions: false,
|
|
774
|
-
singleConversation:
|
|
793
|
+
singleConversation: false,
|
|
794
|
+
showHeader: true
|
|
775
795
|
};
|
|
776
796
|
EmailShellDemo.argTypes = {
|
|
777
797
|
autoCollapse: { control: { type: 'boolean' } },
|
|
778
798
|
hideSuggestions: { control: { type: 'boolean' } },
|
|
779
|
-
singleConversation: { control: { type: 'boolean' } }
|
|
799
|
+
singleConversation: { control: { type: 'boolean' } },
|
|
800
|
+
showHeader: { control: { type: 'boolean' } }
|
|
780
801
|
};
|
|
781
802
|
export const EntityListDemo = (args) => {
|
|
782
803
|
const itemCounter = useRef(3);
|
|
@@ -884,15 +905,61 @@ export const EmailSummaryListDemo = (args) => {
|
|
|
884
905
|
}, [loading]);
|
|
885
906
|
return (<EmailSummaryList ref={emailSummaryListRef} unreadEmailCount={99} categories={categories} items={args.items || allEmailItems} onItemClick={args.onItemClick || handleItemClick} onCategoryClick={onCategoryClick} onLoadMore={args.onLoadMore || (hasMore ? loadMore : undefined)} loading={args.loading || loading} emptyMessage='No emails.'/>);
|
|
886
907
|
};
|
|
908
|
+
export const EmailCaseViewDemo = (args) => {
|
|
909
|
+
const content = <EmailShellDemo />;
|
|
910
|
+
const utilities = (<Grid container={{ rowGap: 2 }}>
|
|
911
|
+
<EntityListDemo />
|
|
912
|
+
<Card>
|
|
913
|
+
<CardHeader container={{ alignItems: 'center', gap: 1 }}>
|
|
914
|
+
<Icon name='document-doc'/>
|
|
915
|
+
<Text variant='h3'>Email header</Text>
|
|
916
|
+
</CardHeader>
|
|
917
|
+
<CardContent>
|
|
918
|
+
<FieldValueList fields={viewAnalysisEmailHeaderMock} variant='stacked'/>
|
|
919
|
+
</CardContent>
|
|
920
|
+
</Card>
|
|
921
|
+
<SummaryList name='Topics' icon='headline' items={topicListMock.map(items => ({
|
|
922
|
+
...items,
|
|
923
|
+
primary: <StyledLabel>{items.primary}</StyledLabel>,
|
|
924
|
+
secondary: (<Flex container={{ direction: 'row', justify: 'between' }}>
|
|
925
|
+
<Text variant='primary'>{items.secondary.indicator}</Text>
|
|
926
|
+
<StyledLabel>{items.secondary.value}</StyledLabel>
|
|
927
|
+
</Flex>)
|
|
928
|
+
}))} noItemsText='No items'/>
|
|
929
|
+
</Grid>);
|
|
930
|
+
return (<AppShellDemo appHeader main={<EmailCaseView header={args.showHeader
|
|
931
|
+
? {
|
|
932
|
+
icon: 'mail',
|
|
933
|
+
title: 'ET-5432'
|
|
934
|
+
}
|
|
935
|
+
: undefined} banners={args.showBanners && (<Banner id='error' variant='urgent' heading='Error' messages={['Your email could not be delivered due to poor network connection.']}/>)} content={content} utilities={!args.noUtilityView && utilities} utilitiesSummaryItems={!args.noUtilityView
|
|
936
|
+
? [
|
|
937
|
+
{ iconName: 'list-number', count: 7 },
|
|
938
|
+
{ iconName: 'document-doc', count: 1 },
|
|
939
|
+
{ iconName: 'headline', count: 4 }
|
|
940
|
+
]
|
|
941
|
+
: undefined} defaultUtilitiesExpanded/>}/>);
|
|
942
|
+
};
|
|
943
|
+
EmailCaseViewDemo.args = {
|
|
944
|
+
showBanners: false,
|
|
945
|
+
noUtilityView: false,
|
|
946
|
+
showHeader: true
|
|
947
|
+
};
|
|
948
|
+
EmailCaseViewDemo.argTypes = {
|
|
949
|
+
showBanners: { control: { type: 'boolean' } },
|
|
950
|
+
noUtilityView: { control: { type: 'boolean' } },
|
|
951
|
+
showHeader: { control: { type: 'boolean' } }
|
|
952
|
+
};
|
|
953
|
+
EmailCaseViewDemo.parameters = {
|
|
954
|
+
layout: 'fullscreen'
|
|
955
|
+
};
|
|
887
956
|
export const EmailManagerAppShell = (args) => {
|
|
888
957
|
const INITIAL_CHUNK_SIZE = 9;
|
|
889
958
|
const APPEND_CHUNK_SIZE = 1;
|
|
890
|
-
const [activeItemId, setActiveItemId] = useState();
|
|
891
959
|
const [emailList, setEmailList] = useState(emailSummaryItems.slice(0, INITIAL_CHUNK_SIZE));
|
|
892
960
|
const [loading, setLoading] = useState(false);
|
|
893
961
|
const [hasMore, setHasMore] = useState(true);
|
|
894
962
|
const handleEmailItemClick = (id) => {
|
|
895
|
-
setActiveItemId(id);
|
|
896
963
|
const index = emailList.findIndex(emailItem => {
|
|
897
964
|
return emailItem.id === id;
|
|
898
965
|
});
|
|
@@ -916,44 +983,55 @@ export const EmailManagerAppShell = (args) => {
|
|
|
916
983
|
}, 1500);
|
|
917
984
|
}
|
|
918
985
|
}, [loading]);
|
|
919
|
-
const
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
<
|
|
923
|
-
|
|
924
|
-
<
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
</Card>
|
|
932
|
-
<SummaryList name='Topics' icon='headline' items={topicListMock.map(items => ({
|
|
986
|
+
const utilities = (<Grid container={{ rowGap: 2 }}>
|
|
987
|
+
<EntityListDemo />
|
|
988
|
+
<Card>
|
|
989
|
+
<CardHeader container={{ alignItems: 'center', gap: 1 }}>
|
|
990
|
+
<Icon name='document-doc'/>
|
|
991
|
+
<Text variant='h3'>Email header</Text>
|
|
992
|
+
</CardHeader>
|
|
993
|
+
<CardContent>
|
|
994
|
+
<FieldValueList fields={viewAnalysisEmailHeaderMock} variant='stacked'/>
|
|
995
|
+
</CardContent>
|
|
996
|
+
</Card>
|
|
997
|
+
<SummaryList name='Topics' icon='headline' items={topicListMock.map(items => ({
|
|
933
998
|
...items,
|
|
934
999
|
primary: <StyledLabel>{items.primary}</StyledLabel>,
|
|
935
1000
|
secondary: (<Flex container={{ direction: 'row', justify: 'between' }}>
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
1001
|
+
<Text variant='primary'>{items.secondary.indicator}</Text>
|
|
1002
|
+
<StyledLabel>{items.secondary.value}</StyledLabel>
|
|
1003
|
+
</Flex>)
|
|
939
1004
|
}))} noItemsText='No items'/>
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
1005
|
+
</Grid>);
|
|
1006
|
+
const content = <EmailShellDemo showHeader={false}/>;
|
|
1007
|
+
return (<AppShellDemo appHeader main={<EmailManager header={args.showHeader
|
|
1008
|
+
? {
|
|
1009
|
+
icon: 'mail',
|
|
1010
|
+
title: 'Inbox'
|
|
1011
|
+
}
|
|
1012
|
+
: undefined} list={<EmailSummaryListDemo onItemClick={handleEmailItemClick} items={emailList} onLoadMore={hasMore ? onLoadMore : undefined} loading={loading}/>} emailCaseDetails={!args.showEmptyView && (<EmailCaseView banners={args.showCaseViewBanners && (<Banner id='error' variant='urgent' heading='Error' messages={[
|
|
1013
|
+
'Your email could not be delivered due to poor network connection.'
|
|
1014
|
+
]}/>)} content={content} utilities={args.showUtilities && utilities} utilitiesSummaryItems={args.showUtilities
|
|
1015
|
+
? [
|
|
1016
|
+
{ iconName: 'list-number', count: 7 },
|
|
1017
|
+
{ iconName: 'document-doc', count: 1 },
|
|
1018
|
+
{ iconName: 'headline', count: 4 }
|
|
1019
|
+
]
|
|
1020
|
+
: undefined} defaultUtilitiesExpanded={false}/>)}/>}/>);
|
|
951
1021
|
};
|
|
952
1022
|
EmailManagerAppShell.args = {
|
|
953
|
-
enableContextMenu: true
|
|
1023
|
+
enableContextMenu: true,
|
|
1024
|
+
showEmptyView: false,
|
|
1025
|
+
showHeader: true,
|
|
1026
|
+
showCaseViewBanners: false,
|
|
1027
|
+
showUtilities: true
|
|
954
1028
|
};
|
|
955
1029
|
EmailManagerAppShell.argTypes = {
|
|
956
|
-
enableContextMenu: { control: { type: 'boolean' } }
|
|
1030
|
+
enableContextMenu: { control: { type: 'boolean' } },
|
|
1031
|
+
showEmptyView: { control: { type: 'boolean' } },
|
|
1032
|
+
showHeader: { control: { type: 'boolean' } },
|
|
1033
|
+
showCaseViewBanners: { control: { type: 'boolean' } },
|
|
1034
|
+
showUtilities: { control: { type: 'boolean' } }
|
|
957
1035
|
};
|
|
958
1036
|
EmailManagerAppShell.parameters = {
|
|
959
1037
|
layout: 'fullscreen'
|