chore: 🤖 add disable cred rotation field to storage bucket creation form (#246)

* chore: 🤖 add disable cred rotation field
This commit is contained in:
Dharini Jeeva authored and GitHub committed 2023-05-09 14:06:05 -07:00
1 parent 03fd24f1ec
commit 5844768f57
5 files changed
+26

No files matched your search

@@ -85,4 +85,10 @@ export default class GeneratedStorageBucketModel extends BaseModel {
description: 'The secret access key to use.',
})
secret_access_key;
@attr('boolean', {
isNestedAttribute: true,
description: '',
})
disable_credential_rotation;
}
@@ -50,6 +50,7 @@ export default factory.extend({
max: 9,
}
)}`,
disable_credential_rotation: faker.datatype.boolean(),
};
}
},
@@ -31,6 +31,7 @@ module('Unit | Serializer | storage bucket', function (hooks) {
access_key_id: 'foobars',
secret_access_key: 'testing',
secrets_hmac: 'hmac',
disable_credential_rotation: true,
});
const expectedResult = {
name: 'AWS',
@@ -41,6 +42,7 @@ module('Unit | Serializer | storage bucket', function (hooks) {
worker_filter: 'workerfilter',
attributes: {
region: 'eu-west-1',
disable_credential_rotation: true,
},
secrets: {
access_key_id: 'foobars',
@@ -66,6 +68,7 @@ module('Unit | Serializer | storage bucket', function (hooks) {
worker_filter: 'workerfilter',
attributes: {
region: 'eu-west-1',
disable_credential_rotation: true,
},
secrets_hmac: 'this is secret',
};
@@ -90,6 +93,7 @@ module('Unit | Serializer | storage bucket', function (hooks) {
worker_filter: 'workerfilter',
secrets_hmac: 'this is secret',
region: 'eu-west-1',
disable_credential_rotation: true,
},
type: 'storage-bucket',
relationships: {},
@@ -301,6 +301,15 @@
{{/if}}
</Hds::Form::TextInput::Field>
<Hds::Form::Checkbox::Field
name='disable_credential_rotation'
checked={{@model.disable_credential_rotation}}
{{on 'change' this.toggleDisableCredentialRotation}}
as |F|
>
<F.Label>{{t 'form.disable_credential_rotation.label'}}</F.Label>
</Hds::Form::Checkbox::Field>
{{#if (can 'save model' @model)}}
<form.actions
@enableEditText={{t 'actions.edit-form'}}
@@ -27,4 +27,10 @@ export default class FormStorageBucketComponent extends Component {
set(this.args.model, currentAttr, oldVal);
}
}
@action
toggleDisableCredentialRotation() {
this.args.model.disable_credential_rotation =
!this.args.model.disable_credential_rotation;
}
}