Skip to content

Commit 5472dc7

Browse files
committed
Disable clicking number to go to results step
Prevent accidentally creating and deleting things in the wizard dialogs by clicking the last step indicator.
1 parent e1ba88d commit 5472dc7

File tree

7 files changed

+21
-7
lines changed

7 files changed

+21
-7
lines changed

app/scripts/directives/bindService.js

+3
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@
123123
label: 'Binding',
124124
view: 'views/directives/bind-service/bind-service-form.html',
125125
valid: true,
126+
allowClickNav: true,
126127
onShow: showBind
127128
};
128129

@@ -131,6 +132,7 @@
131132
label: 'Parameters',
132133
view: 'views/directives/bind-service/bind-parameters.html',
133134
hidden: true,
135+
allowClickNav: true,
134136
onShow: showParameters
135137
};
136138

@@ -139,6 +141,7 @@
139141
label: 'Results',
140142
view: 'views/directives/bind-service/results.html',
141143
valid: true,
144+
allowClickNav: false,
142145
onShow: showResults
143146
};
144147

app/scripts/directives/processTemplateDialog.js

+3
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
hidden: ctrl.useProjectTemplate !== true,
4242
allowed: true,
4343
valid: false,
44+
allowClickNav: true,
4445
onShow: showSelect
4546
};
4647

@@ -52,6 +53,7 @@
5253
// is displayed and the template has required fields.
5354
valid: false,
5455
allowed: true,
56+
allowClickNav: true,
5557
onShow: showConfig
5658
};
5759

@@ -62,6 +64,7 @@
6264
valid: true,
6365
allowed: false,
6466
prevEnabled: false,
67+
allowClickNav: false,
6568
onShow: showResults
6669
};
6770

app/views/directives/bind-service.html

+3-2
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,13 @@
88
on-finish="ctrl.closeWizard()"
99
on-cancel="ctrl.closeWizard()"
1010
wizard-done="ctrl.wizardComplete">
11-
<pf-wizard-step ng-repeat="step in ctrl.steps track by $index"
11+
<pf-wizard-step ng-repeat="step in ctrl.steps track by step.id"
1212
step-title="{{step.label}}"
1313
next-enabled="step.valid"
1414
on-show="step.onShow"
1515
step-id="{{step.id}}"
16-
step-priority="{{$index}}">
16+
step-priority="{{$index}}"
17+
allow-click-nav="step.allowClickNav">
1718
<div class="wizard-pf-main-inner-shadow-covers">
1819
<div class="bind-service-config">
1920
<div ng-include="step.view" class="wizard-pf-main-form-contents"></div>

app/views/directives/process-template-dialog.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<pf-wizard-step ng-repeat="step in $ctrl.steps track by step.id"
1616
step-title="{{step.label}}"
1717
wz-disabled="{{step.hidden}}"
18-
allow-click-nav="step.allowed"
18+
allow-click-nav="step.allowClickNav"
1919
next-enabled="step.valid"
2020
prev-enabled="step.prevEnabled"
2121
on-show="step.onShow"

app/views/directives/unbind-service.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@
1111
wizard-done="ctrl.wizardComplete"
1212
class="pf-wizard-no-back">
1313
<pf-wizard-step
14-
ng-repeat="step in ctrl.steps track by $index"
14+
ng-repeat="step in ctrl.steps track by step.id"
1515
step-title="{{step.label}}"
1616
next-enabled="step.valid"
17+
allow-click-nav="false"
1718
on-show="step.onShow"
1819
step-id="{{step.id}}"
1920
step-priority="{{$index}}">

dist/scripts/scripts.js

