chore: Adding AI agent feature flag check for audit logs upgrade page (#40185)
## Description Adding AI agent feature flag check for audit logs upgrade page 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 --> > [!IMPORTANT] > 🟣 🟣 🟣 Your tests are running. > Tests running at: <https://github.com/appsmithorg/appsmith/actions/runs/14350813652> > Commit: 89483c5e9067b19dcad00e1654031bdd2e438b29 > Workflow: `PR Automation test suite` > Tags: `@tag.Settings` > Spec: `` > <hr>Wed, 09 Apr 2025 06:49:26 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** - Upgrade messaging now dynamically reflects the selected plan—displaying "business" or "enterprise" based on current settings. - Enhanced audit log configurations incorporate an enterprise flag to adjust messaging contextually. - **Bug Fixes** - Corrected text capitalization for clearer plan description in the upgrade footer. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
parent
af2f442587
commit
62bdd846d4
|
|
@ -1511,8 +1511,11 @@ export const ENTERPRISE_TAG = () => "Enterprise";
|
|||
|
||||
// Upgrade pages begin
|
||||
export const AVAILABLE_ON_BUSINESS = () => "Available on a business plan only";
|
||||
export const EXCLUSIVE_TO_BUSINESS = (featureName: string) =>
|
||||
`The ${featureName} feature is exclusive to workspaces on the business plan`;
|
||||
export const EXCLUSIVE_TO_BUSINESS = (
|
||||
featureName: string,
|
||||
planName: "business" | "enterprise" = "business",
|
||||
) =>
|
||||
`The ${featureName} feature is exclusive to workspaces on the ${planName} plan`;
|
||||
export const AVAILABLE_ON_ENTERPRISE = () => "Available on Appsmith Enterprise";
|
||||
// Upgrade pages end
|
||||
|
||||
|
|
@ -1557,7 +1560,7 @@ export const RESTRICT_PUBLIC_EXPOSURE = () =>
|
|||
export const RESTRICT_PUBLIC_EXPOSURE_DETAIL1 = () =>
|
||||
"Proactively disallow groups of non-admin or non-super-admin users from publicly sharing your app or exporting app data out of your environment, domain, and security perimeters.";
|
||||
export const ACCESS_CONTROL_UPGRADE_PAGE_FOOTER = () =>
|
||||
"Unlock granular access controls along with audit logs and SSO for enhanced security and reliability with an upgrade to our Business plan.";
|
||||
"Unlock granular access controls along with audit logs and SSO for enhanced security and reliability with an upgrade to our business plan.";
|
||||
// Access control upgrade page end
|
||||
|
||||
// Provisioning upgrade page begin
|
||||
|
|
|
|||
|
|
@ -5,6 +5,10 @@ import {
|
|||
SettingTypes,
|
||||
} from "ee/pages/AdminSettings/config/types";
|
||||
import { AuditLogsUpgradePage } from "../../Upgrade/AuditLogsUpgradePage";
|
||||
import store from "store";
|
||||
import { getIsAiAgentFlowEnabled } from "ee/selectors/aiAgentSelectors";
|
||||
|
||||
const isAIAgentFlowEnabled = getIsAiAgentFlowEnabled(store.getState());
|
||||
|
||||
export const config: AdminConfigType = {
|
||||
icon: "file-list-2-line",
|
||||
|
|
@ -15,4 +19,5 @@ export const config: AdminConfigType = {
|
|||
title: "Audit logs",
|
||||
canSave: false,
|
||||
isFeatureEnabled: false,
|
||||
isEnterprise: isAIAgentFlowEnabled ? true : false,
|
||||
} as AdminConfigType;
|
||||
|
|
|
|||
|
|
@ -19,6 +19,8 @@ import {
|
|||
} from "ee/constants/messages";
|
||||
import useOnUpgrade from "utils/hooks/useOnUpgrade";
|
||||
import { RampFeature, RampSection } from "utils/ProductRamps/RampsControlList";
|
||||
import { useSelector } from "react-redux";
|
||||
import { getIsAiAgentFlowEnabled } from "ee/selectors/aiAgentSelectors";
|
||||
|
||||
export function AuditLogsUpgradePage() {
|
||||
const { onUpgrade } = useOnUpgrade({
|
||||
|
|
@ -27,6 +29,7 @@ export function AuditLogsUpgradePage() {
|
|||
featureName: RampFeature.AuditLogs,
|
||||
sectionName: RampSection.AdminSettings,
|
||||
});
|
||||
const isAiAgentFlowEnabled = useSelector(getIsAiAgentFlowEnabled);
|
||||
|
||||
const header: Header = {
|
||||
heading: createMessage(INTRODUCING, "audit logs"),
|
||||
|
|
@ -77,7 +80,12 @@ export function AuditLogsUpgradePage() {
|
|||
onClick: () => {
|
||||
onUpgrade();
|
||||
},
|
||||
message: createMessage(EXCLUSIVE_TO_BUSINESS, ["audit logs"]),
|
||||
message: createMessage(
|
||||
EXCLUSIVE_TO_BUSINESS,
|
||||
["audit logs"],
|
||||
isAiAgentFlowEnabled ? "enterprise" : "business",
|
||||
),
|
||||
isEnterprise: isAiAgentFlowEnabled ? true : false,
|
||||
};
|
||||
const props = { header, carousel, footer };
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user