diff --git a/ui/admin/app/components/form/storage-bucket/index.hbs b/ui/admin/app/components/form/storage-bucket/index.hbs index c0c814d3a..aef78d9b6 100644 --- a/ui/admin/app/components/form/storage-bucket/index.hbs +++ b/ui/admin/app/components/form/storage-bucket/index.hbs @@ -3,17 +3,16 @@ SPDX-License-Identifier: BUSL-1.1 }} {{#if @model.type}} - {{component - (concat 'form/storage-bucket/' @model.compositeType) - model=@model - submit=@submit - cancel=@cancel - updateScope=this.updateScope - scopes=@scopes - pluginTypes=this.pluginTypes - changePluginType=@changePluginType - changeCredentialType=@changeCredentialType - rollbackSecretAttrs=this.rollbackSecretAttrs - toggleDisableCredentialRotation=this.toggleDisableCredentialRotation - }} + {{/if}} \ No newline at end of file diff --git a/ui/admin/app/components/form/storage-bucket/index.js b/ui/admin/app/components/form/storage-bucket/index.js index ba174e207..288d09278 100644 --- a/ui/admin/app/components/form/storage-bucket/index.js +++ b/ui/admin/app/components/form/storage-bucket/index.js @@ -7,11 +7,18 @@ import Component from '@glimmer/component'; import { action } from '@ember/object'; import { service } from '@ember/service'; import { set } from '@ember/object'; - +import { assert } from '@ember/debug'; import { TYPE_CREDENTIAL_DYNAMIC, TYPES_STORAGE_BUCKET_PLUGIN, } from 'api/models/storage-bucket'; +import awsFormComponent from './aws'; +import minioFormComponent from './minio'; + +const modelCompositeTypeToComponent = { + aws: awsFormComponent, + minio: minioFormComponent, +}; export default class FormStorageBucketComponent extends Component { // =attributes @@ -24,6 +31,19 @@ export default class FormStorageBucketComponent extends Component { return TYPES_STORAGE_BUCKET_PLUGIN; } + /** + * returns the associated storage bucket form component for the model's composite type + */ + get storageBucketFormComponent() { + const component = + modelCompositeTypeToComponent[this.args.model.compositeType]; + assert( + `Mapped component must exist for storage bucket composite type: ${this.args.model.compositeType}`, + component, + ); + return component; + } + // =actions @action updateScope(event) {