File tree Expand file tree Collapse file tree 2 files changed +34
-7
lines changed
ui/admin/app/components/form/host-set Expand file tree Collapse file tree 2 files changed +34
-7
lines changed Original file line number Diff line number Diff line change 33 SPDX-License-Identifier: BUSL-1.1
44}}
55
6- {{ component
7- (concat ' form/host-set/' @model.compositeType )
8- model = @model
9- edit = @edit
10- submit = @submit
11- cancel = @cancel
12- }}
6+ <this .hostSetForm
7+ @model ={{ @model }}
8+ @edit ={{ @edit }}
9+ @submit ={{ @submit }}
10+ @cancel ={{ @cancel }}
11+ />
Original file line number Diff line number Diff line change 1+ import Component from '@glimmer/component' ;
2+ import { assert } from '@ember/debug' ;
3+ import awsFormComponent from './aws' ;
4+ import azureFormComponent from './azure' ;
5+ import gcpFormComponent from './gcp' ;
6+ import staticFormComponent from './static' ;
7+
8+ const modelCompositeTypeToComponent = {
9+ aws : awsFormComponent ,
10+ azure : azureFormComponent ,
11+ gcp : gcpFormComponent ,
12+ static : staticFormComponent ,
13+ } ;
14+
15+ export default class FormHostSetIndex extends Component {
16+ /**
17+ * returns the associated host set form component for the model's composite type
18+ */
19+ get hostSetForm ( ) {
20+ const component =
21+ modelCompositeTypeToComponent [ this . args . model . compositeType ] ;
22+ assert (
23+ `Mapped component must exist for host set composite type: ${ this . args . model . compositeType } ` ,
24+ component ,
25+ ) ;
26+ return component ;
27+ }
28+ }
You can’t perform that action at this time.
0 commit comments