Skip to content

Comments

fix: Fix NGRX effect to reload fields after adding new field#243

Merged
fvanderflier merged 3 commits intomainfrom
copilot/fix-fields-reload-issue
Dec 29, 2025
Merged

fix: Fix NGRX effect to reload fields after adding new field#243
fvanderflier merged 3 commits intomainfrom
copilot/fix-fields-reload-issue

Conversation

Copy link
Contributor

Copilot AI commented Dec 29, 2025

When adding a field via the Builder component modal, the new field didn't appear in the table. The reloadCollectionTypesAfterField$ effect dispatched only collection type reloads, but the component subscribes to selectFields which reads from state.modelResponse?.Fields.

Changes

Modified reloadCollectionTypesAfterField$ effect to dispatch loadFields action after addFieldSuccess:

reloadCollectionTypesAfterField$ = createEffect(() =>
  this.actions$.pipe(
    ofType(CollectionActions.addFieldSuccess),
    withLatestFrom(this.store.pipe(select(selectSelectedType))),
    filter(([_, selectedType]) => !!selectedType),
    concatMap(([_, selectedType]) => [
      CollectionActions.loadPublishedCollectionTypes(),
      CollectionActions.loadDraftCollectionTypes(),
      CollectionActions.loadFields({ modelType: selectedType }),  // Added
    ])
  )
);

The effect now retrieves the current model type from the store and reloads its fields, ensuring the UI reflects the newly added field.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • fonts.googleapis.com
    • Triggering command: /usr/local/bin/node node /home/REDACTED/work/dappi/dappi/CCUI.DAPPI/node_modules/.bin/ng build (dns block)
  • www.google-analytics.com
    • Triggering command: /usr/local/bin/node node /home/REDACTED/work/dappi/dappi/CCUI.DAPPI/node_modules/.bin/ng build (dns block)
    • Triggering command: /usr/local/bin/node node /home/REDACTED/work/dappi/dappi/CCUI.DAPPI/node_modules/.bin/ng build --configuration development (dns block)
    • Triggering command: /usr/local/bin/node node /home/REDACTED/work/dappi/dappi/CCUI.DAPPI/node_modules/.bin/ng build --configuration development wroot/styles-I3WCRGFP.css (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Fields are not reloaded when a new field is added</issue_title>
<issue_description>Currently in the #Builder component when a field is added from the modal, the new field doesn't appear in the table. This seems to be an NGRX issue. The fields should be refreshed each time a field of any type is added to the collection.</issue_description>

<agent_instructions>Check the reducer files. Try to stick to the current conventions as closely as possible and try to create a simple fix.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@fvanderflier
Copy link
Collaborator

@copilot

Copilot AI and others added 2 commits December 29, 2025 14:15
Co-authored-by: fvanderflier <177029273+fvanderflier@users.noreply.github.com>
Co-authored-by: fvanderflier <177029273+fvanderflier@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix fields not reloading when a new field is added Fix NGRX effect to reload fields after adding new field Dec 29, 2025
Copilot AI requested a review from fvanderflier December 29, 2025 14:21
@fvanderflier fvanderflier changed the title Fix NGRX effect to reload fields after adding new field fix: Fix NGRX effect to reload fields after adding new field Dec 29, 2025
@fvanderflier fvanderflier marked this pull request as ready for review December 29, 2025 14:35
@fvanderflier fvanderflier merged commit 9faafe3 into main Dec 29, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fields are not reloaded when a new field is added

2 participants