chore: 🤖 migrate away from component helper for managed group (#3082)

* chore: 🤖 migrate away from component helper for managed group

* Add missing copyright headers
This commit is contained in:
hashicc authored and GitHub committed 2025-12-05 14:11:22 -05:00
1 parent 1d08ddb513
commit 0bac7d2711
2 files changed
+36 -9

No files matched your search

@@ -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}}
@@ -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;
}
}