RED-3081-As an admin of a dossier template I want to customize the highlighting color of a skipped redaction of an entity
- add skippedHexColor to type entity - update of tests
This commit is contained in:
parent
237667e9c8
commit
d537a16d65
@ -22,6 +22,7 @@ public class Type {
|
|||||||
private String label;
|
private String label;
|
||||||
private String hexColor;
|
private String hexColor;
|
||||||
private String recommendationHexColor;
|
private String recommendationHexColor;
|
||||||
|
private String skippedHexColor;
|
||||||
private int rank;
|
private int rank;
|
||||||
private boolean isHint;
|
private boolean isHint;
|
||||||
private boolean isCaseInsensitive;
|
private boolean isCaseInsensitive;
|
||||||
|
|||||||
@ -46,6 +46,8 @@ public class TypeEntity {
|
|||||||
@Column
|
@Column
|
||||||
private String recommendationHexColor;
|
private String recommendationHexColor;
|
||||||
@Column
|
@Column
|
||||||
|
private String skippedHexColor;
|
||||||
|
@Column
|
||||||
private int rank;
|
private int rank;
|
||||||
@Column
|
@Column
|
||||||
private boolean isHint;
|
private boolean isHint;
|
||||||
|
|||||||
@ -120,7 +120,7 @@ public class DossierTemplateCloneService {
|
|||||||
private void cloneDictionariesWithEntries(String dossierTemplateId, String clonedDossierTemplateId) {
|
private void cloneDictionariesWithEntries(String dossierTemplateId, String clonedDossierTemplateId) {
|
||||||
var types = dictionaryPersistenceService.getAllTypesForDossierTemplate(dossierTemplateId, false);
|
var types = dictionaryPersistenceService.getAllTypesForDossierTemplate(dossierTemplateId, false);
|
||||||
for (TypeEntity t : types) {
|
for (TypeEntity t : types) {
|
||||||
var type = dictionaryPersistenceService.addType(t.getType(), clonedDossierTemplateId, t.getHexColor(), t.getRecommendationHexColor(), t.getRank(), t.isHint(), t.isCaseInsensitive(), t.isRecommendation(), t.getDescription(), t.isAddToDictionaryAction(), t.getLabel(), null, t.isHasDictionary(), t.isSystemManaged(), t.isAutoHideSkipped());
|
var type = dictionaryPersistenceService.addType(t.getType(), clonedDossierTemplateId, t.getHexColor(), t.getRecommendationHexColor(), t.getSkippedHexColor(), t.getRank(), t.isHint(), t.isCaseInsensitive(), t.isRecommendation(), t.getDescription(), t.isAddToDictionaryAction(), t.getLabel(), null, t.isHasDictionary(), t.isSystemManaged(), t.isAutoHideSkipped());
|
||||||
entryPersistenceService.cloneEntries(t.getId(), type.getId());
|
entryPersistenceService.cloneEntries(t.getId(), type.getId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -33,7 +33,7 @@ public class DictionaryPersistenceService {
|
|||||||
private final EntryRepository entryRepository;
|
private final EntryRepository entryRepository;
|
||||||
|
|
||||||
|
|
||||||
public TypeEntity addType(String type, String dossierTemplateId, String hexColor, String recommendationHexColor, int rank, boolean isHint, boolean caseInsensitive,
|
public TypeEntity addType(String type, String dossierTemplateId, String hexColor, String recommendationHexColor, String skippedHexColor, int rank, boolean isHint, boolean caseInsensitive,
|
||||||
boolean isRecommendation, String description, boolean addToDictionaryAction, String label, String dossierId, boolean hasDictionary,
|
boolean isRecommendation, String description, boolean addToDictionaryAction, String label, String dossierId, boolean hasDictionary,
|
||||||
boolean systemManaged, boolean autoHideSkipped) {
|
boolean systemManaged, boolean autoHideSkipped) {
|
||||||
|
|
||||||
@ -46,6 +46,7 @@ public class DictionaryPersistenceService {
|
|||||||
.dossierTemplate(dossierTemplateRepository.getOne(dossierTemplateId))
|
.dossierTemplate(dossierTemplateRepository.getOne(dossierTemplateId))
|
||||||
.hexColor(hexColor)
|
.hexColor(hexColor)
|
||||||
.recommendationHexColor(recommendationHexColor)
|
.recommendationHexColor(recommendationHexColor)
|
||||||
|
.skippedHexColor(skippedHexColor)
|
||||||
.rank(rank)
|
.rank(rank)
|
||||||
.description(description)
|
.description(description)
|
||||||
.isHint(isHint)
|
.isHint(isHint)
|
||||||
@ -77,6 +78,7 @@ public class DictionaryPersistenceService {
|
|||||||
if (type.isSystemManaged()) {
|
if (type.isSystemManaged()) {
|
||||||
type.setHexColor(typeValueRequest.getHexColor());
|
type.setHexColor(typeValueRequest.getHexColor());
|
||||||
type.setRecommendationHexColor(typeValueRequest.getRecommendationHexColor());
|
type.setRecommendationHexColor(typeValueRequest.getRecommendationHexColor());
|
||||||
|
type.setSkippedHexColor(typeValueRequest.getSkippedHexColor());
|
||||||
type.setDescription(typeValueRequest.getDescription());
|
type.setDescription(typeValueRequest.getDescription());
|
||||||
type.setLabel(typeValueRequest.getLabel());
|
type.setLabel(typeValueRequest.getLabel());
|
||||||
type.setAddToDictionaryAction(typeValueRequest.isAddToDictionaryAction());
|
type.setAddToDictionaryAction(typeValueRequest.isAddToDictionaryAction());
|
||||||
|
|||||||
@ -169,7 +169,7 @@ public class DictionaryController implements DictionaryResource {
|
|||||||
}
|
}
|
||||||
String color = typeRequest.getHexColor();
|
String color = typeRequest.getHexColor();
|
||||||
validateColor(color);
|
validateColor(color);
|
||||||
return convert(dictionaryPersistenceService.addType(typeRequest.getType(), typeRequest.getDossierTemplateId(), color, typeRequest.getRecommendationHexColor(), typeRequest.getRank(), typeRequest.isHint(), typeRequest.isCaseInsensitive(), typeRequest.isRecommendation(), typeRequest.getDescription(), typeRequest.isAddToDictionaryAction(), typeRequest.getLabel(), typeRequest.getDossierId(), typeRequest.isHasDictionary(), typeRequest.isSystemManaged(), typeRequest.isAutoHideSkipped()), Type.class);
|
return convert(dictionaryPersistenceService.addType(typeRequest.getType(), typeRequest.getDossierTemplateId(), color, typeRequest.getRecommendationHexColor(), typeRequest.getSkippedHexColor(), typeRequest.getRank(), typeRequest.isHint(), typeRequest.isCaseInsensitive(), typeRequest.isRecommendation(), typeRequest.getDescription(), typeRequest.isAddToDictionaryAction(), typeRequest.getLabel(), typeRequest.getDossierId(), typeRequest.isHasDictionary(), typeRequest.isSystemManaged(), typeRequest.isAutoHideSkipped()), Type.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,11 @@
|
|||||||
|
databaseChangeLog:
|
||||||
|
- changeSet:
|
||||||
|
id: add-skipped-color
|
||||||
|
author: corinaolariu
|
||||||
|
changes:
|
||||||
|
- addColumn:
|
||||||
|
columns:
|
||||||
|
- column:
|
||||||
|
name: skipped_hex_color
|
||||||
|
type: VARCHAR(255)
|
||||||
|
tableName: entity
|
||||||
@ -75,3 +75,5 @@ databaseChangeLog:
|
|||||||
file: db/changelog/31-add-file-size-column.changelog.yaml
|
file: db/changelog/31-add-file-size-column.changelog.yaml
|
||||||
- include:
|
- include:
|
||||||
file: db/changelog/sql/31-watermark-configuration.sql
|
file: db/changelog/sql/31-watermark-configuration.sql
|
||||||
|
- include:
|
||||||
|
file: db/changelog/32-added-skipped-color-type-table.changelog.yaml
|
||||||
|
|||||||
@ -25,6 +25,7 @@ public class TypeProvider {
|
|||||||
type.setAddToDictionaryAction(true);
|
type.setAddToDictionaryAction(true);
|
||||||
type.setHexColor("#dddddd");
|
type.setHexColor("#dddddd");
|
||||||
type.setRecommendationHexColor("#aaaaaa");
|
type.setRecommendationHexColor("#aaaaaa");
|
||||||
|
type.setSkippedHexColor("#aaaaaa");
|
||||||
type.setHint(false);
|
type.setHint(false);
|
||||||
type.setRank(100);
|
type.setRank(100);
|
||||||
type.setRecommendation(false);
|
type.setRecommendation(false);
|
||||||
|
|||||||
@ -42,6 +42,7 @@ public class DictionaryTest extends AbstractPersistenceServerServiceTest {
|
|||||||
var dossierTemplate = dossierTemplateTesterAndProvider.provideTestTemplate();
|
var dossierTemplate = dossierTemplateTesterAndProvider.provideTestTemplate();
|
||||||
var type = typeProvider.testAndProvideType(dossierTemplate);
|
var type = typeProvider.testAndProvideType(dossierTemplate);
|
||||||
assertThat(type.getRecommendationHexColor()).isEqualTo("#aaaaaa");
|
assertThat(type.getRecommendationHexColor()).isEqualTo("#aaaaaa");
|
||||||
|
assertThat(type.getSkippedHexColor()).isEqualTo("#aaaaaa");
|
||||||
|
|
||||||
dictionaryClient.addEntries(type.getTypeId(), List.of("word1", "word2"), false, false, DictionaryEntryType.ENTRY);
|
dictionaryClient.addEntries(type.getTypeId(), List.of("word1", "word2"), false, false, DictionaryEntryType.ENTRY);
|
||||||
dictionaryClient.addEntries(type.getTypeId(), List.of("false_positive1", "false_positive"), false, false, DictionaryEntryType.FALSE_POSITIVE);
|
dictionaryClient.addEntries(type.getTypeId(), List.of("false_positive1", "false_positive"), false, false, DictionaryEntryType.FALSE_POSITIVE);
|
||||||
|
|||||||
@ -124,6 +124,7 @@ public class DossierTemplateTest extends AbstractPersistenceServerServiceTest {
|
|||||||
.dossierTemplateId(dossierTemplate.getId())
|
.dossierTemplateId(dossierTemplate.getId())
|
||||||
.hexColor("#ddddd")
|
.hexColor("#ddddd")
|
||||||
.recommendationHexColor("#cccccc")
|
.recommendationHexColor("#cccccc")
|
||||||
|
.skippedHexColor("#cccccc")
|
||||||
.rank(999)
|
.rank(999)
|
||||||
.isHint(false)
|
.isHint(false)
|
||||||
.isRecommendation(false)
|
.isRecommendation(false)
|
||||||
@ -144,6 +145,7 @@ public class DossierTemplateTest extends AbstractPersistenceServerServiceTest {
|
|||||||
.dossierTemplateId(dossierTemplate.getId())
|
.dossierTemplateId(dossierTemplate.getId())
|
||||||
.hexColor("#12345")
|
.hexColor("#12345")
|
||||||
.recommendationHexColor("#6789a")
|
.recommendationHexColor("#6789a")
|
||||||
|
.skippedHexColor("#6789a")
|
||||||
.rank(1002)
|
.rank(1002)
|
||||||
.isHint(false)
|
.isHint(false)
|
||||||
.isRecommendation(false)
|
.isRecommendation(false)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user