Skip to content

Commit

Permalink
[Frontend] Add titles on functional component pages
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

Fixed duplicate issue.

Add translations and linting

Fix import issue from merge

Minor cleanup

Test commit

Formatting change

Add space to root again?

Add settings pages that are already functional

Add killChainPhases

Update translations

Add Narratives title

Translate narratives

Add data components

Remove duplicate Data titles (pt 2)

Add translations

Fix case on Taxii.tsx

Update translations
  • Loading branch information
Bonsai8863 authored and VerboseCat committed Oct 1, 2024
1 parent 961fcf1 commit bee25ba
Show file tree
Hide file tree
Showing 83 changed files with 709 additions and 3 deletions.
69 changes: 69 additions & 0 deletions opencti-platform/opencti-front/lang/front/de.json

Large diffs are not rendered by default.

69 changes: 69 additions & 0 deletions opencti-platform/opencti-front/lang/front/en.json

Large diffs are not rendered by default.

69 changes: 69 additions & 0 deletions opencti-platform/opencti-front/lang/front/es.json

Large diffs are not rendered by default.

69 changes: 69 additions & 0 deletions opencti-platform/opencti-front/lang/front/fr.json

Large diffs are not rendered by default.

69 changes: 69 additions & 0 deletions opencti-platform/opencti-front/lang/front/ja.json

Large diffs are not rendered by default.

69 changes: 69 additions & 0 deletions opencti-platform/opencti-front/lang/front/ko.json

Large diffs are not rendered by default.

69 changes: 69 additions & 0 deletions opencti-platform/opencti-front/lang/front/zh.json

Large diffs are not rendered by default.

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 @@ -260,7 +260,6 @@ const computeBannerSettings = (settings: RootSettings$data) => {
sessionLimit,
};
};

