1
1
< mat-card >
2
- < h2 > {{message}}</ h2 >
3
-
4
- < form [formGroup] ="storyForm " *ngIf ="storyForm " (submit) ="save() " class ="row " style =" width: 100%; ">
5
- < mat-form-field class ="full-width ">
6
- < textarea matInput formControlName ="storyName " placeholder ="Story name "> </ textarea >
7
- </ mat-form-field >
8
- < br >
9
- < mat-form-field class ="full-width ">
10
- < textarea matInput formControlName ="intentName " placeholder ="Intent key " > </ textarea >
11
- </ mat-form-field >
12
-
13
- < h2 > Parameters
14
- < button mat-mini-fab (click) ="addParameter() " color ="primary ">
15
- < mat-icon aria-label ="New Parameter " > add</ mat-icon >
16
- </ button >
17
- </ h2 >
18
- < section class ="parameters " formArrayName ="parameters ">
19
- < div *ngFor ="let paremeter of storyForm.controls.parameters.controls; let i=index; " class ="parameter ">
20
-
21
- < div [formGroup] ="paremeter " fxLayout ="row " fxLayoutGap ="10px " >
22
- < mat-form-field fxFlex ="30 ">
23
- < input matInput formControlName ="name " placeholder ="Parameter name ">
24
- </ mat-form-field >
2
+ < h2 > {{message}}</ h2 >
25
3
26
- < mat-form-field class ="col-md-4 " fxFlex ="10 ">
27
- < mat-select formControlName ="type " placeholder ="Parameter type ">
28
- < mat-option *ngFor ="let story of storyTypesArray " [value] ="story ">
29
- {{ storyTypes[story] }}
30
- </ mat-option >
31
- </ mat-select >
32
- </ mat-form-field >
33
- < mat-checkbox formControlName ="required " fxFlex ="10 "> Required</ mat-checkbox >
34
- < mat-form-field *ngIf ="paremeter.controls.required.value " fxFlex ="45 ">
35
- < textarea matInput formControlName ="prompt " placeholder ="Message to prompt when require "> </ textarea >
36
- </ mat-form-field >
4
+ < form [formGroup] ="storyForm " *ngIf ="storyForm " (submit) ="save() " class ="row " style =" width: 100%; ">
5
+ < mat-form-field class ="full-width ">
6
+ < textarea matInput formControlName ="storyName " placeholder ="Story name "> </ textarea >
7
+ </ mat-form-field >
8
+ < br >
9
+ < mat-form-field class ="full-width ">
10
+ < textarea matInput formControlName ="intentName " placeholder ="Intent key "> </ textarea >
11
+ </ mat-form-field >
37
12
38
- < button mat-icon-button (click) ="deleteParameter(i) " >
13
+ < h2 > Parameters
14
+ < button mat-mini-fab (click) ="addParameter() " color ="primary ">
15
+ < mat-icon aria-label ="New Parameter "> add</ mat-icon >
16
+ </ button >
17
+ </ h2 >
18
+ < section class ="parameters " formArrayName ="parameters ">
19
+ < div *ngFor ="let paremeter of storyForm.controls.parameters.controls; let i=index; " class ="parameter ">
20
+
21
+ < div [formGroup] ="paremeter " fxLayout ="row " fxLayoutGap ="10px ">
22
+ < mat-form-field fxFlex ="30 ">
23
+ < input matInput formControlName ="name " placeholder ="Parameter name ">
24
+ </ mat-form-field >
25
+
26
+ < mat-form-field class ="col-md-4 " fxFlex ="10 ">
27
+ < mat-select formControlName ="type " placeholder ="Parameter type ">
28
+ < mat-option *ngFor ="let story of storyTypesArray " [value] ="story ">
29
+ {{ storyTypes[story] }}
30
+ </ mat-option >
31
+ </ mat-select >
32
+ </ mat-form-field >
33
+ < mat-checkbox formControlName ="required " fxFlex ="10 "> Required</ mat-checkbox >
34
+ < mat-form-field *ngIf ="paremeter.controls.required.value " fxFlex ="45 ">
35
+ < textarea matInput formControlName ="prompt " placeholder ="Message to prompt when require "> </ textarea >
36
+ </ mat-form-field >
37
+
38
+ < button mat-icon-button (click) ="deleteParameter(i) ">
39
39
< mat-icon aria-label ="Delete this intent "> delete</ mat-icon >
40
40
</ button >
41
+ </ div >
41
42
</ div >
42
- </ div >
43
43
44
44
45
- </ section >
45
+ </ section >
46
46
47
47
48
- < h3 >
49
- < mat-checkbox formControlName ="apiTrigger "> API trigger</ mat-checkbox >
50
- </ h3 >
51
- < section [formGroup] ="storyForm.controls.apiDetails " *ngIf ="apiTrigger() " fxLayout ="column " fxLayoutGap ="10px " >
48
+ < h3 >
49
+ < mat-checkbox formControlName ="apiTrigger "> API trigger</ mat-checkbox >
50
+ </ h3 >
51
+ < section [formGroup] ="storyForm.controls.apiDetails " *ngIf ="apiTrigger() " fxLayout ="column " fxLayoutGap ="10px ">
52
52
53
53
54
54
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 >
55
+ < div fxLayout ="row " fxLayoutGap ="20px ">
56
+ < mat-form-field fxFlex ="90 ">
57
+ < input matInput formControlName ="url " placeholder ="API url ">
58
+ </ mat-form-field >
69
59
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 > {{ '\{
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 >
69
+
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,
73
+ < pre > {{ '\{
73
74
"name": \{\{ parameters\[\"name\"\] \}\}
74
75
\}' }}</ pre >
75
76
</ 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 >
77
+ < mat-form-field class ="full-width " *ngIf ="storyForm.value.apiDetails.isJson ">
78
+ < textarea matInput formControlName ="jsonData " placeholder ="JsonData " rows ="8 " placeholder ="JSON payload "> </ textarea >
79
+ </ mat-form-field >
80
+
81
+ </ section >
82
+ < br >
83
+ < mat-form-field class ="full-width ">
84
+ < textarea matInput formControlName ="speechResponse " placeholder ="Speech Response " rows ="5 "> </ textarea >
78
85
</ mat-form-field >
79
86
80
- </ section >
81
- < br >
82
- < mat-form-field class ="full-width ">
83
- < textarea matInput formControlName ="speechResponse " placeholder ="Speech Response " rows ="5 " > </ textarea >
84
- </ mat-form-field >
87
+ < p >
88
+ Extracted parameters and api call response can be accessed from speech respone using "parameters" and "result" objects respectively.
89
+ < a href ="http://jinja.pocoo.org/docs/2.10/templates/ " target ="_blank "> Jinja</ a > Templating enabled.
90
+ </ p >
85
91
86
- < p >
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.
89
- </ p >
90
92
91
-
92
93
93
- < mat-card-actions >
94
- < button mat-raised-button color ="primary "> Save</ button >
95
- </ mat-card-actions >
96
- </ form >
94
+ < mat-card-actions >
95
+ < button mat-raised-button color ="primary "> Save</ button >
96
+ </ mat-card-actions >
97
+ </ form >
97
98
</ mat-card >
0 commit comments