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
|
// Upgrade pages begin
|
||||||
export const AVAILABLE_ON_BUSINESS = () => "Available on a business plan only";
|
export const AVAILABLE_ON_BUSINESS = () => "Available on a business plan only";
|
||||||
export const EXCLUSIVE_TO_BUSINESS = (featureName: string) =>
|
export const EXCLUSIVE_TO_BUSINESS = (
|
||||||
`The ${featureName} feature is exclusive to workspaces on the business plan`;
|
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";
|
export const AVAILABLE_ON_ENTERPRISE = () => "Available on Appsmith Enterprise";
|
||||||
// Upgrade pages end
|
// Upgrade pages end
|
||||||
|
|
||||||
|
|
@ -1557,7 +1560,7 @@ export const RESTRICT_PUBLIC_EXPOSURE = () =>
|
||||||
export const RESTRICT_PUBLIC_EXPOSURE_DETAIL1 = () =>
|
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.";
|
"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 = () =>
|
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
|
// Access control upgrade page end
|
||||||
|
|
||||||
// Provisioning upgrade page begin
|
// Provisioning upgrade page begin
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,10 @@ import {
|
||||||
SettingTypes,
|
SettingTypes,
|
||||||
} from "ee/pages/AdminSettings/config/types";
|
} from "ee/pages/AdminSettings/config/types";
|
||||||
import { AuditLogsUpgradePage } from "../../Upgrade/AuditLogsUpgradePage";
|
import { AuditLogsUpgradePage } from "../../Upgrade/AuditLogsUpgradePage";
|
||||||
|
import store from "store";
|
||||||
|
import { getIsAiAgentFlowEnabled } from "ee/selectors/aiAgentSelectors";
|
||||||
|
|
||||||
|
const isAIAgentFlowEnabled = getIsAiAgentFlowEnabled(store.getState());
|
||||||
|
|
||||||
export const config: AdminConfigType = {
|
export const config: AdminConfigType = {
|
||||||
icon: "file-list-2-line",
|
icon: "file-list-2-line",
|
||||||
|
|
@ -15,4 +19,5 @@ export const config: AdminConfigType = {
|
||||||
title: "Audit logs",
|
title: "Audit logs",
|
||||||
canSave: false,
|
canSave: false,
|
||||||
isFeatureEnabled: false,
|
isFeatureEnabled: false,
|
||||||
|
isEnterprise: isAIAgentFlowEnabled ? true : false,
|
||||||
} as AdminConfigType;
|
} as AdminConfigType;
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,8 @@ import {
|
||||||
} from "ee/constants/messages";
|
} from "ee/constants/messages";
|
||||||
import useOnUpgrade from "utils/hooks/useOnUpgrade";
|
import useOnUpgrade from "utils/hooks/useOnUpgrade";
|
||||||
import { RampFeature, RampSection } from "utils/ProductRamps/RampsControlList";
|
import { RampFeature, RampSection } from "utils/ProductRamps/RampsControlList";
|
||||||
|
import { useSelector } from "react-redux";
|
||||||
|
import { getIsAiAgentFlowEnabled } from "ee/selectors/aiAgentSelectors";
|
||||||
|
|
||||||
export function AuditLogsUpgradePage() {
|
export function AuditLogsUpgradePage() {
|
||||||
const { onUpgrade } = useOnUpgrade({
|
const { onUpgrade } = useOnUpgrade({
|
||||||
|
|
@ -27,6 +29,7 @@ export function AuditLogsUpgradePage() {
|
||||||
featureName: RampFeature.AuditLogs,
|
featureName: RampFeature.AuditLogs,
|
||||||
sectionName: RampSection.AdminSettings,
|
sectionName: RampSection.AdminSettings,
|
||||||
});
|
});
|
||||||
|
const isAiAgentFlowEnabled = useSelector(getIsAiAgentFlowEnabled);
|
||||||
|
|
||||||
const header: Header = {
|
const header: Header = {
|
||||||
heading: createMessage(INTRODUCING, "audit logs"),
|
heading: createMessage(INTRODUCING, "audit logs"),
|
||||||
|
|
@ -77,7 +80,12 @@ export function AuditLogsUpgradePage() {
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
onUpgrade();
|
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 };
|
const props = { header, carousel, footer };
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user