forked from HumanBrainProject/model-catalog
-
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.
* staging: (21 commits) temporarily remove the option to use MC without authentication, until we get sessions working properly use null in place of empty string for missing parameters only show "add model/test" button when authenticated fix bug when adding new model or test from table fix bug introduced in 53357c3 Fix download links for data in CSCS containers move filtering of editable projects to the server Set back-end server for staging at Docker build time Remove warnings from more recent versions of dependencies avoid reloading page when clicking on featured models; allow login when try to access model detail page directly update names of featured models Add support for using Model Catalog when not logged in Update keycloak config, based on HumanBrainProject/hbp-validation-framework#319 by @appukuttan-shailesh update EBRAINS logo for link-outs Add ModelDB linkouts fix a not-so-obvious issue with using autocomplete fix dumb mistake in autocomplete Add search/autocomplete to single-select drop-down lists only show project ID (collab name) for private models, it is not relevant for public ones debug ci build failure ...
- Loading branch information
Showing
22 changed files
with
694 additions
and
445 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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,45 @@ | ||
import React from "react"; | ||
import Button from "@material-ui/core/Button"; | ||
import IconButton from "@material-ui/core/IconButton"; | ||
import PersonIcon from '@material-ui/icons/Person'; | ||
import Tooltip from "@material-ui/core/Tooltip"; | ||
import ContextMain from "./ContextMain"; | ||
|
||
|
||
function AuthWidget(props) { | ||
|
||
const context = React.useContext(ContextMain); | ||
const [auth] = context.auth; | ||
|
||
if (auth.authenticated || props.currentUser) { | ||
|
||
if (!props.currentUser) { | ||
auth.loadUserInfo().then((userInfo) => { | ||
console.log(userInfo); | ||
props.setCurrentUser(userInfo.preferred_username); | ||
}); | ||
}; | ||
|
||
return ( | ||
<Tooltip title={props.currentUser || "anonymous"}> | ||
<IconButton variant="outlined"> | ||
<PersonIcon /> | ||
</IconButton> | ||
</Tooltip> | ||
); | ||
} else { | ||
return ( | ||
<Button | ||
variant="outlined" | ||
color="primary" | ||
disableElevation | ||
size="small" | ||
onClick={auth.login} // todo: login with scopes | ||
> | ||
Login | ||
</Button> | ||
); | ||
} | ||
} | ||
|
||
export default AuthWidget; |
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
Oops, something went wrong.