-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: [DHIS2-17771] Org unit context in tables and lists (#3813)
* feat: update client to list converter * feat: changes in tooltip component * feat: add orgunit context stages and events widget * feat: use cache for subvalues * feat: orgunit context event workspace * fix: renaming of return statement
- Loading branch information
Showing
15 changed files
with
40 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 7 additions & 6 deletions
13
src/core_modules/capture-core/components/Tooltips/TooltipOrgUnit/TooltipOrgUnit.component.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
// @flow | ||
import React from 'react'; | ||
import { Tooltip } from '@dhis2/ui'; | ||
import { useOrgUnitNameWithAncestors } from '../../../metadataRetrieval/orgUnitName'; | ||
|
||
type Props = { | ||
orgUnitName: string, | ||
ancestors?: Array<string>, | ||
orgUnitId: string, | ||
}; | ||
|
||
export const TooltipOrgUnit = ({ orgUnitName, ancestors = [] }: Props) => { | ||
const fullPath = [...ancestors, orgUnitName].join(' / '); | ||
export const TooltipOrgUnit = ({ orgUnitId }: Props) => { | ||
const { displayName, ancestors = [] } = useOrgUnitNameWithAncestors(orgUnitId); | ||
const fullPath = [...ancestors, displayName].join(' / '); | ||
|
||
return ( | ||
<Tooltip content={fullPath} openDelay={400} maxWidth={900}> | ||
<span style={{ textDecoration: 'underline dotted' }}>{orgUnitName}</span> | ||
<Tooltip content={fullPath} openDelay={600} maxWidth={900}> | ||
<span style={{ textDecoration: 'underline dotted' }}>{displayName}</span> | ||
</Tooltip> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 0 additions & 19 deletions
19
...ture-core/components/WidgetTwoEventWorkspace/FlatListOrgUnitField/FlatListOrgUnitField.js
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
...ore_modules/capture-core/components/WidgetTwoEventWorkspace/FlatListOrgUnitField/index.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters