@finos/legend-extension-dsl-data-quality 1.0.38 → 1.0.39
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/components/DataQualityDateSelectionPanel.d.ts +22 -0
- package/lib/components/DataQualityDateSelectionPanel.d.ts.map +1 -0
- package/lib/components/DataQualityDateSelectionPanel.js +47 -0
- package/lib/components/DataQualityDateSelectionPanel.js.map +1 -0
- package/lib/components/DataQualityResultPanel.d.ts.map +1 -1
- package/lib/components/DataQualityResultPanel.js +11 -3
- package/lib/components/DataQualityResultPanel.js.map +1 -1
- package/lib/components/states/DataQualityResultState.d.ts.map +1 -1
- package/lib/components/states/DataQualityResultState.js +1 -1
- package/lib/components/states/DataQualityResultState.js.map +1 -1
- package/lib/components/states/DataQualityState.d.ts +10 -1
- package/lib/components/states/DataQualityState.d.ts.map +1 -1
- package/lib/components/states/DataQualityState.js +57 -2
- package/lib/components/states/DataQualityState.js.map +1 -1
- package/lib/graph-manager/protocol/pure/DSL_DataQuality_PureGraphManagerExtension.d.ts +2 -2
- package/lib/graph-manager/protocol/pure/DSL_DataQuality_PureGraphManagerExtension.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/DSL_DataQuality_PureGraphManagerExtension.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/V1_DSL_Data_Quality_PureGraphManagerExtension.d.ts +4 -3
- package/lib/graph-manager/protocol/pure/v1/V1_DSL_Data_Quality_PureGraphManagerExtension.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/V1_DSL_Data_Quality_PureGraphManagerExtension.js +11 -8
- package/lib/graph-manager/protocol/pure/v1/V1_DSL_Data_Quality_PureGraphManagerExtension.js.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/package.json +4 -4
- package/package.json +14 -14
- package/src/components/DataQualityDateSelectionPanel.tsx +133 -0
- package/src/components/DataQualityResultPanel.tsx +45 -1
- package/src/components/states/DataQualityResultState.ts +6 -1
- package/src/components/states/DataQualityState.ts +86 -5
- package/src/graph-manager/protocol/pure/DSL_DataQuality_PureGraphManagerExtension.ts +2 -0
- package/src/graph-manager/protocol/pure/v1/V1_DSL_Data_Quality_PureGraphManagerExtension.ts +16 -0
- package/style/index.scss +102 -0
- package/tsconfig.json +1 -0
@@ -16,24 +16,31 @@
|
|
16
16
|
|
17
17
|
import { action, computed, flow, makeObservable, observable } from 'mobx';
|
18
18
|
import {
|
19
|
+
type Class,
|
20
|
+
type GraphFetchTree,
|
19
21
|
type GraphManagerState,
|
20
|
-
type
|
22
|
+
type PackageableElement,
|
21
23
|
type RawLambda,
|
22
24
|
type RootGraphFetchTree,
|
23
|
-
type
|
24
|
-
type Class,
|
25
|
-
type GraphFetchTree,
|
26
|
-
buildRawLambdaFromLambdaFunction,
|
25
|
+
type Runtime,
|
27
26
|
CORE_PURE_PATH,
|
28
27
|
FunctionType,
|
29
28
|
GenericType,
|
30
29
|
GenericTypeExplicitReference,
|
30
|
+
getMilestoneTemporalStereotype,
|
31
31
|
LambdaFunction,
|
32
32
|
LambdaFunctionInstanceValue,
|
33
|
+
MILESTONING_STEREOTYPE,
|
33
34
|
Multiplicity,
|
34
35
|
observe_ValueSpecification,
|
35
36
|
PackageableElementExplicitReference,
|
37
|
+
ParameterValue,
|
38
|
+
PRIMITIVE_TYPE,
|
39
|
+
buildRawLambdaFromLambdaFunction,
|
36
40
|
VariableExpression,
|
41
|
+
PROCESSING_DATE_MILESTONING_PROPERTY_NAME,
|
42
|
+
BUSINESS_DATE_MILESTONING_PROPERTY_NAME,
|
43
|
+
V1_RawValueSpecificationType,
|
37
44
|
} from '@finos/legend-graph';
|
38
45
|
import {
|
39
46
|
type EditorExtensionState,
|
@@ -64,6 +71,7 @@ import { DataQualityResultState } from './DataQualityResultState.js';
|
|
64
71
|
import { DATA_QUALITY_HASH_STRUCTURE } from '../../graph/metamodel/DSL_DataQuality_HashUtils.js';
|
65
72
|
import {
|
66
73
|
buildFilterConditionExpression,
|
74
|
+
generateDefaultValueForPrimitiveType,
|
67
75
|
processFilterLambda,
|
68
76
|
QueryBuilderAdvancedWorkflowState,
|
69
77
|
} from '@finos/legend-query-builder';
|
@@ -119,6 +127,13 @@ export abstract class DataQualityState extends ElementEditorState {
|
|
119
127
|
dataQualityQueryBuilderState: DataQualityQueryBuilderState;
|
120
128
|
resultState: DataQualityResultState;
|
121
129
|
showStructuralValidations = false;
|
130
|
+
showDateSelection = false;
|
131
|
+
processingDate = generateDefaultValueForPrimitiveType(
|
132
|
+
PRIMITIVE_TYPE.STRICTDATE,
|
133
|
+
) as string;
|
134
|
+
businessDate = generateDefaultValueForPrimitiveType(
|
135
|
+
PRIMITIVE_TYPE.STRICTDATE,
|
136
|
+
) as string;
|
122
137
|
|
123
138
|
constructor(editorStore: EditorStore, element: PackageableElement) {
|
124
139
|
super(editorStore, element);
|
@@ -129,6 +144,9 @@ export abstract class DataQualityState extends ElementEditorState {
|
|
129
144
|
structuralValidationsGraphFetchTreeState: observable,
|
130
145
|
dataQualityQueryBuilderState: observable,
|
131
146
|
showStructuralValidations: observable,
|
147
|
+
showDateSelection: observable,
|
148
|
+
processingDate: observable,
|
149
|
+
businessDate: observable,
|
132
150
|
constraintsConfigurationElement: computed,
|
133
151
|
setSelectedTab: action,
|
134
152
|
setExecutionContext: action,
|
@@ -136,9 +154,12 @@ export abstract class DataQualityState extends ElementEditorState {
|
|
136
154
|
initializeGraphFetchTreeState: action,
|
137
155
|
initializeStructuralValidationsGraphFetchTreeState: action,
|
138
156
|
setShowStructuralValidations: action,
|
157
|
+
setShowDateSelection: action,
|
139
158
|
updateElementOnClassChange: action,
|
140
159
|
checkConstraintsSelectedAtNode: action,
|
141
160
|
changeClass: action,
|
161
|
+
setProcessingDate: action,
|
162
|
+
setBusinessDate: action,
|
142
163
|
fetchStructuralValidations: flow,
|
143
164
|
tabsToShow: computed,
|
144
165
|
areNestedConstraintsSelected: computed,
|
@@ -169,6 +190,18 @@ export abstract class DataQualityState extends ElementEditorState {
|
|
169
190
|
this.showStructuralValidations = val;
|
170
191
|
}
|
171
192
|
|
193
|
+
setShowDateSelection(val: boolean): void {
|
194
|
+
this.showDateSelection = val;
|
195
|
+
}
|
196
|
+
|
197
|
+
setProcessingDate(val: string): void {
|
198
|
+
this.processingDate = val;
|
199
|
+
}
|
200
|
+
|
201
|
+
setBusinessDate(val: string): void {
|
202
|
+
this.businessDate = val;
|
203
|
+
}
|
204
|
+
|
172
205
|
get tabsToShow(): string[] {
|
173
206
|
const tabs: string[] = Object.values(DATA_QUALITY_TAB);
|
174
207
|
const extensionTabGetters = this.editorStore.pluginManager
|
@@ -185,6 +218,54 @@ export abstract class DataQualityState extends ElementEditorState {
|
|
185
218
|
return tabs;
|
186
219
|
}
|
187
220
|
|
221
|
+
get currentClassMilestoningStrategy(): MILESTONING_STEREOTYPE | undefined {
|
222
|
+
const currentclass = this.dataQualityQueryBuilderState.class;
|
223
|
+
if (currentclass !== undefined) {
|
224
|
+
return getMilestoneTemporalStereotype(
|
225
|
+
currentclass,
|
226
|
+
this.graphManagerState.graph,
|
227
|
+
);
|
228
|
+
}
|
229
|
+
return undefined;
|
230
|
+
}
|
231
|
+
|
232
|
+
get isCurrentClassMilestoned(): boolean {
|
233
|
+
return this.currentClassMilestoningStrategy !== undefined;
|
234
|
+
}
|
235
|
+
|
236
|
+
get lambdaParameterValues(): ParameterValue[] {
|
237
|
+
const parameters: ParameterValue[] = [];
|
238
|
+
const currentClassMilestoningStrategy =
|
239
|
+
this.currentClassMilestoningStrategy;
|
240
|
+
if (
|
241
|
+
currentClassMilestoningStrategy ===
|
242
|
+
MILESTONING_STEREOTYPE.PROCESSING_TEMPORAL ||
|
243
|
+
currentClassMilestoningStrategy === MILESTONING_STEREOTYPE.BITEMPORAL
|
244
|
+
) {
|
245
|
+
const parameterValue = new ParameterValue();
|
246
|
+
parameterValue.name = PROCESSING_DATE_MILESTONING_PROPERTY_NAME;
|
247
|
+
parameterValue.value = {
|
248
|
+
_type: V1_RawValueSpecificationType.CSTRICTDATE,
|
249
|
+
value: this.processingDate,
|
250
|
+
};
|
251
|
+
parameters.push(parameterValue);
|
252
|
+
}
|
253
|
+
if (
|
254
|
+
currentClassMilestoningStrategy ===
|
255
|
+
MILESTONING_STEREOTYPE.BUSINESS_TEMPORAL ||
|
256
|
+
currentClassMilestoningStrategy === MILESTONING_STEREOTYPE.BITEMPORAL
|
257
|
+
) {
|
258
|
+
const parameterValue = new ParameterValue();
|
259
|
+
parameterValue.name = BUSINESS_DATE_MILESTONING_PROPERTY_NAME;
|
260
|
+
parameterValue.value = {
|
261
|
+
_type: V1_RawValueSpecificationType.CSTRICTDATE,
|
262
|
+
value: this.businessDate,
|
263
|
+
};
|
264
|
+
parameters.push(parameterValue);
|
265
|
+
}
|
266
|
+
return parameters;
|
267
|
+
}
|
268
|
+
|
188
269
|
*fetchStructuralValidations(): GeneratorFn<void> {
|
189
270
|
const packagePath = this.constraintsConfigurationElement.path;
|
190
271
|
const model = this.graphManagerState.graph;
|
@@ -20,6 +20,7 @@ import {
|
|
20
20
|
type ExecutionResult,
|
21
21
|
type PureModel,
|
22
22
|
type RootGraphFetchTree,
|
23
|
+
type ParameterValue,
|
23
24
|
AbstractPureGraphManagerExtension,
|
24
25
|
} from '@finos/legend-graph';
|
25
26
|
import { guaranteeNonNullable } from '@finos/legend-shared';
|
@@ -32,6 +33,7 @@ export abstract class DSL_DataQuality_PureGraphManagerExtension extends Abstract
|
|
32
33
|
|
33
34
|
abstract execute(
|
34
35
|
graph: PureModel,
|
36
|
+
lambdaParameterValues: ParameterValue[],
|
35
37
|
packagePath: string,
|
36
38
|
previewLimit: number,
|
37
39
|
): Promise<ExecutionResult>;
|
@@ -24,6 +24,8 @@ import {
|
|
24
24
|
type V1_ExecutionResult,
|
25
25
|
type V1_PureModelContext,
|
26
26
|
type V1_RootGraphFetchTree,
|
27
|
+
type ParameterValue,
|
28
|
+
type V1_ParameterValue,
|
27
29
|
LegendSDLC,
|
28
30
|
PureClientVersion,
|
29
31
|
V1_buildExecutionError,
|
@@ -37,6 +39,8 @@ import {
|
|
37
39
|
V1_PureModelContextPointer,
|
38
40
|
V1_pureModelContextPropSchema,
|
39
41
|
V1_serializeExecutionResult,
|
42
|
+
V1_parameterValueModelSchema,
|
43
|
+
V1_transformParameterValue,
|
40
44
|
} from '@finos/legend-graph';
|
41
45
|
import { createModelSchema, optional, primitive } from 'serializr';
|
42
46
|
import {
|
@@ -47,6 +51,7 @@ import {
|
|
47
51
|
returnUndefOnError,
|
48
52
|
SerializationFactory,
|
49
53
|
UnsupportedOperationError,
|
54
|
+
customListWithSchema,
|
50
55
|
} from '@finos/legend-shared';
|
51
56
|
import { DSL_DataQuality_PureGraphManagerExtension } from '../DSL_DataQuality_PureGraphManagerExtension.js';
|
52
57
|
import {
|
@@ -63,6 +68,7 @@ const DQ_FETCH_PROPERTY_PATH_TREE = 'dq fetch property path tree';
|
|
63
68
|
export class V1_DQExecuteInput {
|
64
69
|
clientVersion: string | undefined;
|
65
70
|
model!: V1_PureModelContext;
|
71
|
+
lambdaParameterValues: V1_ParameterValue[] = [];
|
66
72
|
packagePath!: string;
|
67
73
|
queryLimit: number | undefined;
|
68
74
|
|
@@ -70,6 +76,7 @@ export class V1_DQExecuteInput {
|
|
70
76
|
createModelSchema(V1_DQExecuteInput, {
|
71
77
|
clientVersion: optional(primitive()),
|
72
78
|
model: V1_pureModelContextPropSchema,
|
79
|
+
lambdaParameterValues: customListWithSchema(V1_parameterValueModelSchema),
|
73
80
|
packagePath: primitive(),
|
74
81
|
queryLimit: optional(primitive()),
|
75
82
|
}),
|
@@ -143,6 +150,7 @@ export class V1_DSL_Data_Quality_PureGraphManagerExtension extends DSL_DataQuali
|
|
143
150
|
|
144
151
|
createExecutionInput(
|
145
152
|
graph: PureModel,
|
153
|
+
lambdaParameterValues: ParameterValue[],
|
146
154
|
packagePath: string,
|
147
155
|
clientVersion: string | undefined,
|
148
156
|
previewLimit: number | undefined,
|
@@ -152,6 +160,9 @@ export class V1_DSL_Data_Quality_PureGraphManagerExtension extends DSL_DataQuali
|
|
152
160
|
dqExecuteInput.model = graph.origin
|
153
161
|
? this.buildPureModelSDLCPointer(graph.origin, undefined)
|
154
162
|
: this.graphManager.getFullGraphModelData(graph);
|
163
|
+
dqExecuteInput.lambdaParameterValues = lambdaParameterValues.map(
|
164
|
+
V1_transformParameterValue,
|
165
|
+
);
|
155
166
|
dqExecuteInput.packagePath = packagePath;
|
156
167
|
dqExecuteInput.queryLimit = previewLimit;
|
157
168
|
return dqExecuteInput;
|
@@ -163,6 +174,7 @@ export class V1_DSL_Data_Quality_PureGraphManagerExtension extends DSL_DataQuali
|
|
163
174
|
): Promise<RawExecutionPlan> => {
|
164
175
|
const input = this.createExecutionInput(
|
165
176
|
graph,
|
177
|
+
[],
|
166
178
|
packagePath,
|
167
179
|
V1_DSL_Data_Quality_PureGraphManagerExtension.DEV_PROTOCOL_VERSION,
|
168
180
|
undefined,
|
@@ -186,11 +198,13 @@ export class V1_DSL_Data_Quality_PureGraphManagerExtension extends DSL_DataQuali
|
|
186
198
|
|
187
199
|
execute = async (
|
188
200
|
graph: PureModel,
|
201
|
+
lambdaParameterValues: ParameterValue[],
|
189
202
|
packagePath: string,
|
190
203
|
previewLimit: number,
|
191
204
|
): Promise<ExecutionResult> => {
|
192
205
|
const input = this.createExecutionInput(
|
193
206
|
graph,
|
207
|
+
lambdaParameterValues,
|
194
208
|
packagePath,
|
195
209
|
V1_DSL_Data_Quality_PureGraphManagerExtension.DEV_PROTOCOL_VERSION,
|
196
210
|
previewLimit,
|
@@ -229,6 +243,7 @@ export class V1_DSL_Data_Quality_PureGraphManagerExtension extends DSL_DataQuali
|
|
229
243
|
): Promise<{ plan: RawExecutionPlan; debug: string }> => {
|
230
244
|
const input = this.createExecutionInput(
|
231
245
|
graph,
|
246
|
+
[],
|
232
247
|
packagePath,
|
233
248
|
V1_DSL_Data_Quality_PureGraphManagerExtension.DEV_PROTOCOL_VERSION,
|
234
249
|
undefined,
|
@@ -261,6 +276,7 @@ export class V1_DSL_Data_Quality_PureGraphManagerExtension extends DSL_DataQuali
|
|
261
276
|
const engineServerClient = this.graphManager.engine.getEngineServerClient();
|
262
277
|
const input = this.createExecutionInput(
|
263
278
|
graph,
|
279
|
+
[],
|
264
280
|
packagePath,
|
265
281
|
V1_DSL_Data_Quality_PureGraphManagerExtension.DEV_PROTOCOL_VERSION,
|
266
282
|
undefined,
|
package/style/index.scss
CHANGED
@@ -66,3 +66,105 @@
|
|
66
66
|
width: 15rem;
|
67
67
|
font-size: 1.2rem;
|
68
68
|
}
|
69
|
+
|
70
|
+
.validation-date-selection-modal {
|
71
|
+
padding: 0;
|
72
|
+
width: 25vw;
|
73
|
+
overflow: hidden;
|
74
|
+
|
75
|
+
&__root-container {
|
76
|
+
margin-top: 0 !important;
|
77
|
+
}
|
78
|
+
|
79
|
+
&__container {
|
80
|
+
align-items: center !important;
|
81
|
+
}
|
82
|
+
|
83
|
+
&__content {
|
84
|
+
max-width: 100vw !important;
|
85
|
+
}
|
86
|
+
|
87
|
+
&__content--scrollable {
|
88
|
+
max-width: 100vw !important;
|
89
|
+
}
|
90
|
+
|
91
|
+
.modal__body {
|
92
|
+
height: calc(100% - 8.6rem);
|
93
|
+
padding: 1rem;
|
94
|
+
}
|
95
|
+
|
96
|
+
.modal__body.modal__body--footless {
|
97
|
+
height: calc(100% - 3.6rem);
|
98
|
+
}
|
99
|
+
|
100
|
+
&__absolute-date {
|
101
|
+
padding-bottom: 1rem;
|
102
|
+
border-top: 0.1rem solid var(--color-dark-grey-50);
|
103
|
+
|
104
|
+
&__input {
|
105
|
+
height: 2.8rem;
|
106
|
+
border: 0.1rem solid var(--color-dark-grey-300);
|
107
|
+
color-scheme: dark;
|
108
|
+
font-size: 1.2rem;
|
109
|
+
}
|
110
|
+
}
|
111
|
+
}
|
112
|
+
|
113
|
+
.trial-runs-result-modifier-prompt {
|
114
|
+
@include flexVCenter;
|
115
|
+
|
116
|
+
overflow-x: auto;
|
117
|
+
overflow-y: hidden;
|
118
|
+
|
119
|
+
&__header {
|
120
|
+
@include flexVCenter;
|
121
|
+
|
122
|
+
height: 2.2rem;
|
123
|
+
|
124
|
+
&__label {
|
125
|
+
@include flexVCenter;
|
126
|
+
|
127
|
+
height: 2.2rem;
|
128
|
+
padding: 1rem;
|
129
|
+
text-underline-position: under;
|
130
|
+
}
|
131
|
+
|
132
|
+
&__label__icon {
|
133
|
+
font-size: 1.3rem;
|
134
|
+
margin-right: 0.7rem;
|
135
|
+
}
|
136
|
+
|
137
|
+
&__label__title {
|
138
|
+
white-space: nowrap;
|
139
|
+
font-size: 1.3rem;
|
140
|
+
font-weight: 500;
|
141
|
+
}
|
142
|
+
}
|
143
|
+
|
144
|
+
&__divider {
|
145
|
+
color: var(--color-light-grey-200);
|
146
|
+
margin-right: 1rem;
|
147
|
+
}
|
148
|
+
|
149
|
+
&__divider--light {
|
150
|
+
margin-left: 1rem;
|
151
|
+
}
|
152
|
+
|
153
|
+
&__group {
|
154
|
+
@include flexVCenter;
|
155
|
+
|
156
|
+
&__label {
|
157
|
+
display: flex;
|
158
|
+
align-items: center;
|
159
|
+
justify-content: center;
|
160
|
+
padding: 0.7rem;
|
161
|
+
height: 2.2rem;
|
162
|
+
background: var(--color-dark-grey-280);
|
163
|
+
color: var(--color-light-grey-200);
|
164
|
+
white-space: nowrap;
|
165
|
+
line-height: 1.8rem;
|
166
|
+
border-radius: 0.1rem;
|
167
|
+
font-size: 1.1rem;
|
168
|
+
}
|
169
|
+
}
|
170
|
+
}
|
package/tsconfig.json
CHANGED
@@ -116,6 +116,7 @@
|
|
116
116
|
"./src/components/DataQualityClassValidationEditor.tsx",
|
117
117
|
"./src/components/DataQualityConstraintsSelection.tsx",
|
118
118
|
"./src/components/DataQualityDataSpaceBuilder.tsx",
|
119
|
+
"./src/components/DataQualityDateSelectionPanel.tsx",
|
119
120
|
"./src/components/DataQualityExplorerPanel.tsx",
|
120
121
|
"./src/components/DataQualityFilterPanel.tsx",
|
121
122
|
"./src/components/DataQualityMappingAndRuntimeBuilder.tsx",
|