Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 113 additions & 0 deletions .github/workflows/ad-hoc-docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
name: Ad-hoc Docker Image

on:
# This line enables manual triggering of this workflow.
workflow_dispatch:
inputs:
branch:
description: Branch to build image out of
required: false
type: string
default: master
tag:
description: Tag to use for image
required: false
type: string
default: ad-hoc

jobs:
server-build:
name: server-build
uses: ./.github/workflows/server-build.yml
secrets: inherit
with:
branch: ${{ inputs.branch }}
skip-tests: true

client-build:
name: client-build
uses: ./.github/workflows/client-build.yml
secrets: inherit
with:
branch: ${{ inputs.branch }}

rts-build:
name: rts-build
uses: ./.github/workflows/rts-build.yml
secrets: inherit
with:
branch: ${{ inputs.branch }}

package:
needs: [server-build, client-build, rts-build]
runs-on: ubuntu-latest
# Set permissions since we're using OIDC token authentication between Depot and GitHub
permissions:
contents: read
id-token: write

steps:
# Check out the specified branch in case this workflow is called by another workflow
- name: Checkout the specified branch
uses: actions/checkout@v4
with:
fetch-tags: true
ref: ${{ inputs.branch }}

- name: Download the react build artifact
uses: actions/download-artifact@v4
with:
name: client-build
path: app/client

- name: Unpack the client build artifact
if: steps.run_result.outputs.run_result != 'success'
run: |
mkdir -p app/client/build
tar -xvf app/client/build.tar -C app/client/build

- name: Download the server build artifact
uses: actions/download-artifact@v4
with:
name: server-build
path: app/server/dist

- name: Download the rts build artifact
uses: actions/download-artifact@v4
with:
name: rts-dist
path: app/client/packages/rts/dist

- name: Untar the rts folder
run: |
tar -xvf app/client/packages/rts/dist/rts-dist.tar -C app/client/packages/rts/
echo "Cleaning up the tar files"
rm app/client/packages/rts/dist/rts-dist.tar

- name: Generate info.json
run: |
if [[ -f scripts/generate_info_json.sh ]]; then
scripts/generate_info_json.sh
fi

- name: Set up Depot CLI
uses: depot/setup-action@v1

- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Build and push environment specific image to Docker Hub
if: success()
uses: depot/build-push-action@v1
with:
context: .
push: true
platforms: linux/arm64,linux/amd64
build-args: |
APPSMITH_SEGMENT_CE_KEY=${{ secrets.APPSMITH_SEGMENT_CE_KEY }}
BASE=${{ vars.DOCKER_HUB_ORGANIZATION }}/base-${{ vars.EDITION }}:nightly
tags: |
${{ vars.DOCKER_HUB_ORGANIZATION }}/appsmith-${{ vars.EDITION }}:${{ inputs.tag }}
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ jobs:
close-issue-message: 'This issue has been closed because of inactivity.'
close-pr-message: 'This PR has been closed because of inactivity.'
only-issue-labels: 'Critical'
exempt-pr-labels: 'Dont merge,WIP'
exempt-pr-labels: 'Dont merge,WIP,User Testing'


Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import {
entityExplorer,
table,
propPane,
agHelper,
deployMode,
draggableWidgets,
locators,
propPane,
table,
} from "../../../../../support/Objects/ObjectsCore";
const widgetsPage = require("../../../../../locators/Widgets.json");

