Skip to content

Commit

Permalink
[frontend] fix UI and add translation
Browse files Browse the repository at this point in the history
  • Loading branch information
marieflorescontact committed Sep 30, 2024
1 parent e85d765 commit 2b74a59
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 38 deletions.
1 change: 1 addition & 0 deletions opencti-platform/opencti-front/lang/front/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@
"All types of relationship": "Alle Arten von Beziehungen",
"All types of target": "Alle Arten von Ziel",
"All years": "Alle Jahre",
"Allow modification of sensitive configuration": "Änderung der sensiblen Konfiguration zulassen",
"Allowed marking definitions": "Erlaubte Markierungsdefinitionen",
"Allowed markings": "Erlaubte Markierungen",
"Already in plat.": "Bereits in plat.",
Expand Down
1 change: 1 addition & 0 deletions opencti-platform/opencti-front/lang/front/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@
"All types of relationship": "All types of relationship",
"All types of target": "All types of target",
"All years": "All years",
"Allow modification of sensitive configuration": "Allow modification of sensitive configuration",
"Allowed marking definitions": "Allowed marking definitions",
"Allowed markings": "Allowed markings",
"Already in plat.": "Already in plat.",
Expand Down
1 change: 1 addition & 0 deletions opencti-platform/opencti-front/lang/front/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@
"All types of relationship": "Todos los tipos de relación",
"All types of target": "Todo los tipos de objetivo",
"All years": "Todos los años",
"Allow modification of sensitive configuration": "Permitir la modificación de la configuración sensible",
"Allowed marking definitions": "Definiciones de marcado permitidas",
"Allowed markings": "Marcas permitidas",
"Already in plat.": "Ya está en la plataforma.",
Expand Down
1 change: 1 addition & 0 deletions opencti-platform/opencti-front/lang/front/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@
"All types of relationship": "Tous les types de relation",
"All types of target": "Tous les types de cible",
"All years": "Toutes les années",
"Allow modification of sensitive configuration": "Permettre la modification d'une configuration sensible",
"Allowed marking definitions": "Définitions de marquage autorisées",
"Allowed markings": "Marquages autorisés",
"Already in plat.": "Déjà dans la plat.",
Expand Down
1 change: 1 addition & 0 deletions opencti-platform/opencti-front/lang/front/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@
"All types of relationship": "全てのリレーションシップの種別",
"All types of target": "あらゆる種類のターゲット",
"All years": "すべての年",
"Allow modification of sensitive configuration": "機密設定の変更を許可する",
"Allowed marking definitions": "許可されたマーキング定義",
"Allowed markings": "許可されるマーキング",
"Already in plat.": "すでにプラットフォームに存在します",
Expand Down
1 change: 1 addition & 0 deletions opencti-platform/opencti-front/lang/front/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@
"All types of relationship": "모든 관계 유형",
"All types of target": "모든 대상 유형",
"All years": "모든 연도",
"Allow modification of sensitive configuration": "민감한 구성의 수정 허용",
"Allowed marking definitions": "허용된 마킹 정의",
"Allowed markings": "허용된 마킹",
"Already in plat.": "이미 플랫폼에 있음",
Expand Down
1 change: 1 addition & 0 deletions opencti-platform/opencti-front/lang/front/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@
"All types of relationship": "关系的所有类型",
"All types of target": "所有类型的目标",
"All years": "所有年份",
"Allow modification of sensitive configuration": "允许修改敏感配置",
"Allowed marking definitions": "允许的标记定义",
"Allowed markings": "允许的标记",
"Already in plat.": "已经在平台",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@ import List from '@mui/material/List';
import ListItem from '@mui/material/ListItem';
import ListItemText from '@mui/material/ListItemText';
import ListItemIcon from '@mui/material/ListItemIcon';
import ListItemSecondaryAction from '@mui/material/ListItemSecondaryAction';
import Checkbox from '@mui/material/Checkbox';
import LocalPoliceOutlined from '@mui/icons-material/LocalPoliceOutlined';
import { useFormatter } from '../../../../components/i18n';
import { roleEditionCapabilitiesLinesSearch } from './RoleEditionCapabilities';
import { RoleEditionCapabilitiesLinesSearchQuery } from './__generated__/RoleEditionCapabilitiesLinesSearchQuery.graphql';
import { Role_role$data } from './__generated__/Role_role.graphql';
import ItemIcon from '../../../../components/ItemIcon';
import useSensitiveModifications from '../../../../utils/hooks/useSensitiveModifications';

