Skip to content
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
3 changes: 0 additions & 3 deletions ambari-web/app/routes/create_widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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');
Expand Down Expand Up @@ -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');
Expand Down
15 changes: 14 additions & 1 deletion ambari-web/app/styles/wizard.less
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

@import 'common.less';

@wizard-side-nav-width: 250px;

#enable_security {
.step3 {
overflow: auto;
Expand Down Expand Up @@ -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;
Expand All @@ -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");
Expand Down
4 changes: 3 additions & 1 deletion ambari-web/app/views/common/breadcrumbs_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)});
}
}
Expand Down
5 changes: 5 additions & 0 deletions ambari-web/test/views/common/breadcrumbs_view_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down