Skip to content

Commit

Permalink
Merge pull request #329 from UrbanOS-Public/1143-remove-plotly-link
Browse files Browse the repository at this point in the history
Conditionally removing the plotly help link
  • Loading branch information
RyanRConaway authored Apr 20, 2023
2 parents cadc15c + 2d8b533 commit baf50f5
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@smartcitiesdata/react-discovery-ui",
"version": "2.1.34",
"version": "2.1.35",
"description": "React component for dataset discovery UI",
"main": "./lib/ReactDiscoveryUI.js",
"repository": {
Expand Down
5 changes: 4 additions & 1 deletion src/pages/dataset-view/dataset-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ export default class extends Component {
{this.isNotDatasetDetailsTab() &&
<>
<a className='helpLink primary-color' target='_blank' href='https://en.wikipedia.org/wiki/SQL_syntax'>SQL Help&nbsp;&nbsp;</a>
<a className='helpLink primary-color' target='_blank' href='https://plotly.com/chart-studio-help/tutorials/#basic'>Plot.ly Help</a>
{this.isVisualizationEnabled() &&
<a id='plotlyhelp' className='helpLink primary-color' target='_blank' href='https://plotly.com/chart-studio-help/tutorials/#basic'>Plot.ly Help</a>
}

</>}
</span>
{this.isNotDatasetDetailsTab() &&
Expand Down
7 changes: 6 additions & 1 deletion src/pages/dataset-view/dataset-view.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { shallow } from 'enzyme'
import { Tab, TabPanel } from 'react-tabs'
import { Tab, TabPanel, TabList } from 'react-tabs'

import DatasetView from './dataset-view'
import QueryView from '../query-view'
Expand Down Expand Up @@ -82,6 +82,11 @@ describe('Visualizations when DISABLE_VISUALIZATIONS is true', () => {
it('does not have the visualizations view', () => {
expect(subject.find(ChartView).length).toEqual(0)
})
it('does not have the plot.ly help link', () => {
subject.setState({ index: 1 })
const test = subject.find('#plotlyhelp')
expect(test.length).toEqual(0)
})
})

describe('dataset view when dataset is not loaded', () => {
Expand Down

0 comments on commit baf50f5

Please sign in to comment.