Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions packages/client/src/components/app/ChangeAccessModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import {
import { Control, Controller } from 'react-hook-form';
import { HdrAuto, Edit, Visibility } from '@mui/icons-material';
import { AppDetailsFormTypes } from './app-details.utility';
import { PERMISSION_DESCRIPTION_MAP } from '../settings/member-permissions.constants';

import { PERMISSION_DESCRIPTION_MAP } from '@/constants';
import { useRootStore } from '@/hooks';

const StyledContentBox = styled(Stack)(({ theme }) => ({
Expand Down Expand Up @@ -56,7 +57,7 @@ interface ChangeAccessModalProps {

export const ChangeAccessModal = (props: ChangeAccessModalProps) => {
const { open, onClose, control, getValues } = props;
const permissionDescriptions = PERMISSION_DESCRIPTION_MAP['app'];
const permissionDescriptions = PERMISSION_DESCRIPTION_MAP['APP'];

const { monolithStore } = useRootStore();
const notification = useNotification();
Expand Down
7 changes: 2 additions & 5 deletions packages/client/src/components/engine/EditEngineDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ const StyledEditorContainer = styled('div')(({ theme }) => ({
}));

interface EditEngineDetailsProps {
/** Type of Engine */
type: string;

/** Track if the edit is open */
open: boolean;

Expand All @@ -37,7 +34,7 @@ interface EditEngineDetailsProps {
* Wrap the Engine routes and provide styling/functionality
*/
export const EditEngineDetails = observer((props: EditEngineDetailsProps) => {
const { open = false, type, onClose = () => null, values = {} } = props;
const { open = false, onClose = () => null, values = {} } = props;

// get the notification
const notification = useNotification();
Expand All @@ -54,7 +51,7 @@ export const EditEngineDetails = observer((props: EditEngineDetailsProps) => {
);

// get the engine information
const { id } = useEngine();
const { id, type } = useEngine();

// track the options
const [filterOptions, setFilterOptions] = useState<
Expand Down
29 changes: 9 additions & 20 deletions packages/client/src/components/engine/EngineAccessButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,17 @@ import {
TextArea,
} from '@semoss/ui';
import { EditRounded, RemoveRedEyeRounded, Add } from '@mui/icons-material';
import { PERMISSION_DESCRIPTION_MAP } from '@/components/settings/member-permissions.constants';

import { Role } from '@/types';
import { useRootStore, useEngine } from '@/hooks';
import { PERMISSION_DESCRIPTION_MAP } from '@/constants';

const StyledCard = styled(Card)({
borderRadius: '12px',
});

interface EngineAccessButtonProps {
/**
* Model, Vector, Storage, Database, Function
*/
name: string;
}

export const EngineAccessButton = (props: EngineAccessButtonProps) => {
const { name } = props;
const { id, role } = useEngine();
export const EngineAccessButton = () => {
const { id, type, role } = useEngine();

const { monolithStore } = useRootStore();
const notification = useNotification();
Expand Down Expand Up @@ -155,9 +147,8 @@ export const EngineAccessButton = (props: EngineAccessButtonProps) => {
subheader={
<Box sx={{ marginLeft: '30px' }}>
{
PERMISSION_DESCRIPTION_MAP[
name.toLowerCase()
]?.author
PERMISSION_DESCRIPTION_MAP[type]
.author
}
</Box>
}
Expand Down Expand Up @@ -198,9 +189,8 @@ export const EngineAccessButton = (props: EngineAccessButtonProps) => {
subheader={
<Box sx={{ marginLeft: '30px' }}>
{
PERMISSION_DESCRIPTION_MAP[
name.toLowerCase()
]?.editor
PERMISSION_DESCRIPTION_MAP[type]
.editor
}
</Box>
}
Expand Down Expand Up @@ -241,9 +231,8 @@ export const EngineAccessButton = (props: EngineAccessButtonProps) => {
subheader={
<Box sx={{ marginLeft: '30px' }}>
{
PERMISSION_DESCRIPTION_MAP[
name.toLowerCase()
]?.readonly
PERMISSION_DESCRIPTION_MAP[type]
.readonly
}
</Box>
}
Expand Down
3 changes: 1 addition & 2 deletions packages/client/src/components/engine/EngineShell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ export const EngineShell = (props: EngineShellProps) => {
</Typography>
<Stack flex={1}> &nbsp;</Stack>
<Stack direction="row">
<EngineAccessButton name={name} />
<EngineAccessButton />
{role === 'OWNER' && (
<Button
disabled={exportLoading}
Expand All @@ -177,7 +177,6 @@ export const EngineShell = (props: EngineShellProps) => {
<>
{edit && (
<EditEngineDetails
type={type}
values={metaVals}
open={edit}
onClose={(success) => {
Expand Down
Loading