refact: add conditional table logic (#15330)

This commit is contained in:
Jai 2022-11-22 09:19:16 -05:00 committed by GitHub
parent bebbf340e2
commit 9e6025f25b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 40 additions and 23 deletions

View File

@ -2,28 +2,45 @@
<div class="boxed-section-head"> <div class="boxed-section-head">
Allocations Allocations
</div> </div>
<div class="boxed-section-body is-full-bleed"> <div class="boxed-section-body {{if this.job.allocations.length "is-full-bleed"}}">
<ListTable @source={{@deployment.allocations}} @class="allocations" as |t|> {{#if @deployment.allocations.length}}
<t.head> <ListTable @source={{@deployment.allocations}} @class="allocations" as |t|>
<th class="is-narrow"></th> <t.head>
<th>ID</th> <th class="is-narrow"></th>
<th>Task Group</th> <th>ID</th>
<th>Created</th> <th>Task Group</th>
<th>Modified</th> <th>Created</th>
<th>Status</th> <th>Modified</th>
<th>Version</th> <th>Status</th>
<th>Node</th> <th>Version</th>
<th>Volume</th> <th>Node</th>
<th>CPU</th> <th>Volume</th>
<th>Memory</th> <th>CPU</th>
</t.head> <th>Memory</th>
<t.body as |row|> </t.head>
<AllocationRow <t.body as |row|>
data-test-deployment-allocation <AllocationRow
@allocation={{row.model}} data-test-deployment-allocation
@context="job" @allocation={{row.model}}
/> @context="job"
</t.body> />
</ListTable> </t.body>
</ListTable>
{{else}}
<div class="empty-message" data-test-empty-recent-allocations>
<h3
class="empty-message-headline"
data-test-empty-recent-allocations-headline
>
No Allocations
</h3>
<p
class="empty-message-body"
data-test-empty-recent-allocations-message
>
No allocations have been placed.
</p>
</div>
{{/if}}
</div> </div>
</div> </div>