-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(feat) adding support for questionInfo (#152)
* MVP * Tests added * cleanup * UI update for symmetry * refactor on section and obs group component
- Loading branch information
Showing
9 changed files
with
152 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"name": "Field tester", | ||
"pages": [ | ||
{ | ||
"label": "One", | ||
"sections": [ | ||
{ | ||
"label": "Sec One", | ||
"isExpanded": "true", | ||
"questions": [ | ||
{ | ||
"label": "Text question", | ||
"type": "obs", | ||
"required": false, | ||
"id": "id_text", | ||
"questionInfo":"sample tooltip info for text", | ||
"questionOptions": { | ||
"rendering": "text", | ||
"concept": "928def39-33c1-4ddb-8430-165db28448c8", | ||
"conceptMappings": [], | ||
"answers": [] | ||
}, | ||
"validators": [] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
], | ||
"processor": "EncounterFormProcessor", | ||
"encounterType": "e22e39fd-7db2-45e7-80f1-60fa0d5a4378", | ||
"referencedForms": [], | ||
"uuid": "0859d9ad-2ed4-48db-96eb-7b0ce0c9903e", | ||
"description": "A form containing most fields, to be used for testing purposes", | ||
"version": "1.0" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.tooltip{ | ||
border: none; | ||
background-color: #f4f4f4; | ||
z-index: 999; | ||
margin-top: 0.25rem; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import React from 'react'; | ||
import { Tooltip } from '@carbon/react'; | ||
import { Information } from '@carbon/react/icons'; | ||
import styles from './ohri-tooltip.scss'; | ||
import { OHRIFormField } from '../../../api/types'; | ||
|
||
interface OHRITooltipProps { | ||
field: OHRIFormField; | ||
} | ||
|
||
export const OHRITooltip: React.FC<OHRITooltipProps> = ({ field }) => { | ||
return ( | ||
<span> | ||
<Tooltip align="right" label={field.questionInfo} description={field.questionInfo}> | ||
<button className={styles.tooltip} type="button" data-testid={field.id}> | ||
<Information /> | ||
</button> | ||
</Tooltip> | ||
</span> | ||
); | ||
}; |
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