PromucFlow_constructor/app/client/src/utils/hooks/useFeatureFlagOverride.ts

85 lines
2.6 KiB
TypeScript
Raw Normal View History

import type { FeatureFlag } from "ee/entities/FeatureFlag";
feat: Move conversion flow under feature flag. (#32490) [![workerB](https://img.shields.io/endpoint?url=https%3A%2F%2Fworkerb.linearb.io%2Fv2%2Fbadge%2Fprivate%2FU2FsdGVkX105sGkyMb3eywi17Q8zKGh7H7PVjvpTo%2Fcollaboration.svg%3FcacheSeconds%3D60)](https://workerb.linearb.io/v2/badge/collaboration-page?magicLinkId=8cXsNLR) ## Description Auto Layout System is being deprecated in favor of Anvil. So we will no longer update Auto Layout and hence we are removing conversion flow to make sure no new Auto Layout Apps are created. However we still want to be able to help users who really have mission critical use cases to convert. two ways to do this - ask Support and they will enable the feature flag to enable conversion.(for cloud users) - ask Support and they will reveal the global function(`overrideFeatureFlag({release_layout_conversion_enabled: true})`) to enable conversion.(for users not connected to internet) Implementation: - current feature flags are supplied from the consolidated api and widgets consume them via `selectFeatureFlags` selector. - to override these flags locally, we provide a global function(accessible from console) `overrideFeatureFlag` which can take an object of featureflags and save them to indexed db. - then we use these saved values to override feature flag values supplied by the consolidated api. - `selectFeatureFlags` is where the values are combined and consumed by all components. Fixes #32140 _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.All" ### :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/8641988198> > Commit: de8e06778bd9fe1feab2f5d20adbaed90e542019 > Cypress dashboard url: <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=8641988198&attempt=2" target="_blank">Click here!</a> <!-- end of auto-generated comment: Cypress test results -->
2024-04-11 11:51:14 +00:00
import {
setFeatureFlagOverridesAction,
updateFeatureFlagOverrideAction,
} from "actions/featureFlagActions";
import { isBoolean } from "lodash";
import { useEffect } from "react";
import { useDispatch, useSelector } from "react-redux";
import { getFeatureFlagsFetched } from "selectors/usersSelectors";
import {
getFeatureFlagOverrideValues,
setFeatureFlagOverrideValues,
} from "utils/storage";
export const AvailableFeaturesToOverride: FeatureFlag[] = [
"release_anvil_enabled",
"release_layout_conversion_enabled",
fix: Changes for Anvil Alpha release (#34211) ## Description This PR makes the following changes to prepare for the Anvil Alpha release - Add a toggle to the applications page header that allows us to toggle the Anvil feature flag from the UI. - Enable the above toggle if the toggle feature flag is enabled - When the toggle is enabled the following changes occur in the UX - Import application via Git is disabled and a callout is shown to the user - Git features are unavailable for users in Anvil applications - Copying and pasting widgets between two different layout systems is disabled and a warning message is shown to the user - Partial import export of widgets between two different layout systems is disabled and a warning message is shown to the user - CRUD page generation is disabled from datasources - Anvil applications and classic applications are separated into their own sections in the workspace. - In case any of the above sections are empty, an appropriate message is displayed in the empty section ### Screenshots ![Alpha Toggle](https://github.com/appsmithorg/appsmith/assets/103687/6bc887e7-eff6-41c2-98a9-ddd5826d4d1a) ![Import from Git Callout](https://github.com/appsmithorg/appsmith/assets/103687/42cd05c8-da90-4e2e-93be-f4038b1f21f3) ![Paste-callout](https://github.com/appsmithorg/appsmith/assets/103687/031ee732-4ad5-4a03-88bf-d02bab1d3faa) ![Screenshot from 2024-07-03 14-39-13](https://github.com/appsmithorg/appsmith/assets/103687/037585d0-1470-47f7-81b2-c0cf4c7901f9) ### Other details - Toggle feature flag - `release_anvil_toggle_enabled` - Anvil feature flag - `release_anvil_enabled` Fixes #34578 Fixes #34576 Fixes #34575 Fixes #33718 ## Automation /ok-to-test tags="@tag.All" ### :mag: Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!CAUTION] > 🔴 🔴 🔴 Some tests have failed. > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/9793128338> > Commit: 09401272c1d52c915aee3b68925406f2f5f962ba > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=9793128338&attempt=2&selectiontype=test&testsstatus=failed&specsstatus=fail" target="_blank">Cypress dashboard</a>. > Tags: @tag.All > The following are new failures, please fix them before merging the PR: <ol> > <li>cypress/e2e/Regression/ClientSide/PartialImportExport/PartialExport_spec.ts</ol> > <a href="https://internal.appsmith.com/app/cypress-dashboard/identified-flaky-tests-65890b3c81d7400d08fa9ee3?branch=master" target="_blank">List of identified flaky tests</a>. <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [x] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added Anvil toggle functionality to the page header. - Introduced layout compatibility checks for pasting widgets. - **Enhancements** - Updated widget paste action to verify layout system compatibility. - Improved handling and processing of user-uploaded JSON files for widget import. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-07-05 08:27:59 +00:00
"release_anvil_toggle_enabled",
feat: add action resp viz (#39690) ## Description Fixes #39554 _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.Sanity" ### :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/13811044062> > Commit: 1a5b458e43a338ad74eb48908a16ce695a6f53e2 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=13811044062&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.Sanity` > Spec: > <hr>Wed, 12 Mar 2025 12:57:34 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 ## Summary by CodeRabbit - **New Features** - Added a new forward arrow icon for enhanced design consistency. - Expanded sidebar functionality to support an optional extra title button for additional actions. - Introduced a comprehensive visualization experience, including interactive components for generating, saving, and displaying visualizations, along with prompt inputs, suggestions, and a results view. - Enhanced action capabilities to support visualization data and debugging with a new visualization tab. - Enabled new release functionalities via an updated feature flag system. - **Style** - Refined sidebar title spacing and layout for improved presentation. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-03-12 12:59:36 +00:00
"release_fn_calling_enabled",
feat: Move conversion flow under feature flag. (#32490) [![workerB](https://img.shields.io/endpoint?url=https%3A%2F%2Fworkerb.linearb.io%2Fv2%2Fbadge%2Fprivate%2FU2FsdGVkX105sGkyMb3eywi17Q8zKGh7H7PVjvpTo%2Fcollaboration.svg%3FcacheSeconds%3D60)](https://workerb.linearb.io/v2/badge/collaboration-page?magicLinkId=8cXsNLR) ## Description Auto Layout System is being deprecated in favor of Anvil. So we will no longer update Auto Layout and hence we are removing conversion flow to make sure no new Auto Layout Apps are created. However we still want to be able to help users who really have mission critical use cases to convert. two ways to do this - ask Support and they will enable the feature flag to enable conversion.(for cloud users) - ask Support and they will reveal the global function(`overrideFeatureFlag({release_layout_conversion_enabled: true})`) to enable conversion.(for users not connected to internet) Implementation: - current feature flags are supplied from the consolidated api and widgets consume them via `selectFeatureFlags` selector. - to override these flags locally, we provide a global function(accessible from console) `overrideFeatureFlag` which can take an object of featureflags and save them to indexed db. - then we use these saved values to override feature flag values supplied by the consolidated api. - `selectFeatureFlags` is where the values are combined and consumed by all components. Fixes #32140 _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.All" ### :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/8641988198> > Commit: de8e06778bd9fe1feab2f5d20adbaed90e542019 > Cypress dashboard url: <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=8641988198&attempt=2" target="_blank">Click here!</a> <!-- end of auto-generated comment: Cypress test results -->
2024-04-11 11:51:14 +00:00
];
export type OverriddenFeatureFlags = Partial<Record<FeatureFlag, boolean>>;
feat: Move conversion flow under feature flag. (#32490) [![workerB](https://img.shields.io/endpoint?url=https%3A%2F%2Fworkerb.linearb.io%2Fv2%2Fbadge%2Fprivate%2FU2FsdGVkX105sGkyMb3eywi17Q8zKGh7H7PVjvpTo%2Fcollaboration.svg%3FcacheSeconds%3D60)](https://workerb.linearb.io/v2/badge/collaboration-page?magicLinkId=8cXsNLR) ## Description Auto Layout System is being deprecated in favor of Anvil. So we will no longer update Auto Layout and hence we are removing conversion flow to make sure no new Auto Layout Apps are created. However we still want to be able to help users who really have mission critical use cases to convert. two ways to do this - ask Support and they will enable the feature flag to enable conversion.(for cloud users) - ask Support and they will reveal the global function(`overrideFeatureFlag({release_layout_conversion_enabled: true})`) to enable conversion.(for users not connected to internet) Implementation: - current feature flags are supplied from the consolidated api and widgets consume them via `selectFeatureFlags` selector. - to override these flags locally, we provide a global function(accessible from console) `overrideFeatureFlag` which can take an object of featureflags and save them to indexed db. - then we use these saved values to override feature flag values supplied by the consolidated api. - `selectFeatureFlags` is where the values are combined and consumed by all components. Fixes #32140 _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.All" ### :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/8641988198> > Commit: de8e06778bd9fe1feab2f5d20adbaed90e542019 > Cypress dashboard url: <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=8641988198&attempt=2" target="_blank">Click here!</a> <!-- end of auto-generated comment: Cypress test results -->
2024-04-11 11:51:14 +00:00
export const useFeatureFlagOverride = () => {
const dispatch = useDispatch();
const areFeatureFlagsFetched = useSelector(getFeatureFlagsFetched);
/**
* Fetches the feature flag override values and updates the state.
*/
useEffect(() => {
if (areFeatureFlagsFetched) {
getFeatureFlagOverrideValues().then((flagValues) => {
const filteredFlagValues = (
Object.entries(flagValues) as [FeatureFlag, boolean][]
).reduce((acc, [flagName, flagValue]) => {
if (
AvailableFeaturesToOverride.includes(flagName) &&
isBoolean(flagValue)
) {
acc[flagName] = flagValues[flagName];
}
chore: add blank line eslint rule (#36369) ## Description Added ESLint rule to force blank lines between statements. 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.All" ### :mag: Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!CAUTION] > 🔴 🔴 🔴 Some tests have failed. > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/10924926728> > Commit: 34f57714a1575ee04e94e03cbcaf95e57a96c86c > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10924926728&attempt=1&selectiontype=test&testsstatus=failed&specsstatus=fail" target="_blank">Cypress dashboard</a>. > Tags: @tag.All > Spec: > The following are new failures, please fix them before merging the PR: <ol> > <li>cypress/e2e/Regression/ClientSide/Anvil/AnvilModal_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilCheckboxGroupWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilCurrencyInputWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilIconButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilInlineButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilInputWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilParagraphWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilPhoneInputWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilStatsWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilSwitchGroupWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilSwitchWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilTableWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilToolbarButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilZoneSectionWidgetSnapshot_spec.ts</ol> > <a href="https://internal.appsmith.com/app/cypress-dashboard/identified-flaky-tests-65890b3c81d7400d08fa9ee3?branch=master" target="_blank">List of identified flaky tests</a>. > <hr>Wed, 18 Sep 2024 16:33:36 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No --------- Co-authored-by: Valera Melnikov <valera@appsmith.com>
2024-09-18 16:35:28 +00:00
feat: Move conversion flow under feature flag. (#32490) [![workerB](https://img.shields.io/endpoint?url=https%3A%2F%2Fworkerb.linearb.io%2Fv2%2Fbadge%2Fprivate%2FU2FsdGVkX105sGkyMb3eywi17Q8zKGh7H7PVjvpTo%2Fcollaboration.svg%3FcacheSeconds%3D60)](https://workerb.linearb.io/v2/badge/collaboration-page?magicLinkId=8cXsNLR) ## Description Auto Layout System is being deprecated in favor of Anvil. So we will no longer update Auto Layout and hence we are removing conversion flow to make sure no new Auto Layout Apps are created. However we still want to be able to help users who really have mission critical use cases to convert. two ways to do this - ask Support and they will enable the feature flag to enable conversion.(for cloud users) - ask Support and they will reveal the global function(`overrideFeatureFlag({release_layout_conversion_enabled: true})`) to enable conversion.(for users not connected to internet) Implementation: - current feature flags are supplied from the consolidated api and widgets consume them via `selectFeatureFlags` selector. - to override these flags locally, we provide a global function(accessible from console) `overrideFeatureFlag` which can take an object of featureflags and save them to indexed db. - then we use these saved values to override feature flag values supplied by the consolidated api. - `selectFeatureFlags` is where the values are combined and consumed by all components. Fixes #32140 _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.All" ### :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/8641988198> > Commit: de8e06778bd9fe1feab2f5d20adbaed90e542019 > Cypress dashboard url: <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=8641988198&attempt=2" target="_blank">Click here!</a> <!-- end of auto-generated comment: Cypress test results -->
2024-04-11 11:51:14 +00:00
return acc;
}, {} as OverriddenFeatureFlags);
chore: add blank line eslint rule (#36369) ## Description Added ESLint rule to force blank lines between statements. 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.All" ### :mag: Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!CAUTION] > 🔴 🔴 🔴 Some tests have failed. > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/10924926728> > Commit: 34f57714a1575ee04e94e03cbcaf95e57a96c86c > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10924926728&attempt=1&selectiontype=test&testsstatus=failed&specsstatus=fail" target="_blank">Cypress dashboard</a>. > Tags: @tag.All > Spec: > The following are new failures, please fix them before merging the PR: <ol> > <li>cypress/e2e/Regression/ClientSide/Anvil/AnvilModal_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilCheckboxGroupWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilCurrencyInputWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilIconButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilInlineButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilInputWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilParagraphWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilPhoneInputWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilStatsWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilSwitchGroupWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilSwitchWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilTableWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilToolbarButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilZoneSectionWidgetSnapshot_spec.ts</ol> > <a href="https://internal.appsmith.com/app/cypress-dashboard/identified-flaky-tests-65890b3c81d7400d08fa9ee3?branch=master" target="_blank">List of identified flaky tests</a>. > <hr>Wed, 18 Sep 2024 16:33:36 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No --------- Co-authored-by: Valera Melnikov <valera@appsmith.com>
2024-09-18 16:35:28 +00:00
feat: Move conversion flow under feature flag. (#32490) [![workerB](https://img.shields.io/endpoint?url=https%3A%2F%2Fworkerb.linearb.io%2Fv2%2Fbadge%2Fprivate%2FU2FsdGVkX105sGkyMb3eywi17Q8zKGh7H7PVjvpTo%2Fcollaboration.svg%3FcacheSeconds%3D60)](https://workerb.linearb.io/v2/badge/collaboration-page?magicLinkId=8cXsNLR) ## Description Auto Layout System is being deprecated in favor of Anvil. So we will no longer update Auto Layout and hence we are removing conversion flow to make sure no new Auto Layout Apps are created. However we still want to be able to help users who really have mission critical use cases to convert. two ways to do this - ask Support and they will enable the feature flag to enable conversion.(for cloud users) - ask Support and they will reveal the global function(`overrideFeatureFlag({release_layout_conversion_enabled: true})`) to enable conversion.(for users not connected to internet) Implementation: - current feature flags are supplied from the consolidated api and widgets consume them via `selectFeatureFlags` selector. - to override these flags locally, we provide a global function(accessible from console) `overrideFeatureFlag` which can take an object of featureflags and save them to indexed db. - then we use these saved values to override feature flag values supplied by the consolidated api. - `selectFeatureFlags` is where the values are combined and consumed by all components. Fixes #32140 _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.All" ### :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/8641988198> > Commit: de8e06778bd9fe1feab2f5d20adbaed90e542019 > Cypress dashboard url: <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=8641988198&attempt=2" target="_blank">Click here!</a> <!-- end of auto-generated comment: Cypress test results -->
2024-04-11 11:51:14 +00:00
if (filteredFlagValues) {
dispatch(setFeatureFlagOverridesAction(filteredFlagValues));
}
});
}
fix: Changes for Anvil Alpha release (#34211) ## Description This PR makes the following changes to prepare for the Anvil Alpha release - Add a toggle to the applications page header that allows us to toggle the Anvil feature flag from the UI. - Enable the above toggle if the toggle feature flag is enabled - When the toggle is enabled the following changes occur in the UX - Import application via Git is disabled and a callout is shown to the user - Git features are unavailable for users in Anvil applications - Copying and pasting widgets between two different layout systems is disabled and a warning message is shown to the user - Partial import export of widgets between two different layout systems is disabled and a warning message is shown to the user - CRUD page generation is disabled from datasources - Anvil applications and classic applications are separated into their own sections in the workspace. - In case any of the above sections are empty, an appropriate message is displayed in the empty section ### Screenshots ![Alpha Toggle](https://github.com/appsmithorg/appsmith/assets/103687/6bc887e7-eff6-41c2-98a9-ddd5826d4d1a) ![Import from Git Callout](https://github.com/appsmithorg/appsmith/assets/103687/42cd05c8-da90-4e2e-93be-f4038b1f21f3) ![Paste-callout](https://github.com/appsmithorg/appsmith/assets/103687/031ee732-4ad5-4a03-88bf-d02bab1d3faa) ![Screenshot from 2024-07-03 14-39-13](https://github.com/appsmithorg/appsmith/assets/103687/037585d0-1470-47f7-81b2-c0cf4c7901f9) ### Other details - Toggle feature flag - `release_anvil_toggle_enabled` - Anvil feature flag - `release_anvil_enabled` Fixes #34578 Fixes #34576 Fixes #34575 Fixes #33718 ## Automation /ok-to-test tags="@tag.All" ### :mag: Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!CAUTION] > 🔴 🔴 🔴 Some tests have failed. > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/9793128338> > Commit: 09401272c1d52c915aee3b68925406f2f5f962ba > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=9793128338&attempt=2&selectiontype=test&testsstatus=failed&specsstatus=fail" target="_blank">Cypress dashboard</a>. > Tags: @tag.All > The following are new failures, please fix them before merging the PR: <ol> > <li>cypress/e2e/Regression/ClientSide/PartialImportExport/PartialExport_spec.ts</ol> > <a href="https://internal.appsmith.com/app/cypress-dashboard/identified-flaky-tests-65890b3c81d7400d08fa9ee3?branch=master" target="_blank">List of identified flaky tests</a>. <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [x] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added Anvil toggle functionality to the page header. - Introduced layout compatibility checks for pasting widgets. - **Enhancements** - Updated widget paste action to verify layout system compatibility. - Improved handling and processing of user-uploaded JSON files for widget import. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-07-05 08:27:59 +00:00
}, [areFeatureFlagsFetched, dispatch]);
feat: Move conversion flow under feature flag. (#32490) [![workerB](https://img.shields.io/endpoint?url=https%3A%2F%2Fworkerb.linearb.io%2Fv2%2Fbadge%2Fprivate%2FU2FsdGVkX105sGkyMb3eywi17Q8zKGh7H7PVjvpTo%2Fcollaboration.svg%3FcacheSeconds%3D60)](https://workerb.linearb.io/v2/badge/collaboration-page?magicLinkId=8cXsNLR) ## Description Auto Layout System is being deprecated in favor of Anvil. So we will no longer update Auto Layout and hence we are removing conversion flow to make sure no new Auto Layout Apps are created. However we still want to be able to help users who really have mission critical use cases to convert. two ways to do this - ask Support and they will enable the feature flag to enable conversion.(for cloud users) - ask Support and they will reveal the global function(`overrideFeatureFlag({release_layout_conversion_enabled: true})`) to enable conversion.(for users not connected to internet) Implementation: - current feature flags are supplied from the consolidated api and widgets consume them via `selectFeatureFlags` selector. - to override these flags locally, we provide a global function(accessible from console) `overrideFeatureFlag` which can take an object of featureflags and save them to indexed db. - then we use these saved values to override feature flag values supplied by the consolidated api. - `selectFeatureFlags` is where the values are combined and consumed by all components. Fixes #32140 _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.All" ### :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/8641988198> > Commit: de8e06778bd9fe1feab2f5d20adbaed90e542019 > Cypress dashboard url: <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=8641988198&attempt=2" target="_blank">Click here!</a> <!-- end of auto-generated comment: Cypress test results -->
2024-04-11 11:51:14 +00:00
/**
* Sets up a global function to toggle the feature flag override.
*/
useEffect(() => {
// TODO: Fix this the next time the file is edited
// eslint-disable-next-line @typescript-eslint/no-explicit-any
feat: Move conversion flow under feature flag. (#32490) [![workerB](https://img.shields.io/endpoint?url=https%3A%2F%2Fworkerb.linearb.io%2Fv2%2Fbadge%2Fprivate%2FU2FsdGVkX105sGkyMb3eywi17Q8zKGh7H7PVjvpTo%2Fcollaboration.svg%3FcacheSeconds%3D60)](https://workerb.linearb.io/v2/badge/collaboration-page?magicLinkId=8cXsNLR) ## Description Auto Layout System is being deprecated in favor of Anvil. So we will no longer update Auto Layout and hence we are removing conversion flow to make sure no new Auto Layout Apps are created. However we still want to be able to help users who really have mission critical use cases to convert. two ways to do this - ask Support and they will enable the feature flag to enable conversion.(for cloud users) - ask Support and they will reveal the global function(`overrideFeatureFlag({release_layout_conversion_enabled: true})`) to enable conversion.(for users not connected to internet) Implementation: - current feature flags are supplied from the consolidated api and widgets consume them via `selectFeatureFlags` selector. - to override these flags locally, we provide a global function(accessible from console) `overrideFeatureFlag` which can take an object of featureflags and save them to indexed db. - then we use these saved values to override feature flag values supplied by the consolidated api. - `selectFeatureFlags` is where the values are combined and consumed by all components. Fixes #32140 _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.All" ### :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/8641988198> > Commit: de8e06778bd9fe1feab2f5d20adbaed90e542019 > Cypress dashboard url: <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=8641988198&attempt=2" target="_blank">Click here!</a> <!-- end of auto-generated comment: Cypress test results -->
2024-04-11 11:51:14 +00:00
(window as any).overrideFeatureFlag = (
featureFlagValues: OverriddenFeatureFlags,
) => {
const areAllFlagsValid = (
Object.entries(featureFlagValues) as [FeatureFlag, boolean][]
).every(
([flagName, flagValue]) =>
AvailableFeaturesToOverride.includes(flagName) &&
isBoolean(flagValue),
);
chore: add blank line eslint rule (#36369) ## Description Added ESLint rule to force blank lines between statements. 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.All" ### :mag: Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!CAUTION] > 🔴 🔴 🔴 Some tests have failed. > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/10924926728> > Commit: 34f57714a1575ee04e94e03cbcaf95e57a96c86c > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10924926728&attempt=1&selectiontype=test&testsstatus=failed&specsstatus=fail" target="_blank">Cypress dashboard</a>. > Tags: @tag.All > Spec: > The following are new failures, please fix them before merging the PR: <ol> > <li>cypress/e2e/Regression/ClientSide/Anvil/AnvilModal_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilCheckboxGroupWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilCurrencyInputWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilIconButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilInlineButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilInputWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilParagraphWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilPhoneInputWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilStatsWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilSwitchGroupWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilSwitchWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilTableWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilToolbarButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilZoneSectionWidgetSnapshot_spec.ts</ol> > <a href="https://internal.appsmith.com/app/cypress-dashboard/identified-flaky-tests-65890b3c81d7400d08fa9ee3?branch=master" target="_blank">List of identified flaky tests</a>. > <hr>Wed, 18 Sep 2024 16:33:36 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No --------- Co-authored-by: Valera Melnikov <valera@appsmith.com>
2024-09-18 16:35:28 +00:00
feat: Move conversion flow under feature flag. (#32490) [![workerB](https://img.shields.io/endpoint?url=https%3A%2F%2Fworkerb.linearb.io%2Fv2%2Fbadge%2Fprivate%2FU2FsdGVkX105sGkyMb3eywi17Q8zKGh7H7PVjvpTo%2Fcollaboration.svg%3FcacheSeconds%3D60)](https://workerb.linearb.io/v2/badge/collaboration-page?magicLinkId=8cXsNLR) ## Description Auto Layout System is being deprecated in favor of Anvil. So we will no longer update Auto Layout and hence we are removing conversion flow to make sure no new Auto Layout Apps are created. However we still want to be able to help users who really have mission critical use cases to convert. two ways to do this - ask Support and they will enable the feature flag to enable conversion.(for cloud users) - ask Support and they will reveal the global function(`overrideFeatureFlag({release_layout_conversion_enabled: true})`) to enable conversion.(for users not connected to internet) Implementation: - current feature flags are supplied from the consolidated api and widgets consume them via `selectFeatureFlags` selector. - to override these flags locally, we provide a global function(accessible from console) `overrideFeatureFlag` which can take an object of featureflags and save them to indexed db. - then we use these saved values to override feature flag values supplied by the consolidated api. - `selectFeatureFlags` is where the values are combined and consumed by all components. Fixes #32140 _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.All" ### :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/8641988198> > Commit: de8e06778bd9fe1feab2f5d20adbaed90e542019 > Cypress dashboard url: <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=8641988198&attempt=2" target="_blank">Click here!</a> <!-- end of auto-generated comment: Cypress test results -->
2024-04-11 11:51:14 +00:00
if (areAllFlagsValid) {
dispatch(updateFeatureFlagOverrideAction(featureFlagValues));
setFeatureFlagOverrideValues(featureFlagValues);
window.console.log(
"Feature flag override values set to: ",
featureFlagValues,
);
} else {
window.console.error(
"Invalid feature flag override values. Please check the feature flags being overridden.",
);
}
};
}, [dispatch]);
};