Merge ~ya-bo-ng/maas:zones-page into ~deadlight/maas:vanilla

Proposed by Anthony Dillon
Status: Merged
Approved by: Karl Williams
Approved revision: 26956fbfe99d417eff1a17780c7ec4d170836554
Merged at revision: 26956fbfe99d417eff1a17780c7ec4d170836554
Proposed branch: ~ya-bo-ng/maas:zones-page
Merge into: ~deadlight/maas:vanilla
Diff against target: 259 lines (+119/-103)
2 files modified
src/maasserver/static/partials/zone-details.html (+61/-50)
src/maasserver/static/partials/zones-list.html (+58/-53)
Reviewer Review Type Date Requested Status
Karl Williams Approve
Review via email: mp+335946@code.launchpad.net

Description of the change

Updated the zones section.
- Check the zone listing page
- Check a zone details page
- Create a zone
- Delete a zone

To post a comment you must log in.
Revision history for this message
Karl Williams (deadlight) wrote :

LGTM +1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/src/maasserver/static/partials/zone-details.html b/src/maasserver/static/partials/zone-details.html
index 15290c7..aae8a73 100644
--- a/src/maasserver/static/partials/zone-details.html
+++ b/src/maasserver/static/partials/zone-details.html
@@ -19,69 +19,80 @@
19 </div>19 </div>
20 </div>20 </div>
21 </div>21 </div>
22 <div class="row">22 <div class="row u-no-margin--top">
23 <div class="page-header__dropdown" data-ng-class="{ 'is-open': confirmingDelete }">23 <div data-ng-if="confirmingDelete">
24 <section class="page-header__section ng-hide" data-ng-hide="canBeDeleted()">24 <hr />
25 <p class="page-header__message page-header__message--error">25 <section class="row ng-hide" data-ng-hide="canBeDeleted()">
26 Zone cannot be deleted because it is the default zone.26 <div class="col-6">
27 </p>27 <p><i class="p-icon--error">Error:</i> Zone cannot be deleted because it is the default zone.</p>
28 <div class="page-header__controls">28 </div>
29 <button class="p-button--base is-inline" data-ng-click="cancelDeleteButton()">Cancel</button>29 <div class="col-6 u-align--right">
30 <button class="p-button--base" data-ng-click="cancelDeleteButton()">Cancel</button>
30 </div>31 </div>
31 </section>32 </section>
32 <section class="page-header__section ng-hide" data-ng-show="canBeDeleted() && !error">33 <section class="row ng-hide" data-ng-show="canBeDeleted() && !error">
33 <p class="page-header__message page-header__message--error">34 <div class="col-6">
34 Are you sure you want to delete this zone?35 <p><i class="p-icon--error">Error:</i> Are you sure you want to delete this zone?</p>
35 </p>36 </div>
36 <div class="page-header__controls">37 <div class="col-6 u-align--right">
37 <button class="p-button--base is-inline" data-ng-click="cancelDeleteButton()">Cancel</button>38 <button class="p-button--base" data-ng-click="cancelDeleteButton()">Cancel</button>
38 <button class="p-button--negative is-inline" data-ng-click="deleteConfirmButton()">Delete zone</button>39 <button class="p-button--negative u-no-margin--top" data-ng-click="deleteConfirmButton()">Delete zone</button>
39 </div>40 </div>
40 </section>41 </section>
41 <section class="page-header__section ng-hide" data-ng-show="canBeDeleted() && error">42 <section class="row ng-hide" data-ng-show="canBeDeleted() && error">
42 <p class="page-header__message page-header__message--error">{$ error $}</p>43 <div class="col-6">
43 <div class="page-header__controls">44 <p><i class="p-icon--error">Error:</i> {$ error $}</p>
44 <button class="p-button--base is-inline" data-ng-click="cancelDeleteButton()">Cancel</button>45 </div>
45 <button class="p-button--neutral is-inline" data-ng-click="deleteConfirmButton()">Retry</button>46 <div class="col-6 u-align--right">
47 <button class="p-button--base" data-ng-click="cancelDeleteButton()">Cancel</button>
48 <button class="p-button--neutral u-no-margin--top" data-ng-click="deleteConfirmButton()">Retry</button>
46 </div>49 </div>
47 </section>50 </section>
48 </div>51 </div>
49 </div>52 </div>
50 </header>53 </header>
51 <div data-ng-show="!loading">54 <div data-ng-show="!loading">
52 <section class="row">55 <section class="p-strip">
53 <div class="wrapper--inner">56 <div class="row">
54 <div class="twelve-col">57 <div class="col-6">
55 <h2 class="u-float--left">Zone summary</h2>58 <h2>Zone summary</h2>
56 <button type="button" name="button" class="button--secondary button--inline u-float--right" data-ng-click="enterEditSummary()" data-ng-if="editSummary != true">Edit</button>
57 </div>59 </div>
58 <div class="twelve-col" data-ng-if="editSummary != true">60 <div class="col-6">
59 <dl class="six-col">61 <button type="button" name="button" class="p-button--neutral u-float--right" data-ng-click="enterEditSummary()" data-ng-if="editSummary != true">Edit</button>
60 <dt class="two-col">Name</dt>
61 <dd class="four-col last-col">{$ zone.name $}</dd>
62 <dt class="two-col">Description</dt>
63 <dd class="four-col last-col">{$ zone.description $}&nbsp;</dd>
64 <dt class="two-col">Machines</dt>
65 <dd class="four-col last-col"><a href="#/nodes?tab=nodes&query=zone:({$ zone.name $})">{$ zone.machines_count $}</a></dd>
66 </dl>
67 </div>62 </div>
63 </div>
64 <div class="row u-no-margin--top" data-ng-if="editSummary != true">
65 <dl class="col-6">
66 <dt>Name</dt>
67 <dd>{$ zone.name $}</dd>
68 <dt>Description</dt>
69 <dd>{$ zone.description $}&nbsp;</dd>
70 <dt>Machines</dt>
71 <dd><a href="#/nodes?tab=nodes&query=zone:({$ zone.name $})">{$ zone.machines_count $}</a></dd>
72 </dl>
73 </div>
74 <div class="row">
68 <maas-obj-form obj="zone" data-ng-if="editSummary == true" table-form="true" save-on-blur="false" after-save="exitEditSummary" manager="zoneManager" data-ng-disabled="!isSuperUser()">75 <maas-obj-form obj="zone" data-ng-if="editSummary == true" table-form="true" save-on-blur="false" after-save="exitEditSummary" manager="zoneManager" data-ng-disabled="!isSuperUser()">
69 <fieldset class="form__fieldset six-col">76 <div class="row">
70 <maas-obj-field type="text" key="name" label="Name" placeholder="Zone name"77 <div class="col-6">
71 label-width="two" input-width="three" blur-on-enter="true"></maas-obj-field>78 <maas-obj-field type="text" key="name" label="Name" placeholder="Zone name"
72 <maas-obj-field type="textarea" key="description" label="Description" placeholder="Zone description"79 label-width="2" input-width="5" blur-on-enter="true"></maas-obj-field>
73 label-width="two" input-width="three" blur-on-enter="true"></maas-obj-field>80 <maas-obj-field type="textarea" key="description" label="Description" placeholder="Zone description"
74 <dl>81 label-width="2" input-width="5" blur-on-enter="true"></maas-obj-field>
75 <dt class="two-col">Machines</dt>82 <dl>
76 <dd class="four-col last-col">83 <dt class="col-2">Machines</dt>
77 <a href="#/nodes?tab=nodes&query=zone:({$ zone.name $})">{$ zone.machines_count $}</a>84 <dd class="col-5">
78 </dd>85 <a href="#/nodes?tab=nodes&query=zone:({$ zone.name $})">{$ zone.machines_count $}</a>
79 </dl>86 </dd>
80 </fieldset>87 </dl>
81 <div class="twelve-col u-align--right">88 </div>
82 <button class="button--base button--inline"89 </div>
83 data-ng-click="exitEditSummary()">Cancel</button>90 <div class="row">
84 <button class="button--positive button--inline" maas-obj-save>Save summary</button>91 <div class="col-12 u-align--right">
92 <button class="p-button--base"
93 data-ng-click="exitEditSummary()">Cancel</button>
94 <button class="p-button--positive" maas-obj-save>Save summary</button>
95 </div>
85 </div>96 </div>
86 </maas-obj-form>97 </maas-obj-form>
87 </div>98 </div>
diff --git a/src/maasserver/static/partials/zones-list.html b/src/maasserver/static/partials/zones-list.html
index 2b0f63b..a5f63d1 100755
--- a/src/maasserver/static/partials/zones-list.html
+++ b/src/maasserver/static/partials/zones-list.html
@@ -16,61 +16,66 @@
16 </div>16 </div>
17 </div>17 </div>
18 </div>18 </div>
19 <div class="row">19 <div class="row u-no-margin--top" data-ng-if="action.open">
20 <div class="page-header__dropdown is-open" data-ng-if="action.open">20 <hr />
21 <div class="page-header__section col-12">21 <maas-obj-form obj="action.obj" manager="zoneManager" manager-method="createItem"
22 <maas-obj-form obj="action.obj" manager="zoneManager" manager-method="createItem"22 inline="true" save-on-blur="false" after-save="closeZone">
23 inline="true" save-on-blur="false" after-save="closeZone">23 <div class="col-6">
24 <fieldset class="p-form__fieldset">24 <maas-obj-field
25 <maas-obj-field25 type="text" key="name" label="Name (required)" subtle="false"
26 type="text" key="name" label="Name (required)" subtle="false"26 placeholder="Name (required)" label-width="2" input-width="3" ></maas-obj-field>
27 placeholder="Name (required)"></maas-obj-field>
28 </fieldset>
29 <div class="page-header__controls">
30 <button class="p-button--base is-inline" data-ng-click="closeZone()">Cancel</button>
31 <button class="p-button--positive is-inline" maas-obj-save>Add zone</button>
32 </div>
33 </maas-obj-form>
34 </div>27 </div>
35 </div>28 <div class="col-6 u-align--right">
29 <button class="p-button--base" data-ng-click="closeZone()">Cancel</button>
30 <button class="p-button--positive u-no-margin--top" maas-obj-save>Add zone</button>
31 </div>
32 </maas-obj-form>
36 </div>33 </div>
37</header>34</header>
38<section class="row">35<section class="p-strip">
39 <div class="wrapper--inner">36 <div class="row">
40 <div class="twelve-col ng-hide" data-ng-show="!loading">37 <div class="col-12 ng-hide u-equal-height" data-ng-show="!loading">
41 <h2>Physical zones <span class="icon icon--help tooltip tooltip--right"38 <h2 class="u-float--left">Physical zones</h2>
42 aria-label="A representation of a grouping of nodes, typically by physical location.">39
43 </span></h2>40 <span class="col-2 u-vertically-center">
44 <!-- Spaces grouped table -->41 <span class=" p-tooltip p-tooltip--right">
45 <table class="table-listing">42 <i class="p-icon--help u-hide u-show--large">Help:</i>
46 <thead>43 <span class="p-tooltip__message" role="tooltip">A representation of a grouping of nodes, typically by physical location.</span>
47 <tr class="table-listing__row">44 </span>
48 <th class="table__column--20">Name</th>45 </span>
49 <th class="table__column--20">Description</th>
50 <th class="table__column--20">Machines</th>
51 <th class="table__column--15">Devices</th>
52 <th class="table__column--15">Controllers</th>
53 </tr>
54 </thead>
55 <tbody vs-repeat vs-scroll-parent="window">
56 <tr class="table-listing__row" data-ng-repeat="zone in zones">
57 <td class="table-listing__cell table__column--20" aria-label="Name">
58 <a href="#/zone/{$ zone.id $}">{$ zone.name $}</a>
59 </td>
60 <td class="table-listing__cell table__column--20" aria-label="Description">
61 {$ zone.description $}
62 </td>
63 <td class="table-listing__cell table__column--20" aria-label="Machines">
64 <a href="#/nodes?tab=nodes&query=zone:({$ zone.name $})">{$ zone.machines_count $}</a>
65 </td>
66 <td class="table-listing__cell table__column--30" aria-label="Devices">
67 <a href="#/nodes?tab=devices&query=zone:({$ zone.name $})">{$ zone.devices_count $}</a>
68 </td>
69 <td class="table-listing__cell table__column--30" aria-label="Controllers">
70 <a href="#/nodes?tab=controllers&query=zone:({$ zone.name $})">{$ zone.controllers_count $}</a>
71 </td>
72 </tr>
73 </tbody>
74 </table>
75 </div>46 </div>
47 </div>
48 <div class="row">
49 <!-- Spaces grouped table -->
50 <table class="table-listing">
51 <thead>
52 <tr>
53 <th>Name</th>
54 <th>Description</th>
55 <th>Machines</th>
56 <th>Devices</th>
57 <th>Controllers</th>
58 </tr>
59 </thead>
60 <tbody vs-repeat vs-scroll-parent="window">
61 <tr data-ng-repeat="zone in zones">
62 <td aria-label="Name">
63 <a href="#/zone/{$ zone.id $}">{$ zone.name $}</a>
64 </td>
65 <td aria-label="Description">
66 {$ zone.description $}
67 </td>
68 <td aria-label="Machines">
69 <a href="#/nodes?tab=nodes&query=zone:({$ zone.name $})">{$ zone.machines_count $}</a>
70 </td>
71 <td aria-label="Devices">
72 <a href="#/nodes?tab=devices&query=zone:({$ zone.name $})">{$ zone.devices_count $}</a>
73 </td>
74 <td aria-label="Controllers">
75 <a href="#/nodes?tab=controllers&query=zone:({$ zone.name $})">{$ zone.controllers_count $}</a>
76 </td>
77 </tr>
78 </tbody>
79 </table>
80 </div>
76</section>81</section>

Subscribers

People subscribed via source and target branches

to all changes: