Skip to content

Commit

Permalink
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
Browse files Browse the repository at this point in the history
…o chore/eject-cra-retry-3
  • Loading branch information
riodeuno committed Feb 13, 2025
2 parents 7fca371 + e71d14b commit 93155cf
Show file tree
Hide file tree
Showing 9 changed files with 153 additions and 78 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
2 changes: 1 addition & 1 deletion app/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
"copy-to-clipboard": "^3.3.1",
"core-js": "^3.9.1",
"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
74 changes: 74 additions & 0 deletions app/client/src/components/formControls/DropDownControl.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -220,3 +220,77 @@ describe("DropDownControl grouping tests", () => {
expect(screen.getByText("Option 2")).toBeInTheDocument();
});
});

describe("DropdownControl Single select tests", () => {
// TODO: Fix this the next time the file is edited
// eslint-disable-next-line @typescript-eslint/no-explicit-any
let store: any;

const initialValuesSingleSelect = {
actionConfiguration: {
testPath: "option1",
},
};

const mockActionSingleSelect = {
type: "API_ACTION",
name: "Test API Action",
datasource: {
id: "datasource1",
name: "Datasource 1",
},
actionConfiguration: {
body: "",
headers: [],
testPath: "option1",
},
};

const dropDownPropsSingleSelect = {
options: mockOptions,
placeholderText: "Select Columns",
configProperty: "actionConfiguration.testPath",
controlType: "PROJECTION",
propertyValue: "",
label: "Columns",
id: "column",
formName: "",
isValid: true,
formValues: mockActionSingleSelect,
isLoading: false,
maxTagCount: 3,
isAllowClear: true,
};

beforeEach(() => {
store = mockStore({
form: {
TestForm: {
values: initialValuesSingleSelect,
},
},
appState: {},
});
});
it("should clear selected option", async () => {
render(
<Provider store={store}>
<ReduxFormDecorator>
<DropDownControl {...dropDownPropsSingleSelect} />
</ReduxFormDecorator>
</Provider>,
);

const clearAllButton = document.querySelector(".rc-select-clear");

expect(clearAllButton).toBeInTheDocument();

fireEvent.click(clearAllButton!);

await waitFor(() => {
const options = screen.queryAllByText(/Option.../);

expect(options.length).toBe(0);
});
});
});
5 changes: 4 additions & 1 deletion app/client/src/components/formControls/DropDownControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,9 @@ function renderDropdown(

return (
<Select
allowClear={props.isMultiSelect && !isEmpty(selectedValue)}
allowClear={
(props.isMultiSelect || props.isAllowClear) && !isEmpty(selectedValue)
}
data-testid={`t--dropdown-${props?.configProperty}`}
defaultValue={props.initialValue}
isDisabled={props.disabled}
Expand Down Expand Up @@ -365,6 +367,7 @@ export interface DropDownControlProps extends ControlProps {
formValues: Partial<Action>;
setFirstOptionAsDefault?: boolean;
maxTagCount?: number;
isAllowClear?: boolean;
}

interface ReduxDispatchProps {
Expand Down
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
33 changes: 11 additions & 22 deletions app/client/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13063,7 +13063,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 @@ -16333,19 +16333,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 @@ -16541,15 +16542,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 @@ -16565,18 +16566,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
6 changes: 3 additions & 3 deletions app/server/appsmith-plugins/mysqlPlugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@

<!-- Test Dependencies -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.28</version>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<version>9.2.0</version>
<scope>test</scope>
</dependency>

Expand Down

0 comments on commit 93155cf

Please sign in to comment.