Skip to content

Commit

Permalink
fix: merge from release
Browse files Browse the repository at this point in the history
  • Loading branch information
AmanAgarwal041 committed Sep 30, 2024
2 parents 1786523 + 6f27959 commit b92a9d0
Show file tree
Hide file tree
Showing 40 changed files with 1,075 additions and 162 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/github-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,14 @@ jobs:
run: |
scripts/generate_info_json.sh
# As pg docker image is continuously updated for each scheduled cron on release, we are using the nightly tag while building the latest tag
- name: Place server artifacts-es
run: |
if [[ -f scripts/prepare_server_artifacts.sh ]]; then
scripts/prepare_server_artifacts.sh
PG_TAG=nightly scripts/prepare_server_artifacts.sh
else
echo "No script found to prepare server artifacts"
exit 1
fi
- name: Login to DockerHub
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/test-build-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,12 @@ jobs:
- name: Place server artifacts-es
run: |
run: |
if [[ -f scripts/prepare_server_artifacts.sh ]]; then
scripts/prepare_server_artifacts.sh
else
echo "No script found to prepare server artifacts"
exit 1
fi
- name: Set up Depot CLI
Expand Down Expand Up @@ -439,6 +443,9 @@ jobs:
run: |
if [[ -f scripts/prepare_server_artifacts.sh ]]; then
scripts/prepare_server_artifacts.sh
else
echo "No script found to prepare server artifacts"
exit 1
fi
- name: Set up Depot CLI
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
import ReconnectLocators from "../../../../locators/ReconnectLocators";
import { featureFlagIntercept } from "../../../../support/Objects/FeatureFlags";
import {
agHelper,
gitSync,
homePage,
} from "../../../../support/Objects/ObjectsCore";

let wsName: string;
let repoName: string = "TED-testrepo1";
let repoName: string = "TED-autocommit-test-1";