interface CapabilitiesListProps {
queryRef: PreloadedQuery<RoleEditionCapabilitiesLinesSearchQuery>;
Expand All @@ -27,8 +31,23 @@ const CapabilitiesList: FunctionComponent<CapabilitiesListProps> = ({
roleEditionCapabilitiesLinesSearch,
queryRef,
);
const { ffenabled } = useSensitiveModifications();

return (
<List>
{ffenabled && (
<ListItem
key='sensitive'
dense={true}
divider={true}
style={{ paddingLeft: 0 }}
>
<ListItemIcon style={{ minWidth: 32 }}>
<ItemIcon type="Capability" />
</ListItemIcon>
<ListItemText primary={t_i18n('Allow modification of sensitive configuration')} />
</ListItem>
)}
{capabilities?.edges?.map((edge, i) => {
const capability = edge?.node;
if (capability) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ import ListItem from '@mui/material/ListItem';
import { Link } from 'react-router-dom';
import ListItemIcon from '@mui/material/ListItemIcon';
import ListItemText from '@mui/material/ListItemText';
import VerifiedUserIcon from '@mui/icons-material/VerifiedUser';
import ListItemSecondaryAction from '@mui/material/ListItemSecondaryAction';
import Checkbox from '@mui/material/Checkbox';
import List from '@mui/material/List';
import AccessesMenu from '../AccessesMenu';
import { useFormatter } from '../../../../components/i18n';
import { Role_role$data, Role_role$key } from './__generated__/Role_role.graphql';
Expand Down Expand Up @@ -179,38 +175,6 @@ const Role = ({
</Grid>
</Paper>
</Grid>
<Grid item xs={6} >
<Typography variant="h4" gutterBottom={true}>
{t_i18n('Allow modification of sensitive configuration')}
</Typography>
<Paper classes={{ root: classes.paper }} variant="outlined">
<Grid container={true} spacing={3}>
<Grid item xs={12} style={{ paddingTop: 10 }}>
{ffenabled && (
<List dense={true}>
<ListItem
key='sensitive'
divider={true}
dense={true}
style={{ paddingLeft: 0 }}
>
<ListItemIcon style={{ minWidth: 32 }}>
<VerifiedUserIcon fontSize="small" />
</ListItemIcon>
<ListItemText primary={t_i18n('Allow modification of sensitive configuration')} />
<ListItemSecondaryAction>
<Checkbox
checked={role.is_sensitive_changes_allow ? role.is_sensitive_changes_allow : false}
disabled={true}
/>
</ListItemSecondaryAction>
</ListItem>
</List>
)}
</Grid>
</Grid>
</Paper>
</Grid>
</Grid>
<QueryRenderer
query={roleEditionQuery}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import List from '@mui/material/List';
import { PreloadedQuery } from 'react-relay/relay-hooks/EntryPointTypes';
import ListItemIcon from '@mui/material/ListItemIcon';
import LocalPoliceOutlined from '@mui/icons-material/LocalPoliceOutlined';
import VerifiedUserIcon from '@mui/icons-material/VerifiedUser';
import Loader, { LoaderVariant } from '../../../../components/Loader';
import { useFormatter } from '../../../../components/i18n';
import { RoleEditionCapabilitiesLinesSearchQuery } from './__generated__/RoleEditionCapabilitiesLinesSearchQuery.graphql';
Expand Down Expand Up @@ -145,7 +144,7 @@ const RoleEditionCapabilitiesComponent: FunctionComponent<RoleEditionCapabilitie
style={{ paddingLeft: 0 }}
>
<ListItemIcon style={{ minWidth: 32 }}>
<VerifiedUserIcon fontSize="small" />
<LocalPoliceOutlined fontSize="small" />
</ListItemIcon>
<ListItemText primary={t_i18n('Allow modification of sensitive configuration')} />
<ListItemSecondaryAction>
Expand Down

0 comments on commit 2b74a59

Please sign in to comment.