@truedat/qx 5.14.1 → 5.15.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.
- package/package.json +3 -3
- package/src/api.js +3 -2
- package/src/components/QxRoutes.js +4 -4
- package/src/components/common/ResourceSelector.js +80 -0
- package/src/components/common/TestFormWrapper.js +9 -6
- package/src/components/common/TypeSelector.js +3 -1
- package/src/components/common/__tests__/DescriptionInput.spec.js +48 -0
- package/src/components/common/__tests__/ResourceSelector.spec.js +124 -0
- package/src/components/common/__tests__/TypeSelector.spec.js +29 -0
- package/src/components/common/__tests__/__snapshots__/DescriptionInput.spec.js.snap +19 -0
- package/src/components/common/__tests__/__snapshots__/ResourceSelector.spec.js.snap +484 -0
- package/src/components/common/__tests__/__snapshots__/TypeSelector.spec.js.snap +230 -0
- package/src/components/common/expressions/Clauses.js +100 -0
- package/src/components/common/expressions/Condition.js +178 -0
- package/src/components/common/expressions/Expression.js +54 -0
- package/src/components/common/expressions/FieldSelector.js +66 -0
- package/src/components/{functions → common}/expressions/FunctionArgs.js +1 -0
- package/src/components/{functions → common}/expressions/FunctionSelector.js +24 -4
- package/src/components/{functions → common}/expressions/ParamSelector.js +3 -3
- package/src/components/{functions → common}/expressions/ShapeSelector.js +22 -6
- package/src/components/common/expressions/__tests__/Clauses.spec.js +53 -0
- package/src/components/common/expressions/__tests__/Condition.spec.js +33 -0
- package/src/components/{functions → common}/expressions/__tests__/ConstantSelector.spec.js +6 -1
- package/src/components/{functions → common}/expressions/__tests__/Expression.spec.js +7 -5
- package/src/components/common/expressions/__tests__/FieldSelector.spec.js +24 -0
- package/src/components/{functions → common}/expressions/__tests__/FunctionArgs.spec.js +20 -6
- package/src/components/{functions → common}/expressions/__tests__/FunctionSelector.spec.js +1 -1
- package/src/components/{functions → common}/expressions/__tests__/ParamSelector.spec.js +22 -10
- package/src/components/{functions → common}/expressions/__tests__/ShapeSelector.spec.js +3 -3
- package/src/components/common/expressions/__tests__/__snapshots__/Clauses.spec.js.snap +64 -0
- package/src/components/common/expressions/__tests__/__snapshots__/Condition.spec.js.snap +316 -0
- package/src/components/{functions → common}/expressions/__tests__/__snapshots__/ConstantSelector.spec.js.snap +1 -1
- package/src/components/common/expressions/__tests__/__snapshots__/Expression.spec.js.snap +939 -0
- package/src/components/common/expressions/__tests__/__snapshots__/FieldSelector.spec.js.snap +5 -0
- package/src/components/common/expressions/__tests__/__snapshots__/FunctionArgs.spec.js.snap +344 -0
- package/src/components/{functions → common}/expressions/__tests__/__snapshots__/ParamSelector.spec.js.snap +4 -4
- package/src/components/{functions → common}/expressions/__tests__/__snapshots__/ShapeSelector.spec.js.snap +17 -24
- package/src/components/common/expressions/constantInputs/AnySelector.js +44 -0
- package/src/components/{functions → common}/expressions/constantInputs/__tests__/AnySelector.spec.js +21 -14
- package/src/components/{functions → common}/expressions/constantInputs/__tests__/DefaultSelector.spec.js +5 -2
- package/src/components/{functions → common}/expressions/constantInputs/__tests__/__snapshots__/AnySelector.spec.js.snap +2 -2
- package/src/components/common/expressions/index.js +4 -0
- package/src/components/common/resourceSelectors/DataStructureSelector.js +63 -0
- package/src/components/common/resourceSelectors/DataViewSelector.js +65 -0
- package/src/components/common/resourceSelectors/ReferenceDatasetSelector.js +61 -0
- package/src/components/common/resourceSelectors/__tests__/DataStructureSelector.spec.js +31 -0
- package/src/components/common/resourceSelectors/__tests__/DataViewSelector.spec.js +133 -0
- package/src/components/common/resourceSelectors/__tests__/ReferenceDatasetSelector.spec.js +97 -0
- package/src/components/common/resourceSelectors/__tests__/__snapshots__/DataStructureSelector.spec.js.snap +105 -0
- package/src/components/common/resourceSelectors/__tests__/__snapshots__/DataViewSelector.spec.js.snap +50 -0
- package/src/components/common/resourceSelectors/__tests__/__snapshots__/ReferenceDatasetSelector.spec.js.snap +50 -0
- package/src/components/common/resourceSelectors/index.js +5 -0
- package/src/components/dataViews/DataViewEditor.js +170 -0
- package/src/components/dataViews/DataViewSelect.js +47 -0
- package/src/components/dataViews/DataViews.js +169 -0
- package/src/components/dataViews/Queryable.js +138 -0
- package/src/components/dataViews/Queryables.js +53 -0
- package/src/components/dataViews/__tests__/DataViewEditor.spec.js +293 -0
- package/src/components/dataViews/__tests__/DataViewSelect.spec.js +28 -0
- package/src/components/dataViews/__tests__/DataViews.spec.js +57 -0
- package/src/components/dataViews/__tests__/Queryable.spec.js +201 -0
- package/src/components/dataViews/__tests__/Queryables.spec.js +183 -0
- package/src/components/dataViews/__tests__/__snapshots__/DataViewEditor.spec.js.snap +1000 -0
- package/src/components/dataViews/__tests__/__snapshots__/DataViewSelect.spec.js.snap +55 -0
- package/src/components/dataViews/__tests__/__snapshots__/DataViews.spec.js.snap +77 -0
- package/src/components/dataViews/__tests__/__snapshots__/Queryable.spec.js.snap +874 -0
- package/src/components/dataViews/__tests__/__snapshots__/Queryables.spec.js.snap +911 -0
- package/src/components/dataViews/__tests__/queryableFunctions.spec.js +193 -0
- package/src/components/dataViews/queryableFunctions.js +80 -0
- package/src/components/dataViews/queryableProperties/From.js +15 -0
- package/src/components/dataViews/queryableProperties/GroupBy.js +124 -0
- package/src/components/dataViews/queryableProperties/Join.js +62 -0
- package/src/components/dataViews/queryableProperties/JoinTypeIcon.js +49 -0
- package/src/components/dataViews/queryableProperties/Select.js +76 -0
- package/src/components/dataViews/queryableProperties/SelectField.js +116 -0
- package/src/components/dataViews/queryableProperties/Where.js +15 -0
- package/src/components/dataViews/queryableProperties/__tests__/From.spec.js +30 -0
- package/src/components/dataViews/queryableProperties/__tests__/GroupBy.spec.js +75 -0
- package/src/components/dataViews/queryableProperties/__tests__/Join.spec.js +38 -0
- package/src/components/dataViews/queryableProperties/__tests__/JoinTypeIcon.spec.js +36 -0
- package/src/components/dataViews/queryableProperties/__tests__/Select.spec.js +144 -0
- package/src/components/dataViews/queryableProperties/__tests__/SelectField.spec.js +107 -0
- package/src/components/dataViews/queryableProperties/__tests__/Where.spec.js +27 -0
- package/src/components/dataViews/queryableProperties/__tests__/__snapshots__/From.spec.js.snap +75 -0
- package/src/components/dataViews/queryableProperties/__tests__/__snapshots__/GroupBy.spec.js.snap +276 -0
- package/src/components/dataViews/queryableProperties/__tests__/__snapshots__/Join.spec.js.snap +252 -0
- package/src/components/dataViews/queryableProperties/__tests__/__snapshots__/JoinTypeIcon.spec.js.snap +77 -0
- package/src/components/dataViews/queryableProperties/__tests__/__snapshots__/Select.spec.js.snap +411 -0
- package/src/components/dataViews/queryableProperties/__tests__/__snapshots__/SelectField.spec.js.snap +343 -0
- package/src/components/dataViews/queryableProperties/__tests__/__snapshots__/Where.spec.js.snap +22 -0
- package/src/components/dataViews/queryableProperties/index.js +7 -0
- package/src/components/functions/FunctionEditor.js +30 -29
- package/src/components/functions/Functions.js +3 -11
- package/src/components/functions/__tests__/FunctionEditor.spec.js +6 -0
- package/src/components/functions/__tests__/FunctionParams.spec.js +6 -0
- package/src/components/functions/__tests__/__snapshots__/FunctionEditor.spec.js.snap +490 -466
- package/src/components/functions/__tests__/__snapshots__/FunctionParams.spec.js.snap +1 -1
- package/src/hooks/__tests__/{useDataSets.spec.js → useDataViews.spec.js} +5 -5
- package/src/hooks/useDataViews.js +33 -0
- package/src/styles/Expression.less +150 -0
- package/src/types.js +11 -3
- package/src/components/DataSets.js +0 -64
- package/src/components/__tests__/DataSets.spec.js +0 -46
- package/src/components/__tests__/__snapshots__/DataSets.spec.js.snap +0 -82
- package/src/components/functions/expressions/Expression.js +0 -40
- package/src/components/functions/expressions/FieldSelector.js +0 -56
- package/src/components/functions/expressions/__tests__/__snapshots__/Expression.spec.js.snap +0 -904
- package/src/components/functions/expressions/__tests__/__snapshots__/FunctionArgs.spec.js.snap +0 -392
- package/src/components/functions/expressions/constantInputs/AnySelector.js +0 -29
- package/src/hooks/useDataSets.js +0 -8
- /package/src/components/{functions → common}/expressions/ConstantSelector.js +0 -0
- /package/src/components/{functions → common}/expressions/__tests__/__snapshots__/FunctionSelector.spec.js.snap +0 -0
- /package/src/components/{functions → common/expressions}/__tests__/useWatchParams.spec.js +0 -0
- /package/src/components/{functions → common}/expressions/constantInputs/BooleanSelector.js +0 -0
- /package/src/components/{functions → common}/expressions/constantInputs/DefaultSelector.js +0 -0
- /package/src/components/{functions → common}/expressions/constantInputs/__tests__/BooleanSelector.spec.js +0 -0
- /package/src/components/{functions → common}/expressions/constantInputs/__tests__/__snapshots__/BooleanSelector.spec.js.snap +0 -0
- /package/src/components/{functions → common}/expressions/constantInputs/__tests__/__snapshots__/DefaultSelector.spec.js.snap +0 -0
- /package/src/components/{functions → common}/expressions/constantInputs/index.js +0 -0
- /package/src/components/{functions → common/expressions}/useWatchParams.js +0 -0
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`<SelectField /> matches the latest snapshot for group_by 1`] = `
|
|
4
|
+
<div>
|
|
5
|
+
<div>
|
|
6
|
+
<div
|
|
7
|
+
class="ui grid"
|
|
8
|
+
>
|
|
9
|
+
<div
|
|
10
|
+
class="row"
|
|
11
|
+
>
|
|
12
|
+
<div
|
|
13
|
+
class="column"
|
|
14
|
+
/>
|
|
15
|
+
<div
|
|
16
|
+
class="nine wide column"
|
|
17
|
+
>
|
|
18
|
+
<div
|
|
19
|
+
class="ui grid"
|
|
20
|
+
>
|
|
21
|
+
<div
|
|
22
|
+
class="sixteen wide column"
|
|
23
|
+
>
|
|
24
|
+
<div
|
|
25
|
+
class="expression-container"
|
|
26
|
+
>
|
|
27
|
+
<div
|
|
28
|
+
aria-expanded="false"
|
|
29
|
+
class="ui top left pointing dropdown"
|
|
30
|
+
role="listbox"
|
|
31
|
+
tabindex="0"
|
|
32
|
+
>
|
|
33
|
+
<div
|
|
34
|
+
class="shape-selector-trigger"
|
|
35
|
+
>
|
|
36
|
+
f(x)
|
|
37
|
+
</div>
|
|
38
|
+
<div
|
|
39
|
+
class="menu transition"
|
|
40
|
+
>
|
|
41
|
+
<div
|
|
42
|
+
aria-checked="false"
|
|
43
|
+
aria-selected="false"
|
|
44
|
+
class="item"
|
|
45
|
+
role="option"
|
|
46
|
+
style="pointer-events: all;"
|
|
47
|
+
>
|
|
48
|
+
<div
|
|
49
|
+
class="text flex-center"
|
|
50
|
+
>
|
|
51
|
+
<small
|
|
52
|
+
style="margin-right: 5px;"
|
|
53
|
+
>
|
|
54
|
+
<b>
|
|
55
|
+
<code>
|
|
56
|
+
[π]
|
|
57
|
+
</code>
|
|
58
|
+
</b>
|
|
59
|
+
</small>
|
|
60
|
+
constant
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
<div
|
|
64
|
+
aria-checked="true"
|
|
65
|
+
aria-selected="true"
|
|
66
|
+
class="active selected item"
|
|
67
|
+
role="option"
|
|
68
|
+
style="pointer-events: all;"
|
|
69
|
+
>
|
|
70
|
+
<div
|
|
71
|
+
class="text flex-center"
|
|
72
|
+
>
|
|
73
|
+
<small
|
|
74
|
+
style="margin-right: 5px;"
|
|
75
|
+
>
|
|
76
|
+
<b>
|
|
77
|
+
<code>
|
|
78
|
+
f(x)
|
|
79
|
+
</code>
|
|
80
|
+
</b>
|
|
81
|
+
</small>
|
|
82
|
+
function
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
87
|
+
<div
|
|
88
|
+
class="accordion ui fluid no-margin"
|
|
89
|
+
>
|
|
90
|
+
<div
|
|
91
|
+
class="active title no-padding"
|
|
92
|
+
>
|
|
93
|
+
<div
|
|
94
|
+
class="flex-center"
|
|
95
|
+
>
|
|
96
|
+
<i
|
|
97
|
+
aria-hidden="true"
|
|
98
|
+
class="dropdown icon"
|
|
99
|
+
/>
|
|
100
|
+
<div
|
|
101
|
+
aria-expanded="false"
|
|
102
|
+
class="ui fluid search selection dropdown"
|
|
103
|
+
role="combobox"
|
|
104
|
+
>
|
|
105
|
+
<input
|
|
106
|
+
aria-autocomplete="list"
|
|
107
|
+
autocomplete="off"
|
|
108
|
+
class="search"
|
|
109
|
+
tabindex="0"
|
|
110
|
+
type="text"
|
|
111
|
+
value=""
|
|
112
|
+
/>
|
|
113
|
+
<div
|
|
114
|
+
aria-atomic="true"
|
|
115
|
+
aria-live="polite"
|
|
116
|
+
class="divider text"
|
|
117
|
+
role="alert"
|
|
118
|
+
>
|
|
119
|
+
placeholder
|
|
120
|
+
</div>
|
|
121
|
+
<i
|
|
122
|
+
aria-hidden="true"
|
|
123
|
+
class="dropdown icon"
|
|
124
|
+
/>
|
|
125
|
+
<div
|
|
126
|
+
class="menu transition"
|
|
127
|
+
role="listbox"
|
|
128
|
+
>
|
|
129
|
+
<div
|
|
130
|
+
class="message"
|
|
131
|
+
>
|
|
132
|
+
No results found.
|
|
133
|
+
</div>
|
|
134
|
+
</div>
|
|
135
|
+
</div>
|
|
136
|
+
</div>
|
|
137
|
+
</div>
|
|
138
|
+
<div
|
|
139
|
+
class="content active no-padding"
|
|
140
|
+
/>
|
|
141
|
+
</div>
|
|
142
|
+
</div>
|
|
143
|
+
</div>
|
|
144
|
+
</div>
|
|
145
|
+
</div>
|
|
146
|
+
<div
|
|
147
|
+
class="six wide column"
|
|
148
|
+
>
|
|
149
|
+
<div
|
|
150
|
+
class="inline fields no-margin"
|
|
151
|
+
>
|
|
152
|
+
<div
|
|
153
|
+
class="field"
|
|
154
|
+
>
|
|
155
|
+
<div
|
|
156
|
+
class="ui input"
|
|
157
|
+
>
|
|
158
|
+
<input
|
|
159
|
+
autocomplete="off"
|
|
160
|
+
placeholder="alias"
|
|
161
|
+
type="text"
|
|
162
|
+
value=""
|
|
163
|
+
/>
|
|
164
|
+
</div>
|
|
165
|
+
</div>
|
|
166
|
+
</div>
|
|
167
|
+
</div>
|
|
168
|
+
</div>
|
|
169
|
+
</div>
|
|
170
|
+
</div>
|
|
171
|
+
</div>
|
|
172
|
+
`;
|
|
173
|
+
|
|
174
|
+
exports[`<SelectField /> matches the latest snapshot for select 1`] = `
|
|
175
|
+
<div>
|
|
176
|
+
<div>
|
|
177
|
+
<div
|
|
178
|
+
class="ui grid"
|
|
179
|
+
>
|
|
180
|
+
<div
|
|
181
|
+
class="row"
|
|
182
|
+
>
|
|
183
|
+
<div
|
|
184
|
+
class="column"
|
|
185
|
+
/>
|
|
186
|
+
<div
|
|
187
|
+
class="nine wide column"
|
|
188
|
+
>
|
|
189
|
+
<div
|
|
190
|
+
class="ui grid"
|
|
191
|
+
>
|
|
192
|
+
<div
|
|
193
|
+
class="sixteen wide column"
|
|
194
|
+
>
|
|
195
|
+
<div
|
|
196
|
+
class="expression-container"
|
|
197
|
+
>
|
|
198
|
+
<div
|
|
199
|
+
aria-expanded="false"
|
|
200
|
+
class="ui top left pointing dropdown"
|
|
201
|
+
role="listbox"
|
|
202
|
+
tabindex="0"
|
|
203
|
+
>
|
|
204
|
+
<div
|
|
205
|
+
class="shape-selector-trigger"
|
|
206
|
+
>
|
|
207
|
+
f(x)
|
|
208
|
+
</div>
|
|
209
|
+
<div
|
|
210
|
+
class="menu transition"
|
|
211
|
+
>
|
|
212
|
+
<div
|
|
213
|
+
aria-checked="false"
|
|
214
|
+
aria-selected="false"
|
|
215
|
+
class="item"
|
|
216
|
+
role="option"
|
|
217
|
+
style="pointer-events: all;"
|
|
218
|
+
>
|
|
219
|
+
<div
|
|
220
|
+
class="text flex-center"
|
|
221
|
+
>
|
|
222
|
+
<small
|
|
223
|
+
style="margin-right: 5px;"
|
|
224
|
+
>
|
|
225
|
+
<b>
|
|
226
|
+
<code>
|
|
227
|
+
[π]
|
|
228
|
+
</code>
|
|
229
|
+
</b>
|
|
230
|
+
</small>
|
|
231
|
+
constant
|
|
232
|
+
</div>
|
|
233
|
+
</div>
|
|
234
|
+
<div
|
|
235
|
+
aria-checked="true"
|
|
236
|
+
aria-selected="true"
|
|
237
|
+
class="active selected item"
|
|
238
|
+
role="option"
|
|
239
|
+
style="pointer-events: all;"
|
|
240
|
+
>
|
|
241
|
+
<div
|
|
242
|
+
class="text flex-center"
|
|
243
|
+
>
|
|
244
|
+
<small
|
|
245
|
+
style="margin-right: 5px;"
|
|
246
|
+
>
|
|
247
|
+
<b>
|
|
248
|
+
<code>
|
|
249
|
+
f(x)
|
|
250
|
+
</code>
|
|
251
|
+
</b>
|
|
252
|
+
</small>
|
|
253
|
+
function
|
|
254
|
+
</div>
|
|
255
|
+
</div>
|
|
256
|
+
</div>
|
|
257
|
+
</div>
|
|
258
|
+
<div
|
|
259
|
+
class="accordion ui fluid no-margin"
|
|
260
|
+
>
|
|
261
|
+
<div
|
|
262
|
+
class="active title no-padding"
|
|
263
|
+
>
|
|
264
|
+
<div
|
|
265
|
+
class="flex-center"
|
|
266
|
+
>
|
|
267
|
+
<i
|
|
268
|
+
aria-hidden="true"
|
|
269
|
+
class="dropdown icon"
|
|
270
|
+
/>
|
|
271
|
+
<div
|
|
272
|
+
aria-expanded="false"
|
|
273
|
+
class="ui fluid search selection dropdown"
|
|
274
|
+
role="combobox"
|
|
275
|
+
>
|
|
276
|
+
<input
|
|
277
|
+
aria-autocomplete="list"
|
|
278
|
+
autocomplete="off"
|
|
279
|
+
class="search"
|
|
280
|
+
tabindex="0"
|
|
281
|
+
type="text"
|
|
282
|
+
value=""
|
|
283
|
+
/>
|
|
284
|
+
<div
|
|
285
|
+
aria-atomic="true"
|
|
286
|
+
aria-live="polite"
|
|
287
|
+
class="divider text"
|
|
288
|
+
role="alert"
|
|
289
|
+
>
|
|
290
|
+
placeholder
|
|
291
|
+
</div>
|
|
292
|
+
<i
|
|
293
|
+
aria-hidden="true"
|
|
294
|
+
class="dropdown icon"
|
|
295
|
+
/>
|
|
296
|
+
<div
|
|
297
|
+
class="menu transition"
|
|
298
|
+
role="listbox"
|
|
299
|
+
>
|
|
300
|
+
<div
|
|
301
|
+
class="message"
|
|
302
|
+
>
|
|
303
|
+
No results found.
|
|
304
|
+
</div>
|
|
305
|
+
</div>
|
|
306
|
+
</div>
|
|
307
|
+
</div>
|
|
308
|
+
</div>
|
|
309
|
+
<div
|
|
310
|
+
class="content active no-padding"
|
|
311
|
+
/>
|
|
312
|
+
</div>
|
|
313
|
+
</div>
|
|
314
|
+
</div>
|
|
315
|
+
</div>
|
|
316
|
+
</div>
|
|
317
|
+
<div
|
|
318
|
+
class="six wide column"
|
|
319
|
+
>
|
|
320
|
+
<div
|
|
321
|
+
class="inline fields no-margin"
|
|
322
|
+
>
|
|
323
|
+
<div
|
|
324
|
+
class="field"
|
|
325
|
+
>
|
|
326
|
+
<div
|
|
327
|
+
class="ui input"
|
|
328
|
+
>
|
|
329
|
+
<input
|
|
330
|
+
autocomplete="off"
|
|
331
|
+
placeholder="alias"
|
|
332
|
+
type="text"
|
|
333
|
+
value=""
|
|
334
|
+
/>
|
|
335
|
+
</div>
|
|
336
|
+
</div>
|
|
337
|
+
</div>
|
|
338
|
+
</div>
|
|
339
|
+
</div>
|
|
340
|
+
</div>
|
|
341
|
+
</div>
|
|
342
|
+
</div>
|
|
343
|
+
`;
|
package/src/components/dataViews/queryableProperties/__tests__/__snapshots__/Where.spec.js.snap
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`<Where /> matches the latest snapshot 1`] = `
|
|
4
|
+
<div>
|
|
5
|
+
<div
|
|
6
|
+
class="field"
|
|
7
|
+
>
|
|
8
|
+
<label>
|
|
9
|
+
Clause
|
|
10
|
+
</label>
|
|
11
|
+
<div
|
|
12
|
+
class="ui horizontal divider"
|
|
13
|
+
>
|
|
14
|
+
<button
|
|
15
|
+
class="ui mini button"
|
|
16
|
+
>
|
|
17
|
+
Add Group
|
|
18
|
+
</button>
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
`;
|
|
@@ -15,7 +15,7 @@ import { ConfirmModal } from "@truedat/core/components";
|
|
|
15
15
|
import QxContext from "@truedat/qx/components/QxContext";
|
|
16
16
|
import { typeToColor } from "@truedat/qx/types";
|
|
17
17
|
import { DescriptionInput, TypeSelector } from "@truedat/qx/components/common";
|
|
18
|
-
import Expression from "
|
|
18
|
+
import { Expression } from "@truedat/qx/components/common/expressions";
|
|
19
19
|
|
|
20
20
|
import FunctionParams from "./FunctionParams";
|
|
21
21
|
|
|
@@ -51,7 +51,9 @@ export default function FunctionEditor({
|
|
|
51
51
|
<Form>
|
|
52
52
|
<Header as="h3" dividing>
|
|
53
53
|
{watch("name") || "Function"}/{params.length}
|
|
54
|
-
<Label color={typeToColor(type)}>
|
|
54
|
+
<Label color={typeToColor(type)}>
|
|
55
|
+
{formatMessage({ id: `expressions.data_type.${type}` })}
|
|
56
|
+
</Label>
|
|
55
57
|
</Header>
|
|
56
58
|
<Grid>
|
|
57
59
|
<GridColumn>
|
|
@@ -129,59 +131,58 @@ export default function FunctionEditor({
|
|
|
129
131
|
</QxContext.Provider>
|
|
130
132
|
<Divider hidden />
|
|
131
133
|
<div className="actions">
|
|
132
|
-
|
|
134
|
+
<Button
|
|
135
|
+
onClick={handleSubmit(onSubmit)}
|
|
136
|
+
primary
|
|
137
|
+
loading={isSubmitting}
|
|
138
|
+
disabled={!isValid || !isDirty}
|
|
139
|
+
content={formatMessage({ id: "actions.save" })}
|
|
140
|
+
/>
|
|
141
|
+
{isDirty ? (
|
|
133
142
|
<ConfirmModal
|
|
134
143
|
trigger={
|
|
135
144
|
<Button
|
|
136
|
-
|
|
137
|
-
content={formatMessage({ id: "actions.delete" })}
|
|
145
|
+
content={formatMessage({ id: "actions.cancel" })}
|
|
138
146
|
disabled={isSubmitting}
|
|
139
147
|
/>
|
|
140
148
|
}
|
|
141
149
|
header={formatMessage({
|
|
142
|
-
id: "
|
|
150
|
+
id: "actions.discard.confirmation.header",
|
|
143
151
|
})}
|
|
144
152
|
content={formatMessage({
|
|
145
|
-
id: "
|
|
153
|
+
id: "actions.discard.confirmation.content",
|
|
146
154
|
})}
|
|
147
|
-
onConfirm={
|
|
155
|
+
onConfirm={onCancel}
|
|
148
156
|
onOpen={(e) => e.stopPropagation()}
|
|
149
157
|
onClose={(e) => e.stopPropagation()}
|
|
150
158
|
/>
|
|
151
|
-
) :
|
|
152
|
-
|
|
159
|
+
) : (
|
|
160
|
+
<Button
|
|
161
|
+
content={formatMessage({ id: "actions.cancel" })}
|
|
162
|
+
disabled={isSubmitting}
|
|
163
|
+
onClick={onCancel}
|
|
164
|
+
/>
|
|
165
|
+
)}
|
|
166
|
+
{onDelete ? (
|
|
153
167
|
<ConfirmModal
|
|
154
168
|
trigger={
|
|
155
169
|
<Button
|
|
156
|
-
|
|
170
|
+
color="red"
|
|
171
|
+
content={formatMessage({ id: "actions.delete" })}
|
|
157
172
|
disabled={isSubmitting}
|
|
158
173
|
/>
|
|
159
174
|
}
|
|
160
175
|
header={formatMessage({
|
|
161
|
-
id: "
|
|
176
|
+
id: "functions.action.delete.header",
|
|
162
177
|
})}
|
|
163
178
|
content={formatMessage({
|
|
164
|
-
id: "
|
|
179
|
+
id: "functions.action.delete.content",
|
|
165
180
|
})}
|
|
166
|
-
onConfirm={
|
|
181
|
+
onConfirm={onDelete}
|
|
167
182
|
onOpen={(e) => e.stopPropagation()}
|
|
168
183
|
onClose={(e) => e.stopPropagation()}
|
|
169
184
|
/>
|
|
170
|
-
) :
|
|
171
|
-
<Button
|
|
172
|
-
content={formatMessage({ id: "actions.cancel" })}
|
|
173
|
-
disabled={isSubmitting}
|
|
174
|
-
onClick={onCancel}
|
|
175
|
-
/>
|
|
176
|
-
)}
|
|
177
|
-
|
|
178
|
-
<Button
|
|
179
|
-
onClick={handleSubmit(onSubmit)}
|
|
180
|
-
primary
|
|
181
|
-
loading={isSubmitting}
|
|
182
|
-
disabled={!isValid || !isDirty}
|
|
183
|
-
content={formatMessage({ id: "actions.save" })}
|
|
184
|
-
/>
|
|
185
|
+
) : null}
|
|
185
186
|
</div>
|
|
186
187
|
</Form>
|
|
187
188
|
</FormProvider>
|
|
@@ -7,12 +7,11 @@ import {
|
|
|
7
7
|
GridColumn,
|
|
8
8
|
Header,
|
|
9
9
|
Icon,
|
|
10
|
-
Label,
|
|
11
10
|
List,
|
|
12
11
|
Segment,
|
|
13
12
|
} from "semantic-ui-react";
|
|
14
13
|
|
|
15
|
-
import {
|
|
14
|
+
import { typeLabel } from "@truedat/qx/types";
|
|
16
15
|
import {
|
|
17
16
|
useFunctions,
|
|
18
17
|
useFunctionCreate,
|
|
@@ -101,15 +100,8 @@ export default function Functions() {
|
|
|
101
100
|
>
|
|
102
101
|
<List.Content>
|
|
103
102
|
<List.Header>
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
circular
|
|
107
|
-
color={typeToColor(func.type)}
|
|
108
|
-
width="100px"
|
|
109
|
-
>
|
|
110
|
-
{func.type[0]}
|
|
111
|
-
</Label>{" "}
|
|
112
|
-
{func.name || "Function"}/{func.params.length}
|
|
103
|
+
{typeLabel(func.type)} {func.name || "Function"}/
|
|
104
|
+
{func.params.length}
|
|
113
105
|
</List.Header>
|
|
114
106
|
</List.Content>
|
|
115
107
|
</List.Item>
|
|
@@ -31,6 +31,12 @@ const renderOpts = {
|
|
|
31
31
|
"functions.expression.constant.false": "false",
|
|
32
32
|
"functions.expression.constant.true": "true",
|
|
33
33
|
"functions.form.description": "description",
|
|
34
|
+
"expressions.data_type.timestamp": "timestamp",
|
|
35
|
+
"expressions.data_type.date": "date",
|
|
36
|
+
"expressions.data_type.number": "number",
|
|
37
|
+
"expressions.data_type.string": "string",
|
|
38
|
+
"expressions.data_type.boolean": "boolean",
|
|
39
|
+
"expressions.data_type.any": "any",
|
|
34
40
|
},
|
|
35
41
|
},
|
|
36
42
|
fallback: "lazy",
|
|
@@ -13,6 +13,12 @@ const renderOpts = {
|
|
|
13
13
|
"functions.form.name": "name",
|
|
14
14
|
"functions.form.add_param": "add_param",
|
|
15
15
|
"functions.form.description": "description",
|
|
16
|
+
"expressions.data_type.timestamp": "timestamp",
|
|
17
|
+
"expressions.data_type.date": "date",
|
|
18
|
+
"expressions.data_type.number": "number",
|
|
19
|
+
"expressions.data_type.string": "string",
|
|
20
|
+
"expressions.data_type.boolean": "boolean",
|
|
21
|
+
"expressions.data_type.any": "any",
|
|
16
22
|
},
|
|
17
23
|
},
|
|
18
24
|
fallback: "lazy",
|