Skip to content

Commit

Permalink
[frontend] Fix some tiny issues in the diamond model
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuelHassine committed Jun 24, 2024
1 parent c17c7b1 commit d6fc673
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 5 deletions.
2 changes: 2 additions & 0 deletions opencti-platform/opencti-front/lang/front/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
"advanced": "fortgeschritten",
"Advanced options": "Erweiterte Optionen",
"Advanced search": "Erweiterte Suche",
"Adversary": "Widersacher",
"Affected software": "Betroffene Software",
"Affecting this sector": "Beeinflussung dieses Sektors",
"AI Powered": "KI-gesteuert",
Expand Down Expand Up @@ -1295,6 +1296,7 @@
"Information type": "Informationstyp",
"information_types": "informationstypen",
"Information_types": "Informationstypen",
"Infrastructure": "Infrastruktur",
"Infrastructure types": "Infrastruktur-Typen",
"infrastructure-architect": "infrastruktur-Architekt",
"infrastructure-operator": "infrastruktur-Betreiber",
Expand Down
2 changes: 2 additions & 0 deletions opencti-platform/opencti-front/lang/front/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
"advanced": "advanced",
"Advanced options": "Advanced options",
"Advanced search": "Advanced search",
"Adversary": "Adversary",
"Affected software": "Affected software",
"Affecting this sector": "Affecting this sector",
"AI Powered": "AI Powered",
Expand Down Expand Up @@ -1295,6 +1296,7 @@
"Information type": "Information type",
"Information_types": "Information Types",
"information_types": "information types",
"Infrastructure": "Infrastructure",
"Infrastructure types": "Infrastructure types",
"infrastructure-architect": "infrastructure-architect",
"infrastructure-operator": "infrastructure-operator",
Expand Down
2 changes: 2 additions & 0 deletions opencti-platform/opencti-front/lang/front/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
"advanced": "Avanzada",
"Advanced options": "Opciones avanzadas",
"Advanced search": "Búsqueda avanzada",
"Adversary": "Adversario",
"Affected software": "Aplicaciones afectadas",
"Affecting this sector": "Afecta a este sector",
"AI Powered": "AI Powered",
Expand Down Expand Up @@ -1295,6 +1296,7 @@
"Information type": "Tipo de información",
"information_types": "tipos de información",
"Information_types": "Tipos de información",
"Infrastructure": "Infraestructura",
"Infrastructure types": "Tipos de infraestructura",
"infrastructure-architect": "Arquitecto de infraestructura",
"infrastructure-operator": "Operador de infraestrusctura",
Expand Down
2 changes: 2 additions & 0 deletions opencti-platform/opencti-front/lang/front/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
"advanced": "avancé",
"Advanced options": "Options avancées",
"Advanced search": "Recherche avancée",
"Adversary": "Adversaire",
"Affected software": "Logiciels affectés",
"Affecting this sector": "Affectant ce secteur",
"AI Powered": "AI Powered",
Expand Down Expand Up @@ -1295,6 +1296,7 @@
"Information type": "Type d'informations",
"information_types": "types d'informations",
"Information_types": "Types d'informations",
"Infrastructure": "Infrastructure",
"Infrastructure types": "Types d'infrastructure",
"infrastructure-architect": "architecte d'infrastructure",
"infrastructure-operator": "infrastructure-operator",
Expand Down
3 changes: 3 additions & 0 deletions opencti-platform/opencti-front/lang/front/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
"advanced": "高度",
"Advanced options": "高度なオプション",
"Advanced search": "詳細検索",
"Adversary": "逆賊",
"Affected software": "影響を受けるソフトウェア",
"Affecting this sector": "このセクターに影響があるもの",
"AI Powered": "AI搭載",
Expand Down Expand Up @@ -1295,6 +1296,7 @@
"Information type": "情報タイプ",
"information_types": "情報の種類",
"Information_types": "情報の種類",
"Infrastructure": "インフラ",
"Infrastructure types": "インフラストラクチャ種別",
"infrastructure-architect": "インフラストラクチャ設計者",
"infrastructure-operator": "インフラストラクチャ運用者",
Expand Down Expand Up @@ -2760,6 +2762,7 @@
"Victimology (regions)": "被害者学(地域)",
"Victimology (sectors)": "被害者学(セクター)",
"View": "表示",
"View all": "全てを見る",
"View all entities created by user": "ユーザーによって作成されたすべてのエンティティを表示する",
"View all relationships created by user": "ユーザーによって作成されたすべての関係を表示する",
"View the item": "アイテムの表示",
Expand Down
2 changes: 2 additions & 0 deletions opencti-platform/opencti-front/lang/front/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
"advanced": "高级",
"Advanced options": "高级选项",
"Advanced search": "高级搜索",
"Adversary": "对手",
"Affected software": "受影响的软件",
"Affecting this sector": "影响此部门",
"AI Powered": "人工智能技术",
Expand Down Expand Up @@ -1295,6 +1296,7 @@
"Information type": "信息类型",
"information_types": "信息类型",
"Information_types": "信息类型",
"Infrastructure": "基础设施",
"Infrastructure types": "基础设施类型",
"infrastructure-architect": "基础设施架构师",
"infrastructure-operator": "基础设施操作员",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import nodeTypes from './diamond/types/nodes';
import edgeTypes from './diamond/types/edges';
import { ErrorBoundary } from '../../Error';
import { stixDomainObjectThreatDiamondQuery } from './StixDomainObjectThreatDiamondQuery';
import { useFormatter } from '../../../../components/i18n';

