Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions ui/admin/app/components/form/managed-group/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
}}

{{#if @model.type}}
{{component
(concat 'form/managed-group/' @model.type)
model=@model
edit=@edit
submit=@submit
cancel=@cancel
removeItemByIndex=@removeItemByIndex
addStringItem=@addStringItem
}}
<this.managedGroupForm
@model={{@model}}
@edit={{@edit}}
@submit={{@submit}}
@cancel={{@cancel}}
@removeItemByIndex={{@removeItemByIndex}}
@addStringItem={{@addStringItem}}
/>
{{/if}}
28 changes: 28 additions & 0 deletions ui/admin/app/components/form/managed-group/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1
*/

import Component from '@glimmer/component';
import { assert } from '@ember/debug';
import ldapFormComponent from './ldap';
import oidcFormComponent from './oidc';

const modelTypeToComponent = {
ldap: ldapFormComponent,
oidc: oidcFormComponent,
};

export default class FormManagedGroupIndex extends Component {
/**
* returns the associated managed group form component for the model's type
*/
get managedGroupForm() {
const component = modelTypeToComponent[this.args.model.type];
assert(
`Mapped component must exist for account type: ${this.args.model.type}`,
component,
);
return component;
}
}
Loading