File tree Expand file tree Collapse file tree 3 files changed +27
-5
lines changed
addon/components/form/authenticate
app/components/form/authenticate Expand file tree Collapse file tree 3 files changed +27
-5
lines changed Original file line number Diff line number Diff line change 4
4
}}
5
5
6
6
{{ #if @model.type }}
7
- {{ component
8
- (concat ' form/authenticate/' @model.type )
9
- onSubmit = @submit
10
- disabled = @disabled
11
- }}
7
+ <this .authenticateFormComponent
8
+ @onSubmit ={{ @submit }}
9
+ @disabled ={{ @disabled }}
10
+ />
12
11
{{ /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 oidc from './oidc' ;
4
+ import ldap from './ldap' ;
5
+ import password from './password' ;
6
+
7
+ const modelTypeToComponent = {
8
+ ldap,
9
+ password,
10
+ oidc,
11
+ } ;
12
+
13
+ export default class FormAuthenticateIndex extends Component {
14
+ get authenticateFormComponent ( ) {
15
+ const component = modelTypeToComponent [ this . args . model . type ] ;
16
+ assert (
17
+ `Mapped component must exist for auth method: ${ this . args . model . type } ` ,
18
+ component ,
19
+ ) ;
20
+ return component ;
21
+ }
22
+ }
Original file line number Diff line number Diff line change
1
+ export { default } from 'core/components/form/authenticate/index' ;
You can’t perform that action at this time.
0 commit comments