Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: select widget lazy loading #38867

Merged
merged 61 commits into from
Feb 13, 2025
Merged
Changes from 1 commit
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
3709714
update: add types for option groups
ayushpahwa Jan 15, 2025
4d985e5
update: added control type for grouped options
ayushpahwa Jan 15, 2025
32bebe1
update: fix option render
ayushpahwa Jan 15, 2025
15e771f
Merge branch 'release' into feat/multi-select-widget-pagination
ayushpahwa Jan 15, 2025
3111c37
refactor: destructured imp fields
ayushpahwa Jan 15, 2025
e3a2d8f
update: fix css styles for option groups
ayushpahwa Jan 15, 2025
6e0aa8c
update: test code to check grouped select items
ayushpahwa Jan 15, 2025
fc7b16a
Merge branch 'release' into feat/multi-select-widget-pagination
ayushpahwa Jan 15, 2025
59df9ea
Merge branch 'release' into feat/multi-select-widget-pagination
ayushpahwa Jan 16, 2025
7130066
Merge branch 'release' into feat/multi-select-widget-grouping
ayushpahwa Jan 27, 2025
2fffb55
Merge branch 'release' into feat/multi-select-widget-grouping
ayushpahwa Jan 28, 2025
b074254
update: add optional type for grouping in options
ayushpahwa Jan 28, 2025
0d09225
udpate: use flat config for options rather than nested
ayushpahwa Jan 28, 2025
ec68831
update: test form config json
ayushpahwa Jan 28, 2025
76939f0
update: show groups with children present
ayushpahwa Jan 28, 2025
40c42fb
update: show ungrouped options under others category
ayushpahwa Jan 28, 2025
31e0cfd
Merge branch 'release' into feat/multi-select-widget-grouping
ayushpahwa Jan 28, 2025
8547874
Merge branch 'release' into feat/multi-select-widget-grouping
ayushpahwa Jan 28, 2025
3f605f1
update: add lazy load trigger on scroll
ayushpahwa Jan 28, 2025
00dbf20
update: create redux action to fetch next page
ayushpahwa Jan 28, 2025
a031c16
update: create action to interface with component
ayushpahwa Jan 28, 2025
0671a77
create: saga to handle next page fetch
ayushpahwa Jan 28, 2025
dbb957e
update: create selector to fetch conditional output
ayushpahwa Jan 28, 2025
bdee2d5
update: handle call to fetch paginated data
ayushpahwa Jan 28, 2025
9b6bdf2
update: add args with payload for action call
ayushpahwa Jan 28, 2025
3eb5b1a
update: send prepared payload for next page fetch
ayushpahwa Jan 28, 2025
306188b
Merge branch 'release' into feat/multi-select-widget-lazy-load
ayushpahwa Jan 28, 2025
0c3d7f7
Merge branch 'release' into feat/multi-select-widget-lazy-load
ayushpahwa Jan 29, 2025
5cd044a
refactor: rename optional param to be more verbose
ayushpahwa Jan 29, 2025
9d585a7
update: sample js object for grouping feature
ayushpahwa Jan 29, 2025
c29153c
update: remove sample scaffolding
ayushpahwa Jan 29, 2025
d51fcab
refactor: add comments for clarity
ayushpahwa Jan 29, 2025
5fad93b
refactor: fix typo
ayushpahwa Jan 29, 2025
b8afa36
Merge branch 'release' into feat/multi-select-widget-grouping
ayushpahwa Jan 29, 2025
a48e457
Merge branch 'feat/multi-select-widget-grouping' into feat/multi-sele…
ayushpahwa Jan 29, 2025
e67dd08
udpate: keep sample scaffolding till pr is ready
ayushpahwa Jan 29, 2025
d901d92
test: add coverage for grouped options
ayushpahwa Jan 29, 2025
3e60fc5
Merge branch 'release' into feat/multi-select-widget-grouping
ayushpahwa Jan 29, 2025
0170666
Merge branch 'feat/multi-select-widget-grouping' into feat/multi-sele…
ayushpahwa Jan 29, 2025
bcecbe4
udpate: use hasown instead of hasownproperty
ayushpahwa Jan 29, 2025
e6afd0c
Merge branch 'release' into feat/multi-select-widget-grouping
ayushpahwa Jan 30, 2025
9d15249
update: fix next page calculation
ayushpahwa Jan 30, 2025
e3439ed
update: handle non dynamic params
ayushpahwa Jan 30, 2025
837352e
update: remove scaffolding for form config
ayushpahwa Jan 30, 2025
975cbf1
update: send identifier to pagination call
ayushpahwa Jan 30, 2025
ba5e587
update: send fetched data to reducer
ayushpahwa Jan 30, 2025
b67f23b
update: append fetched data to current data
ayushpahwa Jan 30, 2025
f08c31b
Merge branch 'release' into feat/multi-select-widget-grouping
ayushpahwa Jan 30, 2025
f874f8c
Merge branch 'feat/multi-select-widget-grouping' into feat/multi-sele…
ayushpahwa Jan 30, 2025
5c808c5
Merge branch 'release' into feat/multi-select-widget-lazy-load
ayushpahwa Jan 31, 2025
cbd9b94
Merge branch 'release' into feat/multi-select-widget-lazy-load
ayushpahwa Jan 31, 2025
e2a8ff4
update: remove init reducer settings
ayushpahwa Jan 31, 2025
3216e9a
update: improve perf of select control functionalities
ayushpahwa Jan 31, 2025
2646e9f
Merge branch 'release' into feat/multi-select-widget-lazy-load
ayushpahwa Feb 11, 2025
7cfcc98
chore: sync with latest release
ayushpahwa Feb 11, 2025
6eb44e7
delete: test file
ayushpahwa Feb 11, 2025
b6717cc
Merge branch 'release' into feat/multi-select-widget-lazy-load
ayushpahwa Feb 12, 2025
9c4297a
test: improved tests to handle perf issues
ayushpahwa Feb 12, 2025
78339e9
refactor: remove redundant log
ayushpahwa Feb 12, 2025
5b2aeb2
refactor: remove redundant comments
ayushpahwa Feb 13, 2025
01f4649
Merge branch 'release' into feat/multi-select-widget-lazy-load
ayushpahwa Feb 13, 2025
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
Prev Previous commit
Next Next commit
update: remove init reducer settings
ayushpahwa committed Jan 31, 2025
commit e2a8ff4ab05319479163f38c0dec23c8badbadc7
30 changes: 11 additions & 19 deletions app/client/src/reducers/evaluationReducers/triggerReducer.ts
Original file line number Diff line number Diff line change
@@ -62,19 +62,6 @@ const triggers = createReducer(initialState, {
},
};
},
[ReduxActionTypes.FETCH_FORM_DYNAMIC_VAL_NEXT_PAGE_INIT]: (
state: FormEvaluationState,
action: ReduxAction<{ identifier: string; actionId: string }>,
) =>
produce(state, (draftState) => {
const { actionId, identifier } = action.payload;

if (!draftState[actionId][identifier].fetchDynamicValues) {
return draftState;
}

draftState[actionId][identifier].fetchDynamicValues.isLoading = true;
}),
[ReduxActionTypes.FETCH_FORM_DYNAMIC_VAL_NEXT_PAGE_SUCCESS]: (
state: FormEvaluationState,
action: ReduxAction<TriggerActionNextPagePayload>,
@@ -89,15 +76,20 @@ const triggers = createReducer(initialState, {
const triggers = state[actionId];
const storedConditionalOutput = triggers[identifier];

let content: Array<unknown> = [];
let content: Array<unknown> =
storedConditionalOutput.fetchDynamicValues?.data.content;

if (storedConditionalOutput.fetchDynamicValues?.data.content) {
content = [
...storedConditionalOutput.fetchDynamicValues?.data.content,
...newValue.data.content,
];
// if stored data is already of the same length or more than the incoming data
// then this might be a duplicate call and needs to be skipped.
if (newValue.data.count + newValue.data.startIndex <= content.length) {
return draftState;
}

content = [
...storedConditionalOutput.fetchDynamicValues?.data.content,
...newValue.data.content,
];

const updatedData = {
content,
startIndex: newValue.data.startIndex || 0,