Expand Down Expand Up @@ -114,6 +113,11 @@ describe(
it("4. It provides currentRow and currentIndex properties in min validation field", function () {
agHelper.AddDsl("tableV2NewDslWithPagination");
cy.openPropertyPane("tablewidgetv2");
// To make sorting more predictable making `id` column type Number.
table.toggleColumnEditableViaColSettingsPane("id", "v2", true, false);
cy.changeColumnType("Number");

propPane.NavigateBackToPropertyPane();
table.toggleColumnEditableViaColSettingsPane(
"orderAmount",
"v2",
Expand All @@ -124,17 +128,18 @@ describe(
propPane.UpdatePropertyFieldValue("Computed value", "{{currentIndex}}");
cy.changeColumnType("Number");

// #region Min
propPane.UpdatePropertyFieldValue("Min", "{{currentIndex}}");
cy.get(".t--evaluatedPopup-error").should("not.exist");

// Update cell with row : 1, column : orderAmount

table.EditTableCell(1, 4, -1, false);
cy.get(".bp3-popover-content").contains("Invalid input");
cy.get(locators._popoverToolTip).contains("Invalid input");
table.UpdateTableCell(1, 4, 0);
cy.get(".bp3-popover-content").contains("Invalid input");
cy.get(locators._popoverToolTip).contains("Invalid input");
table.UpdateTableCell(1, 4, 3);
cy.get(".bp3-popover-content").should("not.exist");
cy.get(locators._popoverToolTip).should("not.exist");

// Check if currentRow works
propPane.NavigateBackToPropertyPane();
Expand All @@ -148,94 +153,141 @@ describe(

// Update cell with row : 0, column : orderAmount. The min is set to 7 (i.e value of cell in id column)
table.EditTableCell(1, 4, 8, false);
cy.get(".bp3-popover-content").should("not.exist");
cy.get(locators._popoverToolTip).should("not.exist");

table.UpdateTableCell(1, 4, 6);
cy.get(".bp3-popover-content").contains("Row at index 1 is not valid");
table.UpdateTableCell(1, 4, -1);
cy.get(locators._popoverToolTip).contains("Row at index 1 is not valid");

table.UpdateTableCell(1, 4, 8);
cy.get(".bp3-popover-content").should("not.exist");
cy.get(locators._popoverToolTip).should("not.exist");

propPane.UpdatePropertyFieldValue(
"Error message",
"Row with id {{currentRow.id}} is not valid",
);

table.EditTableCell(1, 4, 5, false);
cy.get(".bp3-popover-content").contains("Row with id 7 is not valid");
table.EditTableCell(1, 4, 1, false);
cy.get(locators._popoverToolTip).contains("Row with id 2 is not valid");

cy.discardTableCellValue(4, 1);
table.DiscardEditRow(1, 5);

// Sort the id column and ensure that `currentRow` is correctly evaluated
table.SortColumn("id", "descending");
table.EditTableCell(1, 4, 1, false);
cy.get(locators._popoverToolTip).contains("Row with id 24 is not valid");

cy.discardTableCellValue(4, 1);
table.SortColumn("id", "ascending");

propPane.UpdatePropertyFieldValue("Min", "");
propPane.UpdatePropertyFieldValue("Error message", "");

// #endregion Min

// #region Regex
// Check for currentIndex property on Regex field
cy.changeColumnType("Plain text");
propPane.UpdatePropertyFieldValue("Regex", "{{currentIndex}}2");

cy.get(".t--evaluatedPopup-error").should("not.exist");
table.EditTableCell(1, 4, 3, false);

cy.get(".bp3-popover-content").contains("Invalid input");
cy.get(locators._popoverToolTip).contains("Invalid input");
table.UpdateTableCell(1, 4, 12);
cy.get(".bp3-popover-content").should("not.exist");
cy.get(locators._popoverToolTip).should("not.exist");

// Check for currentRow property on Regex field
propPane.UpdatePropertyFieldValue("Regex", "{{currentRow.id}}");
table.EditTableCell(1, 4, 7, false);
cy.get(".bp3-popover-content").should("not.exist");
table.EditTableCell(1, 4, 20, false);
cy.get(locators._popoverToolTip).should("not.exist");
table.UpdateTableCell(1, 4, 8);
cy.get(".bp3-popover-content").contains("Invalid input");
table.UpdateTableCell(1, 4, 7);
cy.get(".bp3-popover-content").should("not.exist");
cy.get(locators._popoverToolTip).contains("Invalid input");
table.UpdateTableCell(1, 4, 20);
cy.get(locators._popoverToolTip).should("not.exist");

cy.discardTableCellValue(4, 1);
table.DiscardEditRow(1, 5);

// Sort the id column and ensure that `currentRow` is correctly evaluated
table.SortColumn("id", "descending");

table.EditTableCell(1, 4, 10, false);
cy.get(locators._popoverToolTip).contains("Invalid input");

table.UpdateTableCell(1, 4, 24);
cy.get(locators._popoverToolTip).should("not.exist");

propPane.UpdatePropertyFieldValue("Regex", "");

table.DiscardEditRow(1, 5);
table.SortColumn("id", "ascending");

// #endregion Regex

// #region Required
propPane.EnterJSContext("Required", "{{currentIndex == 1}}");
table.EditTableCell(1, 4, "", false);
cy.get(".bp3-popover-content").contains("This field is required");
cy.get(locators._popoverToolTip).contains(
Cypress.env("MESSAGES").FIELD_REQUIRED_MESSAGE(),
);
table.UpdateTableCell(1, 4, 1, true);
cy.get(".bp3-popover-content").should("not.exist");

cy.wait(1500);
cy.discardTableRow(5, 1);
cy.wait(1500);
cy.get(locators._popoverToolTip).should("not.exist");

// Value isn't required in Row Index 2
table.EditTableCell(2, 4, "", false);
cy.get(".bp3-popover-content").should("not.exist");
cy.get(locators._popoverToolTip).should("not.exist");
table.UpdateTableCell(2, 4, "11");
cy.get(".bp3-popover-content").should("not.exist");
cy.get(locators._popoverToolTip).should("not.exist");
table.UpdateTableCell(2, 4, "", true);
cy.get(".bp3-popover-content").should("not.exist");

cy.wait(1500);
cy.discardTableRow(5, 2);
cy.get(locators._popoverToolTip).should("not.exist");

// Check for Required property using currentRow, row with index 1 has id 7
propPane.UpdatePropertyFieldValue("Required", "{{currentRow.id == 7}}");
table.DiscardEditRow(2, 5);
// Check for Required property using currentRow, row with index 1 has id 2
propPane.UpdatePropertyFieldValue("Required", "{{currentRow.id == 2}}");

table.EditTableCell(1, 4, "", false);
cy.get(".bp3-popover-content").contains("This field is required");
cy.get(locators._popoverToolTip).contains(
Cypress.env("MESSAGES").FIELD_REQUIRED_MESSAGE(),
);
table.UpdateTableCell(1, 4, 1);
cy.get(".bp3-popover-content").should("not.exist");
cy.get(locators._popoverToolTip).should("not.exist");
table.UpdateTableCell(1, 4, "");
cy.get(".bp3-popover-content").contains("This field is required");
cy.get(locators._popoverToolTip).contains(
Cypress.env("MESSAGES").FIELD_REQUIRED_MESSAGE(),
);

table.UpdateTableCell(1, 4, "1", true);
cy.get(".bp3-popover-content").should("not.exist");

cy.wait(1500);
cy.discardTableRow(5, 1);
cy.wait(1500);
cy.get(locators._popoverToolTip).should("not.exist");

// Value isn't required in Row Index 2
table.EditTableCell(2, 4, "", false);
cy.get(".bp3-popover-content").should("not.exist");
cy.get(locators._popoverToolTip).should("not.exist");
table.UpdateTableCell(2, 4, 10);
cy.get(".bp3-popover-content").should("not.exist");
cy.get(locators._popoverToolTip).should("not.exist");
table.UpdateTableCell(2, 4, "", true);
cy.get(".bp3-popover-content").should("not.exist");
cy.get(locators._popoverToolTip).should("not.exist");

table.DiscardEditRow(2, 5);

// Sort the id column and ensure that `currentRow` is correctly evaluated
table.SortColumn("id", "descending");
table.EditTableCell(1, 4, "", false);
cy.get(locators._popoverToolTip).should("not.exist");
table.UpdateTableCell(1, 4, 10);
cy.get(locators._popoverToolTip).should("not.exist");

propPane.UpdatePropertyFieldValue("Required", "{{currentRow.id == 24}}");
table.EditTableCell(1, 4, "");
cy.get(locators._popoverToolTip).contains(
Cypress.env("MESSAGES").FIELD_REQUIRED_MESSAGE(),
);

cy.discardTableCellValue(4, 1);
table.DiscardEditRow(1, 5);

cy.wait(1500);
cy.discardTableRow(5, 2);
table.SortColumn("id", "ascending");
// #endregion Required

// Cleanup
propPane.UpdatePropertyFieldValue(
Expand Down
Loading