diff --git a/yoti-sdk-spring-boot-example/src/main/java/com/yoti/api/examples/springboot/attribute/AttributeDisplayProperty.java b/yoti-sdk-spring-boot-example/src/main/java/com/yoti/api/examples/springboot/attribute/AttributeDisplayProperty.java index 519f1f4f..80790f5b 100644 --- a/yoti-sdk-spring-boot-example/src/main/java/com/yoti/api/examples/springboot/attribute/AttributeDisplayProperty.java +++ b/yoti-sdk-spring-boot-example/src/main/java/com/yoti/api/examples/springboot/attribute/AttributeDisplayProperty.java @@ -5,7 +5,7 @@ import com.yoti.api.client.Attribute; -enum AttributeDisplayProperty { +public enum AttributeDisplayProperty { FAMILY_NAME("family_name", "Family name", "yoti-icon-profile"), GIVEN_NAMES("given_names", "Given names", "yoti-icon-profile"), @@ -16,7 +16,6 @@ enum AttributeDisplayProperty { STRUCTURED_POSTAL_ADDRESS("structured_postal_address", "Structured address", "yoti-icon-address"), NATIONALITY("nationality", "Nationality", "yoti-icon-nationality"), PHONE_NUMBER("phone_number", "Mobile number", "yoti-icon-phone"), - SELFIE("selfie"), EMAIL_ADDRESS("email_address", "Email address", "yoti-icon-email"), IDENTITY_PROFILE_REPORT("identity_profile_report", "Identity Profile Report", "yoti-icon-document", true); @@ -25,13 +24,6 @@ enum AttributeDisplayProperty { private final String icon; private final boolean isJson; - AttributeDisplayProperty(String name) { - this.name = name; - label = null; - icon = null; - isJson = false; - } - AttributeDisplayProperty(String name, String label, String icon) { this.name = name; this.label = label; diff --git a/yoti-sdk-spring-boot-example/src/main/java/com/yoti/api/examples/springboot/attribute/AttributeMapper.java b/yoti-sdk-spring-boot-example/src/main/java/com/yoti/api/examples/springboot/attribute/AttributeMapper.java index 1fc9bf11..e9bfc3d0 100644 --- a/yoti-sdk-spring-boot-example/src/main/java/com/yoti/api/examples/springboot/attribute/AttributeMapper.java +++ b/yoti-sdk-spring-boot-example/src/main/java/com/yoti/api/examples/springboot/attribute/AttributeMapper.java @@ -13,9 +13,9 @@ public class AttributeMapper { public static DisplayAttribute mapToDisplayAttribute(Attribute> attribute) { return AttributeDisplayProperty.fromAttribute(attribute) - .map(displayProperty -> !displayProperty.isJson() - ? new DisplayAttribute(attribute, displayProperty) - : new DisplayAttribute(toJson(attribute), displayProperty) + .map(property -> property.isJson() + ? new DisplayAttribute(toJson(attribute), property) + : new DisplayAttribute(attribute, property) ) .orElseGet(() -> { if (attribute.getName().contains(":")) { @@ -43,8 +43,9 @@ private static DisplayAttribute handleAgeVerification(Attribute> attribute) { } private static DisplayAttribute handleProfileAttribute(Attribute> attribute) { - String attributeName = StringUtils.capitalize(attribute.getName()); - return new DisplayAttribute(attributeName, attribute, "yoti-icon-profile"); + return attribute.getName().equalsIgnoreCase("selfie") + ? null + : new DisplayAttribute(StringUtils.capitalize(attribute.getName()), attribute, "yoti-icon-profile"); } } diff --git a/yoti-sdk-spring-boot-example/src/main/resources/templates/digital-identity-share.html b/yoti-sdk-spring-boot-example/src/main/resources/templates/digital-identity-share.html index 0147991c..da290f70 100644 --- a/yoti-sdk-spring-boot-example/src/main/resources/templates/digital-identity-share.html +++ b/yoti-sdk-spring-boot-example/src/main/resources/templates/digital-identity-share.html @@ -63,7 +63,6 @@