-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Create sections for Secrets sync destination fields for create/edit view #27538
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
15d115b
initial shuffling of credentials and advanced configuration options
Monkeychip af4c517
update all destination models
Monkeychip 90982df
wip changelog
Monkeychip 895127e
Update 27538.txt
Monkeychip 19b13f6
remove custom_tags from gh
Monkeychip 7448156
Merge branch 'main' into ui/VAULT-28051-add-gh-destination
Monkeychip fb3f947
missed vercel and remove custom_tags from base
Monkeychip d708bf9
Merge branch 'main' into ui/VAULT-28051-add-gh-destination
Monkeychip 466c17d
refactor conditional logic on templace
Monkeychip 4c1712e
things
Monkeychip 8fbcbd9
Merge branch 'main' into ui/VAULT-28051-add-gh-destination
Monkeychip 6ebf0e2
test coverage and dynamic subText
Monkeychip b2887c9
add assert to not see enableInput on create
Monkeychip d6c3e2d
Merge branch 'main' into ui/VAULT-28051-add-gh-destination
Monkeychip 5d653fe
clean up
Monkeychip ef2fbe4
Merge branch 'main' into ui/VAULT-28051-add-gh-destination
Monkeychip 2acb753
remove extra parens
Monkeychip ddf4757
test clean up to clarify what the header subtext vs breadcrumb transi…
Monkeychip File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
```release-note:improvement | ||
ui: Creates separate section for updating sensitive creds for Secrets sync create/edit view. | ||
``` |
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
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,7 +44,7 @@ module('Integration | Component | sync | Secrets::Page::Destinations::CreateAndE | |
}; | ||
}); | ||
|
||
test('create: it renders and navigates back to create on cancel', async function (assert) { | ||
test('create: it renders breadcrumbs and navigates back to create on cancel', async function (assert) { | ||
assert.expect(2); | ||
const { type } = SYNC_DESTINATIONS[0]; | ||
this.model = this.store.createRecord(`sync/destinations/${type}`, { type }); | ||
|
@@ -56,21 +56,57 @@ module('Integration | Component | sync | Secrets::Page::Destinations::CreateAndE | |
assert.true(transition, 'transitions to vault.cluster.sync.secrets.destinations.create on cancel'); | ||
}); | ||
|
||
test('edit: it renders and navigates back to details on cancel', async function (assert) { | ||
test('create: it renders headers and fieldGroups subtext', async function (assert) { | ||
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. 👏 |
||
assert.expect(4); | ||
const { type } = SYNC_DESTINATIONS[0]; | ||
this.model = this.store.createRecord(`sync/destinations/${type}`, { type }); | ||
|
||
await this.renderFormComponent(); | ||
assert | ||
.dom(PAGE.form.fieldGroupHeader('Credentials')) | ||
.hasText('Credentials', 'renders credentials section on create'); | ||
assert | ||
.dom(PAGE.form.fieldGroupHeader('Advanced configuration')) | ||
.hasText('Advanced configuration', 'renders advanced configuration section on create'); | ||
assert | ||
.dom(PAGE.form.fieldGroupSubtext('Credentials')) | ||
.hasText('Connection credentials are sensitive information used to authenticate with the destination.'); | ||
assert | ||
.dom(PAGE.form.fieldGroupSubtext('Advanced configuration')) | ||
.hasText('Configuration options for the destination.'); | ||
}); | ||
|
||
test('edit: it renders breadcrumbs and navigates back to details on cancel', async function (assert) { | ||
assert.expect(2); | ||
this.model = this.generateModel(); | ||
|
||
await this.renderFormComponent(); | ||
assert.dom(PAGE.breadcrumbs).hasText('Secrets Sync Destinations Destination Edit Destination'); | ||
assert.dom('h2').hasText('Credentials', 'renders credentials section on edit'); | ||
|
||
await click(PAGE.cancelButton); | ||
const transition = this.transitionStub.calledWith('vault.cluster.sync.secrets.destinations.destination'); | ||
assert.true(transition, 'transitions to vault.cluster.sync.secrets.destinations.destination on cancel'); | ||
}); | ||
|
||
test('edit: it renders headers and fieldGroup subtext', async function (assert) { | ||
assert.expect(4); | ||
this.model = this.generateModel(); | ||
|
||
await this.renderFormComponent(); | ||
assert | ||
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. moved this into a subtext specific test |
||
.dom('p.hds-foreground-faint') | ||
.dom(PAGE.form.fieldGroupHeader('Credentials')) | ||
.hasText('Credentials', 'renders credentials section on edit'); | ||
assert | ||
.dom(PAGE.form.fieldGroupHeader('Advanced configuration')) | ||
.hasText('Advanced configuration', 'renders advanced configuration section on edit'); | ||
assert | ||
.dom(PAGE.form.fieldGroupSubtext('Credentials')) | ||
.hasText( | ||
'Connection credentials are sensitive information and the value cannot be read. Enable the input to update.' | ||
); | ||
await click(PAGE.cancelButton); | ||
const transition = this.transitionStub.calledWith('vault.cluster.sync.secrets.destinations.destination'); | ||
assert.true(transition, 'transitions to vault.cluster.sync.secrets.destinations.destination on cancel'); | ||
assert | ||
.dom(PAGE.form.fieldGroupSubtext('Advanced configuration')) | ||
.hasText('Configuration options for the destination.'); | ||
}); | ||
|
||
test('edit: it PATCH updates custom_tags', async function (assert) { | ||
|
@@ -236,7 +272,7 @@ module('Integration | Component | sync | Secrets::Page::Destinations::CreateAndE | |
const filteredObfuscatedFields = this.model.formFields.filter((field) => | ||
obfuscatedFields.includes(field.name) | ||
); | ||
assert.expect(filteredObfuscatedFields.length); | ||
assert.expect(filteredObfuscatedFields.length * 2); | ||
await this.renderFormComponent(); | ||
// iterate over the form fields and filter for those that are obfuscated | ||
// fill those in and assert that they are masked | ||
|
@@ -246,6 +282,9 @@ module('Integration | Component | sync | Secrets::Page::Destinations::CreateAndE | |
assert | ||
.dom(PAGE.maskedInput(field.name)) | ||
.hasClass('masked-font', `it renders ${field.name} for ${destination} with masked font`); | ||
assert | ||
.dom(PAGE.form.enableInput(field.name)) | ||
.doesNotExist(`it does not render enable input for ${field.name}`); | ||
}); | ||
}); | ||
|
||
|
Oops, something went wrong.
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.
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.
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 went this exact same route, but it fails to read the args. It might be because I'm iterating over via a each and then each-in and then an each again, but passing in via the template solved the problem
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.
strange! it must be how the template helper functions compile 🤔