Skip to content
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

SC-86 Evaluator journey: Upload complete evaluation #2024

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

edwin-jebaraj
Copy link
Collaborator

Changes in this PR

Added new files to upload completed documents

  1. app/controllers/evaluation/download_documents_controller.rb - Updated file for evaluation document upload
  2. app/controllers/evaluation/upload_completed_documents_controller.rb - Added new controller for evaluation document upload
  3. app/models/support/case.rb - Updated file for evaluation document upload
  4. app/models/support/case/document_uploadable.rb - Added new function for evaluation document upload
  5. app/models/support/case/document_uploader.rb - Added new function for evaluation document upload
  6. app/models/support/evaluators_upload_document.rb - Added new model file for evaluation document upload
  7. app/views/evaluation/tasks/show.html.erb - Updated file for upload documents link
  8. app/views/evaluation/upload_completed_documents/_form.html.erb - Added new view file for evaluation document upload
  9. app/views/evaluation/upload_completed_documents/_uploaded_documents.html.erb - Added new view file for evaluation document upload
  10. app/views/evaluation/upload_completed_documents/destroy.html.erb - Added new view file for delete document
  11. app/views/evaluation/upload_completed_documents/show.html.erb - Added new view file for evaluation document upload
  12. config/locales/en.yml - Added new language variable for evaluation document upload
  13. config/routes.rb - Added new route path for evaluation document upload
  14. db/migrate/20250116143149_add_support_evaluators_upload_documents.rb - Added new migration file to create new table for upload evaluation document details
  15. db/migrate/20250117101341_add_has_uploaded_documents_to_support_evalutors.rb - Added new migration file to update upload document status
  16. spec/features/evaluation/upload_completed_documents_spec.rb - Added new spec file to test evaluation document upload

Screen-shots or screen-capture of UI changes

@@ -8,14 +8,18 @@ class Support::Case::DocumentUploader
attribute :support_case
attribute :has_uploaded_documents

validates :files, presence: true, if: -> { support_case.has_uploaded_documents.nil? }
validates :files, presence: true, if: -> { has_uploaded_documents.blank? }
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm confused by the semantics here. Why is it important that it's blank? rather than a boolean check?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We need to validate the upload confirmation "Yes" or "No". By default it is blank which means no radio button selected.

@@ -0,0 +1,5 @@
class AddHasUploadedDocumentsToSupportEvalutors < ActiveRecord::Migration[7.2]
def change
add_column :support_evaluators, :has_uploaded_documents, :boolean
Copy link
Collaborator

Choose a reason for hiding this comment

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

Consider adding a default (probably false) and making this non-NULL.

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
B Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

Copy link

Test coverage

Line: 86.95%
Branch: 76.77%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants