@truedat/dq 4.32.1 → 4.33.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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## [4.33.2] 2021-11-25
4
+
5
+ ### Fixed
6
+
7
+ - [TD-4251] Enable input of filters for referenced table in quality implementation
8
+
9
+ ## [4.33.1] 2021-11-22
10
+
11
+ ### Hotfix
12
+
13
+ [TD-4327] Fix dropdown domain selector for glossay new quality rule
14
+
3
15
  ## [4.31.4] 2021-10-25
4
16
 
5
17
  ### Added
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@truedat/dq",
3
- "version": "4.32.1",
3
+ "version": "4.33.2",
4
4
  "description": "Truedat Web Data Quality Module",
5
5
  "sideEffects": false,
6
6
  "jsnext:main": "src/index.js",
@@ -31,7 +31,7 @@
31
31
  "@babel/plugin-transform-modules-commonjs": "^7.15.0",
32
32
  "@babel/preset-env": "^7.15.0",
33
33
  "@babel/preset-react": "^7.14.5",
34
- "@truedat/test": "4.32.0",
34
+ "@truedat/test": "4.33.2",
35
35
  "babel-jest": "^27.0.6",
36
36
  "babel-plugin-dynamic-import-node": "^2.3.3",
37
37
  "babel-plugin-lodash": "^3.3.4",
@@ -82,8 +82,8 @@
82
82
  },
83
83
  "dependencies": {
84
84
  "@apollo/client": "^3.4.10",
85
- "@truedat/core": "4.32.0",
86
- "@truedat/df": "4.32.1",
85
+ "@truedat/core": "4.33.2",
86
+ "@truedat/df": "4.33.2",
87
87
  "axios": "^0.19.2",
88
88
  "graphql": "^15.5.3",
89
89
  "path-to-regexp": "^1.7.0",
@@ -103,5 +103,5 @@
103
103
  "react-dom": ">= 16.8.6 < 17",
104
104
  "semantic-ui-react": ">= 0.88.2 < 2.1"
105
105
  },
106
- "gitHead": "771e256599825a2ff75e57a1ead86fd341e53768"
106
+ "gitHead": "fcb19bbbe67e7aca3242426f56e1f2e52be8bdcb"
107
107
  }
@@ -19,6 +19,7 @@ import {
19
19
  import { HistoryBackButton } from "@truedat/core/components";
20
20
  import { applyTemplate } from "@truedat/df/utils";
21
21
  import { selectDomain } from "@truedat/df/routines";
22
+ import { getDomainSelectorOptions } from "@truedat/bg/selectors";
22
23
  import DynamicRuleForm from "./DynamicRuleForm";
23
24
 
24
25
  const DomainDropdownSelector = React.lazy(() =>
@@ -345,9 +346,13 @@ export class RuleForm extends React.Component {
345
346
  } = this.props;
346
347
  const rule = this.state;
347
348
  const { domain_id } = rule;
348
- const { concept } = this.props;
349
+ const { concept, domainOptions } = this.props;
349
350
  const messages = this.generateValidationMessages();
350
- const defaultFilters = _.isEmpty(domain_id)
351
+ const hasDomainSelected = _.flow(
352
+ _.reject((id) => _.isNil(id) || id === ""),
353
+ _.negate(_.isEmpty)
354
+ )([domain_id]);
355
+ const defaultFilters = !hasDomainSelected
351
356
  ? filters
352
357
  : { ...filters, domain_ids: [domain_id] };
353
358
 
@@ -394,7 +399,11 @@ export class RuleForm extends React.Component {
394
399
  >
395
400
  <DomainDropdownSelector
396
401
  name="domain"
397
- scope="manage_quality_rule"
402
+ domainOptions={
403
+ domainOptions
404
+ ? getDomainSelectorOptions({ domains: domainOptions })
405
+ : null
406
+ }
398
407
  hideLabel
399
408
  invalid={!_.isFinite(this.state.domain_id)}
400
409
  onChange={this.handleDomainSelected}
@@ -564,6 +573,7 @@ RuleForm.propTypes = {
564
573
  template: PropTypes.object,
565
574
  match: PropTypes.object,
566
575
  intl: PropTypes.object,
576
+ domainOptions: PropTypes.array,
567
577
  };
568
578
 
569
579
  const mapStateToProps = (state) => ({
@@ -572,6 +582,7 @@ const mapStateToProps = (state) => ({
572
582
  templatesLoaded: !state.templatesLoading && !_.isEmpty(state.templates),
573
583
  template: state.template,
574
584
  applyTemplate: applyTemplate(state.template),
585
+ domainOptions: _.pathOr(null, "conceptRulesActions.domain_ids")(state),
575
586
  });
576
587
 
577
588
  const mapDispatchToProps = { selectDomain };
@@ -178,11 +178,11 @@ exports[`<RuleForm /> matches the latest snapshot for create 1`] = `
178
178
  required={true}
179
179
  >
180
180
  <lazy
181
+ domainOptions={null}
181
182
  hideLabel={true}
182
183
  invalid={true}
183
184
  name="domain"
184
185
  onChange={[Function]}
185
- scope="manage_quality_rule"
186
186
  value={null}
187
187
  />
188
188
  </FieldLabelWrapping>
@@ -412,11 +412,11 @@ exports[`<RuleForm /> matches the latest snapshot for editMode 1`] = `
412
412
  required={true}
413
413
  >
414
414
  <lazy
415
+ domainOptions={null}
415
416
  hideLabel={true}
416
417
  invalid={true}
417
418
  name="domain"
418
419
  onChange={[Function]}
419
- scope="manage_quality_rule"
420
420
  value={null}
421
421
  />
422
422
  </FieldLabelWrapping>
@@ -38,7 +38,7 @@ export const ValueConditions = ({
38
38
  onChange && onChange(modifiedPopulation);
39
39
  };
40
40
 
41
- const onValueChange = (index, value, valueIndex) => {
41
+ const onValueChange = (index, value, modifier, valueIndex) => {
42
42
  const clause = _.nth(index)(population);
43
43
  const value_type = clause?.operator?.value_type;
44
44
  const values = clause?.value || [null, null];