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

Membership duration warning #1771

Conversation

pbanaszkiewicz
Copy link
Contributor

Improve agreement start/end date handling and UX.

  1. There's no more default value of "today" for both fields
  2. "End" field gets updated to +1yr when selecting start date
  3. Warning on the form shows and hides when the duration is not 1 year long.
  4. Warning shows on membership detail page after adding a new membership with invalid agreement duration
  5. "End" will not accept dates in past.

TODO: I asked a question about membership agreement start/end values being empty. I think we shouldn't allow for them being empty, but I want to receive confirmation from @maneesha.

Show membership duration warning if the membership was created with
invalid duration (ie. != full year).

The year calculation is based on replacing year with start_year+1 and
comparing to selected end date.

The warning will only show up after creating the membership, not on
every request to the membership details page.
1. Add JavaScript logic to set a new agreement end date when user
enters start date. The new end date will be start date with year
incremented by 1.
2. Remove default value out of Membership model. It was causing the
prepopulation in the first place.
3. The change in default value results in migration.
Ensure the agreement start is sooner than the agreement end date.
@maneesha
Copy link
Contributor

Correct - start and end date should always be required.

@pbanaszkiewicz pbanaszkiewicz merged commit 72f3478 into carpentries:develop Jan 28, 2021
@pbanaszkiewicz pbanaszkiewicz linked an issue Jan 28, 2021 that may be closed by this pull request
@pbanaszkiewicz pbanaszkiewicz deleted the feature/1754-membership-duration-warning branch July 24, 2021 08:40
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.

Introduce warning if membership term is not one year
2 participants