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

Drop the navigation footer from setup wizard, fix UI alignment issues #8875

Merged
merged 5 commits into from
Jul 23, 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
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
package com.redhat.rhn.frontend.action.satellite;

import com.redhat.rhn.domain.iss.IssFactory;
import com.redhat.rhn.frontend.nav.NavCache;
import com.redhat.rhn.frontend.nav.NavNode;
import com.redhat.rhn.frontend.nav.NavTree;
import com.redhat.rhn.frontend.struts.RhnAction;
import com.redhat.rhn.frontend.struts.RhnHelper;
import com.redhat.rhn.manager.content.ContentSyncManager;
Expand All @@ -30,8 +27,6 @@
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

Expand All @@ -43,10 +38,6 @@ public class SetupWizardAction extends RhnAction {
private static final String NAVIGATION_XML_PATH = "/WEB-INF/nav/setup_wizard.xml";

// page attributes
private static final String NEXT_STEP_ATTRIBUTE = "nextStep";
private static final String PREVIOUS_STEP_ATTRIBUTE = "previousStep";
private static final String TOTAL_STEPS_ATTRIBUTE = "totalSteps";
private static final String CURRENT_STEP_ATTRIBUTE = "currentStep";
private static final String REFRESH_NEEDED = "refreshNeeded";
private static final String ISS_MASTER = "issMaster";
private static final String REFRESH_RUNNING = "refreshRunning";
Expand All @@ -68,33 +59,12 @@ public ActionForward execute(ActionMapping mapping, ActionForm formIn,
}

/**
* Sets common attributes needed by setup-tab-footer.jspf.
* @param mapping the Action mapping object
* @param request current request object
* @throws Exception if parsing of navigation XML fails
*/
private void setAttributes(ActionMapping mapping, HttpServletRequest request)
throws Exception {
String path = mapping.getPath();
logger.debug("Current path: {}", path);
NavTree tree =
NavCache.getTree(getServlet().getServletContext().getResource(
NAVIGATION_XML_PATH));
List<NavNode> nodes = (List<NavNode>) tree.getNodes();
int nodeIndex = getNodeIndex(path, nodes);
int totalSteps = nodes.size();

request.setAttribute(CURRENT_STEP_ATTRIBUTE, nodeIndex + 1);

request.setAttribute(TOTAL_STEPS_ATTRIBUTE, totalSteps);

request.setAttribute(PREVIOUS_STEP_ATTRIBUTE,
nodeIndex == 0 ? null : nodes.get(nodeIndex - 1).getURLs().get(0));

request.setAttribute(NEXT_STEP_ATTRIBUTE,
nodeIndex == (totalSteps - 1) ? null : nodes.get(nodeIndex + 1).getURLs()
.get(0));

request.setAttribute(ISS_MASTER, IssFactory.getCurrentMaster() == null);
ContentSyncManager csm = new ContentSyncManager();
request.setAttribute(REFRESH_NEEDED, csm.isRefreshNeeded(null));
Expand All @@ -103,25 +73,4 @@ private void setAttributes(ActionMapping mapping, HttpServletRequest request)
request.setAttribute(REFRESH_RUNNING,
latestRun != null && latestRun.getEndTime() == null);
}

/**
* Looks for a URL in a list of navigation nodes, returns the index if any.
* @param path the path
* @param nodes the navigation nodes
* @return the index
* @throws IllegalArgumentException if path is not found
*/
private int getNodeIndex(String path, List<NavNode> nodes) {
for (int i = 0; i < nodes.size(); i++) {
NavNode node = nodes.get(i);
List<String> urls = (List<String>) node.getURLs();
for (String url : urls) {
if (url.endsWith(path + ".do")) {
return i;
}
}
}
throw new IllegalArgumentException("SetupWizardAction: path " +
path + " not found");
}
}
45 changes: 20 additions & 25 deletions java/code/webapp/WEB-INF/pages/admin/setup/mirror-credentials.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -110,31 +110,26 @@
<rhn:dialogmenu mindepth="0" maxdepth="1"
definition="/WEB-INF/nav/setup_wizard.xml"
renderer="com.redhat.rhn.frontend.nav.DialognavRenderer" />
<div class="panel panel-default">
<div class="panel-body">
<c:choose>
<c:when test='${issMaster}'>
<div class="row" id="mirror-credentials">
<div class="col-sm-9" id="listset-container">
<rhn:icon type="spinner"></rhn:icon>
<script>ajax("render-mirror-credentials", "", makeRendererHandler("listset-container", false).callback, "text/html");</script>
</div>
<div class="col-sm-3 hidden-xs" id="wizard-faq">
<h4><bean:message key="mirror-credentials.jsp.info.h1" /></h4>
<p><bean:message key="mirror-credentials.jsp.info.p1" /></p>
<img src="../../../img/credentials-help.png" />
<h4><bean:message key="mirror-credentials.jsp.info.h2" /></h4>
<p><bean:message key="mirror-credentials.jsp.info.p2" /></p>
</div>
</div>
</c:when>
<c:otherwise>
<div class="alert alert-warning" role="alert"><bean:message key="mirror-credentials.jsp.iss-slave"/></div>
</c:otherwise>
</c:choose>
</div>
<jsp:include page="/WEB-INF/pages/common/fragments/setup/setup-tab-footer.jspf" />
</div>
<c:choose>
<c:when test='${issMaster}'>
<div class="row" id="mirror-credentials">
<div class="col-sm-9" id="listset-container">
<rhn:icon type="spinner"></rhn:icon>
<script>ajax("render-mirror-credentials", "", makeRendererHandler("listset-container", false).callback, "text/html");</script>
</div>
<div class="col-sm-3 hidden-xs" id="wizard-faq">
<h4><bean:message key="mirror-credentials.jsp.info.h1" /></h4>
<p><bean:message key="mirror-credentials.jsp.info.p1" /></p>
<img src="../../../img/credentials-help.png" />
<h4><bean:message key="mirror-credentials.jsp.info.h2" /></h4>
<p><bean:message key="mirror-credentials.jsp.info.p2" /></p>
</div>
</div>
</c:when>
<c:otherwise>
<div class="alert alert-warning" role="alert"><bean:message key="mirror-credentials.jsp.iss-slave"/></div>
</c:otherwise>
</c:choose>
</div>
</body>
</html>
83 changes: 39 additions & 44 deletions java/code/webapp/WEB-INF/pages/admin/setup/proxy-settings.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -10,55 +10,50 @@
</rhn:toolbar>
<rhn:dialogmenu mindepth="0" maxdepth="1" definition="/WEB-INF/nav/setup_wizard.xml"
renderer="com.redhat.rhn.frontend.nav.DialognavRenderer" />
<div class="panel panel-default">
<div class="panel-body">
<div class="row" id="http-proxy">
<div class="col-sm-9">
<div class="panel panel-default">
<div class="panel-body">
<form class="form-horizontal" role="form">
<div class="form-group">
<label for="http-proxy-input-hostname" class="col-xs-4 control-label">HTTP Proxy Hostname:</label>
<div class="col-xs-8">
<p class="form-control-static http-proxy-hostname"></p>
<input type="text" class="form-control http-proxy-hostname" id="http-proxy-input-hostname" placeholder="Hostname:Port">
</div>
</div>
<div class="form-group">
<label for="http-proxy-input-username" class="col-xs-4 control-label">HTTP Proxy Username:</label>
<div class="col-xs-8">
<p class="form-control-static http-proxy-username"></p>
<input type="text" class="form-control http-proxy-username" id="http-proxy-input-username" value="" placeholder="Username">
</div>
</div>
<div class="form-group">
<label for="http-proxy-input-password" class="col-xs-4 control-label">HTTP Proxy Password:</label>
<div class="col-xs-8">
<p class="form-control-static http-proxy-password"></p>
<input type="password" autocomplete="new-password" class="form-control http-proxy-password" id="http-proxy-input-password" value="" placeholder="Password">
</div>
</div>
</form>
<div class="row" id="http-proxy">
<div class="col-sm-9">
<div class="panel panel-default">
<div class="panel-body">
<form class="form-horizontal" role="form">
<div class="form-group">
<label for="http-proxy-input-hostname" class="col-xs-4 control-label">HTTP Proxy Hostname:</label>
<div class="col-xs-8">
<p class="form-control-static http-proxy-hostname"></p>
<input type="text" class="form-control http-proxy-hostname" id="http-proxy-input-hostname" placeholder="Hostname:Port">
</div>
</div>
<div class="form-group">
<label for="http-proxy-input-username" class="col-xs-4 control-label">HTTP Proxy Username:</label>
<div class="col-xs-8">
<p class="form-control-static http-proxy-username"></p>
<input type="text" class="form-control http-proxy-username" id="http-proxy-input-username" value="" placeholder="Username">
</div>
</div>
<div class="form-group">
<label for="http-proxy-input-password" class="col-xs-4 control-label">HTTP Proxy Password:</label>
<div class="col-xs-8">
<p class="form-control-static http-proxy-password"></p>
<input type="password" autocomplete="new-password" class="form-control http-proxy-password" id="http-proxy-input-password" value="" placeholder="Password">
</div>
</div>
</form>
</div>
<div class="panel-footer">
<div class="text-right">
<button id="http-proxy-save" class="btn btn-success">Save and Verify</button>
</div>
<div class="panel-footer">
<div class="text-right">
<button id="http-proxy-save" class="btn btn-success">Save and Verify</button>
</div>
<div class="text-left">
<a id="http-proxy-verify" href="#"><i class="fa fa-check-square text-success"></i></a>
<a id="http-proxy-edit" href="#"><i class="fa fa-pencil"></i></a>
</div>
<div class="text-left">
<a id="http-proxy-verify" href="#"><i class="fa fa-check-square text-success"></i></a>
<a id="http-proxy-edit" href="#"><i class="fa fa-pencil"></i></a>
</div>
</div>
</div>
<div class="col-sm-3 hidden-xs" id="wizard-faq">
<img src="../../../img/http-proxy.png" />
<h4>HTTP Proxy</h4>
<p>If this server uses an HTTP proxy to access the outside network, you can use this form to configure it. If that is not the case simply click on Next.</p>
</div>
</div>
</div>
<jsp:include page="/WEB-INF/pages/common/fragments/setup/setup-tab-footer.jspf" />
<div class="col-sm-3 hidden-xs" id="wizard-faq">
<img src="../../../img/http-proxy.png" />
<h4>HTTP Proxy</h4>
<p>If this server uses an HTTP proxy to access the outside network, you can use this form to configure it. If that is not the case, move on to Organization Credentials.</p>
</div>
</div>
</div>
</body>
Expand Down

This file was deleted.

1 change: 1 addition & 0 deletions java/spacewalk-java.changes.eth.setup
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Update setup wizard UI
Loading
Loading