File tree Expand file tree Collapse file tree 2 files changed +31
-9
lines changed
ui/admin/app/components/form/managed-group Expand file tree Collapse file tree 2 files changed +31
-9
lines changed Original file line number Diff line number Diff line change 44}}
55
66{{ #if @model.type }}
7- {{ component
8- (concat ' form/managed-group/' @model.type )
9- model = @model
10- edit = @edit
11- submit = @submit
12- cancel = @cancel
13- removeItemByIndex = @removeItemByIndex
14- addStringItem = @addStringItem
15- }}
7+ <this .managedGroupForm
8+ @model ={{ @model }}
9+ @edit ={{ @edit }}
10+ @submit ={{ @submit }}
11+ @cancel ={{ @cancel }}
12+ @removeItemByIndex ={{ @removeItemByIndex }}
13+ @addStringItem ={{ @addStringItem }}
14+ />
1615{{ /if }}
Original file line number Diff line number Diff line change 1+ import Component from '@glimmer/component' ;
2+ import { assert } from '@ember/debug' ;
3+ import ldapFormComponent from './ldap' ;
4+ import oidcFormComponent from './oidc' ;
5+
6+ const modelTypeToComponent = {
7+ ldap : ldapFormComponent ,
8+ oidc : oidcFormComponent ,
9+ } ;
10+
11+ export default class FormManagedGroupIndex extends Component {
12+ /**
13+ * returns the associated managed group form component for the model's type
14+ */
15+ get managedGroupForm ( ) {
16+ const component = modelTypeToComponent [ this . args . model . type ] ;
17+ assert (
18+ `Mapped component must exist for account type: ${ this . args . model . type } ` ,
19+ component ,
20+ ) ;
21+ return component ;
22+ }
23+ }
You can’t perform that action at this time.
0 commit comments