Merge ~ltrager/maas:fix_confirmation_dialogs into maas:master

Proposed by Lee Trager
Status: Merged
Approved by: Andres Rodriguez
Approved revision: 92c57634d8546d95818fad21e72cafc995758f5c
Merge reported by: MAAS Lander
Merged at revision: not available
Proposed branch: ~ltrager/maas:fix_confirmation_dialogs
Merge into: maas:master
Diff against target: 140 lines (+32/-28)
4 files modified
src/maasserver/static/js/angular/controllers/node_details.js (+2/-3)
src/maasserver/static/js/angular/controllers/nodes_list.js (+8/-3)
src/maasserver/static/partials/node-details.html (+18/-14)
src/maasserver/static/partials/nodes-list.html (+4/-8)
Reviewer Review Type Date Requested Status
Andres Rodriguez (community) Approve
Martin Storey (community) Approve
MAAS Lander Approve
Review via email: mp+359107@code.launchpad.net

Commit message

Update confirmation dialogs in the UI to current design patterns.

To post a comment you must log in.
Revision history for this message
MAAS Lander (maas-lander) wrote :

UNIT TESTS
-b fix_confirmation_dialogs lp:~ltrager/maas/+git/maas into -b master lp:~maas-committers/maas

STATUS: SUCCESS
COMMIT: 92c57634d8546d95818fad21e72cafc995758f5c

review: Approve
Revision history for this message
Martin Storey (cassiocassio) wrote :

much cleaner. nicely done.

review: Approve
Revision history for this message
Andres Rodriguez (andreserl) wrote :

