Merge ~deadlight/maas:action-error-messages into maas:master

Proposed by Karl Williams
Status: Merged
Approved by: Anthony Dillon
Approved revision: c0bb516a2fa373f9a52acb0b3b7166a41701d356
Merge reported by: MAAS Lander
Merged at revision: not available
Proposed branch: ~deadlight/maas:action-error-messages
Merge into: maas:master
Diff against target: 157 lines (+35/-35)
5 files modified
src/maasserver/static/partials/domain-details.html (+0/-1)
src/maasserver/static/partials/node-details.html (+15/-11)
src/maasserver/static/partials/nodes-list.html (+13/-18)
src/maasserver/static/partials/pod-details.html (+6/-4)
src/maasserver/static/partials/zone-details.html (+1/-1)
Reviewer Review Type Date Requested Status
Anthony Dillon Approve
MAAS Maintainers Pending
Review via email: mp+343030@code.launchpad.net

Commit message

LP: #1761768 - Format error messages in the notification style.

Description of the change

Format error messages in the notification style.

QA:

If you have the sample data installed, you can view the errors by trying to do something like commissioning a machine, which should fail.

To post a comment you must log in.
Revision history for this message
Anthony Dillon (ya-bo-ng) wrote :

LGTM +1

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/partials/domain-details.html b/src/maasserver/static/partials/domain-details.html
2index 2444901..88e2884 100644
3--- a/src/maasserver/static/partials/domain-details.html
4+++ b/src/maasserver/static/partials/domain-details.html
5@@ -300,4 +300,3 @@
6 </table>
7 </div>
8 </section>
9-
10diff --git a/src/maasserver/static/partials/node-details.html b/src/maasserver/static/partials/node-details.html
11index e938a2c..81ee924 100755
12--- a/src/maasserver/static/partials/node-details.html
13+++ b/src/maasserver/static/partials/node-details.html
14@@ -188,9 +188,11 @@
15 <div class="row ng-hide" data-ng-show="isActionError()">
16 <!-- XXX blake_r 2015-02-19 - Need to add e2e test. -->
17 <div class="col-12">
18- <p>
19- <i class="p-icon--error">Error:</i> Node failed to be {$ action.option.sentence $}, because of the following error: {$ action.error $}
20- </p>
21+ <div class="p-notification--negative">
22+ <p class="p-notification__response">
23+ <span class="p-notification__status">Error:</span>Node failed to be {$ action.option.sentence $}, because of the following error: {$ action.error $}
24+ </p>
25+ </div>
26 <div class="u-align--right">
27 <button class="p-button--base" data-ng-click="actionCancel()">Cancel</button>
28 <button class="p-button--neutral" data-ng-click="actionGo()">Retry</button>
29@@ -200,9 +202,11 @@
30 <div class="row ng-hide" data-ng-show="isDeployError()">
31 <!-- XXX blake_r 2015-02-19 - Need to add e2e test. -->
32 <div class="col-8">
33- <p>
34- <i class="p-icon--error">Error:</i> Node cannot be {$ action.option.sentence $}, because the required boot images have not been imported. To import boot images, visit the <a href="images/">images page</a>.
35- </p>
36+ <div class="p-notification--negative">
37+ <p class="p-notification__response">
38+ <span class="p-notification__status">Error:</span> Node cannot be {$ action.option.sentence $}, because the required boot images have not been imported. To import boot images, visit the <a href="images/">images page</a>.
39+ </p>
40+ </div>
41 </div>
42 <div class="col-4 u-align--right">
43 <button class="p-button--base" data-ng-click="actionCancel()">Cancel</button>
44@@ -210,11 +214,11 @@
45 </div>
46 <div class="row ng-hide" data-ng-show="hasActionPowerError(action.option.name)">
47 <div class="col-8">
48- <p>
49- <i class="p-icon--error">Error:</i> Node cannot be {$ action.option.sentence $}, because power control software for the
50- node is missing from its rack controller. To proceed, install the
51- {$ getPowerErrors() $} on the rack controller.
52- </p>
53+ <div class="p-notification--negative">
54+ <p class="p-notification__response">
55+ <span class="p-notification__status">Error:</span> Node cannot be {$ action.option.sentence $}, because power control software for the node is missing from its rack controller. To proceed, install the {$ getPowerErrors() $} on the rack controller.
56+ </p>
57+ </div>
58 </div>
59 <div class="col-4 u-align--right">
60 <button class="p-button--base" data-ng-click="actionCancel()">Cancel</button>
61diff --git a/src/maasserver/static/partials/nodes-list.html b/src/maasserver/static/partials/nodes-list.html
62index a7a6447..0cd4e0a 100644
63--- a/src/maasserver/static/partials/nodes-list.html
64+++ b/src/maasserver/static/partials/nodes-list.html
65@@ -285,12 +285,9 @@
66 {$ tabs[tab].actionProgress.completed $} of {$ tabs[tab].actionProgress.total $}
67 nodes are transitioning to {$ tabs[tab].actionOption.sentence $}.
68 </p>
69- <p class="page-header__message page-header__message--error"
70- data-ng-repeat="(error, nodes) in tabs[tab].actionProgress.errors">
71- The {$ tabs[tab].actionOption.title.toLowerCase() $} action for {$ nodes.length $}
72- <span data-ng-pluralize count="nodes.length" when="{'one': 'node', 'other': 'nodes'}"></span>
73- failed with error: {$ error $}
74- </p>
75+ <div class="p-notification--negative" data-ng-repeat="(error, machines) in tabs[tab].actionProgress.errors">
76+ <p class="p-notification__response"><span class="p-notification__status">Error: </span> The {$ tabs[tab].actionOption.title.toLowerCase() $} action for {$ nodes.length $} <span data-ng-pluralize count="nodes.length" when="{'one': 'node', 'other': 'nodes'}"></span> failed with error: {$ error $}</p>
77+ </div>
78 </div>
79 </section>
80 </div>
81@@ -479,12 +476,11 @@
82 {$ tabs.devices.actionProgress.completed $} of {$ tabs.devices.actionProgress.total $}
83 devices have been {$ tabs.devices.actionOption.sentence $}.
84 </p>
85- <p class="page-header__message page-header__message--error"
86- data-ng-repeat="(error, devices) in tabs.devices.actionProgress.errors">
87- The {$ tabs.devices.actionOption.title.toLowerCase() $} action for {$ devices.length $}
88- <span data-ng-pluralize count="devices.length" when="{'one': 'device', 'other': 'devices'}"></span>
89- failed with error: {$ error $}
90- </p>
91+ <div class="p-notification--negative" data-ng-repeat="(error, devices) in tabs.devices.actionProgress.errors">
92+ <p class="p-notification__response">
93+ <span class="p-notification__status">Error: </span>The {$ tabs.devices.actionOption.title.toLowerCase() $} action for {$ devices.length $} <span data-ng-pluralize count="devices.length" when="{'one': 'device', 'other': 'devices'}"></span> failed with error: {$ error $}
94+ </p>
95+ </div>
96 </div>
97 </div>
98
99@@ -688,12 +684,11 @@
100 {$ tabs.controllers.actionProgress.completed $} of {$ tabs.controllers.actionProgress.total $}
101 controllers have been {$ tabs.controllers.actionOption.sentence $}.
102 </p>
103- <p class="page-header__message page-header__message--error"
104- data-ng-repeat="(error, controllers) in tabs.controllers.actionProgress.errors">
105- The {$ tabs.controllers.actionOption.title.toLowerCase() $} action for {$ controllers.length $}
106- <span data-ng-pluralize count="controllers.length" when="{'one': 'controller', 'other': 'controllers'}"></span>
107- failed with error: {$ error $}
108- </p>
109+ <div class="p-notification--negative" data-ng-repeat="(error, controllers) in tabs.controllers.actionProgress.errors">
110+ <p class="p-notification__response">
111+ <span class="p-notification__status">Error:</span> The {$ tabs.controllers.actionOption.title.toLowerCase() $} action for {$ controllers.length $} <span data-ng-pluralize count="controllers.length" when="{'one': 'controller', 'other': 'controllers'}"></span> failed with error: {$ error $}
112+ </p>
113+ </div>
114 </form>
115 </div>
116 </div>
117diff --git a/src/maasserver/static/partials/pod-details.html b/src/maasserver/static/partials/pod-details.html
118index f8dc201..01eac28 100644
119--- a/src/maasserver/static/partials/pod-details.html
120+++ b/src/maasserver/static/partials/pod-details.html
121@@ -122,9 +122,11 @@
122 <div class="row" data-ng-if="action.option && !action.inProgress">
123 <form class="p-form p-form--inline u-align--right">
124 <div class="col-8">
125- <p data-ng-if="action.error">
126- <i class="p-icon--error">Error:</i> Performing {$ action.option.sentence $} failed: {$ action.error $}
127- </p>
128+ <div class="p-notification--negative" data-ng-if="action.error">
129+ <p class="p-notification__response">
130+ <span class="p-notification__status">Error:</span> Performing {$ action.option.sentence $} failed: {$ action.error $}
131+ </p>
132+ </div>
133 </div>
134 <div class="col-4 u-align--right">
135 <button class="p-button--base" type="button" data-ng-click="actionCancel()">Cancel</button>
136@@ -224,7 +226,7 @@
137 <maas-obj-field type="options" key="zone" label="Zone" subtle="false" placeholder="Choose a zone"
138 options="zone.id as zone.name for zone in zones"></maas-obj-field>
139 <maas-obj-field type="tags" key="tags" label="Tags" label-width="2" input-width="5"
140- disable-label="false" placeholder="Add a tag"></maas-obj-field>
141+ disable-label="false" placeholder="Add a tag"></maas-obj-field>
142 </div>
143 </div>
144 <div class="col-6">
145diff --git a/src/maasserver/static/partials/zone-details.html b/src/maasserver/static/partials/zone-details.html
146index 79f100e..84209c4 100644
147--- a/src/maasserver/static/partials/zone-details.html
148+++ b/src/maasserver/static/partials/zone-details.html
149@@ -27,7 +27,7 @@
150 <p><i class="p-icon--error">Error:</i> AZ cannot be deleted because it is the default AZ.</p>
151 </div>
152 <div class="col-6 u-align--right">
153- <button class="p-button--base" type="button"data-ng-click="cancelDeleteButton()">Cancel</button>
154+ <button class="p-button--base" type="button" data-ng-click="cancelDeleteButton()">Cancel</button>
155 </div>
156 </section>
157 <section class="row ng-hide" data-ng-show="canBeDeleted() && !error">

Subscribers

People subscribed via source and target branches