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

WIP: Button storybook #9675

Draft
wants to merge 53 commits into
base: ux-buttons-btn-unstyled-alignment-text
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
75bdee6
Removed css for btn-success, removed class btn-success from pages
bisht-richa Oct 2, 2024
a0f48b8
Replaced btn-success class
bisht-richa Oct 3, 2024
4e9b759
Removed btn-warning
bisht-richa Oct 7, 2024
aa9cc1f
Fixed btn-link use cases
bisht-richa Oct 10, 2024
061a494
Added btn-primary class to primary actions
bisht-richa Oct 11, 2024
3d558bd
Added btn class to Download CSV, clean code
bisht-richa Oct 15, 2024
459a7a3
Fixed lint and added changelog files
bisht-richa Oct 16, 2024
51cf541
Commit changes to license file
bisht-richa Nov 4, 2024
aa1faf1
changes to license fix
bisht-richa Nov 4, 2024
134735b
Fixed ToolbarTag components test
bisht-richa Nov 7, 2024
7c1a912
Fixed review comments, modify text in changelog file
bisht-richa Nov 14, 2024
187d18d
Changelog text update
bisht-richa Nov 14, 2024
3272c87
Fix lint
bisht-richa Nov 14, 2024
07ff4a8
Corrected changelog file name
bisht-richa Nov 18, 2024
44dbcbb
Removed css for btn-success, removed class btn-success from pages
bisht-richa Oct 2, 2024
71e1418
Fixed btn-link use cases
bisht-richa Oct 10, 2024
439644e
Fixed buttons label
bisht-richa Oct 25, 2024
1782f7f
Added btn-unstyled button style and modify button component
bisht-richa Oct 25, 2024
69107dd
Added inline icon button in My Account page and configuration channel…
bisht-richa Nov 4, 2024
fd670b9
Simplify buttons in DangerDialog, move buttons at the bottom of the …
bisht-richa Nov 7, 2024
86d25e9
Added buton class to a tag, clean up btn css, added unstyled button c…
bisht-richa Nov 18, 2024
dda782b
Clean up ode
bisht-richa Nov 18, 2024
4bf8420
Update submit buttons positions, label correction
bisht-richa Nov 25, 2024
22bc413
Merge Master
bisht-richa Nov 29, 2024
075e0cc
Fixed whitespace issue in java files, removed less files
bisht-richa Dec 3, 2024
8c78a1e
Fix lint
bisht-richa Dec 4, 2024
b214106
Reposition action and csv download buttons
bisht-richa Dec 6, 2024
8947a7b
Repositioning download CSV buttons, added edit buttons in system over…
bisht-richa Dec 16, 2024
c4c69d1
Fixed csv button in channel section
bisht-richa Dec 17, 2024
f8987dd
Added change log files
bisht-richa Dec 17, 2024
5d31f66
Fixed lint error
bisht-richa Dec 17, 2024
f90f80d
Fix lit issues, rever back select all buttons
bisht-richa Jan 3, 2025
0bc19ac
Fix failed tests
bisht-richa Jan 3, 2025
03e2471
Fix failed tests for links
bisht-richa Jan 3, 2025
525cf83
Fix test for action chain
bisht-richa Jan 8, 2025
ace7fec
More fixed for download CSV button and tests
bisht-richa Jan 9, 2025
10f092b
Fixed action chain secondary test
bisht-richa Jan 10, 2025
16a4072
Replaced btn-link class with btn-tertiary
bisht-richa Jan 14, 2025
1f829b0
Fixed lint
bisht-richa Jan 14, 2025
5241fc2
More fixes for button text, style
bisht-richa Jan 15, 2025
dfe8a97
Fixes in button css and labels
bisht-richa Jan 16, 2025
c4af9b0
Fix in tertiary but style
bisht-richa Jan 17, 2025
b6b2aa8
Fixed review comments, more fixes
bisht-richa Jan 22, 2025
035d0a2
Fixed lint
bisht-richa Jan 22, 2025
75c7f16
Fixed text user label
bisht-richa Jan 22, 2025
de457c3
Fixes in buttons css style
bisht-richa Jan 23, 2025
e3b5172
Removed icons from submit buttons, fixed disabled state for tertiary …
bisht-richa Jan 27, 2025
79e990f
Added guideline for button component
bisht-richa Jan 2, 2025
5ec8379
Added buttons examples
bisht-richa Jan 23, 2025
bdfbeca
Added tertiary button examples
bisht-richa Jan 23, 2025
ed5de8e
Added addtional button information
bisht-richa Jan 24, 2025
ddb2b79
Fix lint
bisht-richa Jan 24, 2025
9902cac
Added Best Practices for button lables
bisht-richa Jan 27, 2025
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 @@ -290,8 +290,8 @@
<context context-type="sourcefile">/rhn/users/Addresses</context>
</context-group>
</trans-unit>
<trans-unit id="Fill in this address" xml:space="preserve">
<source>Fill in this address</source>
<trans-unit id="Add address" xml:space="preserve">
<source>Add address</source>
<context-group name="ctx">
<context context-type="sourcefile">/rhn/users/Addresses</context>
</context-group>
Expand Down Expand Up @@ -526,8 +526,8 @@
<context context-type="sourcefile">Navigation Menu</context>
</context-group>
</trans-unit>
<trans-unit id="Edit this address" xml:space="preserve">
<source>Edit this address</source>
<trans-unit id="Edit" xml:space="preserve">
<source>Edit</source>
<context-group name="ctx">
<context context-type="sourcefile">/rhn/users/Addresses</context>
</context-group>
Expand Down Expand Up @@ -2170,7 +2170,7 @@ and try again.
</context-group>
</trans-unit>
<trans-unit id="toolbar.delete.snippets" xml:space="preserve">
<source>delete snippet</source>
<source>Delete Snippet</source>
<context-group name="ctx">
<context context-type="sourcefile">/rhn/kickstart/cobbler/CobblerSnippetEdit</context>
</context-group>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1868,7 +1868,7 @@ button below, and &lt;b&gt;will be unable to log back in&lt;/b&gt;.</source>
</context-group>
</trans-unit>
<trans-unit id="userdetails.jsp.noemailaddress" xml:space="preserve">
<source>No email address</source>
<source>Add Email Address</source>
<context-group name="ctx">
<context context-type="sourcefile">/rhn/users/UserDetails</context>
</context-group>
Expand Down Expand Up @@ -6345,13 +6345,13 @@ organization. You may grant or remove the organization administrator role in the
</context-group>
</trans-unit>
<trans-unit id="systems.groups.jsp.remove">
<source>Leave Selected Groups</source>
<source>Leave Groups</source>
<context-group name="ctx">
<context context-type="sourcefile">/rhn/systems/details/groups/* pages</context>
</context-group>
</trans-unit>
<trans-unit id="systems.groups.jsp.add">
<source>Join Selected Groups</source>
<source>Join Groups</source>
<context-group name="ctx">
<context context-type="sourcefile">/rhn/systems/details/groups/* pages</context>
</context-group>
Expand Down Expand Up @@ -6489,7 +6489,7 @@ organization. You may grant or remove the organization administrator role in the
</context-group>
</trans-unit>
<trans-unit id="systemgroup.details.editproperties">
<source>Edit These Properties</source>
<source>Edit System Group Properties</source>
<context-group name="ctx">
<context context-type="sourcefile">/rhn/systems/details/groups/* pages</context>
</context-group>
Expand Down Expand Up @@ -7261,7 +7261,7 @@ organization. You may grant or remove the organization administrator role in the
</context-group>
</trans-unit>
<trans-unit id="installpkgs.jsp.installpackages" xml:space="preserve">
<source>Install Selected Packages</source>
<source>Install Packages</source>
<context-group name="ctx">
<context context-type="sourcefile">/rhn/systems/details/packages/InstallPackages</context>
</context-group>
Expand Down Expand Up @@ -12287,7 +12287,7 @@ the &lt;strong&gt;@@ENTERPRISE_LINUX_NAME@@ System Administration Guide.&lt;/str
</context-group>
</trans-unit>
<trans-unit id="activation-key.groups.jsp.add">
<source>Join Selected Groups</source>
<source>Join Groups</source>
<context-group name="ctx">
<context context-type="sourcefile">/rhn/activationkeys/groups/* pages</context>
</context-group>
Expand Down Expand Up @@ -12711,13 +12711,13 @@ the &lt;strong&gt;@@ENTERPRISE_LINUX_NAME@@ System Administration Guide.&lt;/str
</context-group>
</trans-unit>
<trans-unit id="system.audit.listscap.jsp.removebut">
<source>Remove Selected Scans</source>
<source>Remove</source>
<context-group name="ctx">
<context context-type="sourcefile">View of SCAP scans for given system</context>
</context-group>
</trans-unit>
<trans-unit id="system.audit.listscap.jsp.diffbut">
<source>Compare Selected Scans</source>
<source>Compare</source>
<context-group name="ctx">
<context context-type="sourcefile">View of SCAP scans for given system</context>
</context-group>
Expand Down Expand Up @@ -13499,7 +13499,7 @@ the &lt;strong&gt;@@ENTERPRISE_LINUX_NAME@@ System Administration Guide.&lt;/str
</context-group>
</trans-unit>
<trans-unit id="system.event.pending.headerPending">
<source>You may cancel events for this system by selecting them and clicking the &lt;strong&gt;Cancel Selected Events&lt;/strong&gt; button.</source>
<source>You may cancel events for this system by selecting them and clicking the &lt;strong&gt;Cancel Events&lt;/strong&gt; button.</source>
<context-group name="ctx">
<context context-type="sourcefile">System Events Pages</context>
</context-group>
Expand All @@ -13517,7 +13517,7 @@ the &lt;strong&gt;@@ENTERPRISE_LINUX_NAME@@ System Administration Guide.&lt;/str
</context-group>
</trans-unit>
<trans-unit id="system.event.pending.cancel">
<source>Cancel Selected Events</source>
<source>Cancel Events</source>
<context-group name="ctx">
<context context-type="sourcefile">System Events Pages</context>
</context-group>
Expand Down Expand Up @@ -14761,7 +14761,7 @@ a file or files, or copy the latest version into a set of local overrides or int
</context-group>
</trans-unit>
<trans-unit id="channelfiles.jsp.removeselected" xml:space="preserve">
<source>Remove Selected Files</source>
<source>Remove Files</source>
<context-group name="ctx">
<context context-type="sourcefile">/rhn/configuration/ChannelFiles.do</context>
</context-group>
Expand Down Expand Up @@ -15674,7 +15674,7 @@ centrally-managed configuration channel, {2}; below is a list of systems you may
</context-group>
</trans-unit>
<trans-unit id="toolbar.delete.configfile" xml:space="preserve">
<source>Delete This File Revision</source>
<source>Delete</source>
<context-group name="ctx">
<context context-type="sourcefile">/rhn/configuration/file/FileDetails.do</context>
</context-group>
Expand All @@ -15686,7 +15686,7 @@ centrally-managed configuration channel, {2}; below is a list of systems you may
</context-group>
</trans-unit>
<trans-unit id="toolbar.delete.deletefile" xml:space="preserve">
<source>Delete This File</source>
<source>Delete</source>
<context-group name="ctx">
<context context-type="sourcefile">/rhn/configuration/file/FileDetails.do</context>
</context-group>
Expand Down Expand Up @@ -18765,14 +18765,14 @@ any of these revisions. Are you sure you want to do this?</source>
<trans-unit id="ssm.package.remove.select.summary">
<source>Packages listed below may be removed from one or more systems.

Select one or more and click the &lt;b&gt;Remove Selected Packages&lt;/b&gt; button to schedule package removal.
Select one or more and click the &lt;b&gt;Remove Packages&lt;/b&gt; button to schedule package removal.
</source>
<context-group name="ctx">
<context context-type="sourcefile">/rhn/ssm/PackageRemove.do</context>
</context-group>
</trans-unit>
<trans-unit id="ssm.package.remove.select.confirm">
<source>Remove Selected Packages</source>
<source>Remove Packages</source>
<context-group name="ctx">
<context context-type="sourcefile">/rhn/ssm/PackageRemove.do</context>
</context-group>
Expand Down Expand Up @@ -18830,7 +18830,7 @@ any of these revisions. Are you sure you want to do this?</source>
</context-group>
</trans-unit>
<trans-unit id="ssm.package.upgrade.select.confirm">
<source>Upgrade Selected Packages</source>
<source>Upgrade Packages</source>
<context-group name="ctx">
<context context-type="sourcefile">/rhn/ssm/PackageUpgrade.do</context>
</context-group>
Expand Down Expand Up @@ -18882,14 +18882,14 @@ any of these revisions. Are you sure you want to do this?</source>
<trans-unit id="ssm.package.verify.select.summary">
<source>Packages listed below may be verified on one or more systems.

Select one or more and click the &lt;b&gt;Verify Selected Packages&lt;/b&gt; button to schedule package verification.
Select one or more and click the &lt;b&gt;Verify Packages&lt;/b&gt; button to schedule package verification.
</source>
<context-group name="ctx">
<context context-type="sourcefile">/rhn/ssm/PackageVerify.do</context>
</context-group>
</trans-unit>
<trans-unit id="ssm.package.verify.select.confirm">
<source>Verify Selected Packages</source>
<source>Verify Packages</source>
<context-group name="ctx">
<context context-type="sourcefile">/rhn/ssm/PackageVerify.do</context>
</context-group>
Expand Down Expand Up @@ -20787,7 +20787,13 @@ The Tree Path, Base Channel, and Installer Generation should always match. This
</context-group>
</trans-unit>
<trans-unit id="sdc.details.overview.subscribedchannels" xml:space="preserve">
<source>Subscribed Channels (&lt;a href="{0}"&gt;Alter Channel Subscriptions&lt;/a&gt;)</source>
<source>Subscribed Channels</source>
<context-group name="ctx">
<context context-type="sourcefile">/systems/details/Overview.do</context>
</context-group>
</trans-unit>
<trans-unit id="sdc.details.overview.subscribedchannels.edit" xml:space="preserve">
<source>Edit Subscribed Channels</source>
<context-group name="ctx">
<context context-type="sourcefile">/systems/details/Overview.do</context>
</context-group>
Expand Down Expand Up @@ -20861,7 +20867,13 @@ The Tree Path, Base Channel, and Installer Generation should always match. This
</context-group>
</trans-unit>
<trans-unit id="sdc.details.overview.sysproperties" xml:space="preserve">
<source>System Properties (&lt;a href="{0}"&gt;Edit These Properties&lt;/a&gt;)</source>
<source>System Properties</source>
<context-group name="ctx">
<context context-type="sourcefile">/systems/details/Overview.do</context>
</context-group>
</trans-unit>
<trans-unit id="sdc.details.overview.sysproperties.edit" xml:space="preserve">
<source>Edit System Properties</source>
<context-group name="ctx">
<context context-type="sourcefile">/systems/details/Overview.do</context>
</context-group>
Expand Down Expand Up @@ -23813,13 +23825,13 @@ given channel.</source>
</context-group>
</trans-unit>
<trans-unit id="toolbar.create.schedule" xml:space="preserve">
<source>create schedule</source>
<source>Create schedule</source>
<context-group name="ctx">
<context context-type="sourcefile">/rhn/admin/ScheduleDetail.do</context>
</context-group>
</trans-unit>
<trans-unit id="toolbar.delete.schedule" xml:space="preserve">
<source>delete schedule</source>
<source>Delete Schedule</source>
<context-group name="ctx">
<context context-type="sourcefile">/rhn/admin/ScheduleDetail.do</context>
</context-group>
Expand Down Expand Up @@ -23951,7 +23963,7 @@ given channel.</source>
</context-group>
</trans-unit>
<trans-unit id="toolbar.delete.software.channel" xml:space="preserve">
<source>Delete software channel</source>
<source>Delete Channel</source>
<context-group name="ctx">
<context context-type="sourcefile">/rhn/channels/manage/Edit.do</context>
</context-group>
Expand All @@ -23975,7 +23987,7 @@ given channel.</source>
</context-group>
</trans-unit>
<trans-unit id="toolbar.delete.channel" xml:space="preserve">
<source>Delete software channel</source>
<source>Delete Channel</source>
<context-group name="ctx">
<context context-type="sourcefile">/rhn/channels/manage/errata//Add.do</context>
</context-group>
Expand Down Expand Up @@ -24422,13 +24434,13 @@ given channel.</source>
<source>Add new slave</source>
</trans-unit>
<trans-unit id="iss.slave.remove" xml:space="preserve">
<source>Remove selected slaves</source>
<source>Remove slaves</source>
</trans-unit>
<trans-unit id="toolbar.create.master" xml:space="preserve">
<source>Add new master</source>
</trans-unit>
<trans-unit id="iss.master.remove" xml:space="preserve">
<source>Remove selected masters</source>
<source>Remove masters</source>
</trans-unit>
<trans-unit id="toolbar.delete.slave" xml:space="preserve">
<source>Delete slave</source>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
*
* Phone: 650-555-1212
* Fax: 650-555-1212
* Edit This Address (this is a link)
* Edit (this is a link)
* </pre>
*
*/
Expand Down Expand Up @@ -213,7 +213,7 @@ public int doStartTag() throws JspException {
.append("&amp;uid=")
.append(user.getId())
.append("\">")
.append(ls.getMessage("Edit this address"))
.append(ls.getMessage("Edit"))
.append("</a>");
}
else {
Expand All @@ -229,7 +229,7 @@ public int doStartTag() throws JspException {
.append("&amp;uid=")
.append(user.getId())
.append("\">")
.append(ls.getMessage("Fill in this address"))
.append(ls.getMessage("Add address"))
.append("</a>");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ public class IconTag extends TagSupport {
icons.put("system-virt-guest", "fa fa-1-5x spacewalk-icon-virtual-guest");
icons.put("system-virt-host", "fa fa-1-5x spacewalk-icon-virtual-host");
icons.put("system-warn", "fa fa-exclamation-triangle fa-1-5x text-warning");
icons.put("item-close", "fa fa-times");
}

/**
Expand Down
31 changes: 16 additions & 15 deletions java/code/src/com/redhat/rhn/frontend/taglibs/ListDisplayTag.java
Original file line number Diff line number Diff line change
Expand Up @@ -465,12 +465,12 @@ private void renderSetButtons(Writer out) throws IOException {
"update_list_key_id").render());
buf.append(" ");
buf.append(addButtonTo(buf,
RequestContext.DISPATCH, SELECT_ALL_KEY).render());
RequestContext.DISPATCH, SELECT_ALL_KEY).render());

if (numItemsChecked > 0) {
buf.append(" ");
buf.append(addButtonTo(buf, RequestContext.DISPATCH, UNSELECT_ALL_KEY)
.render());
.render());
}
buf.append("</span>");
}
Expand Down Expand Up @@ -594,7 +594,7 @@ private void renderActionButtons(JspWriter out) throws IOException {
return;
}

out.println("<div class=\"col-sm-12 text-right\">");
out.println("<div class=\"action-button-wrapper\">");
if (getButton2() != null && AclManager.hasAcl(getButton2Acl(),
(HttpServletRequest) pageContext.getRequest(), getMixins())) {

Expand Down Expand Up @@ -772,13 +772,6 @@ public int doStartTag() throws JspException {
doSort(sortedColumn);
}

out.print("<div class=\"spacewalk-list ");
out.println(type + "\"");
if (tableId != null) {
out.print(" id=\"" + tableId + "\"");
}
out.println(">");

/*
* If pageList contains an index and pageList.size() (what we are
* displaying on the page) is less than pageList.getTotalSize() (the
Expand All @@ -787,6 +780,7 @@ public int doStartTag() throws JspException {
* the entries on a single page and is similar to how the perl code
* behaves.
*/

StringWriter alphaBarContent = new StringWriter();
StringWriter paginationContent = new StringWriter();

Expand Down Expand Up @@ -817,6 +811,18 @@ public int doStartTag() throws JspException {
out.print(paginationContent.getBuffer().toString());
out.println("</div>");
}
if (isPaging()) {
out.print("<div class=\"spacewalk-section-toolbar\">\n");
renderActionButtons(out);
out.println("</div>");
}

out.print("<div class=\"spacewalk-list ");
out.println(type + "\"");
if (tableId != null) {
out.print(" id=\"" + tableId + "\"");
}
out.println(">");

out.print("<div class=\"panel panel-default\">");

Expand Down Expand Up @@ -943,11 +949,6 @@ else if (type.equals("list")) {
out.println("</span>");
}
out.println("</div>");
if (isPaging()) {
out.print("<div class=\"row-0\">\n");
renderActionButtons(out);
out.println("</div>");
}
out.println("</div>");

// close list
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,14 @@ private String getPopulatedReturnValue(HttpServletRequest req, Long uid) {
"Fax: 650-555-1212<br />" +
"</address>" +
"<a class=\"btn btn-default\" href=\"/EditAddress.do?type=M&amp;uid=" +
uid + "\">" + "Edit this address</a>";
uid + "\">" + "Edit</a>";
}

private String getEmptyReturnValue(HttpServletRequest req, Long uid) {
return "<strong>Mailing Address</strong>" +
"<div class=\"alert alert-info\">Address not filled in</div>" +
"<a class=\"btn btn-default\" href=\"/EditAddress.do?type=M&amp;uid=" +
uid + "\">Fill in this address</a>";
uid + "\">Add address</a>";
}

}
Loading
Loading