-
Notifications
You must be signed in to change notification settings - Fork 4.4k
UI Secrets Sync: Destinations adapter add LIST #23716
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
Merged
hellobontempo
merged 25 commits into
ui/VAULT-17968/secrets-sync
from
ui/VAULT-21208/query-list-destinations
Oct 19, 2023
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
a07e039
add models
hellobontempo e2cd3b2
adapters
hellobontempo 17959ec
base model adapter
hellobontempo 96c8a05
update test response
hellobontempo 00b3f2b
Merge branch 'ui/VAULT-17968/secrets-sync' into ui/VAULT-21049/ember-…
hellobontempo 76ac9ba
add sync destinations helper
hellobontempo 2772cd6
finish renaming base destination model/adapter
hellobontempo 3fd98f0
add comment
hellobontempo 3e22e15
add serializer
hellobontempo 705f420
doc-link helper
hellobontempo 377807c
add version service
hellobontempo e238920
landing and overview component
hellobontempo 6b71489
Merge branch 'ui/VAULT-17968/secrets-sync' into ui/VAULT-21036/overvi…
hellobontempo 2a45393
overview page
hellobontempo 1fc759b
build out serializer and adapters
hellobontempo 59294ce
update mirage
hellobontempo 26e5890
Merge branch 'ui/VAULT-17968/secrets-sync' into ui/VAULT-21208/query-…
hellobontempo f31c2a1
fix merge conflicts
hellobontempo 4784436
one more conflict!
hellobontempo 59a0a86
pull transformQueryResponse to separate method in adapter
hellobontempo 8d186c1
move data transforming all to serializer and tests
hellobontempo 0799124
add note to paginationd ocs
hellobontempo 9d380de
conditionally render CTA
hellobontempo 264554e
add lazyPaginatedQuery method to destinations route
hellobontempo c90f169
remove partial error
hellobontempo 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 hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
|
@@ -43,7 +43,7 @@ The `size` param defaults to the default page size set in [the app config](../co | |
|
||
### Serializing | ||
|
||
In order to interrupt the regular serialization when using `lazyPaginatedData`, define `extractLazyPaginatedData` on the modelType's serializer. This will be called with the raw response before being cached on the store. | ||
In order to interrupt the regular serialization when using `lazyPaginatedData`, define `extractLazyPaginatedData` on the modelType's serializer. This will be called with the raw response before being cached on the store. `extractLazyPaginatedData` should return an array of objects. | ||
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. 🎉 |
||
|
||
## Gotchas | ||
|
||
|
This file contains hidden or 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 hidden or 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,17 @@ | ||
/** | ||
* Copyright (c) HashiCorp, Inc. | ||
* SPDX-License-Identifier: BUSL-1.1 | ||
*/ | ||
|
||
import Route from '@ember/routing/route'; | ||
import { inject as service } from '@ember/service'; | ||
|
||
import type StoreService from 'vault/services/store'; | ||
|
||
export default class SyncSecretsRoute extends Route { | ||
@service declare readonly store: StoreService; | ||
|
||
async model() { | ||
return this.store.query('sync/destination', {}).catch(() => []); | ||
} | ||
} |
This file contains hidden or 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,26 @@ | ||
/** | ||
* Copyright (c) HashiCorp, Inc. | ||
* SPDX-License-Identifier: BUSL-1.1 | ||
*/ | ||
|
||
import Route from '@ember/routing/route'; | ||
import { inject as service } from '@ember/service'; | ||
|
||
import type StoreService from 'vault/services/store'; | ||
|
||
interface SyncSecretsDestinationsRouteParams { | ||
page: string; | ||
pageFilter: string; | ||
} | ||
|
||
export default class SyncSecretsDestinationsRoute extends Route { | ||
@service declare readonly store: StoreService; | ||
|
||
async model(params: SyncSecretsDestinationsRouteParams) { | ||
return this.store.lazyPaginatedQuery('sync/destination', { | ||
page: Number(params.page) || 1, | ||
pageFilter: params.pageFilter, | ||
responsePath: 'data.keys', | ||
}); | ||
} | ||
} |
This file contains hidden or 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 |
---|---|---|
@@ -1 +1,6 @@ | ||
<Secrets::Page::Overview /> | ||
{{! | ||
Copyright (c) HashiCorp, Inc. | ||
SPDX-License-Identifier: BUSL-1.1 | ||
~}} | ||
|
||
<Secrets::Page::Overview @shouldRenderOverview={{this.model.length}} /> |
This file contains hidden or 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 |
---|---|---|
|
@@ -24,6 +24,7 @@ export default function (server) { | |
} | ||
return keyInfo; | ||
}, {}), | ||
keys: records.map((r) => r.type), | ||
}, | ||
}; | ||
}); | ||
|
@@ -33,6 +34,7 @@ export default function (server) { | |
if (record) { | ||
delete record.type; | ||
delete record.name; | ||
delete record.id; | ||
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. 🎉 |
||
return { | ||
data: { | ||
connection_details: record, | ||
|
This file contains hidden or 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 hidden or 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
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.
I would love to figure out how to still extend the
ApplicationSerializer
while being able to usenormalizeFindRecordResponse
rather than conditionally targeting therequestType
but this does the trick.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.
Yeah...I couldn't find a way around this. I tried a few things like just interrupt
normalizeItems
and returnpayload
but I got aMaximum call stack exceeded
error 🙃