Lgtm!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/src/maasserver/static/js/angular/controllers/node_details.js b/src/maasserver/static/js/angular/controllers/node_details.js
2index 923c6a5..9560602 100644
3--- a/src/maasserver/static/js/angular/controllers/node_details.js
4+++ b/src/maasserver/static/js/angular/controllers/node_details.js
5@@ -642,8 +642,7 @@ angular.module('MAAS').controller('NodeDetailsController', [
6 !$scope.action.showing_confirmation) {
7 $scope.action.showing_confirmation = true;
8 $scope.action.confirmation_message =
9- $scope.type_name_title + " is currently deployed. " +
10- "Are you sure you want to continue to test hardware?";
11+ $scope.type_name_title + " is in a deployed state.";
12 return;
13 }
14 // Set the test options.
15@@ -681,7 +680,7 @@ angular.module('MAAS').controller('NodeDetailsController', [
16 }
17 if($scope.action.confirmation_details.length > 0) {
18 $scope.action.confirmation_message +=
19- "Are you sure you want delete this controller?";
20+ $scope.type_name_title + " will be deleted."
21 $scope.action.showing_confirmation = true;
22 return;
23 }
24diff --git a/src/maasserver/static/js/angular/controllers/nodes_list.js b/src/maasserver/static/js/angular/controllers/nodes_list.js
25index 7641483..6dbba82 100644
26--- a/src/maasserver/static/js/angular/controllers/nodes_list.js
27+++ b/src/maasserver/static/js/angular/controllers/nodes_list.js
28@@ -854,9 +854,14 @@ angular.module('MAAS').controller('NodesListController', [
29 }
30 }
31 if(tab.actionProgress.affected_nodes != 0) {
32- tab.actionProgress.confirmation_message =
33- tab.actionProgress.affected_nodes +
34- " controllers will be deleted.";
35+ if(tab.actionProgress.affected_nodes === 1) {
36+ tab.actionProgress.confirmation_message =
37+ "1 controller will be deleted.";
38+ } else {
39+ tab.actionProgress.confirmation_message =
40+ tab.actionProgress.affected_nodes +
41+ " controllers will be deleted.";
42+ }
43 tab.actionProgress.showing_confirmation = true;
44 return;
45 }
46diff --git a/src/maasserver/static/partials/node-details.html b/src/maasserver/static/partials/node-details.html
47index 698a651..4bdd438 100755
48--- a/src/maasserver/static/partials/node-details.html
49+++ b/src/maasserver/static/partials/node-details.html
50@@ -203,23 +203,27 @@
51 </div>
52 </div>
53 <div class="row ng-hide" data-ng-show="action.showing_confirmation">
54- <hr />
55- <div class="u-equal-height">
56- <div class="col-9 u-vertically-center">
57- <p class="u-remove-max-width">
58- <i class="p-icon--warning" /><b>Confirm:</b> {$ action.confirmation_message $}
59- </p>
60+ <div class="col-12">
61+ <p>
62+ <i class="p-icon--warning" /><b>Confirm:</b> {$ action.confirmation_message $}
63+ </p>
64+ <div data-ng-repeat="confirmation_detail in action.confirmation_details">
65+ <span>{$ confirmation_detail $}</span>
66 </div>
67- <div class="col-3">
68- <div class="u-align--right">
69- <button class="p-button--base" data-ng-click="actionCancel()">No</button>
70- <button class="p-button--negative" data-ng-click="actionGo()">Yes</button>
71- </div>
72+ <div class="u-equal-height">
73+ <div class="col-9 u-vertically-center">
74+ <p class="u-remove-max-width">
75+ Are you sure you want to {$ action.actionOption.name $} this {$ type_name $}?
76+ </p>
77+ </div>
78+ <div class="col-3">
79+ <div class="u-align--right">
80+ <button class="p-button--base" data-ng-click="actionCancel()">No</button>
81+ <button class="p-button--negative" data-ng-click="actionGo()">Yes</button>
82+ </div>
83+ </div>
84 </div>
85 </div>
86- <div data-ng-repeat="confirmation_detail in action.confirmation_details">
87- <span>{$ confirmation_detail $}</span>
88- </div>
89 </div>
90 <div class="row u-equal-height ng-hide" data-ng-show="isActionError()">
91 <!-- XXX blake_r 2015-02-19 - Need to add e2e test. -->
92diff --git a/src/maasserver/static/partials/nodes-list.html b/src/maasserver/static/partials/nodes-list.html
93index d6629a3..ee5e96f 100644
94--- a/src/maasserver/static/partials/nodes-list.html
95+++ b/src/maasserver/static/partials/nodes-list.html
96@@ -384,18 +384,16 @@
97 </div>
98 </section>
99 <section class="page-header__section row u-no-margin--top ng-hide" data-ng-show="tabs[tab].actionProgress.showing_confirmation">
100- <hr />
101 <div class="col-12">
102 <p>
103- <i class="p-icon--warning">Confirm:</i> {$ tabs[tab].actionProgress.confirmation_message $}
104+ <i class="p-icon--warning" /><b>Confirm:</b> {$ tabs[tab].actionProgress.confirmation_message $}
105 </p>
106 <div data-ng-repeat="confirmation_detail in tabs[tab].actionProgress.confirmation_details">
107 <span>{$ confirmation_detail $}</span>
108 </div>
109- <hr />
110 <div>
111 <div class="u-align--left">
112- <b>Confirm:</b> Are you sure you want to {$ tabs[tab].actionOption.name $} these machines?
113+ Are you sure you want to {$ tabs[tab].actionOption.name $} <span data-ng-pluralize count="tabs[tab].selectedItems.length" when="{'one': 'this machine', 'other': 'these machines'}"></span>?
114 </div>
115 <div class="u-align--right">
116 <button class="p-button--base" data-ng-click="actionCancel(tab)">No</button>
117@@ -669,21 +667,19 @@
118 </div>
119
120 <section class="page-header__section row u-no-margin--top ng-hide" data-ng-show="tabs.controllers.actionProgress.showing_confirmation">
121- <hr />
122 <div class="row">
123 <div class="col-12">
124 <p>
125- <i class="p-icon--warning">Confirm:</i> {$ tabs.controllers.actionProgress.confirmation_message $}
126+ <i class="p-icon--warning" /><b>Confirm:</b> {$ tabs.controllers.actionProgress.confirmation_message $}
127 </p>
128 <div data-ng-repeat="confirmation_detail in tabs.controllers.actionProgress.confirmation_details">
129 <span>{$ confirmation_detail $}</span>
130 </div>
131 </div>
132 </div>
133- <hr />
134 <div class="row">
135 <div class="col-8">
136- <b>Confirm:</b> Are you sure you want to {$ tabs.controllers.actionOption.name $} these controllers?
137+ Are you sure you want to {$ tabs.controllers.actionOption.name $} <span data-ng-pluralize count="tabs.controllers.selectedItems.length" when="{'one': 'this controller', 'other': 'these controllers'}"></span>?
138 </div>
139 <div class="col-4 u-align--right">
140 <button class="p-button--base" data-ng-click="actionCancel('controllers')">No</button>

Subscribers

People subscribed via source and target branches