Skip to content

Commit 5ee2044

Browse files
authored
Merge pull request #40885 from appsmithorg/release
06/06 Daily Promotion
2 parents 996ad8c + fde8d01 commit 5ee2044

File tree

21 files changed

+394
-105
lines changed

21 files changed

+394
-105
lines changed

app/client/cypress/e2e/Regression/ClientSide/Widgets/Input/Inputv2_spec.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { DEBOUNCE_WAIT_TIME_ON_INPUT_CHANGE } from "../../../../../../src/constants/WidgetConstants";
12
import { agHelper } from "../../../../../support/Objects/ObjectsCore";
23

34
const widgetName = "inputwidgetv2";
@@ -385,7 +386,9 @@ describe(
385386
cy.get(widgetInput).clear();
386387
cy.wait(300);
387388
// Input text and hit enter key
388-
cy.get(widgetInput).type("test{enter}");
389+
cy.get(widgetInput).type("test{enter}", {
390+
delay: DEBOUNCE_WAIT_TIME_ON_INPUT_CHANGE,
391+
});
389392
// Assert if the Text widget contains the whole value, test
390393
cy.get(".t--widget-textwidget").should("have.text", "test");
391394
});

app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_BasicClientSideData_spec.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
const publishLocators = require("../../../../../locators/publishWidgetspage.json");
22
const commonlocators = require("../../../../../locators/commonlocators.json");
33

4+
import { DEBOUNCE_WAIT_TIME_ON_INPUT_CHANGE } from "../../../../../../src/constants/WidgetConstants";
45
import * as _ from "../../../../../support/Objects/ObjectsCore";
56

