Skip to content

Commit

Permalink
put vis tool button behind flag (#3376)
Browse files Browse the repository at this point in the history
  • Loading branch information
chejennifer authored Sep 1, 2023
1 parent ce1120e commit ff96847
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 11 deletions.
3 changes: 2 additions & 1 deletion server/app_env/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@

class Config(_base.Config):
GA_ACCOUNT = 'G-KWSES5WXZE'
HIDE_REVAMP_CHANGES = True
HIDE_REVAMP_CHANGES = True
LOGO_PATH = '/images/dc-logo-old.svg'
3 changes: 2 additions & 1 deletion server/app_env/staging.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@

class Config(_base.Config):
GA_ACCOUNT = 'G-HV2XYYS1JD'
HIDE_REVAMP_CHANGES = True
HIDE_REVAMP_CHANGES = True
LOGO_PATH = '/images/dc-logo-old.svg'
1 change: 1 addition & 0 deletions server/templates/tools/map.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
{% endblock %}

{% block content %}
<div id="metadata" class="d-none" data-hide-vis-link="{{ config['HIDE_REVAMP_CHANGES'] }}"></div>
<div id="main-pane"></div>
<script>
infoConfig = {{info_json|tojson|safe}};
Expand Down
1 change: 1 addition & 0 deletions server/templates/tools/scatter.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
{% endblock %}

{% block content %}
<div id="metadata" class="d-none" data-hide-vis-link="{{ config['HIDE_REVAMP_CHANGES'] }}"></div>
<div id="main-pane"></div>
<script>
infoConfig = {{info_json|tojson|safe}};
Expand Down
1 change: 1 addition & 0 deletions server/templates/tools/timeline.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
{% endblock %}

{% block content %}
<div id="metadata" class="d-none" data-hide-vis-link="{{ config['HIDE_REVAMP_CHANGES'] }}"></div>
<div id="main-pane"></div>
<script>
infoConfig = {{info_json|tojson|safe}};
Expand Down
9 changes: 9 additions & 0 deletions static/images/dc-logo-old.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 7 additions & 3 deletions static/js/tools/map/title.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,19 @@ import { ifShowChart } from "./util";

export function Title(): JSX.Element {
const { statVar, placeInfo } = useContext(Context);
const hideVisLink =
document.getElementById("metadata")?.dataset?.hideVisLink === "True";

return (
<>
{!ifShowChart(statVar.value, placeInfo.value) && (
<div className="app-header">
<h1 className="mb-4">Map Explorer</h1>
<a href="/tools/visualization#visType%3Dmap">
Go back to the new Data Commons
</a>
{!hideVisLink && (
<a href="/tools/visualization#visType%3Dmap">
Go back to the new Data Commons
</a>
)}
</div>
)}
</>
Expand Down
10 changes: 7 additions & 3 deletions static/js/tools/scatter/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ function App(): JSX.Element {
const showInfo = !showChart && !showChooseStatVarMessage;
const [isSvModalOpen, updateSvModalOpen] = useState(false);
const toggleSvModalCallback = () => updateSvModalOpen(!isSvModalOpen);
const hideVisLink =
document.getElementById("metadata")?.dataset?.hideVisLink === "True";
return (
<>
<StatVarChooser
Expand All @@ -63,9 +65,11 @@ function App(): JSX.Element {
<Row>
<div className="app-header">
<h1 className="mb-4">Scatter Plot Explorer</h1>
<a href="/tools/visualization#visType%3Dscatter">
Go back to the new Data Commons
</a>
{!hideVisLink && (
<a href="/tools/visualization#visType%3Dscatter">
Go back to the new Data Commons
</a>
)}
</div>
</Row>
)}
Expand Down
10 changes: 7 additions & 3 deletions static/js/tools/timeline/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ class Page extends Component<unknown, PageStateType> {
svToSvInfo[sv] =
sv in this.state.statVarInfo ? this.state.statVarInfo[sv] : {};
}
const hideVisLink =
document.getElementById("metadata")?.dataset?.hideVisLink === "True";

return (
<>
Expand All @@ -177,9 +179,11 @@ class Page extends Component<unknown, PageStateType> {
{numPlaces === 0 && (
<div className="app-header">
<h1 className="mb-4">Timelines Explorer</h1>
<a href="/tools/visualization#visType%3Dtimeline">
Go back to the new Data Commons
</a>
{!hideVisLink && (
<a href="/tools/visualization#visType%3Dtimeline">
Go back to the new Data Commons
</a>
)}
</div>
)}
<Card id="place-search">
Expand Down

0 comments on commit ff96847

Please sign in to comment.