Skip to content

Commit

Permalink
[Frontend] Titles on functional component pages have been updated.
Browse files Browse the repository at this point in the history
WIP - Adding Titles to pages

WIP - Updating Titles

WIP - Updating Titles for Functional Components only.

Updated Titles. Some class component pages have not been updated.

Revert "Updated Titles. Some class component pages have not been updated."

This reverts commit babb1cd.

Updated Titles. Some class component pages have not been updated.

Resolving Merge Conflicts

[frontend] Replaced Creation Floating Action Buttons for Cases

[frontend] Replaced Creation Floating Action Buttons for Observations

Fixed minor errors
  • Loading branch information
Bonsai8863 authored and dotdev8 committed Jul 23, 2024
1 parent 892e878 commit cfeb7d3
Show file tree
Hide file tree
Showing 68 changed files with 3,168 additions and 1,789 deletions.
100 changes: 50 additions & 50 deletions opencti-platform/opencti-front/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,54 +5,54 @@
"main": "src/front.tsx",
"dependencies": {
"@analytics/google-analytics": "1.0.7",
"@ckeditor/ckeditor5-react": "6.2.0",
"@ckeditor/ckeditor5-react": "8.0.0",
"@date-fns/upgrade": "1.0.3",
"@date-io/date-fns": "3.0.0",
"@emotion/react": "11.11.4",
"@emotion/styled": "11.11.5",
"@fontsource/geologica": "5.0.5",
"@fontsource/ibm-plex-sans": "5.0.20",
"@mui/icons-material": "5.15.18",
"@mui/lab": "5.0.0-alpha.170",
"@mui/material": "5.15.18",
"@mui/styles": "5.15.18",
"@mui/utils": "5.15.14",
"@mui/x-date-pickers": "6.20.0",
"@rjsf/core": "5.18.1",
"@rjsf/mui": "5.18.1",
"@rjsf/utils": "5.18.1",
"@mui/icons-material": "5.16.0",
"@mui/lab": "5.0.0-alpha.171",
"@mui/material": "5.16.0",
"@mui/styles": "5.16.0",
"@mui/utils": "5.16.0",
"@mui/x-date-pickers": "7.9.0",
"@rjsf/core": "5.19.2",
"@rjsf/mui": "5.19.2",
"@rjsf/utils": "5.19.2",
"@types/react-beautiful-dnd": "^13.1.8",
"analytics": "0.8.11",
"apexcharts": "3.49.1",
"analytics": "0.8.13",
"apexcharts": "3.50.0",
"axios": "1.7.2",
"ckeditor5-custom-build": "0.0.1",
"ckeditor5-custom-build": "0.0.6",
"classnames": "2.5.1",
"convert": "5.2.0",
"convert": "5.3.0",
"d3-hierarchy": "3.1.2",
"d3-timer": "3.0.1",
"dagre": "0.8.5",
"date-fns": "3.6.0",
"extract-files": "13.0.0",
"filigran-icon": "0.5.0",
"filigran-ui": "0.5.1",
"filigran-icon": "0.6.0",
"filigran-ui": "0.11.4",
"formik": "2.4.6",
"formik-mui": "5.0.0-alpha.0",
"formik-mui-lab": "1.0.0",
"graphql": "16.8.2",
"graphql": "16.9.0",
"html-to-image": "1.11.11",
"html-to-pdfmake": "2.5.6",
"html-to-pdfmake": "2.5.10",
"invert-color": "2.0.0",
"js-base64": "3.7.7",
"js-file-download": "0.4.12",
"leaflet": "1.9.4",
"lodash": "4.17.21",
"mdi-material-ui": "7.8.0",
"mdi-material-ui": "7.9.1",
"moment": "2.30.1",
"moment-timezone": "0.5.45",
"pdfmake": "0.2.10",
"prop-types": "15.8.1",
"qrcode": "1.5.3",
"ramda": "0.29.1",
"ramda": "0.30.1",
"react": "18.3.1",
"react-apexcharts": "1.4.1",
"react-beautiful-dnd": "13.1.1",
Expand All @@ -70,56 +70,56 @@
"react-material-ui-carousel": "3.4.2",
"react-mde": "11.5.0",
"react-otp-input": "3.1.1",
"react-pdf": "9.0.0",
"react-pdf": "9.1.0",
"react-rectangle-selection": "1.0.4",
"react-relay": "16.2.0",
"react-relay": "17.0.0",
"react-relay-network-modern": "6.2.2",
"react-router-dom": "6.22.3",
"react-router-dom": "6.24.1",
"react-syntax-highlighter": "15.5.0",
"react-timeline-range-slider": "1.4.1",
"react-virtualized": "9.22.5",
"reactflow": "11.11.3",
"reactflow": "11.11.4",
"recharts": "2.12.7",
"relay-runtime": "16.2.0",
"relay-runtime": "17.0.0",
"remark-flexible-markers": "1.2.1",
"remark-gfm": "4.0.0",
"remark-parse": "11.0.0",
"rxjs": "7.8.1",
"subscriptions-transport-ws": "0.11.0",
"three-spritetext": "1.8.2",
"unified": "11.0.4",
"unified": "11.0.5",
"use-analytics": "1.1.0",
"uuid": "9.0.1",
"uuid": "10.0.0",
"yup": "1.4.0"
},
"devDependencies": {
"@playwright/test": "1.44.1",
"@playwright/test": "1.45.1",
"@rollup/plugin-graphql": "2.0.4",
"@testing-library/jest-dom": "6.4.2",
"@testing-library/react": "14.2.2",
"@testing-library/jest-dom": "6.4.6",
"@testing-library/react": "16.0.0",
"@testing-library/user-event": "14.5.2",
"@types/node": "20.12.12",
"@types/node": "20.14.10",
"@types/qrcode": "1.5.5",
"@types/ramda": "0.29.11",
"@types/react": "18.3.2",
"@types/ramda": "0.30.1",
"@types/react": "18.3.3",
"@types/react-csv": "1.1.10",
"@types/react-dom": "18.3.0",
"@types/react-grid-layout": "1.3.5",
"@types/react-relay": "16.0.6",
"@types/react-router-dom": "5.3.3",
"@types/react-syntax-highlighter": "15.5.13",
"@types/react-test-renderer": "18.0.7",
"@types/relay-runtime": "14.1.24",
"@types/react-test-renderer": "18.3.0",
"@types/relay-runtime": "17.0.1",
"@types/relay-test-utils": "14.1.4",
"@types/uuid": "9.0.8",
"@vitejs/plugin-react": "4.2.1",
"babel-plugin-relay": "16.2.0",
"@types/uuid": "10.0.0",
"@vitejs/plugin-react": "4.3.1",
"babel-plugin-relay": "17.0.0",
"chokidar": "3.6.0",
"compression": "1.7.4",
"cross-env": "7.0.3",
"esbuild": "0.20.2",
"esbuild": "0.23.0",
"esbuild-jest": "0.5.0",
"eslint": "8.57.0",
"eslint": "9.6.0",
"eslint-config-airbnb": "19.0.4",
"eslint-config-airbnb-base": "15.0.0",
"eslint-config-airbnb-typescript": "18.0.0",
Expand All @@ -131,18 +131,18 @@
"express": "4.19.2",
"fs-extra": "11.2.0",
"http-proxy-middleware": "3.0.0",
"i18n-auto-translation": "1.4.0",
"jsdom": "24.0.0",
"monocart-reporter": "2.4.5",
"i18n-auto-translation": "1.5.0",
"jsdom": "24.1.0",
"monocart-reporter": "2.6.0",
"react-test-renderer": "18.3.1",
"relay-compiler": "16.2.0",
"relay-test-utils": "16.2.0",
"tap": "18.7.1",
"typescript": "5.4.4",
"vite": "5.2.8",
"relay-compiler": "17.0.0",
"relay-test-utils": "17.0.0",
"tap": "21.0.0",
"typescript": "5.5.3",
"vite": "5.3.3",
"vite-plugin-relay": "2.1.0",
"vite-plugin-static-copy": "1.0.2",
"vitest": "1.4.0"
"vite-plugin-static-copy": "1.0.6",
"vitest": "2.0.1"
},
"engines": {
"node": ">= 17.*"
Expand Down
1 change: 0 additions & 1 deletion opencti-platform/opencti-front/src/private/Root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,6 @@ const RootComponent: FunctionComponent<RootComponentProps> = ({ queryRef }) => {
return [n.entity_type, filtersSchema];
})),
};

