Skip to content

Commit

Permalink
Merge pull request #39380 from appsmithorg/release
Browse files Browse the repository at this point in the history
20/02 Daily promotion
  • Loading branch information
btsgh authored Feb 20, 2025
2 parents dd81167 + 6dfbfe2 commit c41eaf9
Show file tree
Hide file tree
Showing 758 changed files with 8,254 additions and 5,540 deletions.
2 changes: 1 addition & 1 deletion .github/config.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ app/client/yalc.lock
.idea
.fleet/*
app/client/.fleet/*
.lens

# Observability related local storage
utils/observability/tempo-data/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@ describe("Branding", { tags: ["@tag.Settings"] }, () => {
let favicon;
let shades = {};

it("1. check if localStorage is populated with tenantConfig values", () => {
it("1. check if localStorage is populated with organizationConfig values", () => {
if (CURRENT_REPO === REPO.CE) {
const tenantConfig = localStorage.getItem("tenantConfig");
const organizationConfig = localStorage.getItem("organizationConfig");

expect(tenantConfig).to.be.null;
expect(organizationConfig).to.be.null;
}

if (CURRENT_REPO === REPO.EE) {
const tenantConfig = localStorage.getItem("tenantConfig");
const organizationConfig = localStorage.getItem("organizationConfig");

expect(tenantConfig).to.not.be.null;
expect(organizationConfig).to.not.be.null;
}
});

Expand Down Expand Up @@ -123,10 +123,10 @@ describe("Branding", { tags: ["@tag.Settings"] }, () => {
);
});

it("4. Check if localStorage is populated with tenantConfig values & form cannot be submitted", () => {
it("4. Check if localStorage is populated with organizationConfig values & form cannot be submitted", () => {
if (CURRENT_REPO === REPO.CE) {
const tenantConfig = localStorage.getItem("tenantConfig");
expect(tenantConfig).to.be.null;
const organizationConfig = localStorage.getItem("organizationConfig");
expect(organizationConfig).to.be.null;
cy.get(locators.submitButton).should("be.disabled");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,19 @@ describe("Slug URLs", { tags: ["@tag.AppUrl"] }, () => {

it("4. Checks redirect url", () => {
cy.url().then((url) => {
homePage.Signout(true);
const redirectUrl = `${url}?embed=true&a=b`;
cy.stub(agHelper, "VisitNAssert").as("visitStub");

// Call your function that handles redirection
agHelper.VisitNAssert(redirectUrl);
agHelper.AssertURL(`?redirectUrl=${encodeURIComponent(redirectUrl)}`);

// Assert that the stubbed function was called with the correct redirectUrl
cy.get("@visitStub").should("have.been.calledWith", redirectUrl);
cy.wrap(redirectUrl).then((redirectUrl) => {
const encodedRedirectUrl = `?redirectUrl=${encodeURIComponent(redirectUrl)}`;
cy.log(encodedRedirectUrl);
agHelper.AssertURL(encodedRedirectUrl);
});
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -135,18 +135,18 @@ describe(
agHelper.Sleep(1000);
propPane.SelectColorFromColorPicker("iconcolor", -15);
agHelper.AssertCSS(
widgetLocators.recorderComplete,
widgetLocators.recorderPrompt,
"background-color",
"rgb(255, 193, 61)",
);
propPane.EnterJSContext("Box shadow", "Small");
agHelper
.GetElement(widgetLocators.recorderComplete)
.GetElement(widgetLocators.recorderPrompt)
.should("have.css", "box-shadow")
.and("not.eq", "none");
propPane.EnterJSContext("Border radius", "none");
agHelper.AssertCSS(
widgetLocators.recorderComplete,
widgetLocators.recorderPrompt,
"border-radius",
"3px",
0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,58 @@ describe(
deployMode.NavigateBacktoEditor();
});

it("2. Toggle JS - Validate isVisible", function () {
it("2. Validate isVisible when list has selected item (#37683)", () => {
// Define selectors for widgets
const widgetSelector = (name: string) => `[data-widgetname-cy="${name}"]`;
const containerWidgetSelector = `[type="CONTAINER_WIDGET"]`;

// Drag and drop the Button widget onto the canvas
// entityExplorer.DragDropWidgetNVerify("listwidgetv2", 300, 300);
entityExplorer.DragDropWidgetNVerify("buttonwidget");

// Set up the button to make the list visible when clicked
EditorNavigation.SelectEntityByName("Button1", EntityType.Widget);
propPane.EnterJSContext("onClick", `{{List1.setVisibility(true)}}`, true);

// Set up the list widget to become invisible when an item is clicked
EditorNavigation.SelectEntityByName("List1", EntityType.Widget);
propPane.EnterJSContext(
"onItemClick",
`{{List1.setVisibility(false)}}`,
true,
);

// Deploy the application to test the visibility functionality
deployMode.DeployApp();

// Simulate a click on the first item in the list to hide the list
agHelper
.GetElement(widgetSelector("List1"))
.find(containerWidgetSelector)
.first()
.click({ force: true });
agHelper.WaitUntilEleDisappear(
locators._widgetInDeployed(draggableWidgets.LIST_V2),
);

// Assert that the list widget is not visible after clicking an item
agHelper.AssertElementAbsence(
locators._widgetInDeployed(draggableWidgets.LIST_V2),
);

// Click the button to make the list visible again
agHelper.GetNClick(widgetSelector("Button1"));

// Assert that the list widget is visible after clicking the button
agHelper.AssertElementVisibility(
locators._widgetInDeployed(draggableWidgets.LIST_V2),
);

// Navigate back to the editor after testing
deployMode.NavigateBacktoEditor();
});

it("3. Toggle JS - Validate isVisible", function () {
// Open Property pane
agHelper.AssertElementVisibility(
locators._widgetInDeployed(draggableWidgets.LIST_V2),
Expand All @@ -61,7 +112,7 @@ describe(
deployMode.NavigateBacktoEditor();
});

it("3. Renaming the widget from Property pane and Entity explorer ", function () {
it("4. Renaming the widget from Property pane and Entity explorer ", function () {
// Open Property pane
EditorNavigation.SelectEntityByName("List1", EntityType.Widget);
// Change the list widget name from property pane and Verify it
Expand All @@ -73,7 +124,7 @@ describe(
agHelper.AssertElementVisibility(locators._widgetName("List1"));
});

it("4. Item Spacing Validation ", function () {
it("5. Item Spacing Validation ", function () {
EditorNavigation.SelectEntityByName("List1", EntityType.Widget);
propPane.Search("item spacing");
propPane.UpdatePropertyFieldValue("Item Spacing (px)", "-1");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import EditorNavigation, {
AppSidebarButton,
AppSidebar,
} from "../../../../support/Pages/EditorNavigation";
import PageList from "../../../../support/Pages/PageList";

describe(
"Validate API request body panel",
Expand Down Expand Up @@ -99,6 +100,7 @@ describe(
});

it("7. Checks MultiPart form data for a File Type upload + Bug 12476", () => {
PageList.AddNewPage();
const imageNameToUpload = "ConcreteHouse.jpg";
agHelper.AddDsl("multiPartFormDataDsl");

Expand All @@ -111,7 +113,7 @@ describe(
apiPage.EnterBodyFormData(
"MULTIPART_FORM_DATA",
"file",
"{{FilePicker1.files[0]}}",
"{{FilePicker1.files[0].data}}",
"File",
);

Expand Down Expand Up @@ -141,7 +143,7 @@ describe(
EditorNavigation.SelectEntityByName("MultipartAPI", EntityType.Api);

apiPage.ToggleOnPageLoadRun(false); //Bug 12476
EditorNavigation.SelectEntityByName("Page1", EntityType.Page);
EditorNavigation.SelectEntityByName("Page2", EntityType.Page);
deployMode.DeployApp(locators._buttonByText("Select Files"));
agHelper.ClickButton("Select Files");
agHelper.UploadFile(imageNameToUpload);
Expand Down
34 changes: 16 additions & 18 deletions app/client/cypress/support/Objects/FeatureFlags.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { LICENSE_FEATURE_FLAGS } from "../Constants";
import { ObjectsRegistry } from "./Registry";
import produce from "immer";

const defaultFlags = {
rollout_remove_feature_walkthrough_enabled: false, // remove this flag from here when it's removed from code
Expand Down Expand Up @@ -40,12 +39,13 @@ export const getConsolidatedDataApi = (
res.statusCode === 500
) {
const originalResponse = res?.body;
const updatedResponse = produce(originalResponse, (draft: any) => {
draft.data.featureFlags.data = {
...flags,
};
});
return res.send(updatedResponse);
try {
const updatedResponse = JSON.parse(JSON.stringify(originalResponse));
updatedResponse.data.featureFlags.data = { ...flags };
return res.send(updatedResponse);
} catch (e) {
cy.log(`vamsi error `, e);
}
}
});
}).as("getConsolidatedData");
Expand Down Expand Up @@ -90,18 +90,16 @@ export const featureFlagInterceptForLicenseFlags = () => {
delete req.headers["if-none-match"];
if (res.statusCode === 200) {
const originalResponse = res?.body;
const updatedResponse = produce(originalResponse, (draft: any) => {
draft.data.featureFlags.data = {};
Object.keys(originalResponse.data.featureFlags.data).forEach(
(flag) => {
if (LICENSE_FEATURE_FLAGS.includes(flag)) {
draft.data.featureFlags.data[flag] =
originalResponse.data.featureFlags.data[flag];
}
},
);
draft.data.featureFlags.data["release_app_sidebar_enabled"] = true;
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);
}
});
Expand Down
2 changes: 2 additions & 0 deletions app/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
"@types/d3-geo": "^3.1.0",
"@types/google.maps": "^3.51.0",
"@types/react-page-visibility": "^6.4.1",
"@types/react-window-infinite-loader": "^1.0.9",
"@types/web": "^0.0.99",
"@uppy/core": "^1.16.0",
"@uppy/dashboard": "^1.16.0",
Expand Down Expand Up @@ -203,6 +204,7 @@
"react-virtuoso": "^4.5.0",
"react-webcam": "^7.0.1",
"react-window": "^1.8.6",
"react-window-infinite-loader": "^1.0.10",
"react-zoom-pan-pinch": "^1.6.1",
"redux": "^4.0.1",
"redux-form": "^8.2.6",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/* eslint-disable no-console */
import React from "react";
import type { Meta, StoryObj } from "@storybook/react";

