datajunction-ui 0.0.49 → 0.0.50
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 +1 -1
- package/src/app/pages/NodePage/AddComplexDimensionLinkPopover.jsx +24 -0
- package/src/app/pages/NodePage/NodePreAggregationsTab.jsx +22 -0
- package/src/app/services/DJService.js +2 -0
- package/src/app/services/__tests__/DJService.test.jsx +1 -0
- package/src/styles/preaggregations.css +25 -0
package/package.json
CHANGED
|
@@ -66,6 +66,7 @@ export default function AddComplexDimensionLinkPopover({
|
|
|
66
66
|
values.joinType || 'left',
|
|
67
67
|
values.joinCardinality || 'many_to_one',
|
|
68
68
|
values.role?.trim() || null,
|
|
69
|
+
values.defaultValue?.trim() || null,
|
|
69
70
|
);
|
|
70
71
|
|
|
71
72
|
if (response.status === 200 || response.status === 201) {
|
|
@@ -177,6 +178,7 @@ export default function AddComplexDimensionLinkPopover({
|
|
|
177
178
|
joinCardinality:
|
|
178
179
|
existingLink?.join_cardinality || 'many_to_one',
|
|
179
180
|
role: existingLink?.role || '',
|
|
181
|
+
defaultValue: existingLink?.default_value || '',
|
|
180
182
|
}}
|
|
181
183
|
onSubmit={handleSubmit}
|
|
182
184
|
validate={values => {
|
|
@@ -338,6 +340,28 @@ export default function AddComplexDimensionLinkPopover({
|
|
|
338
340
|
</small>
|
|
339
341
|
</div>
|
|
340
342
|
|
|
343
|
+
<div style={{ marginBottom: '1rem' }}>
|
|
344
|
+
<label htmlFor="defaultValue">
|
|
345
|
+
Default Value (Optional)
|
|
346
|
+
</label>
|
|
347
|
+
<Field
|
|
348
|
+
type="text"
|
|
349
|
+
name="defaultValue"
|
|
350
|
+
id="defaultValue"
|
|
351
|
+
placeholder="e.g., Unknown, N/A"
|
|
352
|
+
style={{
|
|
353
|
+
width: '100%',
|
|
354
|
+
padding: '0.5rem',
|
|
355
|
+
}}
|
|
356
|
+
/>
|
|
357
|
+
<small
|
|
358
|
+
style={{ color: '#6c757d', fontSize: '0.75rem' }}
|
|
359
|
+
>
|
|
360
|
+
Value to use when LEFT or RIGHT JOIN produces NULL
|
|
361
|
+
(wraps dimension column in COALESCE)
|
|
362
|
+
</small>
|
|
363
|
+
</div>
|
|
364
|
+
|
|
341
365
|
<button
|
|
342
366
|
className="add_node"
|
|
343
367
|
type="submit"
|
|
@@ -202,6 +202,15 @@ export default function NodePreAggregationsTab({ node }) {
|
|
|
202
202
|
{isExpanded ? '\u25BC' : '\u25B6'}
|
|
203
203
|
</span>
|
|
204
204
|
|
|
205
|
+
{preagg.preagg_hash && (
|
|
206
|
+
<code
|
|
207
|
+
className="preagg-row-hash"
|
|
208
|
+
title="Pre-aggregation hash - used in table and workflow names"
|
|
209
|
+
>
|
|
210
|
+
{preagg.preagg_hash}
|
|
211
|
+
</code>
|
|
212
|
+
)}
|
|
213
|
+
|
|
205
214
|
<div className="preagg-row-grain-chips">
|
|
206
215
|
{(() => {
|
|
207
216
|
const grainCols = preagg.grain_columns || [];
|
|
@@ -309,6 +318,19 @@ export default function NodePreAggregationsTab({ node }) {
|
|
|
309
318
|
: 'Not set'}
|
|
310
319
|
</td>
|
|
311
320
|
</tr>
|
|
321
|
+
{preagg.preagg_hash && (
|
|
322
|
+
<tr>
|
|
323
|
+
<td className="preagg-config-key">Hash</td>
|
|
324
|
+
<td className="preagg-config-value">
|
|
325
|
+
<code
|
|
326
|
+
className="preagg-hash-badge"
|
|
327
|
+
title="Unique identifier for this pre-aggregation. Used in table and workflow names."
|
|
328
|
+
>
|
|
329
|
+
{preagg.preagg_hash}
|
|
330
|
+
</code>
|
|
331
|
+
</td>
|
|
332
|
+
</tr>
|
|
333
|
+
)}
|
|
312
334
|
<tr>
|
|
313
335
|
<td className="preagg-config-key">Schedule</td>
|
|
314
336
|
<td className="preagg-config-value">
|
|
@@ -1460,6 +1460,7 @@ export const DataJunctionAPI = {
|
|
|
1460
1460
|
joinType = null,
|
|
1461
1461
|
joinCardinality = null,
|
|
1462
1462
|
role = null,
|
|
1463
|
+
defaultValue = null,
|
|
1463
1464
|
) {
|
|
1464
1465
|
const response = await fetch(`${DJ_URL}/nodes/${nodeName}/link`, {
|
|
1465
1466
|
method: 'POST',
|
|
@@ -1472,6 +1473,7 @@ export const DataJunctionAPI = {
|
|
|
1472
1473
|
join_on: joinOn,
|
|
1473
1474
|
join_cardinality: joinCardinality,
|
|
1474
1475
|
role: role,
|
|
1476
|
+
default_value: defaultValue,
|
|
1475
1477
|
}),
|
|
1476
1478
|
credentials: 'include',
|
|
1477
1479
|
});
|
|
@@ -95,6 +95,17 @@
|
|
|
95
95
|
color: #666;
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
+
.preagg-row-hash {
|
|
99
|
+
background-color: #f3e8ff;
|
|
100
|
+
padding: 2px 8px;
|
|
101
|
+
border-radius: 4px;
|
|
102
|
+
color: #7c3aed;
|
|
103
|
+
font-size: 11px;
|
|
104
|
+
font-weight: 600;
|
|
105
|
+
font-family: monospace;
|
|
106
|
+
letter-spacing: 0.05em;
|
|
107
|
+
}
|
|
108
|
+
|
|
98
109
|
.preagg-row-grain-chips {
|
|
99
110
|
display: flex;
|
|
100
111
|
align-items: center;
|
|
@@ -385,6 +396,20 @@
|
|
|
385
396
|
font-weight: 500;
|
|
386
397
|
}
|
|
387
398
|
|
|
399
|
+
/* Hash badge (purple/violet) */
|
|
400
|
+
.preagg-hash-badge {
|
|
401
|
+
background-color: #f3e8ff;
|
|
402
|
+
padding: 4px 10px;
|
|
403
|
+
border-radius: 4px;
|
|
404
|
+
color: #7c3aed;
|
|
405
|
+
font-size: 12px;
|
|
406
|
+
font-weight: 500;
|
|
407
|
+
font-family: monospace;
|
|
408
|
+
letter-spacing: 0.05em;
|
|
409
|
+
user-select: all;
|
|
410
|
+
cursor: text;
|
|
411
|
+
}
|
|
412
|
+
|
|
388
413
|
/* Metric badge (red/rose) */
|
|
389
414
|
.preagg-metric-badge {
|
|
390
415
|
font-size: 11px;
|