Merge ~ya-bo-ng/maas:add-dhcp-snippets-empty-state into maas:master

Proposed by Anthony Dillon
Status: Merged
Approved by: Blake Rouse
Approved revision: 0d12f2010d744ded8e682d7efe5cd7119cc1ea91
Merge reported by: MAAS Lander
Merged at revision: not available
Proposed branch: ~ya-bo-ng/maas:add-dhcp-snippets-empty-state
Merge into: maas:master
Diff against target: 30 lines (+7/-2)
1 file modified
src/maasserver/static/partials/settings.html (+7/-2)
Reviewer Review Type Date Requested Status
Blake Rouse (community) Approve
MAAS Lander Approve
Review via email: mp+343359@code.launchpad.net

Commit message

Add an empty state to the settings DHCP snippets

Description of the change

Add logic to the DHCP snippets table which displays a message when there are none.

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

UNIT TESTS
-b add-dhcp-snippets-empty-state lp:~ya-bo-ng/maas/+git/maas into -b master lp:~maas-committers/maas

STATUS: SUCCESS
COMMIT: 0d12f2010d744ded8e682d7efe5cd7119cc1ea91

review: Approve
Revision history for this message
Blake Rouse (blake-rouse) wrote :

Looks good.

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/settings.html b/src/maasserver/static/partials/settings.html
index 1a6ca98..d471186 100644
--- a/src/maasserver/static/partials/settings.html
+++ b/src/maasserver/static/partials/settings.html
@@ -58,6 +58,11 @@
58 </tr>58 </tr>
59 </thead>59 </thead>
60 <tbody>60 <tbody>
61 <tr data-ng-if="snippets.length === 0">
62 <td colspan="5">
63 No DHCP snippets available
64 </td>
65 </tr>
61 <tr data-ng-repeat="snippet in snippets track by snippet.id"66 <tr data-ng-repeat="snippet in snippets track by snippet.id"
62 data-ng-class="{ 'is-active': editSnippet === snippet || deleteSnippet === snippet }">67 data-ng-class="{ 'is-active': editSnippet === snippet || deleteSnippet === snippet }">
63 <td class="col-2" aria-label="Name" data-ng-if="editSnippet !== snippet">68 <td class="col-2" aria-label="Name" data-ng-if="editSnippet !== snippet">
@@ -200,11 +205,11 @@
200 <label for="subnet" class="u-hide u-show--small" data-ng-if="newSnippet.$maasForm.getValue('type') === 'Subnet'">Choose subnet</label>205 <label for="subnet" class="u-hide u-show--small" data-ng-if="newSnippet.$maasForm.getValue('type') === 'Subnet'">Choose subnet</label>
201 <label for="node" class="u-hide u-show--small" data-ng-if="newSnippet.$maasForm.getValue('type') === 'Node'">Choose node</label>206 <label for="node" class="u-hide u-show--small" data-ng-if="newSnippet.$maasForm.getValue('type') === 'Node'">Choose node</label>
202 <maas-obj-field type="options" key="subnet" placeholder="Choose subnet"207 <maas-obj-field type="options" key="subnet" placeholder="Choose subnet"
203 disable-label="true" input-class="table__input"208 disable-label="true" input-class="table__input" class="u-no-margin--top"
204 options="subnet.id as getSubnetName(subnet) for subnet in subnets"209 options="subnet.id as getSubnetName(subnet) for subnet in subnets"
205 data-ng-if="newSnippet.$maasForm.getValue('type') === 'Subnet'"></maas-obj-field>210 data-ng-if="newSnippet.$maasForm.getValue('type') === 'Subnet'"></maas-obj-field>
206 <maas-obj-field type="options" key="node" placeholder="Choose node"211 <maas-obj-field type="options" key="node" placeholder="Choose node"
207 disable-label="true" input-class="table__input"212 disable-label="true" input-class="table__input" class="u-no-margin--top"
208 options="node.system_id as node.fqdn group by node.node_type_display for node in machines.concat(devices).concat(controllers)"213 options="node.system_id as node.fqdn group by node.node_type_display for node in machines.concat(devices).concat(controllers)"
209 data-ng-if="newSnippet.$maasForm.getValue('type') === 'Node'">214 data-ng-if="newSnippet.$maasForm.getValue('type') === 'Node'">
210 </maas-obj-field>215 </maas-obj-field>

Subscribers

People subscribed via source and target branches