Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI: Use the standard empty message when an fs dir is empty #6158

Merged
merged 1 commit into from
Aug 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions ui/app/templates/allocations/allocation/task/fs.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
<div class="boxed-section-head">
{{fs-breadcrumbs task=task path=path}}
</div>
{{#list-table
source=sortedDirectoryEntries
sortProperty=sortProperty
sortDescending=sortDescending
class="boxed-section-body is-full-bleed is-compact" as |t|}}
{{#if directoryEntries}}
{{#if directoryEntries}}
{{#list-table
source=sortedDirectoryEntries
sortProperty=sortProperty
sortDescending=sortDescending
class="boxed-section-body is-full-bleed is-compact" as |t|}}
{{#t.head}}
{{#t.sort-by prop="Name" class="is-two-thirds"}}Name{{/t.sort-by}}
{{#t.sort-by prop="Size" class="has-text-right"}}File Size{{/t.sort-by}}
Expand All @@ -25,17 +25,17 @@
{{#t.body as |row|}}
{{fs-directory-entry path=path task=task entry=row.model}}
{{/t.body}}
{{else}}
<tbody>
<tr data-test-entry>
<td colspan="3">
{{x-icon "alert-circle-outline"}}
<span class="name" data-test-name>Directory is empty</span>
</td>
</tr>
</tbody>
{{/if}}
{{/list-table}}
{{/list-table}}
{{else}}
<div class="boxed-section-body">
<div data-test-empty-directory class="empty-message">
<h3 data-test-empty-directory-headline class="empty-message-headline">No Files</h3>
<p data-test-empty-directory-body class="empty-message-body">
Directory is currently empty.
</p>
</div>
</div>
{{/if}}
</div>
{{/if}}
{{else}}
Expand All @@ -46,4 +46,4 @@
</p>
</div>
{{/if}}
</section>
</section>
3 changes: 1 addition & 2 deletions ui/tests/acceptance/task-fs-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -344,8 +344,7 @@ module('Acceptance | task fs', function(hooks) {
test('viewing an empty directory', async function(assert) {
await FS.visitPath({ id: allocation.id, name: task.name, path: '/empty-directory' });

assert.equal(FS.directoryEntries.length, 1);
assert.ok(FS.directoryEntries[0].isEmpty);
assert.ok(FS.isEmptyDirectory);
});

test('viewing paths that produce stat API errors', async function(assert) {
Expand Down
3 changes: 2 additions & 1 deletion ui/tests/pages/allocations/task/fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ export default create({

isFile: isPresent('.icon-is-file-outline'),
isDirectory: isPresent('.icon-is-folder-outline'),
isEmpty: isPresent('.icon-is-alert-circle-outline'),

size: text('[data-test-size]'),
lastModified: text('[data-test-last-modified]'),
Expand All @@ -51,6 +50,8 @@ export default create({
path: attribute('href', 'a'),
}),

isEmptyDirectory: isPresent('[data-test-empty-directory]'),

directoryEntryNames() {
return this.directoryEntries.toArray().mapBy('name');
},
Expand Down