Spaces:
Building
Building
Update flare-ui/src/app/dialogs/version-edit-dialog/version-edit-dialog.component.ts
Browse files
flare-ui/src/app/dialogs/version-edit-dialog/version-edit-dialog.component.ts
CHANGED
@@ -167,6 +167,12 @@ export default class VersionEditDialogComponent implements OnInit {
|
|
167 |
}
|
168 |
|
169 |
createIntentFormGroup(intent: any = {}): FormGroup {
|
|
|
|
|
|
|
|
|
|
|
|
|
170 |
const parametersArray = this.fb.array([]);
|
171 |
|
172 |
if (intent.parameters) {
|
@@ -180,7 +186,7 @@ export default class VersionEditDialogComponent implements OnInit {
|
|
180 |
caption: [intent.caption || ''],
|
181 |
locale: [intent.locale || 'tr-TR'],
|
182 |
detection_prompt: [intent.detection_prompt || '', Validators.required],
|
183 |
-
examples:
|
184 |
parameters: parametersArray,
|
185 |
action: [intent.action || '', Validators.required],
|
186 |
fallback_timeout_prompt: [intent.fallback_timeout_prompt || ''],
|
|
|
167 |
}
|
168 |
|
169 |
createIntentFormGroup(intent: any = {}): FormGroup {
|
170 |
+
// Examples için FormControl array oluştur
|
171 |
+
const examplesArray = this.fb.array(
|
172 |
+
(intent.examples || []).map((example: string) => this.fb.control(example))
|
173 |
+
);
|
174 |
+
|
175 |
+
// Parameters için ayrı FormGroup'lar oluştur
|
176 |
const parametersArray = this.fb.array([]);
|
177 |
|
178 |
if (intent.parameters) {
|
|
|
186 |
caption: [intent.caption || ''],
|
187 |
locale: [intent.locale || 'tr-TR'],
|
188 |
detection_prompt: [intent.detection_prompt || '', Validators.required],
|
189 |
+
examples: examplesArray,
|
190 |
parameters: parametersArray,
|
191 |
action: [intent.action || '', Validators.required],
|
192 |
fallback_timeout_prompt: [intent.fallback_timeout_prompt || ''],
|