File tree Expand file tree Collapse file tree 2 files changed +36
-11
lines changed
ui/admin/app/components/form/auth-method Expand file tree Collapse file tree 2 files changed +36
-11
lines changed Original file line number Diff line number Diff line change 22 Copyright (c) HashiCorp, Inc.
33 SPDX-License-Identifier: BUSL-1.1
44}}
5-
65{{ #if @model.type }}
7- {{ component
8- (concat ' form/auth-method/' @model.type )
9- model = @model
10- edit = @edit
11- submit = @submit
12- cancel = @cancel
13- removeItemByIndex = @removeItemByIndex
14- addStringItem = @addStringItem
15- addAccountMapItem = @addAccountMapItem
16- }}
6+ <this .authMethodFormComponent
7+ @model ={{ @model }}
8+ @edit ={{ @edit }}
9+ @submit ={{ @submit }}
10+ @cancel ={{ @cancel }}
11+ @removeItemByIndex ={{ @removeItemByIndex }}
12+ @addStringItem ={{ @addStringItem }}
13+ @addAccountMapItem ={{ @addAccountMapItem }}
14+ />
1715{{ /if }}
Original file line number Diff line number Diff line change 1+ /**
2+ * Copyright (c) HashiCorp, Inc.
3+ * SPDX-License-Identifier: BUSL-1.1
4+ */
5+
6+ import Component from '@glimmer/component' ;
7+ import { assert } from '@ember/debug' ;
8+ import oidc from './oidc' ;
9+ import ldap from './ldap' ;
10+ import password from './password' ;
11+
12+ const modelTypeToComponent = {
13+ ldap,
14+ password,
15+ oidc,
16+ } ;
17+
18+ export default class FormAuthMethodIndex extends Component {
19+ get authMethodFormComponent ( ) {
20+ const component = modelTypeToComponent [ this . args . model . type ] ;
21+ assert (
22+ `Mapped component must exist for auth method: ${ this . args . model . type } ` ,
23+ component ,
24+ ) ;
25+ return component ;
26+ }
27+ }
You can’t perform that action at this time.
0 commit comments