@finos/legend-query-builder 3.0.6 → 3.0.8
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/__lib__/QueryBuilderDocumentation.d.ts +0 -1
- package/lib/__lib__/QueryBuilderDocumentation.d.ts.map +1 -1
- package/lib/__lib__/QueryBuilderDocumentation.js +0 -1
- package/lib/__lib__/QueryBuilderDocumentation.js.map +1 -1
- package/lib/__lib__/QueryBuilderEvent.d.ts +18 -0
- package/lib/__lib__/QueryBuilderEvent.d.ts.map +1 -1
- package/lib/__lib__/QueryBuilderEvent.js +20 -0
- package/lib/__lib__/QueryBuilderEvent.js.map +1 -1
- package/lib/__lib__/QueryBuilderTelemetryHelper.d.ts +14 -0
- package/lib/__lib__/QueryBuilderTelemetryHelper.d.ts.map +1 -1
- package/lib/__lib__/QueryBuilderTelemetryHelper.js +43 -1
- package/lib/__lib__/QueryBuilderTelemetryHelper.js.map +1 -1
- package/lib/components/QueryBuilder.d.ts +0 -1
- package/lib/components/QueryBuilder.d.ts.map +1 -1
- package/lib/components/QueryBuilder.js +25 -34
- package/lib/components/QueryBuilder.js.map +1 -1
- package/lib/components/QueryBuilderConstantExpressionPanel.d.ts +0 -1
- package/lib/components/QueryBuilderConstantExpressionPanel.d.ts.map +1 -1
- package/lib/components/QueryBuilderConstantExpressionPanel.js +11 -15
- package/lib/components/QueryBuilderConstantExpressionPanel.js.map +1 -1
- package/lib/components/QueryBuilderDiffPanel.d.ts +0 -1
- package/lib/components/QueryBuilderDiffPanel.d.ts.map +1 -1
- package/lib/components/QueryBuilderParametersPanel.d.ts +0 -1
- package/lib/components/QueryBuilderParametersPanel.d.ts.map +1 -1
- package/lib/components/QueryBuilderParametersPanel.js +16 -20
- package/lib/components/QueryBuilderParametersPanel.js.map +1 -1
- package/lib/components/QueryBuilderPropertyExpressionEditor.d.ts +0 -1
- package/lib/components/QueryBuilderPropertyExpressionEditor.d.ts.map +1 -1
- package/lib/components/QueryBuilderResultPanel.d.ts +0 -1
- package/lib/components/QueryBuilderResultPanel.d.ts.map +1 -1
- package/lib/components/QueryBuilderSideBar.d.ts +0 -1
- package/lib/components/QueryBuilderSideBar.d.ts.map +1 -1
- package/lib/components/QueryBuilderTextEditor.d.ts +0 -1
- package/lib/components/QueryBuilderTextEditor.d.ts.map +1 -1
- package/lib/components/QueryBuilderUnsupportedQueryEditor.d.ts +0 -1
- package/lib/components/QueryBuilderUnsupportedQueryEditor.d.ts.map +1 -1
- package/lib/components/explorer/QueryBuilderFunctionsExplorerPanel.d.ts +0 -1
- package/lib/components/explorer/QueryBuilderFunctionsExplorerPanel.d.ts.map +1 -1
- package/lib/components/explorer/QueryBuilderMilestoningEditor.d.ts +0 -1
- package/lib/components/explorer/QueryBuilderMilestoningEditor.d.ts.map +1 -1
- package/lib/components/explorer/QueryBuilderPropertySearchPanel.d.ts +0 -1
- package/lib/components/explorer/QueryBuilderPropertySearchPanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderFetchStructurePanel.d.ts +0 -1
- package/lib/components/fetch-structure/QueryBuilderFetchStructurePanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderGraphFetchTreePanel.d.ts +0 -1
- package/lib/components/fetch-structure/QueryBuilderGraphFetchTreePanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.d.ts +0 -1
- package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js +13 -3
- package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderPostTDSPanel.d.ts +0 -1
- package/lib/components/fetch-structure/QueryBuilderPostTDSPanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.d.ts +0 -1
- package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderTDSPanel.d.ts +0 -1
- package/lib/components/fetch-structure/QueryBuilderTDSPanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderTDSPanel.js +1 -1
- package/lib/components/fetch-structure/QueryBuilderTDSPanel.js.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderTDSWindowPanel.d.ts +0 -1
- package/lib/components/fetch-structure/QueryBuilderTDSWindowPanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderTDSWindowPanel.js +2 -2
- package/lib/components/fetch-structure/QueryBuilderTDSWindowPanel.js.map +1 -1
- package/lib/components/filter/QueryBuilderFilterPanel.d.ts +0 -1
- package/lib/components/filter/QueryBuilderFilterPanel.d.ts.map +1 -1
- package/lib/components/filter/QueryBuilderFilterPanel.js +14 -3
- package/lib/components/filter/QueryBuilderFilterPanel.js.map +1 -1
- package/lib/components/shared/LambdaEditor.d.ts +0 -1
- package/lib/components/shared/LambdaEditor.d.ts.map +1 -1
- package/lib/components/shared/LambdaParameterValuesEditor.d.ts +0 -1
- package/lib/components/shared/LambdaParameterValuesEditor.d.ts.map +1 -1
- package/lib/components/shared/LambdaParameterValuesEditor.js +2 -1
- package/lib/components/shared/LambdaParameterValuesEditor.js.map +1 -1
- package/lib/components/shared/QueryBuilderVariableSelector.d.ts +0 -1
- package/lib/components/shared/QueryBuilderVariableSelector.d.ts.map +1 -1
- package/lib/components/watermark/QueryBuilderWatermark.d.ts +0 -1
- package/lib/components/watermark/QueryBuilderWatermark.d.ts.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -1
- package/lib/package.json +5 -5
- package/lib/stores/QueryBuilderState.d.ts +1 -2
- package/lib/stores/QueryBuilderState.d.ts.map +1 -1
- package/lib/stores/QueryBuilderState.js +7 -8
- package/lib/stores/QueryBuilderState.js.map +1 -1
- package/lib/stores/QueryBuilderValueSpecificationBuilder.d.ts +2 -1
- package/lib/stores/QueryBuilderValueSpecificationBuilder.d.ts.map +1 -1
- package/lib/stores/QueryBuilderValueSpecificationBuilder.js +1 -1
- package/lib/stores/QueryBuilderValueSpecificationBuilder.js.map +1 -1
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeValueSpecificationBuilder.d.ts +2 -1
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeValueSpecificationBuilder.d.ts.map +1 -1
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeValueSpecificationBuilder.js +18 -15
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeValueSpecificationBuilder.js.map +1 -1
- package/package.json +13 -13
- package/src/__lib__/QueryBuilderDocumentation.ts +0 -2
- package/src/__lib__/QueryBuilderEvent.ts +20 -0
- package/src/__lib__/QueryBuilderTelemetryHelper.ts +131 -1
- package/src/components/QueryBuilder.tsx +147 -188
- package/src/components/QueryBuilderConstantExpressionPanel.tsx +7 -12
- package/src/components/QueryBuilderParametersPanel.tsx +6 -10
- package/src/components/fetch-structure/QueryBuilderPostFilterPanel.tsx +96 -60
- package/src/components/fetch-structure/QueryBuilderTDSPanel.tsx +1 -3
- package/src/components/fetch-structure/QueryBuilderTDSWindowPanel.tsx +2 -4
- package/src/components/filter/QueryBuilderFilterPanel.tsx +102 -60
- package/src/components/shared/LambdaParameterValuesEditor.tsx +6 -5
- package/src/index.ts +2 -0
- package/src/stores/QueryBuilderState.ts +6 -11
- package/src/stores/QueryBuilderValueSpecificationBuilder.ts +1 -1
- package/src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeValueSpecificationBuilder.ts +43 -25
@@ -69,7 +69,6 @@ import { QueryBuilderConstantExpressionPanel } from './QueryBuilderConstantExpre
|
|
69
69
|
import { QueryBuilder_LegendApplicationPlugin } from './QueryBuilder_LegendApplicationPlugin.js';
|
70
70
|
import { QUERY_BUILDER_SETTING_KEY } from '../__lib__/QueryBuilderSetting.js';
|
71
71
|
import { QUERY_BUILDER_COMPONENT_ELEMENT_ID } from './QueryBuilderComponentElement.js';
|
72
|
-
import { QUERY_BUILDER_DOCUMENTATION_KEY } from '../__lib__/QueryBuilderDocumentation.js';
|
73
72
|
|
74
73
|
const QueryBuilderStatusBar = observer(
|
75
74
|
(props: { queryBuilderState: QueryBuilderState }) => {
|
@@ -250,18 +249,6 @@ export const QueryBuilder = observer(
|
|
250
249
|
const applicationStore = queryBuilderState.applicationStore;
|
251
250
|
const openLambdaEditor = (mode: QueryBuilderTextEditorMode): void =>
|
252
251
|
queryBuilderState.textEditorState.openModal(mode);
|
253
|
-
const toggleAssistant = (): void =>
|
254
|
-
applicationStore.assistantService.toggleAssistant();
|
255
|
-
const queryDocEntry = applicationStore.documentationService.getDocEntry(
|
256
|
-
QUERY_BUILDER_DOCUMENTATION_KEY.TUTORIAL_QUERY_BUILDER,
|
257
|
-
);
|
258
|
-
const openQueryTutorial = (): void => {
|
259
|
-
if (queryDocEntry?.url) {
|
260
|
-
applicationStore.navigationService.navigator.visitAddress(
|
261
|
-
queryDocEntry.url,
|
262
|
-
);
|
263
|
-
}
|
264
|
-
};
|
265
252
|
const toggleShowFunctionPanel = (): void => {
|
266
253
|
queryBuilderState.setShowFunctionsExplorerPanel(
|
267
254
|
!queryBuilderState.showFunctionsExplorerPanel,
|
@@ -373,206 +360,178 @@ export const QueryBuilder = observer(
|
|
373
360
|
)}
|
374
361
|
</div>
|
375
362
|
<div className="query-builder__sub-header__content__actions">
|
376
|
-
<
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
363
|
+
<DropdownMenu
|
364
|
+
className="query-builder__sub-header__custom-action"
|
365
|
+
title="Show Advanced Menu..."
|
366
|
+
content={
|
367
|
+
<MenuContent>
|
368
|
+
<MenuContentItem
|
369
|
+
onClick={toggleShowFunctionPanel}
|
370
|
+
disabled={!queryBuilderState.isQuerySupported}
|
371
|
+
>
|
372
|
+
<MenuContentItemIcon>
|
373
|
+
{queryBuilderState.showFunctionsExplorerPanel ? (
|
374
|
+
<CheckIcon />
|
375
|
+
) : null}
|
376
|
+
</MenuContentItemIcon>
|
377
|
+
<MenuContentItemLabel className="query-builder__sub-header__menu-content">
|
378
|
+
Show Function(s)
|
379
|
+
</MenuContentItemLabel>
|
380
|
+
</MenuContentItem>
|
381
|
+
{!queryBuilderState.isParameterSupportDisabled && (
|
388
382
|
<MenuContentItem
|
389
|
-
onClick={
|
390
|
-
disabled={!queryBuilderState.isQuerySupported}
|
391
|
-
>
|
392
|
-
<MenuContentItemIcon>
|
393
|
-
{queryBuilderState.showFunctionsExplorerPanel ? (
|
394
|
-
<CheckIcon />
|
395
|
-
) : null}
|
396
|
-
</MenuContentItemIcon>
|
397
|
-
<MenuContentItemLabel className="query-builder__sub-header__menu-content">
|
398
|
-
Show Function(s)
|
399
|
-
</MenuContentItemLabel>
|
400
|
-
</MenuContentItem>
|
401
|
-
{!queryBuilderState.isParameterSupportDisabled && (
|
402
|
-
<MenuContentItem
|
403
|
-
onClick={toggleShowParameterPanel}
|
404
|
-
disabled={
|
405
|
-
!queryBuilderState.isQuerySupported ||
|
406
|
-
queryBuilderState.parametersState.parameterStates
|
407
|
-
.length > 0
|
408
|
-
}
|
409
|
-
>
|
410
|
-
<MenuContentItemIcon>
|
411
|
-
{queryBuilderState.showParametersPanel ? (
|
412
|
-
<CheckIcon />
|
413
|
-
) : null}
|
414
|
-
</MenuContentItemIcon>
|
415
|
-
<MenuContentItemLabel className="query-builder__sub-header__menu-content">
|
416
|
-
Show Parameter(s)
|
417
|
-
</MenuContentItemLabel>
|
418
|
-
</MenuContentItem>
|
419
|
-
)}
|
420
|
-
{
|
421
|
-
<MenuContentItem
|
422
|
-
onClick={toggleConstantPanel}
|
423
|
-
disabled={
|
424
|
-
!queryBuilderState.isQuerySupported ||
|
425
|
-
queryBuilderState.constantState.constants.length >
|
426
|
-
0
|
427
|
-
}
|
428
|
-
>
|
429
|
-
<MenuContentItemIcon>
|
430
|
-
{queryBuilderState.constantState
|
431
|
-
.showConstantPanel ? (
|
432
|
-
<CheckIcon />
|
433
|
-
) : null}
|
434
|
-
</MenuContentItemIcon>
|
435
|
-
<MenuContentItemLabel className="query-builder__sub-header__menu-content">
|
436
|
-
Show Constant(s)
|
437
|
-
</MenuContentItemLabel>
|
438
|
-
</MenuContentItem>
|
439
|
-
}
|
440
|
-
<MenuContentItem
|
441
|
-
onClick={toggleShowFilterPanel}
|
383
|
+
onClick={toggleShowParameterPanel}
|
442
384
|
disabled={
|
443
385
|
!queryBuilderState.isQuerySupported ||
|
444
|
-
|
445
|
-
|
446
|
-
).length > 0
|
386
|
+
queryBuilderState.parametersState.parameterStates
|
387
|
+
.length > 0
|
447
388
|
}
|
448
389
|
>
|
449
390
|
<MenuContentItemIcon>
|
450
|
-
{queryBuilderState.
|
391
|
+
{queryBuilderState.showParametersPanel ? (
|
451
392
|
<CheckIcon />
|
452
393
|
) : null}
|
453
394
|
</MenuContentItemIcon>
|
454
395
|
<MenuContentItemLabel className="query-builder__sub-header__menu-content">
|
455
|
-
Show
|
456
|
-
</MenuContentItemLabel>
|
457
|
-
</MenuContentItem>
|
458
|
-
<MenuContentItem
|
459
|
-
onClick={toggleShowOLAPGroupByPanel}
|
460
|
-
disabled={
|
461
|
-
!queryBuilderState.isQuerySupported ||
|
462
|
-
!(
|
463
|
-
queryBuilderState.fetchStructureState
|
464
|
-
.implementation instanceof QueryBuilderTDSState
|
465
|
-
) ||
|
466
|
-
queryBuilderState.fetchStructureState.implementation
|
467
|
-
.windowState.windowColumns.length > 0
|
468
|
-
}
|
469
|
-
>
|
470
|
-
<MenuContentItemIcon>
|
471
|
-
{isTDSState &&
|
472
|
-
guaranteeType(
|
473
|
-
queryBuilderState.fetchStructureState
|
474
|
-
.implementation,
|
475
|
-
QueryBuilderTDSState,
|
476
|
-
).showWindowFuncPanel ? (
|
477
|
-
<CheckIcon />
|
478
|
-
) : null}
|
479
|
-
</MenuContentItemIcon>
|
480
|
-
<MenuContentItemLabel className="query-builder__sub-header__menu-content">
|
481
|
-
Show Window Func(s)
|
396
|
+
Show Parameter(s)
|
482
397
|
</MenuContentItemLabel>
|
483
398
|
</MenuContentItem>
|
399
|
+
)}
|
400
|
+
{
|
484
401
|
<MenuContentItem
|
485
|
-
onClick={
|
402
|
+
onClick={toggleConstantPanel}
|
486
403
|
disabled={
|
487
404
|
!queryBuilderState.isQuerySupported ||
|
488
|
-
|
489
|
-
queryBuilderState.fetchStructureState
|
490
|
-
.implementation instanceof QueryBuilderTDSState
|
491
|
-
) ||
|
492
|
-
Array.from(
|
493
|
-
queryBuilderState.fetchStructureState.implementation.postFilterState.nodes.values(),
|
494
|
-
).length > 0
|
405
|
+
queryBuilderState.constantState.constants.length > 0
|
495
406
|
}
|
496
407
|
>
|
497
408
|
<MenuContentItemIcon>
|
498
|
-
{queryBuilderState.
|
499
|
-
.
|
500
|
-
queryBuilderState.fetchStructureState.implementation
|
501
|
-
.showPostFilterPanel ? (
|
409
|
+
{queryBuilderState.constantState
|
410
|
+
.showConstantPanel ? (
|
502
411
|
<CheckIcon />
|
503
412
|
) : null}
|
504
413
|
</MenuContentItemIcon>
|
505
414
|
<MenuContentItemLabel className="query-builder__sub-header__menu-content">
|
506
|
-
Show
|
415
|
+
Show Constant(s)
|
507
416
|
</MenuContentItemLabel>
|
508
417
|
</MenuContentItem>
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
418
|
+
}
|
419
|
+
<MenuContentItem
|
420
|
+
onClick={toggleShowFilterPanel}
|
421
|
+
disabled={
|
422
|
+
!queryBuilderState.isQuerySupported ||
|
423
|
+
Array.from(
|
424
|
+
queryBuilderState.filterState.nodes.values(),
|
425
|
+
).length > 0
|
426
|
+
}
|
427
|
+
>
|
428
|
+
<MenuContentItemIcon>
|
429
|
+
{queryBuilderState.filterState.showPanel ? (
|
430
|
+
<CheckIcon />
|
431
|
+
) : null}
|
432
|
+
</MenuContentItemIcon>
|
433
|
+
<MenuContentItemLabel className="query-builder__sub-header__menu-content">
|
434
|
+
Show Filter
|
435
|
+
</MenuContentItemLabel>
|
436
|
+
</MenuContentItem>
|
437
|
+
<MenuContentItem
|
438
|
+
onClick={toggleShowOLAPGroupByPanel}
|
439
|
+
disabled={
|
440
|
+
!queryBuilderState.isQuerySupported ||
|
441
|
+
!(
|
520
442
|
queryBuilderState.fetchStructureState
|
521
|
-
.implementation instanceof QueryBuilderTDSState
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
</
|
537
|
-
<
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
</
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
443
|
+
.implementation instanceof QueryBuilderTDSState
|
444
|
+
) ||
|
445
|
+
queryBuilderState.fetchStructureState.implementation
|
446
|
+
.windowState.windowColumns.length > 0
|
447
|
+
}
|
448
|
+
>
|
449
|
+
<MenuContentItemIcon>
|
450
|
+
{isTDSState &&
|
451
|
+
guaranteeType(
|
452
|
+
queryBuilderState.fetchStructureState
|
453
|
+
.implementation,
|
454
|
+
QueryBuilderTDSState,
|
455
|
+
).showWindowFuncPanel ? (
|
456
|
+
<CheckIcon />
|
457
|
+
) : null}
|
458
|
+
</MenuContentItemIcon>
|
459
|
+
<MenuContentItemLabel className="query-builder__sub-header__menu-content">
|
460
|
+
Show Window Func(s)
|
461
|
+
</MenuContentItemLabel>
|
462
|
+
</MenuContentItem>
|
463
|
+
<MenuContentItem
|
464
|
+
onClick={toggleShowPostFilterPanel}
|
465
|
+
disabled={
|
466
|
+
!queryBuilderState.isQuerySupported ||
|
467
|
+
!(
|
468
|
+
queryBuilderState.fetchStructureState
|
469
|
+
.implementation instanceof QueryBuilderTDSState
|
470
|
+
) ||
|
471
|
+
Array.from(
|
472
|
+
queryBuilderState.fetchStructureState.implementation.postFilterState.nodes.values(),
|
473
|
+
).length > 0
|
474
|
+
}
|
475
|
+
>
|
476
|
+
<MenuContentItemIcon>
|
477
|
+
{queryBuilderState.fetchStructureState
|
478
|
+
.implementation instanceof QueryBuilderTDSState &&
|
479
|
+
queryBuilderState.fetchStructureState.implementation
|
480
|
+
.showPostFilterPanel ? (
|
481
|
+
<CheckIcon />
|
482
|
+
) : null}
|
483
|
+
</MenuContentItemIcon>
|
484
|
+
<MenuContentItemLabel className="query-builder__sub-header__menu-content">
|
485
|
+
Show Post-Filter
|
486
|
+
</MenuContentItemLabel>
|
487
|
+
</MenuContentItem>
|
488
|
+
<MenuContentItem onClick={openWatermark}>
|
489
|
+
<MenuContentItemIcon>{null}</MenuContentItemIcon>
|
490
|
+
<MenuContentItemLabel className="query-builder__sub-header__menu-content">
|
491
|
+
Show Watermark
|
492
|
+
</MenuContentItemLabel>
|
493
|
+
</MenuContentItem>
|
494
|
+
<MenuContentDivider />
|
495
|
+
<MenuContentItem
|
496
|
+
onClick={openCheckEntitlmentsEditor}
|
497
|
+
disabled={
|
498
|
+
queryBuilderState.isQuerySupported &&
|
499
|
+
queryBuilderState.fetchStructureState
|
500
|
+
.implementation instanceof QueryBuilderTDSState &&
|
501
|
+
queryBuilderState.fetchStructureState.implementation
|
502
|
+
.projectionColumns.length === 0
|
503
|
+
}
|
504
|
+
>
|
505
|
+
<MenuContentItemIcon>{null}</MenuContentItemIcon>
|
506
|
+
<MenuContentItemLabel className="query-builder__sub-header__menu-content">
|
507
|
+
Check Entitlements
|
508
|
+
</MenuContentItemLabel>
|
509
|
+
</MenuContentItem>
|
510
|
+
<MenuContentItem onClick={editQueryInPure}>
|
511
|
+
<MenuContentItemIcon>{null}</MenuContentItemIcon>
|
512
|
+
<MenuContentItemLabel className="query-builder__sub-header__menu-content">
|
513
|
+
Edit Query in Pure
|
514
|
+
</MenuContentItemLabel>
|
515
|
+
</MenuContentItem>
|
516
|
+
<MenuContentItem onClick={showQueryProtocol}>
|
517
|
+
<MenuContentItemIcon>{null}</MenuContentItemIcon>
|
518
|
+
<MenuContentItemLabel className="query-builder__sub-header__menu-content">
|
519
|
+
Show Query Protocol
|
520
|
+
</MenuContentItemLabel>
|
521
|
+
</MenuContentItem>
|
522
|
+
</MenuContent>
|
523
|
+
}
|
524
|
+
menuProps={{
|
525
|
+
anchorOrigin: { vertical: 'bottom', horizontal: 'right' },
|
526
|
+
transformOrigin: { vertical: 'top', horizontal: 'right' },
|
527
|
+
elevation: 7,
|
528
|
+
}}
|
529
|
+
>
|
530
|
+
<div className="query-builder__sub-header__custom-action__label">
|
531
|
+
Advanced
|
532
|
+
</div>
|
533
|
+
<CaretDownIcon className="query-builder__sub-header__custom-action__icon" />
|
534
|
+
</DropdownMenu>
|
576
535
|
</div>
|
577
536
|
</div>
|
578
537
|
<div className="query-builder__main">
|
@@ -85,13 +85,11 @@ const QueryBuilderConstantExpressionEditor = observer(
|
|
85
85
|
),
|
86
86
|
);
|
87
87
|
|
88
|
-
const [
|
88
|
+
const [isNameValid, setIsNameValid] = useState<boolean>(true);
|
89
89
|
|
90
|
-
const getValidationMessage = (
|
91
|
-
constantInput
|
92
|
-
|
93
|
-
const possibleMessage = !constantInput
|
94
|
-
? `Constant Name can't be empty`
|
90
|
+
const getValidationMessage = (constantInput: string): string | undefined =>
|
91
|
+
!constantInput
|
92
|
+
? `Constant name can't be empty`
|
95
93
|
: isValidIdentifier(constantInput) === false
|
96
94
|
? 'Constant name must be text with no spaces and not start with an uppercase letter or number'
|
97
95
|
: allVariableNames.filter((e) => e === constantInput).length >
|
@@ -99,10 +97,6 @@ const QueryBuilderConstantExpressionEditor = observer(
|
|
99
97
|
? 'Constant name already exists'
|
100
98
|
: undefined;
|
101
99
|
|
102
|
-
setFailedValidation(possibleMessage !== undefined);
|
103
|
-
return possibleMessage;
|
104
|
-
};
|
105
|
-
|
106
100
|
const close = (): void => {
|
107
101
|
variableState.setSelectedConstant(undefined);
|
108
102
|
};
|
@@ -146,7 +140,8 @@ const QueryBuilderConstantExpressionEditor = observer(
|
|
146
140
|
update={(value: string | undefined): void => {
|
147
141
|
variableExpression_setName(varExpression, value ?? '');
|
148
142
|
}}
|
149
|
-
|
143
|
+
validate={getValidationMessage}
|
144
|
+
onValidate={(issue: string | undefined) => setIsNameValid(!issue)}
|
150
145
|
value={variableName}
|
151
146
|
isReadOnly={false}
|
152
147
|
/>
|
@@ -198,7 +193,7 @@ const QueryBuilderConstantExpressionEditor = observer(
|
|
198
193
|
{isCreating && (
|
199
194
|
<ModalFooterButton
|
200
195
|
text="Create"
|
201
|
-
|
196
|
+
disabled={!isNameValid}
|
202
197
|
onClick={onAction}
|
203
198
|
/>
|
204
199
|
)}
|
@@ -113,10 +113,10 @@ const VariableExpressionEditor = observer(
|
|
113
113
|
|
114
114
|
const parameterNameValue = varState.name;
|
115
115
|
|
116
|
-
const [
|
116
|
+
const [isNameValid, setIsNameValid] = useState<boolean>(true);
|
117
117
|
|
118
|
-
const getValidationMessage = (input: string): string | undefined =>
|
119
|
-
|
118
|
+
const getValidationMessage = (input: string): string | undefined =>
|
119
|
+
!input
|
120
120
|
? `Parameter name can't be empty`
|
121
121
|
: allVariableNames.filter((e) => e === input).length >
|
122
122
|
(isCreating ? 0 : 1)
|
@@ -134,11 +134,6 @@ const VariableExpressionEditor = observer(
|
|
134
134
|
? 'Parameter name must be text with no spaces and not start with an uppercase letter or number'
|
135
135
|
: undefined;
|
136
136
|
|
137
|
-
setFailedValidation(possibleMessage !== undefined);
|
138
|
-
|
139
|
-
return possibleMessage;
|
140
|
-
};
|
141
|
-
|
142
137
|
const close = (): void => {
|
143
138
|
queryParametersState.setSelectedParameter(undefined);
|
144
139
|
};
|
@@ -171,10 +166,11 @@ const VariableExpressionEditor = observer(
|
|
171
166
|
name="Parameter Name"
|
172
167
|
prompt="Name of the parameter. Should be descriptive of its purpose."
|
173
168
|
value={parameterNameValue}
|
174
|
-
validateInput={getValidationMessage}
|
175
169
|
update={(value: string | undefined): void => {
|
176
170
|
variableExpression_setName(varState, value ?? '');
|
177
171
|
}}
|
172
|
+
validate={getValidationMessage}
|
173
|
+
onValidate={(issue: string | undefined) => setIsNameValid(!issue)}
|
178
174
|
isReadOnly={false}
|
179
175
|
/>
|
180
176
|
<div className="panel__content__form__section">
|
@@ -229,7 +225,7 @@ const VariableExpressionEditor = observer(
|
|
229
225
|
{isCreating && (
|
230
226
|
<ModalFooterButton
|
231
227
|
text="Create"
|
232
|
-
|
228
|
+
disabled={!isNameValid}
|
233
229
|
onClick={onAction}
|
234
230
|
/>
|
235
231
|
)}
|