Projects STRLCPY opencti Commits f02f41c1
🤬
Revision indexing in progress... (symbol navigation in revisions will be accurate after indexed)
  • ■ ■ ■ ■
    opencti-platform/opencti-front/src/private/components/techniques/data_components/DataComponent.tsx
    skipped 38 lines
    39 39   <StixDomainObjectHeader
    40 40   stixDomainObject={DataComponent_dataComponent}
    41 41   enableReferences={enableReferences}
    42  - PopoverComponent={<DataComponentPopover />}
     42 + PopoverComponent={DataComponentPopover}
    43 43   />
    44 44   <Grid
    45 45   container={true}
    skipped 111 lines
  • ■ ■ ■ ■ ■ ■
    opencti-platform/opencti-front/src/private/components/techniques/data_components/DataComponentEdition.js
    skipped 8 lines
    9 9  import { commitMutation, QueryRenderer } from '../../../../relay/environment';
    10 10  import inject18n from '../../../../components/i18n';
    11 11  import Loader from '../../../../components/Loader';
    12  -import DataComponentEditionContainer from "./DataComponentEditionContainer";
    13  -import { dataComponentEditionOverviewFocus } from "./DataComponentEditionOverview";
     12 +import DataComponentEditionContainer from './DataComponentEditionContainer';
     13 +import { dataComponentEditionOverviewFocus } from './DataComponentEditionOverview';
    14 14   
    15 15  const styles = (theme) => ({
    16 16   editButton: {
    skipped 105 lines
  • ■ ■ ■ ■
    opencti-platform/opencti-front/src/private/components/techniques/data_components/DataComponentLine.tsx
    skipped 8 lines
    9 9  import { Theme } from '@mui/material/styles/createTheme';
    10 10  import Skeleton from '@mui/material/Skeleton';
    11 11  import { useFormatter } from '../../../../components/i18n';
    12  -import { DataColumns, PaginationOptions } from '../../../../components/list_lines';
    13 12   
    14 13  const useStyles = makeStyles((theme: Theme) => ({
    15 14   item: {},
    skipped 42 lines
    58 57   name: string
    59 58   description: string
    60 59   }
    61  - dataColumns: DataColumns,
    62  - paginationOptions: PaginationOptions
    63 60  }
    64 61   
    65  -const DataComponentLineComponent: React.FC<DataComponentLineProps> = ({ node, dataColumns, paginationOptions }) => {
     62 +const DataComponentLineComponent: React.FC<DataComponentLineProps> = ({ node }) => {
    66 63   const classes = useStyles();
    67 64   const { t } = useFormatter();
    68 65   
    skipped 64 lines
  • ■ ■ ■ ■ ■ ■
    opencti-platform/opencti-front/src/private/components/techniques/data_components/DataComponentOverview.js opencti-platform/opencti-front/src/private/components/techniques/data_components/DataComponentOverview.tsx
    1  -import React, { Component } from 'react';
    2  -import * as PropTypes from 'prop-types';
    3  -import { compose, map, propOr } from 'ramda';
     1 +import React from 'react';
     2 +import { map, propOr } from 'ramda';
    4 3  import { graphql, createFragmentContainer } from 'react-relay';
    5  -import withStyles from '@mui/styles/withStyles';
     4 +import makeStyles from '@mui/styles/makeStyles';
    6 5  import Paper from '@mui/material/Paper';
    7 6  import Typography from '@mui/material/Typography';
    8  -import inject18n from '../../../../components/i18n';
     7 +import { useFormatter } from '../../../../components/i18n';
    9 8  import ItemAuthor from '../../../../components/ItemAuthor';
    10 9  import ItemMarking from '../../../../components/ItemMarking';
    11 10  import ExpandableMarkdown from '../../../../components/ExpandableMarkdown';
     11 +import { DataComponentOverview_dataComponent$data } from './__generated__/DataComponentOverview_dataComponent.graphql';
    12 12   
    13  -const styles = () => ({
     13 +const useStyles = makeStyles(() => ({
    14 14   paper: {
    15 15   height: '100%',
    16 16   minHeight: '100%',
    skipped 1 lines
    18 18   padding: '15px',
    19 19   borderRadius: 6,
    20 20   },
    21  -});
     21 +}));
    22 22   
    23  -class DataComponentOverviewComponent extends Component {
    24  - render() {
    25  - const { t, fldt, classes, dataComponent } = this.props;
    26  - return (
     23 +interface DataComponentOverviewProps {
     24 + dataComponent: DataComponentOverview_dataComponent$data,
     25 +}
     26 + 
     27 +const DataComponentOverviewComponent: React.FC<DataComponentOverviewProps> = ({ dataComponent }) => {
     28 + const classes = useStyles();
     29 + const { t, fldt } = useFormatter();
     30 + return (
    27 31   <div style={{ height: '100%' }} className="break">
    28 32   <Typography variant="h4" gutterBottom={true}>
    29 33   {t('Information')}
    skipped 53 lines
    83 87   />
    84 88   </Paper>
    85 89   </div>
    86  - );
    87  - }
    88  -}
    89  - 
    90  -DataComponentOverviewComponent.propTypes = {
    91  - dataComponent: PropTypes.object,
    92  - classes: PropTypes.object,
    93  - t: PropTypes.func,
    94  - fldt: PropTypes.func,
     90 + );
    95 91  };
    96 92   
    97 93  const DataComponentOverview = createFragmentContainer(
    skipped 26 lines
    124 120   },
    125 121  );
    126 122   
    127  -export default compose(inject18n, withStyles(styles))(DataComponentOverview);
    128  - 
  • ■ ■ ■ ■ ■ ■
    opencti-platform/opencti-front/src/private/components/techniques/data_components/DataComponentPopover.tsx
    skipped 12 lines
    13 13  import makeStyles from '@mui/styles/makeStyles';
    14 14  import { graphql } from 'react-relay';
    15 15  import { Theme } from '@mui/material/styles/createTheme';
     16 +import Slide from '@mui/material/Slide';
    16 17  import { useFormatter } from '../../../../components/i18n';
    17 18  import { commitMutation, QueryRenderer } from '../../../../relay/environment';
    18 19  import Loader, { LoaderVariant } from '../../../../components/Loader';
    19  -import Security, { KNOWLEDGE_KNUPDATE_KNDELETE, } from '../../../../utils/Security';
     20 +import Security, { KNOWLEDGE_KNUPDATE_KNDELETE } from '../../../../utils/Security';
    20 21  import { dataComponentEditionQuery } from './DataComponentEdition';
    21 22  import DataComponentEditionContainer from './DataComponentEditionContainer';
    22  -import Transition from '../../../../components/Transition';
     23 +import { deleteNode } from '../../../../utils/Store';
     24 +import { PaginationOptions } from '../../../../components/list_lines';
    23 25   
    24 26  const styles = makeStyles<Theme>((theme) => ({
    25 27   container: {
    skipped 19 lines
    45 47  `;
    46 48   
    47 49  interface DataComponentPopoverProps {
    48  - dataComponentId: string
     50 + dataComponentId: string,
     51 + paginationOptions: PaginationOptions,
    49 52  }
    50 53   
    51  -const DataComponentPopover: FunctionComponent<DataComponentPopoverProps> = ({ dataComponentId }) => {
     54 +const DataComponentPopover: FunctionComponent<DataComponentPopoverProps> = ({ dataComponentId, paginationOptions }) => {
    52 55   const { t } = useFormatter();
    53 56   const classes = styles();
    54 57   const history = useHistory();
    skipped 5 lines
    60 63   
    61 64   const handleOpen = (event: React.MouseEvent<HTMLElement>) => {
    62 65   setAnchorEl(event.currentTarget);
    63  - }
     66 + };
    64 67   
    65 68   const handleClose = () => {
    66 69   setAnchorEl(null);
    67  - }
     70 + };
    68 71   
    69 72   const handleOpenDelete = () => {
    70 73   setDisplayEdit(true);
    71 74   handleClose();
    72  - }
     75 + };
    73 76   
    74 77   const handleCloseDelete = () => {
    75 78   setDisplayDelete(false);
    76  - }
     79 + };
    77 80   
    78 81   const submitDelete = () => {
    79 82   setDeleting(true);
    skipped 7 lines
    87 90   handleClose();
    88 91   history.push('/dashboard/techniques/data_component');
    89 92   },
    90  - updater: undefined,
     93 + updater: (store: any) => deleteNode(store, 'Pagination_dataComponents', paginationOptions, dataComponentId),
    91 94   optimisticUpdater: undefined,
    92 95   optimisticResponse: undefined,
    93 96   onError: undefined,
    94 97   setSubmitting: undefined,
    95 98   });
    96  - }
     99 + };
    97 100   
    98 101   const handleOpenEdit = () => {
    99 102   setDisplayEdit(true);
    100 103   handleClose();
    101  - }
     104 + };
    102 105   
    103 106   const handleCloseEdit = () => {
    104 107   setDisplayEdit(false);
    105  - }
     108 + };
    106 109   
    107 110   return (
    108 111   <div className={classes.container}>
    skipped 22 lines
    131 134   <Dialog
    132 135   open={displayDelete}
    133 136   keepMounted={true}
    134  - TransitionComponent={Transition}
    135 137   PaperProps={{ elevation: 1 }}
    136 138   onClose={handleCloseDelete}
    137 139   >
    skipped 44 lines
    182 184   </Drawer>
    183 185   </div>
    184 186   );
    185  -}
     187 +};
    186 188   
    187 189  export default DataComponentPopover;
    188 190   
Please wait...
Page is in error, reload to recover