Skip to content

Commit

Permalink
[frontend] roll back investigation graph after expanding a node (#3167)
Browse files Browse the repository at this point in the history
  • Loading branch information
ValentinBouzinFiligran committed Apr 8, 2024
1 parent 2d71d35 commit 8c4a973
Show file tree
Hide file tree
Showing 18 changed files with 332 additions and 22 deletions.
6 changes: 5 additions & 1 deletion opencti-platform/opencti-front/lang/back/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -628,5 +628,9 @@
"Samples": "Stichproben",
"Contains observable": "Enthält beobachtbar",
"Artifact content": "Artefaktinhalt",
"Tracking number": "Tracking nummer"
"Tracking number": "Tracking nummer",
"Entity ID": "Entitäts-ID",
"Source connector": "Quellverbinder",
"Malware analysis operating System": "Betriebssystem der Malware-Analyse",
"Allowed markings": "Erlaubte Markierungen"
}
6 changes: 5 additions & 1 deletion opencti-platform/opencti-front/lang/back/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -628,5 +628,9 @@
"Samples": "Samples",
"Contains observable": "Contains observable",
"Artifact content": "Artifact content",
"Tracking number": "Tracking number"
"Tracking number": "Tracking number",
"Entity ID": "Entity ID",
"Source connector": "Source connector",
"Malware analysis operating System": "Malware analysis operating System",
"Allowed markings": "Allowed markings"
}
6 changes: 5 additions & 1 deletion opencti-platform/opencti-front/lang/back/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -628,5 +628,9 @@
"Samples": "Muestras",
"Contains observable": "Contiene observable",
"Artifact content": "Contenido del artefacto",
"Tracking number": "El número de rastreo"
"Tracking number": "El número de rastreo",
"Entity ID": "Entidad ID",
"Source connector": "Conector fuente",
"Malware analysis operating System": "Sistema operativo de análisis de malware",
"Allowed markings": "Marcas permitidas"
}
6 changes: 5 additions & 1 deletion opencti-platform/opencti-front/lang/back/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -628,5 +628,9 @@
"Samples": "Échantillons",
"Contains observable": "Contient des observables",
"Artifact content": "Contenu de l'artefact",
"Tracking number": "Numéro de suivi"
"Tracking number": "Numéro de suivi",
"Entity ID": "ID de l'entité",
"Source connector": "Connecteur source",
"Malware analysis operating System": "Système d'exploitation pour l'analyse des logiciels malveillants",
"Allowed markings": "Marquages autorisés"
}
6 changes: 5 additions & 1 deletion opencti-platform/opencti-front/lang/back/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -628,5 +628,9 @@
"Samples": "サンプル",
"Contains observable": "観測値を含む",
"Artifact content": "人工物の内容",
"Tracking number": "追跡番号"
"Tracking number": "追跡番号",
"Entity ID": "エンティティID",
"Source connector": "ソースコネクター",
"Malware analysis operating System": "マルウェア解析オペレーティングシステム",
"Allowed markings": "許可マーク"
}
8 changes: 6 additions & 2 deletions opencti-platform/opencti-front/lang/back/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -628,5 +628,9 @@
"Samples": "样本",
"Contains observable": "包含观测值",
"Artifact content": "工件内容",
"Tracking number": "追踪号码"
}
"Tracking number": "追踪号码",
"Entity ID": "实体 ID",
"Source connector": "源连接器",
"Malware analysis operating System": "恶意软件分析操作系统",
"Allowed markings": "允许的标记"
}
14 changes: 11 additions & 3 deletions opencti-platform/opencti-front/lang/front/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -2672,8 +2672,10 @@
"Strategic": "Strategisch",
"Link created": "Link erstellt",
"Public dashboard": "Öffentliches Dashboard",
"Restore the state of the graphic before the last expansion": "Wiederherstellung des Zustands der Grafik vor der letzten Erweiterung",
"Revert to Pre-Expansion State": "Zurückkehren zum Zustand vor der Erweiterung",
"Last expansion": "Letzte Erweiterung",
"Show left navigation submenu icons": "Symbole des linken Navigations-Untermenüs anzeigen",
"Auto collapse submenus in left navigation": "Untermenüs in der linken Navigation automatisch einklappen",
"Unless specific groups are selected, user will be created with default groups only.": "Wenn keine spezifischen Gruppen ausgewählt werden, wird der Benutzer nur mit den Standardgruppen erstellt.",
"By enabling the OpenCTI Enterprise Edition, you (and your organization) agrees to the OpenCTI Enterprise Edition (EE) supplemental license terms and conditions of usage:": "Mit der Aktivierung der OpenCTI Enterprise Edition erklären Sie (und Ihre Organisation) sich mit den zusätzlichen Lizenz- und Nutzungsbedingungen der OpenCTI Enterprise Edition (EE) einverstanden:",
"OpenCTI EE is free-to-use for development, testing and research purposes as well as for non-profit organizations.": "OpenCTI EE ist für Entwicklungs-, Test- und Forschungszwecke sowie für gemeinnützige Organisationen frei nutzbar.",
Expand All @@ -2687,5 +2689,11 @@
"Credential": "Berechtigung",
"Credentials": "Berechtigungsnachweis",
"entity_Tracking-Number": "Tracking-Nummer",
"entity_Credential": "Berechtigung"
}
"entity_Credential": "Berechtigung",
"Auto collapse submenus in left navigation": "Untermenüs in der linken Navigation automatisch einklappen",
"All add or remove actions done on the graph after the last expansion will be lost.": "Alle Hinzufügungs- oder Entfernungsaktionen, die nach der letzten Erweiterung am Diagramm vorgenommen wurden, gehen verloren.",
"Disable vertical tree mode": "Vertikalen Baummodus deaktivieren",
"Enable vertical tree mode": "Vertikalen Baummodus einschalten",
"Disable horizontal tree mode": "Deaktivieren des horizontalen Baummodus",
"Enable horizontal tree mode": "Horizontalen Baummodus einschalten"
}
12 changes: 10 additions & 2 deletions opencti-platform/opencti-front/lang/front/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1849,6 +1849,9 @@
"Create investigation": "Create investigation",
"Update dashboard": "Update dashboard",
"Update investigation": "Update investigation",
"Restore the state of the graphic before the last expansion": "Restore the state of the graphic before the last expansion",
"Revert to Pre-Expansion State": "Revert to Pre-Expansion State",
"Last expansion": "Last expansion",
"Add a widget": "Add a widget",
"Update a widget": "Update a widget",
"Update an artifact": "Update an artifact",
Expand Down Expand Up @@ -2672,6 +2675,7 @@
"Operational": "Operational",
"Strategic": "Strategic",
"Link created": "Link created",
"All add or remove actions done on the graph after the last expansion will be lost.": "All add or remove actions done on the graph after the last expansion will be lost.",
"Show left navigation submenu icons": "Show left navigation submenu icons",
"Auto collapse submenus in left navigation": "Auto collapse submenus in left navigation",
"Public dashboard": "Public dashboard",
Expand All @@ -2687,5 +2691,9 @@
"Credential": "Credential",
"Credentials": "Credentials",
"entity_Tracking-Number": "Tracking number",
"entity_Credential": "Credential"
}
"entity_Credential": "Credential",
"Disable vertical tree mode": "Disable vertical tree mode",
"Enable vertical tree mode": "Enable vertical tree mode",
"Disable horizontal tree mode": "Disable horizontal tree mode",
"Enable horizontal tree mode": "Enable horizontal tree mode"
}
12 changes: 10 additions & 2 deletions opencti-platform/opencti-front/lang/front/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -2672,6 +2672,9 @@
"Strategic": "Estratégico",
"Link created": "Enlace creado",
"Public dashboard": "Cuadro de mandos público",
"Restore the state of the graphic before the last expansion": "Restaurar el estado del gráfico antes de la última ampliación",
"Revert to Pre-Expansion State": "Volver al estado anterior a la expansión",
"Last expansion": "Última expansión",
"Show left navigation submenu icons": "Mostrar iconos del submenú de navegación izquierdo",
"Auto collapse submenus in left navigation": "Submenús contraídos automáticamente en la navegación izquierda",
"Unless specific groups are selected, user will be created with default groups only.": "A menos que se seleccionen grupos específicos, el usuario se creará sólo con los grupos por defecto.",
Expand All @@ -2687,5 +2690,10 @@
"Credential": "Credencial",
"Credentials": "Cartas_credenciales",
"entity_Tracking-Number": "El número de rastreo",
"entity_Credential": "Credencial"
}
"entity_Credential": "Credencial",
"All add or remove actions done on the graph after the last expansion will be lost.": "Todas las acciones de añadir o eliminar realizadas en el grafo después de la última expansión se perderán.",
"Disable vertical tree mode": "Desactivar el modo de árbol vertical",
"Enable vertical tree mode": "Activar el modo de árbol vertical",
"Disable horizontal tree mode": "Desactivar el modo de árbol horizontal",
"Enable horizontal tree mode": "Activar el modo de árbol horizontal"
}
12 changes: 10 additions & 2 deletions opencti-platform/opencti-front/lang/front/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -2672,6 +2672,9 @@
"Strategic": "Stratégique",
"Link created": "Lien créé",
"Public dashboard": "Tableau de bord public",
"Restore the state of the graphic before the last expansion": "Rétablir l'état du graphique avant la dernière expansion",
"Revert to Pre-Expansion State": "Retour à l'état antérieur à l'expansion",
"Last expansion": "Dernière extension",
"Show left navigation submenu icons": "Afficher les icônes des sous-menus de la navigation de gauche",
"Auto collapse submenus in left navigation": "Fermer automatiquement les sous-menus de la navigation de gauche",
"Unless specific groups are selected, user will be created with default groups only.": "À moins que des groupes spécifiques ne soient sélectionnés, l'utilisateur sera créé avec les groupes par défaut uniquement.",
Expand All @@ -2687,5 +2690,10 @@
"Credential": "Identifiant",
"Credentials": "Informations d'identification",
"entity_Tracking-Number": "Numéro de suivi",
"entity_Credential": "Informations d'identification"
}
"entity_Credential": "Informations d'identification",
"All add or remove actions done on the graph after the last expansion will be lost.": "Toutes les actions d'ajout ou de suppression effectuées sur le graphique après la dernière expansion seront perdues.",
"Disable vertical tree mode": "Désactiver le mode arbre verticale",
"Enable vertical tree mode": "Activer le mode arbre verticale",
"Disable horizontal tree mode": "Désactiver le mode arbre horizontal",
"Enable horizontal tree mode": "Activer le mode arbre horizontal"
}
12 changes: 10 additions & 2 deletions opencti-platform/opencti-front/lang/front/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -2672,6 +2672,9 @@
"Strategic": "戦略的",
"Link created": "リンク作成",
"Public dashboard": "公開ダッシュボード",
"Restore the state of the graphic before the last expansion": "最後の拡張前のグラフィックの状態を復元する。",
"Revert to Pre-Expansion State": "拡張前の状態に戻す",
"Last expansion": "最後の拡張",
"Show left navigation submenu icons": "左側のナビゲーション サブメニュー アイコンを表示する",
"Auto collapse submenus in left navigation": "左側のナビゲーションのサブメニューを自動的に折りたたむ",
"Unless specific groups are selected, user will be created with default groups only.": "特定のグループを選択しない限り、ユーザーはデフォルトのグループのみで作成されます。",
Expand All @@ -2687,5 +2690,10 @@
"Credential": "資格情報",
"Credentials": "資格",
"entity_Tracking-Number": "追跡番号",
"entity_Credential": "資格情報"
}
"entity_Credential": "資格情報",
"All add or remove actions done on the graph after the last expansion will be lost.": "最後の拡張以降にグラフ上で行われた追加や削除の操作はすべて失われる。",
"Disable vertical tree mode": "垂直ツリーモードを無効にする",
"Enable vertical tree mode": "垂直ツリーモードを有効にする",
"Disable horizontal tree mode": "水平ツリーモードを無効にする",
"Enable horizontal tree mode": "水平ツリーモードを有効にする"
}
14 changes: 11 additions & 3 deletions opencti-platform/opencti-front/lang/front/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -2672,8 +2672,10 @@
"Strategic": "战略",
"Link created": "创建的链接",
"Public dashboard": "公共仪表板",
"Restore the state of the graphic before the last expansion": "恢复上次扩展前的图形状态",
"Revert to Pre-Expansion State": "恢复到扩展前状态",
"Last expansion": "最后扩",
"Show left navigation submenu icons": "显示左侧导航子菜单图标",
"Auto collapse submenus in left navigation": "自动折叠左侧导航中的子菜单",
"Unless specific groups are selected, user will be created with default groups only.": "除非选择了特定组,否则创建的用户将只包含默认组。",
"By enabling the OpenCTI Enterprise Edition, you (and your organization) agrees to the OpenCTI Enterprise Edition (EE) supplemental license terms and conditions of usage:": "启用 OpenCTI 企业版,即表示您(和您的组织)同意 OpenCTI 企业版 (EE) 补充许可条款和使用条件:",
"OpenCTI EE is free-to-use for development, testing and research purposes as well as for non-profit organizations.": "OpenCTI EE 可免费用于开发、测试和研究目的,也可用于非营利组织。",
Expand All @@ -2683,9 +2685,15 @@
"All other filters": "所有其他筛选器",
"Testing csv mapper": "测试 csv 映射器",
"This operations will only apply on labels or markings added in the context of this playbook such as enrichment or other knowledge manipulations but not if the labels or markings are already written in the platform.": "此操作仅适用于在此播放列表中添加的标签或标记,如充实或其他知识操作,但不适用于平台中已写入的标签或标记。",
"Auto collapse submenus in left navigation": "自动折叠左侧导航中的子菜单",
"The opinions has no value defined in your vocabulary. Please add them first to be able to add opinions.": "意见在您的词汇中没有定义值。请先添加意见,才能添加观点。",
"Credential": "证书",
"Credentials": "证书",
"entity_Tracking-Number": "追踪号码",
"entity_Credential": "凭据"
}
"entity_Credential": "凭据",
"All add or remove actions done on the graph after the last expansion will be lost.": "上次扩展后在图形上进行的所有添加或删除操作都将丢失。",
"Disable vertical tree mode": "禁用垂直树模式",
"Enable vertical tree mode": "启用垂直树模式",
"Disable horizontal tree mode": "禁用水平树模式",
"Enable horizontal tree mode": "启用水平树模式"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import React from 'react';
import Dialog from '@mui/material/Dialog';
import DialogTitle from '@mui/material/DialogTitle';
import DialogContent from '@mui/material/DialogContent';
import DialogActions from '@mui/material/DialogActions';
import Button from '@mui/material/Button';
import { getPreExpansionStateList } from '../utils/investigationStorage';
import { useFormatter } from '../../../../../components/i18n';

