mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-10-29 09:42:25 +00:00
UI: Connection "Add Role" automatically populates database in form (#11119)
* Database role create form sets url param itemKey as database on init * add test for new functionality * Add changelog
This commit is contained in:
3
changelog/11119.txt
Normal file
3
changelog/11119.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
```release-note:bug
|
||||
ui: Add role from database connection automatically populates the database for new role
|
||||
```
|
||||
@@ -19,6 +19,9 @@ export default class DatabaseRoleEdit extends Component {
|
||||
) {
|
||||
this.wizard.transitionFeatureMachine(this.wizard.featureState, 'CONTINUE', 'database');
|
||||
}
|
||||
if (this.args.initialKey) {
|
||||
this.args.model.database = [this.args.initialKey];
|
||||
}
|
||||
}
|
||||
|
||||
@tracked loading = false;
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
@secret=''
|
||||
@mode="create"
|
||||
@type="add"
|
||||
@queryParams={{query-params initialKey=(or filter baseKey.id) itemType="role"}}
|
||||
@queryParams={{query-params initialKey=@model.name itemType="role"}}
|
||||
@data-test-secret-create=true
|
||||
>
|
||||
Add role
|
||||
|
||||
@@ -139,6 +139,14 @@ module('Acceptance | secrets/database/*', function(hooks) {
|
||||
assert
|
||||
.dom(`[data-test-row-value="Write concern"]`)
|
||||
.hasText('{ "wtimeout": 5000 }', 'Write concern is now showing on the table');
|
||||
// click "Add Role"
|
||||
await click('[data-test-secret-create="true"]');
|
||||
await settled();
|
||||
assert.equal(
|
||||
searchSelectComponent.selectedOptions[0].text,
|
||||
connectionDetails.id,
|
||||
'Database connection is pre-selected on the form'
|
||||
);
|
||||
});
|
||||
|
||||
test('buttons show up for managing connection', async function(assert) {
|
||||
|
||||
Reference in New Issue
Block a user