-
Notifications
You must be signed in to change notification settings - Fork 2
fix(trainsformer): fix adding / removing service dates, days of week #1351
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
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
df57323
refactor: move start date before end date validation to utility module
rudiejd 485a531
feat(trainsformer): validate start date is before end date for trains…
rudiejd d4da214
polish: change the opacity on hover for trainsformer icons
rudiejd 2b98960
fix(trainsformer): use sort/drop params to add or remove service date…
rudiejd 7d2c1be
fix(trainsformer): remove unused add / delete service date event hand…
rudiejd 6bc5c91
polish: set a default of today for start / end date
rudiejd 388ccd4
fixup: set value of new service date to new
rudiejd 69c8fca
fixup: correctly delete trainsformer exports
rudiejd b2c26b6
test: delete a service date in the integration test
rudiejd a9b6969
fixup: credo issues with integration tests
rudiejd 1e47a13
fixup: export => hastus_export
rudiejd b1387ab
fixup: increase opacity by 40% on hover instead of decreasing
rudiejd 8048ed1
fixup: change other stuff to hastus export instead of just export
rudiejd 9ed834b
fixup: move sart / end date validation to Arrow.Util.Validation module
rudiejd 7d7a01d
fixup: fix typo
rudiejd 8333fe4
fixup: more disambiguating trainsformer vs hastus export
rudiejd fbecb2b
fixup: fix typos
rudiejd 487bcd9
fixup: dialyze
rudiejd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| defmodule Arrow.Util.Validation do | ||
| @moduledoc """ | ||
| Utilities for validating changesets in Arrow. Note that many these functions make assumptions | ||
| about the field names / error messages in your changeset that are specific to this project. | ||
| """ | ||
| @spec validate_start_date_before_end_date(Ecto.Changeset.t(any())) :: Ecto.Changeset.t(any()) | ||
| def validate_start_date_before_end_date(changeset) do | ||
| start_date = Ecto.Changeset.get_field(changeset, :start_date) | ||
| end_date = Ecto.Changeset.get_field(changeset, :end_date) | ||
|
|
||
| cond do | ||
| is_nil(start_date) or is_nil(end_date) -> | ||
| changeset | ||
|
|
||
| Date.compare(start_date, end_date) == :gt -> | ||
| Ecto.Changeset.add_error( | ||
| changeset, | ||
| :start_date, | ||
| "start date must be less than or equal to end date" | ||
| ) | ||
|
|
||
| true -> | ||
| changeset | ||
| end | ||
| end | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion:
Good catch.
If it wouldn't be too much of a pain, it would also help to rename the
delete_exportevent and its correspondinghandle_eventclause todelete_hastus_export.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can do!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1e47a13