type InvestigationRollBackExpandDialogProps = {
closeDialog: () => void;
handleRollBackToPreExpansionState: () => void;
isOpen: boolean;
};

const InvestigationRollBackExpandDialog = ({ closeDialog, handleRollBackToPreExpansionState, isOpen }: InvestigationRollBackExpandDialogProps) => {
const { t_i18n, fldt } = useFormatter();

const handleSubmit = () => {
handleRollBackToPreExpansionState();
closeDialog();
};

const getLastRollBackExpandDate = () => {
const storedPreExpansion = getPreExpansionStateList();
if (storedPreExpansion) {
return fldt(JSON.parse(storedPreExpansion)[0].dateTime);
}
return null;
};

return (
<Dialog
PaperProps={{ elevation: 1 }}
open={isOpen}
onClose={closeDialog}
fullWidth={true}
maxWidth="sm"
>
<DialogTitle>{t_i18n('Revert to Pre-Expansion State')}</DialogTitle>
<DialogContent>
<p>{t_i18n('Last expansion')}: {getLastRollBackExpandDate()}</p>
<p>{t_i18n('All add or remove actions done on the graph after the last expansion will be lost.')}</p>
</DialogContent>
<DialogActions>
<Button onClick={closeDialog}>{t_i18n('Cancel')}</Button>
<Button onClick={handleSubmit} color="secondary">{t_i18n('Validate')}</Button>
</DialogActions>
</Dialog>
);
};

export default InvestigationRollBackExpandDialog;

0 comments on commit 8c4a973

Please sign in to comment.