ui: [BUGFIX] Role/Policy selector default sort (#9434)

* Sort the options when they aren't being searched
This commit is contained in:
John Cowen 2021-01-04 18:28:35 +00:00 committed by GitHub
parent 2c84b76469
commit 8c9d5ecc2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 5 deletions

View File

@ -23,7 +23,7 @@
<PowerSelect
@searchEnabled={{true}}
@search={{action collection.search}}
@options={{options}}
@options={{sort-by 'Name:asc' options}}
@loadingMessage="Loading..."
@searchMessage="No possible options"
@searchPlaceholder={{placeholder}}

View File

@ -10,10 +10,10 @@ Feature: dc / acls / policies / as many / add existing: Add existing policy
---
And 2 policy models from yaml
---
- ID: policy-1
Name: Policy 1
- ID: policy-2
Name: Policy 2
- ID: policy-1
Name: Policy 1
---
When I visit the [Model] page for yaml
---
@ -22,6 +22,7 @@ Feature: dc / acls / policies / as many / add existing: Add existing policy
---
Then the url should be /datacenter/acls/[Model]s/key
And I click "form > #policies .ember-power-select-trigger"
And I see the text "Policy 1" in ".ember-power-select-option:first-child"
And I type "Policy 1" into ".ember-power-select-search-input"
And I click ".ember-power-select-option:first-child"
And I see 1 policy model on the policies component

View File

@ -10,10 +10,10 @@ Feature: dc / acls / roles / as many / add existing: Add existing
---
And 2 role models from yaml
---
- ID: role-1
Name: Role 1
- ID: role-2
Name: Role 2
- ID: role-1
Name: Role 1
---
When I visit the token page for yaml
---
@ -22,6 +22,7 @@ Feature: dc / acls / roles / as many / add existing: Add existing
---
Then the url should be /datacenter/acls/tokens/key
And I click "form > #roles .ember-power-select-trigger"
And I see the text "Role 1" in ".ember-power-select-option:first-child"
And I type "Role 1" into ".ember-power-select-search-input"
And I click ".ember-power-select-option:first-child"
And I see 1 role model on the roles component