forked from microsoft/chat-copilot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🚀 Adding new app state to handle user info (microsoft#145)
### Motivation and Context <!-- Thank you for your contribution to the copilot-chat repo! Please help reviewers and future users, providing the following information: 1. Why is this change required? 2. What problem does it solve? 3. What scenario does it contribute to? 4. If it fixes an open issue, please link to the issue here. --> Added new app state for setting user info, refactored app views, and added shared styles for informative views. This is a fix for a bug where the webapp would get stuck on the Loading Chats page. Something with SSO caused this. ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> - The App component now transitions to a SettingUserInfo state after successfully discovering the backend, and then to the LoadingChats state after successfully setting the active user info. - The user info status text in the App component has been updated to display a default message while fetching user information, and an error component has been added to display an error message at view level. - A new useSharedClasses hook has been added to provide a set of shared styles for informative views. - The BackendProbe component has also been updated to use the shared informativeView class. - Added tesseract data files to gitignore ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [x] The code builds clean without any errors or warnings - [x] The PR follows the [Contribution Guidelines](https://github.com/microsoft/copilot-chat/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/copilot-chat/blob/main/CONTRIBUTING.md#development-scripts) raises no violations ~~- [ ] All unit tests pass, and I have added new tests where possible~~ - [x] I didn't break anyone 😄
- Loading branch information
1 parent
850f571
commit 0837444
Showing
7 changed files
with
76 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright (c) Microsoft. All rights reserved. | ||
|
||
import { Subtitle2 } from '@fluentui/react-components'; | ||
import { ErrorCircleRegular } from '@fluentui/react-icons'; | ||
import { FC } from 'react'; | ||
import { useSharedClasses } from '../../styles'; | ||
|
||
interface IErrorProps { | ||
text: string; | ||
} | ||
|
||
export const Error: FC<IErrorProps> = ({ text }) => { | ||
const classes = useSharedClasses(); | ||
return ( | ||
<div className={classes.informativeView}> | ||
<ErrorCircleRegular fontSize={36} color="red" /> | ||
<Subtitle2>{text}</Subtitle2> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export * from './BackendProbe'; | ||
export * from './ChatView'; | ||
export * from './Error'; | ||
export * from './Loading'; | ||
export * from './Login'; | ||
export * from './MissingEnvVariablesError'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters