Compare commits

...
Author SHA1 Message Date
Kevin Tumma 457cd731e4 Update .gitlab-ci.yml file 2024-03-04 14:36:47 +01:00
Andrei Isvoran e01931c1e9 test publish stuff 2024-03-01 15:33:43 +02:00
Andrei Isvoran 67a10bb7c2 test publish stuff 2024-03-01 15:32:14 +02:00
Andrei Isvoran 313df1e118 Merge branch 'RED-8586-dossier-redactions' into 'master'
RED-8586 - Don't treat dossier redactions differently

Closes RED-8586

See merge request redactmanager/redaction-service!302
2024-03-01 12:41:55 +01:00
Andrei Isvoran 24c1be66fd RED-8586 - Don't treat dossier redactions differently 2024-03-01 12:41:55 +01:00
Andrei Isvoran 0825686741 Merge branch 'RED-8586-fix' into 'master'
RED-8586 - Add higher salience to rule ETC.5.1

Closes RED-8586

See merge request redactmanager/redaction-service!299
2024-02-29 15:42:39 +01:00
Andrei Isvoran fd10d6e325 RED-8586 - Add higher salience to rule ETC.5.1 2024-02-29 16:28:33 +02:00
8 changed files with 36 additions and 21 deletions
+9
View File
@@ -21,3 +21,12 @@ deploy:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_COMMIT_BRANCH =~ /^release/
- if: $CI_COMMIT_TAG
pages:
stage: build
script:
- mkdir public
- mv redaction-service-v1/index.html public/
artifacts:
paths:
- public
+22
View File
@@ -0,0 +1,22 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Dummy Page</title>
</head>
<body>
<header>
<h1>Welcome to the Dummy Page</h1>
</header>
<main>
<section>
<p>This is a simple HTML page created as a placeholder or for testing purposes. You can add more content and styles to expand it.</p>
<a href="https://example.com">Visit Example</a>
</section>
</main>
<footer>
<p>&copy; 2024 Dummy Page. All rights reserved.</p>
</footer>
</body>
</html>
@@ -74,34 +74,13 @@ public class EntityChangeLogService {
.collect(Collectors.toSet());
List<EntityLogEntry> removedEntries = previousEntityLogEntries.stream()
.filter(entry -> !existingIds.contains(entry.getId()))
.collect(Collectors.toList());
List<EntityLogEntry> removedDossierRedaction = removedEntries.stream()
.filter(e -> e.getState() == EntryState.REMOVED && e.getType().equals("dossier_redaction"))
.toList();
previousEntityLogEntries.removeAll(removedDossierRedaction);
removedEntries.removeAll(removedDossierRedaction);
removedEntries.forEach(entry -> entry.getChanges().add(new Change(analysisNumber, ChangeType.REMOVED, now)));
removedEntries.forEach(entry -> entry.setState(EntryState.REMOVED));
removedEntries.forEach(entry -> addManualChangeForDictionaryRemovals(entry, manualRedactions));
newEntityLogEntries.addAll(removedEntries);
}
private void addManualChangeForDictionaryRemovals(EntityLogEntry entry, ManualRedactions manualRedactions) {
if (manualRedactions == null || manualRedactions.getIdsToRemove().isEmpty()) {
return;
}
manualRedactions.getIdsToRemove()
.stream()
.filter(IdRemoval::isRemoveFromDictionary)//
.filter(removed -> removed.getAnnotationId().equals(entry.getId()))//
.findFirst()//
.ifPresent(idRemove -> entry.getManualChanges().add(ManualChangeFactory.toManualChange(idRemove, false)));
}
private ChangeType calculateChangeType(EntryState state, EntryState previousState) {
if (state.equals(previousState)) {
@@ -702,6 +702,7 @@ rule "ETC.5.0: Skip dossier_redaction entries if confidentiality is 'confidentia
end
rule "ETC.5.1: Remove dossier_redaction entries if confidentiality is not 'confidential'"
salience 256
when
not FileAttribute(label == "Confidentiality", value == "confidential")
$dossierRedaction: TextEntity(type() == "dossier_redaction")
@@ -1160,6 +1160,7 @@ rule "ETC.5.0: Skip dossier_redaction entries if confidentiality is 'confidentia
end
rule "ETC.5.1: Remove dossier_redaction entries if confidentiality is not 'confidential'"
salience 256
when
not FileAttribute(label == "Confidentiality", value == "confidential")
$dossierRedaction: TextEntity(type() == "dossier_redaction")
@@ -812,6 +812,7 @@ rule "ETC.5.0: Skip dossier_redaction entries if confidentiality is 'confidentia
end
rule "ETC.5.1: Remove dossier_redaction entries if confidentiality is not 'confidential'"
salience 256
when
not FileAttribute(label == "Confidentiality", value == "confidential")
$dossierRedaction: TextEntity(type() == "dossier_redaction")
@@ -459,6 +459,7 @@ rule "ETC.5.0: Skip dossier_redaction entries if confidentiality is 'confidentia
end
rule "ETC.5.1: Remove dossier_redaction entries if confidentiality is not 'confidential'"
salience 256
when
not FileAttribute(label == "Confidentiality", value == "confidential")
$dossierRedaction: TextEntity(type() == "dossier_redaction")
@@ -1169,6 +1169,7 @@ rule "ETC.5.0: Skip dossier_redaction entries if confidentiality is 'confidentia
end
rule "ETC.5.1: Remove dossier_redaction entries if confidentiality is not 'confidential'"
salience 256
when
not FileAttribute(label == "Confidentiality", value == "confidential")
$dossierRedaction: TextEntity(type() == "dossier_redaction")