-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: fix errors and add data owner on milestones (#808)
Co-authored-by: Noggling <[email protected]>
- Loading branch information
Showing
8 changed files
with
404 additions
and
176 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,5 @@ | ||
|
||
--- | ||
"fusion-project-portal": patch | ||
--- | ||
Fix errors and add data owner on milestones |
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
67 changes: 67 additions & 0 deletions
67
client/packages/portal-pages/src/pages/sheared/components/data-info/DataInfo.tsx
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,67 @@ | ||
import { Icon, Popover, Typography } from '@equinor/eds-core-react'; | ||
import { info_circle, title } from '@equinor/eds-icons'; | ||
import { tokens } from '@equinor/eds-tokens'; | ||
import { PersonCell } from '@equinor/fusion-react-person'; | ||
import { useRef, useState } from 'react'; | ||
import styled from 'styled-components'; | ||
|
||
type DataInfoProps = { | ||
title: string; | ||
dataSource: string; | ||
azureUniqueId?: string; | ||
access: 'Internal' | 'External' | 'Restricted'; | ||
}; | ||
|
||
const Style = { | ||
Content: styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
gap: 1rem; | ||
min-width: 200px; | ||
`, | ||
}; | ||
|
||
export const DataInfo = ({ dataSource, azureUniqueId, access, title }: DataInfoProps) => { | ||
const referenceElement = useRef<HTMLDivElement>(null); | ||
const [isOpen, setIsOpen] = useState(false); | ||
|
||
return ( | ||
<div | ||
onMouseOver={() => { | ||
setIsOpen(true); | ||
}} | ||
onMouseLeave={() => { | ||
setIsOpen(false); | ||
}} | ||
ref={referenceElement} | ||
> | ||
<Icon data={info_circle} color={tokens.colors.text.static_icons__tertiary.hex} /> | ||
<Popover placement="bottom" open={isOpen} anchorEl={referenceElement.current}> | ||
<Popover.Header>{title}</Popover.Header> | ||
<Popover.Content> | ||
<Style.Content> | ||
<div> | ||
<Typography variant="overline"> Data source:</Typography> | ||
<Typography variant="body_short"> | ||
<b>{dataSource}</b> | ||
</Typography> | ||
</div> | ||
<div> | ||
<Typography variant="overline"> Access:</Typography> | ||
<Typography variant="body_short"> | ||
<b>{access}</b> | ||
</Typography> | ||
</div> | ||
|
||
{azureUniqueId && ( | ||
<> | ||
<Typography variant="overline">Contact person</Typography> | ||
<PersonCell azureId={azureUniqueId} showAvatar subHeading={(u) => u.mail} /> | ||
</> | ||
)} | ||
</Style.Content> | ||
</Popover.Content> | ||
</Popover> | ||
</div> | ||
); | ||
}; |
Oops, something went wrong.