mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-09-26 00:48:12 +08:00
Add configurable about this dataset links (#907)
* add about arg * add simple url validator * attach about link to config api * add links to configDefaults * add conditional link in top left and menu item * whitespace * change to lower case * move --about arg before click.command() if this fixes it I have no idea why * change link>URL * be more descriptive about URL * Make error more explicit * refactor attach_data to accept about * format * change icon * add trailing parenthesis * whitespace
This commit is contained in:
@@ -7,15 +7,26 @@ import Logo from "../framework/logo";
|
||||
@connect(state => ({
|
||||
responsive: state.responsive,
|
||||
datasetTitle: state.config?.displayNames?.dataset ?? "",
|
||||
aboutURL: state.config?.links?.["about-dataset"],
|
||||
scatterplotXXaccessor: state.controls.scatterplotXXaccessor,
|
||||
scatterplotYYaccessor: state.controls.scatterplotYYaccessor
|
||||
}))
|
||||
class LeftSideBar extends React.Component {
|
||||
render() {
|
||||
const { datasetTitle } = this.props;
|
||||
const { datasetTitle, aboutURL } = this.props;
|
||||
|
||||
const paddingToAvoidScrollBar = 15;
|
||||
|
||||
const displayTitle =
|
||||
datasetTitle.length > globals.datasetTitleMaxCharacterCount
|
||||
? `${datasetTitle.substring(
|
||||
0,
|
||||
Math.floor(globals.datasetTitleMaxCharacterCount / 2)
|
||||
)}…${datasetTitle.slice(
|
||||
-Math.floor(globals.datasetTitleMaxCharacterCount / 2)
|
||||
)}`
|
||||
: datasetTitle;
|
||||
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
@@ -69,14 +80,7 @@ class LeftSideBar extends React.Component {
|
||||
}}
|
||||
title={datasetTitle}
|
||||
>
|
||||
{datasetTitle.length > globals.datasetTitleMaxCharacterCount
|
||||
? `${datasetTitle.substring(
|
||||
0,
|
||||
Math.floor(globals.datasetTitleMaxCharacterCount / 2)
|
||||
)}…${datasetTitle.slice(
|
||||
-Math.floor(globals.datasetTitleMaxCharacterCount / 2)
|
||||
)}`
|
||||
: datasetTitle}
|
||||
{aboutURL ? <a href={aboutURL}>{displayTitle}</a> : displayTitle}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user