wth - (SPARCDashboard) Validate Calendar when Sending Protocol to Epic #1198
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.
Background: On SPARCDashboard Admin Edit "Request Details" tab, the "Send to Epic" button sends a whole protocol to Epic. But it's currently showing on requests for admins who don't have services going to Epic, and doesn't validate the service calendar.
Acceptance criteria:
1). The "Send to Epic" button should only show up when a protocol has been selected to be sent to Epic (protocols.selected_for_epic = 1);
2). The "Send to Epic" button should only show up on if the SSR organization has services that goes to Epic (services.send_to_epic = 1);
3). Validation should be put on the "Send to Epic" button, with a popup error message "This protocol has failed to be sent to Epic because of failed validation. Please make sure the service calendar is intact before trying again." when it has a broken calendar;
4). When the validation fails, no protocol (SOAP) message should be sent to Epic.
[#151880302]
Story - https://www.pivotaltracker.com/story/show/151880302