describe(
"Git Autocommit",
{
tags: [
"@tag.Git",
"@tag.GitAutocommit",
"@tag.excludeForAirgap",
"@tag.Sanity",
"@tag.TedMigration",
],
},
function () {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
import { tableDateColumnTypes } from "../../../../../fixtures/tableDateColumnTypes";
import {
agHelper,
entityExplorer,
propPane,
table,
} from "../../../../../support/Objects/ObjectsCore";

import EditorNavigation, {
EntityType,
} from "../../../../../support/Pages/EditorNavigation";

describe(
"Table widget date column type validation",
{ tags: ["@tag.Widget", "@tag.Table"] },
() => {
before(() => {
entityExplorer.DragNDropWidget("tablewidgetv2", 350, 500);
EditorNavigation.SelectEntityByName("Table1", EntityType.Widget);
propPane.ToggleJSMode("Table data", true);
propPane.UpdatePropertyFieldValue("Table data", tableDateColumnTypes);
table.EditColumn("unixs", "v2");
});

beforeEach(() => {
propPane.NavigateBackToPropertyPane(false);
});

const setEditableDateFormats = (format: string) => {
// Update date format property
propPane.ToggleJSMode("Date format", true);
propPane.UpdatePropertyFieldValue("Date format", format);

// Update display format property
propPane.ToggleJSMode("Display format", true);
propPane.UpdatePropertyFieldValue("Display format", "YYYY-MM-DD");

// Toggle editable
propPane.TogglePropertyState("Editable", "On");
};

const clickAndValidateDateCell = (row: number, column: number) => {
// Click unix cell edit
table.ClickOnEditIcon(row, column);

// Click on specific date within
agHelper.GetNClick(
`${table._dateInputPopover} [aria-label='${table.getFormattedTomorrowDates().verboseFormat}']`,
);

// Check that date is set in column
table
.ReadTableRowColumnData(row, column, "v2")
.then((val) =>
expect(val).to.equal(table.getFormattedTomorrowDates().isoFormat),
);
};

it("1. should allow inline editing of Unix Timestamp in seconds (unix/s)", () => {
table.ChangeColumnType("unixs", "Date");
setEditableDateFormats("Epoch");
clickAndValidateDateCell(0, 0);
});

it("2. should allow inline editing of Unix Timestamp in milliseconds (unix/ms)", () => {
table.ChangeColumnType("unixms", "Date");
setEditableDateFormats("Milliseconds");
clickAndValidateDateCell(0, 1);
});

it("3. should allow inline editing of date in YYYY-MM-DD format", () => {
table.EditColumn("yyyymmdd", "v2");
setEditableDateFormats("YYYY-MM-DD");
clickAndValidateDateCell(0, 2);
});

it("4. should allow inline editing of date in YYYY-MM-DD HH:mm format", () => {
table.EditColumn("yyyymmddhhmm", "v2");
setEditableDateFormats("YYYY-MM-DD HH:mm");
clickAndValidateDateCell(0, 3);
});

it("5. should allow inline editing of date in ISO 8601 format (YYYY-MM-DDTHH:mm:ss)", () => {
table.EditColumn("iso8601", "v2");
setEditableDateFormats("YYYY-MM-DDTHH:mm:ss");
clickAndValidateDateCell(0, 4);
});

it("6. should allow inline editing of date in YYYY-MM-DD HH:mm format", () => {
table.EditColumn("yyyymmddTHHmmss", "v2");
setEditableDateFormats("YYYY-MM-DD HH:mm");
clickAndValidateDateCell(0, 5);
});

it("7. should allow inline editing of date in 'do MMM yyyy' format", () => {
table.ChangeColumnType("yyyymmddhhmmss", "Date");
setEditableDateFormats("YYYY-MM-DDTHH:mm:ss");
clickAndValidateDateCell(0, 6);
});

it("8. should allow inline editing of date in DD/MM/YYYY format", () => {
table.ChangeColumnType("doMMMyyyy", "Date");
setEditableDateFormats("Do MMM YYYY");
clickAndValidateDateCell(0, 7);
});

it("9. should allow inline editing of date in DD/MM/YYYY HH:mm format", () => {
table.EditColumn("ddmmyyyy", "v2");
setEditableDateFormats("DD/MM/YYYY");
clickAndValidateDateCell(0, 8);
});

it("10. should allow inline editing of date in LLL (Month Day, Year Time) format", () => {
table.EditColumn("ddmmyyyyhhmm", "v2");
setEditableDateFormats("DD/MM/YYYY HH:mm");
clickAndValidateDateCell(0, 9);
});

it("11. should allow inline editing of date in LL (Month Day, Year) format", () => {
table.EditColumn("lll", "v2");
setEditableDateFormats("LLL");
clickAndValidateDateCell(0, 10);
});

it("12. should allow inline editing of date in 'D MMMM, YYYY' format", () => {
table.EditColumn("ll", "v2");
setEditableDateFormats("LL");
clickAndValidateDateCell(0, 11);
});

it("13. should allow inline editing of date in 'h:mm A D MMMM, YYYY' format", () => {
table.EditColumn("dmmmmyyyy", "v2");
setEditableDateFormats("D MMMM, YYYY");
clickAndValidateDateCell(0, 12);
});

it("14. should allow inline editing of date in MM-DD-YYYY format", () => {
table.EditColumn("hmmAdmmmmyyyy", "v2");
setEditableDateFormats("H:mm A D MMMM, YYYY");
clickAndValidateDateCell(0, 13);
});

it("15. should allow inline editing of date in DD-MM-YYYY format", () => {
table.EditColumn("mm1dd1yyyy", "v2");
setEditableDateFormats("MM-DD-YYYY");
clickAndValidateDateCell(0, 14);
});
},
);
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ describe(
force: true,
})
.type(
"https://www.facebook.com/users/{{Button2.text}}?key=test&val={{Button2.text}}",
"http://host.docker.internal:5001/{{Button2.text}}?key=test&val={{Button2.text}}",
{ force: true, parseSpecialCharSequences: false },
)
.wait(3000)
Expand All @@ -106,7 +106,7 @@ describe(
.type("{enter}", { parseSpecialCharSequences: true });

cy.validateEvaluatedValue(
"https://www.facebook.com/users/Cancel?key=test&val=Cancel",
"http://host.docker.internal:5001/Cancel?key=test&val=Cancel",
);
});
},
Expand Down
26 changes: 26 additions & 0 deletions app/client/cypress/fixtures/tableDateColumnTypes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
export const tableDateColumnTypes = `
{{
[
{
"unixs": 1727212200,
"unixms": 1727212200000,
"yyyymmdd": "2024-09-25",
"yyyymmddhhmm": "2024-09-25 14:30",
iso8601: "2024-09-25T14:30:00.000Z",
"yyyymmddTHHmmss": "2024-09-25T14:30:00",
"yyyymmddhhmmss": "2024-09-25 02:30:00",
"doMMMyyyy": "25th Sep 2024",
"ddmmyyyy": "25/09/2024",
"ddmmyyyyhhmm": "25/09/2024 14:30",
lll: "September 25, 2024 2:30 PM",
ll: "September 25, 2024",
"dmmmmyyyy": "25 September, 2024",
"hmmAdmmmmyyyy": "2:30 PM 25 September, 2024",
"mm1dd1yyyy": "09-25-2024",
"dd1mm1yyyy": "25-09-2024",
"ddimmiyy": "25/09/24",
"mmddyy": "09/25/24",
},
]
}}
`;
42 changes: 38 additions & 4 deletions app/client/cypress/support/Pages/Table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -855,9 +855,44 @@ export class Table {
verify && cy.get(selector).eq(1).should("be.disabled");
}

