-
Notifications
You must be signed in to change notification settings - Fork 4.7k
UI: Migrate <ConfigureAwsSecret /> to HDS & TS #27367
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,141 @@ | ||
| {{! | ||
| Copyright (c) HashiCorp, Inc. | ||
| SPDX-License-Identifier: BUSL-1.1 | ||
| ~}} | ||
|
|
||
| <Hds::Tabs class="has-top-margin-l" as |T|> | ||
| <T.Tab data-test-tab="access-to-aws"> | ||
| Dynamic IAM root credentials | ||
| </T.Tab> | ||
| <T.Tab data-test-tab="lease"> | ||
| Leases | ||
| </T.Tab> | ||
| <T.Panel> | ||
| <form | ||
| onsubmit={{action | ||
| "saveRootCreds" | ||
|
Comment on lines
+13
to
+16
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd say wait for the new designs first. We just spoke in standup about how KVv2 create also makes two network requests on save. I think it's in the same component but rendered conditionally. Also, something to keep in mind, do we need to make new components if they're not consumed elsewhere or is one configuration create component sufficient and separates the concerns clearly?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
ah mk, if designs are going to change i can hold off, although i do already have PRs ready for them (see links in my first comment) 😅
whatcha mean by this? this component is only used when configuring an AWS secret engine. is there something else behind the scenes i'm missing?
very fair question! there are a couple reasons why i often opt for splitting components up, even if they're not reused:
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
If we move away from these tabs and have only one view, then this will become a similar scenario to KVv2 create. Chelsea brought this up as example—it's just another create page that makes two network requests and both endpoints have different permission checks because they're different paths—similar to aws configure with /root vs /leases. It was just an example we could turn to if we needed to see how we handled a similar situation. Yankun is working on the designs today so they should be done soon but I suspect we'll move to one create view with now tabs. And for splitting up in components, thank you for the thoughts. Testing is a great point, and with that in mind splitting into two components makes sense. I'll check out your current WIP prs and any thoughts and feelings I'll put there, but please feel free to continue on that work. |
||
| (hash access_key=@accessKey iam_endpoint=@iamEndpoint sts_endpoint=@stsEndpoint secret_key=@secretKey region=@region) | ||
| }} | ||
| data-test-aws-root-creds-form="true" | ||
| aria-label="save root creds form" | ||
| > | ||
| <div class="box is-fullwidth is-shadowless is-marginless"> | ||
| <NamespaceReminder @mode="save" @noun="configuration" /> | ||
| <p class="has-text-grey-dark"> | ||
| Note: the client uses the official AWS SDK and will use the specified credentials, environment credentials, shared | ||
| file credentials, or IAM role/ECS task credentials in that order. | ||
| </p> | ||
| </div> | ||
|
|
||
| <div class="field"> | ||
| <label for="access" class="is-label"> | ||
| Access key | ||
| </label> | ||
| <div class="control"> | ||
| <Input | ||
| @type="text" | ||
| id="access" | ||
| name="access" | ||
| class="input" | ||
| autocomplete="off" | ||
| spellcheck="false" | ||
| @value={{@accessKey}} | ||
| data-test-aws-input="accessKey" | ||
| /> | ||
| </div> | ||
| </div> | ||
|
|
||
| <div class="field"> | ||
| <label for="secret" class="is-label"> | ||
| Secret key | ||
| </label> | ||
| <div class="control"> | ||
| <Input | ||
| @type="password" | ||
| id="secret" | ||
| name="secret" | ||
| class="input" | ||
| @value={{@secretKey}} | ||
| data-test-aws-input="secretKey" | ||
| /> | ||
| </div> | ||
| </div> | ||
|
|
||
| <ToggleButton @isOpen={{this.showOptions}} @onClick={{fn (mut this.showOptions)}} /> | ||
| {{#if this.showOptions}} | ||
| <div class="box is-marginless"> | ||
| <div class="field"> | ||
| <label for="region" class="is-label"> | ||
| Region | ||
| </label> | ||
| <div class="control is-expanded"> | ||
| <div class="select is-fullwidth"> | ||
| <select | ||
| name="region" | ||
| id="region" | ||
| onchange={{action (mut @region) value="target.value"}} | ||
| data-test-input="region" | ||
| > | ||
| <option value=""></option> | ||
| {{#each (aws-regions) as |val|}} | ||
| <option>{{val}}</option> | ||
| {{/each}} | ||
| </select> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| <div class="field"> | ||
| <label for="iam" class="is-label"> | ||
| IAM endpoint | ||
| </label> | ||
| <div class="control"> | ||
| <Input @type="text" id="iam" name="iam" class="input" @value={{@iamEndpoint}} /> | ||
| </div> | ||
| </div> | ||
| <div class="field"> | ||
| <label for="sts" class="is-label"> | ||
| STS endpoint | ||
| </label> | ||
| <div class="control"> | ||
| <Input @type="text" id="sts" name="sts" class="input" @value={{@stsEndpoint}} /> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| {{/if}} | ||
|
|
||
| <div class="box is-bottomless is-fullwidth"> | ||
| <Hds::Button @text="Save" data-test-aws-input="root-save" type="submit" /> | ||
| </div> | ||
| </form> | ||
| </T.Panel> | ||
| <T.Panel> | ||
| <form | ||
| onsubmit={{action "saveLease" (hash lease=@model.lease lease_max=@model.leaseMax)}} | ||
| aria-label="save lease form" | ||
| data-test-aws-leases-form="true" | ||
| > | ||
| <div class="box is-fullwidth is-shadowless is-marginless"> | ||
| <NamespaceReminder @mode="saved" @noun="configuration" /> | ||
| <MessageError @model={{@model}} /> | ||
| <p class="has-text-grey-dark"> | ||
| If you do not supply lease settings, we will use the default values in AWS. | ||
| </p> | ||
| </div> | ||
| <TtlPicker | ||
| @label="Lease" | ||
| @initialValue={{@model.lease}} | ||
| @initialEnabled={{@model.lease}} | ||
| @onChange={{fn this.handleTtlChange "lease"}} | ||
| /> | ||
| <TtlPicker | ||
| @label="Maximum Lease" | ||
| @initialValue={{@model.leaseMax}} | ||
| @initialEnabled={{@model.leaseMax}} | ||
| @onChange={{fn this.handleTtlChange "leaseMax"}} | ||
| /> | ||
| <div class="box is-bottomless is-fullwidth"> | ||
| <Hds::Button @text="Save" data-test-aws-input="lease-save" type="submit" /> | ||
| </div> | ||
| </form> | ||
| </T.Panel> | ||
| </Hds::Tabs> | ||
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one thing to note -- this page was previously using query params to keep track of which tabs were selected. if this is helpful for ensuring users can copy/paste a URL with a tab pre-selected i can totally add that back in, just wanted to make sure it was necessary first. 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the new designs Yankun is working on will remove tabs all together. That aside, I think removing queryParams here is okay because given the fact this page never properly transitioned after save I suspect it's not being used as much as we'd hope.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, good to know! should i look into fixing the transition?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two thoughts on the transition:
I think ideally, we'd do number 1, but only if it was easy to both fix and backport—otherwise, we can proceed with a fix in this aws 1.18.x work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point, let's do #1. thanks!