Fix #2343: Enable Save button when timezone changes
- Added timezone field to frontend validation schema - Added timezone field to backend validation schema - Fixed state synchronization in Settings component
This commit is contained in:
1 parent
5b86d892c5
commit
ed5d5986ff
3 files changed
+4
No files matched your search
@@ -85,6 +85,8 @@ const Settings = () => {
|
|||||||
|
|
||||||
if (name === "timezone") {
|
if (name === "timezone") {
|
||||||
dispatch(setTimezone({ timezone: value }));
|
dispatch(setTimezone({ timezone: value }));
|
||||||
|
// Make sure to update settingsData with the new timezone value
|
||||||
|
setSettingsData(newSettingsData);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (name === "mode") {
|
if (name === "mode") {
|
||||||
|
|||||||
@@ -277,6 +277,7 @@ const settingsValidation = joi.object({
|
|||||||
}),
|
}),
|
||||||
pagespeedApiKey: joi.string().allow("").optional(),
|
pagespeedApiKey: joi.string().allow("").optional(),
|
||||||
language: joi.string().required(),
|
language: joi.string().required(),
|
||||||
|
timezone: joi.string().allow("").optional(),
|
||||||
systemEmailHost: joi.string().allow(""),
|
systemEmailHost: joi.string().allow(""),
|
||||||
systemEmailPort: joi.number().allow(null, ""),
|
systemEmailPort: joi.number().allow(null, ""),
|
||||||
systemEmailAddress: joi.string().allow(""),
|
systemEmailAddress: joi.string().allow(""),
|
||||||
|
|||||||
@@ -427,6 +427,7 @@ const updateAppSettingsBodyValidation = joi.object({
|
|||||||
checkTTL: joi.number().allow(""),
|
checkTTL: joi.number().allow(""),
|
||||||
pagespeedApiKey: joi.string().allow(""),
|
pagespeedApiKey: joi.string().allow(""),
|
||||||
language: joi.string().allow(""),
|
language: joi.string().allow(""),
|
||||||
|
timezone: joi.string().allow(""),
|
||||||
// showURL: joi.bool().required(),
|
// showURL: joi.bool().required(),
|
||||||
systemEmailHost: joi.string().allow(""),
|
systemEmailHost: joi.string().allow(""),
|
||||||
systemEmailPort: joi.number().allow(""),
|
systemEmailPort: joi.number().allow(""),
|
||||||
|
|||||||
Reference in new issue
Block a user