67
const widgetSelector = (name) => `[data-widgetname-cy="${name}"]`;
@@ -76,7 +77,7 @@ describe(
7677
cy.get(".t--draggable-inputwidgetv2").each(($inputWidget, index) => {
7778
cy.wrap($inputWidget)
7879
.find("input")
79-
.type(index + 1);
80+
.type(index + 1, { delay: DEBOUNCE_WAIT_TIME_ON_INPUT_CHANGE });
8081
});
8182

8283
// Verify the typed value
@@ -101,7 +102,7 @@ describe(
101102
cy.get(".t--draggable-inputwidgetv2").each(($inputWidget, index) => {
102103
cy.wrap($inputWidget)
103104
.find("input")
104-
.type(index + 4);
105+
.type(index + 4, { delay: DEBOUNCE_WAIT_TIME_ON_INPUT_CHANGE });
105106
});
106107

107108
// Verify the typed value

app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_Nested_EventBindings_spec.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { DEBOUNCE_WAIT_TIME_ON_INPUT_CHANGE } from "../../../../../../src/constants/WidgetConstants";
12
const nestedListDSL = require("../../../../../fixtures/Listv2/nestedList.json");
23
const commonlocators = require("../../../../../locators/commonlocators.json");
34

@@ -22,10 +23,14 @@ describe(
2223
"{{showAlert(`${level_1.currentView.Text1.text} _ ${level_1.currentItem.id} _ ${level_1.currentIndex} _ ${level_1.currentView.Input1.text} _ ${currentView.Input2.text}`)}}",
2324
);
2425
// Enter text in the parent list widget's text input
25-
cy.get(widgetSelector("Input1")).find("input").type("outer input");
26+
cy.get(widgetSelector("Input1"))
27+
.find("input")
28+
.type("outer input", { delay: DEBOUNCE_WAIT_TIME_ON_INPUT_CHANGE });
2629

2730
// Enter text in the child list widget's text input in first row
28-
cy.get(widgetSelector("Input2")).find("input").type("inner input");
31+
cy.get(widgetSelector("Input2"))
32+
.find("input")
33+
.type("inner input", { delay: DEBOUNCE_WAIT_TIME_ON_INPUT_CHANGE });
2934

3035
// click the button on inner list 1st row.
3136
cy.get(widgetSelector("Button3")).find("button").click({ force: true });
@@ -40,13 +45,17 @@ describe(
4045
cy.get(widgetSelector("Input1"))
4146
.find("input")
4247
.clear()
43-
.type("outer input updated");
48+
.type("outer input updated", {
49+
delay: DEBOUNCE_WAIT_TIME_ON_INPUT_CHANGE,
50+
});
4451

4552
// Enter text in the child list widget's text input in first row
4653
cy.get(widgetSelector("Input2"))
4754
.find("input")
4855
.clear()
49-
.type("inner input updated");
56+
.type("inner input updated", {
57+
delay: DEBOUNCE_WAIT_TIME_ON_INPUT_CHANGE,
58+
});
5059

5160
// click the button on inner list 1st row.
5261
cy.get(widgetSelector("Button3")).find("button").click({ force: true });

app/client/cypress/support/Pages/AggregateHelper.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { EntityItems } from "./AssertHelper";
77
import EditorNavigator from "./EditorNavigation";
88
import { EntityType } from "./EditorNavigation";
99
import ClickOptions = Cypress.ClickOptions;
10+
import { DEBOUNCE_WAIT_TIME_ON_INPUT_CHANGE } from "../../../src/constants/WidgetConstants";
1011

1112
type ElementType = string | JQuery<HTMLElement>;
1213

@@ -945,10 +946,13 @@ export class AggregateHelper {
945946
.focus()
946947
.type("{backspace}".repeat(charCount), { timeout: 2, force: true })
947948
.wait(50)
948-
.type(totype);
949+
.type(totype, { delay: DEBOUNCE_WAIT_TIME_ON_INPUT_CHANGE });
949950
else {
950951
if (charCount == -1) this.GetElement(selector).eq(index).clear();
951-
this.TypeText(selector, totype, index);
952+
this.TypeText(selector, totype, {
953+
index,
954+
delay: DEBOUNCE_WAIT_TIME_ON_INPUT_CHANGE,
955+
});
952956
}
953957
}
954958

@@ -973,7 +977,10 @@ export class AggregateHelper {
973977
force = false,
974978
) {
975979
this.ClearTextField(selector, force, index);
976-
return this.TypeText(selector, totype, index);
980+
return this.TypeText(selector, totype, {
981+
index,
982+
delay: DEBOUNCE_WAIT_TIME_ON_INPUT_CHANGE,
983+
});
977984
}
978985

979986
public TypeText(
@@ -1323,7 +1330,10 @@ export class AggregateHelper {
13231330
toClear && this.ClearInputText(name);
13241331
cy.xpath(this.locator._inputWidgetValueField(name, isInput))
13251332
.trigger("click")
1326-
.type(input, { parseSpecialCharSequences: false });
1333+
.type(input, {
1334+
parseSpecialCharSequences: false,
1335+
delay: DEBOUNCE_WAIT_TIME_ON_INPUT_CHANGE,
1336+
});
13271337
}
13281338

13291339
public ClearInputText(name: string, isInput = true) {

app/client/src/constants/WidgetConstants.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,3 +279,6 @@ export type PasteWidgetReduxAction = {
279279
groupWidgets: boolean;
280280
existingWidgets?: unknown;
281281
} & EitherMouseLocationORGridPosition;
282+
283+
// Constant for debouncing the input change to avoid multiple Execute calls in reactive flow
284+
export const DEBOUNCE_WAIT_TIME_ON_INPUT_CHANGE = 300;

app/client/src/git/sagas/initGitSaga.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,24 @@ export default function* initGitForEditorSaga(
3636
yield put(gitArtifactActions.fetchMetadataInit({ artifactDef }));
3737
yield take(gitArtifactActions.fetchMetadataSuccess.type);
3838

39-
if (isAutocommitEnabled(artifactDef)) {
40-
yield put(
41-
gitArtifactActions.triggerAutocommitInit({ artifactDef, artifactId }),
42-
);
43-
}
44-
4539
yield put(
4640
gitArtifactActions.fetchBranchesInit({ artifactDef, artifactId }),
4741
);
4842

43+
// We skip the auto-commit and status check for protected branches
44+
// Hence we need to check if the current branch is protected before triggering auto-commit and status check
4945
if (isProtectedBranchesEnabled(artifactDef)) {
5046
yield put(
5147
gitArtifactActions.fetchProtectedBranchesInit({ artifactDef }),
5248
);
5349
}
5450

51+
if (isAutocommitEnabled(artifactDef)) {
52+
yield put(
53+
gitArtifactActions.triggerAutocommitInit({ artifactDef, artifactId }),
54+
);
55+
}
56+
5557
yield put(
5658
gitArtifactActions.fetchStatusInit({ artifactDef, artifactId }),
5759
);

app/client/src/git/sagas/triggerAutocommitSaga.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ import type {
1111
} from "git/requests/triggerAutocommitRequest.types";
1212
import type { TriggerAutocommitInitPayload } from "git/store/actions/triggerAutocommitActions";
1313
import { gitArtifactActions } from "git/store/gitArtifactSlice";
14-
import { selectAutocommitEnabled } from "git/store/selectors/gitArtifactSelectors";
14+
import {
15+
selectAutocommitEnabled,
16+
selectProtectedMode,
17+
} from "git/store/selectors/gitArtifactSelectors";
1518
import type { GitArtifactPayloadAction } from "git/store/types";
1619
import {
1720
call,
@@ -142,8 +145,13 @@ export default function* triggerAutocommitSaga(
142145
selectAutocommitEnabled,
143146
artifactDef,
144147
);
148+
const isCurrentBranchProtected: boolean = yield select(
149+
selectProtectedMode,
150+
artifactDef,
151+
);
152+
const shouldAutocommit = isAutocommitEnabled && !isCurrentBranchProtected;
145153

146-
if (isAutocommitEnabled) {
154+
if (shouldAutocommit) {
147155
const params = { artifactDef, artifactId };
148156
const pollTask: Task = yield fork(pollAutocommitProgressSaga, params);
149157

app/client/src/git/store/actions/fetchStatusActions.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export const fetchStatusInitAction =
1313
createArtifactAction<FetchStatusInitPayload>((state) => {
1414
state.apiResponses.status.loading = true;
1515
state.apiResponses.status.error = null;
16+
state.apiResponses.status.value = null;
1617

1718
return state;
1819
});
@@ -26,6 +27,15 @@ export const fetchStatusSuccessAction = createArtifactAction<
2627
return state;
2728
});
2829

30+
export const resetGitStatusAction =
31+
createArtifactAction<FetchStatusRequestParams>((state) => {
32+
state.apiResponses.status.loading = false;
33+
state.apiResponses.status.error = null;
34+
state.apiResponses.status.value = null;
35+
36+
return state;
37+
});
38+
2939
export const fetchStatusErrorAction =
3040
createArtifactAction<GitAsyncErrorPayload>((state, action) => {
3141
const { error } = action.payload;

app/client/src/git/store/gitArtifactSlice.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import {
2121
fetchStatusErrorAction,
2222
fetchStatusInitAction,
2323
fetchStatusSuccessAction,
24+
resetGitStatusAction,
2425
} from "./actions/fetchStatusActions";
2526
import {
2627
clearCommitErrorAction,
@@ -200,6 +201,7 @@ export const gitArtifactSlice = createSlice({
200201
clearDiscardError: clearDiscardErrorAction,
201202
fetchStatusInit: fetchStatusInitAction,
202203
fetchStatusSuccess: fetchStatusSuccessAction,
204+
resetGitStatus: resetGitStatusAction,
203205
fetchStatusError: fetchStatusErrorAction,
204206
fetchMergeStatusInit: fetchMergeStatusInitAction,
205207
fetchMergeStatusSuccess: fetchMergeStatusSuccessAction,

app/client/src/pages/Editor/PropertyPane/index.tsx

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
import React, { useRef } from "react";
1+
import React, { useRef, useEffect, useState } from "react";
22
import styled from "styled-components";
33
import { useSelector } from "react-redux";
44
import { PanelStack, Classes } from "@blueprintjs/core";
55

66
import { get } from "lodash";
77
import { getSelectedWidgets } from "selectors/ui";
88
import PropertyPaneView from "./PropertyPaneView";
9+
import { retryPromise } from "utils/AppsmithUtils";
910

1011
const StyledPanelStack = styled(PanelStack)`
1112
height: 100%;
@@ -28,8 +29,29 @@ function PropertyPane() {
2829
const selectedWidgets = useSelector(getSelectedWidgets);
2930
const panelWrapperRef = useRef<HTMLDivElement>(null);
3031

32+
// Track registration state
33+
const [controlsRegistered, setControlsRegistered] = useState(false);
34+
35+
useEffect(() => {
36+
const loadPropertyControlBuilders = async () => {
37+
const module = await retryPromise(
38+
async () =>
39+
import(
40+
/* webpackChunkName: "PropertyControlRegistry" */ "utils/PropertyControlRegistry"
41+
),
42+
);
43+
44+
module.default.registerPropertyControlBuilders();
45+
46+
setControlsRegistered(true);
47+
};
48+
49+
loadPropertyControlBuilders();
50+
}, []);
51+
3152
// TODO: add analytics code
3253
if (
54+
!controlsRegistered ||
3355
selectedWidgets.length === 0 ||
3456
get(selectedWidgets, "0.disablePropertyPane")
3557
) {

0 commit comments

Comments
 (0)