Commit 88b8f175 authored by Hando Lukats's avatar Hando Lukats
Browse files

TEIS-2394 implemented changes from testing

parent 334df4fa
......@@ -44,7 +44,8 @@ public class RiskAssessmentPDFComposeService {
}
public RiskFactorPdfDto composeRiskFactorPdfDto(String name, String impact, String explanation) {
impact = removeMarkdown(impact);
explanation = removeMarkdown(explanation);
return RiskFactorPdfDto.builder()
.name(name)
.description(impact)
......@@ -52,6 +53,14 @@ public class RiskAssessmentPDFComposeService {
.build();
}
public String removeMarkdown(String string) {
if (string == null) {
return null;
}
String pattern = "(.*) (\\[([a-zA-Z]*)\\]\\?\\([0-9]*\\))(.)";
return string.replaceAll(pattern, "$1 $3$4");
}
public RiskIndicatorPdfDto composeRiskIndicator(RiskStatementAssessmentPdfDto riskStatementAssessment,
RequestMetaDTO requestMetaDTO) {
List<RiskIndicatorValuesPdfDto> riskIndicatorList = new ArrayList<>();
......
......@@ -174,13 +174,13 @@ public class RiskAssessmentPDFService {
RiskStatementAssessmentPdfDto riskStatementAssessmentPdfDto, String status) {
if (riskStatementAssessment.getRiskStatementId() != null) {
RiskStatementEntity riskStatement = riskStatementDataService.getCurrentById(riskStatementAssessment.getRiskStatementId());
riskStatementAssessmentPdfDto.setDetailedDescription(riskStatement.getDetailedDescription());
riskStatementAssessmentPdfDto.setShortDescription(riskStatement.getBriefDescription());
riskStatementAssessmentPdfDto.setDetailedDescription(pdfComposeService.removeMarkdown(riskStatement.getDetailedDescription()));
riskStatementAssessmentPdfDto.setShortDescription(pdfComposeService.removeMarkdown(riskStatement.getBriefDescription()));
} else {
riskStatementAssessmentPdfDto.setShortDescription(riskStatementAssessment.getDescription());
riskStatementAssessmentPdfDto.setShortDescription(pdfComposeService.removeMarkdown(riskStatementAssessment.getDescription()));
}
if (status.equals(NO_ACTION_NEEDED)) {
riskStatementAssessmentPdfDto.setNoActionReason(riskStatementAssessment.getNoActionReason());
riskStatementAssessmentPdfDto.setNoActionReason(pdfComposeService.removeMarkdown(riskStatementAssessment.getNoActionReason()));
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment