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
1diff --git a/src/maasserver/static/partials/settings.html b/src/maasserver/static/partials/settings.html
2index 1a6ca98..d471186 100644
3--- a/src/maasserver/static/partials/settings.html
4+++ b/src/maasserver/static/partials/settings.html
5@@ -58,6 +58,11 @@
6 </tr>
7 </thead>
8 <tbody>
9+ <tr data-ng-if="snippets.length === 0">
10+ <td colspan="5">
11+ No DHCP snippets available
12+ </td>
13+ </tr>
14 <tr data-ng-repeat="snippet in snippets track by snippet.id"
15 data-ng-class="{ 'is-active': editSnippet === snippet || deleteSnippet === snippet }">
16 <td class="col-2" aria-label="Name" data-ng-if="editSnippet !== snippet">
17@@ -200,11 +205,11 @@
18 <label for="subnet" class="u-hide u-show--small" data-ng-if="newSnippet.$maasForm.getValue('type') === 'Subnet'">Choose subnet</label>
19 <label for="node" class="u-hide u-show--small" data-ng-if="newSnippet.$maasForm.getValue('type') === 'Node'">Choose node</label>
20 <maas-obj-field type="options" key="subnet" placeholder="Choose subnet"
21- disable-label="true" input-class="table__input"
22+ disable-label="true" input-class="table__input" class="u-no-margin--top"
23 options="subnet.id as getSubnetName(subnet) for subnet in subnets"
24 data-ng-if="newSnippet.$maasForm.getValue('type') === 'Subnet'"></maas-obj-field>
25 <maas-obj-field type="options" key="node" placeholder="Choose node"
26- disable-label="true" input-class="table__input"
27+ disable-label="true" input-class="table__input" class="u-no-margin--top"
28 options="node.system_id as node.fqdn group by node.node_type_display for node in machines.concat(devices).concat(controllers)"
29 data-ng-if="newSnippet.$maasForm.getValue('type') === 'Node'">
30 </maas-obj-field>

Subscribers

People subscribed via source and target branches