Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

Fix validation to fire for user input #34

Merged
merged 3 commits into from
Apr 25, 2019
Merged

Conversation

Blackbaud-SteveBrush
Copy link
Member

Validation works fine when the initial value is set in the FormControl, or if the value is written programmatically to the formControlName after the fact, but validation doesn't work when manually selecting dates from the date pickers. This PR addresses that problem.

To test, serve the master branch and select "Specific range" and then deliberately choose an end date that comes before a start date to NOT see the expected error.

Copy link
Member

@Blackbaud-TrevorBurch Blackbaud-TrevorBurch left a comment

Choose a reason for hiding this comment

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

LGTM

@codecov
Copy link

codecov bot commented Apr 24, 2019

Codecov Report

Merging #34 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #34   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          25     25           
  Lines        1294   1291    -3     
  Branches      194    194           
=====================================
- Hits         1294   1291    -3
Impacted Files Coverage Δ
...ate-range-picker/types/date-range-calculator-id.ts 100% <100%> (ø) ⬆️
...e-range-picker/types/date-range-calculator-type.ts 100% <100%> (ø) ⬆️
...s/date-range-picker/date-range-picker.component.ts 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2c0126c...69cd479. Read the comment docs.

@Blackbaud-AlexKingman
Copy link
Contributor

When changing from an invalid state to a valid state, the red border does not go away. See screenshot:
Screen Shot 2019-04-24 at 10 33 50 AM

@Blackbaud-SteveBrush
Copy link
Member Author

@Blackbaud-AlexKingman Ready for another look.

@@ -1,4 +1,4 @@
export const enum SkyDateRangeCalculatorType {
export enum SkyDateRangeCalculatorType {
Copy link
Member Author

@Blackbaud-SteveBrush Blackbaud-SteveBrush Apr 24, 2019

Choose a reason for hiding this comment

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

Adding const was causing this enum to return an empty value. I'm guessing it has something to do with our version of TypeScript. At any rate, removing the const fixes the problem.

Copy link
Contributor

@Blackbaud-AlexKingman Blackbaud-AlexKingman left a comment

Choose a reason for hiding this comment

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

Works great now. Thanks!

@Blackbaud-SteveBrush Blackbaud-SteveBrush merged commit 52b0a29 into master Apr 25, 2019
@Blackbaud-SteveBrush Blackbaud-SteveBrush deleted the fix-validation branch April 25, 2019 14:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants