Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1078,6 +1078,16 @@ public String getDisplayName() {
return CredentialsNameProvider.name(credentials);
}

/**
* Description is useful for select drop down in the name but not in the credentials list.
* So remove the description so we have more control over how its displayed.
*/
@Restricted(NoExternalUse.class)
@SuppressWarnings("unused") // jelly
public String getCleanedName() throws IOException {
return getDisplayName().replace("(" + getDescription() + ")", "");
}

/**
* Gets the display name of the {@link CredentialsDescriptor}.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,16 @@ public String getName() {
return CredentialsNameProvider.name(credentials);
}

/**
* Description is useful for select drop down in the name but not in the credentials list.
* So remove the description so we have more control over how its displayed.
*/
@Restricted(NoExternalUse.class)
@SuppressWarnings("unused") // jelly
public String getCleanedName() throws IOException {
return getName().replace("(" + getDescription() + ")", "");
}

/**
* Returns the {@link StandardCredentials#getDescription()} of the {@link #credentials}.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,17 +99,20 @@
<div class="credentials-card__inner">
<div class="credentials-card__title">
<l:icon class="${c.iconClassName}" tooltip="${c.typeName}"/>
<a href="credential/${c.urlName}">${c.displayName}</a>
</div>
<a href="credential/${c.urlName}">${c.id}</a>

<div class="credentials-card__details">
<span>${c.id}</span>
<j:if test="${!empty(safeDescription)}">
<span>-</span>
<span>${safeDescription}</span>
<j:set var="name" value="${c.cleanedName}"/>
<j:if test="${name ne null and name ne c.id and name ne c.description}">
<span class="credentials-card__tags">${name}</span>
</j:if>
</div>

<j:if test="${!empty(safeDescription)}">
<div class="credentials-card__details">
<span>${safeDescription}</span>
</div>
</j:if>

</div>
<div class="credentials-card__controls">
<j:if test="${h.hasPermission(c, it.parent.UPDATE)}">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,12 @@
<div class="credentials-card__title">
<l:icon class="${d.iconClassName}" tooltip="${d.kind}"/>
<a href="${(storeAction==null?d.store.getRelativeLinkTo(d.domain):d.store.relativeLinkToContext+'credentials/store/'+storeAction.urlName+'/'+d.domain.url)+'credential/'+d.id}">
${d.name}
${d.id}
</a>
<j:set var="name" value="${d.cleanedName}"/>
<j:if test="${name ne null and name ne d.id and name ne d.description}">
<span class="credentials-card__tags">${name}</span>
</j:if>
</div>
<div class="credentials-card__details">
<a href="${storeAction==null?d.store.relativeLinkToAction:d.store.relativeLinkToContext+'credentials/store/'+storeAction.urlName}">
Expand All @@ -138,8 +142,6 @@
</j:otherwise>
</j:choose>
</a>
<span>-</span>
${d.id}
<j:if test="${!empty(safeDescription)}">
<span>-</span>
${safeDescription}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,16 @@

.credentials-card__inner {
padding: 0.75rem 1rem;
display: flex;
flex-direction: column;
justify-content: center;
min-height: 3.5rem;
Comment on lines +43 to +46
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on the store page the description can be empty which didn't look great, this centres the title if there's no description. It also ensures that all the cards are the same size even if there's no description.

Without this change:
image

}

.credentials-card__inner--split {
display: grid;
grid-template-columns: 350px 1fr;
min-height: unset;
}

.credentials-card__details {
Expand Down
Loading