diff --git a/frontend/src/component/feature/FeatureToggleList/FeatureToggleListItem/FeatureToggleListItem.jsx b/frontend/src/component/feature/FeatureToggleList/FeatureToggleListItem/FeatureToggleListItem.jsx index f839695d36..87e442ec42 100644 --- a/frontend/src/component/feature/FeatureToggleList/FeatureToggleListItem/FeatureToggleListItem.jsx +++ b/frontend/src/component/feature/FeatureToggleList/FeatureToggleListItem/FeatureToggleListItem.jsx @@ -32,13 +32,25 @@ const FeatureToggleListItem = ({ }) => { const styles = useStyles(); - // const {projects} = useProjects() + const { projects } = useProjects(); const isArchive = !!revive; const { name, description, type, stale, createdAt, project, lastSeenAt } = feature; - // let obj = projects.find(project => project.id === 'projectId'); + const isProjectDeleted = () => { + let projectExist = projects.find(proj => proj.id === project); + if (projectExist) { + return true; + } + return false; + }; + + const reviveFeature = () => { + if (isProjectDeleted()) { + revive(feature.name); + } + }; return ( @@ -129,7 +144,10 @@ const FeatureToggleListItem = ({ console.log('ho')}> + } diff --git a/frontend/src/component/feature/FeatureToggleList/FeatureToggleListItem/styles.js b/frontend/src/component/feature/FeatureToggleList/FeatureToggleListItem/styles.js index 8519c95cf3..68cc624d86 100644 --- a/frontend/src/component/feature/FeatureToggleList/FeatureToggleListItem/styles.js +++ b/frontend/src/component/feature/FeatureToggleList/FeatureToggleListItem/styles.js @@ -29,4 +29,7 @@ export const useStyles = makeStyles(theme => ({ listItemStrategies: { marginLeft: 'auto', }, + disabledLink:{ + pointerEvents: 'none' + }, }));