@truedat/dq 7.1.5 → 7.1.6

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/dq",
3
- "version": "7.1.5",
3
+ "version": "7.1.6",
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": "7.1.5",
37
+ "@truedat/test": "7.1.6",
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": "7.1.5",
96
- "@truedat/df": "7.1.5",
95
+ "@truedat/core": "7.1.6",
96
+ "@truedat/df": "7.1.6",
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": "70b7033a85426aac68147bffa65c44ad754441bc"
121
+ "gitHead": "0d15ef9da4d597618a5e3543ad2173e3d76f258b"
122
122
  }
@@ -5,7 +5,7 @@ import { connect } from "react-redux";
5
5
  import { Dimmer, Loader, Segment } from "semantic-ui-react";
6
6
  import { useActiveRoute } from "@truedat/core/hooks";
7
7
  import { IMPLEMENTATIONS_PENDING } from "@truedat/core/routes";
8
- import { getExecutionQuery } from "../selectors";
8
+ import { getExecutionQuery, getRuleImplementationColumns } from "../selectors";
9
9
  import RuleImplementationsActions from "./RuleImplementationsActions";
10
10
  import RuleImplementationsLabelResults from "./RuleImplementationsLabelResults";
11
11
  import RuleImplementationsPagination from "./RuleImplementationsPagination";
