-
-
Notifications
You must be signed in to change notification settings - Fork 55
[WEB-3071] smart-on-fhir launch endpoint #1531
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from 28 commits
cc04acc
867ef6b
63206c6
261a2a0
d0103b8
7f8724c
d324312
839d14e
3a0cedf
40d015b
0879486
5fb5ba2
150041d
082d3a5
21da3c7
425342d
79c850a
b30ea8f
0919e8c
f39f1dc
46efd8a
71d0b74
e9f6fd1
2ed4a23
a13a432
e21e647
25beeaf
5c448fc
25e5d11
58799d6
abed6b5
5b76100
e8b4079
a75d74d
44a9540
54acddc
aac9bd3
2066f68
dd558e9
9b80f91
ac68090
0a563c2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,7 @@ import Popover from '../elements/Popover'; | |
import { colors } from '../../themes/baseTheme'; | ||
|
||
export const WorkspaceSwitcher = props => { | ||
const { t, api, trackMetric } = props; | ||
const { t, api, trackMetric, isSmartOnFhirMode } = props; | ||
|
||
const dispatch = useDispatch(); | ||
const loggedInUserId = useSelector((state) => state.blip.loggedInUserId); | ||
const allUsersMap = useSelector((state) => state.blip.allUsersMap); | ||
|
@@ -88,81 +88,88 @@ export const WorkspaceSwitcher = props => { | |
|
||
return menuOptions.length ? ( | ||
<Flex id='workspace-switcher' sx={{ justifyContent: ['center', 'flex-start', 'center'] }}> | ||
{menuOptions.length > 1 && ( | ||
{isSmartOnFhirMode ? ( | ||
<Text fontSize={2} color="text.primary">{selectedClinic?.label}</Text> | ||
) : ( | ||
<> | ||
<Button | ||
id="workspace-switcher-current" | ||
variant="textPrimary" | ||
color="text.primary" | ||
{...bindTrigger(popupState)} | ||
icon={KeyboardArrowDownRoundedIcon} | ||
iconLabel={t('Open navigation menu')} | ||
sx={{ | ||
fontSize: 2, | ||
'&:hover': { | ||
color: colors.purpleDark, | ||
}, | ||
}} | ||
> | ||
{selectedClinic?.label} | ||
</Button> | ||
|
||
<Popover | ||
minWidth="15em" | ||
anchorOrigin={{ | ||
vertical: 'bottom', | ||
horizontal: 'center', | ||
}} | ||
transformOrigin={{ | ||
vertical: 'top', | ||
horizontal: 'center', | ||
}} | ||
{...bindPopover(popupState)} | ||
> | ||
<Box py={2}> | ||
{map(menuOptions, (option, key) => ( | ||
<Button | ||
className="workspace-option" | ||
variant="textPrimary" | ||
color="text.primary" | ||
pt={2} | ||
pb={3} | ||
px={3} | ||
key={key} | ||
icon={option.id === selectedClinic?.id ? CheckRoundedIcon : null} | ||
iconLabel={t('Selected')} | ||
onClick={() => handleSelect(option)} | ||
sx={{ | ||
width: '100%', | ||
fontSize: 2, | ||
justifyContent: 'space-between', | ||
'&:hover': { | ||
color: colors.purpleDark, | ||
}, | ||
'&:last-child': { | ||
pb: 2, | ||
}, | ||
textAlign: 'left', | ||
}} | ||
> | ||
{option.label} | ||
</Button> | ||
))} | ||
</Box> | ||
</Popover> | ||
{menuOptions.length > 1 && ( | ||
<> | ||
<Button | ||
id="workspace-switcher-current" | ||
variant="textPrimary" | ||
color="text.primary" | ||
{...bindTrigger(popupState)} | ||
icon={KeyboardArrowDownRoundedIcon} | ||
iconLabel={t('Open navigation menu')} | ||
sx={{ | ||
fontSize: 2, | ||
'&:hover': { | ||
color: colors.purpleDark, | ||
}, | ||
}} | ||
> | ||
{selectedClinic?.label} | ||
</Button> | ||
|
||
<Popover | ||
minWidth="15em" | ||
anchorOrigin={{ | ||
vertical: 'bottom', | ||
horizontal: 'center', | ||
}} | ||
transformOrigin={{ | ||
vertical: 'top', | ||
horizontal: 'center', | ||
}} | ||
{...bindPopover(popupState)} | ||
> | ||
<Box py={2}> | ||
{map(menuOptions, (option, key) => ( | ||
<Button | ||
className="workspace-option" | ||
variant="textPrimary" | ||
color="text.primary" | ||
pt={2} | ||
pb={3} | ||
px={3} | ||
key={key} | ||
icon={option.id === selectedClinic?.id ? CheckRoundedIcon : null} | ||
iconLabel={t('Selected')} | ||
onClick={() => handleSelect(option)} | ||
sx={{ | ||
width: '100%', | ||
fontSize: 2, | ||
justifyContent: 'space-between', | ||
'&:hover': { | ||
color: colors.purpleDark, | ||
}, | ||
'&:last-child': { | ||
pb: 2, | ||
}, | ||
textAlign: 'left', | ||
}} | ||
> | ||
{option.label} | ||
</Button> | ||
))} | ||
</Box> | ||
</Popover> | ||
</> | ||
)} | ||
|
||
{menuOptions.length === 1 && ( | ||
<Text fontSize={2} color="text.primary">{selectedClinic?.label}</Text> | ||
)} | ||
</> | ||
)} | ||
|
||
{menuOptions.length === 1 && ( | ||
<Text fontSize={2} color="text.primary">{selectedClinic?.label}</Text> | ||
)} | ||
</Flex> | ||
) : null; | ||
}; | ||
|
||
WorkspaceSwitcher.propTypes = { | ||
api: PropTypes.object.isRequired, | ||
trackMetric: PropTypes.func.isRequired, | ||
isSmartOnFhirMode: PropTypes.bool, | ||
}; | ||
|
||
export default withTranslation()(WorkspaceSwitcher); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PropTypes Consistency Issue
Inconsistent PropTypes declarations across chart components. Some mark
isSmartOnFhirMode
asisRequired
while others don't for the same prop. Consider standardizing this - if the prop is always passed down, it should consistently be marked asisRequired
.Also appears in:
app/components/chart/daily.js
,app/components/chart/trends.js
, etc.