chore: Updating to logic to handle toggle changes when reverted manually should disable the save button on Admin settings (#40153)

## Description

Updating to logic to handle toggle changes when reverted manually should
disable the save button on Admin settings

Fixes #`Issue Number`  
_or_  
Fixes `Issue URL`
> [!WARNING]  
> _If no issue exists, please create an issue first, and check with the
maintainers if the issue is valid._

## Automation

/ok-to-test tags="@tag.Settings"

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/14326135327>
> Commit: 3340b0658e9f57a89481cacf87727b79237e8afd
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=14326135327&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.Settings`
> Spec:
> <hr>Tue, 08 Apr 2025 06:17:41 UTC
<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [ ] No


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Refactor**
- Enhanced the conditions for displaying certain admin settings,
ensuring they now appear only when all required conditions are met.
- Adjusted the update criteria for settings so that both checkbox and
toggle types are better managed, preventing updates when appropriate.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
Ankita Kinger 2025-04-08 11:55:08 +05:30 committed by GitHub
parent d20de1fc59
commit a54ac4700d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 3 deletions

View File

@ -121,7 +121,9 @@ export const FormAuth: AdminConfigType = {
return false;
}
return settings.emailVerificationEnabled && mailEnabled;
return (
settings.emailVerificationEnabled && mailEnabled && !isMultiOrgEnabled
);
},
},
{
@ -137,7 +139,11 @@ export const FormAuth: AdminConfigType = {
return false;
}
if (!mailEnabled && settings.emailVerificationEnabled) {
if (
!mailEnabled &&
settings.emailVerificationEnabled &&
!isMultiOrgEnabled
) {
return true;
}

View File

@ -395,7 +395,8 @@ export default withRouter(
_.forEach(AdminConfig.settingsMap, (setting, name) => {
const fieldValue = selector(state, name);
const doNotUpdate =
setting.controlType === SettingTypes.CHECKBOX &&
(setting.controlType === SettingTypes.CHECKBOX ||
setting.controlType === SettingTypes.TOGGLE) &&
!settingsConfig[name] &&
!fieldValue;