-
Notifications
You must be signed in to change notification settings - Fork 87
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
refactor: migrate preview admin form endpoint to Typescript #864
Conversation
# Conflicts: # src/app/modules/form/admin-form/__tests__/admin-form.controller.spec.ts
Rerequesting review since the extraction of form instance method was slightly more complex than it seemed (and also upped the robustness of the public form view; now it ensures the form is populated before returning the public view) |
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.
lgtm other than yr's comments!
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.
Some comments for your consideration, please.
…View step" This reverts commit 872e3ca.
No need anymore, use model function directly
Ready for rereview |
Closing this PR for the time being until @karrui 's involvement on other project is reduced. |
# Conflicts: # src/app/modules/form/__tests__/form.utils.spec.ts # src/app/modules/form/form.utils.ts # src/app/modules/submission/email-submission/email-submission.service.ts
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.
lgtm
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.
I notice the consistent use of getPublicView()
which is great, so let's create a new interface in order to embed that consistency:
interface PublicView<T> {
getPublicView(): T
}
interface IAgencySchema extends IAgency, Document, PublicView<PublicAgency> {...}
Problem
Migrates
:formId/adminform/preview
endpoint to Typescript.The choice of public fields to display is now in each database model's domain; see:
UserModel.getPublicView
AgencyModel.getPublicView
FormModel.getPublicView
Solution
Features:
Tests
Controller tests have been added.
add tests for FormModel#getPublicView instance method
add tests for FormSvc#getFormPublicView