|
1 | 1 | <form
|
2 | 2 | novalidate
|
3 | 3 | vclForm
|
| 4 | + [formGroup]="form" |
4 | 5 | >
|
5 | 6 | <fieldset>
|
6 | 7 | <legend>
|
7 | 8 | Add role
|
8 | 9 | <vcl-icon
|
9 |
| - class="vcl-jss-form-add" |
| 10 | + class="role-add" |
10 | 11 | icon="vcl:add"
|
| 12 | + (click)="addUser()" |
11 | 13 | ></vcl-icon>
|
12 | 14 | </legend>
|
13 | 15 |
|
14 |
| - <fieldset> |
15 |
| - <legend> |
16 |
| - Role 1 |
17 |
| - <vcl-icon |
18 |
| - class="vcl-jss-form-remove" |
19 |
| - icon="vcl:remove" |
20 |
| - ></vcl-icon> |
21 |
| - </legend> |
| 16 | + <div formArrayName="associations"> |
| 17 | + @for (item of associations.controls; track item; let idx = $index) { |
| 18 | + <fieldset |
| 19 | + [formGroupName]="idx" |
| 20 | + class="mb-3" |
| 21 | + > |
| 22 | + <legend> |
| 23 | + Role {{ idx + 1 }} |
| 24 | + <vcl-icon |
| 25 | + class="role-remove" |
| 26 | + icon="vcl:remove" |
| 27 | + (click)="removeUser(idx)" |
| 28 | + ></vcl-icon> |
| 29 | + </legend> |
22 | 30 |
|
23 |
| - <vcl-form-control-group> |
24 |
| - <vcl-label>Role</vcl-label> |
25 |
| - <vcl-select |
26 |
| - [clearable]="true" |
27 |
| - placeholder="Select role" |
28 |
| - [search]="true" |
29 |
| - > |
30 |
| - <vcl-select-list> |
31 |
| - <vcl-select-list-item> |
32 |
| - Role 1 |
33 |
| - <vcl-sub-label>About role 1</vcl-sub-label> |
34 |
| - </vcl-select-list-item> |
35 |
| - </vcl-select-list> |
36 |
| - </vcl-select> |
37 |
| - <vcl-hint-error error="required" |
38 |
| - >This field is required.</vcl-hint-error |
39 |
| - > |
40 |
| - </vcl-form-control-group> |
| 31 | + <vcl-form-control-group> |
| 32 | + <vcl-label>Role</vcl-label> |
| 33 | + <vcl-select |
| 34 | + [clearable]="true" |
| 35 | + placeholder="Select role" |
| 36 | + [search]="true" |
| 37 | + > |
| 38 | + <vcl-select-list formControlName="role"> |
| 39 | + <vcl-select-list-item> |
| 40 | + Role 1 |
| 41 | + <vcl-sub-label>About role 1</vcl-sub-label> |
| 42 | + </vcl-select-list-item> |
| 43 | + </vcl-select-list> |
| 44 | + </vcl-select> |
| 45 | + <vcl-hint-error error="required" |
| 46 | + >This field is required.</vcl-hint-error |
| 47 | + > |
| 48 | + </vcl-form-control-group> |
41 | 49 |
|
42 |
| - <!-- roleScopingInstanceType --> |
43 |
| - <vcl-form-control-group> |
44 |
| - <vcl-label>Role scoping instance type</vcl-label> |
45 |
| - <vcl-select |
46 |
| - [clearable]="true" |
47 |
| - placeholder="Select scoping instance" |
48 |
| - > |
49 |
| - <vcl-select-list> |
50 |
| - <vcl-select-list-item> |
51 |
| - Role 1 |
52 |
| - <vcl-sub-label>About role 1</vcl-sub-label> |
53 |
| - </vcl-select-list-item> |
54 |
| - </vcl-select-list> |
55 |
| - </vcl-select> |
56 |
| - <vcl-hint-error error="required" |
57 |
| - >This field is required.</vcl-hint-error |
58 |
| - > |
59 |
| - </vcl-form-control-group> |
| 50 | + <vcl-form-control-group> |
| 51 | + <vcl-label>Instance type</vcl-label> |
| 52 | + <vcl-select |
| 53 | + [clearable]="true" |
| 54 | + placeholder="Select scoping instance" |
| 55 | + > |
| 56 | + <vcl-select-list formControlName="instanceType"> |
| 57 | + <vcl-select-list-item> |
| 58 | + Role 1 |
| 59 | + <vcl-sub-label>About role 1</vcl-sub-label> |
| 60 | + </vcl-select-list-item> |
| 61 | + </vcl-select-list> |
| 62 | + </vcl-select> |
| 63 | + <vcl-hint-error error="required" |
| 64 | + >This field is required.</vcl-hint-error |
| 65 | + > |
| 66 | + </vcl-form-control-group> |
60 | 67 |
|
61 |
| - <!-- Organization --> |
62 |
| - <vcl-form-control-group> |
63 |
| - <vcl-label>Organization</vcl-label> |
64 |
| - <vcl-select |
65 |
| - [clearable]="true" |
66 |
| - placeholder="Select Organization" |
67 |
| - [search]="true" |
68 |
| - > |
69 |
| - <vcl-select-list> |
70 |
| - <vcl-select-list-item> |
71 |
| - Role 1 |
72 |
| - <vcl-sub-label>About role 1</vcl-sub-label> |
73 |
| - </vcl-select-list-item> |
74 |
| - </vcl-select-list> |
75 |
| - </vcl-select> |
76 |
| - <vcl-hint-error error="required" |
77 |
| - >This field is required.</vcl-hint-error |
78 |
| - > |
79 |
| - </vcl-form-control-group> |
| 68 | + <!-- Organization --> |
| 69 | + <vcl-form-control-group> |
| 70 | + <vcl-label>Organization</vcl-label> |
| 71 | + <vcl-select |
| 72 | + [clearable]="true" |
| 73 | + placeholder="Select Organization" |
| 74 | + [search]="true" |
| 75 | + > |
| 76 | + <vcl-select-list formArrayName="instanceId"> |
| 77 | + <vcl-select-list-item> |
| 78 | + Role 1 |
| 79 | + <vcl-sub-label>About role 1</vcl-sub-label> |
| 80 | + </vcl-select-list-item> |
| 81 | + </vcl-select-list> |
| 82 | + </vcl-select> |
| 83 | + <vcl-hint-error error="required" |
| 84 | + >This field is required.</vcl-hint-error |
| 85 | + > |
| 86 | + </vcl-form-control-group> |
80 | 87 |
|
81 |
| - <!-- User --> |
82 |
| - <vcl-form-control-group> |
83 |
| - <vcl-label>User</vcl-label> |
84 |
| - <vcl-select |
85 |
| - [clearable]="true" |
86 |
| - placeholder="Select User" |
87 |
| - [search]="true" |
88 |
| - > |
89 |
| - <vcl-select-list> |
90 |
| - <vcl-select-list-item> |
91 |
| - Role 1 |
92 |
| - <vcl-sub-label>About role 1</vcl-sub-label> |
93 |
| - </vcl-select-list-item> |
94 |
| - </vcl-select-list> |
95 |
| - </vcl-select> |
96 |
| - <vcl-hint-error error="required" |
97 |
| - >This field is required.</vcl-hint-error |
98 |
| - > |
99 |
| - </vcl-form-control-group> |
100 |
| - </fieldset> |
| 88 | + <!-- User --> |
| 89 | + <vcl-form-control-group> |
| 90 | + <vcl-label>User</vcl-label> |
| 91 | + <vcl-select |
| 92 | + [clearable]="true" |
| 93 | + placeholder="Select User" |
| 94 | + [search]="true" |
| 95 | + > |
| 96 | + <vcl-select-list formArrayName="instanceId"> |
| 97 | + <vcl-select-list-item> |
| 98 | + Role 1 |
| 99 | + <vcl-sub-label>About role 1</vcl-sub-label> |
| 100 | + </vcl-select-list-item> |
| 101 | + </vcl-select-list> |
| 102 | + </vcl-select> |
| 103 | + <vcl-hint-error error="required" |
| 104 | + >This field is required.</vcl-hint-error |
| 105 | + > |
| 106 | + </vcl-form-control-group> |
| 107 | + </fieldset> |
| 108 | + } |
| 109 | + </div> |
| 110 | + |
| 111 | + @if (associations.controls.length === 0) { No role associations } |
101 | 112 | </fieldset>
|
102 | 113 |
|
103 | 114 | <!-- Buttons -->
|
104 |
| - <div class="loose-button-group"> |
| 115 | + <div class="loose-button-group row justify-end mt-4"> |
105 | 116 | <button
|
106 | 117 | vcl-button
|
107 |
| - type="submit" |
108 |
| - class="emphasized" |
| 118 | + type="button" |
| 119 | + class="transparent" |
109 | 120 | >
|
110 |
| - Save |
| 121 | + Cancel |
111 | 122 | </button>
|
| 123 | + |
112 | 124 | <button
|
113 | 125 | vcl-button
|
114 |
| - type="button" |
115 |
| - class="transparent" |
| 126 | + type="submit" |
116 | 127 | >
|
117 |
| - Cancel |
| 128 | + Save |
118 | 129 | </button>
|
119 | 130 | </div>
|
120 | 131 | </form>
|
0 commit comments