2023-03-27 09:36:03 +00:00
|
|
|
import { ObjectsRegistry } from "../Objects/Registry";
|
2024-01-25 13:41:48 +00:00
|
|
|
import { featureFlagIntercept } from "../Objects/FeatureFlags";
|
2023-03-27 09:36:03 +00:00
|
|
|
|
|
|
|
|
export class AdminSettings {
|
|
|
|
|
public agHelper = ObjectsRegistry.AggregateHelper;
|
|
|
|
|
public locator = ObjectsRegistry.CommonLocators;
|
|
|
|
|
public homePage = ObjectsRegistry.HomePage;
|
2023-10-10 09:24:28 +00:00
|
|
|
public assertHelper = ObjectsRegistry.AssertHelper;
|
2023-03-27 09:36:03 +00:00
|
|
|
|
2024-01-25 13:41:48 +00:00
|
|
|
public _adminSettingsBtn = ".admin-settings-menu-option";
|
2024-03-21 10:07:13 +00:00
|
|
|
public _saveButton = ".t--admin-settings-save-button";
|
2023-03-27 09:36:03 +00:00
|
|
|
private _settingsList = ".t--settings-category-list";
|
|
|
|
|
public _usersTab = ".t--settings-category-users";
|
|
|
|
|
public _roles = (user: string) =>
|
|
|
|
|
"//span[contains(text(), '" +
|
|
|
|
|
user +
|
2023-10-10 09:24:28 +00:00
|
|
|
"')]/parent::div/parent::span/parent::a/parent::td/following-sibling::td[1]";
|
|
|
|
|
public _instanceName = '[name="instanceName"]';
|
feat: Updating admin settings page as per new designs (#40101)
## Description
Updating admin settings page as per new designs:
https://www.figma.com/design/XouAwUQJKF2lf57bQvNM1e/Cloud-Billing-(-Phase-1-)?node-id=15907-10916&m=dev
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"
### :mag: 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/14302998753>
> Commit: 259bdc292d08fd3f6cc4ffb2fce833b71c123d2e
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=14302998753&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.Settings`
> Spec:
> <hr>Mon, 07 Apr 2025 07:33:30 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
- **New Features**
- Introduced an updated profile page for managing account details and
profile images.
- Expanded and restructured the Admin Settings with clear sections like
Instance Settings, Configuration, User Management, Branding, and
Profile.
- Added new icons that enhance the visual experience.
- Implemented a new styled component for conditional rendering of links
in settings.
- Added user settings for session management and Git configuration.
- Enhanced test cases for Admin Settings to ensure proper navigation and
functionality.
- Introduced a new configuration for instance settings, allowing for
detailed management options.
- Added a new configuration for profile settings, enhancing user
management capabilities.
- Introduced a new configuration for email settings, reflecting
organizational needs.
- **Bug Fixes**
- Revised the save button text to “Save Changes” and refined success
notifications.
- **Refactor**
- Streamlined routing and configuration for a more intuitive and
consistent Admin Settings experience.
- Updated category management logic in the LeftPane component to focus
on user management and organizational categories.
- Modified the filtering logic in admin settings helpers for improved
clarity and functionality.
- Enhanced the overall structure of test cases for better organization
and clarity.
- **Style**
- Updated header and layout styling for improved visual consistency.
- Enhanced the visual presentation of the SettingsSubHeader component.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-04-07 10:14:20 +00:00
|
|
|
public _googleMapsAPIField = '[name="googleMapsKey"]';
|
2024-01-25 13:41:48 +00:00
|
|
|
public rolesTab = ".t--settings-category-roles";
|
2024-03-21 10:07:13 +00:00
|
|
|
public auditLogsTab = ".t--settings-category-audit-logs";
|
|
|
|
|
public routes = {
|
|
|
|
|
APPLICATIONS: "/applications",
|
|
|
|
|
SETTINGS: "/settings",
|
feat: Updating admin settings page as per new designs (#40101)
## Description
Updating admin settings page as per new designs:
https://www.figma.com/design/XouAwUQJKF2lf57bQvNM1e/Cloud-Billing-(-Phase-1-)?node-id=15907-10916&m=dev
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"
### :mag: 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/14302998753>
> Commit: 259bdc292d08fd3f6cc4ffb2fce833b71c123d2e
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=14302998753&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.Settings`
> Spec:
> <hr>Mon, 07 Apr 2025 07:33:30 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
- **New Features**
- Introduced an updated profile page for managing account details and
profile images.
- Expanded and restructured the Admin Settings with clear sections like
Instance Settings, Configuration, User Management, Branding, and
Profile.
- Added new icons that enhance the visual experience.
- Implemented a new styled component for conditional rendering of links
in settings.
- Added user settings for session management and Git configuration.
- Enhanced test cases for Admin Settings to ensure proper navigation and
functionality.
- Introduced a new configuration for instance settings, allowing for
detailed management options.
- Added a new configuration for profile settings, enhancing user
management capabilities.
- Introduced a new configuration for email settings, reflecting
organizational needs.
- **Bug Fixes**
- Revised the save button text to “Save Changes” and refined success
notifications.
- **Refactor**
- Streamlined routing and configuration for a more intuitive and
consistent Admin Settings experience.
- Updated category management logic in the LeftPane component to focus
on user management and organizational categories.
- Modified the filtering logic in admin settings helpers for improved
clarity and functionality.
- Enhanced the overall structure of test cases for better organization
and clarity.
- **Style**
- Updated header and layout styling for improved visual consistency.
- Enhanced the visual presentation of the SettingsSubHeader component.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-04-07 10:14:20 +00:00
|
|
|
PROFILE: "/settings/profile",
|
2024-03-21 10:07:13 +00:00
|
|
|
GENERAL: "/settings/general",
|
|
|
|
|
EMAIL: "/settings/email",
|
feat: Updating admin settings page as per new designs (#40101)
## Description
Updating admin settings page as per new designs:
https://www.figma.com/design/XouAwUQJKF2lf57bQvNM1e/Cloud-Billing-(-Phase-1-)?node-id=15907-10916&m=dev
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"
### :mag: 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/14302998753>
> Commit: 259bdc292d08fd3f6cc4ffb2fce833b71c123d2e
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=14302998753&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.Settings`
> Spec:
> <hr>Mon, 07 Apr 2025 07:33:30 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
- **New Features**
- Introduced an updated profile page for managing account details and
profile images.
- Expanded and restructured the Admin Settings with clear sections like
Instance Settings, Configuration, User Management, Branding, and
Profile.
- Added new icons that enhance the visual experience.
- Implemented a new styled component for conditional rendering of links
in settings.
- Added user settings for session management and Git configuration.
- Enhanced test cases for Admin Settings to ensure proper navigation and
functionality.
- Introduced a new configuration for instance settings, allowing for
detailed management options.
- Added a new configuration for profile settings, enhancing user
management capabilities.
- Introduced a new configuration for email settings, reflecting
organizational needs.
- **Bug Fixes**
- Revised the save button text to “Save Changes” and refined success
notifications.
- **Refactor**
- Streamlined routing and configuration for a more intuitive and
consistent Admin Settings experience.
- Updated category management logic in the LeftPane component to focus
on user management and organizational categories.
- Modified the filtering logic in admin settings helpers for improved
clarity and functionality.
- Enhanced the overall structure of test cases for better organization
and clarity.
- **Style**
- Updated header and layout styling for improved visual consistency.
- Enhanced the visual presentation of the SettingsSubHeader component.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-04-07 10:14:20 +00:00
|
|
|
USER_SETTINGS: "/settings/user-settings",
|
|
|
|
|
INSTANCE_SETTINGS: "/settings/instance-settings",
|
|
|
|
|
CONFIGURATION: "/settings/configuration",
|
|
|
|
|
VERSION: "/settings/version",
|
2024-03-21 10:07:13 +00:00
|
|
|
AUTHENTICATION: "/settings/authentication",
|
|
|
|
|
GOOGLEAUTH: "/settings/authentication/google-auth",
|
|
|
|
|
GITHUBAUTH: "/settings/authentication/github-auth",
|
|
|
|
|
FORMLOGIN: "/settings/authentication/form-login",
|
|
|
|
|
BRANDING: "/settings/branding",
|
|
|
|
|
ACCESS_CONTROL: "/settings/access-control",
|
|
|
|
|
AUDIT_LOGS: "/settings/audit-logs",
|
|
|
|
|
PROVISIONING: "/settings/provisioning",
|
|
|
|
|
};
|
2023-03-27 09:36:03 +00:00
|
|
|
|
2024-01-25 13:41:48 +00:00
|
|
|
public NavigateToAdminSettings(toNavigateToHome = true) {
|
|
|
|
|
toNavigateToHome && this.homePage.NavigateToHome();
|
|
|
|
|
this.agHelper.AssertElementVisibility(this._adminSettingsBtn);
|
2023-03-27 09:36:03 +00:00
|
|
|
this.agHelper.GetNClick(this._adminSettingsBtn);
|
2023-10-10 09:24:28 +00:00
|
|
|
this.assertHelper.AssertNetworkStatus("getEnvVariables");
|
2023-08-10 07:06:03 +00:00
|
|
|
this.agHelper.AssertElementVisibility(this._settingsList);
|
2023-03-27 09:36:03 +00:00
|
|
|
}
|
2024-01-25 13:41:48 +00:00
|
|
|
|
|
|
|
|
public EnableGAC(
|
|
|
|
|
toNavigateToHome = true,
|
|
|
|
|
toNavigateBackToHome = true,
|
|
|
|
|
methodType: "adminSettings" | "home" = "adminSettings",
|
|
|
|
|
) {
|
|
|
|
|
switch (methodType) {
|
|
|
|
|
case "adminSettings":
|
|
|
|
|
this.NavigateToAdminSettings(toNavigateToHome);
|
|
|
|
|
this.enableGACFeatureFlag();
|
|
|
|
|
this.assertHelper.AssertDocumentReady();
|
|
|
|
|
this.agHelper.WaitUntilEleAppear(this.rolesTab);
|
2024-02-01 11:12:53 +00:00
|
|
|
this.agHelper.AssertElementExist(this.rolesTab);
|
|
|
|
|
this.agHelper.AssertElementVisibility(this.rolesTab);
|
2024-01-25 13:41:48 +00:00
|
|
|
toNavigateBackToHome && this.homePage.NavigateToHome();
|
|
|
|
|
break;
|
|
|
|
|
case "home":
|
|
|
|
|
toNavigateToHome && this.homePage.NavigateToHome();
|
|
|
|
|
this.enableGACFeatureFlag();
|
|
|
|
|
this.assertHelper.AssertDocumentReady();
|
|
|
|
|
this.agHelper.AssertElementExist(this.homePage._homePageContainer);
|
|
|
|
|
this.agHelper.AssertElementVisibility(this.homePage._homePageContainer);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private enableGACFeatureFlag() {
|
|
|
|
|
featureFlagIntercept({ license_gac_enabled: true });
|
|
|
|
|
}
|
2023-03-27 09:36:03 +00:00
|
|
|
}
|