-
Notifications
You must be signed in to change notification settings - Fork 0
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 (#707) * Provide specifications in user context to enable filtering by full name user name and orcid * Extend userinfo with optional orcid if provided during registration * Update add collaborator UI to show orcid, full name and filtering of the new values * Overhaul UI and ProjectAccessComponentgrid * Add confirm notification if a project user is to be removed * ƒilter for oidc instead of orcid specifically * Update userinfo to also contain oidc issuer * Show oidc link as specified by orcId and generalize it so multiple oidc could be shown * Update css to use oidc instead of orcid * User to userinformation conversion provides oidc issuer * Extract oidcLogo and oidctype to make it reusable * LoginLayout employs extracted oidc logo * Provide javadocs for OidcLogo and extract duplicate css into singular default value for oidc logo * Move OidcLogo and OidcType into general components and adjust width for user access grid * Adjust enum naming scheme to adhere to programmatic standard * Allow filtering of oidcissuer as well within add collaborator dialog * Don't throw an exception if unknown oidc is provided and seperate setting of Oidc with generation of Info item * Fix measurement spacing * Remove controls if user doesn't have access * Adapt frontend cell and create grid via method instead of modifying it * Remove unnecessary semicolon * Add private final to header object * Employ same Div for selection and showing user info * Update CSS according to SP recommendations --------- Co-authored-by: Tobias Koch <[email protected]>
- Loading branch information
1 parent
3225958
commit 5437054
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.