@finos/legend-application-query 13.0.0 → 13.0.2
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/components/QueryEditor.d.ts.map +1 -1
- package/lib/components/QueryEditor.js +40 -33
- package/lib/components/QueryEditor.js.map +1 -1
- package/lib/components/QuerySetup.d.ts +3 -3
- package/lib/components/QuerySetup.d.ts.map +1 -1
- package/lib/components/QuerySetup.js +1 -1
- package/lib/components/QuerySetup.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 +3 -3
- package/lib/stores/QueryEditorStore.d.ts +21 -22
- package/lib/stores/QueryEditorStore.d.ts.map +1 -1
- package/lib/stores/QueryEditorStore.js +11 -20
- package/lib/stores/QueryEditorStore.js.map +1 -1
- package/lib/stores/QuerySetupStore.d.ts.map +1 -1
- package/lib/stores/QuerySetupStore.js +4 -1
- package/lib/stores/QuerySetupStore.js.map +1 -1
- package/package.json +12 -12
- package/src/components/QueryEditor.tsx +61 -50
- package/src/components/QuerySetup.tsx +1 -1
- package/src/index.ts +4 -1
- package/src/stores/QueryEditorStore.ts +26 -35
- package/src/stores/QuerySetupStore.ts +10 -1
@@ -150,14 +150,15 @@ export interface QueryPersistConfiguration {
|
|
150
150
|
}
|
151
151
|
|
152
152
|
export class QuerySaveAsState {
|
153
|
-
editorStore: QueryEditorStore;
|
153
|
+
readonly editorStore: QueryEditorStore;
|
154
|
+
readonly queryBuilderState: QueryBuilderState;
|
155
|
+
readonly createQueryState = ActionState.create();
|
156
|
+
|
154
157
|
lambda: RawLambda;
|
155
158
|
queryName: string;
|
156
159
|
allowUpdate = false;
|
157
160
|
onQueryUpdate?: ((query: Query) => void) | undefined;
|
158
161
|
decorator?: ((query: Query) => void) | undefined;
|
159
|
-
queryBuilderState: QueryBuilderState;
|
160
|
-
createQueryState = ActionState.create();
|
161
162
|
|
162
163
|
constructor(
|
163
164
|
editorStore: QueryEditorStore,
|
@@ -258,7 +259,6 @@ export class QuerySaveAsState {
|
|
258
259
|
this.queryBuilderState.changeDetectionState.initialize(this.lambda);
|
259
260
|
// turn off change detection at this point
|
260
261
|
// TODO: to make performance better, refrain from refreshing like this
|
261
|
-
this.editorStore.setTitle(query.name);
|
262
262
|
this.editorStore.applicationStore.navigationService.navigator.goToLocation(
|
263
263
|
generateExistingQueryEditorRoute(newQuery.id),
|
264
264
|
);
|
@@ -268,7 +268,6 @@ export class QuerySaveAsState {
|
|
268
268
|
query,
|
269
269
|
this.editorStore.graphManagerState.graph,
|
270
270
|
)) as Query;
|
271
|
-
this.editorStore.setTitle(updatedQuery.name);
|
272
271
|
this.editorStore.applicationStore.notificationService.notifySuccess(
|
273
272
|
`Successfully updated query!`,
|
274
273
|
);
|
@@ -303,14 +302,15 @@ export class QuerySaveAsState {
|
|
303
302
|
}
|
304
303
|
|
305
304
|
export class QuerySaveState {
|
306
|
-
editorStore: QueryEditorStore;
|
305
|
+
readonly editorStore: QueryEditorStore;
|
306
|
+
readonly saveQueryState = ActionState.create();
|
307
|
+
|
308
|
+
queryBuilderState: QueryBuilderState;
|
307
309
|
lambda: RawLambda;
|
308
310
|
queryName: string;
|
309
311
|
allowUpdate = false;
|
310
312
|
onQueryUpdate?: ((query: Query) => void) | undefined;
|
311
313
|
decorator?: ((query: Query) => void) | undefined;
|
312
|
-
queryBuilderState: QueryBuilderState;
|
313
|
-
saveQueryState = ActionState.create();
|
314
314
|
|
315
315
|
constructor(
|
316
316
|
editorStore: QueryEditorStore,
|
@@ -414,7 +414,7 @@ export class QueryRenameState {
|
|
414
414
|
readonly editorStore: QueryEditorStore;
|
415
415
|
readonly queryBuilderState: QueryBuilderState;
|
416
416
|
|
417
|
-
readonly
|
417
|
+
readonly renameQueryState = ActionState.create();
|
418
418
|
|
419
419
|
lambda: RawLambda;
|
420
420
|
queryName: string;
|
@@ -455,7 +455,7 @@ export class QueryRenameState {
|
|
455
455
|
) {
|
456
456
|
return;
|
457
457
|
}
|
458
|
-
this.
|
458
|
+
this.renameQueryState.inProgress();
|
459
459
|
const query = new Query();
|
460
460
|
query.name = this.queryName;
|
461
461
|
query.mapping = PackageableElementExplicitReference.create(
|
@@ -475,7 +475,7 @@ export class QueryRenameState {
|
|
475
475
|
error,
|
476
476
|
);
|
477
477
|
this.editorStore.applicationStore.notificationService.notifyError(error);
|
478
|
-
this.
|
478
|
+
this.renameQueryState.reset();
|
479
479
|
return;
|
480
480
|
}
|
481
481
|
|
@@ -485,7 +485,6 @@ export class QueryRenameState {
|
|
485
485
|
query,
|
486
486
|
this.editorStore.graphManagerState.graph,
|
487
487
|
)) as Query;
|
488
|
-
this.editorStore.setTitle(updatedQuery.name);
|
489
488
|
this.editorStore.applicationStore.notificationService.notifySuccess(
|
490
489
|
`Successfully renamed query!`,
|
491
490
|
);
|
@@ -510,7 +509,7 @@ export class QueryRenameState {
|
|
510
509
|
);
|
511
510
|
this.editorStore.applicationStore.notificationService.notifyError(error);
|
512
511
|
} finally {
|
513
|
-
this.
|
512
|
+
this.renameQueryState.reset();
|
514
513
|
this.editorStore.setRenameState(undefined);
|
515
514
|
}
|
516
515
|
}
|
@@ -529,7 +528,6 @@ export abstract class QueryEditorStore {
|
|
529
528
|
saveAsState?: QuerySaveAsState | undefined;
|
530
529
|
saveState?: QuerySaveState | undefined;
|
531
530
|
renameState?: QueryRenameState | undefined;
|
532
|
-
|
533
531
|
title: string | undefined;
|
534
532
|
existingQueryName: string | undefined;
|
535
533
|
|
@@ -548,7 +546,6 @@ export abstract class QueryEditorStore {
|
|
548
546
|
setExistingQueryName: action,
|
549
547
|
setSaveAsState: action,
|
550
548
|
setSaveState: action,
|
551
|
-
setTitle: action,
|
552
549
|
initialize: flow,
|
553
550
|
buildGraph: flow,
|
554
551
|
searchExistingQueryName: flow,
|
@@ -621,11 +618,6 @@ export abstract class QueryEditorStore {
|
|
621
618
|
return false;
|
622
619
|
}
|
623
620
|
|
624
|
-
setTitle(val: string | undefined): void {
|
625
|
-
document.title = `${val} - Legend Query`;
|
626
|
-
this.title = val;
|
627
|
-
}
|
628
|
-
|
629
621
|
setSaveAsState(val: QuerySaveAsState | undefined): void {
|
630
622
|
this.saveAsState = val;
|
631
623
|
}
|
@@ -656,7 +648,7 @@ export abstract class QueryEditorStore {
|
|
656
648
|
*/
|
657
649
|
protected abstract initializeQueryBuilderState(): Promise<QueryBuilderState>;
|
658
650
|
|
659
|
-
abstract
|
651
|
+
abstract getPersistConfiguration(
|
660
652
|
lambda: RawLambda,
|
661
653
|
options?: { update?: boolean | undefined },
|
662
654
|
): Promise<QueryPersistConfiguration>;
|
@@ -824,11 +816,11 @@ export abstract class QueryEditorStore {
|
|
824
816
|
}
|
825
817
|
|
826
818
|
export class MappingQueryCreatorStore extends QueryEditorStore {
|
827
|
-
groupId: string;
|
828
|
-
artifactId: string;
|
829
|
-
versionId: string;
|
830
|
-
mappingPath: string;
|
831
|
-
runtimePath: string;
|
819
|
+
readonly groupId: string;
|
820
|
+
readonly artifactId: string;
|
821
|
+
readonly versionId: string;
|
822
|
+
readonly mappingPath: string;
|
823
|
+
readonly runtimePath: string;
|
832
824
|
|
833
825
|
constructor(
|
834
826
|
applicationStore: LegendQueryApplicationStore,
|
@@ -898,7 +890,7 @@ export class MappingQueryCreatorStore extends QueryEditorStore {
|
|
898
890
|
return queryBuilderState;
|
899
891
|
}
|
900
892
|
|
901
|
-
async
|
893
|
+
async getPersistConfiguration(): Promise<QueryPersistConfiguration> {
|
902
894
|
return {
|
903
895
|
decorator: (query: Query): void => {
|
904
896
|
query.id = uuid();
|
@@ -911,11 +903,11 @@ export class MappingQueryCreatorStore extends QueryEditorStore {
|
|
911
903
|
}
|
912
904
|
|
913
905
|
export class ServiceQueryCreatorStore extends QueryEditorStore {
|
914
|
-
groupId: string;
|
915
|
-
artifactId: string;
|
916
|
-
versionId: string;
|
917
|
-
servicePath: string;
|
918
|
-
executionKey: string | undefined;
|
906
|
+
readonly groupId: string;
|
907
|
+
readonly artifactId: string;
|
908
|
+
readonly versionId: string;
|
909
|
+
readonly servicePath: string;
|
910
|
+
readonly executionKey: string | undefined;
|
919
911
|
|
920
912
|
constructor(
|
921
913
|
applicationStore: LegendQueryApplicationStore,
|
@@ -986,7 +978,7 @@ export class ServiceQueryCreatorStore extends QueryEditorStore {
|
|
986
978
|
return queryBuilderState;
|
987
979
|
}
|
988
980
|
|
989
|
-
async
|
981
|
+
async getPersistConfiguration(
|
990
982
|
lambda: RawLambda,
|
991
983
|
options?: { update?: boolean | undefined },
|
992
984
|
): Promise<QueryPersistConfiguration> {
|
@@ -1100,11 +1092,10 @@ export class ExistingQueryEditorStore extends QueryEditorStore {
|
|
1100
1092
|
},
|
1101
1093
|
},
|
1102
1094
|
);
|
1103
|
-
this.setTitle(this.query.name);
|
1104
1095
|
return queryBuilderState;
|
1105
1096
|
}
|
1106
1097
|
|
1107
|
-
async
|
1098
|
+
async getPersistConfiguration(
|
1108
1099
|
lambda: RawLambda,
|
1109
1100
|
options?: { update?: boolean | undefined },
|
1110
1101
|
): Promise<QueryPersistConfiguration> {
|
@@ -26,7 +26,10 @@ import {
|
|
26
26
|
import { BasicGraphManagerState } from '@finos/legend-graph';
|
27
27
|
import type { DepotServerClient } from '@finos/legend-server-depot';
|
28
28
|
import { LEGEND_QUERY_APP_EVENT } from '../__lib__/LegendQueryEvent.js';
|
29
|
-
import {
|
29
|
+
import {
|
30
|
+
DEFAULT_TAB_SIZE,
|
31
|
+
LEGEND_APPLICATION_COLOR_THEME,
|
32
|
+
} from '@finos/legend-application';
|
30
33
|
import type { LegendQueryPluginManager } from '../application/LegendQueryPluginManager.js';
|
31
34
|
import type { LegendQueryApplicationStore } from './LegendQueryBaseStore.js';
|
32
35
|
import { generateQuerySetupRoute } from '../__lib__/LegendQueryNavigation.js';
|
@@ -62,6 +65,12 @@ export abstract class BaseQuerySetupStore {
|
|
62
65
|
return;
|
63
66
|
}
|
64
67
|
|
68
|
+
// TODO?: remove this when we properly support theme everywhere
|
69
|
+
// See https://github.com/finos/legend-studio/issues/264
|
70
|
+
this.applicationStore.layoutService.setColorTheme(
|
71
|
+
LEGEND_APPLICATION_COLOR_THEME.DEFAULT_DARK,
|
72
|
+
);
|
73
|
+
|
65
74
|
try {
|
66
75
|
this.initState.inProgress();
|
67
76
|
yield this.graphManagerState.graphManager.initialize(
|