-
Notifications
You must be signed in to change notification settings - Fork 8
feat/AB#80252_Allow-frontend-to-reload-when-admin-updates/create-a-form #2184
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
base: beta
Are you sure you want to change the base?
feat/AB#80252_Allow-frontend-to-reload-when-admin-updates/create-a-form #2184
Conversation
@@ -202,6 +202,7 @@ export class AddPageComponent extends UnsubscribeComponent implements OnInit { | |||
); | |||
|
|||
this.onSubmit(); | |||
window.location.reload(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I tried a new approach!
@@ -38,3 +38,121 @@ export const GET_SHORT_FORM_BY_ID = gql` | |||
} | |||
} | |||
`; | |||
|
|||
/** Graphql request for getting query types */ | |||
export const GET_QUERY_TYPES = gql` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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