Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions openaev-api/src/main/java/io/openaev/config/AppConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public class AppConfig {
public static final String EMAIL_FORMAT = "This field must be a valid email.";
public static final String PHONE_FORMAT =
"This field must start with '+' character and country identifier.";
public static final String MAX_255_MESSAGE = "This field must be less than 255 characters.";

@Resource private OpenAEVConfig openAEVConfig;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package io.openaev.rest.exercise.form;

import static io.openaev.config.AppConfig.EMAIL_FORMAT;
import static io.openaev.config.AppConfig.MANDATORY_MESSAGE;
import static io.openaev.config.AppConfig.*;

import com.fasterxml.jackson.annotation.JsonProperty;
import jakarta.annotation.Nullable;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import java.util.ArrayList;
import java.util.List;
import lombok.Data;
Expand All @@ -19,6 +19,7 @@
public class ExerciseInput {

@NotBlank(message = MANDATORY_MESSAGE)
@Size(max = 255, message = MAX_255_MESSAGE)
@JsonProperty("exercise_name")
private String name;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const ExerciseForm: FunctionComponent<Props> = ({
mode: 'onTouched',
resolver: zodResolver(
zodImplement<CreateExerciseInput>().with({
exercise_name: z.string().min(1, { message: t('Should not be empty') }),
exercise_name: z.string().min(1, { message: t('Should not be empty') }).max(255, { message: t('Should not exceed 255 characters') }),
exercise_subtitle: z.string().optional(),
exercise_category: z.string().optional(),
exercise_main_focus: z.string().optional(),
Expand Down Expand Up @@ -95,6 +95,7 @@ const ExerciseForm: FunctionComponent<Props> = ({
control={control}
setValue={setValue}
askAi={true}
maxLength={255}
/>
<GridLegacy container spacing={2}>
<GridLegacy item xs={7}>
Expand Down
8 changes: 8 additions & 0 deletions openaev-front/src/utils/api-types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -976,6 +976,10 @@ export interface CreateExerciseInput {
exercise_main_focus?: string;
exercise_message_footer?: string;
exercise_message_header?: string;
/**
* @minLength 0
* @maxLength 255
*/
exercise_name: string;
exercise_severity?: string;
/** @format date-time */
Expand Down Expand Up @@ -6075,6 +6079,10 @@ export interface UpdateExerciseInput {
exercise_main_focus?: string;
exercise_message_footer?: string;
exercise_message_header?: string;
/**
* @minLength 0
* @maxLength 255
*/
exercise_name: string;
exercise_severity?: string;
exercise_subtitle?: string;
Expand Down
1 change: 1 addition & 0 deletions openaev-front/src/utils/lang/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -1555,6 +1555,7 @@
"Should be a valid XLS file": "Sollte eine gültige XLS-Datei sein",
"Should have at least one asset or one asset group": "Sollte mindestens ein Asset oder eine Assetgruppe enthalten",
"Should not be empty": "Darf nicht leer sein",
"Should not exceed 255 characters": "Sollte 255 Zeichen nicht überschreiten",
"Show all assets": "Alle Assets anzeigen",
"Show covered TTP only": "Nur abgedeckte TTP anzeigen",
"Show in findings": "In Befunden anzeigen",
Expand Down
1 change: 1 addition & 0 deletions openaev-front/src/utils/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1555,6 +1555,7 @@
"Should be a valid XLS file": "Should be a valid XLS file",
"Should have at least one asset or one asset group": "Should have at least one asset or one asset group",
"Should not be empty": "Should not be empty",
"Should not exceed 255 characters": "Should not exceed 255 characters",
"Show all assets": "Show all assets",
"Show covered TTP only": "Show covered TTP only",
"Show in findings": "Show in findings",
Expand Down
1 change: 1 addition & 0 deletions openaev-front/src/utils/lang/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -1555,6 +1555,7 @@
"Should be a valid XLS file": "Debe ser un archivo XLS válido",
"Should have at least one asset or one asset group": "Debe tener al menos un activo o un grupo de activos",
"Should not be empty": "No debe estar vacío",
"Should not exceed 255 characters": "No debe superar los 255 caracteres",
"Show all assets": "Mostrar todos los activos",
"Show covered TTP only": "Mostrar sólo Patrones de ataques cubiertos",
"Show in findings": "Mostrar en resultados",
Expand Down
1 change: 1 addition & 0 deletions openaev-front/src/utils/lang/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -1555,6 +1555,7 @@
"Should be a valid XLS file": "Doit être un fichier XLS valide",
"Should have at least one asset or one asset group": " Doit avoir au moins un actif ou un groupe d'actifs",
"Should not be empty": "Ne doit pas être vide",
"Should not exceed 255 characters": "Ne doit pas dépasser 255 caractères",
"Show all assets": "Afficher tous les actifs",
"Show covered TTP only": "Afficher uniquement les TTP couverts",
"Show in findings": "Afficher dans les résultats",
Expand Down
1 change: 1 addition & 0 deletions openaev-front/src/utils/lang/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -1555,6 +1555,7 @@
"Should be a valid XLS file": "Deve essere un file XLS valido",
"Should have at least one asset or one asset group": "Deve avere almeno un asset o un gruppo di asset",
"Should not be empty": "Non deve essere vuoto",
"Should not exceed 255 characters": "Non deve superare i 255 caratteri",
"Show all assets": "Mostra tutti gli asset",
"Show covered TTP only": "Mostra solo il TTP coperto",
"Show in findings": "Mostra nei risultati",
Expand Down
1 change: 1 addition & 0 deletions openaev-front/src/utils/lang/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -1555,6 +1555,7 @@
"Should be a valid XLS file": "有効なXLSファイルであること",
"Should have at least one asset or one asset group": "少なくとも1つの資産または1つの資産グループであること",
"Should not be empty": "空であってはならない",
"Should not exceed 255 characters": "255文字以内",
"Show all assets": "すべてのアセットを表示する",
"Show covered TTP only": "カバーされたTTPのみを表示する",
"Show in findings": "所見で表示",
Expand Down
1 change: 1 addition & 0 deletions openaev-front/src/utils/lang/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -1555,6 +1555,7 @@
"Should be a valid XLS file": "Должен быть действительный XLS-файл",
"Should have at least one asset or one asset group": "Должен быть хотя бы один актив или одна группа активов",
"Should not be empty": "Не должен быть пустым",
"Should not exceed 255 characters": "Не должно превышать 255 символов",
"Show all assets": "Показать все активы",
"Show covered TTP only": "Показать только покрытые ТТП",
"Show in findings": "Показать в выводах",
Expand Down
1 change: 1 addition & 0 deletions openaev-front/src/utils/lang/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -1555,6 +1555,7 @@
"Should be a valid XLS file": "应为有效XLS文件",
"Should have at least one asset or one asset group": " 应至少拥有一项资产或一个资产组",
"Should not be empty": "不能为空",
"Should not exceed 255 characters": "不应超过 255 个字符",
"Show all assets": "显示所有资产",
"Show covered TTP only": "只显示覆盖的 TTP",
"Show in findings": "在调查结果中显示",
Expand Down