-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44 from johnoliver/merge-ui
Sync UI with python
- Loading branch information
Showing
24 changed files
with
1,030 additions
and
961 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Ignore JSON | ||
**/*.json |
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 |
---|---|---|
@@ -1,13 +1,13 @@ | ||
<!DOCTYPE html> | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/x-icon" href="/favicon.ico" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/x-icon" href="/favicon.ico" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>GPT + Enterprise data | Java Sample</title> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
<script type="module" src="/src/index.tsx"></script> | ||
</body> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
<script type="module" src="/src/index.tsx"></script> | ||
</body> | ||
</html> |
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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 |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
border-radius: 5px; | ||
padding: 30px 30px; | ||
font-weight: 100; | ||
} | ||
} |
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 |
---|---|---|
@@ -1,40 +1,39 @@ | ||
import { DefaultButton } from '@fluentui/react'; | ||
import { useMsal } from '@azure/msal-react'; | ||
import { DefaultButton } from "@fluentui/react"; | ||
import { useMsal } from "@azure/msal-react"; | ||
|
||
import styles from "./LoginButton.module.css"; | ||
import { loginRequest } from '../../authConfig'; | ||
|
||
import { getRedirectUri, loginRequest } from "../../authConfig"; | ||
|
||
export const LoginButton = () => { | ||
const { instance } = useMsal(); | ||
const activeAccount = instance.getActiveAccount(); | ||
const handleLoginPopup = () => { | ||
/** | ||
* When using popup and silent APIs, we recommend setting the redirectUri to a blank page or a page | ||
* that does not implement MSAL. Keep in mind that all redirect routes must be registered with the application | ||
* For more information, please follow this link: https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/login-user.md#redirecturi-considerations | ||
*/ | ||
instance | ||
.loginPopup({ | ||
...loginRequest, | ||
redirectUri: '/redirect', | ||
}) | ||
.catch((error) => console.log(error)); | ||
}; | ||
const handleLogoutPopup = () => { | ||
instance | ||
.logoutPopup({ | ||
mainWindowRedirectUri: '/', // redirects the top level app after logout | ||
account: instance.getActiveAccount(), | ||
}) | ||
.catch((error) => console.log(error)); | ||
}; | ||
const logoutText = `Logout\n${activeAccount?.username}` | ||
return ( | ||
<DefaultButton | ||
text={activeAccount ? logoutText : "Login"} | ||
className={styles.loginButton} | ||
onClick={activeAccount ? handleLogoutPopup : handleLoginPopup}> | ||
</DefaultButton> | ||
) | ||
const { instance } = useMsal(); | ||
const activeAccount = instance.getActiveAccount(); | ||
const handleLoginPopup = () => { | ||
/** | ||
* When using popup and silent APIs, we recommend setting the redirectUri to a blank page or a page | ||
* that does not implement MSAL. Keep in mind that all redirect routes must be registered with the application | ||
* For more information, please follow this link: https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/login-user.md#redirecturi-considerations | ||
*/ | ||
instance | ||
.loginPopup({ | ||
...loginRequest, | ||
redirectUri: getRedirectUri() | ||
}) | ||
.catch(error => console.log(error)); | ||
}; | ||
const handleLogoutPopup = () => { | ||
instance | ||
.logoutPopup({ | ||
mainWindowRedirectUri: "/", // redirects the top level app after logout | ||
account: instance.getActiveAccount() | ||
}) | ||
.catch(error => console.log(error)); | ||
}; | ||
const logoutText = `Logout\n${activeAccount?.username}`; | ||
return ( | ||
<DefaultButton | ||
text={activeAccount ? logoutText : "Login"} | ||
className={styles.loginButton} | ||
onClick={activeAccount ? handleLogoutPopup : handleLoginPopup} | ||
></DefaultButton> | ||
); | ||
}; |
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 |
---|---|---|
@@ -1 +1 @@ | ||
export * from "./LoginButton" | ||
export * from "./LoginButton"; |
4 changes: 3 additions & 1 deletion
4
app/frontend/src/components/QuestionInput/QuestionInput.module.css
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
Oops, something went wrong.