Skip to content
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

Enable generated items for more auth methods #7513

Merged
merged 73 commits into from
Oct 17, 2019
Merged
Show file tree
Hide file tree
Changes from 67 commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
3b362cf
enable auth method item configuration in go code
Sep 25, 2019
c1674de
properly parse and list generated items
Sep 25, 2019
a018669
make sure we only set name on attrs if a label comes from openAPI
Sep 25, 2019
ff30535
correctly construct paths object for method index route
Sep 25, 2019
f6c5d83
set sensitive property on password for userpass
Sep 25, 2019
af7639e
remove debugger statements
Sep 25, 2019
6fbc18b
pass method model to list route template to use paths on model for tabs
Sep 26, 2019
69be01c
update tab generation in generated item list, undo enabling userpass …
Sep 26, 2019
5078fd8
enable openapi generated itams for certs and userpass, update ldap to…
Sep 27, 2019
200210e
add editType to DisplayAttributes, pull tokenutil fields into field g…
Sep 27, 2019
9e503d0
show sensitive message for sensitive fields displayed in fieldGroupSh…
Sep 27, 2019
b80d10e
grab sensitive and editType fields from displayAttrs in openapi-to-at…
Sep 27, 2019
54f8568
make sure we don't ask for paths for secret backends since that isn't…
Sep 27, 2019
bbc4824
fix styling of sensitive text for fieldGroupShow component
Sep 27, 2019
f7caf20
update openapi-to-attrs util test to no longer include label by defau…
Sep 27, 2019
c8dbec2
properly log errors to the console
andaley Oct 8, 2019
b1803ed
capitalize This value is sensitive...
andaley Oct 8, 2019
1666872
get rid of extra padding on bottom of fieldgroupshow
andaley Oct 8, 2019
3e468e4
make auth methods clickable and use new confirm ux
andaley Oct 8, 2019
4851bb5
Update sdk/framework/path.go
Oct 9, 2019
0791598
Update sdk/framework/path.go
Oct 9, 2019
f8fc768
add whitespace
andaley Oct 9, 2019
9d05de0
return intErr instead of err
andaley Oct 9, 2019
4555e66
uncomment out helpUrl because we need it
andaley Oct 10, 2019
80eff2d
remove extra box class
andaley Oct 10, 2019
254d495
use const instead of let
andaley Oct 10, 2019
66b8f9f
remove extra conditional since we already split the pathName later on
andaley Oct 10, 2019
6ce2e04
ensure we request the correct url when listing generated items
andaley Oct 10, 2019
4a096ae
use const
andaley Oct 10, 2019
68ba6e9
link to list and show pages
andaley Oct 11, 2019
ed6a07a
remove dead code
andaley Oct 11, 2019
3984b66
show nested item name instead of id
andaley Oct 11, 2019
2efd7dd
add comments
andaley Oct 11, 2019
8c58198
show tooltip for text-file inputs
andaley Oct 11, 2019
40d4f42
fix storybook
andaley Oct 11, 2019
cde6b56
remove extra filter
andaley Oct 11, 2019
cc3d6e7
add TODOs
andaley Oct 11, 2019
fe570f4
add comments
andaley Oct 11, 2019
c6f90ad
comment out unused variables but leave them in function signature
andaley Oct 11, 2019
8763d2d
only link to auth methods that can be fully managed in the ui
andaley Oct 14, 2019
197b2ef
Merge branch 'master' into ui-generated-items
Oct 14, 2019
685ec87
clean up comments
andaley Oct 14, 2019
d6a6667
Merge branch 'ui-generated-items' of https://github.com/hashicorp/vau…
andaley Oct 14, 2019
00d7e2a
only render tooltip if there is helpText
andaley Oct 14, 2019
accca31
rename id authMethodPath
andaley Oct 14, 2019
797a127
remove optionsForQuery since we don't need it
andaley Oct 14, 2019
eb00a9c
add indentation
andaley Oct 14, 2019
7c8c8ca
standardize ConfirmMessage and show model name instead of id when edi…
andaley Oct 15, 2019
050d08b
standardize ConfirmMessage and show model name instead of id when edi…
andaley Oct 15, 2019
e4f0b58
add comments
andaley Oct 15, 2019
bed1949
post to the correct updateUrl so we can edit users and groups
andaley Oct 15, 2019
b102a33
Merge branch 'ui-generated-items' of https://github.com/hashicorp/vau…
andaley Oct 15, 2019
db081ac
use pop instead of slice
andaley Oct 15, 2019
0de5c4d
add TODO for finding a better way to store ids
andaley Oct 15, 2019
e932a61
ensure ids are handled the same way on list and show pages; fix editi…
andaley Oct 15, 2019
bde3887
Merge branch 'master' into ui-generated-items
Oct 15, 2019
624c00d
Merge branch 'master' into ui-generated-items
Oct 15, 2019
41a4fc5
add comment about difference between list and show urls
andaley Oct 15, 2019
10a1cc7
use model.id instead of name since we do not need it
andaley Oct 15, 2019
8fe2f93
remove dead code
andaley Oct 15, 2019
8aee523
ensure list pages have page headers
andaley Oct 15, 2019
3a5b559
Merge branch 'ui-generated-items' of https://github.com/hashicorp/vau…
andaley Oct 15, 2019
8df98e6
standardize using authMethodPath instead of method and remove dead code
andaley Oct 15, 2019
8dc6c98
i love indentation
andaley Oct 15, 2019
7374206
remove more dead code
andaley Oct 16, 2019
84ddaab
Merge branch 'master' into ui-generated-items
Oct 16, 2019
75c461e
Merge branch 'master' into ui-generated-items
Oct 16, 2019
47b44b9
use new Confirm
andaley Oct 16, 2019
31bcd09
Merge branch 'ui-generated-items' of https://github.com/hashicorp/vau…
andaley Oct 16, 2019
a25301c
show correct flash message when deleting an item
andaley Oct 16, 2019
5797336
update flash message for creating and updating
andaley Oct 16, 2019
34db27d
use plus icon for creating group/user instead of an arrow
andaley Oct 16, 2019
d3f797b
Merge branch 'master' into ui-generated-items
Oct 17, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions builtin/credential/cert/path_certs.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ func pathListCerts(b *backend) *framework.Path {

HelpSynopsis: pathCertHelpSyn,
HelpDescription: pathCertHelpDesc,
DisplayAttrs: &framework.DisplayAttributes{
Navigation: true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this boolean describes whether the item should have a tab in the navigation:

image

ItemType: "Certificate",
},
}
}

