feat/AB#80252_Allow-frontend-to-reload-when-admin-updates/create-a-form#2184
Conversation
| ); | ||
|
|
||
| this.onSubmit(); | ||
| window.location.reload(); |
There was a problem hiding this comment.
@GuilhermeGabriel
that won't work
you need to wait for the server to be ready again to do that
There was a problem hiding this comment.
Ok, I tried a new approach!
| `; | ||
|
|
||
| /** Graphql request for getting query types */ | ||
| export const GET_QUERY_TYPES = gql` |
There was a problem hiding this comment.
@GuilhermeGabriel
I don't like this approach
you're duplicating a query we already see in another service, for a call that will be done only once, so for me it doesn't make sense
you should prefer, for example, build a subject in the query-builder, and, when you detect a change in the subject, you refetch the data
so you can, in the form builder service, just emit an event to the query builder service
There was a problem hiding this comment.
@AntoineRelief do you think a websocket solution would be overkill?
Description
One issue we usually face while configuring forms/resources is that the system will stop working as expected after saving forms/resources. Indeed, the back-end needs to reload, and the front does not get the changes. We should, if possible, either reload the entire front, either reload the graphql.
Useful links
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Create a new form, add a field to it, and test if the field appears in the layout editor without reloading the page.
Screenshots
output.mp4
Checklist:
( * == Mandatory )
More explanation
https://www.loom.com/share/05a716d61b9744faaf51fb304c21d1e5?sid=f87cf896-582a-4f76-93ae-8ceed801b145