From 4b0e758e491fbcf12b1c4a88478d54cbde07c392 Mon Sep 17 00:00:00 2001 From: Reto Wettstein Date: Fri, 6 Oct 2023 18:47:07 +0200 Subject: [PATCH] word-wrap for rows, no empty a-tags --- .../adapter/SearchBundleHtmlGenerator.java | 56 ++++++++++--------- .../src/main/resources/static/dsf.css | 1 + 2 files changed, 32 insertions(+), 25 deletions(-) diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/dev/dsf/fhir/adapter/SearchBundleHtmlGenerator.java b/dsf-fhir/dsf-fhir-server/src/main/java/dev/dsf/fhir/adapter/SearchBundleHtmlGenerator.java index 794218a3e..51c7e5a10 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/java/dev/dsf/fhir/adapter/SearchBundleHtmlGenerator.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/dev/dsf/fhir/adapter/SearchBundleHtmlGenerator.java @@ -331,17 +331,18 @@ private String getOrganizationRow(Organization resource) String name = resource.getName() != null ? resource.getName() : ""; - String endpointId = "", endpointHref = ""; + String endpointLink = ""; if (resource.hasEndpoint()) { - endpointId = resource.getEndpointFirstRep().getReferenceElement().getIdPart(); - endpointHref = endpointResourcePath + "/" + endpointId; + String endpointId = resource.getEndpointFirstRep().getReferenceElement().getIdPart(); + String endpointHref = endpointResourcePath + "/" + endpointId; + endpointLink = "" + endpointId + "" + + (resource.getEndpoint().size() > 1 ? ", ..." : ""); } return "" + id + "" + resource.getActive() + "" + identifier + "" + name - + "" + endpointId + "" - + (resource.getEndpoint().size() > 1 ? ", ..." : "") + "" + + "" + endpointLink + "" + DATE_TIME_DISPLAY_FORMAT.format(resource.getMeta().getLastUpdated()) + ""; } @@ -350,37 +351,41 @@ private String getOrganizationAffiliationRow(OrganizationAffiliation resource) String id = resource.getIdElement().getIdPart(); String idHref = organizationResourcePath + "/" + id; - String parentOrganizationId = "", parentOrganizationHref = ""; + String parentOrganizationLink = ""; if (resource.hasOrganization()) { - parentOrganizationId = resource.getOrganization().getReferenceElement().getIdPart(); - parentOrganizationHref = organizationResourcePath + "/" + parentOrganizationId; + String parentOrganizationId = resource.getOrganization().getReferenceElement().getIdPart(); + String parentOrganizationHref = organizationResourcePath + "/" + parentOrganizationId; + parentOrganizationLink = "" + parentOrganizationId + ""; } - String participatingOrganizationId = "", participatingOrganizationHref = ""; + String participatingOrganizationLink = ""; if (resource.hasParticipatingOrganization()) { - participatingOrganizationId = resource.getParticipatingOrganization().getReferenceElement().getIdPart(); - participatingOrganizationHref = organizationResourcePath + "/" + participatingOrganizationId; + String participatingOrganizationId = resource.getParticipatingOrganization().getReferenceElement() + .getIdPart(); + String participatingOrganizationHref = organizationResourcePath + "/" + participatingOrganizationId; + participatingOrganizationLink = "" + + participatingOrganizationId + ""; } String role = resource.getCode().stream().flatMap(c -> c.getCoding().stream()) .filter(c -> CODE_SYSTEM_ORGANIZATION_ROLE.equals(c.getSystem())).map(Coding::getCode) .collect(Collectors.joining(", ")); - String endpointId = "", endpointHref = ""; + String endpointLink = ""; if (resource.hasEndpoint()) { - endpointId = resource.getEndpointFirstRep().getReferenceElement().getIdPart(); - endpointHref = endpointResourcePath + "/" + endpointId; + String endpointId = resource.getEndpointFirstRep().getReferenceElement().getIdPart(); + String endpointHref = endpointResourcePath + "/" + endpointId; + endpointLink = "" + endpointId + "" + + (resource.getEndpoint().size() > 1 ? ", ..." : ""); } return "" + id - + "" + resource.getActive() + "" + parentOrganizationId + "" + participatingOrganizationId + "" + role - + "" + endpointId + "" - + (resource.getEndpoint().size() > 1 ? ", ..." : "") + "" + + "" + resource.getActive() + "" + parentOrganizationLink + + "" + participatingOrganizationLink + "" + role + + "" + endpointLink + "" + DATE_TIME_DISPLAY_FORMAT.format(resource.getMeta().getLastUpdated()) + ""; } @@ -398,17 +403,18 @@ private String getEndpointRow(Endpoint resource) String name = resource.getName() != null ? resource.getName() : ""; - String managingOrganizationId = "", managingOrganizationHref = ""; + String managingOrganizationLink = ""; if (resource.hasManagingOrganization()) { - managingOrganizationId = resource.getManagingOrganization().getReferenceElement().getIdPart(); - managingOrganizationHref = organizationResourcePath + "/" + managingOrganizationId; + String managingOrganizationId = resource.getManagingOrganization().getReferenceElement().getIdPart(); + String managingOrganizationHref = organizationResourcePath + "/" + managingOrganizationId; + managingOrganizationLink = "" + managingOrganizationId + + ""; } return "" + id + "" + resource.getStatus().toCode() + "" + identifier + "" + name - + "" + resource.getAddress() + "" + managingOrganizationId + "" - + DATE_TIME_DISPLAY_FORMAT.format(resource.getMeta().getLastUpdated()) + ""; + + "" + resource.getAddress() + "" + managingOrganizationLink + + "" + DATE_TIME_DISPLAY_FORMAT.format(resource.getMeta().getLastUpdated()) + ""; } } diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/static/dsf.css b/dsf-fhir/dsf-fhir-server/src/main/resources/static/dsf.css index 7def18ec3..fca172087 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/static/dsf.css +++ b/dsf-fhir/dsf-fhir-server/src/main/resources/static/dsf.css @@ -501,6 +501,7 @@ pre.lang-html { .row-text, .row-text>a:visited { color: var(--color-disabled-text); + word-wrap: break-word; } .row-text.id-value {