[
https://issues.apache.org/jira/browse/AMBARI-22756?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16320170#comment-16320170
]
ASF GitHub Bot commented on AMBARI-22756:
-----------------------------------------
atkach closed pull request #80: AMBARI-22756 Post-install: Reduce navigation
width in wizard. (atkach)
URL: https://github.com/apache/ambari/pull/80
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/ambari-web/app/routes/create_widget.js
b/ambari-web/app/routes/create_widget.js
index 1e4a30ec507..f014a7ffb20 100644
--- a/ambari-web/app/routes/create_widget.js
+++ b/ambari-web/app/routes/create_widget.js
@@ -62,7 +62,6 @@ module.exports = App.WizardRoute.extend({
step1: Em.Route.extend({
route: '/step1',
- breadcrumbs: null,
connectOutlets: function (router) {
var controller = router.get('widgetWizardController');
@@ -96,7 +95,6 @@ module.exports = App.WizardRoute.extend({
step2: Em.Route.extend({
route: '/step2',
- breadcrumbs: null,
connectOutlets: function (router) {
var controller = router.get('widgetWizardController');
@@ -127,7 +125,6 @@ module.exports = App.WizardRoute.extend({
step3: Em.Route.extend({
route: '/step3',
- breadcrumbs: null,
connectOutlets: function (router) {
var controller = router.get('widgetWizardController');
diff --git a/ambari-web/app/styles/wizard.less
b/ambari-web/app/styles/wizard.less
index 4e680cac202..d42f19d5aca 100644
--- a/ambari-web/app/styles/wizard.less
+++ b/ambari-web/app/styles/wizard.less
@@ -18,6 +18,8 @@
@import 'common.less';
+@wizard-side-nav-width: 250px;
+
#enable_security {
.step3 {
overflow: auto;
@@ -696,6 +698,17 @@
}
}
+.modal {
+ .wizard {
+ .wizard-nav {
+ width: @wizard-side-nav-width;
+ }
+ .wizard-content.col-md-9 {
+ width: calc(~"100% - 250px");
+ }
+ }
+}
+
.install-wizard-content {
#top-nav .navbar.navbar-static-top {
margin-bottom: 0;
@@ -709,7 +722,7 @@
.wizard {
border: none;
.wizard-nav {
- width: 250px;
+ width: @wizard-side-nav-width;
}
.wizard-content.col-md-9 {
width: calc(~"100% - 250px");
diff --git a/ambari-web/app/views/common/breadcrumbs_view.js
b/ambari-web/app/views/common/breadcrumbs_view.js
index 7c5ec4ef36d..ec6e6a64efb 100644
--- a/ambari-web/app/views/common/breadcrumbs_view.js
+++ b/ambari-web/app/views/common/breadcrumbs_view.js
@@ -190,6 +190,7 @@ App.BreadcrumbsView = Em.View.extend({
items: function () {
let currentState = App.get('router.currentState');
let items = [];
+ const wizardStepRegex = /^step[0-9]?/;
while (currentState) {
if (currentState.breadcrumbs !== undefined) {
// breadcrumbs should be defined and be not null or any other
falsie-value
@@ -208,7 +209,8 @@ App.BreadcrumbsView = Em.View.extend({
}
else {
// generate breadcrumb if it is not defined
- if (currentState.name && !['root',
'index'].contains(currentState.name)) {
+ // breadcrumbs of wizard step such as "Step #" should be ignored
+ if (currentState.name && !['root',
'index'].contains(currentState.name) &&
!wizardStepRegex.test(currentState.name)) {
items.pushObject({label: _formatLabel(currentState.name)});
}
}
diff --git a/ambari-web/test/views/common/breadcrumbs_view_test.js
b/ambari-web/test/views/common/breadcrumbs_view_test.js
index 3e2fc17ec6c..6c773c9fdd8 100644
--- a/ambari-web/test/views/common/breadcrumbs_view_test.js
+++ b/ambari-web/test/views/common/breadcrumbs_view_test.js
@@ -123,6 +123,11 @@ describe('App.BreadcrumbsView', function () {
expect(view.get('items')).to.be.empty;
});
+ it('`step1` route is ignored', function () {
+ currentState = getCurrentState({}, {name: 'step1'});
+ expect(view.get('items')).to.be.empty;
+ });
+
it('last item is disabled by default', function () {
currentState = getCurrentState({breadcrumbs: {label: 'parent'}},
{breadcrumbs: {label: 'child'}});
expect(view.get('items.length')).to.be.equal(2);
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Post-install: Reduce navigation width in wizard
> -----------------------------------------------
>
> Key: AMBARI-22756
> URL: https://issues.apache.org/jira/browse/AMBARI-22756
> Project: Ambari
> Issue Type: Task
> Components: ambari-web
> Affects Versions: 3.0.0
> Reporter: Andrii Tkach
> Assignee: Andrii Tkach
> Priority: Minor
> Fix For: 3.0.0
>
>
> Reduce width of navigation and make it fixed in wizards.
> Step of the wizard should be ignored in breadcrumbs.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)