// TODO : Use the hook useHelper when all project is pure function //
const bannerSettings = computeBannerSettings(settings);
const platformModuleHelpers = platformModuleHelper(settings);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import useEnterpriseEdition from '../../utils/hooks/useEnterpriseEdition';
import { useBuildEntityTypeBasedFilterContext, emptyFilterGroup, useGetDefaultFilterObject } from '../../utils/filters/filtersUtils';
import { decodeSearchKeyword, handleSearchByKeyword } from '../../utils/SearchUtils';
import { useFormatter } from '../../components/i18n';
import useConnectedDocumentModifier from '../../utils/hooks/useConnectedDocumentModifier';

const LOCAL_STORAGE_KEY = 'search';

Expand All @@ -30,6 +31,8 @@ const Search = () => {
const isEnterpriseEdition = useEnterpriseEdition();
const navigate = useNavigate();
const { t_i18n } = useFormatter();
const { setTitle } = useConnectedDocumentModifier();
setTitle(t_i18n('Knowledge Search | Advanced Search'));
const { keyword } = useParams() as { keyword: string };
const searchTerm = decodeSearchKeyword(keyword);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import { hexToRGB, itemColor } from '../../utils/Colors';
import ItemMarkings from '../../components/ItemMarkings';
import { export_max_size } from '../../utils/utils';
import Breadcrumbs from '../../components/Breadcrumbs';
import useConnectedDocumentModifier from '../../utils/hooks/useConnectedDocumentModifier';

const SEARCH$ = new Subject().pipe(debounce(() => timer(500)));

Expand Down Expand Up @@ -263,6 +264,8 @@ const inlineStyles = {

const SearchBulk = () => {
const { t_i18n, nsd, n } = useFormatter();
const { setTitle } = useConnectedDocumentModifier();
setTitle(t_i18n('Bulk Search'));
const isGrantedToExports = useGranted([KNOWLEDGE_KNGETEXPORT]);
const classes = useStyles();
const [textFieldValue, setTextFieldValue] = useState('');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ interface ExternalReferencesProps {
const ExternalReferences: FunctionComponent<ExternalReferencesProps> = () => {
const { t_i18n } = useFormatter();
const { setTitle } = useConnectedDocumentModifier();
setTitle(t_i18n('External references | Analyses'));
setTitle(t_i18n('External References | Analyses'));
const { isFeatureEnable } = useHelper();
const isFABReplaced = isFeatureEnable('FAB_REPLACEMENT');
const {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,16 @@ import { useFormatter } from '../../../components/i18n';
import useHelper from '../../../utils/hooks/useHelper';
import useEntityToggle from '../../../utils/hooks/useEntityToggle';
import ExportContextProvider from '../../../utils/ExportContextProvider';
import useConnectedDocumentModifier from '../../../utils/hooks/useConnectedDocumentModifier';

const LOCAL_STORAGE_KEY = 'channels';

const Channels = () => {
const { t_i18n } = useFormatter();
const { isFeatureEnable } = useHelper();
const FAB_REPLACED = isFeatureEnable('FAB_REPLACEMENT');
const { setTitle } = useConnectedDocumentModifier();
setTitle(t_i18n('Channels | Arsenal'));
const { viewStorage, helpers, paginationOptions } = usePaginationLocalStorage<ChannelsLinesPaginationQuery$variables>(
LOCAL_STORAGE_KEY,
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,15 @@ import { useFormatter } from '../../../components/i18n';
import { UsePreloadedPaginationFragment } from '../../../utils/hooks/usePreloadedPaginationFragment';
import DataTable from '../../../components/dataGrid/DataTable';
import useHelper from '../../../utils/hooks/useHelper';
import useConnectedDocumentModifier from '../../../utils/hooks/useConnectedDocumentModifier';


const LOCAL_STORAGE_KEY = 'malwares';

const Malwares = () => {
const { t_i18n } = useFormatter();
const { setTitle } = useConnectedDocumentModifier();
setTitle(t_i18n('Malware | Arsenal'));
const initialValues = {
searchTerm: '',
sortBy: 'name',
Expand Down Expand Up @@ -186,4 +190,4 @@ const Malwares = () => {
);
};

export default Malwares;
export default Malwares;
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,16 @@ import Breadcrumbs from '../../../components/Breadcrumbs';
import useHelper from '../../../utils/hooks/useHelper';
import useEntityToggle from '../../../utils/hooks/useEntityToggle';
import ExportContextProvider from '../../../utils/ExportContextProvider';
import useConnectedDocumentModifier from '../../../utils/hooks/useConnectedDocumentModifier';

const LOCAL_STORAGE_KEY = 'tools';

const Tools = () => {
const { t_i18n } = useFormatter();
const { isFeatureEnable } = useHelper();
const FAB_REPLACED = isFeatureEnable('FAB_REPLACEMENT');
const { setTitle } = useConnectedDocumentModifier();
setTitle(t_i18n('Tools | Arsenal'));
const { viewStorage, helpers, paginationOptions } = usePaginationLocalStorage<ToolsLinesPaginationQuery$variables>(
LOCAL_STORAGE_KEY,
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@ import Breadcrumbs from '../../../components/Breadcrumbs';
import useHelper from '../../../utils/hooks/useHelper';
import useEntityToggle from '../../../utils/hooks/useEntityToggle';
import ExportContextProvider from '../../../utils/ExportContextProvider';
import useConnectedDocumentModifier from '../../../utils/hooks/useConnectedDocumentModifier';

const LOCAL_STORAGE_KEY = 'vulnerabilities';

const Vulnerabilities = () => {
const { t_i18n } = useFormatter();
const { setTitle } = useConnectedDocumentModifier();
setTitle(t_i18n('Vulnerabilities | Arsenal'));
const {
platformModuleHelpers: { isRuntimeFieldEnable },
} = useAuth();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { CaseIncidentLineCase_node$data } from './case_incidents/__generated__/C
import { useBuildEntityTypeBasedFilterContext, emptyFilterGroup } from '../../../utils/filters/filtersUtils';
import { useFormatter } from '../../../components/i18n';
import Breadcrumbs from '../../../components/Breadcrumbs';
import useConnectedDocumentModifier from '../../../utils/hooks/useConnectedDocumentModifier';

interface CaseIncidentsProps {
inputValue?: string;
Expand All @@ -29,6 +30,11 @@ export const LOCAL_STORAGE_KEY_CASE_INCIDENT = 'caseIncidents';

const CaseIncidents: FunctionComponent<CaseIncidentsProps> = () => {
const { t_i18n } = useFormatter();
const { setTitle } = useConnectedDocumentModifier();
setTitle(t_i18n('Incident Responses | Cases'));
const { isFeatureEnable } = useHelper();
const { setTitle } = useConnectedDocumentModifier();
setTitle(t_i18n('Incident Responses | Cases'));
const { isFeatureEnable } = useHelper();
const {
platformModuleHelpers: { isRuntimeFieldEnable },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { CaseRfiLineCase_node$data } from './case_rfis/__generated__/CaseRfiLine
import { useBuildEntityTypeBasedFilterContext, emptyFilterGroup } from '../../../utils/filters/filtersUtils';
import { useFormatter } from '../../../components/i18n';
import Breadcrumbs from '../../../components/Breadcrumbs';
import useConnectedDocumentModifier from '../../../utils/hooks/useConnectedDocumentModifier';

interface CaseRfisProps {
inputValue?: string;
Expand All @@ -26,6 +27,8 @@ export const LOCAL_STORAGE_KEY = 'caseRfis';

const CaseRfis: FunctionComponent<CaseRfisProps> = () => {
const { t_i18n } = useFormatter();
const { setTitle } = useConnectedDocumentModifier();
setTitle(t_i18n('Requests for Information | Cases'));
const { isFeatureEnable } = useHelper();
const {
platformModuleHelpers: { isRuntimeFieldEnable },
Expand Down Expand Up @@ -198,4 +201,4 @@ const CaseRfis: FunctionComponent<CaseRfisProps> = () => {
);
};

export default CaseRfis;
export default CaseRfis;
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import CaseRftCreation from './case_rfts/CaseRftCreation';
import { useBuildEntityTypeBasedFilterContext, emptyFilterGroup } from '../../../utils/filters/filtersUtils';
import { useFormatter } from '../../../components/i18n';
import Breadcrumbs from '../../../components/Breadcrumbs';
import useConnectedDocumentModifier from '../../../utils/hooks/useConnectedDocumentModifier';

interface CaseRftsProps {
inputValue?: string;
Expand All @@ -27,6 +28,9 @@ export const LOCAL_STORAGE_KEY = 'caseRfts';
const CaseRfts: FunctionComponent<CaseRftsProps> = () => {
const { t_i18n } = useFormatter();
const { isFeatureEnable } = useHelper();
const { setTitle } = useConnectedDocumentModifier();
setTitle(t_i18n('Requests for Takedown | Cases'));
const { isFeatureEnable } = useHelper();
const {
platformModuleHelpers: { isRuntimeFieldEnable },
} = useAuth();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { FeedbackLine_node$data } from './feedbacks/__generated__/FeedbackLine_n
import { useBuildEntityTypeBasedFilterContext, emptyFilterGroup } from '../../../utils/filters/filtersUtils';
import { useFormatter } from '../../../components/i18n';
import Breadcrumbs from '../../../components/Breadcrumbs';
import useConnectedDocumentModifier from '../../../utils/hooks/useConnectedDocumentModifier';

interface FeedbacksProps {
inputValue?: string;
Expand All @@ -22,6 +23,8 @@ export const LOCAL_STORAGE_KEY_FEEDBACK = 'feedbacks';

const Feedbacks: FunctionComponent<FeedbacksProps> = () => {
const { t_i18n } = useFormatter();
const { setTitle } = useConnectedDocumentModifier();
setTitle(t_i18n('Feedbacks | Cases'));
const {
platformModuleHelpers: { isRuntimeFieldEnable },
} = useAuth();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,14 @@ import { TasksLine_node$data } from './tasks/__generated__/TasksLine_node.graphq
import { useBuildEntityTypeBasedFilterContext, emptyFilterGroup } from '../../../utils/filters/filtersUtils';
import { useFormatter } from '../../../components/i18n';
import Breadcrumbs from '../../../components/Breadcrumbs';
import useConnectedDocumentModifier from '../../../utils/hooks/useConnectedDocumentModifier';

export const LOCAL_STORAGE_KEY_TASKS = 'cases-casesTasks';

const Tasks = () => {
const { t_i18n } = useFormatter();
const { setTitle } = useConnectedDocumentModifier();
setTitle(t_i18n('Tasks | Cases'));
const { viewStorage, helpers, paginationOptions } = usePaginationLocalStorage<TasksLinesPaginationQuery$variables>(
LOCAL_STORAGE_KEY_TASKS,
{
Expand Down
Loading

0 comments on commit cfeb7d3

Please sign in to comment.