-
Notifications
You must be signed in to change notification settings - Fork 24
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
Show dataset name or explorative tracing name in webknossos tab title #4767
Changes from 1 commit
7aa7e70
65a744d
6e176b4
3c35898
a39742a
6ebd63b
bf2b921
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// @flow | ||
|
||
import useDocumentTitle from "@rehooks/document-title"; | ||
|
||
function TabTitle({ title }: { title: string }) { | ||
useDocumentTitle(title); | ||
return null; | ||
} | ||
|
||
export default TabTitle; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,6 +38,7 @@ import messages from "messages"; | |
import window, { document, location } from "libs/window"; | ||
import ErrorHandling from "libs/error_handling"; | ||
import CrossOriginApi from "oxalis/api/cross_origin_api"; | ||
import TabTitle from "../components/tab_title_component"; | ||
|
||
import { GoldenLayoutAdapter } from "./golden_layout_adapter"; | ||
import { determineLayout } from "./default_layout_configs"; | ||
|
@@ -58,6 +59,8 @@ type StateProps = {| | |
isDatasetOnScratchVolume: boolean, | ||
autoSaveLayouts: boolean, | ||
datasetName: string, | ||
displayName: string, | ||
organization: string, | ||
|}; | ||
type DispatchProps = {| | ||
setAutoSaveLayouts: boolean => void, | ||
|
@@ -159,6 +162,8 @@ class TracingLayoutView extends React.PureComponent<PropsWithRouter, State> { | |
storeLayoutConfig(this.currentLayoutConfig, layoutKey, this.currentLayoutName); | ||
}; | ||
|
||
getTabTitle = () => `${this.props.displayName} ${this.props.organization} webknossos`; | ||
|
||
getLayoutNamesFromCurrentView = (layoutKey): Array<string> => | ||
this.props.storedLayouts[layoutKey] ? Object.keys(this.props.storedLayouts[layoutKey]) : []; | ||
|
||
|
@@ -190,6 +195,7 @@ class TracingLayoutView extends React.PureComponent<PropsWithRouter, State> { | |
onImport={isUpdateTracingAllowed ? importTracingFiles : createNewTracing} | ||
isUpdateAllowed={isUpdateTracingAllowed} | ||
> | ||
<TabTitle title={this.getTabTitle()} /> | ||
<OxalisController | ||
initialAnnotationType={this.props.initialAnnotationType} | ||
initialCommandType={this.props.initialCommandType} | ||
|
@@ -343,6 +349,8 @@ function mapStateToProps(state: OxalisState): StateProps { | |
storedLayouts: state.uiInformation.storedLayouts, | ||
isDatasetOnScratchVolume: state.dataset.dataStore.isScratch, | ||
datasetName: state.dataset.name, | ||
displayName: state.tracing.name ? state.tracing.name : state.dataset.name, | ||
organization: state.activeUser ? state.activeUser.organization : "", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this mean that no organization is shown if the user is not logged in? I think, this is problematic since the organization title should especially be presented for guest users. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should it be the organization that owns the dataset instead? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I think that makes sense! |
||
}; | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1162,6 +1162,13 @@ | |
resolved "https://registry.yarnpkg.com/@redux-saga/types/-/types-1.0.2.tgz#1d94f02800b094753f9271c206a26c2a06ca14ee" | ||
integrity sha512-8/qcMh15507AnXJ3lBeuhsdFwnWQqnp68EpUuHlYPixJ5vjVmls7/Jq48cnUlrZI8Jd9U1jkhfCl0gaT5KMgVw== | ||
|
||
"@rehooks/document-title@^1.0.2": | ||
version "1.0.2" | ||
resolved "https://registry.yarnpkg.com/@rehooks/document-title/-/document-title-1.0.2.tgz#d03e8a09e09f6fd481518982b151ab0da4bc5eec" | ||
integrity sha512-8ckcelpgqmWtGNXob+P6Lw2lHM2IfkP7sl8QJ2BNHkFeDQnc1CYeYf2NMVuFflYh3YVlAlfUzAxcIG1QCBrRQQ== | ||
dependencies: | ||
react "^16.13.1" | ||
|
||
"@rpl/[email protected]": | ||
version "2.2.0" | ||
resolved "https://registry.yarnpkg.com/@rpl/badge-up/-/badge-up-2.2.0.tgz#79a5ccf72bdb1777390bb7e4caa08dc42d57dd9a" | ||
|
@@ -10435,6 +10442,15 @@ [email protected]: | |
object-assign "^4.1.0" | ||
prop-types "^15.5.7" | ||
|
||
react@^16.13.1: | ||
version "16.13.1" | ||
resolved "https://registry.yarnpkg.com/react/-/react-16.13.1.tgz#2e818822f1a9743122c063d6410d85c1e3afe48e" | ||
integrity sha512-YMZQQq32xHLX0bz5Mnibv1/LHb3Sqzngu7xstSM+vrkE5Kzr9xE0yMByK5kMoTK30YVJE61WfbxIFFvfeDKT1w== | ||
dependencies: | ||
loose-envify "^1.1.0" | ||
object-assign "^4.1.1" | ||
prop-types "^15.6.2" | ||
|
||
react@^16.3.0, react@^16.8.0: | ||
version "16.8.6" | ||
resolved "https://registry.yarnpkg.com/react/-/react-16.8.6.tgz#ad6c3a9614fd3a4e9ef51117f54d888da01f2bbe" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I think that some sort of separator between these different parts would be nice. For example an
|
. If some of these parts happens to be empty or null, unnecessary|
should be avoided then (for example, filtering the parts as an array and then usejoin
).