LP1879517: Surveys shouldn't end before they begin user/sandbergja/lp1879517_alternative_patch
authorJane Sandberg <js7389@princeton.edu>
Thu, 21 Jul 2022 00:00:24 +0000 (20:00 -0400)
committerJane Sandberg <js7389@princeton.edu>
Wed, 1 Mar 2023 18:03:08 +0000 (10:03 -0800)
commit68cee1cfb009913adacd097f915f157eebcda777
treef7d1847344f75e6fbcbba48a55215245e5e55a59
parent8c9dc8e04ed9933509ccff68412f3220f9adf8ab
LP1879517: Surveys shouldn't end before they begin

To test:
1. Go to Admin > Local > Surveys.
2. Create a new survey.
3. Attempt to create a survey where the end date
comes before the start date.  Without this patch, you will get
no notice that this is invalid, and you can save the invalid
record.
4. Edit an existing survey.
5. Repeat step 3 while editing the existing survey.
6. Apply the patch.
7. Repeat steps 1-5.  Note that you now get a notice and
cannot save if the end date is before the start date.

This commit generalizes a validator already present in the booking
module, and corrects several small bugs related to the datetime-select
component.

Signed-off-by: Jane Sandberg <sandbergja@gmail.com>
14 files changed:
Open-ILS/src/eg2/src/app/core/format.service.ts
Open-ILS/src/eg2/src/app/core/format.spec.ts
Open-ILS/src/eg2/src/app/share/datetime-select/datetime-select.component.spec.ts [new file with mode: 0644]
Open-ILS/src/eg2/src/app/share/datetime-select/datetime-select.component.ts
Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.html
Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.ts
Open-ILS/src/eg2/src/app/share/validators/dates_in_order_validator.directive.ts [new file with mode: 0644]
Open-ILS/src/eg2/src/app/share/validators/dates_in_order_validator.spec.ts [new file with mode: 0644]
Open-ILS/src/eg2/src/app/staff/admin/local/survey/survey-edit.component.html
Open-ILS/src/eg2/src/app/staff/admin/local/survey/survey.component.html
Open-ILS/src/eg2/src/app/staff/admin/local/survey/survey.component.ts
Open-ILS/src/eg2/src/app/staff/booking/create-reservation-dialog.component.html
Open-ILS/src/eg2/src/app/staff/booking/create-reservation-dialog.component.ts
Open-ILS/src/eg2/src/app/staff/common.module.ts