const useStyles = makeStyles(() => ({
container: {
Expand All @@ -25,6 +26,7 @@ const defaultEdgeOptions = {

const StixDomainObjectDiamondComponent = ({ entityLink, data }) => {
const classes = useStyles();
const { t_i18n } = useFormatter();
const { stixDomainObject } = data;
const initialNodes = [
{
Expand Down Expand Up @@ -85,7 +87,7 @@ const StixDomainObjectDiamondComponent = ({ entityLink, data }) => {
sourceHandle: 'adversary',
target: 'adversary',
data: {
label: 'Adversary',
label: t_i18n('Adversary'),
},
},
{
Expand All @@ -95,7 +97,7 @@ const StixDomainObjectDiamondComponent = ({ entityLink, data }) => {
sourceHandle: 'infrastructure',
target: 'infrastructure',
data: {
label: 'Infrastructure',
label: t_i18n('Infrastructure'),
},
},
{
Expand All @@ -105,7 +107,7 @@ const StixDomainObjectDiamondComponent = ({ entityLink, data }) => {
sourceHandle: 'victimology',
target: 'victimology',
data: {
label: 'Victimology',
label: t_i18n('Victimology'),
},
},
{
Expand All @@ -115,7 +117,7 @@ const StixDomainObjectDiamondComponent = ({ entityLink, data }) => {
sourceHandle: 'capabilities',
target: 'capabilities',
data: {
label: 'Capabilities',
label: t_i18n('Capabilities'),
},
},
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Handle, Position, NodeProps } from 'reactflow';
import makeStyles from '@mui/styles/makeStyles';
import type { Theme } from '../../../../../../../components/Theme';
import ItemIcon from '../../../../../../../components/ItemIcon';
import { truncate } from '../../../../../../../utils/String';

// Deprecated - https://mui.com/system/styles/basics/
// Do not use it for new code.
Expand All @@ -12,7 +13,9 @@ const useStyles = makeStyles<Theme>((theme) => ({
width: 200,
height: 200,
lineHeight: '200px',
whiteSpace: 'nowrap',
textAlign: 'center',
fontSize: 10,
margin: 10,
'&::before': {
position: 'absolute',
Expand Down Expand Up @@ -73,7 +76,7 @@ const NodeDiamond = ({ data }: NodeProps) => {
const classes = useStyles();
return (
<div className={classes.node}>
{data.name}
{truncate(data.name, 25, false)}
<div className={classes.adversary}>
<ItemIcon type="threats" size="large" color="inherit" />
</div>
Expand Down

0 comments on commit d6fc673

Please sign in to comment.