## Description Removing the feature flag for using Entity Item component from ADS templates in the Entity Explorer in App Editor. Fixes [#39067](https://github.com/appsmithorg/appsmith/issues/39067) ## Automation /ok-to-test tags="@tag.All" ### 🔍 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/13804174182> > Commit: 8a4a2007c8e1411a9baa388cf841e5e489cb6778 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=13804174182&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.All` > Spec: > <hr>Wed, 12 Mar 2025 06:32:35 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** - Improved entity renaming: input fields now automatically clear previous text for smoother editing. - Enhanced page navigation: active selections are now verified more consistently, ensuring clearer context. - New feature flag added for enhanced entity item visibility. - Added new methods for improved entity selection and verification in tests. - Introduced `parentId` properties in widget definitions to enhance hierarchical structure. - Updated selectors for widget names and collapsible elements in tests for improved targeting. - **Bug Fixes** - Resolved issues with inconsistent element detection and state feedback for a more stable interface. - **Refactor** - Updated widget hierarchy and locator logic for improved layout rendering and overall UI consistency. - Modified locator strategies to enhance element targeting across various components. - Simplified method signatures for better clarity and maintainability. - Enhanced test selectors to improve reliability and maintainability. - Removed obsolete commands and streamlined interaction methods in tests. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Hetu Nandu <hetunandu@gmail.com> Co-authored-by: Hetu Nandu <hetu@appsmith.com>
111 lines
3.3 KiB
TypeScript
111 lines
3.3 KiB
TypeScript
import { LICENSE_FEATURE_FLAGS } from "../Constants";
|
|
import { ObjectsRegistry } from "./Registry";
|
|
|
|
const defaultFlags = {
|
|
rollout_remove_feature_walkthrough_enabled: false, // remove this flag from here when it's removed from code
|
|
release_git_modularisation_enabled: true,
|
|
release_ads_entity_item_enabled: true,
|
|
};
|
|
|
|
export const featureFlagIntercept = (
|
|
flags: Record<string, boolean> = {},
|
|
reload = true,
|
|
) => {
|
|
getConsolidatedDataApi({ ...flags, ...defaultFlags }, false);
|
|
const response = {
|
|
responseMeta: {
|
|
status: 200,
|
|
success: true,
|
|
},
|
|
data: {
|
|
...flags,
|
|
...defaultFlags,
|
|
},
|
|
errorDisplay: "",
|
|
};
|
|
cy.intercept("GET", "/api/v1/users/features", response);
|
|
if (reload) ObjectsRegistry.AggregateHelper.CypressReload();
|
|
};
|
|
|
|
export const getConsolidatedDataApi = (
|
|
flags: Record<string, boolean> = {},
|
|
reload = true,
|
|
) => {
|
|
cy.intercept("GET", "/api/v1/consolidated-api/*?*", (req) => {
|
|
delete req.headers["if-none-match"];
|
|
req.reply((res: any) => {
|
|
if (
|
|
res.statusCode === 200 ||
|
|
res.statusCode === 401 ||
|
|
res.statusCode === 500
|
|
) {
|
|
const originalResponse = res?.body;
|
|
try {
|
|
const updatedResponse = JSON.parse(JSON.stringify(originalResponse));
|
|
updatedResponse.data.featureFlags.data = { ...flags };
|
|
return res.send(updatedResponse);
|
|
} catch (e) {
|
|
cy.log(`Featureflags.ts error `, e);
|
|
}
|
|
}
|
|
});
|
|
}).as("getConsolidatedData");
|
|
if (reload) ObjectsRegistry.AggregateHelper.CypressReload();
|
|
};
|
|
|
|
export const featureFlagInterceptForLicenseFlags = () => {
|
|
cy.intercept(
|
|
{
|
|
method: "GET",
|
|
url: "/api/v1/users/features",
|
|
},
|
|
(req) => {
|
|
req.reply((res) => {
|
|
if (res) {
|
|
const originalResponse = res.body;
|
|
let modifiedResponse: any = {};
|
|
Object.keys(originalResponse.data).forEach((flag) => {
|
|
if (LICENSE_FEATURE_FLAGS.includes(flag)) {
|
|
modifiedResponse[flag] = originalResponse.data[flag];
|
|
}
|
|
});
|
|
modifiedResponse = {
|
|
...modifiedResponse,
|
|
release_app_sidebar_enabled: true,
|
|
};
|
|
res.send({
|
|
responseMeta: {
|
|
status: 200,
|
|
success: true,
|
|
},
|
|
data: { ...modifiedResponse },
|
|
errorDisplay: "",
|
|
});
|
|
}
|
|
});
|
|
},
|
|
).as("getLicenseFeatures");
|
|
|
|
cy.intercept("GET", "/api/v1/consolidated-api/*?*", (req) => {
|
|
req.reply((res: any) => {
|
|
delete req.headers["if-none-match"];
|
|
if (res.statusCode === 200) {
|
|
const originalResponse = res?.body;
|
|
const updatedResponse = JSON.parse(JSON.stringify(originalResponse));
|
|
updatedResponse.data.featureFlags.data = {};
|
|
Object.keys(originalResponse.data.featureFlags.data).forEach((flag) => {
|
|
if (LICENSE_FEATURE_FLAGS.includes(flag)) {
|
|
updatedResponse.data.featureFlags.data[flag] =
|
|
originalResponse.data.featureFlags.data[flag];
|
|
}
|
|
});
|
|
updatedResponse.data.featureFlags.data["release_app_sidebar_enabled"] =
|
|
true;
|
|
return res.send(updatedResponse);
|
|
}
|
|
});
|
|
}).as("getConsolidatedData");
|
|
|
|
ObjectsRegistry.AggregateHelper.CypressReload();
|
|
};
|