Skip to content

Commit 5e73dca

Browse files
committed
ahmed/DAPI-790/fix--markup-error-message
1 parent c38bc77 commit 5e73dca

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

i18n/en/code.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@
122122
"Enter a valid URL. (Example: https://www.[YourDomainName].com)": {
123123
"message": "Enter a valid URL. (Example: https://www.[YourDomainName].com)"
124124
},
125-
"Your markup value must be equal to or above 0.00": {
126-
"message": "Your markup value must be equal to or above 0.00"
125+
"Your markup value must be equal to or above 0.00.": {
126+
"message": "Your markup value must be equal to or above 0.00."
127127
},
128128
"Your markup value must be no more than 3.00.": {
129129
"message": "Your markup value must be no more than 3.00."
@@ -1109,5 +1109,8 @@
11091109
"theme.unlistedContent.message": {
11101110
"message": "This page is unlisted. Search engines will not index it, and only users having a direct link can access it.",
11111111
"description": "The unlisted content banner message"
1112+
},
1113+
"Markup value is required and must be between 0.00 and 3.00.": {
1114+
"message": "Markup value is required and must be between 0.00 and 3.00."
11121115
}
11131116
}

src/features/dashboard/types.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,17 @@ const base_schema = {
6161
}),
6262
app_markup_percentage: yup
6363
.number()
64-
.required()
64+
.nullable()
65+
.transform((value, originalValue) => (originalValue === '' ? null : value))
66+
.required(
67+
translate({
68+
message: 'Markup value is required and must be between 0.00 and 3.00.',
69+
}),
70+
)
6571
.min(
6672
0,
6773
translate({
68-
message: 'Your markup value must be equal to or above 0.00',
74+
message: 'Your markup value must be equal to or above 0.00.',
6975
}),
7076
)
7177
.max(

0 commit comments

Comments
 (0)