@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.
Files changed (111) hide show
  1. package/lib/__lib__/QueryBuilderDocumentation.d.ts +0 -1
  2. package/lib/__lib__/QueryBuilderDocumentation.d.ts.map +1 -1
  3. package/lib/__lib__/QueryBuilderDocumentation.js +0 -1
  4. package/lib/__lib__/QueryBuilderDocumentation.js.map +1 -1
  5. package/lib/__lib__/QueryBuilderEvent.d.ts +18 -0
  6. package/lib/__lib__/QueryBuilderEvent.d.ts.map +1 -1
  7. package/lib/__lib__/QueryBuilderEvent.js +20 -0
  8. package/lib/__lib__/QueryBuilderEvent.js.map +1 -1
  9. package/lib/__lib__/QueryBuilderTelemetryHelper.d.ts +14 -0
  10. package/lib/__lib__/QueryBuilderTelemetryHelper.d.ts.map +1 -1
  11. package/lib/__lib__/QueryBuilderTelemetryHelper.js +43 -1
  12. package/lib/__lib__/QueryBuilderTelemetryHelper.js.map +1 -1
  13. package/lib/components/QueryBuilder.d.ts +0 -1
  14. package/lib/components/QueryBuilder.d.ts.map +1 -1
  15. package/lib/components/QueryBuilder.js +25 -34
  16. package/lib/components/QueryBuilder.js.map +1 -1
  17. package/lib/components/QueryBuilderConstantExpressionPanel.d.ts +0 -1
  18. package/lib/components/QueryBuilderConstantExpressionPanel.d.ts.map +1 -1
  19. package/lib/components/QueryBuilderConstantExpressionPanel.js +11 -15
  20. package/lib/components/QueryBuilderConstantExpressionPanel.js.map +1 -1
  21. package/lib/components/QueryBuilderDiffPanel.d.ts +0 -1
  22. package/lib/components/QueryBuilderDiffPanel.d.ts.map +1 -1
  23. package/lib/components/QueryBuilderParametersPanel.d.ts +0 -1
  24. package/lib/components/QueryBuilderParametersPanel.d.ts.map +1 -1
  25. package/lib/components/QueryBuilderParametersPanel.js +16 -20
  26. package/lib/components/QueryBuilderParametersPanel.js.map +1 -1
  27. package/lib/components/QueryBuilderPropertyExpressionEditor.d.ts +0 -1
  28. package/lib/components/QueryBuilderPropertyExpressionEditor.d.ts.map +1 -1
  29. package/lib/components/QueryBuilderResultPanel.d.ts +0 -1
  30. package/lib/components/QueryBuilderResultPanel.d.ts.map +1 -1
  31. package/lib/components/QueryBuilderSideBar.d.ts +0 -1
  32. package/lib/components/QueryBuilderSideBar.d.ts.map +1 -1
  33. package/lib/components/QueryBuilderTextEditor.d.ts +0 -1
  34. package/lib/components/QueryBuilderTextEditor.d.ts.map +1 -1
  35. package/lib/components/QueryBuilderUnsupportedQueryEditor.d.ts +0 -1
  36. package/lib/components/QueryBuilderUnsupportedQueryEditor.d.ts.map +1 -1
  37. package/lib/components/explorer/QueryBuilderFunctionsExplorerPanel.d.ts +0 -1
  38. package/lib/components/explorer/QueryBuilderFunctionsExplorerPanel.d.ts.map +1 -1
  39. package/lib/components/explorer/QueryBuilderMilestoningEditor.d.ts +0 -1
  40. package/lib/components/explorer/QueryBuilderMilestoningEditor.d.ts.map +1 -1
  41. package/lib/components/explorer/QueryBuilderPropertySearchPanel.d.ts +0 -1
  42. package/lib/components/explorer/QueryBuilderPropertySearchPanel.d.ts.map +1 -1
  43. package/lib/components/fetch-structure/QueryBuilderFetchStructurePanel.d.ts +0 -1
  44. package/lib/components/fetch-structure/QueryBuilderFetchStructurePanel.d.ts.map +1 -1
  45. package/lib/components/fetch-structure/QueryBuilderGraphFetchTreePanel.d.ts +0 -1
  46. package/lib/components/fetch-structure/QueryBuilderGraphFetchTreePanel.d.ts.map +1 -1
  47. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.d.ts +0 -1
  48. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.d.ts.map +1 -1
  49. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js +13 -3
  50. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js.map +1 -1
  51. package/lib/components/fetch-structure/QueryBuilderPostTDSPanel.d.ts +0 -1
  52. package/lib/components/fetch-structure/QueryBuilderPostTDSPanel.d.ts.map +1 -1
  53. package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.d.ts +0 -1
  54. package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.d.ts.map +1 -1
  55. package/lib/components/fetch-structure/QueryBuilderTDSPanel.d.ts +0 -1
  56. package/lib/components/fetch-structure/QueryBuilderTDSPanel.d.ts.map +1 -1
  57. package/lib/components/fetch-structure/QueryBuilderTDSPanel.js +1 -1
  58. package/lib/components/fetch-structure/QueryBuilderTDSPanel.js.map +1 -1
  59. package/lib/components/fetch-structure/QueryBuilderTDSWindowPanel.d.ts +0 -1
  60. package/lib/components/fetch-structure/QueryBuilderTDSWindowPanel.d.ts.map +1 -1
  61. package/lib/components/fetch-structure/QueryBuilderTDSWindowPanel.js +2 -2
  62. package/lib/components/fetch-structure/QueryBuilderTDSWindowPanel.js.map +1 -1
  63. package/lib/components/filter/QueryBuilderFilterPanel.d.ts +0 -1
  64. package/lib/components/filter/QueryBuilderFilterPanel.d.ts.map +1 -1
  65. package/lib/components/filter/QueryBuilderFilterPanel.js +14 -3
  66. package/lib/components/filter/QueryBuilderFilterPanel.js.map +1 -1
  67. package/lib/components/shared/LambdaEditor.d.ts +0 -1
  68. package/lib/components/shared/LambdaEditor.d.ts.map +1 -1
  69. package/lib/components/shared/LambdaParameterValuesEditor.d.ts +0 -1
  70. package/lib/components/shared/LambdaParameterValuesEditor.d.ts.map +1 -1
  71. package/lib/components/shared/LambdaParameterValuesEditor.js +2 -1
  72. package/lib/components/shared/LambdaParameterValuesEditor.js.map +1 -1
  73. package/lib/components/shared/QueryBuilderVariableSelector.d.ts +0 -1
  74. package/lib/components/shared/QueryBuilderVariableSelector.d.ts.map +1 -1
  75. package/lib/components/watermark/QueryBuilderWatermark.d.ts +0 -1
  76. package/lib/components/watermark/QueryBuilderWatermark.d.ts.map +1 -1
  77. package/lib/index.css +2 -2
  78. package/lib/index.css.map +1 -1
  79. package/lib/index.d.ts +2 -0
  80. package/lib/index.d.ts.map +1 -1
  81. package/lib/index.js +2 -0
  82. package/lib/index.js.map +1 -1
  83. package/lib/package.json +5 -5
  84. package/lib/stores/QueryBuilderState.d.ts +1 -2
  85. package/lib/stores/QueryBuilderState.d.ts.map +1 -1
  86. package/lib/stores/QueryBuilderState.js +7 -8
  87. package/lib/stores/QueryBuilderState.js.map +1 -1
  88. package/lib/stores/QueryBuilderValueSpecificationBuilder.d.ts +2 -1
  89. package/lib/stores/QueryBuilderValueSpecificationBuilder.d.ts.map +1 -1
  90. package/lib/stores/QueryBuilderValueSpecificationBuilder.js +1 -1
  91. package/lib/stores/QueryBuilderValueSpecificationBuilder.js.map +1 -1
  92. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeValueSpecificationBuilder.d.ts +2 -1
  93. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeValueSpecificationBuilder.d.ts.map +1 -1
  94. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeValueSpecificationBuilder.js +18 -15
  95. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeValueSpecificationBuilder.js.map +1 -1
  96. package/package.json +13 -13
  97. package/src/__lib__/QueryBuilderDocumentation.ts +0 -2
  98. package/src/__lib__/QueryBuilderEvent.ts +20 -0
  99. package/src/__lib__/QueryBuilderTelemetryHelper.ts +131 -1
  100. package/src/components/QueryBuilder.tsx +147 -188
  101. package/src/components/QueryBuilderConstantExpressionPanel.tsx +7 -12
  102. package/src/components/QueryBuilderParametersPanel.tsx +6 -10
  103. package/src/components/fetch-structure/QueryBuilderPostFilterPanel.tsx +96 -60
  104. package/src/components/fetch-structure/QueryBuilderTDSPanel.tsx +1 -3
  105. package/src/components/fetch-structure/QueryBuilderTDSWindowPanel.tsx +2 -4
  106. package/src/components/filter/QueryBuilderFilterPanel.tsx +102 -60
  107. package/src/components/shared/LambdaParameterValuesEditor.tsx +6 -5
  108. package/src/index.ts +2 -0
  109. package/src/stores/QueryBuilderState.ts +6 -11
  110. package/src/stores/QueryBuilderValueSpecificationBuilder.ts +1 -1
  111. 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
