diff --git a/frontend/src/component/project/Project/ProjectFeatureToggles/ActionsCell/ActionsCell.tsx b/frontend/src/component/project/Project/ProjectFeatureToggles/ActionsCell/ActionsCell.tsx index 2631c9286f..23cccf5da6 100644 --- a/frontend/src/component/project/Project/ProjectFeatureToggles/ActionsCell/ActionsCell.tsx +++ b/frontend/src/component/project/Project/ProjectFeatureToggles/ActionsCell/ActionsCell.tsx @@ -87,7 +87,7 @@ export const ActionsCell: VFC = ({ disableScrollLock={true} PaperProps={{ sx: theme => ({ - borderRadius: theme.shape.borderRadius, + borderRadius: `${theme.shape.borderRadius}px`, padding: theme.spacing(1, 1.5), }), }} diff --git a/frontend/src/component/project/Project/ProjectFeatureToggles/SelectionActionsBar/MoreActions/MoreActions.tsx b/frontend/src/component/project/Project/ProjectFeatureToggles/SelectionActionsBar/MoreActions/MoreActions.tsx index 86b3a62f93..429efebb69 100644 --- a/frontend/src/component/project/Project/ProjectFeatureToggles/SelectionActionsBar/MoreActions/MoreActions.tsx +++ b/frontend/src/component/project/Project/ProjectFeatureToggles/SelectionActionsBar/MoreActions/MoreActions.tsx @@ -12,14 +12,17 @@ import { import { PermissionHOC } from 'component/common/PermissionHOC/PermissionHOC'; import { UPDATE_FEATURE } from 'component/providers/AccessProvider/permissions'; import { MoreVert, WatchLater } from '@mui/icons-material'; +import type { FeatureSchema } from 'openapi'; +import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; interface IMoreActionsProps { projectId: string; + data: FeatureSchema[]; } const menuId = 'selection-actions-menu'; -export const MoreActions: VFC = ({ projectId }) => { +export const MoreActions: VFC = ({ projectId, data }) => { const [anchorEl, setAnchorEl] = useState(null); const open = Boolean(anchorEl); const handleClick = (event: React.MouseEvent) => { @@ -29,6 +32,21 @@ export const MoreActions: VFC = ({ projectId }) => { setAnchorEl(null); }; + const hasStale = data.some(({ stale }) => stale === true); + const hasUnstale = data.some(({ stale }) => stale === false); + + const onMarkAsStale = () => { + console.log('Mark as stale'); + // TODO: Implement + handleClose(); + }; + + const onUnmarkAsStale = () => { + console.log('Un-mark as stale'); + // TODO: Implement + handleClose(); + }; + return ( <> @@ -53,7 +71,7 @@ export const MoreActions: VFC = ({ projectId }) => { disableScrollLock={true} PaperProps={{ sx: theme => ({ - borderRadius: theme.shape.borderRadius, + borderRadius: `${theme.shape.borderRadius}px`, padding: theme.spacing(1, 1.5), }), }} @@ -65,46 +83,45 @@ export const MoreActions: VFC = ({ projectId }) => { > {({ hasAccess }) => ( <> - { - // handleClose(); - // onOpenStaleDialog({ - // featureId, - // stale: stale === true, - // }); - // }} - disabled={!hasAccess} - > - - - - - - Mark as stale - - - - { - // handleClose(); - // onOpenStaleDialog({ - // featureId, - // stale: stale === true, - // }); - // }} - disabled={!hasAccess} - > - - - - - - Un-mark as stale - - - + ( + `${theme.shape.borderRadius}px` }} + + > + + + + + + Mark as stale + + + + )} + /> + ( + `${theme.shape.borderRadius}px` }} + > + + + + + + Un-mark as stale + + + + )} + /> )} diff --git a/frontend/src/component/project/Project/ProjectFeatureToggles/SelectionActionsBar/SelectionActionsBar.tsx b/frontend/src/component/project/Project/ProjectFeatureToggles/SelectionActionsBar/SelectionActionsBar.tsx index afd0494cf3..31b1a5fb14 100644 --- a/frontend/src/component/project/Project/ProjectFeatureToggles/SelectionActionsBar/SelectionActionsBar.tsx +++ b/frontend/src/component/project/Project/ProjectFeatureToggles/SelectionActionsBar/SelectionActionsBar.tsx @@ -92,7 +92,7 @@ export const SelectionActionsBar: VFC = ({ > Tags - +