@truedat/ai 6.11.1 → 6.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/package.json +3 -3
  2. package/src/api.js +8 -0
  3. package/src/components/AiRoutes.js +26 -0
  4. package/src/components/actions/Action.js +90 -0
  5. package/src/components/actions/ActionActions.js +134 -0
  6. package/src/components/actions/ActionBreadcrumbs.js +22 -0
  7. package/src/components/actions/ActionDetail.js +41 -0
  8. package/src/components/actions/ActionEdit.js +70 -0
  9. package/src/components/actions/ActionForm.js +168 -0
  10. package/src/components/actions/ActionNew.js +50 -0
  11. package/src/components/actions/Actions.js +61 -0
  12. package/src/components/actions/ActionsContext.js +52 -0
  13. package/src/components/actions/ActionsTable.js +124 -0
  14. package/src/components/actions/__tests__/Action.spec.js +59 -0
  15. package/src/components/actions/__tests__/ActionActions.spec.js +47 -0
  16. package/src/components/actions/__tests__/ActionBreadcrumbs.spec.js +21 -0
  17. package/src/components/actions/__tests__/ActionDetail.spec.js +106 -0
  18. package/src/components/actions/__tests__/ActionEdit.spec.js +133 -0
  19. package/src/components/actions/__tests__/ActionForm.spec.js +146 -0
  20. package/src/components/actions/__tests__/ActionNew.spec.js +113 -0
  21. package/src/components/actions/__tests__/Actions.spec.js +21 -0
  22. package/src/components/actions/__tests__/ActionsTable.spec.js +72 -0
  23. package/src/components/actions/__tests__/__snapshots__/Action.spec.js.snap +159 -0
  24. package/src/components/actions/__tests__/__snapshots__/ActionActions.spec.js.snap +57 -0
  25. package/src/components/actions/__tests__/__snapshots__/ActionBreadcrumbs.spec.js.snap +25 -0
  26. package/src/components/actions/__tests__/__snapshots__/ActionDetail.spec.js.snap +46 -0
  27. package/src/components/actions/__tests__/__snapshots__/ActionEdit.spec.js.snap +316 -0
  28. package/src/components/actions/__tests__/__snapshots__/ActionForm.spec.js.snap +326 -0
  29. package/src/components/actions/__tests__/__snapshots__/ActionNew.spec.js.snap +518 -0
  30. package/src/components/actions/__tests__/__snapshots__/Actions.spec.js.snap +63 -0
  31. package/src/components/actions/__tests__/__snapshots__/ActionsTable.spec.js.snap +121 -0
  32. package/src/hooks/useActions.js +63 -0
  33. package/src/styles/aiActionEdit.less +19 -0
