@finos/legend-application-studio 28.21.4 → 28.21.6
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/lib/__lib__/LegendStudioEvent.d.ts +4 -1
- package/lib/__lib__/LegendStudioEvent.d.ts.map +1 -1
- package/lib/__lib__/LegendStudioEvent.js +3 -0
- package/lib/__lib__/LegendStudioEvent.js.map +1 -1
- package/lib/__lib__/LegendStudioTelemetryHelper.d.ts +2 -1
- package/lib/__lib__/LegendStudioTelemetryHelper.d.ts.map +1 -1
- package/lib/__lib__/LegendStudioTelemetryHelper.js +11 -3
- package/lib/__lib__/LegendStudioTelemetryHelper.js.map +1 -1
- package/lib/__lib__/LegendStudioUserDataHelper.d.ts +41 -1
- package/lib/__lib__/LegendStudioUserDataHelper.d.ts.map +1 -1
- package/lib/__lib__/LegendStudioUserDataHelper.js +120 -1
- package/lib/__lib__/LegendStudioUserDataHelper.js.map +1 -1
- package/lib/components/editor/editor-group/data-editor/EmbeddedDataEditor.d.ts +1 -1
- package/lib/components/editor/editor-group/data-editor/EmbeddedDataEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/data-editor/EmbeddedDataEditor.js +3 -3
- package/lib/components/editor/editor-group/data-editor/EmbeddedDataEditor.js.map +1 -1
- package/lib/components/editor/editor-group/data-editor/RelationElementsDataEditor.d.ts +3 -0
- package/lib/components/editor/editor-group/data-editor/RelationElementsDataEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/data-editor/RelationElementsDataEditor.js +13 -35
- package/lib/components/editor/editor-group/data-editor/RelationElementsDataEditor.js.map +1 -1
- package/lib/components/editor/editor-group/dataProduct/DataProductEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/dataProduct/DataProductEditor.js +20 -7
- package/lib/components/editor/editor-group/dataProduct/DataProductEditor.js.map +1 -1
- package/lib/components/editor/editor-group/dataProduct/testable/DataProductTestableEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/dataProduct/testable/DataProductTestableEditor.js +59 -22
- package/lib/components/editor/editor-group/dataProduct/testable/DataProductTestableEditor.js.map +1 -1
- package/lib/components/editor/editor-group/function-activator/testable/FunctionTestableEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/function-activator/testable/FunctionTestableEditor.js +113 -75
- package/lib/components/editor/editor-group/function-activator/testable/FunctionTestableEditor.js.map +1 -1
- package/lib/components/editor/editor-group/testable/TestableSharedComponents.d.ts.map +1 -1
- package/lib/components/editor/editor-group/testable/TestableSharedComponents.js +2 -2
- package/lib/components/editor/editor-group/testable/TestableSharedComponents.js.map +1 -1
- package/lib/components/editor/side-bar/DevMetadataPanel.d.ts.map +1 -1
- package/lib/components/editor/side-bar/DevMetadataPanel.js +37 -6
- package/lib/components/editor/side-bar/DevMetadataPanel.js.map +1 -1
- package/lib/components/workspace-setup/RecentWorkspacesPanel.d.ts +22 -0
- package/lib/components/workspace-setup/RecentWorkspacesPanel.d.ts.map +1 -0
- package/lib/components/workspace-setup/RecentWorkspacesPanel.js +80 -0
- package/lib/components/workspace-setup/RecentWorkspacesPanel.js.map +1 -0
- package/lib/components/workspace-setup/WorkspaceSetup.d.ts.map +1 -1
- package/lib/components/workspace-setup/WorkspaceSetup.js +61 -6
- package/lib/components/workspace-setup/WorkspaceSetup.js.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/package.json +1 -1
- package/lib/stores/editor/EditorStore.d.ts.map +1 -1
- package/lib/stores/editor/EditorStore.js +31 -0
- package/lib/stores/editor/EditorStore.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/data/EmbeddedDataState.d.ts +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/data/EmbeddedDataState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/data/EmbeddedDataState.js +20 -48
- package/lib/stores/editor/editor-state/element-editor-state/data/EmbeddedDataState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/dataProduct/testable/DataProductTestableState.d.ts +9 -14
- package/lib/stores/editor/editor-state/element-editor-state/dataProduct/testable/DataProductTestableState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/dataProduct/testable/DataProductTestableState.js +125 -78
- package/lib/stores/editor/editor-state/element-editor-state/dataProduct/testable/DataProductTestableState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/function-activator/testable/FunctionTestableState.d.ts +18 -4
- package/lib/stores/editor/editor-state/element-editor-state/function-activator/testable/FunctionTestableState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/function-activator/testable/FunctionTestableState.js +216 -53
- package/lib/stores/editor/editor-state/element-editor-state/function-activator/testable/FunctionTestableState.js.map +1 -1
- package/lib/stores/editor/sidebar-state/ProjectOverviewState.d.ts.map +1 -1
- package/lib/stores/editor/sidebar-state/ProjectOverviewState.js +11 -0
- package/lib/stores/editor/sidebar-state/ProjectOverviewState.js.map +1 -1
- package/lib/stores/editor/sidebar-state/WorkspaceReviewState.d.ts.map +1 -1
- package/lib/stores/editor/sidebar-state/WorkspaceReviewState.js +11 -0
- package/lib/stores/editor/sidebar-state/WorkspaceReviewState.js.map +1 -1
- package/lib/stores/editor/sidebar-state/dev-metadata/DevMetadataState.d.ts +9 -0
- package/lib/stores/editor/sidebar-state/dev-metadata/DevMetadataState.d.ts.map +1 -1
- package/lib/stores/editor/sidebar-state/dev-metadata/DevMetadataState.js +57 -1
- package/lib/stores/editor/sidebar-state/dev-metadata/DevMetadataState.js.map +1 -1
- package/lib/stores/project-reviewer/ProjectReviewerStore.d.ts.map +1 -1
- package/lib/stores/project-reviewer/ProjectReviewerStore.js +12 -0
- package/lib/stores/project-reviewer/ProjectReviewerStore.js.map +1 -1
- package/lib/stores/workspace-setup/WorkspaceSetupStore.d.ts +17 -0
- package/lib/stores/workspace-setup/WorkspaceSetupStore.d.ts.map +1 -1
- package/lib/stores/workspace-setup/WorkspaceSetupStore.js +61 -0
- package/lib/stores/workspace-setup/WorkspaceSetupStore.js.map +1 -1
- package/package.json +16 -16
- package/src/__lib__/LegendStudioEvent.ts +3 -0
- package/src/__lib__/LegendStudioTelemetryHelper.ts +35 -11
- package/src/__lib__/LegendStudioUserDataHelper.ts +204 -1
- package/src/components/editor/editor-group/data-editor/EmbeddedDataEditor.tsx +4 -0
- package/src/components/editor/editor-group/data-editor/RelationElementsDataEditor.tsx +209 -187
- package/src/components/editor/editor-group/dataProduct/DataProductEditor.tsx +26 -7
- package/src/components/editor/editor-group/dataProduct/testable/DataProductTestableEditor.tsx +149 -86
- package/src/components/editor/editor-group/function-activator/testable/FunctionTestableEditor.tsx +425 -308
- package/src/components/editor/editor-group/testable/TestableSharedComponents.tsx +3 -11
- package/src/components/editor/side-bar/DevMetadataPanel.tsx +194 -10
- package/src/components/workspace-setup/RecentWorkspacesPanel.tsx +161 -0
- package/src/components/workspace-setup/WorkspaceSetup.tsx +97 -8
- package/src/stores/editor/EditorStore.ts +44 -0
- package/src/stores/editor/editor-state/element-editor-state/data/EmbeddedDataState.ts +28 -50
- package/src/stores/editor/editor-state/element-editor-state/dataProduct/testable/DataProductTestableState.ts +164 -100
- package/src/stores/editor/editor-state/element-editor-state/function-activator/testable/FunctionTestableState.ts +307 -72
- package/src/stores/editor/sidebar-state/ProjectOverviewState.ts +14 -0
- package/src/stores/editor/sidebar-state/WorkspaceReviewState.ts +14 -0
- package/src/stores/editor/sidebar-state/dev-metadata/DevMetadataState.ts +84 -1
- package/src/stores/project-reviewer/ProjectReviewerStore.ts +15 -0
- package/src/stores/workspace-setup/WorkspaceSetupStore.ts +93 -0
- package/tsconfig.json +1 -0
|
@@ -223,15 +223,13 @@ export const RelationElementEditor = observer(
|
|
|
223
223
|
(props: {
|
|
224
224
|
relationElementState: RelationElementState;
|
|
225
225
|
isReadOnly: boolean;
|
|
226
|
+
hideColumnDefinitions?: boolean;
|
|
226
227
|
}) => {
|
|
227
|
-
const { relationElementState, isReadOnly } = props;
|
|
228
|
+
const { relationElementState, isReadOnly, hideColumnDefinitions } = props;
|
|
228
229
|
const editorStore = useEditorStore();
|
|
229
230
|
const embeddedData = relationElementState.relationElement;
|
|
230
231
|
const canEditColumns =
|
|
231
232
|
!isReadOnly && relationElementState.supportsColumnEditing;
|
|
232
|
-
const [exportFormat, setExportFormat] = useState<'json' | 'csv' | 'sql'>(
|
|
233
|
-
'json',
|
|
234
|
-
);
|
|
235
233
|
const fileInputRef = useRef<HTMLInputElement>(null);
|
|
236
234
|
|
|
237
235
|
const addColumn = (): void => {
|
|
@@ -297,39 +295,13 @@ export const RelationElementEditor = observer(
|
|
|
297
295
|
}
|
|
298
296
|
};
|
|
299
297
|
|
|
300
|
-
const
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
let mimeType = '';
|
|
304
|
-
|
|
305
|
-
switch (exportFormat) {
|
|
306
|
-
case 'json':
|
|
307
|
-
content = relationElementState.exportJSON();
|
|
308
|
-
filename = 'test_data.json';
|
|
309
|
-
mimeType = 'application/json';
|
|
310
|
-
break;
|
|
311
|
-
case 'csv':
|
|
312
|
-
content = relationElementState.exportCSV();
|
|
313
|
-
filename = 'test_data.csv';
|
|
314
|
-
mimeType = 'text/csv';
|
|
315
|
-
break;
|
|
316
|
-
case 'sql':
|
|
317
|
-
content = relationElementState.exportSQL();
|
|
318
|
-
filename = 'test_data.sql';
|
|
319
|
-
mimeType = 'text/sql';
|
|
320
|
-
break;
|
|
321
|
-
default:
|
|
322
|
-
content = relationElementState.exportJSON();
|
|
323
|
-
filename = 'test_data.json';
|
|
324
|
-
mimeType = 'application/json';
|
|
325
|
-
break;
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
const blob = new Blob([content], { type: mimeType });
|
|
298
|
+
const exportCSV = (): void => {
|
|
299
|
+
const content = relationElementState.exportCSV();
|
|
300
|
+
const blob = new Blob([content], { type: 'text/csv' });
|
|
329
301
|
const url = URL.createObjectURL(blob);
|
|
330
302
|
const a = document.createElement('a');
|
|
331
303
|
a.href = url;
|
|
332
|
-
a.download =
|
|
304
|
+
a.download = 'test_data.csv';
|
|
333
305
|
document.body.appendChild(a);
|
|
334
306
|
a.click();
|
|
335
307
|
document.body.removeChild(a);
|
|
@@ -359,54 +331,103 @@ export const RelationElementEditor = observer(
|
|
|
359
331
|
|
|
360
332
|
return (
|
|
361
333
|
<div className="relation-test-data-editor__content">
|
|
362
|
-
<div className="relation-test-data-
|
|
334
|
+
<div className="relation-test-data-editor__data">
|
|
363
335
|
<div className="relation-test-data-editor__section-header">
|
|
364
|
-
<div className="relation-test-data-editor__section-
|
|
365
|
-
|
|
336
|
+
<div className="relation-test-data-editor__section-header__left">
|
|
337
|
+
<div className="relation-test-data-editor__section-title">
|
|
338
|
+
Test Data ({embeddedData.rows.length} rows)
|
|
339
|
+
</div>
|
|
366
340
|
</div>
|
|
367
|
-
<
|
|
368
|
-
className="
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
<
|
|
383
|
-
className="relation-test-data-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
341
|
+
<div className="relation-test-data-editor__toolbar">
|
|
342
|
+
<div className="relation-test-data-editor__toolbar__left">
|
|
343
|
+
<div className="relation-test-data-editor__action-control">
|
|
344
|
+
<span className="relation-test-data-editor__action-control__label">
|
|
345
|
+
Add Column
|
|
346
|
+
</span>
|
|
347
|
+
<button
|
|
348
|
+
className="btn--icon btn--dark btn--sm"
|
|
349
|
+
onClick={addColumn}
|
|
350
|
+
disabled={!canEditColumns}
|
|
351
|
+
title="Add Column"
|
|
352
|
+
>
|
|
353
|
+
<PlusIcon />
|
|
354
|
+
</button>
|
|
355
|
+
</div>
|
|
356
|
+
<div className="relation-test-data-editor__action-control">
|
|
357
|
+
<span className="relation-test-data-editor__action-control__label">
|
|
358
|
+
Add Row
|
|
359
|
+
</span>
|
|
360
|
+
<button
|
|
361
|
+
className="btn--icon btn--dark btn--sm"
|
|
362
|
+
onClick={addRow}
|
|
363
|
+
disabled={isReadOnly || embeddedData.columns.length === 0}
|
|
364
|
+
title="Add Row"
|
|
365
|
+
>
|
|
366
|
+
<PlusIcon />
|
|
367
|
+
</button>
|
|
368
|
+
</div>
|
|
369
|
+
</div>
|
|
370
|
+
<div className="relation-test-data-editor__toolbar__right">
|
|
371
|
+
<div className="relation-test-data-editor__import-controls">
|
|
372
|
+
<span className="relation-test-data-editor__import-controls__label">
|
|
373
|
+
Upload CSV
|
|
374
|
+
</span>
|
|
375
|
+
<input
|
|
376
|
+
ref={fileInputRef}
|
|
377
|
+
type="file"
|
|
378
|
+
accept=".csv"
|
|
379
|
+
onChange={handleFileUpload}
|
|
380
|
+
style={{ display: 'none' }}
|
|
381
|
+
disabled={isReadOnly}
|
|
382
|
+
/>
|
|
383
|
+
<button
|
|
384
|
+
className="btn--icon btn--dark btn--sm"
|
|
385
|
+
onClick={() => fileInputRef.current?.click()}
|
|
386
|
+
disabled={isReadOnly}
|
|
387
|
+
title="Upload CSV"
|
|
388
|
+
>
|
|
389
|
+
<UploadIcon />
|
|
390
|
+
</button>
|
|
391
|
+
</div>
|
|
398
392
|
</div>
|
|
399
|
-
))}
|
|
400
|
-
</div>
|
|
401
|
-
</div>
|
|
402
|
-
|
|
403
|
-
<div className="relation-test-data-editor__data">
|
|
404
|
-
<div className="relation-test-data-editor__section-header">
|
|
405
|
-
<div className="relation-test-data-editor__section-title">
|
|
406
|
-
Test Data ({embeddedData.rows.length} rows)
|
|
407
393
|
</div>
|
|
408
394
|
</div>
|
|
409
|
-
{
|
|
395
|
+
{!hideColumnDefinitions ? (
|
|
396
|
+
<div className="relation-test-data-editor__columns">
|
|
397
|
+
<div className="relation-test-data-editor__section-header">
|
|
398
|
+
<div className="relation-test-data-editor__section-title">
|
|
399
|
+
Column Definitions
|
|
400
|
+
</div>
|
|
401
|
+
</div>
|
|
402
|
+
<div className="relation-test-data-editor__columns-grid">
|
|
403
|
+
{embeddedData.columns.map((column, index) => (
|
|
404
|
+
<div
|
|
405
|
+
key={`column-${guaranteeNonNullable(index)}`}
|
|
406
|
+
className="relation-test-data-editor__column-row"
|
|
407
|
+
>
|
|
408
|
+
<input
|
|
409
|
+
className="relation-test-data-editor__column-input"
|
|
410
|
+
type="text"
|
|
411
|
+
value={column}
|
|
412
|
+
onChange={(e) => updateColumn(index, e.target.value)}
|
|
413
|
+
placeholder="Column Name"
|
|
414
|
+
disabled={!canEditColumns}
|
|
415
|
+
/>
|
|
416
|
+
<button
|
|
417
|
+
className="btn--icon btn--caution btn--dark btn--sm"
|
|
418
|
+
onClick={() => removeColumn(index)}
|
|
419
|
+
disabled={!canEditColumns}
|
|
420
|
+
title="Remove Column"
|
|
421
|
+
>
|
|
422
|
+
<TimesIcon />
|
|
423
|
+
</button>
|
|
424
|
+
</div>
|
|
425
|
+
))}
|
|
426
|
+
</div>
|
|
427
|
+
</div>
|
|
428
|
+
) : null}
|
|
429
|
+
{embeddedData.rows.length === 0 &&
|
|
430
|
+
embeddedData.columns.length === 0 ? (
|
|
410
431
|
<div className="relation-test-data-editor__empty-data">
|
|
411
432
|
<div className="relation-test-data-editor__empty-text">
|
|
412
433
|
No test data rows. Click "+" below to start entering
|
|
@@ -415,71 +436,89 @@ export const RelationElementEditor = observer(
|
|
|
415
436
|
</div>
|
|
416
437
|
) : (
|
|
417
438
|
<div className="relation-test-data-editor__data-grid">
|
|
418
|
-
<
|
|
419
|
-
|
|
420
|
-
<
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
439
|
+
<table className="relation-test-data-editor__table">
|
|
440
|
+
<thead>
|
|
441
|
+
<tr>
|
|
442
|
+
{embeddedData.columns.map((column, columnIndex) => (
|
|
443
|
+
<th
|
|
444
|
+
key={`col-${guaranteeNonNullable(columnIndex)}`}
|
|
445
|
+
className="relation-test-data-editor__th"
|
|
446
|
+
>
|
|
447
|
+
<div className="relation-test-data-editor__th__inner">
|
|
448
|
+
<input
|
|
449
|
+
className="relation-test-data-editor__th__label relation-test-data-editor__th__label--editable"
|
|
450
|
+
type="text"
|
|
451
|
+
value={column}
|
|
452
|
+
onChange={(e) =>
|
|
453
|
+
updateColumn(columnIndex, e.target.value)
|
|
454
|
+
}
|
|
455
|
+
disabled={!canEditColumns}
|
|
456
|
+
title={column}
|
|
457
|
+
/>
|
|
458
|
+
<button
|
|
459
|
+
className="relation-test-data-editor__th__delete"
|
|
460
|
+
onClick={() => removeColumn(columnIndex)}
|
|
461
|
+
disabled={!canEditColumns}
|
|
462
|
+
title={`Remove column ${column}`}
|
|
463
|
+
>
|
|
464
|
+
<TimesIcon />
|
|
465
|
+
</button>
|
|
466
|
+
</div>
|
|
467
|
+
</th>
|
|
468
|
+
))}
|
|
469
|
+
<th className="relation-test-data-editor__th relation-test-data-editor__th--actions" />
|
|
470
|
+
</tr>
|
|
471
|
+
</thead>
|
|
472
|
+
<tbody>
|
|
473
|
+
{embeddedData.rows.map((_row, rowIndex) => (
|
|
474
|
+
<tr
|
|
475
|
+
key={`row-${guaranteeNonNullable(rowIndex)}`}
|
|
476
|
+
className="relation-test-data-editor__tr"
|
|
443
477
|
>
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
478
|
+
{embeddedData.columns.map((column, columnIndex) => (
|
|
479
|
+
<td
|
|
480
|
+
key={column}
|
|
481
|
+
className="relation-test-data-editor__td"
|
|
482
|
+
>
|
|
483
|
+
<input
|
|
484
|
+
type="text"
|
|
485
|
+
value={relationElementState.getDisplayValue(
|
|
486
|
+
rowIndex,
|
|
487
|
+
columnIndex,
|
|
488
|
+
)}
|
|
489
|
+
onChange={(e) =>
|
|
490
|
+
updateCellValue(
|
|
491
|
+
rowIndex,
|
|
492
|
+
columnIndex,
|
|
493
|
+
e.target.value,
|
|
494
|
+
)
|
|
495
|
+
}
|
|
496
|
+
disabled={isReadOnly}
|
|
497
|
+
className="relation-test-data-editor__data-input"
|
|
498
|
+
/>
|
|
499
|
+
</td>
|
|
500
|
+
))}
|
|
501
|
+
<td className="relation-test-data-editor__td relation-test-data-editor__td--actions">
|
|
502
|
+
<button
|
|
503
|
+
className="btn--icon btn--caution btn--dark btn--sm relation-test-data-editor__icon-button--compact"
|
|
504
|
+
onClick={() => removeRow(rowIndex)}
|
|
505
|
+
disabled={isReadOnly}
|
|
506
|
+
title="Remove Row"
|
|
507
|
+
>
|
|
508
|
+
<TimesIcon />
|
|
509
|
+
</button>
|
|
510
|
+
</td>
|
|
511
|
+
</tr>
|
|
454
512
|
))}
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
className="btn--icon btn--caution btn--dark btn--sm"
|
|
458
|
-
onClick={() => removeRow(rowIndex)}
|
|
459
|
-
disabled={isReadOnly}
|
|
460
|
-
title="Remove Row"
|
|
461
|
-
>
|
|
462
|
-
<TimesIcon />
|
|
463
|
-
</button>
|
|
464
|
-
</div>
|
|
465
|
-
</div>
|
|
466
|
-
))}
|
|
513
|
+
</tbody>
|
|
514
|
+
</table>
|
|
467
515
|
</div>
|
|
468
516
|
)}
|
|
469
517
|
|
|
470
|
-
<div className="relation-test-data-
|
|
471
|
-
<div className="relation-test-data-
|
|
518
|
+
<div className="relation-test-data-editor__footer-actions">
|
|
519
|
+
<div className="relation-test-data-editor__footer-actions__left">
|
|
472
520
|
<button
|
|
473
521
|
className="btn--icon btn--dark btn--sm"
|
|
474
|
-
onClick={addRow}
|
|
475
|
-
disabled={isReadOnly || embeddedData.columns.length === 0}
|
|
476
|
-
title="Add Row"
|
|
477
|
-
>
|
|
478
|
-
<PlusIcon />
|
|
479
|
-
</button>
|
|
480
|
-
|
|
481
|
-
<button
|
|
482
|
-
className="btn--icon btn--caution btn--dark btn--sm"
|
|
483
522
|
onClick={handleClearData}
|
|
484
523
|
disabled={isReadOnly || embeddedData.rows.length === 0}
|
|
485
524
|
title="Clear All Data"
|
|
@@ -487,48 +526,20 @@ export const RelationElementEditor = observer(
|
|
|
487
526
|
<TrashIcon />
|
|
488
527
|
</button>
|
|
489
528
|
</div>
|
|
490
|
-
<div className="relation-test-data-
|
|
491
|
-
<
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
</select>
|
|
505
|
-
<button
|
|
506
|
-
className="btn--icon btn--dark btn--sm"
|
|
507
|
-
onClick={exportData}
|
|
508
|
-
disabled={isReadOnly}
|
|
509
|
-
title={`Export as ${exportFormat.toUpperCase()}`}
|
|
510
|
-
>
|
|
511
|
-
<FileImportIcon />
|
|
512
|
-
</button>
|
|
513
|
-
</div>
|
|
514
|
-
|
|
515
|
-
<div className="relation-test-data-editor__import-controls">
|
|
516
|
-
<input
|
|
517
|
-
ref={fileInputRef}
|
|
518
|
-
type="file"
|
|
519
|
-
accept=".csv"
|
|
520
|
-
onChange={handleFileUpload}
|
|
521
|
-
style={{ display: 'none' }}
|
|
522
|
-
disabled={isReadOnly}
|
|
523
|
-
/>
|
|
524
|
-
<button
|
|
525
|
-
className="btn--icon btn--dark btn--sm"
|
|
526
|
-
onClick={() => fileInputRef.current?.click()}
|
|
527
|
-
disabled={isReadOnly}
|
|
528
|
-
title="Upload a file of CSV"
|
|
529
|
-
>
|
|
530
|
-
<UploadIcon />
|
|
531
|
-
</button>
|
|
529
|
+
<div className="relation-test-data-editor__footer-actions__right">
|
|
530
|
+
<div className="relation-test-data-editor__action-control">
|
|
531
|
+
<span className="relation-test-data-editor__action-control__label">
|
|
532
|
+
Export CSV
|
|
533
|
+
</span>
|
|
534
|
+
<button
|
|
535
|
+
className="btn--icon btn--dark btn--sm"
|
|
536
|
+
onClick={exportCSV}
|
|
537
|
+
disabled={isReadOnly}
|
|
538
|
+
title="Export as CSV"
|
|
539
|
+
>
|
|
540
|
+
<FileImportIcon />
|
|
541
|
+
</button>
|
|
542
|
+
</div>
|
|
532
543
|
</div>
|
|
533
544
|
</div>
|
|
534
545
|
</div>
|
|
@@ -538,8 +549,14 @@ export const RelationElementEditor = observer(
|
|
|
538
549
|
);
|
|
539
550
|
|
|
540
551
|
export const RelationElementsDataEditor = observer(
|
|
541
|
-
(props: {
|
|
542
|
-
|
|
552
|
+
(props: {
|
|
553
|
+
dataState: RelationElementsDataState;
|
|
554
|
+
isReadOnly: boolean;
|
|
555
|
+
isSharedData?: boolean | undefined;
|
|
556
|
+
hideColumnDefinitions?: boolean;
|
|
557
|
+
}) => {
|
|
558
|
+
const { dataState, isReadOnly, isSharedData, hideColumnDefinitions } =
|
|
559
|
+
props;
|
|
543
560
|
|
|
544
561
|
useApplicationNavigationContext(
|
|
545
562
|
LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY.EMBEDDED_DATA_RELATIONAL_EDITOR,
|
|
@@ -606,7 +623,7 @@ export const RelationElementsDataEditor = observer(
|
|
|
606
623
|
) : (
|
|
607
624
|
<span>{relationElementState.relationElement.paths[0]}</span>
|
|
608
625
|
)}
|
|
609
|
-
{!isReadOnly && (
|
|
626
|
+
{!isReadOnly && !isSharedData && (
|
|
610
627
|
<button
|
|
611
628
|
className="service-editor__tab__close-btn"
|
|
612
629
|
onClick={(e): void => {
|
|
@@ -621,13 +638,15 @@ export const RelationElementsDataEditor = observer(
|
|
|
621
638
|
</div>
|
|
622
639
|
))}
|
|
623
640
|
</div>
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
641
|
+
{!isSharedData && (
|
|
642
|
+
<button
|
|
643
|
+
onClick={addRelationElement}
|
|
644
|
+
disabled={isReadOnly}
|
|
645
|
+
title="Add Relation Element"
|
|
646
|
+
>
|
|
647
|
+
<PlusIcon />
|
|
648
|
+
</button>
|
|
649
|
+
)}
|
|
631
650
|
</div>
|
|
632
651
|
{dataState.relationElementStates.length === 0 ||
|
|
633
652
|
dataState.activeRelationElement === undefined ? (
|
|
@@ -642,6 +661,9 @@ export const RelationElementsDataEditor = observer(
|
|
|
642
661
|
<RelationElementEditor
|
|
643
662
|
relationElementState={dataState.activeRelationElement}
|
|
644
663
|
isReadOnly={isReadOnly}
|
|
664
|
+
{...(hideColumnDefinitions !== undefined
|
|
665
|
+
? { hideColumnDefinitions }
|
|
666
|
+
: {})}
|
|
645
667
|
/>
|
|
646
668
|
)}
|
|
647
669
|
</PanelContent>
|
|
@@ -661,6 +661,7 @@ const SampleValuesEditorModal = observer(
|
|
|
661
661
|
accessPointState.relationElementState
|
|
662
662
|
}
|
|
663
663
|
isReadOnly={isReadOnly}
|
|
664
|
+
hideColumnDefinitions={true}
|
|
664
665
|
/>
|
|
665
666
|
</div>
|
|
666
667
|
</Tooltip>
|
|
@@ -2231,6 +2232,9 @@ const AccessPointGroupTab = observer(
|
|
|
2231
2232
|
const DataProductSidebar = observer(
|
|
2232
2233
|
(props: { dataProductEditorState: DataProductEditorState }) => {
|
|
2233
2234
|
const { dataProductEditorState } = props;
|
|
2235
|
+
const showTestingTab =
|
|
2236
|
+
dataProductEditorState.editorStore.applicationStore.config.options
|
|
2237
|
+
.NonProductionFeatureFlag;
|
|
2234
2238
|
const sidebarTabs = [
|
|
2235
2239
|
{
|
|
2236
2240
|
label: DATA_PRODUCT_TAB.HOME,
|
|
@@ -2246,11 +2250,15 @@ const DataProductSidebar = observer(
|
|
|
2246
2250
|
title: 'Operational Metadata',
|
|
2247
2251
|
icon: <GearSuggestIcon />,
|
|
2248
2252
|
},
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2253
|
+
...(showTestingTab
|
|
2254
|
+
? [
|
|
2255
|
+
{
|
|
2256
|
+
label: DATA_PRODUCT_TAB.TESTING,
|
|
2257
|
+
title: 'Testing',
|
|
2258
|
+
icon: <FlaskIcon />,
|
|
2259
|
+
},
|
|
2260
|
+
]
|
|
2261
|
+
: []),
|
|
2254
2262
|
{
|
|
2255
2263
|
label: DATA_PRODUCT_TAB.SUPPORT,
|
|
2256
2264
|
icon: <QuestionCircleIcon />,
|
|
@@ -3359,6 +3367,8 @@ export const DataProductEditor = observer(() => {
|
|
|
3359
3367
|
const [showPreview, setShowPreview] = useState(false);
|
|
3360
3368
|
const [dataProductViewerState, setDataProductViewerState] =
|
|
3361
3369
|
useState<DataProductViewerState>();
|
|
3370
|
+
const showTestingTab =
|
|
3371
|
+
editorStore.applicationStore.config.options.NonProductionFeatureFlag;
|
|
3362
3372
|
|
|
3363
3373
|
const selectedActivity = dataProductEditorState.selectedTab;
|
|
3364
3374
|
const renderActivivtyBarTab = (): React.ReactNode => {
|
|
@@ -3392,12 +3402,12 @@ export const DataProductEditor = observer(() => {
|
|
|
3392
3402
|
/>
|
|
3393
3403
|
);
|
|
3394
3404
|
case DATA_PRODUCT_TAB.TESTING:
|
|
3395
|
-
return (
|
|
3405
|
+
return showTestingTab ? (
|
|
3396
3406
|
<DataProductTestableEditor
|
|
3397
3407
|
dataProductEditorState={dataProductEditorState}
|
|
3398
3408
|
isReadOnly={isReadOnly}
|
|
3399
3409
|
/>
|
|
3400
|
-
);
|
|
3410
|
+
) : null;
|
|
3401
3411
|
default:
|
|
3402
3412
|
return null;
|
|
3403
3413
|
}
|
|
@@ -3413,6 +3423,15 @@ export const DataProductEditor = observer(() => {
|
|
|
3413
3423
|
);
|
|
3414
3424
|
}, [dataProductEditorState]);
|
|
3415
3425
|
|
|
3426
|
+
useEffect(() => {
|
|
3427
|
+
if (
|
|
3428
|
+
!showTestingTab &&
|
|
3429
|
+
dataProductEditorState.selectedTab === DATA_PRODUCT_TAB.TESTING
|
|
3430
|
+
) {
|
|
3431
|
+
dataProductEditorState.setSelectedTab(DATA_PRODUCT_TAB.HOME);
|
|
3432
|
+
}
|
|
3433
|
+
}, [dataProductEditorState, showTestingTab]);
|
|
3434
|
+
|
|
3416
3435
|
useEffect(
|
|
3417
3436
|
() =>
|
|
3418
3437
|
autorun(
|