import { MenuItem } from "../../Menu";
import { EntityContextMenu } from "./EntityContextMenu";

const meta: Meta<typeof EntityContextMenu> = {
title: "ADS/Templates/Entity Context Menu",
component: EntityContextMenu,
};

export default meta;

type Story = StoryObj<typeof EntityContextMenu>;

export const Basic: Story = {
args: {
tooltipContent: "More actions",
children: (
<>
<MenuItem onClick={console.log} startIcon="edit-line">
Rename
</MenuItem>
<MenuItem onClick={console.log} startIcon="copy-control">
Copy
</MenuItem>
<MenuItem onClick={console.log} startIcon="delete">
Delete
</MenuItem>
</>
),
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import styled from "styled-components";

import { MenuContent as ADSMenuContent } from "../../Menu";

export const MenuContent = styled(ADSMenuContent)`
width: 220px;
max-height: unset;
`;

export const ButtonContainer = styled.div`
position: relative;
`;
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import React from "react";
import { useToggle } from "usehooks-ts";

import { Button } from "../../Button";
import { Menu, MenuTrigger } from "../../Menu";
import { Tooltip } from "../../Tooltip";

import {
EntityClassNames,
DEFAULT_DATA_TEST_ID,
DEFAULT_TOOLTIP_CONTENT,
} from "./constants";

import * as Styled from "./EntityContextMenu.styles";

interface Props {
dataTestid?: string;
children?: React.ReactNode[] | React.ReactNode;
tooltipContent?: React.ReactNode;
}

export const EntityContextMenu = (props: Props) => {
const {
children,
dataTestid = DEFAULT_DATA_TEST_ID,
tooltipContent = DEFAULT_TOOLTIP_CONTENT,
} = props;

const [isMenuOpen, toggleMenuOpen] = useToggle();

return (
<Menu onOpenChange={toggleMenuOpen} open={isMenuOpen}>
<MenuTrigger className="t--context-menu">
<Styled.ButtonContainer>
<Tooltip
content={tooltipContent}
isDisabled={isMenuOpen}
mouseLeaveDelay={0}
placement="right"
>
<Button
className={EntityClassNames.CONTEXT_MENU}
data-testid={dataTestid}
isIconButton
kind="tertiary"
startIcon="more-2-fill"
/>
</Tooltip>
</Styled.ButtonContainer>
</MenuTrigger>
<Styled.MenuContent
align="start"
className={`t--entity-context-menu ${EntityClassNames.CONTEXT_MENU_CONTENT}`}
side="right"
>
{children}
</Styled.MenuContent>
</Menu>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export enum EntityClassNames {
CONTEXT_MENU = "entity-context-menu",
CONTEXT_MENU_CONTENT = "entity-context-menu-content",
}

export const DEFAULT_DATA_TEST_ID = "t--more-action-trigger";
export const DEFAULT_TOOLTIP_CONTENT = "More actions";
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { EntityContextMenu } from "./EntityContextMenu";
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ export * from "./Sidebar";
export * from "./EditableEntityName";
export * from "./EditableDismissibleTab";
export * from "./EntityTabsHeader";
export * from "./EntityContextMenu";
Loading

0 comments on commit c41eaf9

Please sign in to comment.