@truedat/ai 6.11.0 → 6.12.0

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,316 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`<ActionEdit /> 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
+ Edit 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
+ Edit 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
+ </label>
76
+ <div
77
+ class="field"
78
+ >
79
+ <div
80
+ class="ui input"
81
+ >
82
+ <input
83
+ name="name"
84
+ type="text"
85
+ value="Action Name"
86
+ />
87
+ </div>
88
+ </div>
89
+ </div>
90
+ <div
91
+ class="required field"
92
+ >
93
+ <label>
94
+ Agent
95
+ </label>
96
+ <div
97
+ class="field"
98
+ >
99
+ <div
100
+ aria-expanded="false"
101
+ class="ui fluid selection dropdown"
102
+ name="user_id"
103
+ role="listbox"
104
+ tabindex="0"
105
+ >
106
+ <div
107
+ aria-atomic="true"
108
+ aria-live="polite"
109
+ class="divider text"
110
+ role="alert"
111
+ >
112
+ Agent 1
113
+ </div>
114
+ <i
115
+ aria-hidden="true"
116
+ class="dropdown icon"
117
+ />
118
+ <div
119
+ class="menu transition"
120
+ >
121
+ <div
122
+ aria-checked="true"
123
+ aria-selected="true"
124
+ class="active selected item"
125
+ role="option"
126
+ style="pointer-events: all;"
127
+ >
128
+ <span
129
+ class="text"
130
+ >
131
+ Agent 1
132
+ </span>
133
+ </div>
134
+ <div
135
+ aria-checked="false"
136
+ aria-selected="false"
137
+ class="item"
138
+ role="option"
139
+ style="pointer-events: all;"
140
+ >
141
+ <span
142
+ class="text"
143
+ >
144
+ Agent 2
145
+ </span>
146
+ </div>
147
+ </div>
148
+ </div>
149
+ </div>
150
+ </div>
151
+ <div
152
+ class="required field"
153
+ >
154
+ <label>
155
+ Template
156
+ </label>
157
+ <div
158
+ class="disabled field"
159
+ >
160
+ <div
161
+ aria-busy="true"
162
+ aria-disabled="true"
163
+ aria-expanded="false"
164
+ class="ui disabled loading search selection dropdown"
165
+ name="template"
166
+ role="combobox"
167
+ >
168
+ <input
169
+ aria-autocomplete="list"
170
+ autocomplete="off"
171
+ class="search"
172
+ tabindex="-1"
173
+ type="text"
174
+ value=""
175
+ />
176
+ <div
177
+ aria-atomic="true"
178
+ aria-live="polite"
179
+ class="divider text"
180
+ role="alert"
181
+ >
182
+ Loading
183
+ </div>
184
+ <i
185
+ aria-hidden="true"
186
+ class="dropdown icon"
187
+ />
188
+ <div
189
+ class="menu transition"
190
+ role="listbox"
191
+ >
192
+ <div
193
+ class="message"
194
+ >
195
+ No results found.
196
+ </div>
197
+ </div>
198
+ </div>
199
+ </div>
200
+ </div>
201
+ <div
202
+ class="ui segment"
203
+ >
204
+ <div
205
+ class="field"
206
+ data-testid="form-field"
207
+ >
208
+ <label>
209
+ Field Label
210
+ <span
211
+ style="color: rgb(217, 92, 92); margin-left: 3px;"
212
+ >
213
+ *
214
+ </span>
215
+ </label>
216
+ <div
217
+ class="dimmable"
218
+ >
219
+ <div
220
+ class="field"
221
+ >
222
+ <div
223
+ aria-expanded="false"
224
+ class="ui fluid search selection dropdown"
225
+ name="field_name"
226
+ role="combobox"
227
+ >
228
+ <input
229
+ aria-autocomplete="list"
230
+ autocomplete="off"
231
+ class="search"
232
+ tabindex="0"
233
+ type="text"
234
+ value=""
235
+ />
236
+ <div
237
+ aria-atomic="true"
238
+ aria-live="polite"
239
+ class="divider text"
240
+ role="alert"
241
+ >
242
+ Value One
243
+ </div>
244
+ <i
245
+ aria-hidden="true"
246
+ class="dropdown icon"
247
+ />
248
+ <div
249
+ aria-multiselectable="false"
250
+ class="menu transition"
251
+ role="listbox"
252
+ >
253
+ <div
254
+ aria-checked="false"
255
+ aria-selected="false"
256
+ class="item"
257
+ role="option"
258
+ style="pointer-events: all;"
259
+ >
260
+ <span
261
+ class="text"
262
+ >
263
+ No selection
264
+ </span>
265
+ </div>
266
+ <div
267
+ aria-checked="true"
268
+ aria-selected="true"
269
+ class="active selected item"
270
+ role="option"
271
+ style="pointer-events: all;"
272
+ >
273
+ <span
274
+ class="text"
275
+ >
276
+ Value One
277
+ </span>
278
+ </div>
279
+ </div>
280
+ </div>
281
+ </div>
282
+ <div
283
+ class="ui inverted dimmer"
284
+ >
285
+ <div
286
+ class="content"
287
+ >
288
+ <div
289
+ class="ui loader"
290
+ />
291
+ </div>
292
+ </div>
293
+ </div>
294
+ </div>
295
+ </div>
296
+ </form>
297
+ <div
298
+ class="ai-action-edit-form-actions actions"
299
+ >
300
+ <a
301
+ class="ui secondary button"
302
+ href="/"
303
+ role="button"
304
+ >
305
+ Cancel
306
+ </a>
307
+ <button
308
+ class="ui primary button"
309
+ role="button"
310
+ >
311
+ Update
312
+ </button>
313
+ </div>
314
+ </div>
315
+ </div>
316
+ `;
@@ -0,0 +1,326 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`<ActionForm /> matches the latest snapshot when is creating 1`] = `
4
+ <div>
5
+ <form
6
+ class="ui form"
7
+ role="form"
8
+ style="display: none;"
9
+ >
10
+ <div
11
+ class="required field"
12
+ >
13
+ <label>
14
+ Name
15
+ <div
16
+ class="ui left pointing label"
17
+ >
18
+ Required Field
19
+ </div>
20
+ </label>
21
+ <div
22
+ class="field"
23
+ >
24
+ <div
25
+ class="ui input"
26
+ >
27
+ <input
28
+ name="name"
29
+ type="text"
30
+ value=""
31
+ />
32
+ </div>
33
+ </div>
34
+ </div>
35
+ <div
36
+ class="required field"
37
+ >
38
+ <label>
39
+ user
40
+ <div
41
+ class="ui left pointing label"
42
+ >
43
+ Required Field
44
+ </div>
45
+ </label>
46
+ <div
47
+ class="field"
48
+ >
49
+ <div
50
+ aria-expanded="false"
51
+ class="ui fluid selection dropdown"
52
+ name="user_id"
53
+ role="listbox"
54
+ tabindex="0"
55
+ >
56
+ <div
57
+ aria-atomic="true"
58
+ aria-live="polite"
59
+ class="divider default text"
60
+ role="alert"
61
+ >
62
+ Select One...
63
+ </div>
64
+ <i
65
+ aria-hidden="true"
66
+ class="dropdown icon"
67
+ />
68
+ <div
69
+ class="menu transition"
70
+ >
71
+ <div
72
+ aria-checked="false"
73
+ aria-selected="true"
74
+ class="selected item"
75
+ role="option"
76
+ style="pointer-events: all;"
77
+ >
78
+ <span
79
+ class="text"
80
+ >
81
+ Agent 1
82
+ </span>
83
+ </div>
84
+ <div
85
+ aria-checked="false"
86
+ aria-selected="false"
87
+ class="item"
88
+ role="option"
89
+ style="pointer-events: all;"
90
+ >
91
+ <span
92
+ class="text"
93
+ >
94
+ Agent 2
95
+ </span>
96
+ </div>
97
+ </div>
98
+ </div>
99
+ </div>
100
+ </div>
101
+ </form>
102
+ <div
103
+ class="ai-action-edit-form-actions actions"
104
+ style="display: none;"
105
+ >
106
+ <a
107
+ class="ui secondary button"
108
+ href="/"
109
+ role="button"
110
+ >
111
+ Cancel
112
+ </a>
113
+ <button
114
+ class="ui primary disabled button"
115
+ disabled=""
116
+ role="button"
117
+ tabindex="-1"
118
+ >
119
+ Create
120
+ </button>
121
+ </div>
122
+ </div>
123
+ `;
124
+
125
+ exports[`<ActionForm /> matches the latest snapshot when is editing 1`] = `
126
+ <div>
127
+ <form
128
+ class="ui form"
129
+ role="form"
130
+ >
131
+ <div
132
+ class="required field"
133
+ >
134
+ <label>
135
+ Name
136
+ </label>
137
+ <div
138
+ class="field"
139
+ >
140
+ <div
141
+ class="ui input"
142
+ >
143
+ <input
144
+ name="name"
145
+ type="text"
146
+ value="Action Name"
147
+ />
148
+ </div>
149
+ </div>
150
+ </div>
151
+ <div
152
+ class="required field"
153
+ >
154
+ <label>
155
+ user
156
+ </label>
157
+ <div
158
+ class="field"
159
+ >
160
+ <div
161
+ aria-expanded="false"
162
+ class="ui fluid selection dropdown"
163
+ name="user_id"
164
+ role="listbox"
165
+ tabindex="0"
166
+ >
167
+ <div
168
+ aria-atomic="true"
169
+ aria-live="polite"
170
+ class="divider text"
171
+ role="alert"
172
+ >
173
+ Agent 1
174
+ </div>
175
+ <i
176
+ aria-hidden="true"
177
+ class="dropdown icon"
178
+ />
179
+ <div
180
+ class="menu transition"
181
+ >
182
+ <div
183
+ aria-checked="true"
184
+ aria-selected="true"
185
+ class="active selected item"
186
+ role="option"
187
+ style="pointer-events: all;"
188
+ >
189
+ <span
190
+ class="text"
191
+ >
192
+ Agent 1
193
+ </span>
194
+ </div>
195
+ <div
196
+ aria-checked="false"
197
+ aria-selected="false"
198
+ class="item"
199
+ role="option"
200
+ style="pointer-events: all;"
201
+ >
202
+ <span
203
+ class="text"
204
+ >
205
+ Agent 2
206
+ </span>
207
+ </div>
208
+ </div>
209
+ </div>
210
+ </div>
211
+ </div>
212
+ <div
213
+ class="ui segment"
214
+ >
215
+ <div
216
+ class="field"
217
+ data-testid="form-field"
218
+ >
219
+ <label>
220
+ Field Label
221
+ <span
222
+ style="color: rgb(217, 92, 92); margin-left: 3px;"
223
+ >
224
+ *
225
+ </span>
226
+ </label>
227
+ <div
228
+ class="dimmable"
229
+ >
230
+ <div
231
+ class="field"
232
+ >
233
+ <div
234
+ aria-expanded="false"
235
+ class="ui fluid search selection dropdown"
236
+ name="field_name"
237
+ role="combobox"
238
+ >
239
+ <input
240
+ aria-autocomplete="list"
241
+ autocomplete="off"
242
+ class="search"
243
+ tabindex="0"
244
+ type="text"
245
+ value=""
246
+ />
247
+ <div
248
+ aria-atomic="true"
249
+ aria-live="polite"
250
+ class="divider text"
251
+ role="alert"
252
+ >
253
+ Value One
254
+ </div>
255
+ <i
256
+ aria-hidden="true"
257
+ class="dropdown icon"
258
+ />
259
+ <div
260
+ aria-multiselectable="false"
261
+ class="menu transition"
262
+ role="listbox"
263
+ >
264
+ <div
265
+ aria-checked="false"
266
+ aria-selected="false"
267
+ class="item"
268
+ role="option"
269
+ style="pointer-events: all;"
270
+ >
271
+ <span
272
+ class="text"
273
+ >
274
+ No Selection
275
+ </span>
276
+ </div>
277
+ <div
278
+ aria-checked="true"
279
+ aria-selected="true"
280
+ class="active selected item"
281
+ role="option"
282
+ style="pointer-events: all;"
283
+ >
284
+ <span
285
+ class="text"
286
+ >
287
+ Value One
288
+ </span>
289
+ </div>
290
+ </div>
291
+ </div>
292
+ </div>
293
+ <div
294
+ class="ui inverted dimmer"
295
+ >
296
+ <div
297
+ class="content"
298
+ >
299
+ <div
300
+ class="ui loader"
301
+ />
302
+ </div>
303
+ </div>
304
+ </div>
305
+ </div>
306
+ </div>
307
+ </form>
308
+ <div
309
+ class="ai-action-edit-form-actions actions"
310
+ >
311
+ <a
312
+ class="ui secondary button"
313
+ href="/"
314
+ role="button"
315
+ >
316
+ Cancel
317
+ </a>
318
+ <button
319
+ class="ui primary button"
320
+ role="button"
321
+ >
322
+ Update
323
+ </button>
324
+ </div>
325
+ </div>
326
+ `;