interface RootComponentProps {
queryRef: PreloadedQuery<RootPrivateQuery>;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import { emptyFilterGroup, useBuildEntityTypeBasedFilterContext, useGetDefaultFi
import { decodeSearchKeyword } from '../../utils/SearchUtils';
import DataTable from '../../components/dataGrid/DataTable';
import { UsePreloadedPaginationFragment } from '../../utils/hooks/usePreloadedPaginationFragment';
import { useFormatter } from '../../components/i18n';
import useConnectedDocumentModifier from '../../utils/hooks/useConnectedDocumentModifier';

const LOCAL_STORAGE_KEY = 'search';

Expand Down Expand Up @@ -185,6 +187,9 @@ const Search = () => {
const {
platformModuleHelpers: { isRuntimeFieldEnable },
} = useAuth();
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 @@ -100,7 +100,7 @@ const externalReferencesLinesFragment = graphql`
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 @@ -13,6 +13,7 @@ import { useFormatter } from '../../../components/i18n';
import DataTable from '../../../components/dataGrid/DataTable';
import { UsePreloadedPaginationFragment } from '../../../utils/hooks/usePreloadedPaginationFragment';
import useHelper from '../../../utils/hooks/useHelper';
import useConnectedDocumentModifier from '../../../utils/hooks/useConnectedDocumentModifier';

const LOCAL_STORAGE_KEY = 'channels';

Expand Down Expand Up @@ -101,7 +102,8 @@ const Channels = () => {
const { t_i18n } = useFormatter();
const { isFeatureEnable } = useHelper();
const isFABReplaced = isFeatureEnable('FAB_REPLACEMENT');

const { setTitle } = useConnectedDocumentModifier();
setTitle(t_i18n('Channels | Arsenal'));
const initialValues = {
searchTerm: '',
sortBy: 'name',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@ 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
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import Breadcrumbs from '../../../components/Breadcrumbs';
import DataTable from '../../../components/dataGrid/DataTable';
import { UsePreloadedPaginationFragment } from '../../../utils/hooks/usePreloadedPaginationFragment';
import useHelper from '../../../utils/hooks/useHelper';
import useConnectedDocumentModifier from '../../../utils/hooks/useConnectedDocumentModifier';

const LOCAL_STORAGE_KEY = 'tools';

Expand Down Expand Up @@ -100,6 +101,8 @@ const Tools = () => {
const { t_i18n } = useFormatter();
const { isFeatureEnable } = useHelper();
const isFABReplaced = isFeatureEnable('FAB_REPLACEMENT');
const { setTitle } = useConnectedDocumentModifier();
setTitle(t_i18n('Tools | Arsenal'));
const initialValues = {
searchTerm: '',
sortBy: 'name',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import Breadcrumbs from '../../../components/Breadcrumbs';
import DataTable from '../../../components/dataGrid/DataTable';
import { UsePreloadedPaginationFragment } from '../../../utils/hooks/usePreloadedPaginationFragment';
import useHelper from '../../../utils/hooks/useHelper';
import useConnectedDocumentModifier from '../../../utils/hooks/useConnectedDocumentModifier';

const LOCAL_STORAGE_KEY = 'vulnerabilities';

Expand Down Expand Up @@ -104,6 +105,8 @@ const vulnerabilitiesLinesFragment = graphql`

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 @@ -18,6 +18,7 @@ import Breadcrumbs from '../../../components/Breadcrumbs';
import DataTable from '../../../components/dataGrid/DataTable';
import { DataTableProps } from '../../../components/dataGrid/dataTableTypes';
import { UsePreloadedPaginationFragment } from '../../../utils/hooks/usePreloadedPaginationFragment';
import useConnectedDocumentModifier from '../../../utils/hooks/useConnectedDocumentModifier';

interface CaseIncidentsProps {
inputValue?: string;
Expand Down Expand Up @@ -126,6 +127,8 @@ 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 {
platformModuleHelpers: { isRuntimeFieldEnable },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { useFormatter } from '../../../components/i18n';
import Breadcrumbs from '../../../components/Breadcrumbs';
import DataTable from '../../../components/dataGrid/DataTable';
import { UsePreloadedPaginationFragment } from '../../../utils/hooks/usePreloadedPaginationFragment';
import useConnectedDocumentModifier from '../../../utils/hooks/useConnectedDocumentModifier';

interface CaseRfisProps {
inputValue?: string;
Expand Down Expand Up @@ -121,6 +122,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
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import Breadcrumbs from '../../../components/Breadcrumbs';
import DataTable from '../../../components/dataGrid/DataTable';
import { UsePreloadedPaginationFragment } from '../../../utils/hooks/usePreloadedPaginationFragment';
import { DataTableProps } from '../../../components/dataGrid/dataTableTypes';
import useConnectedDocumentModifier from '../../../utils/hooks/useConnectedDocumentModifier';

interface CaseRftsProps {
inputValue?: string;
Expand Down Expand Up @@ -123,6 +124,8 @@ 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 {
platformModuleHelpers: { isRuntimeFieldEnable },
} = useAuth();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import Breadcrumbs from '../../../components/Breadcrumbs';
import DataTable from '../../../components/dataGrid/DataTable';
import { UsePreloadedPaginationFragment } from '../../../utils/hooks/usePreloadedPaginationFragment';
import { DataTableProps } from '../../../components/dataGrid/dataTableTypes';
import useConnectedDocumentModifier from '../../../utils/hooks/useConnectedDocumentModifier';

interface FeedbacksProps {
inputValue?: string;
Expand Down Expand Up @@ -119,6 +120,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 @@ -13,6 +13,7 @@ import DataTable from '../../../components/dataGrid/DataTable';
import { UsePreloadedPaginationFragment } from '../../../utils/hooks/usePreloadedPaginationFragment';
import ItemDueDate from '../../../components/ItemDueDate';
import { DataTableProps } from '../../../components/dataGrid/dataTableTypes';
import useConnectedDocumentModifier from '../../../utils/hooks/useConnectedDocumentModifier';

const tasksLinesQuery = graphql`
query TasksLinesPaginationQuery(
Expand Down Expand Up @@ -73,6 +74,8 @@ export const LOCAL_STORAGE_KEY_TASKS = 'cases-casesTasks';

const Tasks = () => {
const { t_i18n } = useFormatter();
const { setTitle } = useConnectedDocumentModifier();
setTitle(t_i18n('Tasks | Cases'));

const initialValues = {
searchTerm: '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import Loader, { LoaderVariant } from '../../../components/Loader';
import useQueryLoading from '../../../utils/hooks/useQueryLoading';
import Breadcrumbs from '../../../components/Breadcrumbs';
import { useFormatter } from '../../../components/i18n';
import useConnectedDocumentModifier from '../../../utils/hooks/useConnectedDocumentModifier';

const LOCAL_STORAGE_KEY_CSV_MAPPERS = 'csvMappers';

Expand All @@ -28,6 +29,8 @@ const useStyles = makeStyles(() => ({
const CsvMappers = () => {
const classes = useStyles();
const { t_i18n } = useFormatter();
const { setTitle } = useConnectedDocumentModifier();
setTitle(t_i18n('Processing: CSV Mappers | Data'));
const { viewStorage, paginationOptions, helpers } = usePaginationLocalStorage<csvMappers_MappersQuery$variables>(
LOCAL_STORAGE_KEY_CSV_MAPPERS,
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@ import Breadcrumbs from '../../../components/Breadcrumbs';
import DataTable from '../../../components/dataGrid/DataTable';
import { UsePreloadedPaginationFragment } from '../../../utils/hooks/usePreloadedPaginationFragment';
import { DataTableProps } from '../../../components/dataGrid/dataTableTypes';
import useConnectedDocumentModifier from '../../../utils/hooks/useConnectedDocumentModifier';

const LOCAL_STORAGE_KEY = 'entities';

const Entities = () => {
const { t_i18n } = useFormatter();
const { setTitle } = useConnectedDocumentModifier();
setTitle(t_i18n('Entities | Data'));
const {
platformModuleHelpers: { isRuntimeFieldEnable },
} = useAuth();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ import Breadcrumbs from '../../../components/Breadcrumbs';
import { useFormatter } from '../../../components/i18n';
import { TAXIIAPI_SETCOLLECTIONS } from '../../../utils/hooks/useGranted';
import Security from '../../../utils/Security';
import useConnectedDocumentModifier from '../../../utils/hooks/useConnectedDocumentModifier';

const Feed = () => {
const { t_i18n } = useFormatter();
const { setTitle } = useConnectedDocumentModifier();
setTitle(t_i18n('Data sharing: CSV Feeds | Data'));
const LOCAL_STORAGE_KEY = 'feed';
const navigate = useNavigate();
const location = useLocation();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import useQueryLoading from '../../../utils/hooks/useQueryLoading';
import { INGESTION_SETINGESTIONS } from '../../../utils/hooks/useGranted';
import Security from '../../../utils/Security';
import Breadcrumbs from '../../../components/Breadcrumbs';
import useConnectedDocumentModifier from '../../../utils/hooks/useConnectedDocumentModifier';

const LOCAL_STORAGE_KEY = 'ingestionCsvs';

Expand All @@ -30,6 +31,8 @@ const useStyles = makeStyles(() => ({
const IngestionCsv = () => {
const classes = useStyles();
const { t_i18n } = useFormatter();
const { setTitle } = useConnectedDocumentModifier();
setTitle(t_i18n('Ingestion: CSV Feeds | Data'));
const { platformModuleHelpers } = useAuth();
const {
viewStorage,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import IngestionMenu from './IngestionMenu';
import Breadcrumbs from '../../../components/Breadcrumbs';
import Security from '../../../utils/Security';
import { INGESTION_SETINGESTIONS } from '../../../utils/hooks/useGranted';
import useConnectedDocumentModifier from '../../../utils/hooks/useConnectedDocumentModifier';

const LOCAL_STORAGE_KEY = 'ingestionRss';

Expand All @@ -28,6 +29,8 @@ const useStyles = makeStyles(() => ({
const IngestionRss = () => {
const classes = useStyles();
const { t_i18n } = useFormatter();
const { setTitle } = useConnectedDocumentModifier();
setTitle(t_i18n('Ingestion: RSS Feeds | Data'));
const { platformModuleHelpers } = useAuth();
const {
viewStorage,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import IngestionMenu from './IngestionMenu';
import Breadcrumbs from '../../../components/Breadcrumbs';
import Security from '../../../utils/Security';
import { INGESTION_SETINGESTIONS } from '../../../utils/hooks/useGranted';
import useConnectedDocumentModifier from '../../../utils/hooks/useConnectedDocumentModifier';

const LOCAL_STORAGE_KEY = 'ingestionTaxii';

Expand All @@ -28,6 +29,8 @@ const useStyles = makeStyles(() => ({
const IngestionTaxii = () => {
const classes = useStyles();
const { t_i18n } = useFormatter();
const { setTitle } = useConnectedDocumentModifier();
setTitle(t_i18n('Ingestion: TAXII Feeds | Data'));
const { platformModuleHelpers } = useAuth();
const {
viewStorage,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import type { Theme } from '../../../components/Theme';
import useEnterpriseEdition from '../../../utils/hooks/useEnterpriseEdition';
import { useFormatter } from '../../../components/i18n';
import Breadcrumbs from '../../../components/Breadcrumbs';
import useConnectedDocumentModifier from '../../../utils/hooks/useConnectedDocumentModifier';

export const LOCAL_STORAGE_KEY_PLAYBOOKS = 'playbooks';

Expand All @@ -46,6 +47,8 @@ const Playbooks: FunctionComponent = () => {
const classes = useStyles();
const isEnterpriseEdition = useEnterpriseEdition();
const { t_i18n } = useFormatter();
const { setTitle } = useConnectedDocumentModifier();
setTitle(t_i18n('Processing: Automation | Data'));
const { viewStorage, helpers, paginationOptions } = usePaginationLocalStorage<PlaybooksLinesPaginationQuery$variables>(
LOCAL_STORAGE_KEY_PLAYBOOKS,
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { DataTableProps } from '../../../components/dataGrid/dataTableTypes';
import ItemIcon from '../../../components/ItemIcon';
import { itemColor } from '../../../utils/Colors';
import ItemEntityType from '../../../components/ItemEntityType';
import useConnectedDocumentModifier from '../../../utils/hooks/useConnectedDocumentModifier';

const LOCAL_STORAGE_KEY = 'relationships';

Expand Down Expand Up @@ -216,6 +217,8 @@ export const relationshipsStixCoreRelationshipsLinesFragment = graphql`

const Relationships = () => {
const { t_i18n } = useFormatter();
const { setTitle } = useConnectedDocumentModifier();
setTitle(t_i18n('Relationships | Data'));
const {
platformModuleHelpers: { isRuntimeFieldEnable },
} = useAuth();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import IngestionMenu from './IngestionMenu';
import Breadcrumbs from '../../../components/Breadcrumbs';
import Security from '../../../utils/Security';
import { INGESTION_SETINGESTIONS } from '../../../utils/hooks/useGranted';
import useConnectedDocumentModifier from '../../../utils/hooks/useConnectedDocumentModifier';

const LOCAL_STORAGE_KEY = 'sync';

Expand All @@ -30,6 +31,8 @@ const Sync = () => {
const theme = useTheme();
const classes = useStyles();
const { t_i18n } = useFormatter();
const { setTitle } = useConnectedDocumentModifier();
setTitle(t_i18n('Ingestion: Remote OCTI Streams | Data'));
const { platformModuleHelpers } = useAuth();
const {
viewStorage,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import useAuth from '../../../utils/hooks/useAuth';
import { TASK_MANAGER } from '../../../utils/platformModulesHelper';
import ProcessingMenu from './ProcessingMenu';
import Breadcrumbs from '../../../components/Breadcrumbs';
import useConnectedDocumentModifier from '../../../utils/hooks/useConnectedDocumentModifier';

// Deprecated - https://mui.com/system/styles/basics/
// Do not use it for new code.
Expand All @@ -22,6 +23,8 @@ const useStyles = makeStyles(() => ({

const Tasks = () => {
const { t_i18n } = useFormatter();
const { setTitle } = useConnectedDocumentModifier();
setTitle(t_i18n('Processing: Tasks | Data'));
const classes = useStyles();
const { platformModuleHelpers } = useAuth();
const optionsInProgress = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ import Breadcrumbs from '../../../components/Breadcrumbs';
import { useFormatter } from '../../../components/i18n';
import { TAXIIAPI_SETCOLLECTIONS } from '../../../utils/hooks/useGranted';
import Security from '../../../utils/Security';
import useConnectedDocumentModifier from '../../../utils/hooks/useConnectedDocumentModifier';

const Taxii = () => {
const { t_i18n } = useFormatter();
const { setTitle } = useConnectedDocumentModifier();
setTitle(t_i18n('Data sharing: TAXII Collections | Data'));
const LOCAL_STORAGE_KEY = 'taxii';
const navigate = useNavigate();
const location = useLocation();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import useApiMutation from '../../../../utils/hooks/useApiMutation';
import Breadcrumbs from '../../../../components/Breadcrumbs';
import { UsePreloadedPaginationFragment } from '../../../../utils/hooks/usePreloadedPaginationFragment';
import { deleteNode } from '../../../../utils/store';
import useConnectedDocumentModifier from '../../../../utils/hooks/useConnectedDocumentModifier';

export const WorkbenchFileLineDeleteMutation = graphql`
mutation ImportFilesContentFileLineDeleteMutation($fileName: String) {
Expand Down Expand Up @@ -123,6 +124,8 @@ const LOCAL_STORAGE_KEY = 'importFiles';

const ImportFilesContent = () => {
const { t_i18n } = useFormatter();
const { setTitle } = useConnectedDocumentModifier();
setTitle(t_i18n('Import: Upload Files | Data'));
const [displayDelete, setDisplayDelete] = useState<string>('');

const initialValues = {
Expand Down
Loading

0 comments on commit bee25ba

Please sign in to comment.