| 
90 | 90 | import life.qbic.projectmanagement.application.ProjectOverview.UserInfo;  | 
91 | 91 | import life.qbic.projectmanagement.application.api.AsyncProjectService;  | 
92 | 92 | import life.qbic.projectmanagement.application.api.AsyncProjectService.AccessDeniedException;  | 
93 |  | -import life.qbic.projectmanagement.application.api.AsyncProjectService.FundingDeletion;  | 
94 | 93 | import life.qbic.projectmanagement.application.api.AsyncProjectService.FundingInformation;  | 
95 | 94 | import life.qbic.projectmanagement.application.api.AsyncProjectService.FundingInformationCreationRequest;  | 
96 | 95 | import life.qbic.projectmanagement.application.api.AsyncProjectService.FundingInformationCreationResponse;  | 
 | 
103 | 102 | import life.qbic.projectmanagement.application.api.AsyncProjectService.ProjectDeletionResponse;  | 
104 | 103 | import life.qbic.projectmanagement.application.api.AsyncProjectService.ProjectManager;  | 
105 | 104 | import life.qbic.projectmanagement.application.api.AsyncProjectService.ProjectResponsible;  | 
106 |  | -import life.qbic.projectmanagement.application.api.AsyncProjectService.ProjectResponsibleDeletion;  | 
107 | 105 | import life.qbic.projectmanagement.application.api.AsyncProjectService.ProjectResponsibleDeletionRequest;  | 
108 | 106 | import life.qbic.projectmanagement.application.api.AsyncProjectService.ProjectResponsibleDeletionResponse;  | 
109 | 107 | import life.qbic.projectmanagement.application.api.AsyncProjectService.ProjectUpdateRequest;  | 
 | 
114 | 112 | import life.qbic.projectmanagement.application.experiment.ExperimentInformationService;  | 
115 | 113 | import life.qbic.projectmanagement.domain.model.experiment.Experiment;  | 
116 | 114 | import life.qbic.projectmanagement.domain.model.project.Contact;  | 
 | 115 | +import life.qbic.projectmanagement.domain.model.project.Contact.OidcInformation;  | 
117 | 116 | import life.qbic.projectmanagement.domain.model.project.Project;  | 
118 | 117 | import life.qbic.projectmanagement.domain.model.project.ProjectCode;  | 
119 | 118 | import life.qbic.projectmanagement.domain.model.project.ProjectId;  | 
@@ -227,7 +226,8 @@ private static ProjectInformation convertToInfo(Project project) {  | 
227 | 226 | 
 
  | 
228 | 227 |   private static life.qbic.datamanager.views.general.contact.Contact convert(Contact contact) {  | 
229 | 228 |     return new life.qbic.datamanager.views.general.contact.Contact(contact.fullName(),  | 
230 |  | -        contact.emailAddress(), contact.oidc(), contact.oidcIssuer());  | 
 | 229 | +        contact.emailAddress(), contact.oidcInformation().map(OidcInformation::oidcId).orElse(null),  | 
 | 230 | +        contact.oidcInformation().map(OidcInformation::oidcIssuer).orElse(null));  | 
231 | 231 |   }  | 
232 | 232 | 
 
  | 
233 | 233 |   private static Button createButtonWithListener(String label,  | 
@@ -463,20 +463,19 @@ private Div renderContactInfo(Contact contact) {  | 
463 | 463 |     var email = new Anchor("mailto:" + contact.emailAddress(), contact.emailAddress());  | 
464 | 464 |     contactInfo.add(name, email);  | 
465 | 465 |     //Account for contacts without oidc or oidcissuer set  | 
466 |  | -    if (contact.oidc() == null || contact.oidcIssuer() == null) {  | 
 | 466 | +    if (contact.oidcInformation().isEmpty()) {  | 
467 | 467 |       return contactInfo;  | 
468 | 468 |     }  | 
469 |  | -    if (contact.oidcIssuer().isEmpty() || contact.oidc().isEmpty()) {  | 
470 |  | -      return contactInfo;  | 
471 |  | -    }  | 
472 |  | -    var oidcType = Arrays.stream(OidcType.values())  | 
473 |  | -        .filter(ot -> ot.getIssuer().equals(contact.oidcIssuer()))  | 
 | 469 | +    OidcInformation oidcInformation = contact.oidcInformation().orElseThrow();  | 
 | 470 | +    var optionalOidcType = Arrays.stream(OidcType.values())  | 
 | 471 | +        .filter(ot -> ot.getIssuer().equals(oidcInformation.oidcIssuer()))  | 
474 | 472 |         .findFirst();  | 
475 |  | -    if (oidcType.isPresent()) {  | 
476 |  | -      String oidcUrl = oidcType.get().getUrlFor(contact.oidc());  | 
477 |  | -      Anchor oidcLink = new Anchor(oidcUrl, contact.oidc());  | 
 | 473 | +    if (optionalOidcType.isPresent()) {  | 
 | 474 | +      OidcType oidcType = optionalOidcType.orElseThrow();  | 
 | 475 | +      String oidcUrl = oidcType.getUrlFor(oidcInformation.oidcId());  | 
 | 476 | +      Anchor oidcLink = new Anchor(oidcUrl, oidcInformation.oidcId());  | 
478 | 477 |       oidcLink.setTarget(AnchorTarget.BLANK);  | 
479 |  | -      OidcLogo oidcLogo = new OidcLogo(oidcType.get());  | 
 | 478 | +      OidcLogo oidcLogo = new OidcLogo(oidcType);  | 
480 | 479 |       Span oidcSpan = new Span(oidcLogo, oidcLink);  | 
481 | 480 |       oidcSpan.addClassNames("gap-02", "flex-align-items-center", "flex-horizontal");  | 
482 | 481 |       contactInfo.add(oidcSpan);  | 
 | 
0 commit comments