mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-23 21:34:55 +00:00
UI: pki configuration edit form (#20245)
* setup routing, move queries in ConfigurationIndex to parent resource route * finish building out form, add model attrs build ttls * add types * update model attribute values, fix default ttl states * remove defaults and use openApi, group with booleans * add model to application route" * add save functionality * add error banner * add transition after save * use defaults from open api * fix empty state language * pass engine data * change model attrs to ttl objects * update types * add invalid form alert to error block * move data manipulation to serialize * fix serializer, add comments * add test for serializer * edit configuration details view * update details test * change to updateRecord so POST request is made * config/urls use POST instead of PUT * add edit tests, update details * add model hooks back to routes * rearrange to remove dif * remove createRecord for urls * update comment * wip sample ttl transform * Revert "wip sample ttl transform" This reverts commit 59fc179b5cd2994c4258e553e56667e29b3d6b72. * revert changes, move model updates back to component * simplify model fetches * address comments; * update pki/urls test * update adapter test
This commit is contained in:
@@ -16,7 +16,7 @@ export default class PkiConfigurationCreateRoute extends Route {
|
||||
model() {
|
||||
return hash({
|
||||
config: this.store.createRecord('pki/action'),
|
||||
urls: this.getOrCreateUrls(this.secretMountPath.currentPath),
|
||||
urls: this.modelFor('configuration').urls,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -28,12 +28,4 @@ export default class PkiConfigurationCreateRoute extends Route {
|
||||
{ label: 'configure' },
|
||||
];
|
||||
}
|
||||
|
||||
async getOrCreateUrls(backend) {
|
||||
try {
|
||||
return this.store.findRecord('pki/urls', backend);
|
||||
} catch (e) {
|
||||
return this.store.createRecord('pki/urls', { id: backend });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user