@@ -0,0 +1,518 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`<ActionNew /> matches the latest snapshot 1`] = `
4
+ <div>
5
+ <div
6
+ class="ui breadcrumb"
7
+ style=""
8
+ >
9
+ <a
10
+ class="section"
11
+ href="/actions"
12
+ >
13
+ Actions
14
+ </a>
15
+ <i
16
+ aria-hidden="true"
17
+ class="right angle icon divider"
18
+ />
19
+ <div
20
+ class="active section"
21
+ >
22
+ New Action
23
+ </div>
24
+ </div>
25
+ <div
26
+ class="ui segment ui text container ai-action-edit ai-action-new"
27
+ style=""
28
+ >
29
+ <div
30
+ class="ai-action-edit-header"
31
+ >
32
+ <h2
33
+ class="ui header"
34
+ >
35
+ <i
36
+ aria-hidden="true"
37
+ class="caret square right icon"
38
+ />
39
+ <div
40
+ class="content"
41
+ >
42
+ New Action
43
+ </div>
44
+ </h2>
45
+ <div
46
+ class="field ai-action-edit-header-active"
47
+ >
48
+ <label>
49
+ Active
50
+ </label>
51
+ <div
52
+ class="ui checked fitted toggle checkbox"
53
+ >
54
+ <input
55
+ checked=""
56
+ class="hidden"
57
+ readonly=""
58
+ tabindex="0"
59
+ type="checkbox"
60
+ value=""
61
+ />
62
+ <label />
63
+ </div>
64
+ </div>
65
+ </div>
66
+ <form
67
+ class="ui form"
68
+ role="form"
69
+ >
70
+ <div
71
+ class="required field"
72
+ >
73
+ <label>
74
+ Name
75
+ <div
76
+ class="ui left pointing label"
77
+ >
78
+ Can't be empty
79
+ </div>
80
+ </label>
81
+ <div
82
+ class="field"
83
+ >
84
+ <div
85
+ class="ui input"
86
+ >
87
+ <input
88
+ name="name"
89
+ type="text"
90
+ value=""
91
+ />
92
+ </div>
93
+ </div>
94
+ </div>
95
+ <div
96
+ class="required field"
97
+ >
98
+ <label>
99
+ Agent
100
+ <div
101
+ class="ui left pointing label"
102
+ >
103
+ Can't be empty
104
+ </div>
105
+ </label>
106
+ <div
107
+ class="field"
108
+ >
109
+ <div
110
+ aria-expanded="false"
111
+ class="ui fluid selection dropdown"
112
+ name="user_id"
113
+ role="listbox"
114
+ tabindex="0"
115
+ >
116
+ <div
117
+ aria-atomic="true"
118
+ aria-live="polite"
119
+ class="divider default text"
120
+ role="alert"
121
+ >
122
+ Select One...
123
+ </div>
124
+ <i
125
+ aria-hidden="true"
126
+ class="dropdown icon"
127
+ />
128
+ <div
129
+ class="menu transition"
130
+ >
131
+ <div
132
+ aria-checked="false"
133
+ aria-selected="true"
134
+ class="selected item"
135
+ role="option"
136
+ style="pointer-events: all;"
137
+ >
138
+ <span
139
+ class="text"
140
+ >
141
+ Agent 1
142
+ </span>
143
+ </div>
144
+ <div
145
+ aria-checked="false"
146
+ aria-selected="false"
147
+ class="item"
148
+ role="option"
149
+ style="pointer-events: all;"
150
+ >
151
+ <span
152
+ class="text"
153
+ >
154
+ Agent 2
155
+ </span>
156
+ </div>
157
+ </div>
158
+ </div>
159
+ </div>
160
+ </div>
161
+ <div
162
+ class="required field"
163
+ >
164
+ <label>
165
+ Template
166
+ <div
167
+ class="ui left pointing label"
168
+ >
169
+ Can't be empty
170
+ </div>
171
+ </label>
172
+ <div
173
+ class="field"
174
+ >
175
+ <div
176
+ aria-busy="true"
177
+ aria-disabled="false"
178
+ aria-expanded="false"
179
+ class="ui loading search selection dropdown"
180
+ name="template"
181
+ role="combobox"
182
+ >
183
+ <input
184
+ aria-autocomplete="list"
185
+ autocomplete="off"
186
+ class="search"
187
+ tabindex="0"
188
+ type="text"
189
+ value=""
190
+ />
191
+ <div
192
+ aria-atomic="true"
193
+ aria-live="polite"
194
+ class="divider default text"
195
+ role="alert"
196
+ >
197
+ Loading
198
+ </div>
199
+ <i
200
+ aria-hidden="true"
201
+ class="dropdown icon"
202
+ />
203
+ <div
204
+ class="menu transition"
205
+ role="listbox"
206
+ >
207
+ <div
208
+ class="message"
209
+ >
210
+ No results found.
211
+ </div>
212
+ </div>
213
+ </div>
214
+ </div>
215
+ </div>
216
+ </form>
217
+ <div
218
+ class="ai-action-edit-form-actions actions"
219
+ >
220
+ <a
221
+ class="ui secondary button"
222
+ href="/"
223
+ role="button"
224
+ >
225
+ Cancel
226
+ </a>
227
+ <button
228
+ class="ui primary disabled button"
229
+ disabled=""
230
+ role="button"
231
+ tabindex="-1"
232
+ >
233
+ Create
234
+ </button>
235
+ </div>
236
+ </div>
237
+ </div>
238
+ `;
239
+
240
+ exports[`<ActionNew /> matches the latest snapshot 2`] = `
241
+ <div>
242
+ <div
243
+ class="ui breadcrumb"
244
+ >
245
+ <a
246
+ class="section"
247
+ href="/actions"
248
+ >
249
+ Actions
250
+ </a>
251
+ <i
252
+ aria-hidden="true"
253
+ class="right angle icon divider"
254
+ />
255
+ <div
256
+ class="active section"
257
+ >
258
+ New Action
259
+ </div>
260
+ </div>
261
+ <div
262
+ class="ui segment ui text container ai-action-edit ai-action-new"
263
+ >
264
+ <div
265
+ class="ai-action-edit-header"
266
+ >
267
+ <h2
268
+ class="ui header"
269
+ >
270
+ <i
271
+ aria-hidden="true"
272
+ class="caret square right icon"
273
+ />
274
+ <div
275
+ class="content"
276
+ >
277
+ New Action
278
+ </div>
279
+ </h2>
280
+ <div
281
+ class="field ai-action-edit-header-active"
282
+ >
283
+ <label>
284
+ Active
285
+ </label>
286
+ <div
287
+ class="ui checked fitted toggle checkbox"
288
+ >
289
+ <input
290
+ checked=""
291
+ class="hidden"
292
+ readonly=""
293
+ tabindex="0"
294
+ type="checkbox"
295
+ value=""
296
+ />
297
+ <label />
298
+ </div>
299
+ </div>
300
+ </div>
301
+ <form
302
+ class="ui form"
303
+ role="form"
304
+ >
305
+ <div
306
+ class="required field"
307
+ >
308
+ <label>
309
+ Name
310
+ <div
311
+ class="ui left pointing label"
312
+ >
313
+ Can't be empty
314
+ </div>
315
+ </label>
316
+ <div
317
+ class="field"
318
+ >
319
+ <div
320
+ class="ui input"
321
+ >
322
+ <input
323
+ name="name"
324
+ type="text"
325
+ value=""
326
+ />
327
+ </div>
328
+ </div>
329
+ </div>
330
+ <div
331
+ class="required field"
332
+ >
333
+ <label>
334
+ Agent
335
+ <div
336
+ class="ui left pointing label"
337
+ >
338
+ Can't be empty
339
+ </div>
340
+ </label>
341
+ <div
342
+ class="field"
343
+ >
344
+ <div
345
+ aria-expanded="false"
346
+ class="ui fluid selection dropdown"
347
+ name="user_id"
348
+ role="listbox"
349
+ tabindex="0"
350
+ >
351
+ <div
352
+ aria-atomic="true"
353
+ aria-live="polite"
354
+ class="divider default text"
355
+ role="alert"
356
+ >
357
+ Select One...
358
+ </div>
359
+ <i
360
+ aria-hidden="true"
361
+ class="dropdown icon"
362
+ />
363
+ <div
364
+ class="menu transition"
365
+ >
366
+ <div
367
+ aria-checked="false"
368
+ aria-selected="true"
369
+ class="selected item"
370
+ role="option"
371
+ style="pointer-events: all;"
372
+ >
373
+ <span
374
+ class="text"
375
+ >
376
+ Agent 1
377
+ </span>
378
+ </div>
379
+ <div
380
+ aria-checked="false"
381
+ aria-selected="false"
382
+ class="item"
383
+ role="option"
384
+ style="pointer-events: all;"
385
+ >
386
+ <span
387
+ class="text"
388
+ >
389
+ Agent 2
390
+ </span>
391
+ </div>
392
+ </div>
393
+ </div>
394
+ </div>
395
+ </div>
396
+ <div
397
+ class="ui segment"
398
+ >
399
+ <div
400
+ class="field"
401
+ data-testid="form-field"
402
+ >
403
+ <label>
404
+ Field Label
405
+ <span
406
+ style="color: rgb(217, 92, 92); margin-left: 3px;"
407
+ >
408
+ *
409
+ </span>
410
+ <div
411
+ class="ui left pointing label"
412
+ >
413
+ Can't be empty
414
+ </div>
415
+ </label>
416
+ <div
417
+ class="dimmable"
418
+ >
419
+ <div
420
+ class="field"
421
+ >
422
+ <div
423
+ aria-expanded="false"
424
+ class="ui fluid search selection dropdown"
425
+ name="field_name"
426
+ role="combobox"
427
+ >
428
+ <input
429
+ aria-autocomplete="list"
430
+ autocomplete="off"
431
+ class="search"
432
+ tabindex="0"
433
+ type="text"
434
+ value=""
435
+ />
436
+ <div
437
+ aria-atomic="true"
438
+ aria-live="polite"
439
+ class="divider default text"
440
+ role="alert"
441
+ >
442
+ Select One...
443
+ </div>
444
+ <i
445
+ aria-hidden="true"
446
+ class="dropdown icon"
447
+ />
448
+ <div
449
+ aria-multiselectable="false"
450
+ class="menu transition"
451
+ role="listbox"
452
+ >
453
+ <div
454
+ aria-checked="false"
455
+ aria-selected="true"
456
+ class="selected item"
457
+ role="option"
458
+ style="pointer-events: all;"
459
+ >
460
+ <span
461
+ class="text"
462
+ >
463
+ No Selection
464
+ </span>
465
+ </div>
466
+ <div
467
+ aria-checked="false"
468
+ aria-selected="false"
469
+ class="item"
470
+ role="option"
471
+ style="pointer-events: all;"
472
+ >
473
+ <span
474
+ class="text"
475
+ >
476
+ Value One
477
+ </span>
478
+ </div>
479
+ </div>
480
+ </div>
481
+ </div>
482
+ <div
483
+ class="ui inverted dimmer"
484
+ >
485
+ <div
486
+ class="content"
487
+ >
488
+ <div
489
+ class="ui loader"
490
+ />
491
+ </div>
492
+ </div>
493
+ </div>
494
+ </div>
495
+ </div>
496
+ </form>
497
+ <div
498
+ class="ai-action-edit-form-actions actions"
499
+ >
500
+ <a
501
+ class="ui secondary button"
502
+ href="/"
503
+ role="button"
504
+ >
505
+ Cancel
506
+ </a>
507
+ <button
508
+ class="ui primary disabled button"
509
+ disabled=""
510
+ role="button"
511
+ tabindex="-1"
512
+ >
513
+ Create
514
+ </button>
515
+ </div>
516
+ </div>
517
+ </div>
518
+ `;
@@ -0,0 +1,63 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`<Actions /> matches the latest snapshot 1`] = `
4
+ <div>
5
+ <div
6
+ class="ui segment"
7
+ >
8
+ <h2
9
+ class="ui header"
10
+ >
11
+ <i
12
+ aria-hidden="true"
13
+ class="caret square right circular icon"
14
+ />
15
+ <div
16
+ class="content"
17
+ >
18
+ AI actions
19
+ <div
20
+ class="sub header"
21
+ >
22
+ AI actions
23
+ </div>
24
+ </div>
25
+ </h2>
26
+ <div
27
+ class="ui grid"
28
+ >
29
+ <div
30
+ class="eight wide column"
31
+ />
32
+ <div
33
+ class="eight wide column"
34
+ >
35
+ <div
36
+ class="ui right aligned container"
37
+ >
38
+ <a
39
+ class="ui primary button"
40
+ href="/actions/new"
41
+ role="button"
42
+ >
43
+ Create
44
+ </a>
45
+ </div>
46
+ </div>
47
+ </div>
48
+ <h4
49
+ class="ui header"
50
+ >
51
+ <i
52
+ aria-hidden="true"
53
+ class="search icon"
54
+ />
55
+ <div
56
+ class="content"
57
+ >
58
+ Empty
59
+ </div>
60
+ </h4>
61
+ </div>
62
+ </div>
63
+ `;
@@ -0,0 +1,121 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`<ActionsTable /> matches the latest snapshot 1`] = `
4
+ <div>
5
+ <table
6
+ class="ui sortable table"
7
+ >
8
+ <thead
9
+ class=""
10
+ >
11
+ <tr
12
+ class=""
13
+ >
14
+ <th
15
+ class=""
16
+ >
17
+ name
18
+ </th>
19
+ <th
20
+ class=""
21
+ >
22
+ Agent
23
+ </th>
24
+ <th
25
+ class=""
26
+ >
27
+ Type
28
+ </th>
29
+ <th
30
+ class=""
31
+ >
32
+ status
33
+ </th>
34
+ <th
35
+ class="two wide descending sorted"
36
+ >
37
+ updated_at
38
+ </th>
39
+ </tr>
40
+ </thead>
41
+ <tbody
42
+ class=""
43
+ >
44
+ <tr
45
+ class=""
46
+ >
47
+ <td
48
+ class=""
49
+ >
50
+ <a
51
+ href="/actions/1"
52
+ >
53
+ action_1
54
+ </a>
55
+ </td>
56
+ <td
57
+ class=""
58
+ >
59
+ agent 1
60
+ </td>
61
+ <td
62
+ class=""
63
+ >
64
+ bar
65
+ </td>
66
+ <td
67
+ class=""
68
+ >
69
+ enabled
70
+ </td>
71
+ <td
72
+ class="center aligned"
73
+ >
74
+ <time
75
+ datetime="1577836800000"
76
+ >
77
+ 2020-01-01 00:00
78
+ </time>
79
+ </td>
80
+ </tr>
81
+ <tr
82
+ class=""
83
+ >
84
+ <td
85
+ class="warning"
86
+ >
87
+ <a
88
+ href="/actions/2"
89
+ >
90
+ action_2
91
+ </a>
92
+ </td>
93
+ <td
94
+ class="warning"
95
+ >
96
+ agent 2
97
+ </td>
98
+ <td
99
+ class="warning"
100
+ >
101
+ foo
102
+ </td>
103
+ <td
104
+ class="warning"
105
+ >
106
+ disabled
107
+ </td>
108
+ <td
109
+ class="warning center aligned"
110
+ >
111
+ <time
112
+ datetime="1577836800000"
113
+ >
114
+ 2020-01-01 00:00
115
+ </time>
116
+ </td>
117
+ </tr>
118
+ </tbody>
119
+ </table>
120
+ </div>
121
+ `;