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

refactor(submissions.client.factory): extract admin form features #1983

Merged
merged 18 commits into from
Jun 7, 2021

Conversation

seaerchin
Copy link
Contributor

@seaerchin seaerchin commented May 27, 2021

Problem

submissions.client.factory client-side service that determines the performance and safety of many key features, but has two separate areas of concern - the public form facing submissions and the admin form retrieval of submissions.

Part 1 of #1874

Solution

This extracts out all the straight forward client submission methods to AdminFormService, and replaces old method calls with the new one.

The download related methods will be in a separate PR for closer scrutiny!

Breaking Changes

  • Yes - this PR contains breaking changes
    • Details ...
  • No - this PR is backwards compatible

Tests

This adds unit tests for all new methods added.

Manual Tests

This has been already tested on staging
Create a storage mode form with any field and activate it. Submit the form >= 11 times. Go to the data section and unlock responses.

  • There should be the correct number of responses displayed
  • Click on any page that is not 1. The relevant responses should be displayed
  • Select a time period without responses and attempt to download (both options). This should not work
  • Select a time period with responses and attempt to download (both options). This should work
  • Search for a response using a valid referenceId. this should work and clicking into the response should display all related data.
  • Search for a response using an invalid/partial referenceId. There should be no responses displayed.
  • Clicking into a single response should work and display all data correctly.

@seaerchin seaerchin force-pushed the refactor/extract-admin-submissions branch from 6f2da95 to 2089db1 Compare May 27, 2021 09:30
seaerchin added 3 commits June 3, 2021 12:28
….mock with mocked

using mockAxios impacted readability and understanding so it was changed to use jest.mock (which
mocks the whole module) together with mocked from ts-jest to mock return values
Copy link
Contributor

@karrui karrui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, only with last few changes

src/public/services/AdminSubmissionsService.ts Outdated Show resolved Hide resolved
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.

4 participants