@truedat/dq 5.0.2 → 5.0.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## [5.0.3] 2023-01-27
4
+
5
+ - [TD-5478] Render actions and views to convert basic implementation to default
6
+ or raw implementation
7
+
3
8
  ## [4.59.10] 2023-01-16
4
9
 
5
10
  ### Changed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@truedat/dq",
3
- "version": "5.0.2",
3
+ "version": "5.0.3",
4
4
  "description": "Truedat Web Data Quality Module",
5
5
  "sideEffects": false,
6
6
  "jsnext:main": "src/index.js",
@@ -34,7 +34,7 @@
34
34
  "@testing-library/jest-dom": "^5.16.5",
35
35
  "@testing-library/react": "^12.0.0",
36
36
  "@testing-library/user-event": "^13.2.1",
37
- "@truedat/test": "5.0.2",
37
+ "@truedat/test": "5.0.3",
38
38
  "babel-jest": "^28.1.0",
39
39
  "babel-plugin-dynamic-import-node": "^2.3.3",
40
40
  "babel-plugin-lodash": "^3.3.4",
@@ -92,8 +92,8 @@
92
92
  },
93
93
  "dependencies": {
94
94
  "@apollo/client": "^3.7.1",
95
- "@truedat/core": "5.0.2",
96
- "@truedat/df": "5.0.2",
95
+ "@truedat/core": "5.0.3",
96
+ "@truedat/df": "5.0.3",
97
97
  "decode-uri-component": "^0.2.2",
98
98
  "graphql": "^15.5.3",
99
99
  "moment": "^2.29.4",
@@ -118,5 +118,5 @@
118
118
  "react-dom": ">= 16.8.6 < 17",
119
119
  "semantic-ui-react": ">= 2.0.3 < 2.2"
120
120
  },
121
- "gitHead": "627767d6f31541ef09a077d7e535fb488a05700c"
121
+ "gitHead": "ee802e3e32b52638cb4723fcab3cdeca266a666c"
122
122
  }
@@ -24,6 +24,22 @@ export const implementationActions = ({
24
24
  formatMessage,
25
25
  }) =>
