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

Validate project before allowing beta submission #3525

Merged
merged 3 commits into from
Mar 8, 2017

Conversation

rogerhutchings
Copy link
Contributor

@rogerhutchings rogerhutchings commented Feb 27, 2017

Following on from a first crack at this in #3523, this adds validation before allowing a beta review submission. It uses set_member_subjects_count which is known to be wrong for some projects (zooniverse/panoptes#2155), so this PR is blocked until that bug is fixed but we're ignoring it for now.

Adds the babel-rewire plugin to allow mocking the apiClient, so will need an npm install before testing locally.

Review Checklist

Optional

  • If it's a new component, is it in ES6? Is it clear of warnings from ESLint?
  • Have you replaced any ChangeListener or PromiseRenderer components with code that updates component state?
  • If changes are made to the classifier, does the dev classifier still work?
  • Have you added in flow type annotations?

@mention-bot
Copy link

@rogerhutchings, thanks for your PR! By analyzing the history of the files in this pull request, we identified @srallen and @saschaishikawa to be potential reviewers.

@rogerhutchings rogerhutchings changed the title Validate project subjects - blocked by zooniverse/Panoptes#2155 Validate project subjects - blocked Feb 27, 2017
@camallen
Copy link
Contributor

camallen commented Feb 28, 2017

@rogerhutchings don't wait on the panoptes issue to get sorted.

@rogerhutchings
Copy link
Contributor Author

Cool. I'm going to rewrite this in ES6 with tests in any case, so I'll request a review when it's done.

@rogerhutchings rogerhutchings force-pushed the validate-project-subjects branch 2 times, most recently from c8fbdcb to 7190245 Compare March 7, 2017 00:52
@rogerhutchings rogerhutchings force-pushed the validate-project-subjects branch from 7190245 to 888b7b4 Compare March 7, 2017 01:00
@rogerhutchings
Copy link
Contributor Author

Okay, this is complete. I've also managed to mock the apiClient, which may be of interest with other tests.

@rogerhutchings rogerhutchings changed the title Validate project subjects - blocked Validate project before allowing beta submission Mar 7, 2017
Copy link
Member

@shaunanoordin shaunanoordin left a comment

Choose a reason for hiding this comment

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

PR Review

  • As a Project Owner, when I go to Build a Project -> (Edit My Project) -> Visibility, under the Beta Status section, if I've ticked all the checkboxes, I can choose Apply for Review
  • If my Project does not meet the minimum requirements (>= 100 Subjects, have FAQ and Research pages), then my Beta application should be prevented.
  • If my Project does meet the minimum requirements, my Beta application should be submitted.

screen shot 2017-03-07 at 16 19 14
The Visibility page upon clicking 'Apply for Review' and being prevented from submitting

  • Tested on OSX+Chrome on localhost.
    • Note that, at the moment, I'm still reviewing the code & running further tests to confirm that the "Submit Beta Application" functionality works.

While I can confirm the functionality for the "Prevent Beta Application", I would like to raise a UI concern.

UI Issue: "Could not Apply for Beta" error message needs to be more obvious

Details:
The "The following errors need to be fixed..." message (see above image) appears immediately after the "Apply for Review" button is clicked and with little fanfare. I initially didn't realise my Application for Beta failed, and the only reason I noticed something was amiss was because - as a dev reviewing the feature - I was actively looking for the error message.

I would argue the UI matter is a non-blocking issue, but would like to have it flagged for future review at minimum.

@rogerhutchings
Copy link
Contributor Author

Errors now look like this:

screen shot 2017-03-08 at 13 35 58

Copy link
Member

@shaunanoordin shaunanoordin left a comment

Choose a reason for hiding this comment

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

PR Review (Update)

  • The new up UI changes make the errors much more explicit. (Visually, not language-wise. Although that would have been hilarious.)
  • Testing for "Prevent Beta application" works as before, but I could not fully test "Submit Beta application" due to an upload limit on my testing account. That said, code looks logical enough to me, so I have no strong concerns.
  • Tests OK on localhost for OSX+Chrome56/FF51, Win7+IE11

Status

LGTM, approval go!

@rogerhutchings rogerhutchings merged commit 95f749e into master Mar 8, 2017
@rogerhutchings rogerhutchings deleted the validate-project-subjects branch March 8, 2017 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants