Update. We have upgraded our ACL System to allow the creation of reusable policies that can be applied to tokens. Read more about the changes and how to upgrade legacy tokens in our documentation.
{{/if}}
-
+ {{#let (sort-by (comparator 'token' sort.selected.key) items) as |sorted|}}
+
+ {{/let}}
+{{/let}}
diff --git a/ui-v2/tests/acceptance/dc/acls/tokens/navigation.feature b/ui-v2/tests/acceptance/dc/acls/tokens/navigation.feature
new file mode 100644
index 0000000000..b05e3ba7a3
--- /dev/null
+++ b/ui-v2/tests/acceptance/dc/acls/tokens/navigation.feature
@@ -0,0 +1,15 @@
+@setupApplicationTest
+Feature: dc / tokens / navigation
+ Scenario: Clicking a token in the listing and back again
+ Given 1 datacenter model with the value "dc-1"
+ And 3 token models
+ When I visit the tokens page for yaml
+ ---
+ dc: dc-1
+ ---
+ Then the url should be /dc-1/acls/tokens
+ And the title should be "Tokens - Consul"
+ Then I see 3 token models
+ When I click token on the tokens
+ And I click "[data-test-back]"
+ Then the url should be /dc-1/acls/tokens
diff --git a/ui-v2/tests/acceptance/dc/acls/tokens/sorting.feature b/ui-v2/tests/acceptance/dc/acls/tokens/sorting.feature
new file mode 100644
index 0000000000..5b97b72b39
--- /dev/null
+++ b/ui-v2/tests/acceptance/dc/acls/tokens/sorting.feature
@@ -0,0 +1,39 @@
+@setupApplicationTest
+Feature: dc / acls / tokens / sorting
+ Scenario: Sorting Tokens
+ Given 1 datacenter model with the value "dc-1"
+ And 4 token models from yaml
+ ---
+ - AccessorID: "00000000-0000-0000-0000-000000000001"
+ CreateTime: "2018-09-15T11:58:09.197Z"
+ - AccessorID: "00000000-0000-0000-0000-000000000002"
+ CreateTime: "2020-09-15T11:58:09.197Z"
+ - AccessorID: "00000000-0000-0000-0000-000000000003"
+ CreateTime: "2007-09-15T11:58:09.197Z"
+ - AccessorID: "00000000-0000-0000-0000-000000000004"
+ CreateTime: "2011-09-15T11:58:09.197Z"
+ ---
+ When I visit the tokens page for yaml
+ ---
+ dc: dc-1
+ ---
+ Then the url should be /dc-1/acls/tokens
+ Then I see 4 token models
+ When I click selected on the sort
+ When I click options.1.button on the sort
+ Then I see id on the tokens vertically like yaml
+ ---
+ - "00000000-0000-0000-0000-000000000003"
+ - "00000000-0000-0000-0000-000000000004"
+ - "00000000-0000-0000-0000-000000000001"
+ - "00000000-0000-0000-0000-000000000002"
+ ---
+ When I click selected on the sort
+ When I click options.0.button on the sort
+ Then I see id on the tokens vertically like yaml
+ ---
+ - "00000000-0000-0000-0000-000000000002"
+ - "00000000-0000-0000-0000-000000000001"
+ - "00000000-0000-0000-0000-000000000004"
+ - "00000000-0000-0000-0000-000000000003"
+ ---
\ No newline at end of file
diff --git a/ui-v2/tests/acceptance/page-navigation.feature b/ui-v2/tests/acceptance/page-navigation.feature
index c2648c77b3..0982c742ff 100644
--- a/ui-v2/tests/acceptance/page-navigation.feature
+++ b/ui-v2/tests/acceptance/page-navigation.feature
@@ -46,8 +46,7 @@ Feature: page-navigation
| node | nodes | /dc-1/nodes/node-0/health-checks | /v1/session/node/node-0?dc=dc-1&ns=@namespace | /dc-1/nodes |
| kv | kvs | /dc-1/kv/0-key-value/edit | /v1/session/info/ee52203d-989f-4f7a-ab5a-2bef004164ca?dc=dc-1&ns=@namespace | /dc-1/kv |
# | acl | acls | /dc-1/acls/anonymous | /v1/acl/info/anonymous?dc=dc-1 | /dc-1/acls |
-# These Endpoints will be datacenters due to the datacenters checkbox selectors
- | token | tokens | /dc-1/acls/tokens/ee52203d-989f-4f7a-ab5a-2bef004164ca | /v1/catalog/datacenters | /dc-1/acls/tokens |
+# These Endpoints will be datacenters due to the datacenters checkbox selectors | /dc-1/acls/tokens |
| policy | policies | /dc-1/acls/policies/ee52203d-989f-4f7a-ab5a-2bef004164ca | /v1/catalog/datacenters | /dc-1/acls/policies |
# | token | tokens | /dc-1/acls/tokens/00000000-0000-0000-0000-000000000000 | /v1/acl/token/00000000-0000-0000-0000-000000000000?dc=dc-1 | /dc-1/acls/tokens |
# | policy | policies | /dc-1/acls/policies/ee52203d-989f-4f7a-ab5a-2bef004164ca | /v1/acl/policy/ee52203d-989f-4f7a-ab5a-2bef004164ca?dc=dc-1 | /dc-1/acls/policies |
diff --git a/ui-v2/tests/acceptance/steps/dc/acls/tokens/navigation-steps.js b/ui-v2/tests/acceptance/steps/dc/acls/tokens/navigation-steps.js
new file mode 100644
index 0000000000..3231912b98
--- /dev/null
+++ b/ui-v2/tests/acceptance/steps/dc/acls/tokens/navigation-steps.js
@@ -0,0 +1,10 @@
+import steps from '../../../steps';
+
+// step definitions that are shared between features should be moved to the
+// tests/acceptance/steps/steps.js file
+
+export default function(assert) {
+ return steps(assert).then('I should find a file', function() {
+ assert.ok(true, this.step);
+ });
+}
diff --git a/ui-v2/tests/acceptance/steps/dc/acls/tokens/sorting-steps.js b/ui-v2/tests/acceptance/steps/dc/acls/tokens/sorting-steps.js
new file mode 100644
index 0000000000..3231912b98
--- /dev/null
+++ b/ui-v2/tests/acceptance/steps/dc/acls/tokens/sorting-steps.js
@@ -0,0 +1,10 @@
+import steps from '../../../steps';
+
+// step definitions that are shared between features should be moved to the
+// tests/acceptance/steps/steps.js file
+
+export default function(assert) {
+ return steps(assert).then('I should find a file', function() {
+ assert.ok(true, this.step);
+ });
+}
diff --git a/ui-v2/tests/pages.js b/ui-v2/tests/pages.js
index 3060bc11bf..af64436c8b 100644
--- a/ui-v2/tests/pages.js
+++ b/ui-v2/tests/pages.js
@@ -164,7 +164,7 @@ export default {
roles: create(roles(visitable, creatable, consulRoleList, freetextFilter)),
// TODO: This needs a policyList
role: create(role(visitable, submitable, deletable, cancelable, policySelector, tokenList)),
- tokens: create(tokens(visitable, creatable, text, consulTokenList, freetextFilter)),
+ tokens: create(tokens(visitable, creatable, text, consulTokenList, popoverSelect)),
token: create(
token(visitable, submitable, deletable, cancelable, clickable, policySelector, roleSelector)
),
diff --git a/ui-v2/tests/pages/dc/acls/tokens/index.js b/ui-v2/tests/pages/dc/acls/tokens/index.js
index 49f77fff1b..b08510794c 100644
--- a/ui-v2/tests/pages/dc/acls/tokens/index.js
+++ b/ui-v2/tests/pages/dc/acls/tokens/index.js
@@ -1,9 +1,9 @@
-export default function(visitable, creatable, text, tokens, filter) {
+export default function(visitable, creatable, text, tokens, popoverSelect) {
return {
visit: visitable('/:dc/acls/tokens'),
update: text('[data-test-notification-update]'),
tokens: tokens(),
- filter: filter(),
+ sort: popoverSelect(),
...creatable(),
};
}
diff --git a/ui-v2/yarn.lock b/ui-v2/yarn.lock
index 86567586cd..05d2bea0f9 100644
--- a/ui-v2/yarn.lock
+++ b/ui-v2/yarn.lock
@@ -1223,9 +1223,9 @@
js-yaml "^3.13.1"
"@hashicorp/consul-api-double@^3.0.0":
- version "3.1.3"
- resolved "https://registry.yarnpkg.com/@hashicorp/consul-api-double/-/consul-api-double-3.1.3.tgz#62f8780c8513e9b37f29302543c29143b4024141"
- integrity sha512-IZ90RK8g4/QPxQpRLnatwpBQh9Z3kQJjOGiUVz+CrSlXg4KRLhQCFFz/gI2vmhAXRACyTxIWuydPV6BcN4ptZA==
+ version "3.1.6"
+ resolved "https://registry.yarnpkg.com/@hashicorp/consul-api-double/-/consul-api-double-3.1.6.tgz#46095438b6989a12cab382a88fdb7b227d834794"
+ integrity sha512-mRH7X7k1zSu/Aq+rs5VoJYrIhD3pO57d+j98dicfs+3KaMO1mQYFYKgyugY/g0kY9FQH3+vySeZ0W5nQs45V1Q==
"@hashicorp/ember-cli-api-double@^3.1.0":
version "3.1.0"