Remove unsupported fields for DB roles show page (#15573)
* Fixed unsupported revocation statements field display for DB roles * Fixed linting * Added changelog * Fixed conditional to filter for only elasticsearch database and changed format of text in changelog * Fixed conditional and added comment for bug fix
This commit is contained in:
parent
df8ae055be
commit
2a91a5c4e5
|
@ -0,0 +1,3 @@
|
||||||
|
```release-note:bug
|
||||||
|
ui: Fixed unsupported revocation statements field for DB roles
|
||||||
|
```
|
|
@ -3,7 +3,7 @@ import { computed } from '@ember/object';
|
||||||
import { alias } from '@ember/object/computed';
|
import { alias } from '@ember/object/computed';
|
||||||
import lazyCapabilities, { apiPath } from 'vault/macros/lazy-capabilities';
|
import lazyCapabilities, { apiPath } from 'vault/macros/lazy-capabilities';
|
||||||
import { expandAttributeMeta } from 'vault/utils/field-to-attrs';
|
import { expandAttributeMeta } from 'vault/utils/field-to-attrs';
|
||||||
import { getRoleFields } from '../../utils/database-helpers';
|
import { getRoleFields } from 'vault/utils/database-helpers';
|
||||||
|
|
||||||
export default Model.extend({
|
export default Model.extend({
|
||||||
idPrefix: 'role/',
|
idPrefix: 'role/',
|
||||||
|
@ -91,7 +91,11 @@ export default Model.extend({
|
||||||
|
|
||||||
get showFields() {
|
get showFields() {
|
||||||
let fields = ['name', 'database', 'type'];
|
let fields = ['name', 'database', 'type'];
|
||||||
fields = fields.concat(getRoleFields(this.type)).concat(['creation_statements', 'revocation_statements']);
|
fields = fields.concat(getRoleFields(this.type)).concat(['creation_statements']);
|
||||||
|
// elasticsearch does not support revocation statements: https://www.vaultproject.io/api-docs/secret/databases/elasticdb#parameters-1
|
||||||
|
if (this.database[0] !== 'elasticsearch') {
|
||||||
|
fields = fields.concat(['revocation_statements']);
|
||||||
|
}
|
||||||
return expandAttributeMeta(this, fields);
|
return expandAttributeMeta(this, fields);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue