-
Notifications
You must be signed in to change notification settings - Fork 19
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
msteele/APPEALS-24727 #19187
msteele/APPEALS-24727 #19187
Conversation
Code Climate has analyzed commit 7878988 and detected 2 issues on this pull request. Here's the issue category breakdown:
Note: there is 1 critical issue. View more on Code Climate. |
@@ -92,6 +92,18 @@ def document_count | |||
handle_non_critical_error("document_count", error) | |||
end | |||
|
|||
# series_id is lowercase, no curly braces because it comes from url | |||
def document_lookup | |||
series_id = "{#{params[:series_id]}}".upcase |
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.
series_id = params[:series_id].to_s.upcase
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.
This was from last story, but the curly braces are necessary for the lookup
# series_id is lowercase, no curly braces because it comes from url | ||
def document_lookup | ||
series_id = "{#{params[:series_id]}}".upcase | ||
document = Document.find_by(series_id: series_id, file_number: appeal.veteran_file_number) |
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.
appeal&.veteran_file_number
def open_assign_hearing_disposition_task? | ||
# ChangeHearingDispositionTask is a subclass of AssignHearingDispositionTask | ||
disposition_task_names = [AssignHearingDispositionTask.name, ChangeHearingDispositionTask.name] | ||
open_task = appeal.tasks.where(type: disposition_task_names).open.first |
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.
you can probably simplify this method by adding a scope method to the task model with something like scope ```
:open_disposition_task, -> {
tasks.where(type: [AssignHearingDispositionTask.name, ChangeHearingDispositionTask.name]).open.first
}
then just use `open_task = appeal.open_disposition_task`
@@ -18,8 +18,13 @@ def assign_to_organization_data(task, _user = nil) | |||
end | |||
|
|||
def mail_assign_to_organization_data(task, user = nil) |
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.
you should probably be able to use instance_of in both places in this method instead of is_a to narrow the type expectation even further
const errorMsg = dateValidationError(value); | ||
|
||
setDateError(errorMsg); | ||
validateDate?.(value !== '' && errorMsg === null); |
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.
suggest removing the ? as chaining is not needed here
const checkIfDocumentExists = async () => { | ||
setLoading(true); |
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.
Whenever the "Retry" button is pressed, will this function's invocation allow for the parent component's state to be updated?
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.
I've just updated the onclick of the retry button with the rest of the functionality from the debounce
value={this.state.eFolderUrl} | ||
valid={this.state.eFolderUrlValid} |
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.
Are these two props able to be removed?
appealId: PropTypes.string.isRequired, | ||
requestType: PropTypes.string, | ||
value: PropTypes.string, | ||
errorMessage: PropTypes.string | ||
errorMessage: PropTypes.string, | ||
valid: PropTypes.bool |
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.
appealId: PropTypes.string.isRequired, | |
requestType: PropTypes.string, | |
value: PropTypes.string, | |
errorMessage: PropTypes.string | |
errorMessage: PropTypes.string, | |
valid: PropTypes.bool | |
appealId: PropTypes.string.isRequired, | |
requestType: PropTypes.string, | |
errorMessage: PropTypes.string |
In case the value and valid props are no longer passed in.
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.
LGTM!
cfb6cd6
into
feature/APPEALS-21339
Resolves APPEALS-24727
Description
Added validation to ensure that a given document series id exists within VBMS eFolder before allowing a HPR task to be created.
Acceptance Criteria
The value of the field labeled "Insert Caseflow Reader document hyperlink to request a hearing withdrawal" with be considered valid if:
https://vefs-claimevidence-ui-..bip.va.gov/file/<document_series_reference_id of document>
Refer to this Slack thread for further context: https://benefits-int-delivery.slack.com/archives/C03NCPYRXK2/p1687881917481399?thread_ts=1687878651.089549&cid=C03NCPYRXK2
Testing Plan
Frontend
User Facing Changes
Best practices
Code Documentation Updates
Tests
Test Coverage
Did you include any test coverage for your code? Check below:
Code Climate
Your code does not add any new code climate offenses? If so why?
Error Handling
Exception Handling