forked from data-dot-all/dataall
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into data-dot-allgh-1301-bulk-share-reapply
Merging with O.S. data.all
- Loading branch information
Showing
30 changed files
with
1,252 additions
and
880 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,4 @@ python-jose==3.3.0 | |
requests==2.32.2 | ||
rsa==4.9 | ||
six==1.16.0 | ||
urllib3==1.26.18 | ||
urllib3==1.26.19 |
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,72 @@ | ||
import VerifiedUserOutlinedIcon from '@mui/icons-material/VerifiedUserOutlined'; | ||
import GppBadOutlinedIcon from '@mui/icons-material/GppBadOutlined'; | ||
import PendingOutlinedIcon from '@mui/icons-material/PendingOutlined'; | ||
import DangerousOutlinedIcon from '@mui/icons-material/DangerousOutlined'; | ||
import * as PropTypes from 'prop-types'; | ||
import { Typography } from '@mui/material'; | ||
import { Label } from './Label'; | ||
|
||
export const ShareHealthStatus = (props) => { | ||
const { status, healthStatus, lastVerificationTime } = props; | ||
|
||
const isShared = ['Revoke_Failed', 'Share_Succeeded'].includes(status); | ||
const isHealthPending = ['PendingReApply', 'PendingVerify', null].includes( | ||
healthStatus | ||
); | ||
const setStatus = () => { | ||
if (!healthStatus) return 'Undefined'; | ||
return healthStatus; | ||
}; | ||
|
||
const setColor = () => { | ||
if (!healthStatus) return 'info'; | ||
if (['Healthy'].includes(healthStatus)) return 'success'; | ||
if (['Unhealthy'].includes(healthStatus)) return 'error'; | ||
if (isHealthPending) return 'warning'; | ||
return 'info'; | ||
}; | ||
|
||
const setIcon = () => { | ||
if (!healthStatus) return <DangerousOutlinedIcon color={setColor()} />; | ||
if (['Healthy'].includes(healthStatus)) | ||
return <VerifiedUserOutlinedIcon color={setColor()} />; | ||
if (['Unhealthy'].includes(healthStatus)) | ||
return <GppBadOutlinedIcon color={setColor()} />; | ||
if (['PendingReApply', 'PendingVerify'].includes(healthStatus)) | ||
return <PendingOutlinedIcon color={setColor()} />; | ||
return <DangerousOutlinedIcon color={setColor()} />; | ||
}; | ||
|
||
if (!isShared) { | ||
return ( | ||
<Typography color="textSecondary" variant="subtitle2"> | ||
{'Item is not Shared'} | ||
</Typography> | ||
); | ||
} | ||
|
||
return ( | ||
<div style={{ display: 'flex', alignItems: 'left' }}> | ||
{setIcon()} | ||
<Label color={setColor()}>{setStatus().toUpperCase()} </Label> | ||
{!isHealthPending && ( | ||
<Typography color="textSecondary" variant="subtitle2" noWrap> | ||
{(lastVerificationTime && | ||
'(' + | ||
lastVerificationTime.substring( | ||
0, | ||
lastVerificationTime.indexOf('.') | ||
) + | ||
')') || | ||
''} | ||
</Typography> | ||
)} | ||
</div> | ||
); | ||
}; | ||
|
||
ShareHealthStatus.propTypes = { | ||
status: PropTypes.string.isRequired, | ||
healthStatus: PropTypes.string, | ||
lastVerificationTime: PropTypes.string | ||
}; |
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
Oops, something went wrong.