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

Feature/3887 maned ed required for new group #2386

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from

Conversation

amdomanska
Copy link
Contributor

@amdomanska amdomanska commented May 22, 2024

Make Editor and Managing Editor fields requiren in a New Editor Group Form

Please don't delete any sections when completing this PR template; instead enter N/A for checkboxes or sections which are not applicable, unless otherwise stated below
See #3887

Describe the scope/purpose of the PR here in as much detail as you like

Categorisation

This PR...

  • has scripts to run
  • has migrations to run
  • adds new infrastructure
  • changes the CI pipeline
  • affects the public site
  • affects the editorial area
  • affects the publisher area
  • affects the monitoring

Basic PR Checklist

Instructions for developers:

  • For each checklist item, if it is N/A to your PR check the N/A box
  • For each item that you have done and confirmed for yourself, check Developer box (including if you have checked the N/A box)

Instructions for reviewers:

  • For each checklist item that has been confirmed by the Developer, check the Reviewer box if you agree
  • For multiple reviewers, feel free to add your own checkbox with your github username next to it if that helps with review tracking

Code Style

  • No deprecated methods are used

    • N/A
    • Developer
    • Reviewer
  • No magic strings/numbers - all strings are in constants or messages files

    • N/A
    • Developer
    • Reviewer
  • ES queries are wrapped in a Query object rather than inlined in the code

    • N/A
    • Developer
    • Reviewer
  • Where possible our common library functions have been used (e.g. dates manipulated via dates)

    • N/A
    • Developer
    • Reviewer
  • Cleaned up commented out code, etc

    • N/A
    • Developer
    • Reviewer
  • Urls are constructed with url_for not hard-coded

    • N/A
    • Developer
    • Reviewer

Testing

  • Unit tests have been added/modified

    • N/A
    • Developer
    • Reviewer
  • Functional tests have been added/modified

    • N/A
    • Developer
    • Reviewer
  • Code has been run manually in development, and functional tests followed locally

    • N/A
    • Developer
    • Reviewer
  • Have CSS/style changes been implemented? If they are of a global scope (e.g. on base HTML elements) have the downstream impacts of the change in other areas of the system been considered?

    • N/A
    • Developer
    • Reviewer

Documentation

Release Readiness

Testing

List the Functional Tests that must be run to confirm this feature

  1. https://doaj.github.io/doaj-docs/feature/3887_maned_ed_required_for_new_group/testbook/index.html#administrative_search/editor_groups/test_new_editor_group_form

Deployment

What deployment considerations are there? (delete any sections you don't need)

Configuration changes

What configuration changes are included in this PR, and do we need to set specific values for production

Scripts

What scripts need to be run from the PR (e.g. if this is a report generating feature), and when (once, regularly, etc).

Migrations

What migrations need to be run to deploy this

Monitoring

What additional monitoring is required of the application as a result of this feature

New Infrastructure

What new infrastructure does this PR require (e.g. new services that need to run on the back-end).

Continuous Integration

What CI changes are required for this

@RK206
Copy link
Contributor

RK206 commented Jun 6, 2024

All good as per the issue. Its working as per the requirement.
I see the clear button (X) is missing in the Editor combo box. Can you please add the button so that it will be consistent with other fields?

Screenshot 2024-06-05 at 9 26 03 PM

Copy link
Contributor

@RK206 RK206 left a comment

Choose a reason for hiding this comment

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

Can you please add the clear button for Editor?

@amdomanska
Copy link
Contributor Author

Fixed

image

@amdomanska amdomanska requested a review from RK206 June 12, 2024 09:16
Copy link
Contributor

@RK206 RK206 left a comment

Choose a reason for hiding this comment

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

Looks good

@philipkcl philipkcl removed their request for review July 31, 2024 12:00
Copy link
Contributor

@richard-jones richard-jones left a comment

Choose a reason for hiding this comment

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

Some odd implementation choices, see comments


def validate(self, extra_validators = None):
return self._validate_editors() and super(EditorGroupForm, self).validate();

Copy link
Contributor

Choose a reason for hiding this comment

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

There's a few oddities here.

There are a bunch of semi-colons on the new code, which aren't necessary, looks like you were in javascript mode when you wrote this :)

Also, overriding the main validate function isn't something I've seen done before. The validation effect we want to achieve is for both managing editor and editor to be required fields, so we just need to remove the Optional validator from both of those, surely?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're absolutely right—there's definitely something strange going on here! I must have had one foot in JavaScript and the other in... well, somewhere else entirely. 😅 Thanks for catching those rogue semi-colons.

As for the validation function override, I honestly have no idea what I was thinking there. I'll get that sorted out right away and remove the unnecessary override. Thanks for the sharp eye, and sorry for the code 💩 !

Remove unnecessary validation override
Add novalidate to form to prevent browser validation - it tried to set focus on a field hidden by select2
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.

3 participants