@@ -27,6 +27,7 @@ export const ImplementationSearchResults = ({
27
27
  role,
28
28
  loading,
29
29
  ruleImplementations,
30
+ columns,
30
31
  }) => {
31
32
  const [executeImplementationsOn, setMode] = useState(
32
33
  _.matches({ filters: { executable: [true] } })(implementationQuery)
@@ -80,9 +81,9 @@ export const ImplementationSearchResults = ({
80
81
  selectedImplementations
81
82
  );
82
83
  };
83
- const withoutColumns = useActiveRoute(IMPLEMENTATIONS_PENDING)
84
- ? []
85
- : ["status"];
84
+ const filteredColumns = useActiveRoute(IMPLEMENTATIONS_PENDING)
85
+ ? columns
86
+ : _.reject(({ name }) => name === "status")(columns);
86
87
 
87
88
  return (
88
89
  <Segment attached="bottom">
@@ -112,7 +113,7 @@ export const ImplementationSearchResults = ({
112
113
  executeImplementationsOn={executeImplementationsOn}
113
114
  isRowChecked={isRowChecked}
114
115
  selectedImplementations={selectedImplementations}
115
- withoutColumns={withoutColumns}
116
+ columns={filteredColumns}
116
117
  />
117
118
  <RuleImplementationsPagination />
118
119
  </Dimmer.Dimmable>
@@ -126,9 +127,11 @@ ImplementationSearchResults.propTypes = {
126
127
  loading: PropTypes.bool,
127
128
  ruleImplementations: PropTypes.array,
128
129
  embedded: PropTypes.bool,
130
+ columns: PropTypes.array,
129
131
  };
130
132
 
131
133
  const mapStateToProps = (state, props) => ({
134
+ columns: getRuleImplementationColumns(state),
132
135
  implementationQuery: getExecutionQuery({
133
136
  ...state,
134
137
  ruleImplementationDefaultFilters: _.propOr({}, "defaultFilters")(props),
@@ -3,10 +3,11 @@ import React from "react";
3
3
  import PropTypes from "prop-types";
4
4
  import { connect } from "react-redux";
5
5
  import { Container } from "semantic-ui-react";
6
+ import { getLinkedImplementationsToRulesColumns } from "../selectors";
6
7
  import RuleImplementationsTable from "./RuleImplementationsTable";
7
8
  import RuleImplementationActions from "./RuleImplementationActions";
8
9
 
9
- export const RuleFormImplementations = ({ rule }) =>
10
+ export const RuleFormImplementations = ({ rule, columns }) =>
10
11
  _.isEmpty(rule) ? null : (
11
12
  <Container fluid>
12
13
  <div className="inline">
@@ -14,14 +15,18 @@ export const RuleFormImplementations = ({ rule }) =>
14
15
  <RuleImplementationActions />
15
16
  </div>
16
17
  </div>
17
- <RuleImplementationsTable withoutColumns={["rule", "business_concept"]} />
18
+ <RuleImplementationsTable columns={columns} />
18
19
  </Container>
19
20
  );
20
21
 
21
- const mapStateToProps = ({ rule }) => ({ rule });
22
+ const mapStateToProps = ({ rule, ...state }) => ({
23
+ rule,
24
+ columns: getLinkedImplementationsToRulesColumns(state),
25
+ });
22
26
 
23
27
  RuleFormImplementations.propTypes = {
24
28
  rule: PropTypes.object,
29
+ columns: PropTypes.array,
25
30
  };
26
31
 
27
32
  export default connect(mapStateToProps)(RuleFormImplementations);
@@ -6,10 +6,6 @@ import { getSortInfo, sortColumn } from "@truedat/core/services/sort";
6
6
  import { Checkbox, Table, Header, Icon } from "semantic-ui-react";
7
7
  import { useIntl } from "react-intl";
8
8
  import { sortImplementations } from "../routines";
9
- import {
10
- getBusinessConceptsLinksToImplementationsColumns,
11
- getRuleImplementationColumns,
12
- } from "../selectors";
13
9
  import RuleImplementationRow from "./RuleImplementationRow";
14
10
 
15
11
  export const RuleImplementationsTable = ({
@@ -23,12 +19,8 @@ export const RuleImplementationsTable = ({
23
19
  ruleImplementations,
24
20
  ruleImplementationsLoading,
25
21
  isRowChecked,
26
- withoutColumns,
27
22
  }) => {
28
23
  const { formatMessage } = useIntl();
29
- const effectiveColumns = _.filter(({ name }) => {
30
- return _.negate(_.includes(name))(withoutColumns);
31
- })(columns);
32
24
  const [sortedColumn, setColumn] = useState(
33
25
  _.prop("column")(getSortInfo(implementationsSort))
34
26
  );
@@ -36,6 +28,10 @@ export const RuleImplementationsTable = ({
36
28
  _.prop("direction")(getSortInfo(implementationsSort))
37
29
  );
38
30
 
31
+ const validColumns = _.reject(
32
+ ({ hideOn }) => _.isFunction(hideOn) && hideOn(ruleImplementations)
33
+ )(columns);
34
+
39
35
  useEffect(() => {
40
36
  const { column: sortedColumn, direction: direction } =
41
37
  getSortInfo(implementationsSort);
@@ -46,62 +42,66 @@ export const RuleImplementationsTable = ({
46
42
  return (
47
43
  <>
48
44
  {!_.isEmpty(ruleImplementations) ? (
49
- <Table sortable>
50
- <Table.Header>
51
- <Table.Row>
52
- {executeImplementationsOn ? (
53
- <Table.HeaderCell textAlign="center">
54
- <Checkbox
55
- id="selectImplementation"
56
- onChange={addAll}
57
- checked={checkedAll}
58
- />
59
- </Table.HeaderCell>
60
- ) : null}
61
- {effectiveColumns
62
- ? effectiveColumns.map((column, key) => (
63
- <Table.HeaderCell
64
- key={key}
65
- width={column.width}
66
- content={formatMessage({
67
- id: `ruleImplementations.props.${
68
- column.header || column.name
69
- }`,
70
- })}
71
- sorted={
72
- _.path("sort.name")(column) === sortedColumn
73
- ? direction
74
- : null
75
- }
76
- className={_.path("sort.name")(column) ? "" : "disabled"}
77
- onClick={() =>
78
- sortColumn(
79
- column,
80
- sortImplementations,
81
- setDirection,
82
- setColumn,
83
- direction,
84
- sortedColumn
85
- )
86
- }
45
+ <div className="implementations-table-overflow">
46
+ <Table sortable>
47
+ <Table.Header>
48
+ <Table.Row>
49
+ {executeImplementationsOn ? (
50
+ <Table.HeaderCell textAlign="center">
51
+ <Checkbox
52
+ id="selectImplementation"
53
+ onChange={addAll}
54
+ checked={checkedAll}
87
55
  />
88
- ))
89
- : null}
90
- </Table.Row>
91
- </Table.Header>
92
- <Table.Body>
93
- {ruleImplementations.map((r, i) => (
94
- <RuleImplementationRow
95
- key={i}
96
- checked={isRowChecked && isRowChecked(r)}
97
- ruleImplementation={r}
98
- columns={effectiveColumns}
99
- onChange={() => checkRow && checkRow(r)}
100
- withCheck={executeImplementationsOn}
101
- />
102
- ))}
103
- </Table.Body>
104
- </Table>
56
+ </Table.HeaderCell>
57
+ ) : null}
58
+ {validColumns
59
+ ? validColumns.map((column, key) => (
60
+ <Table.HeaderCell
61
+ key={key}
62
+ width={column.width}
63
+ content={formatMessage({
64
+ id: `ruleImplementations.props.${
65
+ column.header || column.name
66
+ }`,
67
+ })}
68
+ sorted={
69
+ _.path("sort.name")(column) === sortedColumn
70
+ ? direction
71
+ : null
72
+ }
73
+ className={
74
+ _.path("sort.name")(column) ? "" : "disabled"
75
+ }
76
+ onClick={() =>
77
+ sortColumn(
78
+ column,
79
+ sortImplementations,
80
+ setDirection,
81
+ setColumn,
82
+ direction,
83
+ sortedColumn
84
+ )
85
+ }
86
+ />
87
+ ))
88
+ : null}
89
+ </Table.Row>
90
+ </Table.Header>
91
+ <Table.Body>
92
+ {ruleImplementations.map((r, i) => (
93
+ <RuleImplementationRow
94
+ key={i}
95
+ checked={isRowChecked && isRowChecked(r)}
96
+ ruleImplementation={r}
97
+ columns={validColumns}
98
+ onChange={() => checkRow && checkRow(r)}
99
+ withCheck={executeImplementationsOn}
100
+ />
101
+ ))}
102
+ </Table.Body>
103
+ </Table>
104
+ </div>
105
105
  ) : null}
106
106
  {_.isEmpty(ruleImplementations) && !ruleImplementationsLoading ? (
107
107
  <Header as="h4">
@@ -126,18 +126,11 @@ RuleImplementationsTable.propTypes = {
126
126
  sortImplementations: PropTypes.func,
127
127
  ruleImplementations: PropTypes.array,
128
128
  columns: PropTypes.array,
129
- withoutColumns: PropTypes.array,
129
+ implementationContext: PropTypes.string,
130
130
  };
131
131
 
132
132
  const mapStateToProps = (state, props) => ({
133
- columns: _.some("business_concept_id")(
134
- props.ruleImplementations || state.ruleImplementations
135
- )
136
- ? getBusinessConceptsLinksToImplementationsColumns(state)
137
- : getRuleImplementationColumns(state),
138
- ruleImplementations: _.orderBy(["business_concept_id", "implementation_key"])(
139
- ["desc", "asc"]
140
- )(props.ruleImplementations || state.ruleImplementations),
133
+ ruleImplementations: props.ruleImplementations || state.ruleImplementations,
141
134
  ruleImplementationsLoading: state.ruleImplementationsLoading,
142
135
  implementationsSort: _.path("ruleImplementationQuery.sort")(state),
143
136
  });
@@ -31,7 +31,6 @@ exports[`<ImplementationSearchResults /> matches the latest snapshot 1`] = `
31
31
  executeImplementationsOn={false}
32
32
  isRowChecked={[Function]}
33
33
  selectedImplementations={[]}
34
- withoutColumns={[]}
35
34
  />
36
35
  <Connect(Pagination) />
37
36
  </DimmerDimmable>
@@ -78,7 +77,6 @@ exports[`<ImplementationSearchResults /> renders executions on when executionEna
78
77
  executeImplementationsOn={true}
79
78
  isRowChecked={[Function]}
80
79
  selectedImplementations={[]}
81
- withoutColumns={[]}
82
80
  />
83
81
  <Connect(Pagination) />
84
82
  </DimmerDimmable>
@@ -13,13 +13,6 @@ exports[`<RuleFormImplementations /> matches the latest snapshot 1`] = `
13
13
  <Connect(RuleImplementationActions) />
14
14
  </div>
15
15
  </div>
16
- <Connect(RuleImplementationsTable)
17
- withoutColumns={
18
- [
19
- "rule",
20
- "business_concept",
21
- ]
22
- }
23
- />
16
+ <Connect(RuleImplementationsTable) />
24
17
  </Container>
25
18
  `;
@@ -2,114 +2,118 @@
2
2
 
3
3
  exports[`<RuleImplementationsTable /> matches the latest snapshot 1`] = `
4
4
  <Fragment>
5
- <Table
6
- as="table"
7
- sortable={true}
5
+ <div
6
+ className="implementations-table-overflow"
8
7
  >
9
- <TableHeader
10
- as="thead"
8
+ <Table
9
+ as="table"
10
+ sortable={true}
11
11
  >
12
- <TableRow
13
- as="tr"
14
- cellAs="td"
12
+ <TableHeader
13
+ as="thead"
15
14
  >
16
- <TableHeaderCell
17
- as="th"
18
- className=""
19
- content="ruleImplementations.props.rule"
20
- key="0"
21
- onClick={[Function]}
22
- sorted="descending"
23
- />
24
- <TableHeaderCell
25
- as="th"
26
- className=""
27
- content="ruleImplementations.props.result"
28
- key="1"
29
- onClick={[Function]}
30
- sorted={null}
31
- />
32
- </TableRow>
33
- </TableHeader>
34
- <TableBody
35
- as="tbody"
36
- >
37
- <RuleImplementationRow
38
- columns={
39
- [
40
- {
41
- "name": "rule",
42
- "sort": {
43
- "name": "name.raw",
15
+ <TableRow
16
+ as="tr"
17
+ cellAs="td"
18
+ >
19
+ <TableHeaderCell
20
+ as="th"
21
+ className=""
22
+ content="ruleImplementations.props.rule"
23
+ key="0"
24
+ onClick={[Function]}
25
+ sorted="descending"
26
+ />
27
+ <TableHeaderCell
28
+ as="th"
29
+ className=""
30
+ content="ruleImplementations.props.result"
31
+ key="1"
32
+ onClick={[Function]}
33
+ sorted={null}
34
+ />
35
+ </TableRow>
36
+ </TableHeader>
37
+ <TableBody
38
+ as="tbody"
39
+ >
40
+ <RuleImplementationRow
41
+ columns={
42
+ [
43
+ {
44
+ "name": "rule",
45
+ "sort": {
46
+ "name": "name.raw",
47
+ },
44
48
  },
45
- },
46
- {
47
- "name": "result",
48
- "sort": {
49
- "name": "bar.raw",
49
+ {
50
+ "name": "result",
51
+ "sort": {
52
+ "name": "bar.raw",
53
+ },
50
54
  },
51
- },
52
- ]
53
- }
54
- key="0"
55
- onChange={[Function]}
56
- ruleImplementation={
57
- {
58
- "id": 1,
55
+ ]
59
56
  }
60
- }
61
- />
62
- <RuleImplementationRow
63
- columns={
64
- [
57
+ key="0"
58
+ onChange={[Function]}
59
+ ruleImplementation={
65
60
  {
66
- "name": "rule",
67
- "sort": {
68
- "name": "name.raw",
61
+ "id": 1,
62
+ }
63
+ }
64
+ />
65
+ <RuleImplementationRow
66
+ columns={
67
+ [
68
+ {
69
+ "name": "rule",
70
+ "sort": {
71
+ "name": "name.raw",
72
+ },
69
73
  },
70
- },
71
- {
72
- "name": "result",
73
- "sort": {
74
- "name": "bar.raw",
74
+ {
75
+ "name": "result",
76
+ "sort": {
77
+ "name": "bar.raw",
78
+ },
75
79
  },
76
- },
77
- ]
78
- }
79
- key="1"
80
- onChange={[Function]}
81
- ruleImplementation={
82
- {
83
- "id": 2,
80
+ ]
84
81
  }
85
- }
86
- />
87
- <RuleImplementationRow
88
- columns={
89
- [
82
+ key="1"
83
+ onChange={[Function]}
84
+ ruleImplementation={
90
85
  {
91
- "name": "rule",
92
- "sort": {
93
- "name": "name.raw",
86
+ "id": 2,
87
+ }
88
+ }
89
+ />
90
+ <RuleImplementationRow
91
+ columns={
92
+ [
93
+ {
94
+ "name": "rule",
95
+ "sort": {
96
+ "name": "name.raw",
97
+ },
94
98
  },
95
- },
96
- {
97
- "name": "result",
98
- "sort": {
99
- "name": "bar.raw",
99
+ {
100
+ "name": "result",
101
+ "sort": {
102
+ "name": "bar.raw",
103
+ },
100
104
  },
101
- },
102
- ]
103
- }
104
- key="2"
105
- onChange={[Function]}
106
- ruleImplementation={
107
- {
108
- "id": 3,
105
+ ]
106
+ }
107
+ key="2"
108
+ onChange={[Function]}
109
+ ruleImplementation={
110
+ {
111
+ "id": 3,
112
+ }
109
113
  }
110
- }
111
- />
112
- </TableBody>
113
- </Table>
114
+ />
115
+ </TableBody>
116
+ </Table>
117
+ </div>
114
118
  </Fragment>
115
119
  `;
@@ -11,6 +11,7 @@ const pickFields = _.pick([
11
11
  "concepts",
12
12
  "execution_result_info",
13
13
  "id",
14
+ "df_content",
14
15
  "implementation_key",
15
16
  "implementation_type",
16
17
  "system",
@@ -0,0 +1,20 @@
1
+ import {
2
+ getLinkedImplementationsToRulesColumns,
3
+ defaultImplementationToRulesColumns,
4
+ } from "..";
5
+
6
+ describe("selectors: getLinkedImplementationsToRulesColumns", () => {
7
+ it("should return custom ruleColumns when present", () => {
8
+ const ruleImplementationToRulesColumns = [{ name: "test" }];
9
+ const res = getLinkedImplementationsToRulesColumns({
10
+ ruleImplementationToRulesColumns,
11
+ });
12
+ expect(res).toHaveLength(1);
13
+ expect(res).toEqual(ruleImplementationToRulesColumns);
14
+ });
15
+
16
+ it("should return default defaultImplementationToRulesColumns when no customized", () => {
17
+ const res = getLinkedImplementationsToRulesColumns({});
18
+ expect(res).toHaveLength(defaultImplementationToRulesColumns.length);
19
+ });
20
+ });
@@ -4,9 +4,7 @@ import { createSelector } from "reselect";
4
4
  import { FormattedMessage } from "react-intl";
5
5
  import DateTime from "@truedat/core/components/DateTime";
6
6
  import { formatNumber } from "@truedat/core/services/format";
7
- import ArrayDecorator from "@truedat/core/components/ArrayDecorator";
8
- import { linkTo } from "@truedat/core/routes";
9
- import { Link } from "react-router-dom";
7
+ import { ConceptsLinkDecorator } from "@truedat/bg/components";
10
8
  import RuleResultDecorator from "../components/RuleResultDecorator";
11
9
  import RuleImplementationLink from "../components/RuleImplementationLink";
12
10
  import RuleLink from "../components/RuleLink";
@@ -19,23 +17,19 @@ const resultTypeDecorator = (result, result_type, resultType) =>
19
17
  ? formatNumber(result)
20
18
  : `${result}%`;
21
19
 
22
- export const defaultBusinessConceptsLinksToImplementationsColumns = [
20
+ export const defaultImplementationToRulesColumns = [
23
21
  {
24
22
  name: "implementation_key",
25
23
  fieldSelector: _.pick(["id", "implementation_key", "rule_id"]),
26
24
  fieldDecorator: RuleImplementationLink,
27
- width: 2,
28
- },
29
- {
30
- name: "rule",
31
- fieldSelector: ({ rule, rule_id: id }) => ({ id, name: rule?.name }),
32
- fieldDecorator: RuleLink,
25
+ sort: { name: "implementation_key.raw" },
33
26
  width: 2,
34
27
  },
35
28
  {
36
29
  name: "status",
37
30
  fieldSelector: ({ status }) =>
38
31
  translateDecorator(`ruleImplementation.status.${status}`),
32
+ sort: { name: "status" },
39
33
  width: 2,
40
34
  },
41
35
  {
@@ -44,6 +38,7 @@ export const defaultBusinessConceptsLinksToImplementationsColumns = [
44
38
  value: execution_result_info?.date,
45
39
  }),
46
40
  fieldDecorator: DateTime,
41
+ sort: { name: "execution_result_info.date" },
47
42
  width: 2,
48
43
  },
49
44
  {
@@ -52,6 +47,7 @@ export const defaultBusinessConceptsLinksToImplementationsColumns = [
52
47
  _.isNil(value)
53
48
  ? null
54
49
  : translateDecorator(`ruleImplementations.props.result_type.${value}`),
50
+ sort: { name: "result_type.raw" },
55
51
  width: 2,
56
52
  },
57
53
  {
@@ -59,6 +55,7 @@ export const defaultBusinessConceptsLinksToImplementationsColumns = [
59
55
  fieldSelector: _.pick(["minimum", "result_type"]),
60
56
  fieldDecorator: (field) =>
61
57
  resultTypeDecorator(field.minimum, field.result_type),
58
+ sort: { name: "minimum" },
62
59
  textAlign: "right",
63
60
  width: 1,
64
61
  },
@@ -67,6 +64,7 @@ export const defaultBusinessConceptsLinksToImplementationsColumns = [
67
64
  fieldSelector: _.pick(["goal", "result_type"]),
68
65
  fieldDecorator: (field) =>
69
66
  resultTypeDecorator(field.goal, field.result_type),
67
+ sort: { name: "goal" },
70
68
  textAlign: "right",
71
69
  width: 1,
72
70
  },
@@ -78,8 +76,10 @@ export const defaultBusinessConceptsLinksToImplementationsColumns = [
78
76
  }),
79
77
  fieldDecorator: RuleResultDecorator,
80
78
  textAlign: "center",
79
+ sort: { name: "execution_result_info.result.sort" },
81
80
  width: 2,
82
81
  },
82
+
83
83
  {
84
84
  name: "inserted_at",
85
85
  fieldSelector: ({ inserted_at }) => ({ value: inserted_at }),
@@ -90,27 +90,11 @@ export const defaultBusinessConceptsLinksToImplementationsColumns = [
90
90
  fieldSelector: ({ updated_at }) => ({ value: updated_at }),
91
91
  fieldDecorator: DateTime,
92
92
  },
93
- {
94
- name: "related_by",
95
- fieldSelector: _.pick(["business_concept_id", "business_concept_name"]),
96
- fieldDecorator: ({ business_concept_id, business_concept_name }) => {
97
- return _.isEmpty(business_concept_id) ? (
98
- <></>
99
- ) : (
100
- <Link
101
- to={linkTo.CONCEPT_VERSION({
102
- business_concept_id: business_concept_id,
103
- id: "current",
104
- })}
105
- >
106
- {business_concept_name}
107
- </Link>
108
- );
109
- },
110
- },
111
93
  ];
112
94
 
113
- export const getBusinessConceptsLinksToImplementationsColumns = createSelector(
114
- _.prop("businessConceptsLinksToImplementationsColumns"),
115
- _.defaultTo(defaultBusinessConceptsLinksToImplementationsColumns)
95
+ const getColumns = (state) => state.ruleImplementationToRulesColumns;
96
+
97
+ export const getLinkedImplementationsToRulesColumns = createSelector(
98
+ [getColumns],
99
+ (columns) => _.defaultTo(defaultImplementationToRulesColumns)(columns)
116
100
  );
@@ -4,7 +4,7 @@ import { createSelector } from "reselect";
4
4
  import { FormattedMessage } from "react-intl";
5
5
  import DateTime from "@truedat/core/components/DateTime";
6
6
  import { formatNumber } from "@truedat/core/services/format";
7
- import ArrayDecorator from "@truedat/core/components/ArrayDecorator";
7
+ import { ConceptsLinkDecorator } from "@truedat/bg/components";
8
8
  import RuleResultDecorator from "../components/RuleResultDecorator";
9
9
  import RuleImplementationLink from "../components/RuleImplementationLink";
10
10
  import RuleLink from "../components/RuleLink";
@@ -42,8 +42,7 @@ export const defaultImplementationColumns = [
42
42
  {
43
43
  name: "business_concepts",
44
44
  fieldSelector: _.path("concepts"),
45
- fieldDecorator: ArrayDecorator(1, ", "),
46
- sort: { name: "concepts.raw" },
45
+ fieldDecorator: ConceptsLinkDecorator,
47
46
  width: 2,
48
47
  },
49
48
  {
@@ -97,11 +96,13 @@ export const defaultImplementationColumns = [
97
96
  name: "inserted_at",
98
97
  fieldSelector: ({ inserted_at }) => ({ value: inserted_at }),
99
98
  fieldDecorator: DateTime,
99
+ sort: { name: "inserted_at" },
100
100
  },
101
101
  {
102
102
  name: "updated_at",
103
103
  fieldSelector: ({ updated_at }) => ({ value: updated_at }),
104
104
  fieldDecorator: DateTime,
105
+ sort: { name: "updated_at" },
105
106
  },
106
107
  ];
107
108
 
@@ -109,5 +110,5 @@ const getColumns = (state) => state.ruleImplementationColumns;
109
110
 
110
111
  export const getRuleImplementationColumns = createSelector(
111
112
  [getColumns],
112
- (columns) => _.defaultTo(defaultImplementationColumns)(columns)
113
+ _.defaultTo(defaultImplementationColumns)
113
114
  );
@@ -23,14 +23,14 @@ export {
23
23
  dynamicDecorator,
24
24
  } from "./ruleColumnsSelector";
25
25
  export { getExecutionQuery } from "./getExecutionQuery";
26
+ export {
27
+ getLinkedImplementationsToRulesColumns,
28
+ defaultImplementationToRulesColumns,
29
+ } from "./getLinkedImplementationsToRulesColumns";
26
30
  export {
27
31
  getRuleImplementationColumns,
28
32
  defaultImplementationColumns,
29
33
  } from "./getRuleImplementationColumns";
30
- export {
31
- getBusinessConceptsLinksToImplementationsColumns,
32
- defaultBusinessConceptsLinksToImplementationsColumns,
33
- } from "./getBusinessConceptsLinksToImplementationsColumns";
34
34
  export { getPreviousRuleImplementationQuery } from "./getPreviousRuleImplementationQuery";
35
35
  export { getRuleImplementationAvailableFilters } from "./getRuleImplementationAvailableFilters";
36
36
  export { getRuleImplementationFilterTypes } from "./getRuleImplementationFilterTypes";
@@ -1,23 +0,0 @@
1
- import {
2
- getBusinessConceptsLinksToImplementationsColumns,
3
- defaultBusinessConceptsLinksToImplementationsColumns,
4
- } from "..";
5
-
6
- describe("selectors: getBusinessConceptsLinksToImplementationsColumns", () => {
7
- it("should return custom businessConceptsLinksToImplementationsColumns when present", () => {
8
- const businessConceptsLinksToImplementationsColumns = [{ name: "test" }];
9
- const res = getBusinessConceptsLinksToImplementationsColumns({
10
- businessConceptsLinksToImplementationsColumns,
11
- });
12
- expect(res).toHaveLength(1);
13
- expect(res).toEqual(businessConceptsLinksToImplementationsColumns);
14
- });
15
-
16
- it("should return default getBusinessConceptsLinksToImplementationsColumns when no customized", () => {
17
- const res = getBusinessConceptsLinksToImplementationsColumns({});
18
-
19
- expect(res).toHaveLength(
20
- defaultBusinessConceptsLinksToImplementationsColumns.length
21
- );
22
- });
23
- });