Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement ChatList #2997

Open
wants to merge 255 commits into
base: next/mgt-chat
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
255 commits
Select commit Hold shift + click to select a range
5f26daf
fixed You
plasne Dec 15, 2023
2a37825
add functional changes from last known successful build "fixed You"
seekdavidlee Dec 18, 2023
c686f24
add missing changes
seekdavidlee Dec 20, 2023
f0e3c6d
Remove playwright-ct, fix build
andrewDoing Jan 2, 2024
03e21cc
Change HTML removal to just <p> tags
andrewDoing Jan 2, 2024
6d2804c
Fix regex for CodeQL
andrewDoing Jan 2, 2024
6ba20a0
initial work on adding visual elements
seekdavidlee Jan 2, 2024
7941587
initial work on adding visual elements
seekdavidlee Jan 2, 2024
b2f350e
Make ChatListItems fill ChatList width
andrewDoing Jan 2, 2024
9c27bce
Remove unused ChatList styles
andrewDoing Jan 2, 2024
d1dccf8
Merge branch 'technicallywilliams/chatlistitem-layout' into seekdavid…
seekdavidlee Jan 2, 2024
fecf3dc
Merge branch 'technicallywilliams/chatlistitem-layout' into seekdavid…
seekdavidlee Jan 2, 2024
df9faa7
restore UI after merge
seekdavidlee Jan 2, 2024
b3b1ba3
fix header element spacing
seekdavidlee Jan 3, 2024
e351797
make the chat add icon circle, make the menu stay on top
seekdavidlee Jan 3, 2024
6c70055
propogate the setting of chatlist header menu to top level
seekdavidlee Jan 3, 2024
2d28763
Adjust styles, fix timestamps
andrewDoing Jan 3, 2024
738328f
Make logic more readable
andrewDoing Jan 3, 2024
8f22281
Merge pull request #1 from plasne/technicallywilliams/chatlistitem-la…
andrewDoing Jan 3, 2024
5b70f56
initial starting point for StatefulGraphChatListClient
seekdavidlee Jan 3, 2024
f57cdbd
remove comment
seekdavidlee Jan 3, 2024
e79e996
Merge branch 'next/mgt-chat' into seekdavidlee/chatlist-layout
seekdavidlee Jan 3, 2024
a55b374
add get user id
seekdavidlee Jan 3, 2024
e9db6e4
initial work on signalr and subscription for getAllMessages
seekdavidlee Jan 4, 2024
e87d170
Merge branch 'next/mgt-chat' of https://github.com/microsoftgraph/mic…
plasne Jan 4, 2024
7456e44
add cache
seekdavidlee Jan 4, 2024
a4d33ea
rework based on code review comments
seekdavidlee Jan 4, 2024
244420b
Merge branch 'seekdavidlee/chatlist-layout' into seekdavidlee/chatlis…
seekdavidlee Jan 4, 2024
b4e537e
complete subscription work
seekdavidlee Jan 4, 2024
d9d15e9
wip: functional load
plasne Jan 4, 2024
14f28fb
expose chatlist menu and button items classes,
seekdavidlee Jan 5, 2024
01fed6d
Merge branch 'seekdavidlee/chatlist-layout' into seekdavidlee/chatlis…
seekdavidlee Jan 5, 2024
6757bde
add selecteditm and readitem state to chatlist component
TechnicallyWilliams Jan 5, 2024
3d4182e
update formatting
TechnicallyWilliams Jan 5, 2024
09eed58
fixed timestamp, support for displaying id
plasne Jan 5, 2024
af59be4
create new subscriptions for chatlist message events
seekdavidlee Jan 5, 2024
c4f1976
remove read state from chatlistitem
TechnicallyWilliams Jan 5, 2024
19a34a8
update naming for updating selected item state in ChatList
TechnicallyWilliams Jan 5, 2024
aa3d267
move chatlistitem onselected callback to chatlist;
TechnicallyWilliams Jan 6, 2024
2bade15
update styling to account for new button in chatlist
TechnicallyWilliams Jan 8, 2024
458da65
layout component - Stub out all visual components. (#2)
seekdavidlee Jan 8, 2024
99fd687
remove additional styling from chatlist
TechnicallyWilliams Jan 8, 2024
5fa2795
Merge branch 'next/mgt-chat' into technicallywilliams/chatlist-read-s…
TechnicallyWilliams Jan 8, 2024
87b5e27
initial work on loading chat threads from api
seekdavidlee Jan 8, 2024
f7422c8
implement updating chatlistitem
seekdavidlee Jan 8, 2024
5deae80
fix an issue with markallasread appearing multiple times
seekdavidlee Jan 8, 2024
1d0b483
minor fixes for feedback
plasne Jan 8, 2024
c1997b2
ensure we are using the right annotations
seekdavidlee Jan 8, 2024
1c0a2a5
fix annotations per code review comments
seekdavidlee Jan 9, 2024
e5984aa
hardcode session id to be default
seekdavidlee Jan 9, 2024
bc77f4a
Merge branch 'next/mgt-chat' into seekdavidlee/chatlist-client
seekdavidlee Jan 9, 2024
b6c00ca
Merge branch 'seekdavidlee/chatlist-client' into seekdavidlee/load-ch…
seekdavidlee Jan 9, 2024
12c468f
Merge pull request #4 from plasne/technicallywilliams/chatlist-read-s…
TechnicallyWilliams Jan 9, 2024
c49a3a4
add getAllMessages subscription (#6)
seekdavidlee Jan 9, 2024
7a46857
fix for loading ChatList
plasne Jan 9, 2024
bd7f18d
merged from next/mgt-chat
plasne Jan 9, 2024
da8e559
Merge pull request #5 from plasne/pelasne/chatlistitem-load
plasne Jan 9, 2024
87287dd
Person Icons, Emojis, Images, Group Title +N (#3)
andrewDoing Jan 9, 2024
c1be5a7
move chatthreads to b managed by StatefulGraphChatListClient
seekdavidlee Jan 9, 2024
9c138c6
move subscribe and teardown of client to a common useEffect
seekdavidlee Jan 9, 2024
cf83e98
we don't need subscribeToUser
seekdavidlee Jan 10, 2024
9fe354a
Merge branch 'next/mgt-chat' into seekdavidlee/load-chatthreads
seekdavidlee Jan 10, 2024
ad62a46
graph is always defined
seekdavidlee Jan 10, 2024
4452620
manage chatthreads internal to StatefulGraphChatListClient
seekdavidlee Jan 10, 2024
a98ab01
messages is not required as this is not chat
seekdavidlee Jan 10, 2024
803ec71
teardown should depend on chatClient and not state
seekdavidlee Jan 10, 2024
82ebe5f
updates per code review comments
seekdavidlee Jan 10, 2024
c1c9e87
rework useEffect to be grouped next to each other
seekdavidlee Jan 10, 2024
97ce1fa
added last read timestamp
plasne Jan 10, 2024
8c74fe8
reworked chatlist and stategraphchatlistclient for various issues (#7)
seekdavidlee Jan 10, 2024
cfc678a
merged
plasne Jan 10, 2024
4f2cb15
merged with next
plasne Jan 10, 2024
20fbf14
Merge pull request #8 from plasne/pelasne/last-read-timeout
plasne Jan 11, 2024
186c222
added system event behaviors
plasne Jan 11, 2024
4e8375b
feedback about changing error to log
plasne Jan 12, 2024
cc79d5a
Load more chat threads implementation. (#9)
seekdavidlee Jan 12, 2024
d83ea47
implement mark all messages as read
TechnicallyWilliams Jan 12, 2024
6e85974
merge latest
TechnicallyWilliams Jan 12, 2024
74a8f87
run prettier
TechnicallyWilliams Jan 12, 2024
8cf2f96
make markasread a function that onclick calls
TechnicallyWilliams Jan 12, 2024
d9bb2bc
add comments; remove logging statements
TechnicallyWilliams Jan 13, 2024
2773f71
initial checkin for timer cleanup (#13)
seekdavidlee Jan 16, 2024
bf35ee1
merged with next/mgt-chat
plasne Jan 16, 2024
e4c275c
Merge pull request #11 from plasne/pelasne/implement-thread-change
plasne Jan 16, 2024
54f80c0
Add a prop for specifying the selected ChatListItem.
Jan 16, 2024
d97cd74
Handle Chat Message Notifications (#316) (#10)
andrewDoing Jan 16, 2024
8258ecd
remove stateful list of readitems
TechnicallyWilliams Jan 16, 2024
6e9a3a0
merge latest next/mgt-chat
TechnicallyWilliams Jan 16, 2024
333f5ef
merge latest next/mgt-chat
TechnicallyWilliams Jan 16, 2024
d9263b2
Update loading chat threads to use last-read-timestamp (#12)
andrewDoing Jan 16, 2024
0d09613
small bug fixes
plasne Jan 16, 2024
9401c39
Merge branch 'next/mgt-chat' into mattbillfred/implement-selection-wi…
Jan 16, 2024
01b7600
Renamed selectedItemId to selectedChatId
Jan 16, 2024
3008a42
Merge pull request #15 from plasne/mattbillfred/implement-selection-w…
MattBillFred Jan 16, 2024
eef8eb5
Merge pull request #16 from plasne/pelasne/fixes-from-demo
plasne Jan 17, 2024
34c2725
Merge branch 'next/mgt-chat' into technicallywilliams/markallasread
TechnicallyWilliams Jan 17, 2024
0151d8a
ensure onallmessageread has latest chatthreads
TechnicallyWilliams Jan 17, 2024
b8a154f
add caching to statefulgraphchatlistclient
TechnicallyWilliams Jan 17, 2024
36aeda2
add markasread check to pre-commit of loading more chats
TechnicallyWilliams Jan 17, 2024
0e7b42d
ensure mark all as read returns true read
TechnicallyWilliams Jan 17, 2024
45ff87c
implemented proper app/bot handling
plasne Jan 17, 2024
1c06920
Merge branch 'next/mgt-chat' into technicallywilliams/markallasread
TechnicallyWilliams Jan 17, 2024
ce7effb
fixed unit test re: permissions
plasne Jan 17, 2024
53cd932
remove async modifier from higher order function
TechnicallyWilliams Jan 17, 2024
6c65555
remove async modifier; remove unsafe undefined
TechnicallyWilliams Jan 17, 2024
8ca2023
remove async modifier; remove unsafe undefined
TechnicallyWilliams Jan 17, 2024
35bbf63
reset apps on chat change
plasne Jan 18, 2024
f361886
trailing change: updating placement of read status check
TechnicallyWilliams Jan 18, 2024
62e65d2
feedback: add id filter on load; add nul assertions;
TechnicallyWilliams Jan 18, 2024
3b9fa1c
fix id filter on load
TechnicallyWilliams Jan 18, 2024
ebef10b
update how handler reads
TechnicallyWilliams Jan 18, 2024
a361baa
remove explicit reference to graphchatthread in chatlist
TechnicallyWilliams Jan 18, 2024
7c29505
Merge pull request #14 from plasne/technicallywilliams/markallasread
TechnicallyWilliams Jan 18, 2024
40dcb6e
merged with next/mgt-chat
plasne Jan 18, 2024
2e7beb4
fix selection issue
plasne Jan 19, 2024
29fb19f
add UI for banner showing disconnected state of the subscription (#17)
seekdavidlee Jan 19, 2024
23ce3dd
Merge pull request #18 from plasne/pelasne/fix-appbot-names
plasne Jan 19, 2024
29c1885
remove login from chatlisheader (#20)
seekdavidlee Jan 19, 2024
19d1be8
Merge pull request #21 from microsoftgraph/next/mgt-chat
plasne Jan 19, 2024
5eb0567
Fix shorthands.flex error (#22)
andrewDoing Jan 19, 2024
cd7dfb9
Merge pull request #25 from microsoftgraph/next/mgt-chat
plasne Jan 29, 2024
66c7a92
implementation for switching user (#24)
seekdavidlee Jan 29, 2024
46469e8
fix emoji build error, reload chat threads on subscribe 404 (#27)
seekdavidlee Jan 30, 2024
db2bb3e
bug fixes
plasne Jan 30, 2024
d81a889
removed bad comment
plasne Jan 30, 2024
0499e95
Update packages/mgt-chat/src/components/ChatList/ChatList.tsx
plasne Jan 30, 2024
9a378f6
Merge pull request #28 from plasne/pelasne/chatlist-page-379
plasne Jan 30, 2024
98333ed
fixed conflicts
plasne Jan 30, 2024
25dfdc0
ignore older msg if it came in later (#31)
seekdavidlee Jan 30, 2024
99b1ad3
Merge pull request #30 from plasne/pelasne/test-mode
plasne Jan 31, 2024
c40f70f
Merge pull request #32 from microsoftgraph/next/mgt-chat
plasne Jan 31, 2024
afb4724
added full-screen-errors similar to chat
plasne Jan 31, 2024
88086d4
removed comment
plasne Jan 31, 2024
8faaec3
Merge pull request #33 from plasne/pelasne/chatlist-page-379.2
plasne Jan 31, 2024
ce2f0a0
run yarn setLicense command to set header (#34)
seekdavidlee Feb 1, 2024
bd58b1d
fixes
plasne Feb 1, 2024
6c71d2b
added yarn stuff
plasne Feb 1, 2024
10b4d78
Merge pull request #35 from plasne/pelasne/do-not-rely-on-sign-in-to-…
plasne Feb 1, 2024
f0fad75
fixed some style issues
plasne Feb 1, 2024
6843445
Merge pull request #36 from plasne/pelasne/fix-styles-for-acs-upgrade
plasne Feb 1, 2024
f5c319d
support for undefined
plasne Feb 1, 2024
0d6109c
Merge pull request #38 from plasne/pelasne/support-for-global-provide…
plasne Feb 1, 2024
ee5ca71
add chatlist specific scopes (#37)
seekdavidlee Feb 1, 2024
4f8022d
fixed one more undefined place
plasne Feb 2, 2024
27e466e
Merge pull request #39 from plasne/pelasne/fix-provider-can-be-undefined
plasne Feb 2, 2024
2a0f911
use the compose icon to be consistent with Teams in sample (#40)
seekdavidlee Feb 2, 2024
47708ad
add meeting icon (#41)
seekdavidlee Feb 2, 2024
431bd2e
update react contoso to use chatlist per PG (#42)
seekdavidlee Feb 6, 2024
a2b3a06
Change onLoaded to handle number of chat threads (#43)
andrewDoing Feb 6, 2024
9a08554
Andrew doing/update on loaded (#44)
andrewDoing Feb 6, 2024
e02a6f8
work in progress
plasne Feb 6, 2024
02d0f78
Merge branch 'next/mgt-chat' of https://github.com/plasne/microsoft-g…
plasne Feb 6, 2024
6c465ef
more stuff in PR
plasne Feb 7, 2024
efb7677
wire up chatMessageReceived in draft state (#45)
seekdavidlee Feb 7, 2024
fe273e4
Revert "work in progress"
plasne Feb 7, 2024
7d3c034
Revert "more stuff in PR"
plasne Feb 7, 2024
7d2702c
fixed as appropriate
plasne Feb 7, 2024
c2478a3
removed testing div
plasne Feb 7, 2024
0243c8a
fixed issue where chat would not always display missing chat id
plasne Feb 7, 2024
28688ed
removed debug logs
plasne Feb 7, 2024
ca42664
Merge pull request #48 from plasne/pelasne/revert-commits
plasne Feb 7, 2024
861128f
Merge branch 'next/mgt-chat' of https://github.com/plasne/microsoft-g…
plasne Feb 7, 2024
2ef8211
fixed issue where messages for new chat threads would throw exception
plasne Feb 7, 2024
adc3e32
write previously unhandled messages related to wake-up to the log
plasne Feb 7, 2024
83613b0
Merge pull request #50 from plasne/pelasne/bug-fix-450
plasne Feb 7, 2024
fab1348
Merge pull request #49 from plasne/pelasne/bug-fix-452
plasne Feb 7, 2024
50eec0b
Merge pull request #51 from plasne/pelasne/bug-fix-446
plasne Feb 7, 2024
f6f4809
resolved merge conflicts
plasne Feb 8, 2024
6357e58
Infinite scrolling implementation (#47)
seekdavidlee Feb 9, 2024
a0f5620
fix blind read reset on received messages
TechnicallyWilliams Feb 9, 2024
ec31259
Fix Timer for Vite Rollup bundling (#55)
andrewDoing Feb 9, 2024
bcb95d6
fixed styles
plasne Feb 12, 2024
12494a7
Merge pull request #54 from plasne/microsoftgraph-next/mgt-chat
plasne Feb 12, 2024
2066183
reworked underlying renewal logic so that it is cleaner to debug as w…
seekdavidlee Feb 12, 2024
a427685
Merge branch 'next/mgt-chat' into dexterw/fix-chat-read-reset
TechnicallyWilliams Feb 13, 2024
563e406
incorporate feedback: move internalselectedchat to statefulgraphchatl…
TechnicallyWilliams Feb 13, 2024
d115c8a
incorporate feedback: move internalselectedchat to statefulgraphchatl…
TechnicallyWilliams Feb 13, 2024
e285de4
copy chatthread to update isread
TechnicallyWilliams Feb 13, 2024
21195dd
extend the delay in invoking the next renewal if we create a new subs…
seekdavidlee Feb 13, 2024
f7807f7
update contoso sample
TechnicallyWilliams Feb 13, 2024
81aaca2
copy chatthread to update isread
TechnicallyWilliams Feb 13, 2024
5231f6f
Merge branch 'next/mgt-chat' into dexterw/fix-chat-read-reset
TechnicallyWilliams Feb 13, 2024
3983013
update callbacks in chatpage
TechnicallyWilliams Feb 14, 2024
86ea3e5
Merge pull request #56 from plasne/dexterw/fix-chat-read-reset
TechnicallyWilliams Feb 14, 2024
4650e97
ChatListHeader is now optional if there are no buttons or menu items …
seekdavidlee Feb 14, 2024
6fb163c
Update NewChat with new label and send icon #434 (#59)
andrewDoing Feb 15, 2024
18251dd
persist read messages state (#62)
seekdavidlee Feb 15, 2024
6be4e31
Handle NewChat Errors, filter self from PeoplePicker (#63)
andrewDoing Feb 16, 2024
837b7cb
UI Fixes (#61)
andrewDoing Feb 16, 2024
50211e4
implemented state change tracking for chatThreadsPerPage and selected…
seekdavidlee Feb 20, 2024
1f5746d
merged from upstream
plasne Feb 20, 2024
18e9024
Merge branch 'next/mgt-chat' of https://github.com/plasne/microsoft-g…
plasne Feb 20, 2024
b48c889
Merge pull request #66 from plasne/microsoftgraph-next/mgt-chat
plasne Feb 21, 2024
2a74f53
messages from You are read
plasne Feb 21, 2024
ba26190
Merge pull request #67 from plasne/pelasne/mark-you-as-read-489
plasne Feb 21, 2024
351f070
todos from code review
seekdavidlee Feb 21, 2024
79746f2
Merge pull request #71 from microsoftgraph/next/mgt-chat
plasne Feb 22, 2024
f20294d
Add filter to loadAppsInChat to exclude apps without a bot
andrewDoing Feb 22, 2024
eba6d03
Implement Gavin's review
andrewDoing Feb 23, 2024
1c38760
Rename vars from app => bot
andrewDoing Feb 23, 2024
3323c78
Re-case constant ignoreBotsWithName
andrewDoing Feb 23, 2024
319e7d5
fixed issues with wake-up
plasne Feb 23, 2024
cdfdf68
Merge branch 'next/mgt-chat' of https://github.com/plasne/microsoft-g…
plasne Feb 23, 2024
f7d3411
added some try...finally
plasne Feb 23, 2024
de25715
removed unnecessary log
plasne Feb 23, 2024
f14739b
Merge pull request #75 from plasne/andrewDoing/usegraphchatclientreview
plasne Feb 26, 2024
31f7d93
Merge pull request #73 from plasne/andrewDoing/graphchatreview
plasne Feb 26, 2024
656ff3d
address PG code review for StatefulGraphChatListClient (#74)
seekdavidlee Feb 26, 2024
fe99fe6
merged from next/mgt-chat
plasne Feb 26, 2024
bd6b8c0
updated per David's feedback
plasne Feb 26, 2024
c91b337
Merge pull request #76 from plasne/pelasne/renewal-loop-sticking
plasne Feb 26, 2024
d63ab6c
merged with next/mgt-chat
plasne Feb 26, 2024
1f138bc
Merge pull request #69 from plasne/seekdavidlee/todos
plasne Feb 26, 2024
c81e094
initial work
plasne Feb 26, 2024
211df3d
remove duplicate exports (#77)
seekdavidlee Feb 26, 2024
f479bcf
fixed icons
plasne Feb 27, 2024
9d09d3e
addressed comments
plasne Feb 27, 2024
806c6d5
Merge pull request #78 from plasne/pelasne/pg-feedback-491
plasne Feb 27, 2024
ec95d3c
Feedback for ChatList (#79)
TechnicallyWilliams Feb 28, 2024
35dd83e
bug fix for async load of chat details
plasne Feb 29, 2024
81ff5c8
fixed read info
plasne Feb 29, 2024
46f83d3
Merge pull request #80 from plasne/pelasne/bug-fix-for-adding-chat-me…
plasne Feb 29, 2024
457f61d
Merge pull request #81 from plasne/pelasne/bug-fix-for-you-as-read
plasne Feb 29, 2024
10823ef
fixed issue whereby server connection established was overridden
plasne Mar 1, 2024
dee9cd5
Merge pull request #82 from plasne/pelasne/fix-for-load-chat-threads
plasne Mar 1, 2024
3969786
fix starting as disconnected
plasne Mar 1, 2024
2ff2e3e
fixed a couple of bugs
plasne Mar 6, 2024
06b819b
Merge pull request #84 from plasne/pelasne/bug-fix-before-prod
plasne Mar 6, 2024
0c9e845
merged from upstream
plasne Mar 6, 2024
0004c17
Merge branch 'next/mgt-chat' of https://github.com/plasne/microsoft-g…
plasne Mar 6, 2024
5f1c10c
fixed chatOperationScopes
plasne Mar 6, 2024
5c0eeca
fix refresh issues with ChatList selection
plasne Mar 6, 2024
6cfc293
added ?
plasne Mar 6, 2024
564d79e
Merge pull request #87 from plasne/pelasne/fix-chat-list-selection
plasne Mar 6, 2024
129ad4d
Merge pull request #86 from plasne/pelasne/upstream-changes-march-6
plasne Mar 6, 2024
8fe2806
allow for no sign-in event
plasne Mar 7, 2024
fee25d1
Merge pull request #88 from plasne/pelasne/fix-graph-notifications
plasne Mar 7, 2024
3c06087
getting presence on login no longer causes sign-out
plasne Mar 7, 2024
9e435bb
added post_request_failed
plasne Mar 7, 2024
dc6b06f
added more logs
plasne Mar 7, 2024
2c691ce
added 2 more logs
plasne Mar 7, 2024
8d410a0
removed try...catch in loadAndAppendChatThreads
plasne Mar 7, 2024
cc1ea0e
Merge pull request #89 from plasne/pelasne/fix-signout-on-presence-issue
plasne Mar 7, 2024
9d93d75
[VS]: Updated the MGT chat app to have proxy support as well.
Jun 6, 2024
258dc70
Merge pull request #90 from plasne/vinay/mgt-proxy-support
plasne Jun 8, 2024
7c31721
[VS]: Updated the proxy renuwal code to support renewal cache.
Jun 10, 2024
681558c
[VS]: Updated the mgt proxy token manager to have a token refresh mec…
Jun 11, 2024
4dcacff
[VS]: Added token refresh for scenarios where token is not refreshed …
Jun 17, 2024
4602df3
[VS]: Added a top level check for the response to make sure we have a…
Jun 17, 2024
79d5bef
Merge pull request #91 from plasne/vinay/mgt-proxy-support-BugFixes
plasne Jun 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,7 @@ workbench.html
!.yarn/releases
!.yarn/sdks
!.yarn/versions

/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added .yarn/cache/fsevents-patch-21ad2b1333-8.zip
Binary file not shown.
Binary file added .yarn/cache/fsevents-patch-2882183fbf-8.zip
Binary file not shown.
Binary file added .yarn/cache/fsevents-patch-61ccaa93a2-8.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"build:react-contoso": "lerna run build --scope react-contoso",
"bundle": "cd ./packages/mgt && npm run bundle",
"clean": "lerna run --parallel --stream --scope '@microsoft/*' clean",
"lint:eslint": "eslint -c .eslintrc.js --quiet 'packages/*/src/**/*.ts'",
"lint:eslint": "eslint -c .eslintrc.js --quiet packages/*/src/**/*.ts",
"lint:eslint:loud": "eslint -c .eslintrc.js 'packages/*/src/**/*.ts'",
"lint:styles": "stylelint './packages/mgt-components/**/*.{css,scss}'",
"lint:fix": "npm run lint:styles -- --fix",
Expand All @@ -46,7 +46,7 @@
"watch:react-library-deps": "lerna run build:watch --parallel --stream --scope @microsoft/mgt-react --include-dependencies",
"watch:react-library": "lerna run build:watch --scope @microsoft/mgt-react",
"watch:react-contoso": "lerna run start --scope react-contoso",
"watch:react": "npm-run-all --parallel watch:react-library watch:react-library-deps watch:react-contoso",
"watch:react": "NODE_OPTIONS=--max_old_space_size=8192 npm-run-all --parallel watch:react-library watch:react-library-deps watch:react-contoso",
"prettier:base": "prettier --parser typescript",
"prettier:check": "npm run prettier:base -- --check \"packages/**/*.{ts,tsx}\"",
"prettier:write": "npm run prettier:base -- --write \"packages/**/*.{ts,tsx}\"",
Expand Down
2 changes: 2 additions & 0 deletions packages/mgt-chat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"author": "Microsoft",
"license": "MIT",
"devDependencies": {
"@types/html-to-text": "^9.0.4",
"@types/react": "^17.0.0",
"react": "^17.0.0",
"react-dom": "^17.0.0",
Expand All @@ -64,6 +65,7 @@
"@microsoft/microsoft-graph-types": "^2.0.0",
"@microsoft/microsoft-graph-types-beta": "^0.16.0-preview",
"@microsoft/signalr": "^7.0.4",
"html-to-text": "^9.0.5",
"immer": "^9.0.6",
"opencrypto": "1.5.5",
"uuid": "^9.0.0",
Expand Down
51 changes: 37 additions & 14 deletions packages/mgt-chat/src/components/Chat/Chat.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import { FluentThemeProvider, MessageThread, SendBox, MessageThreadStyles } from '@azure/communication-react';
import { FluentTheme } from '@fluentui/react';
import { FluentProvider, makeStyles, shorthands, webLightTheme } from '@fluentui/react-components';
import { v4 as uuid } from 'uuid';
import { StatefulGraphChatClient } from '../../statefulClient/StatefulGraphChatClient';
import { useGraphChatClient } from '../../statefulClient/useGraphChatClient';
import { onRenderMessage } from '../../utils/chat';
import { renderMGTMention } from '../../utils/mentions';
import { registerAppIcons } from '../styles/registerIcons';
import { Spinner } from '@microsoft/mgt-react';
import { enableMapSet } from 'immer';
import React, { useEffect, useState } from 'react';
Expand All @@ -12,12 +18,7 @@ import { LoadingMessagesErrorIcon } from '../Error/LoadingMessageErrorIcon';
import { OpenTeamsLinkError } from '../Error/OpenTeams';
import { RequireValidChatId } from '../Error/RequireAValidChatId';
import { TypeANewMessage } from '../Error/TypeANewMessage';
import { registerAppIcons } from '../styles/registerIcons';
import { BotInfoClient } from '../../statefulClient/BotInfoClient';
import { StatefulGraphChatClient } from '../../statefulClient/StatefulGraphChatClient';
import { useGraphChatClient } from '../../statefulClient/useGraphChatClient';
import { onRenderMessage } from '../../utils/chat';
import { renderMGTMention } from '../../utils/mentions';

registerAppIcons();

Expand Down Expand Up @@ -79,7 +80,7 @@ const useStyles = makeStyles({
*/
const messageThreadStyles: MessageThreadStyles = {
chatContainer: {
'& .ui-box': {
'& .uiBox': {
zIndex: 'unset',
'& div[data-ui-status]': {
display: 'inline-flex',
Expand All @@ -89,7 +90,7 @@ const messageThreadStyles: MessageThreadStyles = {
}
},
chatMessageContainer: {
'& p>.mgt-person-mention,msft-mention': {
'& p>.mgtPersonMention,msftMention': {
display: 'inline-block',
...shorthands.marginInline('0px')
},
Expand All @@ -99,7 +100,7 @@ const messageThreadStyles: MessageThreadStyles = {
}
},
myChatMessageContainer: {
'& p>.mgt-person-mention,msft-mention': {
'& p>.mgtPersonMention,msftMention': {
display: 'inline-block',
...shorthands.marginInline('0px')
},
Expand All @@ -110,24 +111,46 @@ const messageThreadStyles: MessageThreadStyles = {
}
};

/**
* Provides a stable sessionId for the lifetime of the browser tab.
* @returns a string that is either read from session storage or generated and placed in session storage
*/
const useSessionId = (): string => {
const [sessionId] = useState<string>(() => uuid());
return sessionId;
};

export const Chat = ({ chatId }: IMgtChatProps) => {
useEffect(() => {
enableMapSet();
}, []);
const styles = useStyles();
const chatClient: StatefulGraphChatClient = useGraphChatClient(chatId);
const chatClient: StatefulGraphChatClient = useGraphChatClient();
const [botInfoClient] = useState(() => new BotInfoClient());
const [chatState, setChatState] = useState(() => chatClient.getState());
const [chatState, setChatState] = useState(chatClient.getState());
const sessionId = useSessionId();

useEffect(() => {
chatClient.onStateChange(setChatState);
return () => {
chatClient.offStateChange(setChatState);
};
}, [chatClient]);

const isLoading = ['creating server connections', 'subscribing to notifications', 'loading messages'].includes(
chatState.status
);
// when chatId or sessionId changes this effect subscribes or unsubscribes
// the component to/from web socket based notifications for the given chatId
useEffect(() => {
// we must have both a chatId & sessionId to subscribe.
if (chatId && sessionId) chatClient.subscribeToChat(chatId, sessionId);
else chatClient.setStatus('no chat id');
}, [chatId, sessionId, chatClient]);

const isLoading = [
'initial',
'creating server connections',
'subscribing to notifications',
'loading messages'
].includes(chatState.status);

const disabled = !chatId || !!chatState.activeErrorMessages.length;
const placeholderText = disabled ? 'You cannot send a message' : 'Type a message...';
Expand Down Expand Up @@ -191,7 +214,7 @@ export const Chat = ({ chatId }: IMgtChatProps) => {
<Error message="No chat id has been provided." subheading={RequireValidChatId}></Error>
)}
{chatState.status === 'error' && (
<Error message="We're sorry—we've run into an issue.." subheading={OpenTeamsLinkError}></Error>
<Error message="We're sorry—we've run into an issue." subheading={OpenTeamsLinkError}></Error>
)}
<div className={styles.chatInput}>
<SendBox disabled={disabled} onSendMessage={chatState.onSendMessage} strings={{ placeholderText }} />
Expand Down
Loading
Loading