-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Users full name and orcid is shown and filterable during the addition…
… of collaborators to a project (#774) --------- Co-authored-by: Steffengreiner <[email protected]> Co-authored-by: Tobias Koch <[email protected]> Co-authored-by: wow-such-code <[email protected]> Co-authored-by: Steffengreiner <[email protected]>
- Loading branch information
1 parent
a63d57e
commit 3944e95
Showing
20 changed files
with
461 additions
and
162 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
user-interface/frontend/themes/datamanager/components/image.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,14 @@ | ||
img.clickable { | ||
cursor: pointer; | ||
} | ||
|
||
/*Default height and width for the oidc logo */ | ||
.oidc-logo { | ||
width: var(--lumo-icon-size-m); | ||
height: var(--lumo-icon-size-m); | ||
} | ||
|
||
.size-small { | ||
width: var(--lumo-icon-size-s); | ||
height: var(--lumo-icon-size-s); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
user-interface/src/main/java/life/qbic/datamanager/views/general/oidc/OidcLogo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package life.qbic.datamanager.views.general.oidc; | ||
|
||
import com.vaadin.flow.component.html.Image; | ||
import com.vaadin.flow.server.AbstractStreamResource; | ||
import com.vaadin.flow.server.StreamResource; | ||
|
||
/** | ||
* OidcLogo shown within the data manager application. | ||
* Logo source and image path is based on the information provided within the {@link OidcType} | ||
*/ | ||
public class OidcLogo extends Image { | ||
|
||
private final OidcType oidcType; | ||
|
||
public OidcLogo(OidcType oidcType) { | ||
this.oidcType = oidcType; | ||
addClassName("oidc-logo"); | ||
setSrc(getLogoResource()); | ||
} | ||
|
||
private AbstractStreamResource getLogoResource() { | ||
String oidcLogoSrc = oidcType.getLogoPath(); | ||
//Image source cannot contain a "/" so we look for the actual file name independent in which folder path it is contained. | ||
if (oidcLogoSrc.contains("/")) { | ||
oidcLogoSrc = oidcType.getLogoPath().substring(oidcType.getLogoPath().lastIndexOf('/') + 1); | ||
} | ||
return new StreamResource(oidcLogoSrc, | ||
() -> getClass().getClassLoader().getResourceAsStream(oidcType.getLogoPath())); | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
user-interface/src/main/java/life/qbic/datamanager/views/general/oidc/OidcType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package life.qbic.datamanager.views.general.oidc; | ||
|
||
/** | ||
* The Oidc Types enum contains the associated logo path, the issuer and the url of the | ||
* corresponding oidc a user has provided | ||
*/ | ||
public enum OidcType { | ||
ORCID("https://orcid.org", "login/orcid_logo.svg", "https://orcid.org/", "Orcid"), | ||
ORCID_SANDBOX("https://sandbox.orcid.org", "login/orcid_logo.svg", "https://sandbox.orcid.org/", | ||
"OrcId"); | ||
|
||
private final String issuer; | ||
private final String logoPath; | ||
private final String url; | ||
private final String name; | ||
|
||
OidcType(String issuer, String logoPath, String url, String name) { | ||
this.issuer = issuer; | ||
this.logoPath = logoPath; | ||
this.url = url; | ||
this.name = name; | ||
} | ||
|
||
public String getIssuer() { | ||
return issuer; | ||
} | ||
|
||
public String getLogoPath() { | ||
return logoPath; | ||
} | ||
|
||
public String getUrl() { | ||
return url; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
} |
Oops, something went wrong.