Expand All @@ -39,6 +43,9 @@ func pathCerts(b *backend) *framework.Path {
Type: framework.TypeString,
Description: `The public certificate that should be trusted.
Must be x509 PEM encoded.`,
DisplayAttrs: &framework.DisplayAttributes{
EditType: "file",
andaley marked this conversation as resolved.
Show resolved Hide resolved
},
},

"allowed_names": &framework.FieldSchema{
Expand All @@ -47,36 +54,57 @@ Must be x509 PEM encoded.`,
At least one must exist in either the Common Name or SANs. Supports globbing.
This parameter is deprecated, please use allowed_common_names, allowed_dns_sans,
allowed_email_sans, allowed_uri_sans.`,
DisplayAttrs: &framework.DisplayAttributes{
Group: "Constraints",
},
},

"allowed_common_names": &framework.FieldSchema{
Type: framework.TypeCommaStringSlice,
Description: `A comma-separated list of names.
At least one must exist in the Common Name. Supports globbing.`,
DisplayAttrs: &framework.DisplayAttributes{
Group: "Constraints",
},
},

"allowed_dns_sans": &framework.FieldSchema{
Type: framework.TypeCommaStringSlice,
Description: `A comma-separated list of DNS names.
At least one must exist in the SANs. Supports globbing.`,
DisplayAttrs: &framework.DisplayAttributes{
Name: "Allowed DNS SANs",
Group: "Constraints",
},
},

"allowed_email_sans": &framework.FieldSchema{
Type: framework.TypeCommaStringSlice,
Description: `A comma-separated list of Email Addresses.
At least one must exist in the SANs. Supports globbing.`,
DisplayAttrs: &framework.DisplayAttributes{
Name: "Allowed Email SANs",
Group: "Constraints",
},
},

