Skip to content

Commit

Permalink
Merge branch 'release' into feat/multi-select-widget-lazy-load
Browse files Browse the repository at this point in the history
  • Loading branch information
ayushpahwa committed Feb 13, 2025
2 parents 5b2aeb2 + ec4ea27 commit 01f4649
Show file tree
Hide file tree
Showing 11 changed files with 132 additions and 83 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build-client-server-count.yml
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ jobs:
fi
- name: Add a comment on the PR with new CI failures
if: env.ci_test_failed != 'true' && needs.file-check.outputs.pr != '0'
if: env.ci_test_failed == 'true' && needs.file-check.outputs.pr != '0'
uses: peter-evans/create-or-update-comment@v3
with:
issue-number: ${{fromJson(needs.file-check.outputs.pr)}}
Expand All @@ -328,7 +328,7 @@ jobs:
```
- name: Add a comment on the PR when ci-test-limited is successful
if: env.ci_test_failed == 'true' && needs.file-check.outputs.pr != '0'
if: env.ci_test_failed != 'true' && needs.file-check.outputs.pr != '0'
uses: peter-evans/create-or-update-comment@v3
with:
issue-number: ${{fromJson(needs.file-check.outputs.pr)}}
Expand Down Expand Up @@ -473,7 +473,7 @@ jobs:
fi
- name: Add a comment on the PR with new CI failures
if: env.ci_test_failed != 'true' && needs.file-check.outputs.pr != '0'
if: env.ci_test_failed == 'true' && needs.file-check.outputs.pr != '0'
uses: peter-evans/create-or-update-comment@v3
with:
issue-number: ${{fromJson(needs.file-check.outputs.pr)}}
Expand All @@ -487,7 +487,7 @@ jobs:
```
- name: Add a comment on the PR when ci-test-limited-existing-docker-image is success
if: env.ci_test_failed == 'true' && needs.file-check.outputs.pr != '0'
if: env.ci_test_failed != 'true' && needs.file-check.outputs.pr != '0'
uses: peter-evans/create-or-update-comment@v3
with:
issue-number: ${{fromJson(needs.file-check.outputs.pr)}}
Expand Down
23 changes: 15 additions & 8 deletions .github/workflows/ci-test-custom-script.yml
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,6 @@ jobs:
fi
- name: Run the cypress test
uses: cypress-io/github-action@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CYPRESS_USERNAME: ${{ secrets.CYPRESS_USERNAME }}
Expand Down Expand Up @@ -371,13 +370,21 @@ jobs:
CYPRESS_SNOWFLAKE_ACCOUNT_NAME: ${{ secrets.SNOWFLAKE_ACCOUNT_NAME }}
CYPRESS_SNOWFLAKE_USERNAME: ${{ secrets.SNOWFLAKE_USERNAME }}
CYPRESS_SNOWFLAKE_PASSWORD: ${{ secrets.SNOWFLAKE_PASSWORD }}
with:
browser: ${{ env.BROWSER_PATH }}
install: false
config-file: cypress_ci_custom.config.ts
spec: ${{ inputs.spec }}
working-directory: app/client
env: "NODE_ENV=development"
NODE_ENV: development
run: |
cd app/client
ls -la
if [[ -n "${{ inputs.spec }}" ]]; then
npx cypress-repeat-pro run -n 3 --rerun-failed-only \
--spec "${{ inputs.spec }}" \
--config-file "cypress_ci_custom.config.ts" \
--browser "${{ env.BROWSER_PATH }}"
else
npx cypress-repeat-pro run -n 3 --rerun-failed-only \
--config-file "cypress_ci_custom.config.ts" \
--browser "${{ env.BROWSER_PATH }}"
fi
cat cy-repeat-summary.txt
- name: Trim number of cypress log files
if: failure()
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/ci-test-limited-with-count.yml
Original file line number Diff line number Diff line change
Expand Up @@ -434,26 +434,29 @@ jobs:
CYPRESS_updateSnapshots=true npx cypress-repeat-pro run -n "${{ inputs.run_count }}" --force \
--spec "${{ inputs.specs_to_run }}" \
--config-file "cypress_ci_custom.config.ts" \
--browser "${{ env.BROWSER_PATH }}"
--browser "${{ env.BROWSER_PATH }}" || echo "Cypress tests failed, proceeding with summary check..."
else
echo "Running Cypress tests without snapshot updates..."
npx cypress-repeat-pro run -n "${{ inputs.run_count }}" --force \
--spec "${{ env.specs_to_run }}" \
--config-file "cypress_ci_custom.config.ts" \
--browser "${{ env.BROWSER_PATH }}"
--browser "${{ env.BROWSER_PATH }}" || echo "Cypress tests failed, proceeding with summary check..."
fi
cat cy-repeat-summary.txt
# Define the path for the failure flag file
FAILURE_FLAG_FILE="ci_test_status.txt"
# Check for test results and store the status in the file
if ! grep -q "Total Failed: 0" cy-repeat-summary.txt; then
echo "ci_test_failed=true" > "$FAILURE_FLAG_FILE"
echo "ci_test_failed=true" > "$FAILURE_FLAG_FILE"
else
echo "ci_test_failed=false" > "$FAILURE_FLAG_FILE"
echo "ci_test_failed=false" > "$FAILURE_FLAG_FILE"
fi
cat "$FAILURE_FLAG_FILE"
cat "$FAILURE_FLAG_FILE"
- name: Trim number of cypress log files
if: failure()
run: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const commonlocators = require("../../../../locators/commonlocators.json");

