RED-8820: removed property "value" from recategorize
(cherry picked from commit a5e3c0c98abe5546967dfddcb563b70dd86a3c71)
This commit is contained in:
parent
3824a25a2c
commit
1b9eb72814
@ -51,8 +51,6 @@ public class ManualRecategorizationEntity implements IBaseAnnotation {
|
||||
private String legalBasis;
|
||||
@Column(length = 1024)
|
||||
private String section;
|
||||
@Column
|
||||
private String value;
|
||||
|
||||
@ManyToOne
|
||||
private FileEntity fileStatus;
|
||||
|
||||
@ -356,9 +356,6 @@ public class EntityLogMergeService {
|
||||
if (!Strings.isNullOrEmpty(recategorization.getLegalBasis())) {
|
||||
propertyChanges.put("legalBasis", recategorization.getLegalBasis());
|
||||
}
|
||||
if (!Strings.isNullOrEmpty(recategorization.getValue())) {
|
||||
propertyChanges.put("value", recategorization.getValue());
|
||||
}
|
||||
if (!Strings.isNullOrEmpty(recategorization.getSection())) {
|
||||
propertyChanges.put("section", recategorization.getSection());
|
||||
}
|
||||
|
||||
@ -171,8 +171,6 @@ public class PendingDictionaryEntryFactory {
|
||||
manualChange.getType(),
|
||||
"legalBasis",
|
||||
manualChange.getLegalBasis(),
|
||||
"value",
|
||||
manualChange.getValue(),
|
||||
"section",
|
||||
manualChange.getSection()))
|
||||
.build());
|
||||
|
||||
@ -8,7 +8,4 @@ databaseChangeLog:
|
||||
columns:
|
||||
- column:
|
||||
name: section
|
||||
type: VARCHAR(1024)
|
||||
- column:
|
||||
name: value
|
||||
type: VARCHAR(4000)
|
||||
type: VARCHAR(1024)
|
||||
@ -267,6 +267,35 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest {
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testAddToDictionaryEntryWithCarriageReturn() {
|
||||
|
||||
var dossierTemplate = dossierTemplateTesterAndProvider.provideTestTemplate();
|
||||
var dossier = dossierTesterAndProvider.provideTestDossier(dossierTemplate);
|
||||
var file = fileTesterAndProvider.testAndProvideFile(dossier);
|
||||
var type = typeProvider.testAndProvideType(dossierTemplate);
|
||||
|
||||
manualRedactionClient.addRedactionBulk(dossier.getId(),
|
||||
file.getId(),
|
||||
Set.of(AddRedactionRequestModel.builder()
|
||||
.positions(List.of(Rectangle.builder().topLeftY(1).topLeftX(1).height(1).width(1).build()))
|
||||
.section("section test")
|
||||
.addToDictionary(true)
|
||||
.addToAllDossiers(false)
|
||||
.type(type.getType())
|
||||
.reason("1")
|
||||
.value("Luke Skywalker\r")
|
||||
.legalBasis("1")
|
||||
.sourceId("SourceId")
|
||||
.build()));
|
||||
|
||||
var dossierDictionary = internalDictionaryClient.getDictionaryForType(toTypeId(type.getType(), dossierTemplate.getId(), dossier.getId()), null);
|
||||
assertThat(dossierDictionary.getEntries().size()).isEqualTo(1);
|
||||
assertEquals(dossierDictionary.getEntries()
|
||||
.get(0).getValue(), "Luke Skywalker ");
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testManualRemoveFromAllDossiersAndUndo() {
|
||||
|
||||
@ -1170,7 +1199,6 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest {
|
||||
.addToAllDossiers(true)
|
||||
.legalBasis("")
|
||||
.section("section")
|
||||
.value("some value")
|
||||
.build()),
|
||||
false);
|
||||
|
||||
@ -1256,7 +1284,6 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest {
|
||||
.addToAllDossiers(false)
|
||||
.legalBasis("")
|
||||
.section("section")
|
||||
.value("some value")
|
||||
.build()),
|
||||
false);
|
||||
|
||||
@ -1627,7 +1654,10 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest {
|
||||
|
||||
when(entityLogService.getEntityLog(Mockito.any(), Mockito.any(), any(), anyBoolean())).thenReturn(entityLog);
|
||||
|
||||
manualRedactionClient.recategorizeBulk(dossier.getId(), file.getId(), Set.of(RecategorizationRequestModel.builder().annotationId("dv").legalBasis("").section("section").value("").build()), false);
|
||||
manualRedactionClient.recategorizeBulk(dossier.getId(),
|
||||
file.getId(),
|
||||
Set.of(RecategorizationRequestModel.builder().annotationId("dv").legalBasis("").section("section").build()),
|
||||
false);
|
||||
|
||||
var allManualRedactions = manualRedactionClient.getManualRedactions(dossier.getId(), file.getId(), false, true);
|
||||
assertEquals(allManualRedactions.getRecategorizations().size(), 1);
|
||||
@ -1651,7 +1681,10 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest {
|
||||
.dossierId(dossier.getId())
|
||||
.build());
|
||||
|
||||
manualRedactionClient.recategorizeBulk(dossier.getId(), file.getId(), Set.of(RecategorizationRequestModel.builder().annotationId("dv2").legalBasis("").section("section").value("value").build()), false);
|
||||
manualRedactionClient.recategorizeBulk(dossier.getId(),
|
||||
file.getId(),
|
||||
Set.of(RecategorizationRequestModel.builder().annotationId("dv2").legalBasis("").section("section").build()),
|
||||
false);
|
||||
|
||||
allManualRedactions = manualRedactionClient.getManualRedactions(dossier.getId(), file.getId(), false, true);
|
||||
assertEquals(allManualRedactions.getRecategorizations().size(), 2);
|
||||
@ -1855,7 +1888,6 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest {
|
||||
.addToAllDossiers(true)
|
||||
.legalBasis("")
|
||||
.section("section")
|
||||
.value("value")
|
||||
.build();
|
||||
var recatModelLongLegalBasis = RecategorizationRequestModel.builder()
|
||||
.type(type.getType())
|
||||
@ -1864,7 +1896,13 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest {
|
||||
.addToAllDossiers(true)
|
||||
.legalBasis(RandomStringUtils.randomAlphanumeric(4001))
|
||||
.build();
|
||||
var recatModelNoLegalBasis = RecategorizationRequestModel.builder().type(type.getType()).annotationId("annotationId3").addToDictionary(true).section("section").value("some value").addToAllDossiers(true).build();
|
||||
var recatModelNoLegalBasis = RecategorizationRequestModel.builder()
|
||||
.type(type.getType())
|
||||
.annotationId("annotationId3")
|
||||
.addToDictionary(true)
|
||||
.section("section")
|
||||
.addToAllDossiers(true)
|
||||
.build();
|
||||
|
||||
manualRedactionClient.recategorizeBulk(dossier.getId(), file.getId(), Set.of(recatModel, recatModelNoLegalBasis), false);
|
||||
|
||||
@ -2015,7 +2053,6 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest {
|
||||
.addToAllDossiers(false)
|
||||
.legalBasis("lb2")
|
||||
.section("section")
|
||||
.value("lukeSkywalker")
|
||||
.build();
|
||||
|
||||
manualRedactionClient.recategorizeBulk(dossier.getId(), file.getId(), Set.of(recatModel), false);
|
||||
@ -2031,9 +2068,6 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest {
|
||||
assertTrue(allManualRedactions.getRecategorizations()
|
||||
.stream()
|
||||
.anyMatch(entry -> entry.getSection().equals("section")));
|
||||
assertTrue(allManualRedactions.getRecategorizations()
|
||||
.stream()
|
||||
.anyMatch(entry -> entry.getValue().equals("lukeSkywalker")));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -18,7 +18,6 @@ public class ManualRecategorization extends BaseAnnotation {
|
||||
private boolean addToDictionary;
|
||||
private boolean addToAllDossiers;
|
||||
private String section;
|
||||
private String value;
|
||||
|
||||
|
||||
@Override
|
||||
|
||||
@ -21,6 +21,5 @@ public class RecategorizationRequestModel {
|
||||
boolean addToAllDossiers;
|
||||
String legalBasis;
|
||||
String section;
|
||||
String value;
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user