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

Publisher field and society field cannot have the same answer #2281

Closed

Conversation

amdomanska
Copy link
Contributor

@amdomanska amdomanska commented Aug 4, 2023

Publisher field and society field cannot have the same answer

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 #3136

  1. DifferentTo custom parsley validator should be case insensitive (eg. "CottageLabs Publishing" is the same as "cottagelabs publishing" - fixed
  2. Messages from different_to validator in application_forms.py were not passed to the parsley validator - fixed
  3. different_to validator added to Publisher's name and Institution name fields as required

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

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

Documentation

Release Readiness

Testing

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

  1. New Application Form/Publisher's Form

Deployment

N/A

Configuration changes

N/A

Scripts

N/A

Migrations

N/A

Monitoring

N/A

New Infrastructure

N/A

Continuous Integration

N/A

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

Copy link
Contributor

@Steven-Eardley Steven-Eardley left a comment

Choose a reason for hiding this comment

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

Brilliant

validateString : function(value, requirement) {
return (!value || ($("[name = " + requirement + "]")).val() !== value);
validateString : function(value, requirement, message) {
return (!value || ($("[name = " + requirement + "]")).val().toLowerCase() !== value.toLowerCase());
Copy link
Contributor

Choose a reason for hiding this comment

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

This function takes the argument message but doesn't use it, is that required by the Parsley interface or something?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, that's overlook. Sorry!

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.

Ensure context specific widget config doesn't overwrite widgets from the base field behaviour

"click_to_copy", # ~~^-> ClickToCopy:FormWidget~~
]
}
},
Copy link
Contributor

Choose a reason for hiding this comment

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

THis overwrites the widgets on the base field, so it needs to include the autocomplete and any other widgets that you also want active on the admin form.

Change error text in Institution and Society fields in application form
@Steven-Eardley Steven-Eardley deleted the feature/3136_different_publisher_and_society branch November 21, 2023 19:55
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.

5 participants