26
26
  _.filter(({ key }) => _.flow(Object.keys, _.includes(key))(actions))([
27
+ {
28
+ key: "convert_default",
29
+ icon: "edit",
30
+ text: formatMessage({ id: "ruleImplementation.actions.convert_default" }),
31
+ value: "convert_default",
32
+ as: Link,
33
+ to: linkTo.IMPLEMENTATION_EDIT_AS_DEFAULT({ implementation_id: id }),
34
+ },
35
+ {
36
+ key: "convert_raw",
37
+ icon: "edit outline",
38
+ text: formatMessage({ id: "ruleImplementation.actions.convert_raw" }),
39
+ value: "convert_raw",
40
+ as: Link,
41
+ to: linkTo.IMPLEMENTATION_EDIT_AS_RAW({ implementation_id: id }),
42
+ },
27
43
  {
28
44
  key: "clone",
29
45
  icon: "copy outline",
@@ -11,6 +11,8 @@ import {
11
11
  IMPLEMENTATION_CONCEPT_LINKS_NEW,
12
12
  IMPLEMENTATION_CONCEPT_LINKS,
13
13
  IMPLEMENTATION_EDIT,
14
+ IMPLEMENTATION_EDIT_AS_DEFAULT,
15
+ IMPLEMENTATION_EDIT_AS_RAW,
14
16
  IMPLEMENTATION_EVENTS,
15
17
  IMPLEMENTATION_EXECUTIONS,
16
18
  IMPLEMENTATION_HISTORY,
@@ -218,6 +220,45 @@ export const ImplementationsRoutes = ({
218
220
  </>
219
221
  )}
220
222
  />
223
+ <Route
224
+ exact
225
+ path={IMPLEMENTATION_EDIT_AS_DEFAULT}
226
+ render={() => (
227
+ <>
228
+ {ruleImplementationLoaded ? (
229
+ <ImplementationStructuresLoader
230
+ structureIds={implementationStructures}
231
+ />
232
+ ) : null}
233
+ {!structuresAliasesLoading &&
234
+ ruleImplementationLoaded &&
235
+ implementationStructuresLoaded ? (
236
+ <NewRuleImplementation
237
+ edition
238
+ implementationType="default"
239
+ />
240
+ ) : null}
241
+ </>
242
+ )}
243
+ />
244
+ <Route
245
+ exact
246
+ path={IMPLEMENTATION_EDIT_AS_RAW}
247
+ render={() => (
248
+ <>
249
+ {ruleImplementationLoaded ? (
250
+ <ImplementationStructuresLoader
251
+ structureIds={implementationStructures}
252
+ />
253
+ ) : null}
254
+ {!structuresAliasesLoading &&
255
+ ruleImplementationLoaded &&
256
+ implementationStructuresLoaded ? (
257
+ <NewRuleImplementation edition implementationType="raw" />
258
+ ) : null}
259
+ </>
260
+ )}
261
+ />
221
262
  <Route
222
263
  exact
223
264
  path={IMPLEMENTATION_MOVE}
@@ -261,7 +261,7 @@ export const NewRuleImplementation = ({
261
261
  structuresFields,
262
262
  structuresSiblings,
263
263
  operators,
264
- implementationType = "",
264
+ implementationType,
265
265
  rule,
266
266
  }) => {
267
267
  const precalculatedDataset = _.flow(
@@ -272,11 +272,17 @@ export const NewRuleImplementation = ({
272
272
  edition
273
273
  ? {
274
274
  id: clone ? null : ruleImplementationProps.id,
275
- executable: ruleImplementationProps.executable,
275
+ executable:
276
+ ruleImplementationProps.implementation_type !== "basic"
277
+ ? ruleImplementationProps.executable
278
+ : true,
276
279
  implementationKey: clone
277
280
  ? ""
278
281
  : ruleImplementationProps.implementation_key,
279
- implementationType: ruleImplementationProps.implementation_type,
282
+ implementationType:
283
+ ruleImplementationProps.implementation_type !== "basic"
284
+ ? ruleImplementationProps.implementation_type
285
+ : implementationType,
280
286
  dataset: precalculatedDataset,
281
287
  populations: _.flow(
282
288
  _.pathOr([], "populations"),
@@ -338,7 +344,7 @@ export const NewRuleImplementation = ({
338
344
  : {
339
345
  executable: true,
340
346
  implementationKey: "",
341
- implementationType,
347
+ implementationType: implementationType || "",
342
348
  dataset: [{}],
343
349
  population: [],
344
350
  populations: [],
@@ -635,6 +641,7 @@ NewRuleImplementation.propTypes = {
635
641
  updateRuleImplementation: PropTypes.func,
636
642
  conceptDomainId: PropTypes.number,
637
643
  conceptDomainIds: PropTypes.array,
644
+ rule: PropTypes.object,
638
645
  };
639
646
 
640
647
  const mapStateToProps = (state) => ({
@@ -267,6 +267,8 @@ export default {
267
267
  "Deprecate implementation",
268
268
  "ruleImplementation.actions.edit": "Edit implementation",
269
269
  "ruleImplementation.actions.move": "Move to another rule",
270
+ "ruleImplementation.actions.convert_default": "Edit as default implementation",
271
+ "ruleImplementation.actions.convert_raw": "Edit as raw implementation",
270
272
  "ruleImplementation.actions.restore": "Restore Implementation",
271
273
  "ruleImplementation.actions.restore.confirmation.content":
272
274
  "A deleted implementation will be restored. ¿Are you sure?",
@@ -275,6 +275,8 @@ export default {
275
275
  "Archivar Implementación",
276
276
  "ruleImplementation.actions.edit": "Editar implementación",
277
277
  "ruleImplementation.actions.move": "Mover a otra regla",
278
+ "ruleImplementation.actions.convert_default": "Editar como implementación normal",
279
+ "ruleImplementation.actions.convert_raw": "Editar como implementación nativa",
278
280
  "ruleImplementation.actions.restore": "Restaurar Implementación",
279
281
  "ruleImplementation.actions.restore.confirmation.content":
280
282
  "Se va a restaurar una implementación que está borrada. ¿Estás seguro de continuar?",