Skip to content
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

ref: migrate stream feedback flow to TypeScript #733

Merged
merged 12 commits into from
Nov 26, 2020
Merged

Conversation

karrui
Copy link
Contributor

@karrui karrui commented Nov 25, 2020

Problem

This PR migrates the god controller function for streamFeedback into the DDD architecture we all know and love.

In addition, also add AuthService#getFormAfterPermissionChecks helper function for the repetitive task steps of

  1. Retrieving form
  2. Checking form active state
  3. Checking form permissions

There is also a cherry picked commit 3860e34 from #729 that adds exhaustive switch case typeguard.

Solution

Features:

  • add AuthService#getFormAfterPermissionChecks helper function
  • to that end, add adminFormUtils#getAssertPermissionFn factory that returns the appropriate function.
  • add FeedbackSvc#getFormFeedbackStream fn
  • add AdminFormCtl#handleStreamFormFeedback handler fn

Tests

The usual. No success test case for the controller since I still cannot figure out how to handle stream tests, and Google is not helping.

No integration tests yet since router is not migrated yet.

@karrui karrui merged commit 5b8b382 into develop Nov 26, 2020
@karrui karrui deleted the ref/stream-feedback-ts branch November 26, 2020 11:38
@karrui karrui mentioned this pull request Dec 1, 2020
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.

2 participants