-
Notifications
You must be signed in to change notification settings - Fork 2
HDPI - 6404 - Upload Additional Documents Screen #1843
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
Open
nicole-samuels
wants to merge
25
commits into
HDPI-6421-upload-doc-legal-rep
Choose a base branch
from
HDPI-6404-upload-documents-screen-3
base: HDPI-6421-upload-doc-legal-rep
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
f9c3672
Added additional document page
nicole-samuels a09712d
Merge branch 'HDPI-6421-upload-doc-legal-rep' into HDPI-6404-upload-d…
nicole-samuels b5ac28c
Added new screen to configurer and updated test
nicole-samuels c1a76a4
Adding legal rep document upload class
nicole-samuels 4f9d0b5
changed name of additional documents and updated document content
nicole-samuels d2b7a28
updated the additional document page with common page content
nicole-samuels 2ce7ec4
Removed save and return common page content
nicole-samuels 1585a13
Merge branch 'HDPI-6421-upload-doc-legal-rep' into HDPI-6404-upload-d…
nicole-samuels c875f9e
HDPI-6404 Updated character limit and persisted case data
nicole-samuels e4e0d85
Merged HDPI-6241
nicole-samuels 92ca85a
Merge branch 'HDPI-6421-upload-doc-legal-rep' into HDPI-6404-upload-d…
madhavi1203 b26e3a6
Updated content for upload page
nicole-samuels e16ff97
Merge branch 'HDPI-6421-upload-doc-legal-rep' into HDPI-6404-upload-d…
marianadpereira cdfd587
Merge branch 'HDPI-6421-upload-doc-legal-rep' into HDPI-6404-upload-d…
nicole-samuels 1337f75
Updated title and spacing
nicole-samuels 5d0a654
Merge branch 'HDPI-6421-upload-doc-legal-rep' into HDPI-6404-upload-d…
marianadpereira 8e38ef3
Added LegalRepDocumentTypeWales
nicole-samuels c4b1eea
updated submit method and document service
nicole-samuels da6a594
Merge branch 'HDPI-6421-upload-doc-legal-rep' into HDPI-6404-upload-d…
nicole-samuels 15e0d1a
removed duplicate import
nicole-samuels f82d4e5
Merge branch 'HDPI-6421-upload-doc-legal-rep' into HDPI-6404-upload-d…
nicole-samuels 66e96e1
Added LegalREpDocumentType for English and Welsh journey
nicole-samuels ce26670
Updated DocumentService to ddded mapping to categoryId for legalRepDo…
nicole-samuels 05ab994
Updated DocumentService by removing Optional.of for categoryId mappin…
nicole-samuels 2f9927e
updated DocumentService for legalRepDocument
nicole-samuels 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
39 changes: 39 additions & 0 deletions
39
...main/java/uk/gov/hmcts/reform/pcs/ccd/domain/legalrepdocumentupload/LegalRepDocument.java
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,39 @@ | ||
| package uk.gov.hmcts.reform.pcs.ccd.domain.legalrepdocumentupload; | ||
|
|
||
| import lombok.AllArgsConstructor; | ||
| import lombok.Builder; | ||
| import lombok.Data; | ||
| import lombok.NoArgsConstructor; | ||
| import uk.gov.hmcts.ccd.sdk.api.CCD; | ||
| import uk.gov.hmcts.ccd.sdk.type.Document; | ||
| import uk.gov.hmcts.ccd.sdk.type.FieldType; | ||
| import uk.gov.hmcts.reform.pcs.ccd.domain.legalrepdocumentupload.wales.LegalRepDocumentTypeWales; | ||
|
|
||
| @Data | ||
| @Builder | ||
| @NoArgsConstructor | ||
| @AllArgsConstructor | ||
| public class LegalRepDocument { | ||
|
|
||
| @CCD( | ||
| label = "Type of document", | ||
| typeOverride = FieldType.FixedList, | ||
| typeParameterOverride = "LegalRepDocumentType" | ||
| ) | ||
| private LegalRepDocumentType legalRepDocumentType; | ||
|
|
||
| @CCD( | ||
| label = "Type of document", | ||
| typeOverride = FieldType.FixedList, | ||
| typeParameterOverride = "LegalRepDocumentTypeWales" | ||
| ) | ||
| private LegalRepDocumentTypeWales legalRepDocumentTypeWales; | ||
|
|
||
| @CCD(label = "Document") | ||
| private Document document; | ||
|
|
||
| @CCD(label = "Short description", | ||
| max = 60 | ||
| ) | ||
| private String description; | ||
| } |
23 changes: 23 additions & 0 deletions
23
.../java/uk/gov/hmcts/reform/pcs/ccd/domain/legalrepdocumentupload/LegalRepDocumentType.java
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,23 @@ | ||
| package uk.gov.hmcts.reform.pcs.ccd.domain.legalrepdocumentupload; | ||
|
|
||
| import lombok.AllArgsConstructor; | ||
| import lombok.Getter; | ||
| import uk.gov.hmcts.ccd.sdk.api.HasLabel; | ||
|
|
||
| @AllArgsConstructor | ||
| @Getter | ||
| public enum LegalRepDocumentType implements HasLabel { | ||
|
|
||
| RENT_STATEMENT("Rent or payments"), | ||
| TENANCY_AGREEMENT("Tenancy agreement"), | ||
| CORRESPONDENCE_FROM_DEFENDANT("Correspondence from defendant"), | ||
| CORRESPONDENCE_FROM_CLAIMANT("Correspondence from claimant"), | ||
| PHOTOGRAPHIC_EVIDENCE("Photographic evidence"), | ||
| CERTIFICATE_OF_SUITABILITY_AS_LF("Certificate of suitability as litigation friend"), | ||
| LEGAL_AID_CERTIFICATE("Legal aid certificate"), | ||
| OTHER("Other document"), | ||
| WITNESS_STATEMENT("Witness statement"); | ||
|
|
||
| private final String label; | ||
|
|
||
| } |
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
23 changes: 23 additions & 0 deletions
23
...v/hmcts/reform/pcs/ccd/domain/legalrepdocumentupload/wales/LegalRepDocumentTypeWales.java
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,23 @@ | ||
| package uk.gov.hmcts.reform.pcs.ccd.domain.legalrepdocumentupload.wales; | ||
|
|
||
| import lombok.AllArgsConstructor; | ||
| import lombok.Getter; | ||
| import uk.gov.hmcts.ccd.sdk.api.HasLabel; | ||
|
|
||
| @AllArgsConstructor | ||
| @Getter | ||
| public enum LegalRepDocumentTypeWales implements HasLabel { | ||
|
|
||
| RENT_STATEMENT("Rent or payments"), | ||
| OCCUPATION_LICENCE("Occupation licence"), | ||
| CORRESPONDENCE_FROM_DEFENDANT("Correspondence from defendant"), | ||
| CORRESPONDENCE_FROM_CLAIMANT("Correspondence from claimant"), | ||
| PHOTOGRAPHIC_EVIDENCE("Photographic evidence"), | ||
| CERTIFICATE_OF_SUITABILITY_AS_LF("Certificate of suitability as litigation friend"), | ||
| LEGAL_AID_CERTIFICATE("Legal aid certificate"), | ||
| OTHER("Other document"), | ||
| WITNESS_STATEMENT("Witness statement"); | ||
|
|
||
| private final String label; | ||
|
|
||
| } |
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
71 changes: 71 additions & 0 deletions
71
...k/gov/hmcts/reform/pcs/ccd/page/legalrepdocumentupload/UploadAdditionalDocumentsPage.java
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,71 @@ | ||
| package uk.gov.hmcts.reform.pcs.ccd.page.legalrepdocumentupload; | ||
|
|
||
| import lombok.AllArgsConstructor; | ||
| import org.springframework.stereotype.Component; | ||
| import uk.gov.hmcts.reform.pcs.ccd.common.CcdPageConfiguration; | ||
| import uk.gov.hmcts.reform.pcs.ccd.common.PageBuilder; | ||
| import uk.gov.hmcts.reform.pcs.ccd.domain.PCSCase; | ||
| import uk.gov.hmcts.reform.pcs.ccd.domain.legalrepdocumentupload.LegalRepDocument; | ||
| import uk.gov.hmcts.reform.pcs.ccd.domain.legalrepdocumentupload.LegalRepDocumentUploadDetails; | ||
| import uk.gov.hmcts.reform.pcs.ccd.page.CcdPage; | ||
| import uk.gov.hmcts.reform.pcs.ccd.service.TextAreaValidationService; | ||
|
|
||
| import static uk.gov.hmcts.reform.pcs.ccd.ShowConditions.NEVER_SHOW; | ||
|
|
||
| @Component | ||
| @AllArgsConstructor | ||
| public class UploadAdditionalDocumentsPage implements CcdPageConfiguration, CcdPage { | ||
|
|
||
| private static final String DESCRIPTION_LABEL = "Short description"; | ||
| private final TextAreaValidationService textAreaValidationService; | ||
| public static final String DOCUMENT_DETAILS_CONTENT = """ | ||
| <p class="govuk-body"> | ||
| You should only upload documents that are relevant to the claim. | ||
| </p> | ||
|
|
||
| <p class="govuk-body"> | ||
| Before you upload the document, give it a name that tells the court what it is, | ||
| for example ‘witness statement’, or ‘tenancy agreement’. | ||
| </p> | ||
|
|
||
| <p class="govuk-body"> | ||
| You can upload the following file types: DOC/DOCX (Word), XLS/XLSM | ||
| (Excel), PPT/PPTX (PowerPoint), PDF, RTF, TXT, CSV, JPG/JPEG, PNG, BMP, | ||
| TIF/TIFF. | ||
| </p> | ||
|
|
||
| <p class="govuk-body govuk-!-font-weight-bold govuk-!-margin-0"> | ||
| Before you upload your documents | ||
| </p> | ||
|
|
||
| <p class="govuk-body"> | ||
| Give your document a name that explains what it is. | ||
| </p> | ||
|
|
||
| """; | ||
|
|
||
| @Override | ||
| public void addTo(PageBuilder pageBuilder) { | ||
| String pageKey = getPageKey(); | ||
| pageBuilder | ||
| .page(pageKey) | ||
| .pageLabel("Upload additional documents") | ||
| .label(pageKey + "-line-separator", "---") | ||
| .label(pageKey + "-content", DOCUMENT_DETAILS_CONTENT) | ||
| .complex(PCSCase::getLegalRepDocumentUploadDetails) | ||
| .readonly(LegalRepDocumentUploadDetails::getIsWales, NEVER_SHOW) | ||
| .list(LegalRepDocumentUploadDetails::getLegalRepDocuments) | ||
| .mandatory(LegalRepDocument::getLegalRepDocumentType, "isWales = \"No\"") | ||
| .mandatory(LegalRepDocument::getLegalRepDocumentTypeWales, "isWales = \"Yes\"") | ||
| .mandatory(LegalRepDocument::getDocument) | ||
| .mandatory(LegalRepDocument::getDescription) | ||
| .done() | ||
| .build(); | ||
| } | ||
|
|
||
| @Override | ||
| public String getPageKey() { | ||
| return CcdPage.derivePageKey(this.getClass()); | ||
| } | ||
|
|
||
| } |
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.
It looks like it's not specified in the ticket, but ideally each ticket that captures some data from the user should include persisting it to the DB. Otherwise there is a chance that it can get forgotten about.