diff --git a/opencti-platform/opencti-front/src/private/components/data/feeds/FeedCreation.tsx b/opencti-platform/opencti-front/src/private/components/data/feeds/FeedCreation.tsx index ff5642f1acbe4..7360d66ff5cfc 100644 --- a/opencti-platform/opencti-front/src/private/components/data/feeds/FeedCreation.tsx +++ b/opencti-platform/opencti-front/src/private/components/data/feeds/FeedCreation.tsx @@ -141,7 +141,10 @@ interface FeedAddInput { } interface FeedCreationFormProps { - paginationOptions: PaginationOptions + paginationOptions: PaginationOptions; + open: boolean; + isDuplicated: boolean; + onDrawerClose: () => void; } const feedCreationValidation = (t_i18n: (s: string) => string) => Yup.object().shape({ @@ -154,7 +157,7 @@ const feedCreationValidation = (t_i18n: (s: string) => string) => Yup.object().s }); const FeedCreation: FunctionComponent = (props) => { - const { paginationOptions } = props; + const { onDrawerClose, open, paginationOptions, isDuplicated } = props; const classes = useStyles(); const { t_i18n } = useFormatter(); const [selectedTypes, setSelectedTypes] = useState([]); @@ -173,6 +176,9 @@ const FeedCreation: FunctionComponent = (props) => { setSelectedTypes([]); helpers.handleClearAllFilters(); setFeedAttributes({ 0: {} }); + if (!isDuplicated) { + onDrawerClose(); + } }; const handleSelectTypes = (types: string[]) => { @@ -303,11 +309,12 @@ const FeedCreation: FunctionComponent = (props) => { ); setFeedAttributes(R.assoc(i, newFeedAttribute, feedAttributes)); }; - + console.log('OPEN', open); return ( {({ onClose }) => ( diff --git a/opencti-platform/opencti-front/src/private/components/data/feeds/FeedPopover.jsx b/opencti-platform/opencti-front/src/private/components/data/feeds/FeedPopover.jsx index c35075e7d9ff7..ac445f512a3e9 100644 --- a/opencti-platform/opencti-front/src/private/components/data/feeds/FeedPopover.jsx +++ b/opencti-platform/opencti-front/src/private/components/data/feeds/FeedPopover.jsx @@ -17,6 +17,7 @@ import { ConnectionHandler } from 'relay-runtime'; import inject18n from '../../../../components/i18n'; import { commitMutation, QueryRenderer } from '../../../../relay/environment'; import FeedEdition from './FeedEdition'; +import FeedCreation from './FeedCreation'; const styles = () => ({ container: { @@ -53,6 +54,7 @@ class FeedPopover extends Component { displayUpdate: false, displayDelete: false, deleting: false, + displayDuplicate: false, }; } @@ -73,6 +75,15 @@ class FeedPopover extends Component { this.setState({ displayUpdate: false }); } + handleOpenDuplicate() { + this.setState({ displayDuplicate: true }); + this.handleClose(); + } + + handleCloseDuplicate() { + this.setState({ displayDuplicate: false }); + } + handleOpenDelete() { this.setState({ displayDelete: true }); this.handleClose(); @@ -127,6 +138,9 @@ class FeedPopover extends Component { {t('Update')} + + {t('Duplicate')} + {t('Delete')} @@ -137,11 +151,20 @@ class FeedPopover extends Component { render={({ props }) => { if (props) { return ( - + <> + + + ); } return
;