import {
agHelper,
assertHelper,
dataSources,
deployMode,
homePage,
Expand Down Expand Up @@ -45,6 +46,7 @@ describe(

//TestData & save datasource
dataSources.TestSaveDatasource();
agHelper.WaitUntilAllToastsDisappear();
// fetch bucket
cy.wait("@getDatasourceStructure").should(
"have.nested.property",
Expand Down Expand Up @@ -80,8 +82,7 @@ describe(
});

it("2. Generate CRUD page from datasource ACTIVE section", function () {
cy.NavigateToDSGeneratePage(datasourceName);

dataSources.GeneratePageForDS(datasourceName);
// fetch bucket
cy.wait("@getDatasourceStructure").should(
"have.nested.property",
Expand Down Expand Up @@ -129,12 +130,12 @@ describe(
cy.fillAmazonS3DatasourceForm();

//TestData source
cy.get(".t--test-datasource").click();
cy.wait("@testDatasource");
dataSources.TestDatasource(true);
agHelper.WaitUntilAllToastsDisappear();

//Save source
cy.get(".t--save-datasource").click();
cy.wait("@saveDatasource");
dataSources.SaveDatasource();
agHelper.WaitUntilAllToastsDisappear();

//Verify page after save clicked
// cy.get("@saveDatasource").then((httpResponse) => {
Expand Down
4 changes: 2 additions & 2 deletions app/client/cypress/support/Pages/DataSources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ export class DataSources {
"//div[text()='" + name + "']/parent::div";
public _password =
"input[name $= '.datasourceConfiguration.authentication.password']";
private _testDs = ".t--test-datasource";
_saveDs = ".t--save-datasource";
public _testDs = ".t--test-datasource";
public _saveDs = ".t--save-datasource";
_datasourceCard = ".t--datasource";
_dsMenuoptions = "div.t--datasource-menu-option";
_editButton = ".t--edit-datasource";
Expand Down
4 changes: 2 additions & 2 deletions app/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
"craco-alias": "^2.1.1",
"craco-babel-loader": "^1.0.4",
"cypress-log-to-output": "^1.1.2",
"cypress-repeat-pro": "^1.0.1",
"cypress-repeat-pro": "^1.0.9",
"d3-geo": "^3.1.0",
"date-fns": "^4.1.0",
"dayjs": "^1.10.6",
Expand Down Expand Up @@ -388,4 +388,4 @@
"@types/react": "^17.0.2",
"postcss": "8.4.31"
}
}
}
2 changes: 2 additions & 0 deletions app/client/src/ce/constants/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2626,3 +2626,5 @@ export const PREMIUM_DATASOURCES = {

export const DATASOURCE_SECURE_TEXT = () =>
`When connecting datasources, your passwords are AES-256 encrypted and we never store any of your data.`;

export const TABLE_LOADING_RECORDS = () => "loading records";
67 changes: 33 additions & 34 deletions app/client/src/sagas/ActionSagas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1060,10 +1060,6 @@ function* toggleActionExecuteOnLoadSaga(

function* handleMoveOrCopySaga(actionPayload: ReduxAction<Action>) {
const { baseId: baseActionId, pluginId, pluginType } = actionPayload.payload;
const isApi = pluginType === PluginType.API;
const isQuery = pluginType === PluginType.DB;
const isSaas = pluginType === PluginType.SAAS;
const isInternal = pluginType === PluginType.INTERNAL;
const { parentEntityId } = resolveParentEntityMetadata(actionPayload.payload);

if (!parentEntityId) return;
Expand All @@ -1073,37 +1069,40 @@ function* handleMoveOrCopySaga(actionPayload: ReduxAction<Action>) {
parentEntityId,
);

if (isApi) {
history.push(
apiEditorIdURL({
baseParentEntityId,
baseApiId: baseActionId,
}),
);
}

if (isQuery || isInternal) {
history.push(
queryEditorIdURL({
baseParentEntityId,
baseQueryId: baseActionId,
}),
);
}

if (isSaas) {
const plugin = shouldBeDefined<Plugin>(
yield select(getPlugin, pluginId),
`Plugin not found for pluginId - ${pluginId}`,
);
switch (pluginType) {
case PluginType.API: {
history.push(
apiEditorIdURL({
baseParentEntityId,
baseApiId: baseActionId,
}),
);
break;
}
case PluginType.SAAS: {
const plugin = shouldBeDefined<Plugin>(
yield select(getPlugin, pluginId),
`Plugin not found for pluginId - ${pluginId}`,
);

history.push(
saasEditorApiIdURL({
baseParentEntityId,
pluginPackageName: plugin.packageName,
baseApiId: baseActionId,
}),
);
history.push(
saasEditorApiIdURL({
baseParentEntityId,
pluginPackageName: plugin.packageName,
baseApiId: baseActionId,
}),
);
break;
}
default: {
history.push(
queryEditorIdURL({
baseParentEntityId,
baseQueryId: baseActionId,
}),
);
break;
}
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import React from "react";
import "@testing-library/jest-dom";
import { render, screen } from "@testing-library/react";
import { LoadingIndicator } from "./LoadingIndicator";

describe("LoadingIndicator", () => {
it("renders a spinner and loading text", () => {
render(<LoadingIndicator />);

// Check if the Flex container is rendered
const flexContainer = document.querySelector(".ads-v2-flex");

expect(flexContainer).toBeInTheDocument();

// Check if the spinner is rendered
const spinner = document.querySelector(".ads-v2-spinner");

expect(spinner).toBeInTheDocument();

// Check if the text is displayed correctly
const textElement = screen.getByText("loading records");

expect(textElement).toBeInTheDocument();
expect(textElement).toHaveClass("ads-v2-text");
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { Flex, Spinner, Text } from "@appsmith/ads";
import { createMessage, TABLE_LOADING_RECORDS } from "ee/constants/messages";
import React from "react";

export const LoadingIndicator = () => (
<Flex
alignItems="center"
background="var(--ads-v2-color-white)"
borderTop="1px solid var(--wds-color-border-onaccent)"
bottom="0"
gap="spaces-3"
left="0"
padding="spaces-3"
position="sticky"
right="0"
>
<Spinner iconProps={{ color: "var(--ads-v2-color-gray-400)" }} size="md" />
<Text color="var(--ads-v2-color-gray-400)" kind="body-s">
{createMessage(TABLE_LOADING_RECORDS)}
</Text>
</Flex>
);
33 changes: 11 additions & 22 deletions app/client/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13272,7 +13272,7 @@ __metadata:
cypress-network-idle: ^1.14.2
cypress-plugin-tab: ^1.0.5
cypress-real-events: ^1.8.1
cypress-repeat-pro: ^1.0.1
cypress-repeat-pro: ^1.0.9
cypress-tags: ^1.1.2
cypress-terminal-report: ^5.3.6
cypress-wait-until: ^1.7.2
Expand Down Expand Up @@ -16571,19 +16571,20 @@ __metadata:
languageName: node
linkType: hard

"cypress-repeat-pro@npm:^1.0.1":
version: 1.0.1
resolution: "cypress-repeat-pro@npm:1.0.1"
"cypress-repeat-pro@npm:^1.0.9":
version: 1.0.9
resolution: "cypress-repeat-pro@npm:1.0.9"
dependencies:
"@cypress/grep": ^4.0.1
arg: 5.0.2
bluebird: 3.7.2
debug: 4.3.5
debug: ^4.4.0
dotenv: 8.2.0
peerDependencies:
cypress: ">=5.3.0"
bin:
cypress-repeat-pro: index.js
checksum: e62a21479b62a5d5624ce21bdd8204afd754082d851d5fc712ad76e39ca2cfe6d446c2a1434025be77fa9d76fa257609285879e9841efecc26be4d25454fb732
checksum: 34d5e7a450c73c23085a30424ba748973cb697a9bdb906772864a3f42f6982bd301eb4722d62e2b02b340dfebfd7d9b5369783d077e4b82825001e64e795143e
languageName: node
linkType: hard

Expand Down Expand Up @@ -16790,15 +16791,15 @@ __metadata:
languageName: node
linkType: hard

"debug@npm:4, debug@npm:^4.0.0, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.0, debug@npm:^4.3.1, debug@npm:^4.3.2, debug@npm:^4.3.3, debug@npm:^4.3.4":
version: 4.3.7
resolution: "debug@npm:4.3.7"
"debug@npm:4, debug@npm:^4.0.0, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.0, debug@npm:^4.3.1, debug@npm:^4.3.2, debug@npm:^4.3.3, debug@npm:^4.3.4, debug@npm:^4.4.0":
version: 4.4.0
resolution: "debug@npm:4.4.0"
dependencies:
ms: ^2.1.3
peerDependenciesMeta:
supports-color:
optional: true
checksum: 822d74e209cd910ef0802d261b150314bbcf36c582ccdbb3e70f0894823c17e49a50d3e66d96b633524263975ca16b6a833f3e3b7e030c157169a5fabac63160
checksum: fb42df878dd0e22816fc56e1fdca9da73caa85212fbe40c868b1295a6878f9101ae684f4eeef516c13acfc700f5ea07f1136954f43d4cd2d477a811144136479
languageName: node
linkType: hard

Expand All @@ -16814,18 +16815,6 @@ __metadata:
languageName: node
linkType: hard

"debug@npm:4.3.5":
version: 4.3.5
resolution: "debug@npm:4.3.5"
dependencies:
ms: 2.1.2
peerDependenciesMeta:
supports-color:
optional: true
checksum: 7c002b51e256257f936dda09eb37167df952758c57badf6bf44bdc40b89a4bcb8e5a0a2e4c7b53f97c69e2970dd5272d33a757378a12c8f8e64ea7bf99e8e86e
languageName: node
linkType: hard

"debug@npm:^3.1.0, debug@npm:^3.2.7":
version: 3.2.7
resolution: "debug@npm:3.2.7"
Expand Down

0 comments on commit 01f4649

Please sign in to comment.