feat: 🎸 create form for json credentials (#1498)
* feat: 🎸 create form for json credentials ✅ Closes: ICU-6682 * refactor: 💡 add new info field * refactor: 💡 add feature flag * refactor: 💡 add hds radio cards to json cred * Update ui/admin/tests/acceptance/credential-store/credentials/create-test.js * test: 💍 add test for json cred * chore: 🤖 Remove ember-data-model-fragments package * fix: 🐛 Update how json is added as a known credential type * refactor: 💡 update credentialTypes if statement to ternary * chore: 🤖 add ember-data back to addon/api project * chore: 🤖 remove ember-feature-flag from addon/api * refactor: 💡 remove if statement in cred form * refactor: 💡 update selectors for json cred. tests * refactor: 💡 Update Credential Form to use form.disabled * test: 💍 Fix test selectors for radio card credential tests * refactor: 💡 update credential types declaration to const * style: 💄 Fix style issue with SecretEditor in edit mode * refactor: 💡 remove disabled and readonly attributes in form * refactor: 💡 Create credential ability canRead override * test: 💍 add credential ability override tests * test: 💍 Fix brokered credential test with json support added * refactor: 💡 add attributes comment back to credential model Co-authored-by: Cameron Perera <cameron.perera@hashicorp.com>
This commit is contained in:
1 parent
e18b30a54e
commit
e418017bc2
17 files changed
+420
-86
No files matched your search
@@ -29,15 +29,23 @@ export default class ScopesScopeCredentialStoresCredentialStoreCredentialsNewRou
|
||||
'scopes.scope.credential-stores.credential-store'
|
||||
);
|
||||
let name, description;
|
||||
/**
|
||||
* this sets the credential attribute json_object to a string that
|
||||
* replicates an empty json blob as CodeMirror expects a string
|
||||
*/
|
||||
const json_object = '{}';
|
||||
|
||||
if (this.currentModel?.isNew) {
|
||||
({ name, description } = this.currentModel);
|
||||
this.currentModel.rollbackAttributes();
|
||||
}
|
||||
|
||||
return this.store.createRecord('credential', {
|
||||
type,
|
||||
credential_store_id,
|
||||
name,
|
||||
description,
|
||||
json_object,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user