@@ -11,68 +11,81 @@ <h2>{{message}}</h2>
11
11
</ mat-form-field >
12
12
13
13
< h2 > Parameters
14
- < button type ="button " (click) ="addParameter() " mat-button > add</ button >
14
+ < button mat-mini-fab (click) ="addParameter() " color ="primary ">
15
+ < mat-icon aria-label ="New Parameter " > add</ mat-icon >
16
+ </ button >
15
17
</ h2 >
16
18
< section class ="parameters " formArrayName ="parameters ">
17
- < div *ngFor ="let paremeter of storyForm.controls.parameters.controls; let i=index; ">
19
+ < div *ngFor ="let paremeter of storyForm.controls.parameters.controls; let i=index; " class =" parameter " >
18
20
19
- < div [formGroup] ="paremeter ">
20
- < mat-form-field >
21
- < textarea matInput formControlName ="name " placeholder ="Parameter name "> </ textarea >
21
+ < div [formGroup] ="paremeter " fxLayout =" row " fxLayoutGap =" 10px " >
22
+ < mat-form-field fxFlex =" 30 " >
23
+ < input matInput formControlName ="name " placeholder ="Parameter name ">
22
24
</ mat-form-field >
23
25
24
- < mat-form-field class ="col-md-4 ">
26
+ < mat-form-field class ="col-md-4 " fxFlex =" 10 " >
25
27
< mat-select formControlName ="type " placeholder ="Parameter type ">
26
28
< mat-option *ngFor ="let story of storyTypesArray " [value] ="story ">
27
29
{{ storyTypes[story] }}
28
30
</ mat-option >
29
31
</ mat-select >
30
32
</ mat-form-field >
31
-
32
- < mat-checkbox formControlName ="required "> Required</ mat-checkbox >
33
-
34
- < mat-form-field *ngIf ="paremeter.controls.required.value ">
33
+ < mat-checkbox formControlName ="required " fxFlex ="10 "> Required</ mat-checkbox >
34
+ < mat-form-field *ngIf ="paremeter.controls.required.value " fxFlex ="45 ">
35
35
< textarea matInput formControlName ="prompt " placeholder ="Message to prompt when require "> </ textarea >
36
36
</ mat-form-field >
37
37
38
- < button type ="button " class ="col-md-1 " (click) ="deleteParameter(i) " mat-button > delete</ button >
38
+ < button mat-icon-button (click) ="deleteParameter(i) " >
39
+ < mat-icon aria-label ="Delete this intent "> delete</ mat-icon >
40
+ </ button >
39
41
</ div >
40
42
</ div >
41
43
42
44
43
45
</ section >
44
46
45
47
46
- < h2 >
48
+ < h3 >
47
49
< mat-checkbox formControlName ="apiTrigger "> API trigger</ mat-checkbox >
48
- </ h2 >
49
- < section [formGroup] ="storyForm.controls.apiDetails " *ngIf ="apiTrigger() ">
50
+ </ h3 >
51
+ < section [formGroup] ="storyForm.controls.apiDetails " *ngIf ="apiTrigger() " fxLayout =" column " fxLayoutGap =" 10px " >
50
52
51
- < mat-checkbox formControlName ="isJson "> JSON</ mat-checkbox >
52
53
53
- < mat-form-field >
54
- < textarea matInput formControlName ="url " placeholder ="API url "> </ textarea >
55
- </ mat-form-field >
56
54
57
- < mat-form-field >
58
- < mat-select formControlName ="requestType " placeholder ="API method ">
59
- < mat-option value ="GET "> GET</ mat-option >
60
- < mat-option value ="POST "> POST</ mat-option >
61
- < mat-option value ="PUT "> PUT</ mat-option >
62
- < mat-option value ="DELETE "> DELETE</ mat-option >
63
- </ mat-select >
64
- </ mat-form-field >
55
+ < div fxLayout ="row " fxLayoutGap ="20px " >
56
+ < mat-form-field fxFlex ="90 ">
57
+ < input matInput formControlName ="url " placeholder ="API url ">
58
+ </ mat-form-field >
59
+
60
+ < mat-form-field fxFlex ="10 ">
61
+ < mat-select formControlName ="requestType " placeholder ="API method ">
62
+ < mat-option value ="GET "> GET</ mat-option >
63
+ < mat-option value ="POST "> POST</ mat-option >
64
+ < mat-option value ="PUT "> PUT</ mat-option >
65
+ < mat-option value ="DELETE "> DELETE</ mat-option >
66
+ </ mat-select >
67
+ </ mat-form-field >
68
+ </ div >
65
69
66
- < mat-form-field class ="full-width ">
67
- < textarea matInput formControlName ="jsonData " placeholder ="JsonData "> </ textarea >
70
+ < mat-checkbox formControlName ="isJson "> JSON payload</ mat-checkbox >
71
+ < div *ngIf ="storyForm.value.apiDetails.isJson ">
72
+ Extracted parameters can be used to build your json. Example, < pre > {{ '\{
73
+ "name": \{\{ parameters\[\"name\"\] \}\}
74
+ \}' }}</ pre >
75
+ </ div >
76
+ < mat-form-field class ="full-width " *ngIf ="storyForm.value.apiDetails.isJson ">
77
+ < textarea matInput formControlName ="jsonData " placeholder ="JsonData " rows ="8 " placeholder ="JSON payload "> </ textarea >
68
78
</ mat-form-field >
79
+
69
80
</ section >
81
+ < br >
70
82
< mat-form-field class ="full-width ">
71
- < textarea matInput formControlName ="speechResponse " placeholder ="Speech Response "> </ textarea >
83
+ < textarea matInput formControlName ="speechResponse " placeholder ="Speech Response " rows =" 5 " > </ textarea >
72
84
</ mat-form-field >
73
85
74
86
< p >
75
- Extracted parameters and api call response can be accessed from speech respone using "parameters" and "result" objects respectively
87
+ Extracted parameters and api call response can be accessed from speech respone using "parameters" and "result" objects respectively.
88
+ < a href ="http://jinja.pocoo.org/docs/2.10/templates/ " target ="_blank "> Jinja</ a > Templating enabled.
76
89
</ p >
77
90
78
91
0 commit comments