From fa45282b0a19f0e285c656dd4c8c165a30dbf784 Mon Sep 17 00:00:00 2001 From: Ankita Kinger Date: Thu, 26 May 2022 10:05:35 +0530 Subject: [PATCH] fix: alignment of the image seen on no search results on application page (#13950) * fix: 12861 trim unnecessary re-render in select widget in server side rendering (#12865) * add debounce to search and remove state var * increase debounce time * fix: updated the condition to show expiry key (#13092) * Add index for git (#13133) * fix: Fixed compile time errors * fix: Unable to see apps in home page after git connect fails (#13387) * Fix Redis installation in Dockerfile (#13428) (#13430) Conflicts: Dockerfile * fix: only execute pageload actions after successfully fetching actions and jscollections in view mode (#13521) * prevent execution of onPageLoad actions before sucessful actions fetch * Perform url update before fetching actions and jscollections (cherry picked from commit 7261834fe539545b72d34aa75df9036f645f726d) * fix: NPE check when datasource createdAt is null (cherry picked from commit beafb371b24180dce2e351f1dea6d9d34db2a204) * fixed image alignment for no search results on applications page * deleted duplicate file * reload to Refresh script update * Adding sleep - script fix Co-authored-by: Preet Sidhu Co-authored-by: Aman Agarwal Co-authored-by: Abhijeet <41686026+abhvsn@users.noreply.github.com> Co-authored-by: Nidhi Co-authored-by: Somangshu Goswami Co-authored-by: Rimil Dey Co-authored-by: Anagh Hegde Co-authored-by: Shrikant Sharat Kandula Co-authored-by: Arpit Mohan Co-authored-by: Favour Ohanekwu Co-authored-by: Trisha Anand Co-authored-by: Aishwarya UR --- .../OnLoadTests/JSOnLoad_Spec.ts | 4 +- .../cypress/support/Pages/AggregateHelper.ts | 3 +- .../components/ads/formFields/SelectField.tsx | 77 ------------------- app/client/src/pages/Applications/index.tsx | 1 - app/client/src/sagas/InitSagas.ts | 26 +++++++ 5 files changed, 30 insertions(+), 81 deletions(-) delete mode 100644 app/client/src/components/ads/formFields/SelectField.tsx diff --git a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/OnLoadTests/JSOnLoad_Spec.ts b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/OnLoadTests/JSOnLoad_Spec.ts index 32245662cf..d9d180926a 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/OnLoadTests/JSOnLoad_Spec.ts +++ b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/OnLoadTests/JSOnLoad_Spec.ts @@ -143,7 +143,7 @@ describe("JSObjects OnLoad Actions tests", function() { agHelper.ClickButton("No"); agHelper.ValidateToastMessage("Failed to execute actions during page load"); //When Confirmation is NO table.WaitForTableEmpty(); - cy.reload(); + agHelper.RefreshPage(); agHelper.AssertElementPresence(jsEditor._dialog("Confirmation Dialog")); agHelper.AssertElementPresence( jsEditor._dialogBody((jsName as string) + ".getId"), @@ -510,7 +510,7 @@ describe("JSObjects OnLoad Actions tests", function() { it("12. Tc #1646 - Honouring the order of execution & Bug 13826 + Bug 13646 - Delpoy page", () => { agHelper.DeployApp(); - + agHelper.Sleep(2000); agHelper.AssertElementPresence(jsEditor._dialogBody("getBooks")); agHelper.ClickButton("No"); agHelper.ValidateToastMessage('The action "getBooks" has failed'); diff --git a/app/client/cypress/support/Pages/AggregateHelper.ts b/app/client/cypress/support/Pages/AggregateHelper.ts index 99c3d1c46b..c3990b52ab 100644 --- a/app/client/cypress/support/Pages/AggregateHelper.ts +++ b/app/client/cypress/support/Pages/AggregateHelper.ts @@ -57,7 +57,7 @@ export class AggregateHelper { ).then((dslDumpResp) => { //cy.log("Pages resposne is : " + dslDumpResp.body); expect(dslDumpResp.status).equal(200); - cy.reload(); + this.RefreshPage(); }); }); }); @@ -476,6 +476,7 @@ export class AggregateHelper { public RefreshPage() { cy.reload(); + this.Sleep(2000) } public ActionContextMenuWithInPane( diff --git a/app/client/src/components/ads/formFields/SelectField.tsx b/app/client/src/components/ads/formFields/SelectField.tsx deleted file mode 100644 index 4c6694cb5b..0000000000 --- a/app/client/src/components/ads/formFields/SelectField.tsx +++ /dev/null @@ -1,77 +0,0 @@ -import React, { useEffect, useState } from "react"; -import { - Field, - WrappedFieldMetaProps, - WrappedFieldInputProps, -} from "redux-form"; -import Dropdown from "components/ads/Dropdown"; - -type DropdownWrapperProps = { - placeholder: string; - input?: { - value?: string; - onChange?: (value?: string) => void; - }; - options: Array<{ id: string; value: string; label?: string }>; - fillOptions?: boolean; -}; - -function DropdownWrapper(props: DropdownWrapperProps) { - const [selectedOption, setSelectedOption] = useState({ - value: props.placeholder, - }); - const onSelectHandler = (value?: string) => { - props.input && props.input.onChange && props.input.onChange(value); - }; - - useEffect(() => { - if (props.input && props.input.value) { - setSelectedOption({ value: props.input.value }); - } else if (props.placeholder) { - setSelectedOption({ value: props.placeholder }); - } - }, [props.input, props.placeholder]); - - return ( - - ); -} - -const renderComponent = ( - componentProps: SelectFieldProps & { - meta: Partial; - input: Partial; - }, -) => { - return ; -}; - -type SelectFieldProps = { - name: string; - placeholder: string; - options: Array<{ id: string; value: string; label?: string }>; - size?: "large" | "small"; - outline?: boolean; - fillOptions?: boolean; -}; - -export function SelectField(props: SelectFieldProps) { - return ( - - ); -} - -export default SelectField; diff --git a/app/client/src/pages/Applications/index.tsx b/app/client/src/pages/Applications/index.tsx index ad36911bae..eb655c34a4 100644 --- a/app/client/src/pages/Applications/index.tsx +++ b/app/client/src/pages/Applications/index.tsx @@ -624,7 +624,6 @@ function ApplicationsSection(props: any) { diff --git a/app/client/src/sagas/InitSagas.ts b/app/client/src/sagas/InitSagas.ts index bd8b028855..5316ba4a70 100644 --- a/app/client/src/sagas/InitSagas.ts +++ b/app/client/src/sagas/InitSagas.ts @@ -454,6 +454,32 @@ export function* initializeAppViewerSaga( //Delay page load actions till all actions are retrieved. yield put(fetchPublishedPageSuccess([executePageLoadActions()])); + if (toLoadPageId) { + yield put(fetchPublishedPage(toLoadPageId, true)); + + const resultOfFetchPage: { + success: boolean; + failure: boolean; + } = yield race({ + success: take(ReduxActionTypes.FETCH_PUBLISHED_PAGE_SUCCESS), + failure: take(ReduxActionErrorTypes.FETCH_PUBLISHED_PAGE_ERROR), + }); + + if (resultOfFetchPage.failure) { + yield put({ + type: ReduxActionTypes.SAFE_CRASH_APPSMITH_REQUEST, + payload: { + code: get( + resultOfFetchPage, + "failure.payload.error.code", + ERROR_CODES.SERVER_ERROR, + ), + }, + }); + return; + } + } + yield put(fetchCommentThreadsInit()); yield put({