@truedat/dq 6.8.1 → 6.8.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/dq",
3
- "version": "6.8.1",
3
+ "version": "6.8.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": "6.7.1",
37
+ "@truedat/test": "6.8.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": "6.8.1",
96
- "@truedat/df": "6.8.1",
95
+ "@truedat/core": "6.8.3",
96
+ "@truedat/df": "6.8.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": "974fcd9317b94e2b5b5eafe0281deeeaa58535b7"
121
+ "gitHead": "d3bea8cda996ea5ec5d2a0a75dfeb9a0594269d5"
122
122
  }
@@ -8,14 +8,18 @@ import RuleForm from "./RuleForm";
8
8
 
9
9
  export const EditRule = ({ rule, updateRule }) =>
10
10
  !rule.id ? null : (
11
- <Container as={Segment} text>
11
+ <Container as={Segment} role="form" text>
12
12
  <Header as="h2">
13
13
  <Icon name="cube" />
14
14
  <Header.Content>
15
15
  <FormattedMessage id="quality.actions.edit" />
16
16
  </Header.Content>
17
17
  </Header>
18
- <RuleForm onSubmit={updateRule} rule={rule} editMode />
18
+ <RuleForm
19
+ onSubmit={updateRule}
20
+ rule={{ ...rule, df_content: { ...rule.dynamic_content } }}
21
+ editMode
22
+ />
19
23
  </Container>
20
24
  );
21
25
 
