mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 02:15:43 +03:00
Secure Variables: show file metadata on list pages (#13423)
* Add modified times and namespaces to layout * Undo typing change * Post-hoc accounting for new variable path routing
This commit is contained in:
@@ -3,11 +3,17 @@
|
||||
<th>
|
||||
Path
|
||||
</th>
|
||||
<th>
|
||||
Namespace
|
||||
</th>
|
||||
<th>
|
||||
Last Modified
|
||||
</th>
|
||||
</t.head>
|
||||
<tbody>
|
||||
{{#each this.folders as |folder|}}
|
||||
<tr data-test-folder-row {{on "click" (fn this.handleFolderClick folder.data.absolutePath)}}>
|
||||
<td>
|
||||
<td colspan="3">
|
||||
<span>
|
||||
<FlightIcon @name="folder" />
|
||||
<LinkTo @route="variables.path" @model={{folder.data.absolutePath}}>
|
||||
@@ -29,6 +35,14 @@
|
||||
{{file.name}}
|
||||
</LinkTo>
|
||||
</td>
|
||||
<td>
|
||||
{{file.variable.namespace}}
|
||||
</td>
|
||||
<td>
|
||||
<span class="tooltip" aria-label="{{format-ts file.variable.modifyTime}}">
|
||||
{{moment-from-now file.variable.modifyTime}}
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
{{/each}}
|
||||
|
||||
|
||||
@@ -7,6 +7,10 @@ export default Factory.extend({
|
||||
return this.id;
|
||||
},
|
||||
namespace: 'default',
|
||||
createdIndex: 100,
|
||||
modifiedIndex: 100,
|
||||
createTime: () => faker.date.past(15),
|
||||
modifyTime: () => faker.date.recent(1),
|
||||
items() {
|
||||
return (
|
||||
this.Items || {
|
||||
|
||||
@@ -83,7 +83,7 @@ module('Acceptance | secure variables', function (hooks) {
|
||||
await click(fooLink);
|
||||
assert.equal(
|
||||
currentURL(),
|
||||
'/variables/a/b/c/foo0',
|
||||
'/variables/var/a/b/c/foo0',
|
||||
'correctly traverses to a deeply nested variable file'
|
||||
);
|
||||
const deleteButton = find('[data-test-delete-button] button');
|
||||
|
||||
@@ -77,21 +77,21 @@ module('Integration | Component | variable-paths', function (hooks) {
|
||||
.dom('tbody tr:first-child td:first-child a')
|
||||
.hasAttribute(
|
||||
'href',
|
||||
'/ui/variables/foo/bar/baz',
|
||||
'/ui/variables/var/foo/bar/baz',
|
||||
'Correctly links the first file'
|
||||
);
|
||||
assert
|
||||
.dom('tbody tr:nth-child(2) td:first-child a')
|
||||
.hasAttribute(
|
||||
'href',
|
||||
'/ui/variables/foo/bar/bay',
|
||||
'/ui/variables/var/foo/bar/bay',
|
||||
'Correctly links the second file'
|
||||
);
|
||||
assert
|
||||
.dom('tbody tr:nth-child(3) td:first-child a')
|
||||
.hasAttribute(
|
||||
'href',
|
||||
'/ui/variables/foo/bar/bax',
|
||||
'/ui/variables/var/foo/bar/bax',
|
||||
'Correctly links the third file'
|
||||
);
|
||||
assert
|
||||
|
||||
Reference in New Issue
Block a user