Skip to content

Commit

Permalink
remove xlsx lib + remove inject export
Browse files Browse the repository at this point in the history
Signed-off-by: Antoine MAZEAS <[email protected]>
  • Loading branch information
antoinemzs committed Feb 3, 2025
1 parent 5e6a30f commit ae788f9
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 72 deletions.
1 change: 0 additions & 1 deletion openbas-front/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@
"seamless-immutable": "7.1.4",
"usehooks-ts": "3.1.0",
"uuid": "11.0.3",
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz",
"zod": "3.24.1",
"zustand": "5.0.1"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,8 @@ import { ToggleButton, ToggleButtonGroup, Tooltip } from '@mui/material';
import { makeStyles } from '@mui/styles';
import { FunctionComponent, useContext } from 'react';

import type { TagHelper } from '../../../../actions/helper';
import type { InjectOutputType } from '../../../../actions/injects/Inject';
import ButtonPopover from '../../../../components/common/ButtonPopover';
import { useFormatter } from '../../../../components/i18n';
import { useHelper } from '../../../../store';
import { exportData } from '../../../../utils/Environment';
import useExportToXLS from '../../../../utils/hooks/useExportToXLS';
import { InjectContext, ViewModeContext } from '../Context';
import ImportUploaderInjectFromXls from './ImportUploaderInjectFromXls';

Expand Down Expand Up @@ -41,41 +36,10 @@ const InjectsListButtons: FunctionComponent<Props> = ({
const classes = useStyles();
const { t } = useFormatter();
const injectContext = useContext(InjectContext);

const viewModeContext = useContext(ViewModeContext);

// Fetching data
const { tagsMap } = useHelper((helper: TagHelper) => ({
tagsMap: helper.getTagsMap(),
}));

const exportInjects = exportData(
'inject',
[
'inject_type',
'inject_title',
'inject_description',
'inject_depends_duration',
'inject_enabled',
'inject_tags',
'inject_content',
],
selectedInjects,
tagsMap,
);
const exportInjectsToXLS = useExportToXLS({ data: exportInjects, fileName: `${t('Injects')}` });

const entries = [
{ label: 'Export injects', action: exportInjectsToXLS },
];

return (
<div className={classes.container}>
<ButtonPopover
disabled={!isAtLeastOneValidInject}
entries={entries}
variant="icon"
/>
<ToggleButtonGroup
size="small"
exclusive
Expand Down
25 changes: 0 additions & 25 deletions openbas-front/src/utils/hooks/useExportToXLS.ts

This file was deleted.

10 changes: 0 additions & 10 deletions openbas-front/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9500,7 +9500,6 @@ __metadata:
uuid: "npm:11.0.3"
vite: "npm:6.0.9"
vitest: "npm:2.1.1"
xlsx: "https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz"
zod: "npm:3.24.1"
zustand: "npm:5.0.1"
languageName: unknown
Expand Down Expand Up @@ -12487,15 +12486,6 @@ __metadata:
languageName: node
linkType: hard

"xlsx@https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz":
version: 0.20.3
resolution: "xlsx@https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz"
bin:
xlsx: ./bin/xlsx.njs
checksum: 10c0/eb20749e56ffa23ffc4a5a6fd983524e0406308e53992e24112424de9f30ec64d7dd80e8e56363e39c3853687f7b4151f97a6f5373050b23c0c2758796803b6b
languageName: node
linkType: hard

"xml-name-validator@npm:^5.0.0":
version: 5.0.0
resolution: "xml-name-validator@npm:5.0.0"
Expand Down

0 comments on commit ae788f9

Please sign in to comment.