@finos/legend-application-query 13.4.11 → 13.4.13
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/__lib__/LegendQueryUserDataHelper.js.map +1 -1
- package/lib/components/CloneQueryServiceSetup.js.map +1 -1
- package/lib/components/Core_LegendQueryApplicationPlugin.d.ts +3 -0
- package/lib/components/Core_LegendQueryApplicationPlugin.d.ts.map +1 -1
- package/lib/components/Core_LegendQueryApplicationPlugin.js +250 -5
- package/lib/components/Core_LegendQueryApplicationPlugin.js.map +1 -1
- package/lib/components/CreateMappingQuerySetup.js.map +1 -1
- package/lib/components/LoadProjectServiceQuerySetup.js.map +1 -1
- package/lib/components/QueryEditor.d.ts +8 -0
- package/lib/components/QueryEditor.d.ts.map +1 -1
- package/lib/components/QueryEditor.js +15 -136
- package/lib/components/QueryEditor.js.map +1 -1
- package/lib/components/QueryEdtiorExistingQueryVersionRevertModal.js.map +1 -1
- package/lib/components/QuerySetup.js.map +1 -1
- package/lib/components/UpdateExistingServiceQuerySetup.js.map +1 -1
- package/lib/components/__test-utils__/QueryEditorComponentTestUtils.d.ts.map +1 -1
- package/lib/components/__test-utils__/QueryEditorComponentTestUtils.js +2 -0
- package/lib/components/__test-utils__/QueryEditorComponentTestUtils.js.map +1 -1
- package/lib/components/data-space/DataSpaceQuerySetup.d.ts.map +1 -1
- package/lib/components/data-space/DataSpaceQuerySetup.js +7 -6
- package/lib/components/data-space/DataSpaceQuerySetup.js.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/package.json +12 -12
- package/lib/stores/CloneServiceQuerySetupStore.js.map +1 -1
- package/lib/stores/CreateMappingQuerySetupStore.js.map +1 -1
- package/lib/stores/LegendQueryApplicationPlugin.d.ts +4 -4
- package/lib/stores/LegendQueryApplicationPlugin.d.ts.map +1 -1
- package/lib/stores/LegendQueryApplicationPlugin.js +1 -0
- package/lib/stores/LegendQueryApplicationPlugin.js.map +1 -1
- package/lib/stores/LegendQueryBaseStore.js.map +1 -1
- package/lib/stores/LoadProjectServiceQuerySetupStore.js.map +1 -1
- package/lib/stores/QueryEditorStore.d.ts +5 -1
- package/lib/stores/QueryEditorStore.d.ts.map +1 -1
- package/lib/stores/QueryEditorStore.js +12 -4
- package/lib/stores/QueryEditorStore.js.map +1 -1
- package/lib/stores/QueryProductionizerSetupStore.js.map +1 -1
- package/lib/stores/QuerySetupStore.js.map +1 -1
- package/lib/stores/UpdateExistingServiceQuerySetupStore.js.map +1 -1
- package/lib/stores/__test-utils__/LegendQueryApplicationTestUtils.js +1 -1
- package/lib/stores/__test-utils__/LegendQueryApplicationTestUtils.js.map +1 -1
- package/lib/stores/data-space/DataSpaceQueryCreatorStore.d.ts.map +1 -1
- package/lib/stores/data-space/DataSpaceQueryCreatorStore.js +2 -2
- package/lib/stores/data-space/DataSpaceQueryCreatorStore.js.map +1 -1
- package/lib/stores/data-space/DataSpaceQuerySetupState.d.ts +2 -1
- package/lib/stores/data-space/DataSpaceQuerySetupState.d.ts.map +1 -1
- package/lib/stores/data-space/DataSpaceQuerySetupState.js +6 -3
- package/lib/stores/data-space/DataSpaceQuerySetupState.js.map +1 -1
- package/lib/stores/data-space/DataSpaceTemplateQueryCreatorStore.d.ts.map +1 -1
- package/lib/stores/data-space/DataSpaceTemplateQueryCreatorStore.js +2 -2
- package/lib/stores/data-space/DataSpaceTemplateQueryCreatorStore.js.map +1 -1
- package/package.json +22 -22
- package/src/components/CloneQueryServiceSetup.tsx +6 -6
- package/src/components/Core_LegendQueryApplicationPlugin.tsx +593 -1
- package/src/components/CreateMappingQuerySetup.tsx +8 -8
- package/src/components/LoadProjectServiceQuerySetup.tsx +4 -4
- package/src/components/QueryEditor.tsx +30 -468
- package/src/components/__test-utils__/QueryEditorComponentTestUtils.tsx +2 -0
- package/src/components/data-space/DataSpaceQuerySetup.tsx +52 -53
- package/src/index.ts +2 -1
- package/src/stores/{LegendQueryApplicationPlugin.ts → LegendQueryApplicationPlugin.tsx} +11 -6
- package/src/stores/QueryEditorStore.ts +16 -0
- package/src/stores/__test-utils__/LegendQueryApplicationTestUtils.ts +1 -1
- package/src/stores/data-space/DataSpaceQueryCreatorStore.ts +2 -0
- package/src/stores/data-space/DataSpaceQuerySetupState.ts +8 -0
- package/src/stores/data-space/DataSpaceTemplateQueryCreatorStore.ts +2 -0
- package/tsconfig.json +19 -3
- package/tsconfig.package.json +17 -1
@@ -21,7 +21,6 @@ import {
|
|
21
21
|
DropdownMenu,
|
22
22
|
MenuContent,
|
23
23
|
MenuContentItem,
|
24
|
-
CaretDownIcon,
|
25
24
|
MenuIcon,
|
26
25
|
MenuContentDivider,
|
27
26
|
MenuContentItemIcon,
|
@@ -33,21 +32,14 @@ import {
|
|
33
32
|
ModalFooter,
|
34
33
|
ModalTitle,
|
35
34
|
ModalFooterButton,
|
36
|
-
ManageSearchIcon,
|
37
|
-
LightBulbIcon,
|
38
|
-
EmptyLightBulbIcon,
|
39
|
-
SaveCurrIcon,
|
40
|
-
SaveAsIcon,
|
41
35
|
ExclamationTriangleIcon,
|
42
36
|
PanelListItem,
|
43
|
-
Button,
|
44
37
|
clsx,
|
45
38
|
ModalHeaderActions,
|
46
39
|
TimesIcon,
|
47
40
|
Panel,
|
48
41
|
PanelFullContent,
|
49
42
|
CustomSelectorInput,
|
50
|
-
ArrowCircleUpIcon,
|
51
43
|
} from '@finos/legend-art';
|
52
44
|
import { observer } from 'mobx-react-lite';
|
53
45
|
import { Fragment, useEffect, useMemo, useRef, useState } from 'react';
|
@@ -59,17 +51,9 @@ import {
|
|
59
51
|
LEGEND_QUERY_ROUTE_PATTERN_TOKEN,
|
60
52
|
generateQuerySetupRoute,
|
61
53
|
generateExistingQueryEditorRoute,
|
62
|
-
generateMappingQueryCreatorRoute,
|
63
54
|
} from '../__lib__/LegendQueryNavigation.js';
|
64
|
-
import {
|
65
|
-
|
66
|
-
createViewSDLCProjectHandler,
|
67
|
-
ExistingQueryEditorStore,
|
68
|
-
} from '../stores/QueryEditorStore.js';
|
69
|
-
import {
|
70
|
-
LEGEND_APPLICATION_COLOR_THEME,
|
71
|
-
useApplicationStore,
|
72
|
-
} from '@finos/legend-application';
|
55
|
+
import { ExistingQueryEditorStore } from '../stores/QueryEditorStore.js';
|
56
|
+
import { useApplicationStore } from '@finos/legend-application';
|
73
57
|
import { useParams } from '@finos/legend-application/browser';
|
74
58
|
import {
|
75
59
|
MappingQueryCreatorStoreProvider,
|
@@ -78,7 +62,6 @@ import {
|
|
78
62
|
useQueryEditorStore,
|
79
63
|
} from './QueryEditorStoreProvider.js';
|
80
64
|
import { flowResult } from 'mobx';
|
81
|
-
import { useLegendQueryApplicationStore } from './LegendQueryFrameworkProvider.js';
|
82
65
|
import {
|
83
66
|
QueryBuilder,
|
84
67
|
QueryBuilderNavigationBlocker,
|
@@ -86,33 +69,20 @@ import {
|
|
86
69
|
QueryBuilderDiffViewPanel,
|
87
70
|
type QueryBuilderState,
|
88
71
|
} from '@finos/legend-query-builder';
|
89
|
-
|
90
|
-
import { buildUrl, debounce } from '@finos/legend-shared';
|
91
|
-
import { LegendQueryTelemetryHelper } from '../__lib__/LegendQueryTelemetryHelper.js';
|
92
|
-
import { QUERY_EDITOR_TEST_ID } from '../__lib__/LegendQueryTesting.js';
|
72
|
+
|
93
73
|
import {
|
94
74
|
compareSemVerVersions,
|
95
75
|
generateGAVCoordinates,
|
96
|
-
parseProjectIdentifier,
|
97
76
|
} from '@finos/legend-storage';
|
98
77
|
import {
|
78
|
+
type Query,
|
99
79
|
QueryDataSpaceExecutionContext,
|
100
80
|
QueryExplicitExecutionContext,
|
101
|
-
RuntimePointer,
|
102
|
-
type Query,
|
103
81
|
} from '@finos/legend-graph';
|
104
|
-
import {
|
105
|
-
LATEST_VERSION_ALIAS,
|
106
|
-
StoreProjectData,
|
107
|
-
} from '@finos/legend-server-depot';
|
82
|
+
import { LATEST_VERSION_ALIAS } from '@finos/legend-server-depot';
|
108
83
|
import { buildVersionOption, type VersionOption } from './QuerySetup.js';
|
109
84
|
import { QueryEditorExistingQueryVersionRevertModal } from './QueryEdtiorExistingQueryVersionRevertModal.js';
|
110
|
-
import {
|
111
|
-
DataSpaceQueryBuilderState,
|
112
|
-
generateDataSpaceTemplateQueryPromotionRoute,
|
113
|
-
} from '@finos/legend-extension-dsl-data-space/application';
|
114
|
-
import { generateDataSpaceQueryCreatorRoute } from '../__lib__/DSL_DataSpace_LegendQueryNavigation.js';
|
115
|
-
import { DataSpaceTemplateQueryCreatorStore } from '../stores/data-space/DataSpaceTemplateQueryCreatorStore.js';
|
85
|
+
import { debounce } from '@finos/legend-shared';
|
116
86
|
|
117
87
|
const CreateQueryDialog = observer(() => {
|
118
88
|
const editorStore = useQueryEditorStore();
|
@@ -281,7 +251,7 @@ const SaveQueryDialog = observer(
|
|
281
251
|
},
|
282
252
|
);
|
283
253
|
|
284
|
-
const QueryEditorExistingQueryHeader = observer(
|
254
|
+
export const QueryEditorExistingQueryHeader = observer(
|
285
255
|
(props: {
|
286
256
|
queryBuilderState: QueryBuilderState;
|
287
257
|
existingEditorStore: ExistingQueryEditorStore;
|
@@ -576,435 +546,11 @@ const QueryEditorExistingQueryInfoModal = observer(
|
|
576
546
|
},
|
577
547
|
);
|
578
548
|
|
579
|
-
const QueryEditorHeaderContent = observer(
|
580
|
-
(props: { queryBuilderState: QueryBuilderState }) => {
|
581
|
-
const { queryBuilderState } = props;
|
582
|
-
const editorStore = useQueryEditorStore();
|
583
|
-
const applicationStore = useLegendQueryApplicationStore();
|
584
|
-
const isExistingQuery = editorStore instanceof ExistingQueryEditorStore;
|
585
|
-
const renameQuery = (): void => {
|
586
|
-
if (editorStore instanceof ExistingQueryEditorStore) {
|
587
|
-
editorStore.updateState.setQueryRenamer(true);
|
588
|
-
}
|
589
|
-
};
|
590
|
-
const showQueryInfo = (): void => {
|
591
|
-
if (editorStore instanceof ExistingQueryEditorStore) {
|
592
|
-
editorStore.updateState.setShowQueryInfo(true);
|
593
|
-
}
|
594
|
-
};
|
595
|
-
// actions
|
596
|
-
const openQueryLoader = (): void => {
|
597
|
-
editorStore.queryLoaderState.setQueryLoaderDialogOpen(true);
|
598
|
-
};
|
599
|
-
const viewProject = (): void => {
|
600
|
-
LegendQueryTelemetryHelper.logEvent_QueryViewProjectLaunched(
|
601
|
-
editorStore.applicationStore.telemetryService,
|
602
|
-
);
|
603
|
-
const { groupId, artifactId, versionId } = editorStore.getProjectInfo();
|
604
|
-
createViewProjectHandler(applicationStore)(
|
605
|
-
groupId,
|
606
|
-
artifactId,
|
607
|
-
versionId,
|
608
|
-
undefined,
|
609
|
-
);
|
610
|
-
};
|
611
|
-
const viewSDLCProject = (): void => {
|
612
|
-
LegendQueryTelemetryHelper.logEvent_QueryViewSdlcProjectLaunched(
|
613
|
-
editorStore.applicationStore.telemetryService,
|
614
|
-
);
|
615
|
-
const { groupId, artifactId } = editorStore.getProjectInfo();
|
616
|
-
createViewSDLCProjectHandler(
|
617
|
-
applicationStore,
|
618
|
-
editorStore.depotServerClient,
|
619
|
-
)(groupId, artifactId, undefined).catch(
|
620
|
-
applicationStore.alertUnhandledError,
|
621
|
-
);
|
622
|
-
};
|
623
|
-
const TEMPORARY__toggleLightDarkMode = (): void => {
|
624
|
-
applicationStore.layoutService.setColorTheme(
|
625
|
-
applicationStore.layoutService.TEMPORARY__isLightColorThemeEnabled
|
626
|
-
? LEGEND_APPLICATION_COLOR_THEME.DEFAULT_DARK
|
627
|
-
: LEGEND_APPLICATION_COLOR_THEME.LEGACY_LIGHT,
|
628
|
-
{ persist: true },
|
629
|
-
);
|
630
|
-
};
|
631
|
-
|
632
|
-
const openSaveQueryModal = (): void => {
|
633
|
-
if (editorStore instanceof ExistingQueryEditorStore) {
|
634
|
-
editorStore.updateState.showSaveModal();
|
635
|
-
}
|
636
|
-
};
|
637
|
-
|
638
|
-
const handleNewQuery = (): void => {
|
639
|
-
if (editorStore instanceof ExistingQueryEditorStore) {
|
640
|
-
const query = editorStore.query;
|
641
|
-
if (query) {
|
642
|
-
if (queryBuilderState instanceof DataSpaceQueryBuilderState) {
|
643
|
-
editorStore.applicationStore.navigationService.navigator.goToLocation(
|
644
|
-
generateDataSpaceQueryCreatorRoute(
|
645
|
-
query.groupId,
|
646
|
-
query.artifactId,
|
647
|
-
query.versionId,
|
648
|
-
queryBuilderState.dataSpace.path,
|
649
|
-
queryBuilderState.executionContext.name,
|
650
|
-
undefined,
|
651
|
-
undefined,
|
652
|
-
),
|
653
|
-
);
|
654
|
-
} else {
|
655
|
-
const mapping =
|
656
|
-
editorStore.queryBuilderState?.executionContextState.mapping;
|
657
|
-
const runtime =
|
658
|
-
editorStore.queryBuilderState?.executionContextState.runtimeValue;
|
659
|
-
if (mapping && runtime instanceof RuntimePointer) {
|
660
|
-
editorStore.applicationStore.navigationService.navigator.goToLocation(
|
661
|
-
generateMappingQueryCreatorRoute(
|
662
|
-
query.groupId,
|
663
|
-
query.artifactId,
|
664
|
-
query.versionId,
|
665
|
-
mapping.path,
|
666
|
-
runtime.packageableRuntime.value.path,
|
667
|
-
),
|
668
|
-
);
|
669
|
-
}
|
670
|
-
}
|
671
|
-
}
|
672
|
-
}
|
673
|
-
};
|
674
|
-
|
675
|
-
const toggleAssistant = (): void =>
|
676
|
-
applicationStore.assistantService.toggleAssistant();
|
677
|
-
|
678
|
-
const queryDocEntry = applicationStore.documentationService.getDocEntry(
|
679
|
-
QUERY_DOCUMENTATION_KEY.TUTORIAL_QUERY_BUILDER,
|
680
|
-
);
|
681
|
-
|
682
|
-
const openQueryTutorial = (): void => {
|
683
|
-
if (queryDocEntry?.url) {
|
684
|
-
applicationStore.navigationService.navigator.visitAddress(
|
685
|
-
queryDocEntry.url,
|
686
|
-
);
|
687
|
-
}
|
688
|
-
};
|
689
|
-
|
690
|
-
const handleQuerySaveAs = (): void => {
|
691
|
-
editorStore.queryCreatorState.open(
|
692
|
-
editorStore instanceof ExistingQueryEditorStore
|
693
|
-
? editorStore.query
|
694
|
-
: undefined,
|
695
|
-
);
|
696
|
-
};
|
697
|
-
|
698
|
-
const renderQueryTitle = (): React.ReactNode => {
|
699
|
-
if (editorStore instanceof ExistingQueryEditorStore) {
|
700
|
-
return (
|
701
|
-
<QueryEditorExistingQueryHeader
|
702
|
-
queryBuilderState={queryBuilderState}
|
703
|
-
existingEditorStore={editorStore}
|
704
|
-
/>
|
705
|
-
);
|
706
|
-
} else if (editorStore instanceof DataSpaceTemplateQueryCreatorStore) {
|
707
|
-
return (
|
708
|
-
<div className="query-editor__dataspace__header">
|
709
|
-
<div className="query-editor__header__content__main query-editor__header__content__title__text query-editor__dataspace__header__title__text">
|
710
|
-
{editorStore.templateQueryTitle}
|
711
|
-
</div>
|
712
|
-
<div className="query-editor__dataspace__header__title__tag">
|
713
|
-
template
|
714
|
-
</div>
|
715
|
-
</div>
|
716
|
-
);
|
717
|
-
}
|
718
|
-
|
719
|
-
return (
|
720
|
-
<div className="query-editor__header__content__main query-editor__header__content__title" />
|
721
|
-
);
|
722
|
-
};
|
723
|
-
|
724
|
-
const extraHelpMenuContentItems = applicationStore.pluginManager
|
725
|
-
.getApplicationPlugins()
|
726
|
-
.flatMap(
|
727
|
-
(plugin) =>
|
728
|
-
plugin.getExtraQueryEditorHelpMenuActionConfigurations?.() ?? [],
|
729
|
-
)
|
730
|
-
.map((item) => (
|
731
|
-
<MenuContentItem
|
732
|
-
key={item.key}
|
733
|
-
title={item.title ?? ''}
|
734
|
-
onClick={() => item.onClick(editorStore)}
|
735
|
-
>
|
736
|
-
{item.icon && <MenuContentItemIcon>{item.icon}</MenuContentItemIcon>}
|
737
|
-
<MenuContentItemLabel>{item.label}</MenuContentItemLabel>
|
738
|
-
</MenuContentItem>
|
739
|
-
));
|
740
|
-
|
741
|
-
const proceedCuratedTemplateQueryPromotion = async (): Promise<void> => {
|
742
|
-
if (
|
743
|
-
!(
|
744
|
-
editorStore instanceof ExistingQueryEditorStore &&
|
745
|
-
queryBuilderState instanceof DataSpaceQueryBuilderState
|
746
|
-
)
|
747
|
-
) {
|
748
|
-
return;
|
749
|
-
}
|
750
|
-
// fetch project data
|
751
|
-
const project = StoreProjectData.serialization.fromJson(
|
752
|
-
await editorStore.depotServerClient.getProject(
|
753
|
-
editorStore.lightQuery.groupId,
|
754
|
-
editorStore.lightQuery.artifactId,
|
755
|
-
),
|
756
|
-
);
|
757
|
-
|
758
|
-
// find the matching SDLC instance
|
759
|
-
const projectIDPrefix = parseProjectIdentifier(project.projectId).prefix;
|
760
|
-
const matchingSDLCEntry =
|
761
|
-
editorStore.applicationStore.config.studioInstances.find(
|
762
|
-
(entry) => entry.sdlcProjectIDPrefix === projectIDPrefix,
|
763
|
-
);
|
764
|
-
if (matchingSDLCEntry) {
|
765
|
-
editorStore.applicationStore.navigationService.navigator.visitAddress(
|
766
|
-
buildUrl([
|
767
|
-
editorStore.applicationStore.config.studioApplicationUrl,
|
768
|
-
generateDataSpaceTemplateQueryPromotionRoute(
|
769
|
-
editorStore.lightQuery.groupId,
|
770
|
-
editorStore.lightQuery.artifactId,
|
771
|
-
editorStore.lightQuery.versionId,
|
772
|
-
queryBuilderState.dataSpace.path,
|
773
|
-
editorStore.lightQuery.id,
|
774
|
-
),
|
775
|
-
]),
|
776
|
-
);
|
777
|
-
} else {
|
778
|
-
editorStore.applicationStore.notificationService.notifyWarning(
|
779
|
-
`Can't find the corresponding SDLC instance to productionize the query`,
|
780
|
-
);
|
781
|
-
}
|
782
|
-
};
|
783
|
-
|
784
|
-
const proceedTemplate = (): void => {
|
785
|
-
queryBuilderState.changeDetectionState.alertUnsavedChanges(() => {
|
786
|
-
proceedCuratedTemplateQueryPromotion().catch(
|
787
|
-
editorStore.applicationStore.alertUnhandledError,
|
788
|
-
);
|
789
|
-
});
|
790
|
-
};
|
791
|
-
|
792
|
-
return (
|
793
|
-
<div
|
794
|
-
className="query-editor__header__content"
|
795
|
-
data-testid={QUERY_EDITOR_TEST_ID.QUERY_EDITOR_ACTIONS}
|
796
|
-
>
|
797
|
-
{renderQueryTitle()}
|
798
|
-
|
799
|
-
<div className="query-editor__header__actions">
|
800
|
-
{applicationStore.pluginManager
|
801
|
-
.getApplicationPlugins()
|
802
|
-
.flatMap(
|
803
|
-
(plugin) =>
|
804
|
-
plugin.getExtraQueryEditorActionConfigurations?.(editorStore) ??
|
805
|
-
[],
|
806
|
-
)
|
807
|
-
.map((actionConfig) => (
|
808
|
-
<Fragment key={actionConfig.key}>
|
809
|
-
{actionConfig.renderer(editorStore, queryBuilderState)}
|
810
|
-
</Fragment>
|
811
|
-
))}
|
812
|
-
<>
|
813
|
-
{editorStore instanceof ExistingQueryEditorStore &&
|
814
|
-
queryBuilderState instanceof DataSpaceQueryBuilderState && (
|
815
|
-
<button
|
816
|
-
className="query-editor__header__action btn--dark"
|
817
|
-
tabIndex={-1}
|
818
|
-
onClick={proceedTemplate}
|
819
|
-
title={
|
820
|
-
!(editorStore instanceof ExistingQueryEditorStore)
|
821
|
-
? 'Please save your query first before promoting'
|
822
|
-
: 'Promote Curated Template query...'
|
823
|
-
}
|
824
|
-
>
|
825
|
-
<ArrowCircleUpIcon className="query-editor__header__action__icon--productionize" />
|
826
|
-
<div className="query-editor__header__action__label">
|
827
|
-
Promote as Template Query
|
828
|
-
</div>
|
829
|
-
</button>
|
830
|
-
)}
|
831
|
-
</>
|
832
|
-
<Button
|
833
|
-
className="query-editor__header__action btn--dark"
|
834
|
-
disabled={editorStore.isPerformingBlockingAction}
|
835
|
-
onClick={openQueryLoader}
|
836
|
-
title="Load query..."
|
837
|
-
>
|
838
|
-
<ManageSearchIcon className="query-editor__header__action__icon--load" />
|
839
|
-
<div className="query-editor__header__action__label">
|
840
|
-
Load Query
|
841
|
-
</div>
|
842
|
-
</Button>
|
843
|
-
|
844
|
-
{isExistingQuery && (
|
845
|
-
<Button
|
846
|
-
className="query-editor__header__action btn--dark"
|
847
|
-
disabled={editorStore.isPerformingBlockingAction}
|
848
|
-
onClick={handleNewQuery}
|
849
|
-
title="New query"
|
850
|
-
>
|
851
|
-
<SaveCurrIcon />
|
852
|
-
<div className="query-editor__header__action__label">
|
853
|
-
New Query
|
854
|
-
</div>
|
855
|
-
</Button>
|
856
|
-
)}
|
857
|
-
<Button
|
858
|
-
className="query-editor__header__action btn--dark"
|
859
|
-
disabled={
|
860
|
-
!isExistingQuery || editorStore.isPerformingBlockingAction
|
861
|
-
}
|
862
|
-
onClick={openSaveQueryModal}
|
863
|
-
title="Save query"
|
864
|
-
>
|
865
|
-
<SaveCurrIcon />
|
866
|
-
<div className="query-editor__header__action__label">Save</div>
|
867
|
-
</Button>
|
868
|
-
<Button
|
869
|
-
className="query-editor__header__action btn--dark"
|
870
|
-
disabled={editorStore.isPerformingBlockingAction}
|
871
|
-
onClick={handleQuerySaveAs}
|
872
|
-
title="Save as new query"
|
873
|
-
>
|
874
|
-
<SaveAsIcon />
|
875
|
-
<div className="query-editor__header__action__label">
|
876
|
-
Save As...
|
877
|
-
</div>
|
878
|
-
</Button>
|
879
|
-
<DropdownMenu
|
880
|
-
className="query-editor__header__action btn--dark"
|
881
|
-
disabled={editorStore.isViewProjectActionDisabled}
|
882
|
-
content={
|
883
|
-
<MenuContent>
|
884
|
-
{extraHelpMenuContentItems}
|
885
|
-
{queryDocEntry && (
|
886
|
-
<MenuContentItem onClick={openQueryTutorial}>
|
887
|
-
<MenuContentItemIcon>{null}</MenuContentItemIcon>
|
888
|
-
<MenuContentItemLabel>
|
889
|
-
Open Documentation
|
890
|
-
</MenuContentItemLabel>
|
891
|
-
</MenuContentItem>
|
892
|
-
)}
|
893
|
-
|
894
|
-
<MenuContentItem onClick={toggleAssistant}>
|
895
|
-
<MenuContentItemIcon>
|
896
|
-
{!applicationStore.assistantService.isHidden ? (
|
897
|
-
<CheckIcon />
|
898
|
-
) : null}
|
899
|
-
</MenuContentItemIcon>
|
900
|
-
<MenuContentItemLabel>
|
901
|
-
Show Virtual Assistant
|
902
|
-
</MenuContentItemLabel>
|
903
|
-
</MenuContentItem>
|
904
|
-
</MenuContent>
|
905
|
-
}
|
906
|
-
>
|
907
|
-
<div
|
908
|
-
className="query-editor__header__action__label"
|
909
|
-
title="See more options"
|
910
|
-
>
|
911
|
-
Help...
|
912
|
-
</div>
|
913
|
-
<CaretDownIcon className="query-editor__header__action__dropdown-trigger" />
|
914
|
-
</DropdownMenu>
|
915
|
-
{editorStore.queryLoaderState.isQueryLoaderDialogOpen && (
|
916
|
-
<QueryLoaderDialog
|
917
|
-
queryLoaderState={editorStore.queryLoaderState}
|
918
|
-
title="Load query"
|
919
|
-
/>
|
920
|
-
)}
|
921
|
-
<button
|
922
|
-
title="Toggle light/dark mode"
|
923
|
-
onClick={TEMPORARY__toggleLightDarkMode}
|
924
|
-
className="query-editor__header__action query-editor__header__action__theme-toggler"
|
925
|
-
>
|
926
|
-
{applicationStore.layoutService
|
927
|
-
.TEMPORARY__isLightColorThemeEnabled ? (
|
928
|
-
<>
|
929
|
-
<LightBulbIcon className="query-editor__header__action__icon--bulb--light" />
|
930
|
-
</>
|
931
|
-
) : (
|
932
|
-
<>
|
933
|
-
<EmptyLightBulbIcon className="query-editor__header__action__icon--bulb--dark" />
|
934
|
-
</>
|
935
|
-
)}
|
936
|
-
</button>
|
937
|
-
|
938
|
-
<DropdownMenu
|
939
|
-
className="query-editor__header__action btn--medium"
|
940
|
-
disabled={editorStore.isViewProjectActionDisabled}
|
941
|
-
content={
|
942
|
-
<MenuContent>
|
943
|
-
{isExistingQuery && (
|
944
|
-
<MenuContentItem
|
945
|
-
className="query-editor__header__action__options"
|
946
|
-
onClick={renameQuery}
|
947
|
-
disabled={!isExistingQuery}
|
948
|
-
>
|
949
|
-
Rename Query
|
950
|
-
</MenuContentItem>
|
951
|
-
)}
|
952
|
-
{isExistingQuery && (
|
953
|
-
<MenuContentItem
|
954
|
-
className="query-editor__header__action__options"
|
955
|
-
onClick={showQueryInfo}
|
956
|
-
disabled={!isExistingQuery}
|
957
|
-
>
|
958
|
-
Get Query Info
|
959
|
-
</MenuContentItem>
|
960
|
-
)}
|
961
|
-
<MenuContentItem
|
962
|
-
className="query-editor__header__action__options"
|
963
|
-
disabled={editorStore.isViewProjectActionDisabled}
|
964
|
-
onClick={viewProject}
|
965
|
-
>
|
966
|
-
Go to Project
|
967
|
-
</MenuContentItem>
|
968
|
-
<MenuContentItem
|
969
|
-
className="query-editor__header__action__options"
|
970
|
-
disabled={editorStore.isViewProjectActionDisabled}
|
971
|
-
onClick={viewSDLCProject}
|
972
|
-
>
|
973
|
-
Go to SDLC project
|
974
|
-
</MenuContentItem>
|
975
|
-
</MenuContent>
|
976
|
-
}
|
977
|
-
>
|
978
|
-
<div
|
979
|
-
className="query-editor__header__action__label"
|
980
|
-
title="See more options"
|
981
|
-
>
|
982
|
-
More Actions...
|
983
|
-
</div>
|
984
|
-
<CaretDownIcon className="query-editor__header__action__dropdown-trigger" />
|
985
|
-
</DropdownMenu>
|
986
|
-
|
987
|
-
{editorStore.queryCreatorState.showCreateModal && (
|
988
|
-
<CreateQueryDialog />
|
989
|
-
)}
|
990
|
-
{isExistingQuery &&
|
991
|
-
editorStore.updateState.showQueryInfo &&
|
992
|
-
editorStore.query && (
|
993
|
-
<QueryEditorExistingQueryInfoModal
|
994
|
-
existingEditorStore={editorStore}
|
995
|
-
query={editorStore.query}
|
996
|
-
/>
|
997
|
-
)}
|
998
|
-
</div>
|
999
|
-
</div>
|
1000
|
-
);
|
1001
|
-
},
|
1002
|
-
);
|
1003
|
-
|
1004
549
|
export const QueryEditor = observer(() => {
|
1005
550
|
const applicationStore = useApplicationStore();
|
1006
551
|
const editorStore = useQueryEditorStore();
|
1007
552
|
const isLoadingEditor = !editorStore.initState.hasCompleted;
|
553
|
+
const isExistingQuery = editorStore instanceof ExistingQueryEditorStore;
|
1008
554
|
|
1009
555
|
// documentation
|
1010
556
|
const appDocUrl = applicationStore.documentationService.url;
|
@@ -1024,6 +570,8 @@ export const QueryEditor = observer(() => {
|
|
1024
570
|
generateQuerySetupRoute(),
|
1025
571
|
),
|
1026
572
|
);
|
573
|
+
const goToReleaseLog = (): void =>
|
574
|
+
applicationStore.releaseNotesService.setReleaseLog(true);
|
1027
575
|
// settings
|
1028
576
|
// NOTE: this is temporary until we find a better home for these settings in query builder
|
1029
577
|
const engineConfig =
|
@@ -1041,10 +589,10 @@ export const QueryEditor = observer(() => {
|
|
1041
589
|
|
1042
590
|
return (
|
1043
591
|
<div className="query-editor">
|
1044
|
-
<div className="query-
|
1045
|
-
<div className="query-
|
592
|
+
<div className="query-editor__logo-header">
|
593
|
+
<div className="query-editor__logo-header__menu">
|
1046
594
|
<DropdownMenu
|
1047
|
-
className="query-
|
595
|
+
className="query-editor__logo-header__menu-item"
|
1048
596
|
menuProps={{
|
1049
597
|
anchorOrigin: { vertical: 'top', horizontal: 'right' },
|
1050
598
|
transformOrigin: { vertical: 'top', horizontal: 'left' },
|
@@ -1055,6 +603,9 @@ export const QueryEditor = observer(() => {
|
|
1055
603
|
<MenuContentItem onClick={goToQuerySetup}>
|
1056
604
|
Back to query setup
|
1057
605
|
</MenuContentItem>
|
606
|
+
<MenuContentItem onClick={goToReleaseLog}>
|
607
|
+
Legend Query Release Log
|
608
|
+
</MenuContentItem>
|
1058
609
|
<MenuContentItem
|
1059
610
|
disabled={!appDocUrl}
|
1060
611
|
onClick={goToDocumentation}
|
@@ -1089,11 +640,22 @@ export const QueryEditor = observer(() => {
|
|
1089
640
|
<MenuIcon />
|
1090
641
|
</DropdownMenu>
|
1091
642
|
</div>
|
1092
|
-
|
1093
|
-
|
1094
|
-
|
643
|
+
<div className="query-editor__logo-header__name">Legend Query</div>
|
644
|
+
{editorStore.queryLoaderState.isQueryLoaderDialogOpen && (
|
645
|
+
<QueryLoaderDialog
|
646
|
+
queryLoaderState={editorStore.queryLoaderState}
|
647
|
+
title="Load query"
|
1095
648
|
/>
|
1096
649
|
)}
|
650
|
+
{editorStore.queryCreatorState.showCreateModal && <CreateQueryDialog />}
|
651
|
+
{isExistingQuery &&
|
652
|
+
editorStore.updateState.showQueryInfo &&
|
653
|
+
editorStore.query && (
|
654
|
+
<QueryEditorExistingQueryInfoModal
|
655
|
+
existingEditorStore={editorStore}
|
656
|
+
query={editorStore.query}
|
657
|
+
/>
|
658
|
+
)}
|
1097
659
|
</div>
|
1098
660
|
<div className="query-editor__content">
|
1099
661
|
<PanelLoadingIndicator isLoading={isLoadingEditor} />
|
@@ -43,6 +43,7 @@ import {
|
|
43
43
|
} from '@finos/legend-query-builder';
|
44
44
|
import { LegendQueryFrameworkProvider } from '../LegendQueryFrameworkProvider.js';
|
45
45
|
import { TEST__BrowserEnvironmentProvider } from '@finos/legend-application/test';
|
46
|
+
import { Core_LegendQueryApplicationPlugin } from '../Core_LegendQueryApplicationPlugin.js';
|
46
47
|
|
47
48
|
const TEST_QUERY_ID = 'test-query-id';
|
48
49
|
export const TEST_QUERY_NAME = 'MyTestQuery';
|
@@ -55,6 +56,7 @@ export const TEST__provideMockedQueryEditorStore = (customization?: {
|
|
55
56
|
}): ExistingQueryEditorStore => {
|
56
57
|
const pluginManager =
|
57
58
|
customization?.pluginManager ?? LegendQueryPluginManager.create();
|
59
|
+
pluginManager.usePlugins([new Core_LegendQueryApplicationPlugin()]).install();
|
58
60
|
const applicationStore =
|
59
61
|
customization?.applicationStore ??
|
60
62
|
new ApplicationStore(
|