Skip to content

Commit

Permalink
chore: remove old single value code (#1703)
Browse files Browse the repository at this point in the history
* chore: remove old code

* chore: adjust story and remove imports for deleted files
  • Loading branch information
HendrikThePendric authored Oct 22, 2024
1 parent fa6f221 commit 2cb6b56
Show file tree
Hide file tree
Showing 19 changed files with 1 addition and 997 deletions.
40 changes: 1 addition & 39 deletions src/__demo__/SingleValue.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -629,9 +629,7 @@ const indicatorTypes = ['plain', 'percent', 'subtext']

storiesOf('SingleValue', module).add('default', () => {
const newChartRef = useRef(null)
const oldContainerRef = useRef(null)
const newContainerRef = useRef(null)
const [transpose, setTranspose] = useState(false)
const [dashboard, setDashboard] = useState(false)
const [showIcon, setShowIcon] = useState(true)
const [indicatorType, setIndicatorType] = useState('subtext')
Expand All @@ -647,7 +645,7 @@ storiesOf('SingleValue', module).add('default', () => {
[width, height]
)
useEffect(() => {
if (oldContainerRef.current && newContainerRef.current) {
if (newContainerRef.current) {
requestAnimationFrame(() => {
const extraOptions = {
...baseExtraOptions,
Expand All @@ -668,15 +666,6 @@ storiesOf('SingleValue', module).add('default', () => {
dataObj.metaData.items.FnYCr2EAzWS.indicatorType =
subtextIndicatorType
}
createVisualization(
[dataObj],
layout,
oldContainerRef.current,
extraOptions,
undefined,
undefined,
'dhis'
)
const newVisualization = createVisualization(
[dataObj],
layout,
Expand Down Expand Up @@ -799,35 +788,8 @@ storiesOf('SingleValue', module).add('default', () => {
 Export as PDF
</label>
<button onClick={downloadOffline}>Download offline</button>
<button
onClick={() => {
setTranspose(!transpose)
}}
>
{transpose ? 'Show side by side' : 'Transpose old and new'}
</button>
</div>
<div style={{ display: 'flex', gap: 12 }}>
<div
style={
transpose
? {
...containerStyle,
...{
opacity: 0.45,
transform: `translateX(${width + 10}px)`,
zIndex: 10,
backgroundColor: 'purple',
},
}
: containerStyle
}
>
<div
ref={oldContainerRef}
style={innerContainerStyle}
></div>
</div>
<div style={containerStyle}>
<div
ref={newContainerRef}
Expand Down
38 changes: 0 additions & 38 deletions src/visualizations/config/adapters/dhis_dhis/index.js

This file was deleted.

This file was deleted.

This file was deleted.

33 changes: 0 additions & 33 deletions src/visualizations/config/adapters/dhis_dhis/subtitle/index.js

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

30 changes: 0 additions & 30 deletions src/visualizations/config/adapters/dhis_dhis/title/index.js

This file was deleted.

15 changes: 0 additions & 15 deletions src/visualizations/config/adapters/dhis_dhis/title/singleValue.js

This file was deleted.

10 changes: 0 additions & 10 deletions src/visualizations/config/adapters/dhis_dhis/type.js

This file was deleted.

22 changes: 0 additions & 22 deletions src/visualizations/config/adapters/dhis_dhis/value/index.js

This file was deleted.

2 changes: 0 additions & 2 deletions src/visualizations/config/adapters/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import dhis_dhis from './dhis_dhis/index.js'
import dhis_highcharts from './dhis_highcharts/index.js'

export default {
dhis_highcharts,
dhis_dhis,
}
Loading

0 comments on commit 2cb6b56

Please sign in to comment.