/**
* Helper function to get formatted date strings for tomorrow's date.
*
* @returns {Object} An object containing:
* - verbose format (e.g., "Sat Sep 21 2024")
* - ISO date format (e.g., "2024-09-21")
*/
public getFormattedTomorrowDates() {
// Create a new Date object for today
const tomorrow = new Date();

// Set the date to tomorrow by adding 1 to today's date
tomorrow.setDate(tomorrow.getDate() + 1);

// Format tomorrow's date in verbose form (e.g., "Sat Sep 21 2024")
const verboseFormat = tomorrow
.toLocaleDateString("en-US", {
weekday: "short",
year: "numeric",
month: "short",
day: "2-digit",
})
.replace(/,/g, ""); // Remove commas from the formatted string

// Format tomorrow's date in ISO form (e.g., "2024-09-21")
const isoFormat = tomorrow.toISOString().split("T")[0]; // Extract the date part only

// Return both formatted date strings as an object
return {
verboseFormat,
isoFormat,
};
}

public ExpandIfCollapsedSection(sectionName: string) {
cy.get(`.t--property-pane-section-collapse-${sectionName}`).scrollIntoView().then(
($element) => {
cy.get(`.t--property-pane-section-collapse-${sectionName}`)
.scrollIntoView()
.then(($element) => {
cy.wrap($element)
.siblings(".bp3-collapse")
.then(($sibling) => {
Expand All @@ -867,7 +902,6 @@ export class Table {
$element.click();
}
});
},
);
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,18 @@ import React from "react";
import APIEditorForm from "./components/APIEditorForm";
import { Flex } from "@appsmith/ads";
import { useChangeActionCall } from "./hooks/useChangeActionCall";
import { usePluginActionContext } from "../../PluginActionContext";
import { UIComponentTypes } from "api/PluginApi";

const PluginActionForm = () => {
useChangeActionCall();
const { plugin } = usePluginActionContext();

return (
<Flex p="spaces-2" w="100%">
<APIEditorForm />
{plugin.uiComponent === UIComponentTypes.ApiEditorForm ? (
<APIEditorForm />
) : null}
</Flex>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function useGetFormActionValues() {

// In an unlikely scenario where form is not initialised,
// return empty values to avoid form ui issues
if (!isAPIAction(formValues)) {
if (!formValues || !isAPIAction(formValues)) {
return {
actionHeaders: [],
actionParams: [],
Expand Down
Loading

0 comments on commit b92a9d0

Please sign in to comment.