diff --git a/.gitignore b/.gitignore index 509d9153..4de2274c 100644 --- a/.gitignore +++ b/.gitignore @@ -44,6 +44,7 @@ __pycache__ *.DS_Store* data tags +myconfig.yaml # Jekyll docs/_site/ diff --git a/client/src/components/autosave/filenameDialog.js b/client/src/components/autosave/filenameDialog.js index 6ede84b5..9b67dc17 100644 --- a/client/src/components/autosave/filenameDialog.js +++ b/client/src/components/autosave/filenameDialog.js @@ -13,6 +13,7 @@ import { @connect((state) => ({ idhash: state.config?.parameters?.["annotations-user-data-idhash"] ?? null, annotations: state.annotations, + auth: state.config?.authentication, writableCategoriesEnabled: state.config?.parameters?.annotations ?? false, })) class FilenameDialog extends React.Component { @@ -90,12 +91,13 @@ class FilenameDialog extends React.Component { }; render() { - const { writableCategoriesEnabled, annotations, idhash } = this.props; + const { writableCategoriesEnabled, annotations, idhash, auth } = this.props; const { filenameText } = this.state; return writableCategoriesEnabled && !annotations.dataCollectionNameIsReadOnly && - !annotations.dataCollectionName ? ( + !annotations.dataCollectionName && + auth.is_authenticated ? ( { + const { auth } = props; + + if (!auth || (auth && !auth.requires_client_login)) return null; + + return ( +
+ + + {!auth.is_authenticated ? "Log In" : "Log Out"} + + +
+ ); +}); + +export default Auth; diff --git a/client/src/components/menubar/index.js b/client/src/components/menubar/index.js index 27e6ba7f..1dc8a36a 100644 --- a/client/src/components/menubar/index.js +++ b/client/src/components/menubar/index.js @@ -6,6 +6,7 @@ import * as globals from "../../globals"; import styles from "./menubar.css"; import actions from "../../actions"; import Clip from "./clip"; +import AuthButtons from "./authButtons"; import InformationMenu from "./infoMenu"; import Subset from "./subset"; import UndoRedoReset from "./undoRedo"; @@ -40,6 +41,7 @@ import { getEmbSubsetView } from "../../util/stateManager/viewStackHelpers"; celllist1: state.differential.celllist1, celllist2: state.differential.celllist2, libraryVersions: state.config?.["library_versions"], + auth: state.config?.authentication, undoDisabled: state["@@undoable/past"].length === 0, redoDisabled: state["@@undoable/future"].length === 0, aboutLink: state.config?.links?.["about-dataset"], @@ -218,6 +220,7 @@ class MenuBar extends React.PureComponent { subsetPossible, subsetResetPossible, enableReembedding, + auth, } = this.props; const { pendingClipPercentiles } = this.state; @@ -243,6 +246,7 @@ class MenuBar extends React.PureComponent { zIndex: 3, }} > +