-
Notifications
You must be signed in to change notification settings - Fork 15
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 dev/refactor-how-comments-are-stored
- Loading branch information
Showing
13 changed files
with
190 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import HelpOutlineIcon from '@mui/icons-material/HelpOutline' | ||
import { Button, Dialog, DialogActions, DialogContent, DialogTitle, IconButton, Tooltip } from '@mui/material' | ||
import { ReactNode, useState } from 'react' | ||
|
||
type HelpDialogProps = { | ||
title: string | ||
content: ReactNode | ||
} | ||
|
||
export default function HelpDialog({ title, content }: HelpDialogProps) { | ||
const [open, setOpen] = useState(false) | ||
|
||
return ( | ||
<> | ||
<Tooltip title={title}> | ||
<IconButton size='small' onClick={() => setOpen(true)}> | ||
<HelpOutlineIcon /> | ||
</IconButton> | ||
</Tooltip> | ||
<Dialog open={open} onClose={() => setOpen(false)} maxWidth='md' disableEscapeKeyDown> | ||
<DialogTitle>{title}</DialogTitle> | ||
<DialogContent>{content}</DialogContent> | ||
<DialogActions> | ||
<Button color='secondary' variant='outlined' onClick={() => setOpen(false)}> | ||
Close | ||
</Button> | ||
</DialogActions> | ||
</Dialog> | ||
</> | ||
) | ||
} |
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,89 @@ | ||
import { Box, Grid, Typography } from '@mui/material' | ||
import { Stack } from '@mui/system' | ||
import { useGetModelRoles } from 'actions/model' | ||
import { ReactNode, useCallback, useMemo } from 'react' | ||
import Loading from 'src/common/Loading' | ||
import MessageAlert from 'src/MessageAlert' | ||
import { EntryInterface, RoleKind } from 'types/types' | ||
import { toSentenceCase } from 'utils/stringUtils' | ||
|
||
interface EntryRolesInfoProps { | ||
entry: EntryInterface | ||
} | ||
|
||
export default function EntryRolesInfo({ entry }: EntryRolesInfoProps) { | ||
const { | ||
modelRoles: entryRoles, | ||
isModelRolesLoading: isEntryRolesLoading, | ||
isModelRolesError: isEntryRolesError, | ||
} = useGetModelRoles(entry.id) | ||
|
||
const getFilteredRoles = useCallback( | ||
(roleKind: string) => | ||
entryRoles.reduce<ReactNode[]>((filteredRoles, entryRole) => { | ||
if (entryRole.kind === roleKind) { | ||
filteredRoles.push( | ||
<Box key={entryRole.id}> | ||
<Typography fontWeight='bold'>{entryRole.name}</Typography> | ||
<Typography>{entryRole.description}</Typography> | ||
</Box>, | ||
) | ||
} | ||
return filteredRoles | ||
}, []), | ||
[entryRoles], | ||
) | ||
|
||
const entryRolesList = useMemo(() => getFilteredRoles(RoleKind.ENTRY), [getFilteredRoles]) | ||
const schemaRolesList = useMemo(() => getFilteredRoles(RoleKind.SCHEMA), [getFilteredRoles]) | ||
|
||
if (isEntryRolesError) { | ||
return <MessageAlert message={isEntryRolesError.info.message} severity='error' /> | ||
} | ||
|
||
return ( | ||
<> | ||
{isEntryRolesLoading && <Loading />} | ||
{!isEntryRolesLoading && ( | ||
<Stack spacing={2}> | ||
<Typography> | ||
Roles in Bailo are split into two categories; standard and dynamic. Standard roles are generic across | ||
different schema and are used for determining {`${toSentenceCase(entry.kind)}`} permissions for general | ||
purpose {`${toSentenceCase(entry.kind)}`} upkeep, whereas dynamic roles are created on a per schema basis | ||
and used as part of the review process. The dynamic roles presented below are specified on the schema | ||
selected for this {`${toSentenceCase(entry.kind)}`} and may not apply to other{' '} | ||
{`${toSentenceCase(entry.kind)}s`} using a different schema. | ||
</Typography> | ||
<Grid container spacing={1}> | ||
<Grid item xs={12} sm={6}> | ||
<Stack spacing={1}> | ||
<Box> | ||
<Typography component='h3' variant='h6' fontWeight='bold'> | ||
Standard Roles | ||
</Typography> | ||
<Typography variant='caption'> | ||
{`The following roles are generic across all ${toSentenceCase(entry.kind)}s`} | ||
</Typography> | ||
</Box> | ||
{entryRolesList} | ||
</Stack> | ||
</Grid> | ||
<Grid item xs={12} sm={6}> | ||
<Stack spacing={1}> | ||
<Box> | ||
<Typography component='h3' variant='h6' fontWeight='bold'> | ||
Dynamic Roles | ||
</Typography> | ||
<Typography variant='caption'> | ||
{`The following roles are specified by this ${toSentenceCase(entry.kind)}'s schema`} | ||
</Typography> | ||
</Box> | ||
{schemaRolesList} | ||
</Stack> | ||
</Grid> | ||
</Grid> | ||
</Stack> | ||
)} | ||
</> | ||
) | ||
} |
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
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 |
---|---|---|
|
@@ -178,15 +178,17 @@ minio: | |
# Registry Dependencies | ||
registry: | ||
repository: registry | ||
tag: 2 | ||
tag: 3.0.0-alpha.1 | ||
enabled: true | ||
protocol: "https" | ||
#host: "bailo-registry" # service name | ||
port: 5000 # default 5000 | ||
insecure: "true" | ||
certDir: "/certs" | ||
certFile: cert.pem #use san.cnf to create certs | ||
jwksFile: jwks.json | ||
keyFile: key.pem | ||
serviceAccount: '' | ||
|
||
# Nginx Dependencies | ||
nginxAuth: | ||
|
@@ -210,11 +212,6 @@ openshift: | |
|
||
# Instance Settings | ||
config: | ||
s2i: | ||
name: "seldonio - 1.10.0" | ||
image: seldonio/seldon-core-s2i-python37:1.10.0 | ||
supportEmail: "[email protected]" | ||
|
||
ui: | ||
banner: | ||
enabled: false | ||
|
@@ -231,9 +228,6 @@ config: | |
pass: "mailpass" | ||
from: "[email protected]" | ||
|
||
build: | ||
environment: img # 'img' for k8s | eks and 'openshfit' for openshift | ||
|
||
app: | ||
protocol: "https" | ||
port: 443 | ||
|
@@ -263,3 +257,6 @@ inference: | |
# Url for the inferencing cluster | ||
host: 'https://example.com' | ||
gpus: | ||
|
||
backend: | ||
serviceAccount: '' |