Skip to content
Merged
Prev Previous commit
Next Next commit
fix review
  • Loading branch information
esrevi committed Feb 26, 2026
commit ec76bdeadf256bd8009c5c1d01f7dc7ee11afe2f
8 changes: 4 additions & 4 deletions opencti-platform/opencti-front/lang/back/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -954,10 +954,10 @@
"Theme": "Thème",
"Theme accent": "Accent thématique",
"Theme background": "Arrière-plan du thème",
"Theme login aside color": "Couleur du côté de la connexion au thème",
"Theme login aside gradient end": "Fin du dégradé de la page d'accueil du thème",
"Theme login aside gradient start": "Thème login aside gradient start",
"Theme login aside image": "Image de la page d'accueil du thème",
"Theme login aside color": "Couleur du côté de la page de connexion",
"Theme login aside gradient end": "Fin du dégradé de la page de connexion",
"Theme login aside gradient start": "Début du dégradé de la page de connexion",
"Theme login aside image": "Image de la page de connexion",
"Theme logo": "Logo du thème",
"Theme logo collapsed": "Logo du thème collapsé",
"Theme logo login": "Logo du thème login",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ interface ThemeFormProps {
submitLabel?: string;
withButtons?: boolean;
}
const asideFields = [
const loginAsideFields = [
'theme_login_aside_type',
'theme_login_aside_color',
'theme_login_aside_gradient_start',
Expand Down Expand Up @@ -96,9 +96,9 @@ const ThemeForm: FunctionComponent<ThemeFormProps> = ({
theme_login_aside_image: '',
};

asideFields.forEach((field) => setFieldValue(field, clearedValues[field]));
loginAsideFields.forEach((field) => setFieldValue(field, clearedValues[field]));

const hadSavedValues = asideFields.some((field) => !!initialValues[field])
const hadSavedValues = loginAsideFields.some((field) => !!initialValues[field])
|| !!initialValues.theme_login_aside_type;

if (type || hadSavedValues) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ const themeValidationSchema = (t_i18n: (key: string) => string) => {
theme_logo_collapsed: Yup.string().nullable(),
theme_logo_login: Yup.string().nullable(),

// ✅ IMPORTANT : champ discriminant
// the theme login aside validation is based on the type of aside selected,
// because depeding on the type, the required fields are different
theme_login_aside_type: Yup.mixed<
'' | 'color' | 'gradient' | 'image'
>().oneOf(['', 'color', 'gradient', 'image']),
Expand All @@ -64,7 +65,7 @@ const themeValidationSchema = (t_i18n: (key: string) => string) => {
}),

/**
* GRADIENT START
* GRADIENT START & END
*/
theme_login_aside_gradient_start: Yup.string()
.nullable()
Expand All @@ -76,10 +77,6 @@ const themeValidationSchema = (t_i18n: (key: string) => string) => {
.required(requiredMsg),
otherwise: (schema) => schema.strip(),
}),

/**
* GRADIENT END
*/
theme_login_aside_gradient_end: Yup.string()
.nullable()
.when('theme_login_aside_type', {
Expand Down
Loading