-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/frontend registry and caserecord #36
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
52 commits
Select commit
Hold shift + click to select a range
321447d
Added case to dashboard-layout.html
MartinStenhagen 8a8d04d
Added case-management.html
MartinStenhagen 23a079e
Added CaseManagementViewController
MartinStenhagen a6fb2d8
Added case-management.css
MartinStenhagen 3352440
Added registry-list.html
MartinStenhagen c196d92
Added CaseManagementViewController and new help-methods etc
MartinStenhagen 3c0b83f
Fixed error that prevented case-management from loading properly
MartinStenhagen 6f05362
Added Registry creation
MartinStenhagen 7eb9300
Added Case record creation etc
MartinStenhagen a4f77b6
UI fixes etc
MartinStenhagen eb6978f
Fixed some issues
MartinStenhagen d0313fd
Added support to update caserecords
MartinStenhagen 5d41077
Moved code from CaseManagementViewController to new controllers and a…
MartinStenhagen d994441
chaged init-localstack.sh to autocreate bucket etc
MartinStenhagen f7adf67
Added better exception handling for upload and delete files
MartinStenhagen 00deb88
Added sorting to uploaded files
MartinStenhagen f88b66d
Added sorting to uploaded files and casefile numbering
MartinStenhagen 6e9a18a
Updated tests to match changes in CaseFileService and Repository
MartinStenhagen 8ee59db
Updated and added tests
MartinStenhagen 2e3212f
Added CaseFileViewControllerTest
MartinStenhagen 220874a
Added confidentiality to CaseFile, enum and CaseFileAcess-entity
MartinStenhagen 55aeab9
Added CaseFileAccess + repository and flyway migration
MartinStenhagen 839dc52
Added CaseFileAccessAdminService, CaseFileListItemDto and updated Cas…
MartinStenhagen 50ef8a5
Changes to implement confidentiality to files
MartinStenhagen a719a19
Added confidentiality to case-file-list.html
MartinStenhagen 0817d76
improvements to UserRole
MartinStenhagen 379e2f9
Added CaseFileAccessServiceTest and changed user role from String to …
MartinStenhagen d09a658
Added new tests for confidentiality to CaseFileServiceTest
MartinStenhagen 78a3914
Updated old tests in CaseFileControllerTest
MartinStenhagen 9d426e3
Changes after merge with main
MartinStenhagen 913eea3
Merge branch 'main' into feature/frontend-registry-and-caserecord
MartinStenhagen a2e57e0
More fixes after merge
MartinStenhagen 6a977fd
Fix document number allocation race condition by adding pessimistic l…
MartinStenhagen 37cf746
Reworked casefile-controllers and service to fix coderabbit feedback …
MartinStenhagen 217e963
Reworked upLoadCaseFile and deleteCaseFile and added reloadFileListFr…
MartinStenhagen 1961827
Fixed coderabbit feedback: Don’t re-query the missing entity after ca…
MartinStenhagen 6b6d334
fixed coderabbitfeedback: Keep setters aligned with entity constraint…
MartinStenhagen 26ec276
Flyway migration and changed to CONTENT_TOO_LARGE in exceptionhandler…
MartinStenhagen 474af00
Reworked exception handling after coderabbit feedback
MartinStenhagen e7ceb5b
Fixed Avoid flooring the displayed upload limit.
MartinStenhagen 6cc03e5
Ui fixes after coderabbit feedback
MartinStenhagen b3f3925
changed to <form class="registry-form"
MartinStenhagen e847dbe
Reworked tests after changes to the code and coderabbit feedback
MartinStenhagen 06d0f0d
Removed redundant lines after coderabbit feedback
MartinStenhagen 7b7dcf2
Add CSRF token to the HTMX DELETE request.
MartinStenhagen b6e4ceb
Fixed Compare the enum by name when selecting the current status.
MartinStenhagen be43072
removed a second, different AccessDeniedException response contract.
MartinStenhagen 66913d8
Reworked exception handling to address this issue: Catch‑all Exceptio…
MartinStenhagen 7f08b5e
Added missing test annotation
MartinStenhagen edc0faf
Merge branch 'main' into feature/frontend-registry-and-caserecord
MartinStenhagen a573c9a
Fixed and issue with missing csrf-token for creating registries and c…
MartinStenhagen 82325d6
Fixed coderabbit-feedback: Associate the owner label with its read-on…
MartinStenhagen 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,10 @@ | ||
| #!/bin/bash | ||
| set -euo pipefail | ||
|
|
||
| bucket="${AWS_BUCKET_NAME:-team4you-files}" | ||
| awslocal s3api head-bucket --bucket "$bucket" 2>/dev/null || awslocal s3 mb "s3://$bucket" | ||
| echo "checking/creating s3 bucket: $bucket" | ||
|
|
||
| awslocal s3api head-bucket --bucket "$bucket" 2>/dev/null || awslocal s3 mb "s3://$bucket" | ||
|
|
||
| echo "available buckets:" | ||
| awslocal s3 ls |
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
10 changes: 10 additions & 0 deletions
10
src/main/java/backendlab/team4you/casefile/CaseFileListItemDto.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,10 @@ | ||
| package backendlab.team4you.casefile; | ||
|
|
||
| public record CaseFileListItemDto( | ||
| Long id, | ||
| String documentReference, | ||
| String displayName, | ||
| boolean confidential, | ||
| boolean canDownload | ||
| ) { | ||
| } |
6 changes: 5 additions & 1 deletion
6
src/main/java/backendlab/team4you/casefile/CaseFileRepository.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 |
|---|---|---|
| @@ -1,11 +1,15 @@ | ||
| package backendlab.team4you.casefile; | ||
|
|
||
| import jakarta.persistence.LockModeType; | ||
| import org.springframework.data.jpa.repository.JpaRepository; | ||
| import org.springframework.data.jpa.repository.Lock; | ||
|
|
||
| import java.util.List; | ||
| import java.util.Optional; | ||
|
|
||
| public interface CaseFileRepository extends JpaRepository<CaseFile, Long> { | ||
| List<CaseFile> findByCaseRecordId(Long caseRecordId); | ||
| List<CaseFile> findByCaseRecordIdOrderByDocumentNumberAsc(Long caseRecordId); | ||
| Optional<CaseFile> findByIdAndCaseRecordId(Long id, Long caseRecordId); | ||
| @Lock(LockModeType.PESSIMISTIC_WRITE) | ||
| Optional<CaseFile> findTopByCaseRecordIdOrderByDocumentNumberDesc(Long caseRecordId); | ||
| } | ||
12 changes: 10 additions & 2 deletions
12
src/main/java/backendlab/team4you/casefile/CaseFileResponseDto.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 |
|---|---|---|
| @@ -1,21 +1,29 @@ | ||
| package backendlab.team4you.casefile; | ||
|
|
||
| import backendlab.team4you.common.ConfidentialityLevel; | ||
|
|
||
| import java.time.LocalDateTime; | ||
|
|
||
| public record CaseFileResponseDto( | ||
| Long id, | ||
| String originalFilename, | ||
| String contentType, | ||
| long size, | ||
| LocalDateTime uploadedAt | ||
| LocalDateTime uploadedAt, | ||
| int documentNumber, | ||
| String documentReference, | ||
| ConfidentialityLevel confidentialityLevel | ||
| ) { | ||
| public static CaseFileResponseDto from(CaseFile caseFile) { | ||
| return new CaseFileResponseDto( | ||
| caseFile.getId(), | ||
| caseFile.getOriginalFilename(), | ||
| caseFile.getContentType(), | ||
| caseFile.getSize(), | ||
| caseFile.getUploadedAt() | ||
| caseFile.getUploadedAt(), | ||
| caseFile.getDocumentNumber(), | ||
| caseFile.getDocumentReference(), | ||
| caseFile.getConfidentialityLevel() | ||
| ); | ||
| } | ||
| } |
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.
Uh oh!
There was an error while loading. Please reload this page.