Skip to content

Commit

Permalink
chore: Refactor feature flag `release_show_create_app_from_templates_…
Browse files Browse the repository at this point in the history
…enabled` (#31991)

## Description
Removed the feature flag
`release_show_create_app_from_templates_enabled` import and usage in the
WorkspaceAction component were refactored.

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.Workspace"

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!IMPORTANT]  
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/8373858785>
> Commit: `8e813e49585b11592412bf1d194d847a7753ea60`
> Cypress dashboard url: <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=8373858785&attempt=1"
target="_blank">Click here!</a>
> All cypress tests have passed 🎉🎉🎉

<!-- end of auto-generated comment: Cypress test results  -->
  • Loading branch information
rahulbarwal authored Mar 22, 2024
1 parent e805d50 commit b8ede95
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 24 deletions.
8 changes: 2 additions & 6 deletions app/client/cypress/support/Pages/HomePage.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { ObjectsRegistry } from "../Objects/Registry";
import { REPO, CURRENT_REPO } from "../../fixtures/REPO";
import { CURRENT_REPO, REPO } from "../../fixtures/REPO";
import HomePageLocators from "../../locators/HomePage";
import SignupPageLocators from "../../locators/SignupPage.json";
import { ObjectsRegistry } from "../Objects/Registry";
import { AppSidebar, PageLeftPane } from "./EditorNavigation";
import { featureFlagIntercept } from "../Objects/FeatureFlags";
export class HomePage {
private agHelper = ObjectsRegistry.AggregateHelper;
private locator = ObjectsRegistry.CommonLocators;
Expand Down Expand Up @@ -330,9 +329,6 @@ export class HomePage {
}

public OpenTemplatesDialogInStartFromTemplates() {
featureFlagIntercept({
release_show_create_app_from_templates_enabled: true,
});
this.agHelper.GetNClick(this._homePageAppCreateBtn, 0, true);
this.agHelper.GetNClick(this._newButtonCreateApplicationFromTemplates);
this.agHelper.AssertElementVisibility(this._createAppFromTemplatesDialog);
Expand Down
3 changes: 0 additions & 3 deletions app/client/src/ce/entities/FeatureFlag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ export const FEATURE_FLAG = {
"rollout_consolidated_page_load_fetch_enabled",
release_actions_redesign_enabled: "release_actions_redesign_enabled",
rollout_editor_pane_segments_enabled: "rollout_editor_pane_segments_enabled",
release_show_create_app_from_templates_enabled:
"release_show_create_app_from_templates_enabled",
rollout_remove_feature_walkthrough_enabled:
"rollout_remove_feature_walkthrough_enabled",
release_drag_drop_building_blocks_enabled:
Expand Down Expand Up @@ -90,7 +88,6 @@ export const DEFAULT_FEATURE_FLAG_VALUE: FeatureFlags = {
rollout_consolidated_page_load_fetch_enabled: false,
release_actions_redesign_enabled: false,
rollout_editor_pane_segments_enabled: false,
release_show_create_app_from_templates_enabled: false,
rollout_remove_feature_walkthrough_enabled: false,
rollout_js_enabled_one_click_binding_enabled: false,
rollout_side_by_side_enabled: false,
Expand Down
25 changes: 10 additions & 15 deletions app/client/src/ce/pages/Applications/WorkspaceAction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@ import {
createMessage,
} from "@appsmith/constants/messages";
import type { Workspace } from "@appsmith/constants/workspaceConstants";
import { FEATURE_FLAG } from "@appsmith/entities/FeatureFlag";
import { getIsCreatingApplicationByWorkspaceId } from "@appsmith/selectors/applicationSelectors";
import { getIsFetchingApplications } from "@appsmith/selectors/selectedWorkspaceSelectors";
import { hasCreateNewAppPermission } from "@appsmith/utils/permissionHelpers";
import { useFeatureFlag } from "utils/hooks/useFeatureFlag";

export interface WorkspaceActionProps {
workspace: Workspace;
Expand All @@ -47,9 +45,6 @@ function WorkspaceAction({
const isCreatingApplication = Boolean(
useSelector(getIsCreatingApplicationByWorkspaceId(workspace.id)),
);
const isCreateAppFromTemplatesEnabled = useFeatureFlag(
FEATURE_FLAG.release_show_create_app_from_templates_enabled,
);

const openActionMenu = useCallback(() => {
setIsActionMenuOpen(true);
Expand Down Expand Up @@ -97,16 +92,16 @@ function WorkspaceAction({
{createMessage(NEW_APP)}
</MenuItem>
{<Divider className="!block mb-[2px]" />}
{isCreateAppFromTemplatesEnabled && (
<MenuItem
data-testid="t--workspace-action-create-app-from-template"
disabled={!hasCreateNewApplicationPermission}
onSelect={() => onStartFromTemplate(workspaceId)}
startIcon="layout-2-line"
>
{createMessage(NEW_APP_FROM_TEMPLATE)}
</MenuItem>
)}

<MenuItem
data-testid="t--workspace-action-create-app-from-template"
disabled={!hasCreateNewApplicationPermission}
onSelect={() => onStartFromTemplate(workspaceId)}
startIcon="layout-2-line"
>
{createMessage(NEW_APP_FROM_TEMPLATE)}
</MenuItem>

{enableImportExport && hasCreateNewApplicationPermission && (
<MenuItem
data-testid="t--workspace-import-app"
Expand Down

0 comments on commit b8ede95

Please sign in to comment.