Skip to content

Commit

Permalink
fix: add time dimension metadata when opening ao (#36)
Browse files Browse the repository at this point in the history
Fixes TECH-1034

The time dimension names now update to the correct value when opening AOs. Also, in reducers/ui, I commented out the rest of scheduledDate for consistency.
  • Loading branch information
jenniferarnesen authored Mar 14, 2022
1 parent 9e57374 commit 6530511
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import {
visualizationNotFoundError,
} from '../modules/error.js'
import history from '../modules/history.js'
import { getDynamicTimeDimensionsMetadata } from '../modules/metadata.js'
import { getParentGraphMapFromVisualization } from '../modules/ui.js'
import { transformVisualization } from '../modules/visualization.js'
import { sGetCurrent } from '../reducers/current.js'
Expand Down Expand Up @@ -251,6 +252,7 @@ const App = ({
const metadata = {
[program.id]: program,
[programStage.id]: programStage,
...getDynamicTimeDimensionsMetadata(program, programStage),
}

addParentGraphMap(getParentGraphMapFromVisualization(visualization))
Expand Down
10 changes: 5 additions & 5 deletions src/reducers/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
DIMENSION_ID_EVENT_DATE,
DIMENSION_ID_ENROLLMENT_DATE,
DIMENSION_ID_INCIDENT_DATE,
DIMENSION_ID_SCHEDULED_DATE,
// DIMENSION_ID_SCHEDULED_DATE,
DIMENSION_ID_LAST_UPDATED,
DIMENSION_ID_EVENT_STATUS,
DIMENSION_ID_PROGRAM_STATUS,
Expand Down Expand Up @@ -418,9 +418,9 @@ export const useTimeDimensions = () => {
const incidentDateDim = useSelector((state) =>
sGetMetadataById(state, DIMENSION_ID_INCIDENT_DATE)
)
const scheduledDateDim = useSelector((state) =>
sGetMetadataById(state, DIMENSION_ID_SCHEDULED_DATE)
)
// const scheduledDateDim = useSelector((state) =>
// sGetMetadataById(state, DIMENSION_ID_SCHEDULED_DATE)
// )
const lastUpdatedDim = useSelector((state) =>
sGetMetadataById(state, DIMENSION_ID_LAST_UPDATED)
)
Expand Down Expand Up @@ -457,7 +457,7 @@ export const useTimeDimensions = () => {
eventDateDim,
enrollmentDateDim,
incidentDateDim,
scheduledDateDim,
// scheduledDateDim,
lastUpdatedDim,
])
}

0 comments on commit 6530511

Please sign in to comment.