-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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: ACL Roles cont. plus Service Identities #5661
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
johncowen
force-pushed
the
feature/ui-roles
branch
from
April 17, 2019 09:04
311ada5
to
7926b85
Compare
johncowen
force-pushed
the
feature/ui-service-identities
branch
from
April 17, 2019 09:05
ffd11de
to
f606028
Compare
johncowen
changed the title
UI: Service Identities
UI: ACL Roles cont. plus Service Identities
Apr 24, 2019
johncowen
force-pushed
the
feature/ui-roles
branch
from
April 29, 2019 11:31
7926b85
to
8a822fb
Compare
1. Tweak readonly support 2. Allow HTML like block component syntax (using a component body)
...treat ServiceIdentities as templated Policies Policies use a default blank template
1. Add comments for reminding and yet todo at some point 2. Use '' instead of default for the template name
We always has the 'click $property on the $component component'-like steps This was never going to be sufficient longer term, and with the form within form layouts we needed something so we can traverse deeper into page objects. This add javascript like traversing for some of the scenario steps (to be expanded upon at a later date) so you can use dot syntax like 'roles.form.policies.form.selectedOptions.0' Note this also adds the ability to 'select' indexes on collections using '.0' or '.1' etc. But we are keeping the default to the first element if you don't specify an index as it reads nicver. Lastly, this amends the tests that required this
1. Uses a radioGroupName attribute on the component to set this easily to avoid 2 modals/forms on the same page using the same HTML radiogroup
1. Begin to add more components for the page objects 2. Fix up other tests as I go along need to refer to deeper page object components (we'd been lucky enough to be able to reuse things previously) 3. The tests for Deleting Things were all together in the same feature file. Things are becoming more different now so we start to move these out into their own 'model' here, starting with policies
Follows the 'as-many' directory structure (so roles/as-many) so the model can be tests 'as-many' or as a child of something else. This way we can use test tables to bring down the repetition
Resulted in cleaning up the Policy/as-many mixin a little more
In order to use the functionality of the child-selector it has to be present in the page as the form component is saved. As we'd used javascript state to toggle the visibility of the selector and the form, the selector wasn't present to add the newly saved item as a child. This reverts to using a CSS/HTML state so all the things we need are on the page when we need them
johncowen
force-pushed
the
feature/ui-service-identities
branch
from
April 29, 2019 11:32
14636de
to
fa17fc8
Compare
pearkes
approved these changes
May 1, 2019
* ui: Integrate new pills with icons 1. Introduce the idea of 'policy types' instead of just 'is-management' with a new policy/typeof helper 2. Add placeholders for all structure icons, and start replacing the older ones. 3. %pills no default to transparent, the gray is added at a project level 4. Started to introduce a saner way to size tables, basically sane defaults with the ability to overwrite for the more involved tables * ui: general CSS refactor 1. Mainly working on tables, all tds are now inline-flex 2. The inline flex meant we could remove a lot of cruft and spacing from other areas 3. Spotted an area that wasn't using {{tag-list}} * ui: make sure default helper test passes * ui: adds missing hasActions class, plus all tables are a minimum 3 rows * ui: fix too narrow policy listing detail view specifically in edit role * ui: Adds extra icons to policy-selector tables to distinguish types This adds a 'service' icon to service identity type policies and a 'star' icon to the global management type policies
johncowen
added a commit
that referenced
this pull request
May 1, 2019
Adds support for ACL Roles and Service Identities CRUD, along with necessary changes to Tokens, and the CSS improvements required. Also includes refinements/improvements for easier testing of deeply nested components. 1. ember-data adapter/serializer/model triplet for Roles 2. repository, form/validations and searching filter for Roles 3. Moves potentially, repeated, or soon to to repeated functionality into a mixin (mainly for 'many policy' relationships) 4. A few styling tweaks for little edge cases around roles 5. Router additions, Route, Controller and templates for Roles Also see: * UI: ACL Roles cont. plus Service Identities (#5661 and #5720)
johncowen
added a commit
that referenced
this pull request
May 1, 2019
Adds support for ACL Roles and Service Identities CRUD, along with necessary changes to Tokens, and the CSS improvements required. Also includes refinements/improvements for easier testing of deeply nested components. 1. ember-data adapter/serializer/model triplet for Roles 2. repository, form/validations and searching filter for Roles 3. Moves potentially, repeated, or soon to to repeated functionality into a mixin (mainly for 'many policy' relationships) 4. A few styling tweaks for little edge cases around roles 5. Router additions, Route, Controller and templates for Roles Also see: * UI: ACL Roles cont. plus Service Identities (#5661 and #5720)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR continues on from #5635 and adds 'Service Identities' to the UI.
Service Identities
Service Identities are more or less the same thing as Policies in that they are essentially a Policy with a predefined Rules template which you can see here.
As each Service Identity only needs a ServiceName to produce the templated Policy, only the ServiceNames are saved via the API (as a list/array on the parent object) for example
In terms of the UI, we present the same form for creating/editing a ServiceIdentity as we do for creating/editing a Policy:
And we treat them in the UI as a 'type' of Policy, as essentially that is what they are. There is also potential down the line for further templated Policies, so we've added a new 'template' field to the Policy objects, normal Policies having an empty template.
This work contains serialization/normalization to reflect that, following the current project conventions in
handleResponse
anddataForRequest
(#5637 🔜 will move this into the serializer usingrespondFor...
). We did this using Adapter Mixins as we need the functionality forPolicies
andRoles
, this should also make it trivial to move it elsewhere when we need to.Other
{{code-editor}} changes
We have a
{{code-editor}}
component which wrapsivy-codemirror
. We did 2 things here:<textarea>
:name
->type
The form components from #5635 now use a
type
attribute rather thanname
(thinking here being:<input type="text" />
,<Form type="policy" />
)Tests
The nested nature of the modals (
tokens > policies
,roles > policies
,tokens > roles > policies
) here also meant we needed to create a similar nested approach for our PageObjects, and a way to select/find deeply nested PageObjects using our Gherkin steps. We've added the ability to deeply select/find PageObjects via our Gherkin steps using dot syntax with steps like:This will also now let us select/find certain indexes in lists:
And I click actions on the roles.form.policies.10
The grammar isn't quite ideal here but thats something we can look at at a later date. We've also maintained the past grammar, but moving forwards we'll deprecate that and work to merge some of the repetitive code used in the steps - you can see the beginnings of some of this work here
We also moved some of our acceptance tests that use policies and roles so we can make better used of looping/tables. Previously we would have had to repeat tests in
dc/acls/tokens/policies
anddc/acls/roles/policies
, so we instead madedc/acls/policies/as-many
and loop over bothtokens
androles
for each test in here.Lastly, similar to the previous #5635 PR this is not quite how we'd like to do this. We've briefly discussed this with @meirish , but ideally it requires a deeper RFC which we plan to follow up with.