Skip to content

Commit fd47628

Browse files
author
Alexandra Shubenko
committed
testing customTitle in cite
1 parent 9cf647f commit fd47628

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

vis/js/reducers/heading.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ const context = (state = {}, action) => {
1616
? action.contextObject.params.project_id
1717
: undefined,
1818
presetTitle: action.configObject.title,
19-
titleStyle: getTitleStyle(action.configObject),
19+
// Todo: set titleStyle = "custom" if custom_title exists
20+
titleStyle: action.contextObject.params.custom_title ? 'custom' : getTitleStyle(action.configObject),
2021
titleLabelType: getTitleLabelType(action.configObject),
2122
customTitle: action.configObject.custom_title ? action.configObject.custom_title : action.contextObject.params.custom_title,
2223
};
@@ -26,11 +27,11 @@ const context = (state = {}, action) => {
2627
};
2728

2829
const getTitleStyle = (config) => {
30+
2931
if (config.create_title_from_context) {
3032
if (config.create_title_from_context_style) {
3133
return config.create_title_from_context_style;
3234
}
33-
3435
return "standard";
3536
}
3637

vis/js/templates/modals/CitationModal.jsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,7 @@ const mapStateToProps = (state) => ({
9292
isStreamgraph: state.chartType === STREAMGRAPH_MODE,
9393
query: state.query.text,
9494
customTitle:
95-
// state.heading.titleStyle === "custom" ? state.heading.customTitle : null,
96-
state.heading.customTitle,
95+
state.heading.titleStyle === "custom" ? state.heading.customTitle : null,
9796
timestamp: state.misc.timestamp,
9897
q_advanced: state.q_advanced.text,
9998
titleStyle: state.heading.titleStyle

0 commit comments

Comments
 (0)