@@ -27,7 +27,7 @@ export const NewBasicRuleImplementation = ({
27
27
  ? ""
28
28
  : ruleImplementationProps.implementation_key,
29
29
  dfName: ruleImplementationProps.df_name,
30
- dfContent: ruleImplementationProps.df_content,
30
+ dfContent: ruleImplementationProps.dynamic_content,
31
31
  result_type: ruleImplementationProps.result_type,
32
32
  minimum: ruleImplementationProps.minimum,
33
33
  goal: ruleImplementationProps.goal,
@@ -338,7 +338,7 @@ export const NewRuleImplementation = ({
338
338
 
339
339
  rawContent: ruleImplementationProps.raw_content,
340
340
  dfName: ruleImplementationProps.df_name,
341
- dfContent: ruleImplementationProps.df_content,
341
+ dfContent: ruleImplementationProps.dynamic_content,
342
342
  result_type: ruleImplementationProps.result_type,
343
343
  minimum: ruleImplementationProps.minimum,
344
344
  goal: ruleImplementationProps.goal,
@@ -22,7 +22,7 @@ export const RemediationForm = ({
22
22
  const { formatMessage } = useIntl();
23
23
  const [dfName, setDfName] = useState(remediation?.df_name);
24
24
  const [isValid, setIsValid] = useState();
25
- const [content, setContent] = useState(remediation?.df_content || {});
25
+ const [content, setContent] = useState(remediation?.dynamic_content || {});
26
26
  const {
27
27
  id,
28
28
  implementation_id: implementationId,
@@ -92,7 +92,7 @@ export const RemediationPlan = ({
92
92
  template={_.find(_.propEq("name", remediation.df_name))(
93
93
  templates
94
94
  )}
95
- content={remediation.df_content}
95
+ content={remediation.dynamic_content}
96
96
  />
97
97
  ) : (
98
98
  <Container className="new-remedation-container" fluid>
@@ -1,5 +1,5 @@
1
1
  import _ from "lodash/fp";
2
- import React from "react";
2
+ import React, { useEffect, useState } from "react";
3
3
  import PropTypes from "prop-types";
4
4
  import { FormattedMessage, injectIntl } from "react-intl";
5
5
  import { connect } from "react-redux";
@@ -10,7 +10,6 @@ import {
10
10
  Button,
11
11
  Form,
12
12
  Radio,
13
- Message,
14
13
  Label,
15
14
  Segment,
16
15
  Popup,
@@ -73,128 +72,111 @@ const filters = {
73
72
  current: [true],
74
73
  status: ["pending_approval", "draft", "rejected", "published"],
75
74
  };
76
- export class RuleForm extends React.Component {
77
- state = {
75
+ export const RuleForm = ({
76
+ concept,
77
+ editMode,
78
+ intl,
79
+ isSubmitting,
80
+ match,
81
+ onSubmit,
82
+ rule: ruleData,
83
+ }) => {
84
+ const [valid, setValid] = useState(false);
85
+ const [domainsLoading, setDomainsLoading] = useState(true);
86
+ const [activeSelection, setActiveSelection] = useState(false);
87
+ const [templateName, setTemplateName] = useState("");
88
+ const [rule, setRule] = useState({
78
89
  active: true,
79
- activeSelection: false,
80
90
  concept: null,
81
91
  domain_id: null,
82
- domainsLoading: true,
92
+ business_concept_id: null,
83
93
  name: "",
84
- description: null,
85
- df_name: "",
94
+ description: {},
86
95
  df_content: {},
87
96
  template: null,
88
- };
97
+ });
89
98
 
90
- componentDidMount() {
91
- const { rule, concept } = this.props;
92
- const description = rule ? _.propOr({}, "description")(rule) : {};
93
- if (rule) {
94
- this.setState({
95
- ...rule,
99
+ useEffect(() => {
100
+ if (ruleData) {
101
+ setRule({
102
+ ...ruleData,
96
103
  concept: {
97
- name: rule?.current_business_concept_version?.name,
98
- business_concept_id: rule.business_concept_id,
104
+ name: ruleData?.current_business_concept_version?.name,
105
+ business_concept_id: ruleData.business_concept_id,
99
106
  },
100
107
  });
108
+ setTemplateName(ruleData.df_name);
101
109
  } else if (!_.isEmpty(concept)) {
102
- this.setState({
110
+ setRule({
111
+ ...rule,
103
112
  business_concept_id: concept?.business_concept_id,
104
113
  domain_id: concept?.domain?.id,
105
114
  concept,
106
115
  });
107
116
  }
117
+ }, [ruleData, concept]);
108
118
 
109
- this.updateDescription(description);
110
- }
119
+ const updateRule = (content) => setRule({ ...rule, ...content });
111
120
 
112
- updateRule = (rule) => {
113
- this.setState({ ...rule });
121
+ const handleContentChange = ({ valid, content }) => {
122
+ setRule({ ...rule, df_content: content });
123
+ setValid(valid);
114
124
  };
115
125
 
116
- handleContentChange = ({ valid, content: df_content }) =>
117
- this.setState({ df_content, valid });
118
-
119
- messagesInformed = (messages) => _.some(_.negate(_.isNil))(messages);
120
-
121
- updateDescription = (description) => {
122
- this.handleEditorChange(null, {
123
- value: description,
124
- });
125
- };
126
+ const messagesInformed = (messages) => _.some(_.negate(_.isNil))(messages);
126
127
 
127
- handleEditorChange = (e, { value }) => {
128
- this.handleChange(null, { name: "description", value });
129
- };
128
+ const updateDescription = (e, { value }) =>
129
+ handleChange(null, { name: "description", value });
130
130
 
131
- handleChange = (e, { name, value }) => {
131
+ const handleChange = (e, { name, value }) => {
132
132
  e && e.preventDefault();
133
- this.updateRule({ [name]: value });
134
- };
135
-
136
- handleChangeCheck = (e, { name, checked }) => {
137
- e.preventDefault();
138
- this.updateRule({ [name]: checked });
133
+ updateRule({ [name]: value });
139
134
  };
140
135
 
141
- handleChangeInteger = (e, { name, value }) => {
136
+ const handleChangeCheck = (e, { checked }) => {
142
137
  e.preventDefault();
143
- const intValue = parseInt(value);
144
- if (Number.isInteger(intValue)) this.updateRule({ [name]: intValue });
145
- else if (!_.isEmpty(value)) return;
146
- else this.updateRule({ [name]: null });
138
+ updateRule({ active: checked });
147
139
  };
148
140
 
149
- handleSubmit = (e) => {
141
+ const handleSubmit = (e) => {
150
142
  e.preventDefault();
151
- if (this.messagesInformed(this.generateValidationMessages())) return;
152
- const { onSubmit, match } = this.props;
153
- const rule = _.omit([
154
- "activeSelection",
155
- "concept",
156
- "domainsLoading",
157
- "template",
158
- "valid",
159
- ])(this.state);
143
+ if (messagesInformed(generateValidationMessages())) return;
144
+ const ruleData = _.omit(["concept", "template"])(rule);
160
145
 
161
146
  onSubmit({
162
- rule,
147
+ rule: { ...ruleData, df_name: templateName },
163
148
  ids: match.params,
164
149
  });
165
150
  };
166
151
 
167
- handleConceptSelected = (concept) => {
168
- this.setState({
152
+ const handleConceptSelected = (concept) => {
153
+ setRule({
154
+ ...rule,
169
155
  concept,
170
156
  business_concept_id: concept?.business_concept_id || null,
171
157
  });
172
- concept && this.handleSelectionClick();
158
+ concept && handleSelectionClick();
173
159
  };
174
160
 
175
- handleDomainSelected = (e, { value }) => {
161
+ const handleDomainSelected = (e, { value }) => {
176
162
  const domain_id = value ? _.toInteger(value) : null;
177
- this.setState(
178
- this.props.editMode
179
- ? { concept: null, business_concept_id: null, domain_id }
180
- : { domain_id }
163
+ setRule(
164
+ editMode
165
+ ? { ...rule, concept: null, business_concept_id: null, domain_id }
166
+ : { ...rule, domain_id }
181
167
  );
182
168
  };
183
169
 
184
- handleSelectionClick = () => {
185
- const { activeSelection } = this.state;
186
- this.setState({ activeSelection: !activeSelection });
170
+ const handleSelectionClick = () => {
171
+ setActiveSelection(!activeSelection);
187
172
  };
188
173
 
189
- handleDomainsLoaded = () => {
190
- this.setState({ domainsLoading: false });
174
+ const handleDomainsLoaded = () => {
175
+ setDomainsLoading(false);
191
176
  };
192
177
 
193
- generateValidationMessages = () => {
194
- const rule = this.state;
195
- const {
196
- intl: { formatMessage },
197
- } = this.props;
178
+ const generateValidationMessages = () => {
179
+ const { formatMessage } = intl;
198
180
  const requiredMessage = formatMessage({
199
181
  id: "rule.form.validation.empty_required",
200
182
  });
@@ -209,152 +191,138 @@ export class RuleForm extends React.Component {
209
191
  };
210
192
  };
211
193
 
212
- render() {
213
- const {
214
- isSubmitting,
215
- intl: { formatMessage },
216
- } = this.props;
217
- const { valid, domainsLoading, ...rule } = this.state;
218
- const domain_id = rule?.domain_id;
219
- const { concept } = this.props;
220
- const messages = this.generateValidationMessages();
221
- const hasDomainSelected = !!domain_id;
222
- const defaultFilters = hasDomainSelected
223
- ? { ...filters, domain_ids: [domain_id] }
224
- : filters;
194
+ const { formatMessage } = intl;
195
+ const domain_id = rule?.domain_id;
196
+ const messages = generateValidationMessages();
197
+ const hasDomainSelected = Boolean(domain_id);
198
+ const defaultFilters = hasDomainSelected
199
+ ? { ...filters, domain_ids: [domain_id] }
200
+ : filters;
225
201
 
226
- return (
227
- <>
228
- <Form
229
- loading={domainsLoading}
230
- onSubmit={this.handleSubmit}
231
- className="rule-form"
202
+ return (
203
+ <>
204
+ <Form
205
+ onSubmit={handleSubmit}
206
+ loading={domainsLoading}
207
+ className="rule-form"
208
+ >
209
+ <Form.Field className="rule-form__field-right">
210
+ <Radio
211
+ name="active"
212
+ label={formatMessage({ id: "rule.props.active" })}
213
+ checked={rule.active}
214
+ toggle
215
+ onChange={handleChangeCheck}
216
+ />
217
+ </Form.Field>
218
+ <FieldLabelWrapping
219
+ label={formatMessage({ id: "rule.props.name" })}
220
+ messages={_.prop("name")(messages)}
221
+ required
232
222
  >
233
- <Form.Field className="rule-form__field-right">
234
- <Radio
235
- name="active"
236
- label={formatMessage({ id: "rule.props.active" })}
237
- checked={rule.active}
238
- toggle
239
- onChange={this.handleChangeCheck}
240
- />
241
- </Form.Field>
242
- <FieldLabelWrapping
243
- label={formatMessage({ id: "rule.props.name" })}
244
- messages={_.prop("name")(messages)}
245
- required
246
- >
247
- <Form.Input
248
- aria-label={formatMessage({ id: "rule.props.name.placeholder" })}
249
- name="name"
250
- onChange={this.handleChange}
251
- value={rule.name}
252
- placeholder={formatMessage({ id: "rule.props.name.placeholder" })}
253
- autoComplete="off"
223
+ <Form.Input
224
+ aria-label={formatMessage({ id: "rule.props.name.placeholder" })}
225
+ name="name"
226
+ onChange={handleChange}
227
+ value={rule.name}
228
+ placeholder={formatMessage({ id: "rule.props.name.placeholder" })}
229
+ autoComplete="off"
230
+ />
231
+ </FieldLabelWrapping>
232
+ <FieldLabelWrapping
233
+ label={formatMessage({ id: "rule.props.description" })}
234
+ messages={_.prop("description")(messages)}
235
+ >
236
+ {rule.description ? (
237
+ <RichTextEditor
238
+ name="description"
239
+ value={rule.description}
240
+ onChange={updateDescription}
254
241
  />
255
- </FieldLabelWrapping>
256
- <FieldLabelWrapping
257
- label={formatMessage({ id: "rule.props.description" })}
258
- messages={_.prop("description")(messages)}
259
- >
260
- {rule.description && (
261
- <RichTextEditor
262
- name="description"
263
- value={rule.description}
264
- onChange={this.handleEditorChange}
265
- />
266
- )}
267
- </FieldLabelWrapping>
268
- <FieldLabelWrapping
269
- label={formatMessage({ id: "domain.selector.label" })}
270
- messages={_.prop("domain")(messages)}
242
+ ) : null}
243
+ </FieldLabelWrapping>
244
+ <FieldLabelWrapping
245
+ label={formatMessage({ id: "domain.selector.label" })}
246
+ messages={_.prop("domain")(messages)}
247
+ required
248
+ >
249
+ <DomainSelector
250
+ action="manageQualityRule"
251
+ labels
252
+ onChange={handleDomainSelected}
253
+ onLoad={handleDomainsLoaded}
271
254
  required
272
- >
273
- <DomainSelector
274
- action="manageQualityRule"
275
- labels
276
- onChange={this.handleDomainSelected}
277
- onLoad={this.handleDomainsLoaded}
278
- required
279
- value={domain_id}
280
- />
281
- </FieldLabelWrapping>
282
- {_.isEmpty(concept) && (
283
- <Segment disabled={_.isNil(domain_id)}>
284
- <Form.Group inline>
285
- <label className="rule-form-label">
286
- <FormattedMessage id="rule.form.concept.label" />
287
- </label>
288
- {_.path("concept.name")(rule) && (
289
- <Label size={"medium"}>
290
- {_.flow(
291
- _.path("concept.name"),
292
- _.truncate({ length: 90 })
293
- )(rule)}
294
- <Icon
295
- name="delete"
296
- onClick={() => this.handleConceptSelected(null)}
297
- />
298
- </Label>
299
- )}
300
- </Form.Group>
301
-
302
- <Accordion>
303
- <Accordion.Title
304
- active={rule.activeSelection && !!domain_id}
305
- onClick={this.handleSelectionClick}
306
- >
307
- <Icon name="dropdown" />
308
- <FormattedMessage id="rule.form.accordion.select" />
309
- </Accordion.Title>
310
- <Accordion.Content active={rule.activeSelection && !!domain_id}>
311
- <ConceptSelector
312
- showTitle={false}
313
- defaultFilters={defaultFilters}
314
- handleConceptSelected={this.handleConceptSelected}
315
- businessConceptId={rule?.concept?.business_concept_id}
255
+ value={domain_id}
256
+ />
257
+ </FieldLabelWrapping>
258
+ {_.isEmpty(concept) ? (
259
+ <Segment disabled={_.isNil(domain_id)}>
260
+ <Form.Group inline>
261
+ <label className="rule-form-label">
262
+ <FormattedMessage id="rule.form.concept.label" />
263
+ </label>
264
+ {_.path("concept.name")(rule) ? (
265
+ <Label size={"medium"}>
266
+ {_.flow(
267
+ _.path("concept.name"),
268
+ _.truncate({ length: 90 })
269
+ )(rule)}
270
+ <Icon
271
+ name="delete"
272
+ onClick={() => handleConceptSelected(null)}
316
273
  />
317
- </Accordion.Content>
318
- </Accordion>
319
- </Segment>
320
- )}
274
+ </Label>
275
+ ) : null}
276
+ </Form.Group>
321
277
 
322
- <SelectableDynamicForm
323
- scope="dq"
324
- domainIds={_.isNil(domain_id) ? null : [domain_id]}
325
- required
326
- content={rule.df_content}
327
- name={rule.df_name}
328
- isModification={this.props.editMode}
329
- onChange={this.handleContentChange}
330
- onNameChange={(df_name) => this.setState({ df_name })}
331
- />
278
+ <Accordion>
279
+ <Accordion.Title
280
+ active={activeSelection && !!domain_id}
281
+ onClick={handleSelectionClick}
282
+ >
283
+ <Icon name="dropdown" />
284
+ <FormattedMessage id="rule.form.accordion.select" />
285
+ </Accordion.Title>
286
+ <Accordion.Content active={activeSelection && !!domain_id}>
287
+ <ConceptSelector
288
+ showTitle={false}
289
+ defaultFilters={defaultFilters}
290
+ handleConceptSelected={handleConceptSelected}
291
+ businessConceptId={rule?.concept?.business_concept_id}
292
+ />
293
+ </Accordion.Content>
294
+ </Accordion>
295
+ </Segment>
296
+ ) : null}
332
297
 
333
- <div className="actions">
334
- <HistoryBackButton
335
- content={formatMessage({ id: "actions.cancel" })}
336
- disabled={isSubmitting}
337
- />
338
- <Button
339
- type="submit"
340
- primary
341
- loading={isSubmitting}
342
- disabled={this.messagesInformed(messages) || !_.isEmpty(valid)}
343
- content={formatMessage({ id: "actions.save" })}
344
- />
345
- </div>
346
- </Form>
347
- {this.state.errors ? (
348
- <Message
349
- error
350
- header={formatMessage({ id: "rule.error.goal.minimum.header" })}
351
- list={[formatMessage({ id: "rule.error.goal.minimum" })]}
298
+ <SelectableDynamicForm
299
+ scope="dq"
300
+ domainIds={_.isNil(domain_id) ? null : [domain_id]}
301
+ required
302
+ content={rule.df_content}
303
+ name={templateName}
304
+ isModification={editMode}
305
+ onChange={handleContentChange}
306
+ onNameChange={(df_name) => setTemplateName(df_name)}
307
+ />
308
+
309
+ <div className="actions">
310
+ <HistoryBackButton
311
+ content={formatMessage({ id: "actions.cancel" })}
312
+ disabled={isSubmitting}
352
313
  />
353
- ) : null}
354
- </>
355
- );
356
- }
357
- }
314
+ <Button
315
+ type="submit"
316
+ primary
317
+ loading={isSubmitting}
318
+ disabled={messagesInformed(messages) || !_.isEmpty(valid)}
319
+ content={formatMessage({ id: "actions.save" })}
320
+ />
321
+ </div>
322
+ </Form>
323
+ </>
324
+ );
325
+ };
358
326
 
359
327
  RuleForm.propTypes = {
360
328
  concept: PropTypes.object,
@@ -61,7 +61,7 @@ export const RuleImplementationProperties = ({
61
61
  <DynamicFormViewer
62
62
  boxLayout
63
63
  template={templateImpl}
64
- content={ruleImplementation.df_content}
64
+ content={ruleImplementation.dynamic_content}
65
65
  />
66
66
  )}
67
67
  </Grid.Column>
@@ -73,7 +73,7 @@ export const RuleRoutes = ({
73
73
  {templatesLoaded && template ? (
74
74
  <DynamicFormViewer
75
75
  template={template}
76
- content={rule.df_content}
76
+ content={rule.dynamic_content}
77
77
  />
78
78
  ) : null}
79
79
  </Segment>
@@ -1,14 +1,70 @@
1
1
  import React from "react";
2
- import { shallow } from "enzyme";
2
+ import { render } from "@truedat/test/render";
3
+ import { screen } from "@testing-library/react";
3
4
  import { EditRule } from "../EditRule";
4
5
 
6
+ jest.mock("@truedat/bg/concepts/hooks/useConcepts", () => {
7
+ const originalModule = jest.requireActual(
8
+ "@truedat/bg/concepts/hooks/useConcepts"
9
+ );
10
+
11
+ return {
12
+ __esModule: true,
13
+ ...originalModule,
14
+ useConceptFilters: () => ({
15
+ trigger: () => ({
16
+ then: (callback) =>
17
+ callback({
18
+ data: { data: {} },
19
+ }),
20
+ }),
21
+ }),
22
+ useConceptVersionsSearch: () => ({
23
+ trigger: () => ({
24
+ then: (callback) =>
25
+ callback({
26
+ data: { data: [] },
27
+ headers: {},
28
+ }),
29
+ }),
30
+ }),
31
+ };
32
+ });
33
+
5
34
  describe("<EditRule />", () => {
6
35
  const updateRule = jest.fn();
7
- const rule = { id: 1, name: "nn", description: "dd" };
36
+ const rule = {
37
+ id: 1,
38
+ name: "nn",
39
+ description: {
40
+ document: {
41
+ data: {},
42
+ nodes: [
43
+ {
44
+ data: {},
45
+ nodes: [
46
+ {
47
+ marks: [],
48
+ object: "text",
49
+ text: "rule description",
50
+ },
51
+ ],
52
+ object: "block",
53
+ type: "paragraph",
54
+ },
55
+ ],
56
+ object: "document",
57
+ },
58
+ object: "value",
59
+ },
60
+ };
8
61
  const props = { rule, updateRule };
9
62
 
10
- it("matches the latest snapshot", () => {
11
- const wrapper = shallow(<EditRule {...props} />);
12
- expect(wrapper).toMatchSnapshot();
63
+ it("matches the latest snapshot", async () => {
64
+ const { findByText } = render(<EditRule {...props} />, {
65
+ fallback: "lazy",
66
+ });
67
+ await findByText("Edit Quality Rule");
68
+ expect(screen.getByRole("form")).toMatchSnapshot();
13
69
  });
14
70
  });
@@ -11,6 +11,7 @@ const renderOpts = { fallback: "lazy", state };
11
11
 
12
12
  describe("<NewRule />", () => {
13
13
  it("matches the latest snapshot (with concept)", async () => {
14
+ // falla el snapshot porque viene sin description y falta algún campo
14
15
  const { container, queryByText } = render(<NewRule />, renderOpts);
15
16
  await waitFor(() => expect(queryByText(/lazy/i)).not.toBeInTheDocument());
16
17
  expect(container).toMatchSnapshot();
@@ -1,33 +1,376 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
3
  exports[`<EditRule /> matches the latest snapshot 1`] = `
4
- <Container
5
- as={[Function]}
6
- text={true}
4
+ <div
5
+ class="ui segment ui text container"
6
+ role="form"
7
+ style=""
7
8
  >
8
- <Header
9
- as="h2"
9
+ <h2
10
+ class="ui header"
10
11
  >
11
- <Icon
12
- as="i"
13
- name="cube"
12
+ <i
13
+ aria-hidden="true"
14
+ class="cube icon"
14
15
  />
15
- <HeaderContent>
16
- <MemoizedFormattedMessage
17
- id="quality.actions.edit"
18
- />
19
- </HeaderContent>
20
- </Header>
21
- <withRouter(injectIntl(Connect(RuleForm)))
22
- editMode={true}
23
- onSubmit={[MockFunction]}
24
- rule={
25
- {
26
- "description": "dd",
27
- "id": 1,
28
- "name": "nn",
29
- }
30
- }
31
- />
32
- </Container>
16
+ <div
17
+ class="content"
18
+ >
19
+ Edit Quality Rule
20
+ </div>
21
+ </h2>
22
+ <form
23
+ class="ui loading form rule-form"
24
+ >
25
+ <div
26
+ class="field rule-form__field-right"
27
+ >
28
+ <div
29
+ class="ui checked toggle checkbox"
30
+ >
31
+ <input
32
+ checked=""
33
+ class="hidden"
34
+ name="active"
35
+ readonly=""
36
+ tabindex="0"
37
+ type="radio"
38
+ value=""
39
+ />
40
+ <label>
41
+ Active
42
+ </label>
43
+ </div>
44
+ </div>
45
+ <div
46
+ class="field"
47
+ >
48
+ <label
49
+ class="rule-form-label"
50
+ >
51
+ Name
52
+ <span>
53
+ *
54
+ </span>
55
+ </label>
56
+ <div
57
+ class="field"
58
+ >
59
+ <div
60
+ class="ui input"
61
+ >
62
+ <input
63
+ aria-label="Rule name"
64
+ autocomplete="off"
65
+ name="name"
66
+ placeholder="Rule name"
67
+ type="text"
68
+ value="nn"
69
+ />
70
+ </div>
71
+ </div>
72
+ </div>
73
+ <div
74
+ class="field"
75
+ >
76
+ <label
77
+ class="rule-form-label"
78
+ >
79
+ Description
80
+ </label>
81
+ <div>
82
+ <div
83
+ style="border: 1px solid rgba(34, 36, 38, 0.15); border-radius: 0.28571429rem;"
84
+ >
85
+ <div
86
+ class="ui menu"
87
+ >
88
+ <a
89
+ class="icon item"
90
+ >
91
+ <i
92
+ aria-hidden="true"
93
+ class="bold icon"
94
+ />
95
+ </a>
96
+ <a
97
+ class="icon item"
98
+ >
99
+ <i
100
+ aria-hidden="true"
101
+ class="italic icon"
102
+ />
103
+ </a>
104
+ <a
105
+ class="icon item"
106
+ >
107
+ <i
108
+ aria-hidden="true"
109
+ class="underline icon"
110
+ />
111
+ </a>
112
+ <a
113
+ class="icon item"
114
+ >
115
+ <i
116
+ aria-hidden="true"
117
+ class="header icon"
118
+ />
119
+ </a>
120
+ <a
121
+ class="icon item"
122
+ >
123
+ <i
124
+ aria-hidden="true"
125
+ class="h icon"
126
+ />
127
+ </a>
128
+ <a
129
+ class="icon item"
130
+ >
131
+ <i
132
+ aria-hidden="true"
133
+ class="list ol icon"
134
+ />
135
+ </a>
136
+ <a
137
+ class="icon item"
138
+ >
139
+ <i
140
+ aria-hidden="true"
141
+ class="list ul icon"
142
+ />
143
+ </a>
144
+ <a
145
+ class="icon item"
146
+ >
147
+ <i
148
+ aria-hidden="true"
149
+ class="linkify icon"
150
+ />
151
+ </a>
152
+ </div>
153
+ <div
154
+ style="padding: 10px;"
155
+ >
156
+ <div
157
+ autocorrect="on"
158
+ contenteditable="true"
159
+ data-gramm="false"
160
+ data-key="7"
161
+ data-slate-editor="true"
162
+ role="textbox"
163
+ spellcheck="true"
164
+ style="outline: none; white-space: pre-wrap; word-wrap: break-word;"
165
+ >
166
+ <div
167
+ data-key="8"
168
+ data-slate-object="block"
169
+ style="position: relative;"
170
+ >
171
+ <span
172
+ data-key="9"
173
+ data-slate-object="text"
174
+ >
175
+ <span
176
+ data-offset-key="9:0"
177
+ data-slate-leaf="true"
178
+ >
179
+ <span
180
+ data-slate-string="true"
181
+ >
182
+ rule description
183
+ </span>
184
+ </span>
185
+ </span>
186
+ </div>
187
+ </div>
188
+ </div>
189
+ </div>
190
+ </div>
191
+ </div>
192
+ <div
193
+ class="field"
194
+ >
195
+ <label
196
+ class="rule-form-label"
197
+ >
198
+ Domain
199
+ <span>
200
+ *
201
+ </span>
202
+ <div
203
+ class="ui left pointing label"
204
+ >
205
+ Required field is empty
206
+ </div>
207
+ </label>
208
+ </div>
209
+ <div
210
+ class="ui disabled segment"
211
+ >
212
+ <div
213
+ class="inline fields"
214
+ >
215
+ <label
216
+ class="rule-form-label"
217
+ >
218
+ Concept
219
+ </label>
220
+ </div>
221
+ <div
222
+ class="accordion ui"
223
+ >
224
+ <div
225
+ class="title"
226
+ >
227
+ <i
228
+ aria-hidden="true"
229
+ class="dropdown icon"
230
+ />
231
+ Select
232
+ </div>
233
+ <div
234
+ class="content"
235
+ >
236
+ <div
237
+ class="ui segment"
238
+ >
239
+ <div
240
+ class="ui action left icon input"
241
+ >
242
+ <i
243
+ aria-hidden="true"
244
+ class="search link icon"
245
+ />
246
+ <input
247
+ placeholder="Searching"
248
+ type="text"
249
+ value=""
250
+ />
251
+ <div
252
+ aria-busy="false"
253
+ aria-disabled="false"
254
+ aria-expanded="false"
255
+ class="ui button floating labeled scrolling dropdown icon"
256
+ role="listbox"
257
+ tabindex="0"
258
+ >
259
+ <div
260
+ aria-atomic="true"
261
+ aria-live="polite"
262
+ class="divider text"
263
+ role="alert"
264
+ >
265
+ Filters
266
+ </div>
267
+ <i
268
+ aria-hidden="true"
269
+ class="filter icon"
270
+ />
271
+ <div
272
+ class="menu transition"
273
+ >
274
+ <div
275
+ class="item"
276
+ role="option"
277
+ >
278
+ <em>
279
+ (reset all filters)
280
+ </em>
281
+ </div>
282
+ </div>
283
+ </div>
284
+ </div>
285
+ <div
286
+ class="selectedFilters"
287
+ />
288
+ <div
289
+ class="ui message"
290
+ >
291
+ <div
292
+ class="content"
293
+ >
294
+ No concepts found
295
+ </div>
296
+ </div>
297
+ </div>
298
+ </div>
299
+ </div>
300
+ </div>
301
+ <div
302
+ class="required field"
303
+ >
304
+ <label>
305
+ Template
306
+ <div
307
+ class="ui left pointing label"
308
+ >
309
+ Empty required field
310
+ </div>
311
+ </label>
312
+ <div
313
+ class="field"
314
+ >
315
+ <div
316
+ aria-busy="true"
317
+ aria-expanded="false"
318
+ class="ui loading search selection dropdown"
319
+ name="template"
320
+ role="combobox"
321
+ >
322
+ <input
323
+ aria-autocomplete="list"
324
+ autocomplete="off"
325
+ class="search"
326
+ tabindex="0"
327
+ type="text"
328
+ value=""
329
+ />
330
+ <div
331
+ aria-atomic="true"
332
+ aria-live="polite"
333
+ class="divider default text"
334
+ role="alert"
335
+ >
336
+ loading...
337
+ </div>
338
+ <i
339
+ aria-hidden="true"
340
+ class="dropdown icon"
341
+ />
342
+ <div
343
+ class="menu transition"
344
+ role="listbox"
345
+ >
346
+ <div
347
+ class="message"
348
+ >
349
+ No results found.
350
+ </div>
351
+ </div>
352
+ </div>
353
+ </div>
354
+ </div>
355
+ <div
356
+ class="actions"
357
+ >
358
+ <a
359
+ class="ui secondary button"
360
+ href="/"
361
+ role="button"
362
+ >
363
+ Cancel
364
+ </a>
365
+ <button
366
+ class="ui primary disabled button"
367
+ disabled=""
368
+ tabindex="-1"
369
+ type="submit"
370
+ >
371
+ Save
372
+ </button>
373
+ </div>
374
+ </form>
375
+ </div>
33
376
  `;
@@ -219,60 +219,6 @@ exports[`<NewRule /> matches the latest snapshot (with concept) 1`] = `
219
219
  </div>
220
220
  </label>
221
221
  </div>
222
- <div
223
- class="required field"
224
- >
225
- <label>
226
- Template
227
- <div
228
- class="ui left pointing label"
229
- >
230
- Empty required field
231
- </div>
232
- </label>
233
- <div
234
- class="field"
235
- >
236
- <div
237
- aria-busy="true"
238
- aria-expanded="false"
239
- class="ui loading search selection dropdown"
240
- name="template"
241
- role="combobox"
242
- >
243
- <input
244
- aria-autocomplete="list"
245
- autocomplete="off"
246
- class="search"
247
- tabindex="0"
248
- type="text"
249
- value=""
250
- />
251
- <div
252
- aria-atomic="true"
253
- aria-live="polite"
254
- class="divider default text"
255
- role="alert"
256
- >
257
- loading...
258
- </div>
259
- <i
260
- aria-hidden="true"
261
- class="dropdown icon"
262
- />
263
- <div
264
- class="menu transition"
265
- role="listbox"
266
- >
267
- <div
268
- class="message"
269
- >
270
- No results found.
271
- </div>
272
- </div>
273
- </div>
274
- </div>
275
- </div>
276
222
  <div
277
223
  class="actions"
278
224
  >
@@ -30,7 +30,7 @@ export default {
30
30
  "dataset.form.button.add_structure": "Add Structure",
31
31
  "datasetForm.implementation_key.tooltip":
32
32
  "Leave empty for autogeneration of implementation key after saving implementation",
33
- "execution": "Execution",
33
+ execution: "Execution",
34
34
  "execution.insertedAt": "Created",
35
35
  "execution.latestEvent.insertedAt": "Latest event",
36
36
  "execution.latestEvent.message": "Message",
@@ -93,7 +93,8 @@ export default {
93
93
  "implementations.search.placeholder": "Search implementations...",
94
94
  "implementations.subheader": "Quality implementations list and details",
95
95
  "implementations.subheader.manage": "Implementation Versions in Progress",
96
- "implementations.subheader.deprecated": "List of deprecated quality implementations",
96
+ "implementations.subheader.deprecated":
97
+ "List of deprecated quality implementations",
97
98
  "implementationsStructures.delete.confirmation.content":
98
99
  "The relation will be deleted. Are you sure?",
99
100
  "implementationsStructures.delete.confirmation.header":
@@ -168,13 +169,13 @@ export default {
168
169
  "quality_result.under_minumum": "Under threshold",
169
170
  "referenceDataset.dropdown.placeholder": "Reference dataset",
170
171
  "referenceDatasetFields.dropdown.placeholder": "Reference dataset fields",
171
- "remediation": "Remediation plan",
172
+ remediation: "Remediation plan",
172
173
  "remediation.actions.create": "Create Remediation Plan",
173
174
  "remediation.actions.delete.confirmation.content":
174
175
  "Remediation plan will be deleted. Are you sure?",
175
176
  "remediation.actions.delete.confirmation.header": "Delete remediation plan",
176
177
  "remediation.actions.edit": "Edit Remediation Plan",
177
- "rule": "Quality Rule",
178
+ rule: "Quality Rule",
178
179
  "rule.date.placeholder": "YYYY-MM-DD",
179
180
  "rule.error.goal.required": "Goal required",
180
181
  "rule.error.minimum.required": "Minimun threshold required",
@@ -271,7 +272,8 @@ export default {
271
272
  "Deprecate implementation",
272
273
  "ruleImplementation.actions.edit": "Edit implementation",
273
274
  "ruleImplementation.actions.move": "Move to another rule",
274
- "ruleImplementation.actions.convert_default": "Edit as default implementation",
275
+ "ruleImplementation.actions.convert_default":
276
+ "Edit as default implementation",
275
277
  "ruleImplementation.actions.convert_raw": "Edit as raw implementation",
276
278
  "ruleImplementation.actions.restore": "Restore Implementation",
277
279
  "ruleImplementation.actions.restore.confirmation.content":
@@ -436,13 +438,15 @@ export default {
436
438
  "ruleImplementation.operator.not_in_list.string_list": "is not in the list",
437
439
  "ruleImplementation.operator.not_references": "is not referenced",
438
440
  "ruleImplementation.operator.not_references.field": "is not referenced",
439
- "ruleImplementation.operator.not_references.reference_dataset_field": "not in Reference dataset",
441
+ "ruleImplementation.operator.not_references.reference_dataset_field":
442
+ "not in Reference dataset",
440
443
  "ruleImplementation.operator.number_of_decimals": "has a number of decimals",
441
444
  "ruleImplementation.operator.number_of_decimals.number":
442
445
  "has a number of decimals",
443
446
  "ruleImplementation.operator.references": "referenced in",
444
447
  "ruleImplementation.operator.references.field": "referenced in field",
445
- "ruleImplementation.operator.references.reference_dataset_field": "in Reference dataset",
448
+ "ruleImplementation.operator.references.reference_dataset_field":
449
+ "in Reference dataset",
446
450
  "ruleImplementation.operator.regex_format": "matches regular expression",
447
451
  "ruleImplementation.operator.regex_format.string":
448
452
  "matches regular expression",
@@ -597,7 +601,7 @@ export default {
597
601
  "Error in {implementation_key} attribute: {key} message: {message}",
598
602
  "ruleImplementations.upload.success.header":
599
603
  "Upload success! Loaded {count_ids} omitted {count_errors}",
600
- "ruleResult": "Rule execution result",
604
+ ruleResult: "Rule execution result",
601
605
  "ruleResult.props.date": "Date",
602
606
  "ruleResult.props.details": "Details",
603
607
  "ruleResult.props.errors": "Errors",
@@ -639,6 +643,7 @@ export default {
639
643
  "Error in {rule_name} attribute: {key} message: {message}",
640
644
  "rules.upload.success.header":
641
645
  "Upload successful! Loaded {count_ids} omitted {count_errors}",
646
+ "search.placeholder": "Searching",
642
647
  "segmentsForm.add.text": "Add Segment",
643
648
  "structureFields.dropdown.label": "Select Field",
644
649
  "structureFields.dropdown.placeholder": "Fields",
@@ -3,7 +3,8 @@ export default {
3
3
  "alert.createExecutionGroup.success.content":
4
4
  "Se ha solicitado la ejecución de {count} implementaciones",
5
5
  "alert.createExecutionGroup.success.header": "Ejecuciones programadas",
6
- "alert.createImplementationConcept.failed.header": "Error al vincular con el concepto",
6
+ "alert.createImplementationConcept.failed.header":
7
+ "Error al vincular con el concepto",
7
8
  "alert.createImplementationStructure.failed.header":
8
9
  "Error al vincular con estructura",
9
10
  "alert.createRule.failed.header": "Error creando regla",
@@ -30,7 +31,7 @@ export default {
30
31
  "dataset.form.button.add_structure": "Añadir Estructura",
31
32
  "datasetForm.implementation_key.tooltip":
32
33
  "En caso de no introducir clave de implementación, se autogenerará al guardar la implementación",
33
- "execution": "Ejecución",
34
+ execution: "Ejecución",
34
35
  "execution.insertedAt": "Creado",
35
36
  "execution.latestEvent.insertedAt": "Evento más reciente",
36
37
  "execution.latestEvent.message": "Detalle",
@@ -172,14 +173,14 @@ export default {
172
173
  "quality_result.under_minumum": "Por debajo del umbral",
173
174
  "referenceDataset.dropdown.placeholder": "Dato de referencia",
174
175
  "referenceDatasetFields.dropdown.placeholder": "Campo de dato de referencia",
175
- "remediation": "Plan de remediación",
176
+ remediation: "Plan de remediación",
176
177
  "remediation.actions.create": "Crear plan de remediación",
177
178
  "remediation.actions.delete.confirmation.content":
178
179
  "Se va a eliminar el plan de remediación. ¿Está seguro?",
179
180
  "remediation.actions.delete.confirmation.header":
180
181
  "Eliminar plan de remediación",
181
182
  "remediation.actions.edit": "Editar plan de remediación",
182
- "rule": "Regla de Calidad",
183
+ rule: "Regla de Calidad",
183
184
  "rule.date.placeholder": "YYYY-MM-DD",
184
185
  "rule.error.goal.required": "Objetivo requerido",
185
186
  "rule.error.minimum.required": "Limite minimo requerido",
@@ -279,7 +280,8 @@ export default {
279
280
  "Archivar Implementación",
280
281
  "ruleImplementation.actions.edit": "Editar implementación",
281
282
  "ruleImplementation.actions.move": "Mover a otra regla",
282
- "ruleImplementation.actions.convert_default": "Editar como implementación normal",
283
+ "ruleImplementation.actions.convert_default":
284
+ "Editar como implementación normal",
283
285
  "ruleImplementation.actions.convert_raw": "Editar como implementación nativa",
284
286
  "ruleImplementation.actions.restore": "Restaurar Implementación",
285
287
  "ruleImplementation.actions.restore.confirmation.content":
@@ -446,12 +448,14 @@ export default {
446
448
  "ruleImplementation.operator.not_in_list.string_list": "no está en la lista",
447
449
  "ruleImplementation.operator.not_references": "no está referenciado en",
448
450
  "ruleImplementation.operator.not_references.field": "no referenciado en",
449
- "ruleImplementation.operator.not_references.reference_dataset_field": "no en Datos de Referencia",
451
+ "ruleImplementation.operator.not_references.reference_dataset_field":
452
+ "no en Datos de Referencia",
450
453
  "ruleImplementation.operator.number_of_decimals": "tiene nº decimales",
451
454
  "ruleImplementation.operator.number_of_decimals.number": "tiene nº decimales",
452
455
  "ruleImplementation.operator.references": "referenciado en",
453
456
  "ruleImplementation.operator.references.field": "referenciado en",
454
- "ruleImplementation.operator.references.reference_dataset_field": "en Datos de Referencia",
457
+ "ruleImplementation.operator.references.reference_dataset_field":
458
+ "en Datos de Referencia",
455
459
  "ruleImplementation.operator.regex_format": "cumple la expresión regular",
456
460
  "ruleImplementation.operator.regex_format.string":
457
461
  "cumple la expresión regular",
@@ -618,7 +622,7 @@ export default {
618
622
  "Error en {implementation_key} atributo: {key} mensaje: {message}",
619
623
  "ruleImplementations.upload.success.header":
620
624
  "¡Fichero subido correctamente! subidos {count_ids} errores {count_errors}",
621
- "ruleResult": "Resultado de ejecución de regla",
625
+ ruleResult: "Resultado de ejecución de regla",
622
626
  "ruleResult.props.date": "Fecha",
623
627
  "ruleResult.props.details": "Detalles",
624
628
  "ruleResult.props.errors": "Errores",
@@ -661,6 +665,7 @@ export default {
661
665
  "Error en {rule_name} atributo: {key} mensaje: {message}",
662
666
  "rules.upload.success.header":
663
667
  "¡Fichero subido correctamente! subidos {count_ids} errores {count_errors}",
668
+ "search.placeholder": "Buscando",
664
669
  "segmentsForm.add.text": "Añadir segmentación",
665
670
  "structureFields.dropdown.label": "Seleccionar Campo",
666
671
  "structureFields.dropdown.placeholder": "Campos",
@@ -10,6 +10,7 @@ const pickFields = _.pick([
10
10
  "deleted_at",
11
11
  "description",
12
12
  "df_content",
13
+ "dynamic_content",
13
14
  "df_name",
14
15
  "domain",
15
16
  "domain_id",
@@ -9,6 +9,7 @@ const pickFields = _.pick([
9
9
  "deleted_at",
10
10
  "df_content",
11
11
  "df_name",
12
+ "dynamic_content",
12
13
  "domain",
13
14
  "domain_id",
14
15
  "event_inserted_at",