"allowed_uri_sans": &framework.FieldSchema{
Type: framework.TypeCommaStringSlice,
Description: `A comma-separated list of URIs.
At least one must exist in the SANs. Supports globbing.`,
DisplayAttrs: &framework.DisplayAttributes{
Name: "Allowed URI SANs",
Group: "Constraints",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the Group specifies which field group the field should belong to. for example:

image

},
},

"allowed_organizational_units": &framework.FieldSchema{
Type: framework.TypeCommaStringSlice,
Description: `A comma-separated list of Organizational Units names.
At least one must exist in the OU field.`,
DisplayAttrs: &framework.DisplayAttributes{
Group: "Constraints",
},
},

"required_extensions": &framework.FieldSchema{
Expand Down Expand Up @@ -137,6 +165,10 @@ certificate.`,

HelpSynopsis: pathCertHelpSyn,
HelpDescription: pathCertHelpDesc,
DisplayAttrs: &framework.DisplayAttributes{
Action: "Create",
Copy link
Contributor

@andaley andaley Jul 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is what allows us dynamically generate the form for creating a "nested item" -- i.e., a certificate nested under the cert auth method.
image

ItemType: "Certificate",
},
}

tokenutil.AddTokenFields(p.Fields)
Expand Down
4 changes: 3 additions & 1 deletion builtin/credential/ldap/path_groups.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ func pathGroupsList(b *backend) *framework.Path {
HelpDescription: pathGroupHelpDesc,
DisplayAttrs: &framework.DisplayAttributes{
Navigation: true,
ItemType: "Group",
},
}
}
Expand Down Expand Up @@ -49,7 +50,8 @@ func pathGroups(b *backend) *framework.Path {
HelpSynopsis: pathGroupHelpSyn,
HelpDescription: pathGroupHelpDesc,
DisplayAttrs: &framework.DisplayAttributes{
Action: "Create",
Action: "Create",
ItemType: "Group",
},
}
}
Expand Down
5 changes: 3 additions & 2 deletions builtin/credential/ldap/path_users.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func pathUsersList(b *backend) *framework.Path {
HelpDescription: pathUserHelpDesc,
DisplayAttrs: &framework.DisplayAttributes{
Navigation: true,
Action: "Create",
ItemType: "User",
},
}
}
Expand Down Expand Up @@ -56,7 +56,8 @@ func pathUsers(b *backend) *framework.Path {
HelpSynopsis: pathUserHelpSyn,
HelpDescription: pathUserHelpDesc,
DisplayAttrs: &framework.DisplayAttributes{
Action: "Create",
Action: "Create",
ItemType: "User",
},
}
}
Expand Down
3 changes: 3 additions & 0 deletions builtin/credential/okta/path_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ func pathConfig(b *backend) *framework.Path {
ExistenceCheck: b.pathConfigExistenceCheck,

HelpSynopsis: pathConfigHelp,
DisplayAttrs: &framework.DisplayAttributes{
Action: "Configure",
},
}

tokenutil.AddTokenFields(p.Fields)
Expand Down
8 changes: 8 additions & 0 deletions builtin/credential/okta/path_groups.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ func pathGroupsList(b *backend) *framework.Path {

HelpSynopsis: pathGroupHelpSyn,
HelpDescription: pathGroupHelpDesc,
DisplayAttrs: &framework.DisplayAttributes{
Navigation: true,
ItemType: "Group",
},
}
}

Expand All @@ -45,6 +49,10 @@ func pathGroups(b *backend) *framework.Path {

HelpSynopsis: pathGroupHelpSyn,
HelpDescription: pathGroupHelpDesc,
DisplayAttrs: &framework.DisplayAttributes{
Action: "Create",
ItemType: "Group",
},
}
}

Expand Down
8 changes: 8 additions & 0 deletions builtin/credential/okta/path_users.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ func pathUsersList(b *backend) *framework.Path {

HelpSynopsis: pathUserHelpSyn,
HelpDescription: pathUserHelpDesc,
DisplayAttrs: &framework.DisplayAttributes{
Navigation: true,
ItemType: "User",
},
}
}

Expand Down Expand Up @@ -48,6 +52,10 @@ func pathUsers(b *backend) *framework.Path {

HelpSynopsis: pathUserHelpSyn,
HelpDescription: pathUserHelpDesc,
DisplayAttrs: &framework.DisplayAttributes{
Action: "Create",
ItemType: "User",
},
}
}

Expand Down
3 changes: 3 additions & 0 deletions builtin/credential/radius/path_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ func pathConfig(b *backend) *framework.Path {

HelpSynopsis: pathConfigHelpSyn,
HelpDescription: pathConfigHelpDesc,
DisplayAttrs: &framework.DisplayAttributes{
Action: "Configure",
},
}

tokenutil.AddTokenFields(p.Fields)
Expand Down
8 changes: 8 additions & 0 deletions builtin/credential/radius/path_users.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ func pathUsersList(b *backend) *framework.Path {

HelpSynopsis: pathUserHelpSyn,
HelpDescription: pathUserHelpDesc,
DisplayAttrs: &framework.DisplayAttributes{
Navigation: true,
ItemType: "User",
},
}
}

Expand Down Expand Up @@ -49,6 +53,10 @@ func pathUsers(b *backend) *framework.Path {

HelpSynopsis: pathUserHelpSyn,
HelpDescription: pathUserHelpDesc,
DisplayAttrs: &framework.DisplayAttributes{
Action: "Create",
ItemType: "User",
},
}
}

Expand Down
11 changes: 11 additions & 0 deletions builtin/credential/userpass/path_users.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ func pathUsersList(b *backend) *framework.Path {

HelpSynopsis: pathUserHelpSyn,
HelpDescription: pathUserHelpDesc,
DisplayAttrs: &framework.DisplayAttributes{
Navigation: true,
ItemType: "User",
},
}
}

Expand All @@ -37,6 +41,9 @@ func pathUsers(b *backend) *framework.Path {
"password": &framework.FieldSchema{
Type: framework.TypeString,
Description: "Password for this user.",
DisplayAttrs: &framework.DisplayAttributes{
Sensitive: true,
},
},

"policies": &framework.FieldSchema{
Expand Down Expand Up @@ -75,6 +82,10 @@ func pathUsers(b *backend) *framework.Path {

HelpSynopsis: pathUserHelpSyn,
HelpDescription: pathUserHelpDesc,
DisplayAttrs: &framework.DisplayAttributes{
Action: "Create",
ItemType: "User",
},
andaley marked this conversation as resolved.
Show resolved Hide resolved
}

tokenutil.AddTokenFields(p.Fields)
Expand Down
7 changes: 7 additions & 0 deletions sdk/framework/path.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,18 @@ type DisplayAttributes struct {
// Navigation indicates that the path should be available as a navigation tab
Navigation bool `json:"navigation,omitempty"`

// ItemType is the type of item this path operates on
ItemType string `json:"itemType,omitempty"`

// Group is the suggested UI group to place this field in.
Group string `json:"group,omitempty"`

// Action is the verb to use for the operation.
Action string `json:"action,omitempty"`

// EditType is the type of form field needed for a property
// e.g. "textarea" or "file"
EditType string `json:"editType,omitempty"`
Copy link
Contributor

@andaley andaley Jul 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these are all of the available keys for the DisplayAttributes map, which tells the UI how to display the "thing" (i.e. certificate) or specific form field. see the full list here:

https://github.com/hashicorp/vault/blob/master/sdk/framework/path.go#L169-L196

}

// RequestExample is example of request data.
Expand Down
9 changes: 9 additions & 0 deletions sdk/helper/tokenutil/tokenutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ func TokenFields() map[string]*framework.FieldSchema {
Description: `Comma separated string or JSON list of CIDR blocks. If set, specifies the blocks of IP addresses which are allowed to use the generated token.`,
DisplayAttrs: &framework.DisplayAttributes{
Name: "Generated Token's Bound CIDRs",
Group: "Tokens",
},
},

Expand All @@ -84,6 +85,7 @@ func TokenFields() map[string]*framework.FieldSchema {
Description: tokenExplicitMaxTTLHelp,
DisplayAttrs: &framework.DisplayAttributes{
Name: "Generated Token's Explicit Maximum TTL",
Group: "Tokens",
},
},

Expand All @@ -92,6 +94,7 @@ func TokenFields() map[string]*framework.FieldSchema {
Description: "The maximum lifetime of the generated token",
DisplayAttrs: &framework.DisplayAttributes{
Name: "Generated Token's Maximum TTL",
Group: "Tokens",
},
},

Expand All @@ -100,6 +103,7 @@ func TokenFields() map[string]*framework.FieldSchema {
Description: "If true, the 'default' policy will not automatically be added to generated tokens",
DisplayAttrs: &framework.DisplayAttributes{
Name: "Do Not Attach 'default' Policy To Generated Tokens",
Group: "Tokens",
},
},

Expand All @@ -108,6 +112,7 @@ func TokenFields() map[string]*framework.FieldSchema {
Description: tokenPeriodHelp,
DisplayAttrs: &framework.DisplayAttributes{
Name: "Generated Token's Period",
Group: "Tokens",
},
},

Expand All @@ -116,6 +121,7 @@ func TokenFields() map[string]*framework.FieldSchema {
Description: "Comma-separated list of policies",
DisplayAttrs: &framework.DisplayAttributes{
Name: "Generated Token's Policies",
Group: "Tokens",
},
},

Expand All @@ -125,6 +131,7 @@ func TokenFields() map[string]*framework.FieldSchema {
Description: "The type of token to generate, service or batch",
DisplayAttrs: &framework.DisplayAttributes{
Name: "Generated Token's Type",
Group: "Tokens",
},
},

Expand All @@ -133,6 +140,7 @@ func TokenFields() map[string]*framework.FieldSchema {
Description: "The initial ttl of the token to generate",
DisplayAttrs: &framework.DisplayAttributes{
Name: "Generated Token's Initial TTL",
Group: "Tokens",
},
},

Expand All @@ -141,6 +149,7 @@ func TokenFields() map[string]*framework.FieldSchema {
Description: "The maximum number of times a token may be used, a value of zero means unlimited",
DisplayAttrs: &framework.DisplayAttributes{
Name: "Maximum Uses of Generated Tokens",
Group: "Tokens",
},
},
}
Expand Down
5 changes: 3 additions & 2 deletions ui/.storybook/preview-head.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
<meta name="kmip/config/environment" content="%7B%22modulePrefix%22%3A%22kmip%22%2C%22environment%22%3A%22development%22%7D" />
<meta name="open-api-explorer/config/environment" content="%7B%22modulePrefix%22%3A%22open-api-explorer%22%2C%22environment%22%3A%22development%22%2C%22APP%22%3A%7B%22NAMESPACE_ROOT_URLS%22%3A%5B%22sys/health%22%2C%22sys/seal-status%22%2C%22sys/license/features%22%5D%7D%7D" />
<meta name="replication/config/environment" content="%7B%22modulePrefix%22%3A%22replication%22%2C%22environment%22%3A%22development%22%7D" />
<meta name="vault/config/asset-manifest" content="%7B%22bundles%22%3A%7B%22kmip%22%3A%7B%22assets%22%3A%5B%7B%22uri%22%3A%22/ui/engines-dist/kmip/assets/engine-vendor.js%22%2C%22type%22%3A%22js%22%7D%2C%7B%22uri%22%3A%22/ui/engines-dist/kmip/assets/engine.js%22%2C%22type%22%3A%22js%22%7D%5D%7D%2C%22open-api-explorer%22%3A%7B%22assets%22%3A%5B%7B%22uri%22%3A%22/ui/engines-dist/open-api-explorer/assets/engine-vendor.css%22%2C%22type%22%3A%22css%22%7D%2C%7B%22uri%22%3A%22/ui/engines-dist/open-api-explorer/assets/engine-vendor.js%22%2C%22type%22%3A%22js%22%7D%2C%7B%22uri%22%3A%22/ui/engines-dist/open-api-explorer/assets/engine.css%22%2C%22type%22%3A%22css%22%7D%2C%7B%22uri%22%3A%22/ui/engines-dist/open-api-explorer/assets/engine.js%22%2C%22type%22%3A%22js%22%7D%5D%7D%2C%22replication%22%3A%7B%22assets%22%3A%5B%7B%22uri%22%3A%22/ui/engines-dist/replication/assets/engine-vendor.js%22%2C%22type%22%3A%22js%22%7D%2C%7B%22uri%22%3A%22/ui/engines-dist/replication/assets/engine.js%22%2C%22type%22%3A%22js%22%7D%5D%7D%7D%7D" />
andaley marked this conversation as resolved.
Show resolved Hide resolved
<meta name="vault/config/asset-manifest"
content="%7B%22bundles%22%3A%7B%22kmip%22%3A%7B%22assets%22%3A%5B%7B%22uri%22%3A%22/ui/engines-dist/kmip/assets/engine-vendor.js%22%2C%22type%22%3A%22js%22%7D%2C%7B%22uri%22%3A%22/ui/engines-dist/kmip/assets/engine.js%22%2C%22type%22%3A%22js%22%7D%5D%7D%2C%22open-api-explorer%22%3A%7B%22assets%22%3A%5B%7B%22uri%22%3A%22/ui/engines-dist/open-api-explorer/assets/engine-vendor.css%22%2C%22type%22%3A%22css%22%7D%2C%7B%22uri%22%3A%22/ui/engines-dist/open-api-explorer/assets/engine-vendor.js%22%2C%22type%22%3A%22js%22%7D%2C%7B%22uri%22%3A%22/ui/engines-dist/open-api-explorer/assets/engine.css%22%2C%22type%22%3A%22css%22%7D%2C%7B%22uri%22%3A%22/ui/engines-dist/open-api-explorer/assets/engine.js%22%2C%22type%22%3A%22js%22%7D%5D%7D%2C%22replication%22%3A%7B%22assets%22%3A%5B%7B%22uri%22%3A%22/ui/engines-dist/replication/assets/engine-vendor.js%22%2C%22type%22%3A%22js%22%7D%2C%7B%22uri%22%3A%22/ui/engines-dist/replication/assets/engine.js%22%2C%22type%22%3A%22js%22%7D%5D%7D%7D%7D" />
<link rel="stylesheet" href="/assets/vendor.css" />
<link rel="stylesheet" href="/assets/vault.css" />
<link rel="icon" href="/favicon.png" />
Expand All @@ -23,4 +24,4 @@
</script>
<script>runningTests = true;</script>
<script src="/assets/vendor.js"></script>
<script src="/assets/vault.js"></script>
<script src="/assets/vault.js"></script>
20 changes: 8 additions & 12 deletions ui/app/adapters/generated-item-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,25 @@ import ApplicationAdapter from './application';
export default ApplicationAdapter.extend({
namespace: 'v1',
urlForItem() {},
optionsForQuery(id) {

fetchByQuery(store, query, isList) {
const { id } = query;
let data = {};
if (!id) {
data['list'] = true;
if (isList) {
data.list = true;
}
return { data };
},

fetchByQuery(store, query) {
const { id, method, type } = query;
return this.ajax(this.urlForItem(method, id, type), 'GET', this.optionsForQuery(id)).then(resp => {
return this.ajax(this.urlForItem(id, isList), 'GET', { data }).then(resp => {
const data = {
id,
name: id,
method,
method: id,
};

return assign({}, resp, data);
});
},

query(store, type, query) {
return this.fetchByQuery(store, query);
return this.fetchByQuery(store, query, true);
},

queryRecord(store, type, query) {
Expand Down
2 changes: 1 addition & 1 deletion ui/app/components/generated-item.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default Component.extend({
deleteItem() {
this.model.destroyRecord().then(() => {
this.router.transitionTo('vault.cluster.access.method.item.list').followRedirects();
this.flashMessages.success(`${this.model.id} ${this.itemType} was deleted successfully.`);
this.flashMessages.success(`Successfully deleted ${this.itemType} ${this.name}.`);
andaley marked this conversation as resolved.
Show resolved Hide resolved
});
},
},
Expand Down
Loading