-
Notifications
You must be signed in to change notification settings - Fork 0
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
Feature/save agent form #119
Conversation
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.
Works very well! I'll be sure to implement this in my other PRs as well.
I have a few suggestions that are mostly based on personal preferences, so have a look whether you want to implement any. The only change I'd really like you to consider is the outfactoring of Gender
and SourceMention
into two enums that are reused across ObjectTypes and InputTypes, if you haven't done so in another PR yet.
...end/src/app/data-entry/agent-form/agent-description-form/agent-description-form.component.ts
Outdated
Show resolved
Hide resolved
...end/src/app/data-entry/agent-form/agent-description-form/agent-description-form.component.ts
Show resolved
Hide resolved
...c/app/data-entry/agent-form/agent-identification-form/agent-identification-form.component.ts
Outdated
Show resolved
Hide resolved
return this.form.valid; | ||
} | ||
|
||
private toMutationInput([data, id]: [Partial<FormData>, string]): UpdateAgentInput { |
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.
If you want to get rid of the Partial
(since you are not disabling controls anyway, so all should always be present), you could add form.getRawValue()
to the pipe of changes$
. Not required/necessary by any means.
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.
It's a non-issue here because there are not disabled controls, but in general, if you did disable controls, I would expect that those values are not specified in the update request.
Syncs changes in the agent form with the backend.
This also includes a
FormService
andFormStatusComponent
to show the user whether changes are saved - those can be reused in other forms.Part of #78