@truedat/df 5.17.2 → 5.17.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@truedat/df",
3
- "version": "5.17.2",
3
+ "version": "5.17.3",
4
4
  "description": "Truedat Web Data Quality Module",
5
5
  "sideEffects": false,
6
6
  "jsnext:main": "src/index.js",
@@ -87,8 +87,8 @@
87
87
  },
88
88
  "dependencies": {
89
89
  "@apollo/client": "^3.7.1",
90
- "@truedat/auth": "5.17.2",
91
- "@truedat/core": "5.17.2",
90
+ "@truedat/auth": "5.17.3",
91
+ "@truedat/core": "5.17.3",
92
92
  "decode-uri-component": "^0.2.2",
93
93
  "path-to-regexp": "^1.7.0",
94
94
  "prop-types": "^15.8.1",
@@ -109,5 +109,5 @@
109
109
  "react-dom": ">= 16.8.6 < 17",
110
110
  "semantic-ui-react": ">= 2.0.3 < 2.2"
111
111
  },
112
- "gitHead": "1120a6efa4dfec423696957c5e72d752c9db284f"
112
+ "gitHead": "ec07aeeabffbb6e46d2d22ade283de203dd94c88"
113
113
  }
@@ -1,7 +1,10 @@
1
+ import _ from "lodash/fp";
1
2
  import React from "react";
2
3
  import PropTypes from "prop-types";
3
4
  import { useIntl } from "react-intl";
4
- import { Message } from "semantic-ui-react";
5
+ import { Message, Segment } from "semantic-ui-react";
6
+ import { useTemplate } from "@truedat/core/hooks";
7
+ import Loading from "@truedat/core/components/Loading";
5
8
  import { parseGroups } from "../utils";
6
9
  import FieldGroupDetail from "./FieldGroupDetail";
7
10
 
@@ -50,4 +53,38 @@ DynamicFormViewer.propTypes = {
50
53
  editFunctions: PropTypes.func,
51
54
  };
52
55
 
53
- export default DynamicFormViewer;
56
+ const DynamicFormViewerWithHook = (props) => {
57
+ const { data, loading } = useTemplate({
58
+ name: props.template,
59
+ domainIds: props.domainIds,
60
+ });
61
+ const newProps = {
62
+ ...props,
63
+ template: data?.template,
64
+ };
65
+ return loading ? (
66
+ <Segment>
67
+ <Loading />
68
+ </Segment>
69
+ ) : (
70
+ <DynamicFormViewer {...newProps} />
71
+ );
72
+ };
73
+
74
+ DynamicFormViewerWithHook.propTypes = {
75
+ template: PropTypes.string,
76
+ domainIds: PropTypes.arrayOf(PropTypes.number),
77
+ };
78
+
79
+ const DynamicFormViewerFetcher = (props) =>
80
+ _.isString(props?.template) ? (
81
+ <DynamicFormViewerWithHook {...props} />
82
+ ) : (
83
+ <DynamicFormViewer {...props} />
84
+ );
85
+
86
+ DynamicFormViewerFetcher.propTypes = {
87
+ template: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
88
+ };
89
+
90
+ export default DynamicFormViewerFetcher;
@@ -162,6 +162,7 @@ export default {
162
162
  "template.scope.qe": "Quality Executions",
163
163
  "template.scope.remediation": "Remediation plan",
164
164
  "template.scope.ri": "Quality Implementation",
165
+ "template.scope.quality_control": "Quality Control",
165
166
  "template.widget.copy.char.separator.format": "Char separation format",
166
167
  "template.widget.copy.fixed.column": "Fixed width column format",
167
168
  "template.widget.copy.without.fixed.column": "Format without char separation",
@@ -163,6 +163,7 @@ export default {
163
163
  "template.scope.qe": "Ejecuciones de calidad",
164
164
  "template.scope.remediation": "Plan de remediación",
165
165
  "template.scope.ri": "Implementación de calidad",
166
+ "template.scope.quality_control": "Control de calidad",
166
167
  "template.widget.copy.char.separator.format":
167
168
  "Formato de separación por caracter",
168
169
  "template.widget.copy.fixed.column": "Formato de columna de ancho fijo",
@@ -172,6 +172,19 @@ exports[`<Template /> matches the latest snapshot 1`] = `
172
172
  Grants
173
173
  </span>
174
174
  </div>
175
+ <div
176
+ aria-checked="false"
177
+ aria-selected="false"
178
+ class="item"
179
+ role="option"
180
+ style="pointer-events: all;"
181
+ >
182
+ <span
183
+ class="text"
184
+ >
185
+ Quality Control
186
+ </span>
187
+ </div>
175
188
  <div
176
189
  aria-checked="false"
177
190
  aria-selected="false"
@@ -16,7 +16,17 @@ const scopeOptions = (formatMessage) =>
16
16
  value,
17
17
  })),
18
18
  _.sortBy("text")
19
- )(["bg", "dd", "dq", "gr", "ie", "ri", "qe", "remediation"]);
19
+ )([
20
+ "bg",
21
+ "dd",
22
+ "dq",
23
+ "gr",
24
+ "ie",
25
+ "ri",
26
+ "qe",
27
+ "remediation",
28
+ "quality_control",
29
+ ]);
20
30
 
21
31
  export const TemplateForm = ({ loading, template, onSubmit, onDelete }) => {
22
32
  const { formatMessage } = useIntl();
@@ -29,6 +29,7 @@ const messages = {
29
29
  "template.scope.ri": "ri",
30
30
  "template.scope.qe": "qe",
31
31
  "template.scope.remediation": "Remediation plan",
32
+ "template.scope.quality_control": "Quality control",
32
33
  },
33
34
  };
34
35
 
@@ -80,6 +80,19 @@ exports[`<TemplateForm /> matches the latest snapshot (loading) 1`] = `
80
80
  <div
81
81
  class="menu transition"
82
82
  >
83
+ <div
84
+ aria-checked="false"
85
+ aria-selected="false"
86
+ class="item"
87
+ role="option"
88
+ style="pointer-events: all;"
89
+ >
90
+ <span
91
+ class="text"
92
+ >
93
+ Quality control
94
+ </span>
95
+ </div>
83
96
  <div
84
97
  aria-checked="false"
85
98
  aria-selected="false"
@@ -343,6 +356,19 @@ exports[`<TemplateForm /> matches the latest snapshot 1`] = `
343
356
  <div
344
357
  class="menu transition"
345
358
  >
359
+ <div
360
+ aria-checked="false"
361
+ aria-selected="false"
362
+ class="item"
363
+ role="option"
364
+ style="pointer-events: all;"
365
+ >
366
+ <span
367
+ class="text"
368
+ >
369
+ Quality control
370
+ </span>
371
+ </div>
346
372
  <div
347
373
  aria-checked="false"
348
374
  aria-selected="false"