- <div
377
- title="Query title"
378
- className="query-builder__sub-header__query__title"
379
- >
380
- {queryBuilderState.titleOfQuery}
381
- </div>
382
- <div className="query-builder__sub-header__actions">
383
- <DropdownMenu
384
- className="query-builder__sub-header__custom-action"
385
- title="Show Advanced Menu..."
386
- content={
387
- <MenuContent>
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={toggleShowFunctionPanel}
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
- Array.from(
445
- queryBuilderState.filterState.nodes.values(),
446
- ).length > 0
386
+ queryBuilderState.parametersState.parameterStates
387
+ .length > 0
447
388
  }
448
389
  >
449
390
  <MenuContentItemIcon>
450
- {queryBuilderState.filterState.showPanel ? (
391
+ {queryBuilderState.showParametersPanel ? (
451
392
  <CheckIcon />
452
393
  ) : null}
453
394
  </MenuContentItemIcon>
454
395
  <MenuContentItemLabel className="query-builder__sub-header__menu-content">
455
- Show Filter
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={toggleShowPostFilterPanel}
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.fetchStructureState
499
- .implementation instanceof QueryBuilderTDSState &&
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 Post-Filter
415
+ Show Constant(s)
507
416
  </MenuContentItemLabel>
508
417
  </MenuContentItem>
509
- <MenuContentItem onClick={openWatermark}>
510
- <MenuContentItemIcon>{null}</MenuContentItemIcon>
511
- <MenuContentItemLabel className="query-builder__sub-header__menu-content">
512
- Show Watermark
513
- </MenuContentItemLabel>
514
- </MenuContentItem>
515
- <MenuContentDivider />
516
- <MenuContentItem
517
- onClick={openCheckEntitlmentsEditor}
518
- disabled={
519
- queryBuilderState.isQuerySupported &&
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
- queryBuilderState.fetchStructureState.implementation
523
- .projectionColumns.length === 0
524
- }
525
- >
526
- <MenuContentItemIcon>{null}</MenuContentItemIcon>
527
- <MenuContentItemLabel className="query-builder__sub-header__menu-content">
528
- Check Entitlements
529
- </MenuContentItemLabel>
530
- </MenuContentItem>
531
- <MenuContentItem onClick={editQueryInPure}>
532
- <MenuContentItemIcon>{null}</MenuContentItemIcon>
533
- <MenuContentItemLabel className="query-builder__sub-header__menu-content">
534
- Edit Query in Pure
535
- </MenuContentItemLabel>
536
- </MenuContentItem>
537
- <MenuContentItem onClick={showQueryProtocol}>
538
- <MenuContentItemIcon>{null}</MenuContentItemIcon>
539
- <MenuContentItemLabel className="query-builder__sub-header__menu-content">
540
- Show Query Protocol
541
- </MenuContentItemLabel>
542
- </MenuContentItem>
543
- <MenuContentDivider />
544
- {queryDocEntry && (
545
- <MenuContentItem onClick={openQueryTutorial}>
546
- <MenuContentItemIcon>{null}</MenuContentItemIcon>
547
- <MenuContentItemLabel className="query-builder__sub-header__menu-content">
548
- Open Documentation
549
- </MenuContentItemLabel>
550
- </MenuContentItem>
551
- )}
552
- <MenuContentItem onClick={toggleAssistant}>
553
- <MenuContentItemIcon>
554
- {!applicationStore.assistantService.isHidden ? (
555
- <CheckIcon />
556
- ) : null}
557
- </MenuContentItemIcon>
558
- <MenuContentItemLabel className="query-builder__sub-header__menu-content">
559
- Show Virtual Assistant
560
- </MenuContentItemLabel>
561
- </MenuContentItem>
562
- </MenuContent>
563
- }
564
- menuProps={{
565
- anchorOrigin: { vertical: 'bottom', horizontal: 'right' },
566
- transformOrigin: { vertical: 'top', horizontal: 'right' },
567
- elevation: 7,
568
- }}
569
- >
570
- <div className="query-builder__sub-header__custom-action__label">
571
- Advanced
572
- </div>
573
- <CaretDownIcon className="query-builder__sub-header__custom-action__icon" />
574
- </DropdownMenu>
575
- </div>
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 [hasFailedValidation, setFailedValidation] = useState<boolean>(false);
88
+ const [isNameValid, setIsNameValid] = useState<boolean>(true);
89
89
 
90
- const getValidationMessage = (
91
- constantInput: string,
92
- ): string | undefined => {
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
- validateInput={getValidationMessage}
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
- inProgress={hasFailedValidation}
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 [hasFailedValidation, setFailedValidation] = useState<boolean>(false);
116
+ const [isNameValid, setIsNameValid] = useState<boolean>(true);
117
117
 
118
- const getValidationMessage = (input: string): string | undefined => {
119
- const possibleMessage = !input
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
- inProgress={hasFailedValidation}
228
+ disabled={!isNameValid}
233
229
  onClick={onAction}
234
230
  />
235
231
  )}