Skip to content

Commit 37dde65

Browse files
authored
Define message status for storybook message thread to make sure 'try send again' does not show up in fly out menu (#2732)
* change message status * Change files * Duplicate change files for beta release
1 parent 6b137d2 commit 37dde65

4 files changed

Lines changed: 25 additions & 8 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "make sure message status in storybook is defined to avoid 'try send again' showing up",
4+
"packageName": "@azure/communication-react",
5+
"email": "carolinecao@microsoft.com",
6+
"dependentChangeType": "patch"
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "make sure message status in storybook is defined to avoid 'try send again' showing up",
4+
"packageName": "@azure/communication-react",
5+
"email": "carolinecao@microsoft.com",
6+
"dependentChangeType": "patch"
7+
}

packages/storybook/stories/MessageThread/MessageThread.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ const MessageThreadStory = (args): JSX.Element => {
195195
// We dont want to render the status for previous messages
196196
existingChatMessages.forEach((message) => {
197197
if (message.messageType === 'chat') {
198-
message.status = undefined;
198+
message.status = 'seen';
199199
}
200200
});
201201
setChatMessages([...existingChatMessages, GenerateMockNewChatMessage()]);

packages/storybook/stories/MessageThread/placeholdermessages.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ export const GenerateMockNewChatMessage = (): ChatMessage => {
5252
createdOn: new Date('2020-04-13T00:00:00.000+07:01'),
5353
mine: true,
5454
attached: false,
55-
status: 'seen' as MessageStatus,
56-
contentType: 'text'
55+
contentType: 'text',
56+
status: 'seen' as MessageStatus
5757
};
5858
};
5959

@@ -102,7 +102,8 @@ export const GenerateMockHistoryChatMessages = (): ChatMessage[] => {
102102
createdOn: new Date('2019-04-13T00:00:00.000+08:10'),
103103
mine: true,
104104
attached: false,
105-
contentType: 'text'
105+
contentType: 'text',
106+
status: 'seen' as MessageStatus
106107
},
107108
{
108109
messageType: 'chat',
@@ -139,7 +140,8 @@ export const GenerateMockChatMessages = (): ChatMessage[] => {
139140
createdOn: new Date('2020-04-13T00:00:00.000+08:10'),
140141
mine: true,
141142
attached: false,
142-
contentType: 'text'
143+
contentType: 'text',
144+
status: 'seen' as MessageStatus
143145
},
144146
{
145147
messageType: 'chat',
@@ -169,7 +171,8 @@ export const GenerateMockChatMessages = (): ChatMessage[] => {
169171
createdOn: new Date('2020-04-13T00:00:00.000+08:07'),
170172
mine: true,
171173
attached: false,
172-
contentType: 'text'
174+
contentType: 'text',
175+
status: 'seen' as MessageStatus
173176
},
174177
{
175178
messageType: 'chat',
@@ -229,8 +232,8 @@ export const GenerateMockChatMessages = (): ChatMessage[] => {
229232
createdOn: new Date('2020-04-13T00:00:00.000+08:02'),
230233
mine: true,
231234
attached: false,
232-
status: 'seen' as MessageStatus,
233-
contentType: 'text'
235+
contentType: 'text',
236+
status: 'seen' as MessageStatus
234237
},
235238
{
236239
messageType: 'chat',

0 commit comments

Comments
 (0)