Skip to content

Commit

Permalink
Merge pull request #165 from ahmed-deriv/ahmed/DAPI-790/fix--markup-e…
Browse files Browse the repository at this point in the history
…rror-message

Ahmed/dapi 790/fix  markup error message
  • Loading branch information
sandeep-deriv authored Nov 8, 2024
2 parents eae2f2f + 324f556 commit 7d08f71
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
7 changes: 5 additions & 2 deletions i18n/en/code.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@
"Enter a valid URL. (Example: https://www.[YourDomainName].com)": {
"message": "Enter a valid URL. (Example: https://www.[YourDomainName].com)"
},
"Your markup value must be equal to or above 0.00": {
"message": "Your markup value must be equal to or above 0.00"
"Your markup value must be equal to or above 0.00.": {
"message": "Your markup value must be equal to or above 0.00."
},
"Your markup value must be no more than 3.00.": {
"message": "Your markup value must be no more than 3.00."
Expand Down Expand Up @@ -1110,6 +1110,9 @@
"message": "This page is unlisted. Search engines will not index it, and only users having a direct link can access it.",
"description": "The unlisted content banner message"
},
"Markup value is required and must be between 0.00 and 3.00.": {
"message": "Markup value is required and must be between 0.00 and 3.00."
},
"Clear response": {
"message": "Clear response"
}
Expand Down
7 changes: 5 additions & 2 deletions i18n/fr/code.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@
"Enter a valid URL. (Example: https://www.[YourDomainName].com)": {
"message": "Saisissez une URL valide. (Exemple : https://www.[VotreNomDeDomaine].com)"
},
"Your markup value must be equal to or above 0.00": {
"message": "Votre valeur de majoration doit être égale ou supérieure à 0,00"
"Your markup value must be equal to or above 0.00.": {
"message": "Votre valeur de majoration doit être égale ou supérieure à 0,00."
},
"Your markup value must be no more than 3.00.": {
"message": "Votre valeur de majoration ne doit pas dépasser 3,00."
Expand Down Expand Up @@ -1110,6 +1110,9 @@
"message": "Cette page n'est pas répertoriée. Les moteurs de recherche ne l'indexeront pas, et seuls les utilisateurs disposant d'un lien direct peuvent y accéder.",
"description": "The unlisted content banner message"
},
"Markup value is required and must be between 0.00 and 3.00.": {
"message": "La valeur de la majoration est requise et doit être comprise entre 0,00 et 3,00."
},
"Clear response": {
"message": "Effacer la réponse"
}
Expand Down
10 changes: 8 additions & 2 deletions src/features/dashboard/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,17 @@ const base_schema = {
}),
app_markup_percentage: yup
.number()
.required()
.nullable()
.transform((value, originalValue) => (originalValue === '' ? null : value))
.required(
translate({
message: 'Markup value is required and must be between 0.00 and 3.00.',
}),
)
.min(
0,
translate({
message: 'Your markup value must be equal to or above 0.00',
message: 'Your markup value must be equal to or above 0.00.',
}),
)
.max(
Expand Down

0 comments on commit 7d08f71

Please sign in to comment.