+6
Original file line numberDiff line numberDiff line change
@@ -12590,6 +12590,7 @@ id: "bindForm",
1259012590
label: "Binding",
1259112591
view: "views/directives/bind-service/bind-service-form.html",
1259212592
valid: !0,
12593+
allowClickNav: !0,
1259312594
onShow: function() {
1259412595
d.nextTitle = i.hidden ? "Bind" : "Next >", d.podPresets && !c && (c = e.$watch("ctrl.selectionForm.$valid", function(e) {
1259512596
o.valid = e;
@@ -12600,6 +12601,7 @@ id: "bindParameters",
1260012601
label: "Parameters",
1260112602
view: "views/directives/bind-service/bind-parameters.html",
1260212603
hidden: !0,
12604+
allowClickNav: !0,
1260312605
onShow: function() {
1260412606
d.nextTitle = "Bind", l || (l = e.$watch("ctrl.parametersForm.$valid", function(e) {
1260512607
i.valid = e;
@@ -12610,6 +12612,7 @@ id: "results",
1261012612
label: "Results",
1261112613
view: "views/directives/bind-service/results.html",
1261212614
valid: !0,
12615+
allowClickNav: !1,
1261312616
onShow: function() {
1261412617
c && (c(), c = void 0), l && (l(), l = void 0), d.nextTitle = "Close", d.wizardComplete = !0, d.bindService();
1261512618
}
@@ -12894,6 +12897,7 @@ view: "views/directives/process-template-dialog/process-template-select.html",
1289412897
hidden: !0 !== v.useProjectTemplate,
1289512898
allowed: !0,
1289612899
valid: !1,
12900+
allowClickNav: !0,
1289712901
onShow: function() {
1289812902
v.selectStep.selected = !0, v.configStep.selected = !1, v.resultsStep.selected = !1, v.nextTitle = "Next >", u(), g();
1289912903
}
@@ -12903,6 +12907,7 @@ label: "Configuration",
1290312907
view: "views/directives/process-template-dialog/process-template-config.html",
1290412908
valid: !1,
1290512909
allowed: !0,
12910+
allowClickNav: !0,
1290612911
onShow: function() {
1290712912
v.selectStep.selected = !1, v.configStep.selected = !0, v.resultsStep.selected = !1, v.nextTitle = "Create", v.resultsStep.allowed = v.configStep.valid, h = e.$watch("$ctrl.form.$valid", function(e) {
1290812913
v.configStep.valid = e && v.selectedProject, v.resultsStep.allowed = e;
@@ -12915,6 +12920,7 @@ view: "views/directives/process-template-dialog/process-template-results.html",
1291512920
valid: !0,
1291612921
allowed: !1,
1291712922
prevEnabled: !1,
12923+
allowClickNav: !1,
1291812924
onShow: function() {
1291912925
v.selectStep.selected = !1, v.configStep.selected = !1, v.resultsStep.selected = !0, v.nextTitle = "Close", u(), v.wizardDone = !0;
1292012926
}

dist/scripts/templates.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -5818,7 +5818,7 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
58185818
$templateCache.put('views/directives/bind-service.html',
58195819
"<div class=\"bind-service-wizard\">\n" +
58205820
"<pf-wizard hide-header=\"true\" hide-sidebar=\"true\" step-class=\"bind-service-wizard-step\" wizard-ready=\"ctrl.wizardReady\" next-title=\"ctrl.nextTitle\" on-finish=\"ctrl.closeWizard()\" on-cancel=\"ctrl.closeWizard()\" wizard-done=\"ctrl.wizardComplete\">\n" +
5821-
"<pf-wizard-step ng-repeat=\"step in ctrl.steps track by $index\" step-title=\"{{step.label}}\" next-enabled=\"step.valid\" on-show=\"step.onShow\" step-id=\"{{step.id}}\" step-priority=\"{{$index}}\">\n" +
5821+
"<pf-wizard-step ng-repeat=\"step in ctrl.steps track by step.id\" step-title=\"{{step.label}}\" next-enabled=\"step.valid\" on-show=\"step.onShow\" step-id=\"{{step.id}}\" step-priority=\"{{$index}}\" allow-click-nav=\"step.allowClickNav\">\n" +
58225822
"<div class=\"wizard-pf-main-inner-shadow-covers\">\n" +
58235823
"<div class=\"bind-service-config\">\n" +
58245824
"<div ng-include=\"step.view\" class=\"wizard-pf-main-form-contents\"></div>\n" +
@@ -8785,7 +8785,7 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
87858785
$templateCache.put('views/directives/process-template-dialog.html',
87868786
"<div class=\"order-service\">\n" +
87878787
"<pf-wizard hide-header=\"true\" hide-sidebar=\"true\" hide-back-button=\"!$ctrl.useProjectTemplate\" step-class=\"order-service-wizard-step\" wizard-ready=\"$ctrl.wizardReady\" next-title=\"$ctrl.nextTitle\" next-callback=\"$ctrl.next\" on-finish=\"$ctrl.close()\" on-cancel=\"$ctrl.close()\" wizard-done=\"$ctrl.wizardDone\" current-step=\"$ctrl.currentStep\" ng-class=\"{'pf-wizard-no-back': !$ctrl.useProjectTemplate}\">\n" +
8788-
"<pf-wizard-step ng-repeat=\"step in $ctrl.steps track by step.id\" step-title=\"{{step.label}}\" wz-disabled=\"{{step.hidden}}\" allow-click-nav=\"step.allowed\" next-enabled=\"step.valid\" prev-enabled=\"step.prevEnabled\" on-show=\"step.onShow\" step-id=\"{{step.id}}\" step-priority=\"{{$index}}\">\n" +
8788+
"<pf-wizard-step ng-repeat=\"step in $ctrl.steps track by step.id\" step-title=\"{{step.label}}\" wz-disabled=\"{{step.hidden}}\" allow-click-nav=\"step.allowClickNav\" next-enabled=\"step.valid\" prev-enabled=\"step.prevEnabled\" on-show=\"step.onShow\" step-id=\"{{step.id}}\" step-priority=\"{{$index}}\">\n" +
87898789
"<div class=\"wizard-pf-main-inner-shadow-covers\">\n" +
87908790
"<div class=\"order-service-details\" ng-if=\"!$ctrl.selectStep.selected\">\n" +
87918791
"<div class=\"order-service-details-top\">\n" +
@@ -9138,7 +9138,7 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
91389138
$templateCache.put('views/directives/unbind-service.html',
91399139
"<div class=\"bind-service-wizard unbind-service\">\n" +
91409140
"<pf-wizard hide-header=\"true\" hide-sidebar=\"true\" hide-back-button=\"true\" step-class=\"bind-service-wizard-step\" wizard-ready=\"ctrl.wizardReady\" next-title=\"ctrl.nextTitle\" on-finish=\"ctrl.closeWizard()\" on-cancel=\"ctrl.closeWizard()\" wizard-done=\"ctrl.wizardComplete\" class=\"pf-wizard-no-back\">\n" +
9141-
"<pf-wizard-step ng-repeat=\"step in ctrl.steps track by $index\" step-title=\"{{step.label}}\" next-enabled=\"step.valid\" on-show=\"step.onShow\" step-id=\"{{step.id}}\" step-priority=\"{{$index}}\">\n" +
9141+
"<pf-wizard-step ng-repeat=\"step in ctrl.steps track by step.id\" step-title=\"{{step.label}}\" next-enabled=\"step.valid\" allow-click-nav=\"false\" on-show=\"step.onShow\" step-id=\"{{step.id}}\" step-priority=\"{{$index}}\">\n" +
91429142
"<div class=\"wizard-pf-main-inner-shadow-covers\">\n" +
91439143
"<div class=\"bind-service-config\">\n" +
91449144
"<div ng-include=\"step.view\" class=\"wizard-pf-main-form-contents\"></div>\n" +

0 commit comments

Comments
 (0)