@finos/legend-query-builder 4.16.20 → 4.16.22
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/__test-utils__/QueryBuilderComponentTestUtils.d.ts +23 -1
- package/lib/components/__test-utils__/QueryBuilderComponentTestUtils.d.ts.map +1 -1
- package/lib/components/__test-utils__/QueryBuilderComponentTestUtils.js +16 -2
- package/lib/components/__test-utils__/QueryBuilderComponentTestUtils.js.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js +1 -1
- package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js.map +1 -1
- package/lib/components/filter/QueryBuilderFilterPanel.js +1 -1
- package/lib/components/filter/QueryBuilderFilterPanel.js.map +1 -1
- package/lib/components/shared/BasicValueSpecificationEditor.d.ts +162 -4
- package/lib/components/shared/BasicValueSpecificationEditor.d.ts.map +1 -1
- package/lib/components/shared/BasicValueSpecificationEditor.js +253 -172
- package/lib/components/shared/BasicValueSpecificationEditor.js.map +1 -1
- package/lib/components/shared/CustomDatePicker.d.ts +8 -55
- package/lib/components/shared/CustomDatePicker.d.ts.map +1 -1
- package/lib/components/shared/CustomDatePicker.js +33 -417
- package/lib/components/shared/CustomDatePicker.js.map +1 -1
- package/lib/components/shared/CustomDatePickerHelper.d.ts +145 -0
- package/lib/components/shared/CustomDatePickerHelper.d.ts.map +1 -0
- package/lib/components/shared/CustomDatePickerHelper.js +517 -0
- package/lib/components/shared/CustomDatePickerHelper.js.map +1 -0
- package/lib/components/shared/QueryBuilderVariableSelector.js +1 -1
- package/lib/components/shared/QueryBuilderVariableSelector.js.map +1 -1
- package/lib/components/shared/V1_BasicValueSpecificationEditor.d.ts +38 -0
- package/lib/components/shared/V1_BasicValueSpecificationEditor.d.ts.map +1 -0
- package/lib/components/shared/V1_BasicValueSpecificationEditor.js +166 -0
- package/lib/components/shared/V1_BasicValueSpecificationEditor.js.map +1 -0
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/index.d.ts +4 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +4 -0
- package/lib/index.js.map +1 -1
- package/lib/package.json +1 -1
- package/lib/stores/shared/V1_ValueSpecificationEditorHelper.d.ts +23 -0
- package/lib/stores/shared/V1_ValueSpecificationEditorHelper.d.ts.map +1 -0
- package/lib/stores/shared/V1_ValueSpecificationEditorHelper.js +83 -0
- package/lib/stores/shared/V1_ValueSpecificationEditorHelper.js.map +1 -0
- package/lib/stores/shared/V1_ValueSpecificationModifierHelper.d.ts +20 -0
- package/lib/stores/shared/V1_ValueSpecificationModifierHelper.d.ts.map +1 -0
- package/lib/stores/shared/V1_ValueSpecificationModifierHelper.js +38 -0
- package/lib/stores/shared/V1_ValueSpecificationModifierHelper.js.map +1 -0
- package/lib/stores/shared/ValueSpecificationEditorHelper.d.ts +4 -1
- package/lib/stores/shared/ValueSpecificationEditorHelper.d.ts.map +1 -1
- package/lib/stores/shared/ValueSpecificationEditorHelper.js +23 -2
- package/lib/stores/shared/ValueSpecificationEditorHelper.js.map +1 -1
- package/package.json +10 -10
- package/src/components/__test-utils__/QueryBuilderComponentTestUtils.tsx +103 -12
- package/src/components/fetch-structure/QueryBuilderPostFilterPanel.tsx +1 -1
- package/src/components/filter/QueryBuilderFilterPanel.tsx +1 -1
- package/src/components/shared/BasicValueSpecificationEditor.tsx +1477 -1088
- package/src/components/shared/CustomDatePicker.tsx +146 -905
- package/src/components/shared/CustomDatePickerHelper.ts +984 -0
- package/src/components/shared/QueryBuilderVariableSelector.tsx +1 -1
- package/src/components/shared/V1_BasicValueSpecificationEditor.tsx +409 -0
- package/src/index.ts +7 -0
- package/src/stores/shared/V1_ValueSpecificationEditorHelper.ts +131 -0
- package/src/stores/shared/V1_ValueSpecificationModifierHelper.ts +76 -0
- package/src/stores/shared/ValueSpecificationEditorHelper.ts +71 -2
- package/tsconfig.json +4 -0
@@ -28,8 +28,15 @@ import {
|
|
28
28
|
import { LogService, guaranteeNonNullable } from '@finos/legend-shared';
|
29
29
|
import { createSpy } from '@finos/legend-shared/test';
|
30
30
|
import {
|
31
|
-
type
|
31
|
+
type GraphManagerPluginManager,
|
32
|
+
type ObserverContext,
|
33
|
+
type PureModel,
|
32
34
|
type RawLambda,
|
35
|
+
type RawMappingModelCoverageAnalysisResult,
|
36
|
+
type V1_Enumeration,
|
37
|
+
type V1_Multiplicity,
|
38
|
+
type V1_ValueSpecification,
|
39
|
+
type ValueSpecification,
|
33
40
|
GraphManagerState,
|
34
41
|
PackageableElementExplicitReference,
|
35
42
|
RuntimePointer,
|
@@ -56,6 +63,14 @@ import { STYLE_PREFIX, STYLE_PREFIX__DARK } from '@finos/legend-art';
|
|
56
63
|
import { expect } from '@jest/globals';
|
57
64
|
import { QueryBuilderAdvancedWorkflowState } from '../../stores/query-workflow/QueryBuilderWorkFlowState.js';
|
58
65
|
import { Route, Routes } from '@finos/legend-application/browser';
|
66
|
+
import {
|
67
|
+
BasicValueSpecificationEditor,
|
68
|
+
type TypeCheckOption,
|
69
|
+
} from '../shared/BasicValueSpecificationEditor.js';
|
70
|
+
import {
|
71
|
+
V1_BasicValueSpecificationEditor,
|
72
|
+
type V1_TypeCheckOption,
|
73
|
+
} from '../shared/V1_BasicValueSpecificationEditor.js';
|
59
74
|
|
60
75
|
const getSelectorContainerClassName = (lightMode?: boolean): string =>
|
61
76
|
'.' + `${lightMode ? STYLE_PREFIX : STYLE_PREFIX__DARK}__value-container`;
|
@@ -189,23 +204,15 @@ export const setDerivedPropertyValue = async (
|
|
189
204
|
await waitFor(() => expect(renderResult.queryByRole('dialog')).toBeNull());
|
190
205
|
};
|
191
206
|
|
192
|
-
export const
|
207
|
+
export const TEST__setUpGraphManagerState = async (
|
193
208
|
entities: Entity[],
|
194
|
-
|
195
|
-
|
196
|
-
runtimePath: string,
|
197
|
-
rawMappingModelCoverageAnalysisResult?: RawMappingModelCoverageAnalysisResult,
|
198
|
-
): Promise<{
|
199
|
-
renderResult: RenderResult;
|
200
|
-
queryBuilderState: QueryBuilderState;
|
201
|
-
}> => {
|
202
|
-
const pluginManager = TEST__LegendApplicationPluginManager.create();
|
209
|
+
pluginManager: GraphManagerPluginManager,
|
210
|
+
): Promise<GraphManagerState> => {
|
203
211
|
pluginManager.usePresets([new QueryBuilder_GraphManagerPreset()]).install();
|
204
212
|
const graphManagerState = new GraphManagerState(
|
205
213
|
pluginManager,
|
206
214
|
new LogService(),
|
207
215
|
);
|
208
|
-
|
209
216
|
await graphManagerState.graphManager.initialize({
|
210
217
|
env: 'test',
|
211
218
|
tabSize: 2,
|
@@ -217,6 +224,24 @@ export const TEST__setUpQueryBuilder = async (
|
|
217
224
|
entities,
|
218
225
|
graphManagerState.graphBuildState,
|
219
226
|
);
|
227
|
+
return graphManagerState;
|
228
|
+
};
|
229
|
+
|
230
|
+
export const TEST__setUpQueryBuilder = async (
|
231
|
+
entities: Entity[],
|
232
|
+
lambda: RawLambda,
|
233
|
+
mappingPath: string,
|
234
|
+
runtimePath: string,
|
235
|
+
rawMappingModelCoverageAnalysisResult?: RawMappingModelCoverageAnalysisResult,
|
236
|
+
): Promise<{
|
237
|
+
renderResult: RenderResult;
|
238
|
+
queryBuilderState: QueryBuilderState;
|
239
|
+
}> => {
|
240
|
+
const pluginManager = TEST__LegendApplicationPluginManager.create();
|
241
|
+
const graphManagerState = await TEST__setUpGraphManagerState(
|
242
|
+
entities,
|
243
|
+
pluginManager,
|
244
|
+
);
|
220
245
|
|
221
246
|
const MOCK__applicationStore = new ApplicationStore(
|
222
247
|
TEST__getGenericApplicationConfig(),
|
@@ -275,3 +300,69 @@ export const TEST__setUpQueryBuilder = async (
|
|
275
300
|
queryBuilderState,
|
276
301
|
};
|
277
302
|
};
|
303
|
+
|
304
|
+
export const TEST__setUpBasicValueSpecificationEditor = (
|
305
|
+
pluginManager: TEST__LegendApplicationPluginManager,
|
306
|
+
props: {
|
307
|
+
valueSpecification: ValueSpecification;
|
308
|
+
setValueSpecification: (val: ValueSpecification) => void;
|
309
|
+
typeCheckOption: TypeCheckOption;
|
310
|
+
resetValue: () => void;
|
311
|
+
graph: PureModel;
|
312
|
+
observerContext: ObserverContext;
|
313
|
+
readOnly?: boolean | undefined;
|
314
|
+
},
|
315
|
+
): void => {
|
316
|
+
const MOCK__applicationStore = new ApplicationStore(
|
317
|
+
TEST__getGenericApplicationConfig(),
|
318
|
+
pluginManager,
|
319
|
+
);
|
320
|
+
|
321
|
+
render(
|
322
|
+
<ApplicationStoreProvider store={MOCK__applicationStore}>
|
323
|
+
<TEST__BrowserEnvironmentProvider initialEntries={['/']}>
|
324
|
+
<ApplicationFrameworkProvider>
|
325
|
+
<Routes>
|
326
|
+
<Route
|
327
|
+
path="*"
|
328
|
+
element={<BasicValueSpecificationEditor {...props} />}
|
329
|
+
/>
|
330
|
+
</Routes>
|
331
|
+
</ApplicationFrameworkProvider>
|
332
|
+
</TEST__BrowserEnvironmentProvider>
|
333
|
+
</ApplicationStoreProvider>,
|
334
|
+
);
|
335
|
+
};
|
336
|
+
|
337
|
+
export const TEST__setUpV1BasicValueSpecificationEditor = (
|
338
|
+
pluginManager: TEST__LegendApplicationPluginManager,
|
339
|
+
props: {
|
340
|
+
valueSpecification: V1_ValueSpecification;
|
341
|
+
setValueSpecification: (val: V1_ValueSpecification) => void;
|
342
|
+
multiplicity: V1_Multiplicity;
|
343
|
+
typeCheckOption: V1_TypeCheckOption;
|
344
|
+
resetValue: () => void;
|
345
|
+
enumeration?: V1_Enumeration | undefined;
|
346
|
+
readOnly?: boolean | undefined;
|
347
|
+
},
|
348
|
+
): void => {
|
349
|
+
const MOCK__applicationStore = new ApplicationStore(
|
350
|
+
TEST__getGenericApplicationConfig(),
|
351
|
+
pluginManager,
|
352
|
+
);
|
353
|
+
|
354
|
+
render(
|
355
|
+
<ApplicationStoreProvider store={MOCK__applicationStore}>
|
356
|
+
<TEST__BrowserEnvironmentProvider initialEntries={['/']}>
|
357
|
+
<ApplicationFrameworkProvider>
|
358
|
+
<Routes>
|
359
|
+
<Route
|
360
|
+
path="*"
|
361
|
+
element={<V1_BasicValueSpecificationEditor {...props} />}
|
362
|
+
/>
|
363
|
+
</Routes>
|
364
|
+
</ApplicationFrameworkProvider>
|
365
|
+
</TEST__BrowserEnvironmentProvider>
|
366
|
+
</ApplicationStoreProvider>,
|
367
|
+
);
|
368
|
+
};
|
@@ -446,7 +446,7 @@ const QueryBuilderPostFilterConditionEditor = observer(
|
|
446
446
|
),
|
447
447
|
}}
|
448
448
|
resetValue={resetNode}
|
449
|
-
|
449
|
+
selectorSearchConfig={selectorConfig}
|
450
450
|
isConstant={queryBuilderState.constantState.isValueSpecConstant(
|
451
451
|
rightConditionValue.value,
|
452
452
|
)}
|
@@ -1046,7 +1046,7 @@ const QueryBuilderFilterConditionEditor = observer(
|
|
1046
1046
|
.func.value.genericType.value.rawType,
|
1047
1047
|
}}
|
1048
1048
|
resetValue={resetNode}
|
1049
|
-
|
1049
|
+
selectorSearchConfig={selectorConfig}
|
1050
1050
|
isConstant={queryBuilderState.constantState.isValueSpecConstant(
|
1051
1051
|
rightConditionValue.value,
|
1052
1052
|
)}
|