Skip to content

Commit

Permalink
[frontend] UI improvements to content mapping suggestion page (#5651)
Browse files Browse the repository at this point in the history
Co-authored-by: Landry Trebon <[email protected]>
Co-authored-by: Laurent Bonnet <[email protected]>
Co-authored-by: Adrien Servel <[email protected]>
  • Loading branch information
4 people committed Jun 28, 2024
1 parent 29c2724 commit ee40e06
Show file tree
Hide file tree
Showing 18 changed files with 318 additions and 220 deletions.
4 changes: 4 additions & 0 deletions opencti-platform/opencti-front/lang/front/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@
"Already in plat.": "Bereits in plat.",
"Also delete these elements": "Löschen Sie auch diese Elemente",
"Also include first neighbours": "Auch erste Nachbarn einbeziehen",
"An analysis connector needs to be available to ask for a mapping suggestion.": "Es muss ein Analysekonnektor vorhanden sein, um einen Abbildungsvorschlag anzufordern.",
"An analysis is ongoing, waiting for results.": "Eine Analyse ist im Gange und wartet auf Ergebnisse.",
"An instance trigger on an entity X notifies the following events: update/deletion of X, creation/deletion of a relationship from/to X, creation/deletion of an entity that has X in its refs (for instance contains X, is shared with X, is created by X...), adding/removing X in the ref of an entity.": "Ein Instanz-Trigger auf eine Entität X meldet die folgenden Ereignisse: Aktualisierung/Löschung von X, Erstellung/Löschung einer Beziehung von/zu X, Erstellung/Löschung einer Entität, die X in ihren Referenzen hat (z.B. enthält X, wird mit X geteilt, wird von X erstellt...), Hinzufügen/Entfernen von X in der Referenz einer Entität.",
"An unknown error has occurred! Please try again later.": "Es ist ein unbekannter Fehler aufgetreten! Bitte versuchen Sie es später noch einmal.",
"An unknown error has occurred! Please try again later.": "Es ist ein unbekannter Fehler aufgetreten! Bitte versuchen Sie es später noch einmal.",
Expand Down Expand Up @@ -1653,6 +1655,7 @@
"No available public CSV feeds on this platform": "Keine verfügbaren öffentlichen CSV-Feeds auf dieser Plattform",
"No available public stream on this platform": "Kein öffentlicher Stream auf dieser Plattform verfügbar",
"No available public taxii collections on this platform": "Keine öffentlichen Taxii-Sammlungen auf dieser Plattform verfügbar",
"No changes detected": "Keine Änderungen festgestellt",
"No confidence level found in this user's groups, and no confidence level defined at the user level.": "In den Gruppen dieses Benutzers wurde kein Konfidenzniveau gefunden, und auf Benutzerebene wurde kein Konfidenzniveau definiert.",
"No connector available for the selected entities.": "Kein Konnektor für die ausgewählten Entitäten verfügbar.",
"No connectors are enabled on this platform.": "Auf dieser Plattform sind keine Konnektoren aktiviert.",
Expand Down Expand Up @@ -2865,6 +2868,7 @@
"You do not have any access to the knowledge of this OpenCTI instance.": "Sie haben keinen Zugriff auf das Wissen dieser OpenCTI-Instanz.",
"You have no subscription for the moment.": "Sie haben im Moment kein Abonnement.",
"You have successfully logged out.": "Sie haben sich erfolgreich abgemeldet.",
"You have unsaved changes": "Sie haben ungespeicherte Änderungen",
"You must be logged in to do this.": "Sie müssen eingeloggt sein, um dies zu tun.",
"You must provide at least one external reference for this type of entity": "Sie müssen mindestens einen externen Verweis für diese Art von Entität angeben",
"You need a confidence level to edit objects in the platform.": "Du benötigst ein Vertrauensniveau, um Objekte auf der Plattform zu bearbeiten.",
Expand Down
4 changes: 4 additions & 0 deletions opencti-platform/opencti-front/lang/front/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@
"Already in plat.": "Already in plat.",
"Also delete these elements": "Also delete these elements",
"Also include first neighbours": "Also include first neighbours",
"An analysis connector needs to be available to ask for a mapping suggestion.": "An analysis connector needs to be available to ask for a mapping suggestion.",
"An analysis is ongoing, waiting for results.": "An analysis is ongoing, waiting for results.",
"An instance trigger on an entity X notifies the following events: update/deletion of X, creation/deletion of a relationship from/to X, creation/deletion of an entity that has X in its refs (for instance contains X, is shared with X, is created by X...), adding/removing X in the ref of an entity.": "An instance trigger on an entity X notifies the following events: update/deletion of X, creation/deletion of a relationship from/to X, creation/deletion of an entity that has X in its refs (for instance contains X, is shared with X, is created by X...), adding/removing X in the ref of an entity.",
"An unknown error has occurred! Please try again later.": "An unknown error has occurred! Please try again later.",
"An unknown error has occurred! Please try again later.": "An unknown error has occurred! Please try again later.",
Expand Down Expand Up @@ -1653,6 +1655,7 @@
"No available public CSV feeds on this platform": "No available public CSV feeds on this platform",
"No available public stream on this platform": "No available public stream on this platform",
"No available public taxii collections on this platform": "No available public taxii collections on this platform",
"No changes detected": "No changes detected",
"No confidence level found in this user's groups, and no confidence level defined at the user level.": "No confidence level found in this user's groups, and no confidence level defined at the user level.",
"No connector available for the selected entities.": "No connector available for the selected entities.",
"No connectors are enabled on this platform.": "No connectors are enabled on this platform.",
Expand Down Expand Up @@ -2865,6 +2868,7 @@
"You do not have any access to the knowledge of this OpenCTI instance.": "You do not have any access to the knowledge of this OpenCTI instance.",
"You have no subscription for the moment.": "You have no subscription for the moment.",
"You have successfully logged out.": "You have successfully logged out.",
"You have unsaved changes": "You have unsaved changes",
"You must be logged in to do this.": "You must be logged in to do this.",
"You must provide at least one external reference for this type of entity": "You must provide at least one external reference for this type of entity",
"You need a confidence level to edit objects in the platform.": "You need a confidence level to edit objects in the platform.",
Expand Down
4 changes: 4 additions & 0 deletions opencti-platform/opencti-front/lang/front/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@
"Already in plat.": "Ya está en la plataforma.",
"Also delete these elements": "También elimine estos elementos",
"Also include first neighbours": "Incluya también a los primeros vecinos",
"An analysis connector needs to be available to ask for a mapping suggestion.": "Es necesario disponer de un conector de análisis para solicitar una sugerencia de asignación.",
"An analysis is ongoing, waiting for results.": "Un análisis está en curso, a la espera de los resultados.",
"An instance trigger on an entity X notifies the following events: update/deletion of X, creation/deletion of a relationship from/to X, creation/deletion of an entity that has X in its refs (for instance contains X, is shared with X, is created by X...), adding/removing X in the ref of an entity.": "Un desencadenador de instancia en una entidad X notifica los siguientes eventos: actualización/eliminación de X, creación/eliminación de una relación de/hacia X, creación/eliminación de una entidad que tiene X en sus referencias (por ejemplo, contiene X, se comparte con X, es creada por X...), agrega/elimina X en la referencia de una entidad.",
"An unknown error has occurred! Please try again later.": "Ha ocurrido un error desconocido. Inténtalo de nuevo más tarde.",
"An unknown error has occurred! Please try again later.": "Se ha producido un error desconocido Vuelva a intentarlo más tarde.",
Expand Down Expand Up @@ -1653,6 +1655,7 @@
"No available public CSV feeds on this platform": "No hay fuentes CSV públicas disponibles en esta plataforma",
"No available public stream on this platform": "No hay ningún stream público disponible en esta plataforma",
"No available public taxii collections on this platform": "No hay colecciones Taxii públicas disponibles en esta plataforma",
"No changes detected": "No se han detectado cambios",
"No confidence level found in this user's groups, and no confidence level defined at the user level.": "No se ha encontrado ningún nivel de confianza en los grupos de este usuario, y no se ha definido ningún nivel de confianza a nivel de usuario.",
"No connector available for the selected entities.": "Ningún conector disponible para las entidades seleccionadas.",
"No connectors are enabled on this platform.": "Ningún conector se ha habilitado en esta plataforma.",
Expand Down Expand Up @@ -2865,6 +2868,7 @@
"You do not have any access to the knowledge of this OpenCTI instance.": "No tienes acceso al conocimiento de esta instancia de OpenCTI.",
"You have no subscription for the moment.": "No tienes ninguna suscripción por el momento.",
"You have successfully logged out.": "Has cerrado sesión con éxito.",
"You have unsaved changes": "Tiene cambios sin guardar",
"You must be logged in to do this.": "Tienes que iniciar sesión para hacer esto.",
"You must provide at least one external reference for this type of entity": "Debes facilitar al menos una referencia externa para este tipo de entidad",
"You need a confidence level to edit objects in the platform.": "Necesitas un nivel de confianza para editar objetos en la plataforma.",
Expand Down
4 changes: 4 additions & 0 deletions opencti-platform/opencti-front/lang/front/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@
"Already in plat.": "Déjà dans la plat.",
"Also delete these elements": "Supprimer aussi ces éléments",
"Also include first neighbours": "Inclure également les premiers voisins",
"An analysis connector needs to be available to ask for a mapping suggestion.": "Un connecteur d'analyse doit être disponible pour demander une suggestion de mappage.",
"An analysis is ongoing, waiting for results.": "Une analyse est en cours, en attente de résultats.",
"An instance trigger on an entity X notifies the following events: update/deletion of X, creation/deletion of a relationship from/to X, creation/deletion of an entity that has X in its refs (for instance contains X, is shared with X, is created by X...), adding/removing X in the ref of an entity.": "Un déclencheur d’instance sur une entité X notifie les événements suivants : mise à jour/suppression de X, création/suppression d’une relation de/vers X, création/suppression d’une entité qui a X dans ses refs (par exemple contient X, est partagée avec X, est créée par X...), ajout/suppression de X dans la ref d’une entité.",
"An unknown error has occurred! Please try again later.": "Une erreur est survenue ! Merci de rééssayer plus tard.",
"An unknown error has occurred! Please try again later.": "Une erreur inconnue s'est produite ! Veuillez réessayer plus tard.",
Expand Down Expand Up @@ -1653,6 +1655,7 @@
"No available public CSV feeds on this platform": "Aucun flux CSV public disponible sur cette plateforme",
"No available public stream on this platform": "Aucun flux public disponible sur cette plateforme",
"No available public taxii collections on this platform": "Pas de collections publiques Taxii disponibles sur cette plateforme",
"No changes detected": "Aucun changement détecté",
"No confidence level found in this user's groups, and no confidence level defined at the user level.": "Aucun niveau de confiance n'a été trouvé dans les groupes de cet utilisateur, et aucun niveau de confiance n'a été défini au niveau de l'utilisateur.",
"No connector available for the selected entities.": "Aucun connecteur disponible pour les entités sélectionnées.",
"No connectors are enabled on this platform.": "Aucun connecteur n'est actif sur cette plateforme",
Expand Down Expand Up @@ -2865,6 +2868,7 @@
"You do not have any access to the knowledge of this OpenCTI instance.": "Vous n'avez aucun accès à la connaissance de cette instance OpenCTI.",
"You have no subscription for the moment.": "Vous n'avez aucune souscription pour le moment.",
"You have successfully logged out.": "Vous avez bien été déconnecté.",
"You have unsaved changes": "Vous avez des modifications non enregistrées",
"You must be logged in to do this.": "Vous devez être authentifié pour faire cette action.",
"You must provide at least one external reference for this type of entity": "Vous devez fournir au moins une référence externe pour ce type d'entité",
"You need a confidence level to edit objects in the platform.": "Vous avez besoin d'un niveau de confiance pour éditer des objets sur la plateforme.",
Expand Down
4 changes: 4 additions & 0 deletions opencti-platform/opencti-front/lang/front/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@
"Already in plat.": "すでにプラットフォームに存在します",
"Also delete these elements": "これらの要素も削除します",
"Also include first neighbours": "また、最初の隣人",
"An analysis connector needs to be available to ask for a mapping suggestion.": "分析コネクターは、マッピングの提案を求めるために利用できる必要がある。",
"An analysis is ongoing, waiting for results.": "分析が進行中で、結果を待っている。",
"An instance trigger on an entity X notifies the following events: update/deletion of X, creation/deletion of a relationship from/to X, creation/deletion of an entity that has X in its refs (for instance contains X, is shared with X, is created by X...), adding/removing X in the ref of an entity.": "エンティティ X のインスタンス トリガーは、次のイベントを通知します: X の更新/削除、X からの/へのリレーションシップの作成/削除、参照に X を持つエンティティの作成/削除 (たとえば、X を含む、X と共有されている、X によって作成されている...)、エンティティの参照で X を追加/削除します。",
"An unknown error has occurred! Please try again later.": "不明なエラーが発生しました。後でもう一度お試しください。",
"An unknown error has occurred! Please try again later.": "不明なエラーが発生しました!後で再試行してください。",
Expand Down Expand Up @@ -1653,6 +1655,7 @@
"No available public CSV feeds on this platform": "このプラットフォームで利用可能な公開CSVフィードはありません",
"No available public stream on this platform": "このプラットフォームで利用可能なパブリックストリームはありません",
"No available public taxii collections on this platform": "このプラットフォームで利用可能なパブリックTaxiiコレクションはありません。",
"No changes detected": "変更なし",
"No confidence level found in this user's groups, and no confidence level defined at the user level.": "このユーザのグループには信頼度が見つからず、ユーザ・レベルでは信頼度が定義されていません。",
"No connector available for the selected entities.": "選択したエンティティに有効なコネクタはありません。",
"No connectors are enabled on this platform.": "有効なコネクタがありません。",
Expand Down Expand Up @@ -2865,6 +2868,7 @@
"You do not have any access to the knowledge of this OpenCTI instance.": "このOpenCTIインスタンスのナレッジデータにアクセスする権限がありません。",
"You have no subscription for the moment.": "現在、サブスクリプションはありません。",
"You have successfully logged out.": "ログアウトが完了しました。",
"You have unsaved changes": "未保存の変更があります",
"You must be logged in to do this.": "この操作を行うにはログインする必要があります。",
"You must provide at least one external reference for this type of entity": "このタイプのエンティティは最低1個の外部参照を含む必要があります",
"You need a confidence level to edit objects in the platform.": "プラットフォーム上でオブジェクトを編集するには、最大の自信レベルが必要です。",
Expand Down
4 changes: 4 additions & 0 deletions opencti-platform/opencti-front/lang/front/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@
"Already in plat.": "已经在平台",
"Also delete these elements": "同时删除这些元素",
"Also include first neighbours": "还包括第一个邻居",
"An analysis connector needs to be available to ask for a mapping suggestion.": "需要有一个分析连接器来询问映射建议。",
"An analysis is ongoing, waiting for results.": "分析正在进行,等待结果。",
"An instance trigger on an entity X notifies the following events: update/deletion of X, creation/deletion of a relationship from/to X, creation/deletion of an entity that has X in its refs (for instance contains X, is shared with X, is created by X...), adding/removing X in the ref of an entity.": "实体 X 的实例触发器会通知以下事件:更新/删除 X、创建/删除与 X 的关系、创建/删除在其引用中包含 X 的实体(例如包含 X、与 X 共享、由 X 创建......)、在实体的引用中添加/删除 X。",
"An unknown error has occurred! Please try again later.": "发生未知错误,请稍后再试。",
"An unknown error has occurred! Please try again later.": "出现未知错误!请稍后再试。",
Expand Down Expand Up @@ -1653,6 +1655,7 @@
"No available public CSV feeds on this platform": "该平台上没有可用的公共 CSV 源",
"No available public stream on this platform": "此平台上没有可用的公共流",
"No available public taxii collections on this platform": "该平台上没有可用的公共Taxii集合",
"No changes detected": "未检测到变化",
"No confidence level found in this user's groups, and no confidence level defined at the user level.": "在该用户组中未发现置信度,也未在用户级别定义置信度。",
"No connector available for the selected entities.": "没有可用于选定实体的连接器。",
"No connectors are enabled on this platform.": "此平台未启用任何连接器。",
Expand Down Expand Up @@ -2865,6 +2868,7 @@
"You do not have any access to the knowledge of this OpenCTI instance.": "您无权访问此OpenCTI实例的知识数据。",
"You have no subscription for the moment.": "您暂时没有订阅。",
"You have successfully logged out.": "您已成功注销。",
"You have unsaved changes": "您有未保存的更改",
"You must be logged in to do this.": "您必须登录才能执行此操作。",
"You must provide at least one external reference for this type of entity": "您必须为此类实体提供至少一个外部参照",
"You need a confidence level to edit objects in the platform.": "编辑平台中的对象需要信任级别。",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ const RichTextField = (props) => {
field: { name, value },
meta = {},
onFocus,
onChange,
onSubmit,
onSelect,
label,
Expand Down Expand Up @@ -105,6 +106,7 @@ const RichTextField = (props) => {
data={value || ''}
onChange={(_, editor) => {
setFieldValue(name, editor.getData());
onChange?.(name, editor.getData() || '');
}}
onBlur={internalOnBlur}
onFocus={internalOnFocus}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,11 @@ const ContainerContentComponent = ({ containerData }) => {
const contentMapping = {};
for (const mappedString of mappedStrings) {
const escapedMappedString = mappedString.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
const descriptionRegex = new RegExp(escapedMappedString, 'ig');
const descriptionRegex = new RegExp(`\\b(${escapedMappedString})\\b`, 'gi');
const descriptionCount = (
(description || '').match(descriptionRegex) || []
).length;
const contentRegex = new RegExp(escapedMappedString, 'ig');
const contentRegex = new RegExp(`\\b(${escapedMappedString})\\b`, 'gi');
const contentCount = ((contentField || '').match(contentRegex) || []).length;
contentMapping[mappedString] = descriptionCount + contentCount;
}
Expand Down
Loading

0 comments on commit ee40e06

Please sign in to comment.