Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refine content and appearance of the user account screen #9521

Merged
merged 13 commits into from
Sep 16, 2024
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
5 changes: 5 additions & 0 deletions core/src/main/java/hudson/model/TimeZoneProperty.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ public String getDisplayName() {
return Messages.TimeZoneProperty_DisplayName();
}

@Override
public String getDescription() {
return Messages.TimeZoneProperty_Description();
}

@Override
public UserProperty newInstance(User user) {
return new TimeZoneProperty();
Expand Down
12 changes: 12 additions & 0 deletions core/src/main/java/hudson/model/UserPropertyDescriptor.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

import edu.umd.cs.findbugs.annotations.CheckForNull;
import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.Nullable;
import hudson.model.userproperty.UserPropertyCategory;
import java.util.Optional;
import org.jenkinsci.Symbol;
Expand Down Expand Up @@ -126,4 +127,15 @@ public boolean isEnabled() {
protected @CheckForNull String getUserPropertyCategoryAsString() {
return null;
}

/**
* Optional description for the configurable object
* Displays as plain text
*
* @since TODO
*/
@Nullable
public String getDescription() {
return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@
return Messages.consoleUrlProviderDisplayName();
}

@Override
public String getDescription() {
return Messages.consoleUrlProviderDisplayName_Description();

Check warning on line 70 in core/src/main/java/jenkins/console/ConsoleUrlProviderUserProperty.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered line

Line 70 is not covered by tests
}

@Override
public UserProperty newInstance(User user) {
return new ConsoleUrlProviderUserProperty();
Expand Down
3 changes: 2 additions & 1 deletion core/src/main/resources/hudson/model/Messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,8 @@ Jenkins.IsRestarting=Jenkins is restarting
User.IllegalUsername="{0}" is prohibited as a username for security reasons.
User.IllegalFullname="{0}" is prohibited as a full name for security reasons.

TimeZoneProperty.DisplayName=User Defined Time Zone
TimeZoneProperty.DisplayName=Time zone
TimeZoneProperty.Description=Select a time zone to use rather than the system default
TimeZoneProperty.DisplayDefaultTimeZone=Default
TimeZoneProperty.current_time_in_=Current time in {0}: {1}
TimeZoneProperty.current_time_on_server_in_in_proposed_di=Current time on server in {0}: {1}; in proposed display zone: {2}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ THE SOFTWARE.

<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
<f:entry field="timeZoneName" title="${%title}">
<f:entry field="timeZoneName">
<f:select />
</f:entry>
</j:jelly>

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ THE SOFTWARE.
<l:layout permission="${app.ADMINISTER}" title="${%title}">
<st:include page="sidepanel.jelly" it="${it.targetUser}" />
<l:main-panel>
<f:form method="post" action="configSubmit" name="config">
<f:form method="post" action="configSubmit" name="config" class="jenkins-form">
<h1>
${%title}
</h1>
Expand All @@ -39,18 +39,20 @@ THE SOFTWARE.
<j:set var="it" value="${thisAction.targetUser}" />
<j:set var="instance" value="${it}"/>

<f:entry title="${%Full name}" help="/help/user/fullName.html">
<f:textbox field="fullName" />
</f:entry>
<f:entry title="${%Description}" help="/help/user/description.html">
<f:textarea field="description" codemirror-mode="${app.markupFormatter.codeMirrorMode}" codemirror-config="${app.markupFormatter.codeMirrorConfig}" previewEndpoint="/markupFormatter/previewDescription" />
</f:entry>
<f:section>
<f:entry title="${%Full name}" description="${%Full name.Description}">
<f:textbox field="fullName" />
</f:entry>
<f:entry title="${%Description}" description="${%Description.Description}">
<f:textarea field="description" codemirror-mode="${app.markupFormatter.codeMirrorMode}" codemirror-config="${app.markupFormatter.codeMirrorConfig}" previewEndpoint="/markupFormatter/previewDescription" />
</f:entry>
</f:section>

<j:set var="descriptors" value="${thisAction.myCategoryDescriptors}" />
<j:set var="instances" value="${it.properties}" />
<j:forEach var="d" items="${descriptors}" varStatus="loop">
<j:if test="${d.enabled}">
<f:section title="${d.displayName}">
<f:section title="${d.displayName}" description="${d.description}">
<j:set var="descriptor" value="${d}" />
<j:set var="instance" value="${instances[d]}" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,7 @@
# THE SOFTWARE.

title=Account
Full\ name=Full Name
Full\ name=Full name
Full\ name.Description=We recommend using your real name so people can recognize you instead of your ID
Description=Description
Description.Description=Enter a short description about yourself so that visitors know who you are
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
<!-- Dummy field to always have an entry in form submissions so users can delete all providers. -->
<f:checkbox field="unused" checked="true" />
</f:invisibleEntry>
<f:block>
${%description}
</f:block>
<f:entry>
<f:repeatableHeteroProperty field="providers" hasHeader="true" oneEach="true" header="${%Providers}" />
</f:entry>
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
consoleUrlProviderDisplayName=Console URL Provider
consoleUrlProviderDisplayName.Description=Select which view you want to use for build console links. Views listed higher will be prioritized over those listed lower. The views you choose here will be used rather than those set by administrators.
defaultProviderDisplayName=Default
8 changes: 8 additions & 0 deletions core/src/main/resources/lib/form/section.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ THE SOFTWARE.
If null is given, the entire <f:section> tag becomes no-op.
]]>
</st:attribute>
<st:attribute name="description" since="TODO">
Optional attribute to set a description for the section
</st:attribute>
<st:attribute name="icon">
Optional attribute to set an icon for the section, this is only visible when using section-to-sidebar-items.js
</st:attribute>
Expand All @@ -50,6 +53,11 @@ THE SOFTWARE.
${attrs.title}
</div>
</j:if>
<j:if test="${attrs.description != null}">
<div class="jenkins-section__description">
${attrs.description}
</div>
</j:if>
<d:invokeBody />
</section>
</f:rowSet>
Expand Down
7 changes: 7 additions & 0 deletions war/src/main/scss/components/_section.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@
font-weight: 500;
}

.jenkins-section__description {
// Tweaked margin so that it appears visually centred when placed next to `.jenkins-section__title`
margin: -0.5rem 0 1rem;
color: var(--text-color-secondary);
line-height: 1.66;
}

.jenkins-section__items {
display: grid;
grid-template-columns: 1fr;
Expand Down
5 changes: 0 additions & 5 deletions war/src/main/webapp/help/user/description.html

This file was deleted.

6 changes: 0 additions & 6 deletions war/src/main/webapp/help/user/description_bg.html

This file was deleted.

6 changes: 0 additions & 6 deletions war/src/main/webapp/help/user/description_de.html

This file was deleted.

5 changes: 0 additions & 5 deletions war/src/main/webapp/help/user/description_fr.html

This file was deleted.

7 changes: 0 additions & 7 deletions war/src/main/webapp/help/user/description_it.html

This file was deleted.

4 changes: 0 additions & 4 deletions war/src/main/webapp/help/user/description_ja.html

This file was deleted.

7 changes: 0 additions & 7 deletions war/src/main/webapp/help/user/description_nl.html

This file was deleted.

6 changes: 0 additions & 6 deletions war/src/main/webapp/help/user/description_pt_BR.html

This file was deleted.

5 changes: 0 additions & 5 deletions war/src/main/webapp/help/user/description_ru.html

This file was deleted.

Loading
Loading