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

Ux buttons - Deprecating the classes btn-success, btn-info, and btn-warning #9368

Merged
merged 28 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
6a1eab4
Removed css for btn-success, removed class btn-success from pages
bisht-richa Oct 2, 2024
86e15b0
Replaced btn-success class
bisht-richa Oct 3, 2024
7bf467e
Replaced btn-info class
bisht-richa Oct 7, 2024
ccb29c2
Removed btn-warning
bisht-richa Oct 7, 2024
5d4e824
Fixed btn-link use cases
bisht-richa Oct 10, 2024
50a6132
Added btn-primary class to primary actions
bisht-richa Oct 11, 2024
6fa89be
Fixed button classes in more screens
bisht-richa Oct 14, 2024
4850e9c
Modify FilterEdit component to accept class name
bisht-richa Oct 15, 2024
da78cc1
Added classes to creation types
bisht-richa Oct 15, 2024
dbc95dc
Added btn class to Download CSV, clean code
bisht-richa Oct 15, 2024
e7c4afe
Fixed lint and added changelog files
bisht-richa Oct 16, 2024
d6a3460
Fixed lint in ToolbarTag.java
bisht-richa Oct 16, 2024
bee421e
Fix mc
bisht-richa Nov 26, 2024
f7956a1
changes to license fix
bisht-richa Nov 4, 2024
3cee261
Fixed ToolbarTag components test
bisht-richa Nov 7, 2024
97bc1eb
Fixed more ToolbarTag creation and deletion tests
bisht-richa Nov 7, 2024
94005ed
Fixed review comments, modify text in changelog file
bisht-richa Nov 14, 2024
4e8c4d4
Changelog text update
bisht-richa Nov 14, 2024
a327d7c
Fix lint
bisht-richa Nov 14, 2024
65f2432
Corrected changelog file name
bisht-richa Nov 18, 2024
589f57d
Update licenses.txt
bisht-richa Nov 26, 2024
e1ed0cc
Update structured.js
bisht-richa Nov 26, 2024
f5e9ea0
Updated licenses.structured.js and licenses.txt
bisht-richa Nov 26, 2024
06f57d2
Fixed changelog characters limit
bisht-richa Nov 26, 2024
185853f
Fixed java changelog characters limit
bisht-richa Nov 26, 2024
70c6f8a
Fixed java changelog added new line
bisht-richa Nov 26, 2024
513e0c4
Removed less files
bisht-richa Nov 28, 2024
f5d1cea
Fixed whitespace issue in configuration.jsp
bisht-richa Nov 28, 2024
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 @@ -19595,7 +19595,7 @@ the <a href="/rhn/kickstart/ActivationKeysList.do?ksid={0}">Activation Key
<context context-type="sourcefile">/rhn/kickstart/ViewTrees.do</context>
</context-group>
</trans-unit>
<trans-unit id="kickstart.kickstartable_distro_create_new.jsp">
<trans-unit id="toolbar.create.distro">
<source>Create Distribution</source>
<context-group name="ctx">
<context context-type="sourcefile">/rhn/kickstart/ViewTrees.do</context>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ public int doStartTag() throws JspException {
result.append("</address>");

result.append("<a ")
.append("class=\"btn btn-primary\"")
.append("class=\"btn btn-default\"")
.append(" href=\"")
.append(getActionUrl())
.append("/EditAddress.do?type=")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ private void renderActionButtons(JspWriter out) throws IOException {
if (getButton() != null && AclManager.hasAcl(getButtonAcl(),
(HttpServletRequest) pageContext.getRequest(), getMixins())) {

out.println("<button class=\"btn btn-primary\"" +
out.println("<button class=\"btn btn-default\"" +
" type=\"submit\" name=\"dispatch\" value=\"" +
LocalizationService.getInstance().getMessage(getButton()) +
"\">" +
Expand Down
22 changes: 15 additions & 7 deletions java/code/src/com/redhat/rhn/frontend/taglibs/ToolbarTag.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
import com.redhat.rhn.frontend.html.HtmlTag;
import com.redhat.rhn.manager.acl.AclManager;

import org.apache.commons.lang3.StringUtils;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
Expand Down Expand Up @@ -505,11 +507,11 @@ public int doStartTag() throws JspException {
buf.append(baseTag.renderOpenTag());
buf.append(toolbarDivTag.renderOpenTag());

buf.append(renderCreationLink());
buf.append(renderCloneLink());
buf.append(renderUploadLink());
buf.append(renderDeletionLink());
buf.append(renderMiscLink());
buf.append(renderCreationLink());
buf.append(toolbarDivTag.renderCloseTag());


Expand Down Expand Up @@ -593,7 +595,7 @@ private String renderCreationLink() {
assertNotEmpty(getCreationUrl())) {

String create = "toolbar.create." + getCreationType();
return renderActionLink(getCreationUrl(), create,
return renderActionLink(getCreationUrl(), create, "btn btn-primary",
create, "item-add", null, false);
}
return "";
Expand All @@ -604,7 +606,7 @@ private String renderCloneLink() {
assertNotEmpty(getCloneUrl())) {

String clone = "toolbar.clone." + getCloneType();
return renderActionLink(getCloneUrl(), clone,
return renderActionLink(getCloneUrl(), clone, "btn btn-default",
clone, "item-clone", null, false);
}
return "";
Expand All @@ -615,7 +617,7 @@ private String renderDeletionLink() {
assertNotEmpty(getDeletionUrl())) {

String del = "toolbar.delete." + getDeletionType();
return renderActionLink(getDeletionUrl(), del, del, "item-del", null, false);
return renderActionLink(getDeletionUrl(), del, "btn btn-danger", del, "item-del", null, false);
}
return "";
}
Expand All @@ -625,7 +627,7 @@ private String renderUploadLink() {
assertNotEmpty(getUploadUrl())) {

String del = "toolbar.upload." + getUploadType();
return renderActionLink(getUploadUrl(), del, del, "item-upload", null, false);
return renderActionLink(getUploadUrl(), del, "btn btn-default", del, "item-upload", null, false);
}
return "";
}
Expand All @@ -641,11 +643,12 @@ private String renderMiscLink() {
if (!assertNotEmpty(getMiscImg()) && !assertNotEmpty(getMiscIcon())) {
return "";
}
return renderActionLink(getMiscUrl(), getMiscText(),

return renderActionLink(getMiscUrl(), getMiscText(), "btn btn-default",
getMiscAlt(), getMiscIcon(), getMiscImg(), isMiscSpaOff());
}

private String renderActionLink(String url, String text,
private String renderActionLink(String url, String text, String className,
String alt, String iconName,
String imgName, boolean isSpaOff) {
if (url == null) {
Expand All @@ -656,10 +659,15 @@ private String renderActionLink(String url, String text,

HtmlTag a = new HtmlTag("a");
a.setAttribute("href", url);

if (isSpaOff) {
a.setAttribute("data-senna-off", "true");
}

if (StringUtils.isNotBlank(className)) {
a.setAttribute("class", className);
}

if (assertNotEmpty(imgName)) {
alt = LocalizationService.getInstance().getMessage(alt);
HtmlTag imgTag = new HtmlTag("img");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public void release() {
private void renderExport() throws JspException {
IconTag i = new IconTag("item-download-csv");
String exportLink = "<div class=\"spacewalk-csv-download\">" +
"<a class=\"btn btn-link\" data-senna-off=\"true\" href=\"" + CSV_DOWNLOAD_URI + "?" +
"<a class=\"btn btn-default\" data-senna-off=\"true\" href=\"" + CSV_DOWNLOAD_URI + "?" +
makeCSVRequestParams() + "\">" + i.render() + LocalizationService.getInstance().getMessage(
"listdisplay.csv") + "</a></div>";
ListTagUtil.write(pageContext, exportLink);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ private String getPopulatedReturnValue(HttpServletRequest req, Long uid) {
"Phone: 650-555-1212<br />" +
"Fax: 650-555-1212<br />" +
"</address>" +
"<a class=\"btn btn-primary\" href=\"/EditAddress.do?type=M&amp;uid=" +
"<a class=\"btn btn-default\" href=\"/EditAddress.do?type=M&amp;uid=" +
uid + "\">" + "Edit this address</a>";
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ private void setupCloneTag(String base, String url, String acl, String type) {
public void testCloneNoAcl() throws Exception {
// setup mock objects
String output = "<div class=\"spacewalk-toolbar-h1\">" +
"<div class=\"spacewalk-toolbar\"><a href=\"Clone-url\">" +
"<div class=\"spacewalk-toolbar\"><a href=\"Clone-url\" class=\"btn btn-default\">" +
"<i class=\"fa fa-files-o\" title=\"Clone Autoinstallation\"></i>" +
"Clone Autoinstallation</a></div><h1></h1></div>";

Expand All @@ -65,7 +65,7 @@ public void testCloneWithMissingType() throws Exception {
@Test
public void testCreateAclMultipleMixinsMultipleAcls() throws Exception {
String output = "<div class=\"spacewalk-toolbar-h1\">" +
"<div class=\"spacewalk-toolbar\"><a href=\"Clone-url\">" +
"<div class=\"spacewalk-toolbar\"><a href=\"Clone-url\" class=\"btn btn-default\">" +
"<i class=\"fa fa-files-o\" title=\"Clone Autoinstallation\"></i>" +
"Clone Autoinstallation</a></div><h1></h1></div>";

Expand All @@ -82,7 +82,7 @@ public void testCreateAclMultipleMixinsMultipleAcls() throws Exception {
@Test
public void testCreateAclMultipleAclsSingleMixin() throws Exception {
String output = "<div class=\"spacewalk-toolbar-h1\">" +
"<div class=\"spacewalk-toolbar\"><a href=\"Clone-url\">" +
"<div class=\"spacewalk-toolbar\"><a href=\"Clone-url\" class=\"btn btn-default\">" +
"<i class=\"fa fa-files-o\" title=\"Clone Autoinstallation\">" +
"</i>Clone Autoinstallation</a></div><h1></h1></div>";

Expand Down Expand Up @@ -120,7 +120,7 @@ public void testCreateAclValidAclInvalidMixin() {
public void testCloneAcl() throws Exception {
// setup mock objects
String output = "<div class=\"spacewalk-toolbar-h1\">" +
"<div class=\"spacewalk-toolbar\"><a href=\"Clone-url\">" +
"<div class=\"spacewalk-toolbar\"><a href=\"Clone-url\" class=\"btn btn-default\">" +
"<i class=\"fa fa-files-o\" title=\"Clone Autoinstallation\"></i>" +
"Clone Autoinstallation</a></div><h1></h1></div>";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ private void setupCreationTag(String base, String url, String acl, String type)
public void testCreationNoAcl() throws Exception {
// setup mock objects
String output = "<div class=\"spacewalk-toolbar-h1\">" +
"<div class=\"spacewalk-toolbar\"><a href=\"creation-url\">" +
"<div class=\"spacewalk-toolbar\"><a href=\"creation-url\" class=\"btn btn-primary\">" +
"<i class=\"fa fa-plus\" title=\"Create User\"></i>" +
"Create User</a></div><h1></h1></div>";

Expand All @@ -64,7 +64,7 @@ public void testCreationWithMissingType() throws Exception {
@Test
public void testCreateAclMultipleMixinsMultipleAcls() throws Exception {
String output = "<div class=\"spacewalk-toolbar-h1\">" +
"<div class=\"spacewalk-toolbar\"><a href=\"creation-url\">" +
"<div class=\"spacewalk-toolbar\"><a href=\"creation-url\" class=\"btn btn-primary\">" +
"<i class=\"fa fa-plus\" title=\"Create User\">" +
"</i>Create User</a></div><h1></h1></div>";

Expand All @@ -81,7 +81,7 @@ public void testCreateAclMultipleMixinsMultipleAcls() throws Exception {
@Test
public void testCreateAclMultipleAclsSingleMixin() throws Exception {
String output = "<div class=\"spacewalk-toolbar-h1\">" +
"<div class=\"spacewalk-toolbar\"><a href=\"creation-url\">" +
"<div class=\"spacewalk-toolbar\"><a href=\"creation-url\" class=\"btn btn-primary\">" +
"<i class=\"fa fa-plus\" title=\"Create User\"></i>" +
"Create User</a></div><h1></h1></div>";

Expand Down Expand Up @@ -119,7 +119,7 @@ public void testCreateAclValidAclInvalidMixin() {
public void testCreationAcl() throws Exception {
// setup mock objects
String output = "<div class=\"spacewalk-toolbar-h1\">" +
"<div class=\"spacewalk-toolbar\"><a href=\"creation-url\">" +
"<div class=\"spacewalk-toolbar\"><a href=\"creation-url\" class=\"btn btn-primary\">" +
"<i class=\"fa fa-plus\" title=\"Create User\"></i>" +
"Create User</a></div><h1></h1></div>";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public void testDeletionNoAcl() {
try {
// setup mock objects
String output = "<div class=\"spacewalk-toolbar-h1\">" +
"<div class=\"spacewalk-toolbar\"><a href=\"deletion-url\">" +
"<div class=\"spacewalk-toolbar\"><a href=\"deletion-url\" class=\"btn btn-danger\">" +
"<i class=\"fa fa-trash-o\" title=\"Delete User\">" +
"</i>Delete User</a></div><h1></h1></div>";

Expand Down Expand Up @@ -76,7 +76,7 @@ public void testDeletionWithMissingType() {
public void testCreateAclMultipleMixinsMultipleAcls() {
try {
String output = "<div class=\"spacewalk-toolbar-h1\">" +
"<div class=\"spacewalk-toolbar\"><a href=\"deletion-url\">" +
"<div class=\"spacewalk-toolbar\"><a href=\"deletion-url\" class=\"btn btn-danger\">" +
"<i class=\"fa fa-trash-o\" title=\"Delete User\"></i>Delete User</a>" +
"</div><h1></h1></div>";

Expand All @@ -98,7 +98,7 @@ public void testCreateAclMultipleMixinsMultipleAcls() {
public void testCreateAclMultipleAclsSingleMixin() {
try {
String output = "<div class=\"spacewalk-toolbar-h1\">" +
"<div class=\"spacewalk-toolbar\"><a href=\"deletion-url\">" +
"<div class=\"spacewalk-toolbar\"><a href=\"deletion-url\" class=\"btn btn-danger\">" +
"<i class=\"fa fa-trash-o\" title=\"Delete User\"></i>Delete User</a>" +
"</div><h1></h1></div>";

Expand Down Expand Up @@ -143,7 +143,7 @@ public void testDeletionAcl() {
try {
// setup mock objects
String output = "<div class=\"spacewalk-toolbar-h1\">" +
"<div class=\"spacewalk-toolbar\"><a href=\"deletion-url\">" +
"<div class=\"spacewalk-toolbar\"><a href=\"deletion-url\" class=\"btn btn-danger\">" +
"<i class=\"fa fa-trash-o\" title=\"Delete User\"></i>Delete User</a>" +
"</div><h1></h1></div>";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void testMiscNoAcl() {
try {
// setup mock objects
String output = "<div class=\"spacewalk-toolbar-h1\">" +
"<div class=\"spacewalk-toolbar\"><a href=\"misc-url\">" +
"<div class=\"spacewalk-toolbar\"><a href=\"misc-url\" class=\"btn btn-default\">" +
"<img src=\"/img/foo.gif\" alt=\"ignore me\" title=\"ignore me\" />" +
"ignore me</a></div><h1></h1></div>";

Expand Down Expand Up @@ -81,7 +81,7 @@ public void testMiscWithMissingText() {
public void testCreateAclMultipleMixinsMultipleAcls() {
try {
String output = "<div class=\"spacewalk-toolbar-h1\">" +
"<div class=\"spacewalk-toolbar\"><a href=\"misc-url\">" +
"<div class=\"spacewalk-toolbar\"><a href=\"misc-url\" class=\"btn btn-default\">" +
"<img src=\"/img/foo.gif\" alt=\"ignore me\" title=\"ignore me\" />" +
"ignore me</a></div><h1></h1></div>";

Expand All @@ -103,7 +103,7 @@ public void testCreateAclMultipleMixinsMultipleAcls() {
public void testCreateAclMultipleAclsSingleMixin() {
try {
String output = "<div class=\"spacewalk-toolbar-h1\">" +
"<div class=\"spacewalk-toolbar\"><a href=\"misc-url\">" +
"<div class=\"spacewalk-toolbar\"><a href=\"misc-url\" class=\"btn btn-default\">" +
"<img src=\"/img/foo.gif\" alt=\"ignore me\" title=\"ignore me\" />" +
"ignore me</a></div><h1></h1></div>";

Expand Down Expand Up @@ -149,7 +149,7 @@ public void testMiscAcl() {
try {
// setup mock objects
String output = "<div class=\"spacewalk-toolbar-h1\">" +
"<div class=\"spacewalk-toolbar\"><a href=\"misc-url\">" +
"<div class=\"spacewalk-toolbar\"><a href=\"misc-url\" class=\"btn btn-default\">" +
"<img src=\"/img/foo.gif\" alt=\"ignore me\" title=\"ignore me\" />" +
"ignore me</a></div><h1></h1></div>";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
<div class="col-lg-offset-3 offset-lg-3 col-lg-6">
<html:hidden property="dispatch" value="${rhn:localize('sdc.config.rank.jsp.update')}"/>
<input type="submit" name="dispatcher"
class="btn btn-success"
role="button"
class="btn btn-primary"
value="${rhn:localize('sdc.config.rank.jsp.update')}"
onclick="handle_ranking_dispatch('ranksWidget','rankedValues','channelRanksForm');"/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@

<input type="submit"
name ="dispatch"
class="btn btn-success"
class="btn btn-default"
value='<bean:message key="sdc.config.subscriptions.jsp.continue"/>'/>
</div>
</c:if>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<div class="form-group">
<div class="col-sm-6 text-right">
<rhn:submitted/>
<input class="btn btn-success" type="submit"
<input class="btn btn-primary" type="submit"
name ="dispatch" value='<bean:message key="activation-key.jsp.edit-key"/>'/>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions java/code/webapp/WEB-INF/pages/admin/assignedgroups.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<c:if test="${not (userIsOrgAdmin)}">
<div class="text-right">
<hr />
<html:submit styleClass="btn btn-success" property="submit">
<html:submit styleClass="btn btn-default" property="submit">
<bean:message key="assignedgroups.jsp.submitpermissions" />
</html:submit>
</div>
Expand Down Expand Up @@ -83,7 +83,7 @@
<html:hidden property="uid" />
<div class="text-right">
<hr />
<html:submit styleClass="btn btn-primary" property="submit">
<html:submit styleClass="btn btn-default" property="submit">
<bean:message key="assignedgroups.jsp.submitdefaults"/>
</html:submit>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
</div>
<div class="form-group">
<div class="col-lg-offset-3 offset-lg-3 col-lg-6">
<html:submit styleClass="btn btn-success">
<html:submit styleClass="btn btn-primary">
<bean:message key="config.update"/>
</html:submit>
</div>
Expand Down
2 changes: 1 addition & 1 deletion java/code/webapp/WEB-INF/pages/admin/config/general.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
</div>
<div class="form-group">
<div class="col-lg-offset-3 offset-lg-3 col-lg-6">
<html:submit styleClass="btn btn-success">
<html:submit styleClass="btn btn-primary">
<bean:message key="config.update"/>
</html:submit>
</div>
Expand Down
2 changes: 1 addition & 1 deletion java/code/webapp/WEB-INF/pages/admin/config/restart.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<hr />
<div class="row">
<div class="col-md-offset-2 offset-md-2 col-md-10">
<html:submit styleClass="btn btn-success"><bean:message key="restart.jsp.restart"/></html:submit>
<html:submit styleClass="btn btn-primary"><bean:message key="restart.jsp.restart"/></html:submit>
</div>
</div>
<rhn:submitted/>
Expand Down
2 changes: 1 addition & 1 deletion java/code/webapp/WEB-INF/pages/admin/errata/confirm.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<rhn:list pageList="${requestScope.pageList}" noDataText="nosystems.message">
<div class="spacewalk-section-toolbar">
<div class="action-button-wrapper">
<html:submit styleClass="btn btn-success" property="dispatch">
<html:submit styleClass="btn btn-primary" property="dispatch">
<bean:message key="confirm.jsp.confirm" />
</html:submit>
</div>
Expand Down
4 changes: 2 additions & 2 deletions java/code/webapp/WEB-INF/pages/admin/iss/editmaster.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
</rl:list>
<div class="form-group">
<div class="col-lg-offset-3 offset-lg-3 col-lg-6">
<input type="submit" name="dispatch" class="btn btn-success"
<input type="submit" name="dispatch" class="btn btn-primary"
value='<bean:message key="iss.master.update"/>' />
</div>
</div>
Expand All @@ -117,7 +117,7 @@
<c:otherwise>
<div class="form-group">
<div class="col-lg-offset-3 offset-lg-3 col-lg-6">
<html:submit styleClass="btn btn-success">
<html:submit styleClass="btn btn-primary">
<bean:message key="iss.master.create" />
</html:submit>
</div>
Expand Down
Loading
Loading