RED-7317: fix addredaction with addToDict #106

Merged
kilian.schuettler1 merged 1 commits from RED-7317 into master 2023-09-05 16:26:28 +02:00
3 changed files with 36 additions and 6 deletions

View File

@ -68,12 +68,15 @@ public class ManualRedactionMapper {
.positions(addRedactionRequest.getPositions())
.sourceId(addRedactionRequest.getSourceId())
.dossierId(dossierId)
.dictionaryEntryType(addRedactionRequest.getDictionaryEntryType())
.dictionaryEntryType(addRedactionRequest.getDictionaryEntryType() != null ? addRedactionRequest.getDictionaryEntryType() : DictionaryEntryType.ENTRY)
.build();
}
public List<RemoveRedactionRequest> toRemoveRedactionRequestList(String dossierId, String fileId, String dossierTemplateId,Set<RemoveRedactionRequestModel> removeRedactionRequests) {
public List<RemoveRedactionRequest> toRemoveRedactionRequestList(String dossierId,
String fileId,
String dossierTemplateId,
Set<RemoveRedactionRequestModel> removeRedactionRequests) {
List<RemoveRedactionRequest> requests = new ArrayList<>();
RedactionLog redactionLog = redactionLogService.getRedactionLog(dossierId, fileId);
@ -160,10 +163,11 @@ public class ManualRedactionMapper {
return requests;
}
public List<ResizeRedactionRequest> toResizeRedactionRequestList(Set<ResizeRedactionRequestModel> resizeRedactionRequests) {
return resizeRedactionRequests.stream()
.map(resizeRedactionRequest ->ResizeRedactionRequest.builder()
.map(resizeRedactionRequest -> ResizeRedactionRequest.builder()
.annotationId(resizeRedactionRequest.getAnnotationId())
.user(KeycloakSecurity.getUserId())
.status(AnnotationStatus.APPROVED)

View File

@ -45,8 +45,7 @@ public class AddRedactionRequestModel {
private boolean rectangle;
private String sourceId;
@Builder.Default
private DictionaryEntryType dictionaryEntryType = DictionaryEntryType.ENTRY;
private DictionaryEntryType dictionaryEntryType;
}

27
publish-custom-image.sh Executable file
View File

@ -0,0 +1,27 @@
#!/bin/bash
# This script compiles the project, builds a docker image with the tag <BranchName>-<CommitHash> and pushes it to our nexus.
# Set the Nexus repository URL
NEXUS_REPO="nexus.knecon.com:5001"
# Set the image name
IMAGE_NAME="red/persistence-service-server-v1"
# path to image repo
IMAGE_REPO="persistence-service-image-v1"
echo "Running build"
mvn clean install -Pquickbuild
# Get the current Git branch
GIT_BRANCH=$(git symbolic-ref --short HEAD)
# Get the first 5 characters of the commit hash
GIT_COMMIT_HASH=$(git rev-parse --short=5 HEAD)
# Create the image tag by combining branch and commit hash
IMAGE_TAG="${GIT_BRANCH}-${GIT_COMMIT_HASH}"
IMAGE_NAME="$NEXUS_REPO/$IMAGE_NAME:$IMAGE_TAG"
echo "Building docker image: {$IMAGE_NAME}"
# Build the Docker image with the specified name and tag and push to nexus
mvn -f $IMAGE_REPO docker:build docker:push -Ddocker.image.version=$IMAGE_TAG
echo "Docker image '$IMAGE_NAME' has been built and pushed to Nexus."