diff --git a/ui/admin/app/components/form/account/index.hbs b/ui/admin/app/components/form/account/index.hbs index f6a7d2dae..08d475201 100644 --- a/ui/admin/app/components/form/account/index.hbs +++ b/ui/admin/app/components/form/account/index.hbs @@ -4,10 +4,9 @@ }} {{#if @model.type}} - {{component - (concat 'form/account/' @model.type) - model=@model - submit=@submit - cancel=@cancel - }} + {{/if}} \ No newline at end of file diff --git a/ui/admin/app/components/form/account/index.js b/ui/admin/app/components/form/account/index.js new file mode 100644 index 000000000..6eca02f6f --- /dev/null +++ b/ui/admin/app/components/form/account/index.js @@ -0,0 +1,27 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + +import Component from '@glimmer/component'; +import { assert } from '@ember/debug'; +import oidc from './oidc'; +import ldap from './ldap'; +import password from './password'; + +const modelTypeToComponent = { + ldap, + password, + oidc, +}; + +export default class FormAccountIndex extends Component { + get accountFormComponent() { + const component = modelTypeToComponent[this.args.model.type]; + assert( + `Mapped component must exist for account type: ${this.args.model.type}`, + component, + ); + return component; + } +}