@truedat/df 6.13.5 → 6.13.7

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": "6.13.5",
3
+ "version": "6.13.7",
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": "6.13.5",
91
- "@truedat/core": "6.13.5",
90
+ "@truedat/auth": "6.13.7",
91
+ "@truedat/core": "6.13.7",
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": "8a56d5172d91597712cdeab607983c2b3282eb25"
112
+ "gitHead": "9137d2a416d46886163ac2de4875761d52e6a2e8"
113
113
  }
@@ -4,11 +4,12 @@ import PropTypes from "prop-types";
4
4
  import { Button, Icon, Table, Input } from "semantic-ui-react";
5
5
 
6
6
  export const TableField = ({
7
- field: { name, value = [], values },
8
- onChange
7
+ field: { name, value: fieldValue = [], values },
8
+ onChange,
9
9
  }) => {
10
+ const value = _.defaultTo([])(fieldValue);
10
11
  const table_columns = _.get("table_columns")(values) || [];
11
- const handleAddRow = e => {
12
+ const handleAddRow = (e) => {
12
13
  e && e.preventDefault();
13
14
  onChange(e, {
14
15
  name,
@@ -16,8 +17,8 @@ export const TableField = ({
16
17
  ...value,
17
18
  table_columns.reduce((acc, cur) => {
18
19
  return { ...acc, [cur.name]: "" };
19
- }, [])
20
- ]
20
+ }, []),
21
+ ],
21
22
  });
22
23
  };
23
24
 
@@ -34,14 +35,16 @@ export const TableField = ({
34
35
  const input = { ...currentValue[idx], [data.name]: data.value };
35
36
  onChange(e, {
36
37
  name,
37
- value: currentValue.map((newElem, i) => (i == idx ? input : newElem))
38
+ value: currentValue.map((newElem, i) => (i == idx ? input : newElem)),
38
39
  });
39
40
  };
40
41
 
41
42
  const removeDeletedColumns = (table_columns, content) => {
42
- const columns_name = _.map(column => column.name)(table_columns);
43
- return content.map(row => {
44
- const field_deleted = _.keys(row).filter(x => !columns_name.includes(x));
43
+ const columns_name = _.map((column) => column.name)(table_columns);
44
+ return content.map((row) => {
45
+ const field_deleted = _.keys(row).filter(
46
+ (x) => !columns_name.includes(x)
47
+ );
45
48
  return _.omit(field_deleted)(row);
46
49
  });
47
50
  };
@@ -78,7 +81,7 @@ export const TableField = ({
78
81
  <Icon
79
82
  className="selectable"
80
83
  name="trash alternate outline"
81
- onClick={e => handleRemoveRow(e, i)}
84
+ onClick={(e) => handleRemoveRow(e, i)}
82
85
  />
83
86
  </Table.Cell>
84
87
  </Table.Row>
@@ -104,7 +107,7 @@ export const TableField = ({
104
107
 
105
108
  TableField.propTypes = {
106
109
  field: PropTypes.object,
107
- onChange: PropTypes.func
110
+ onChange: PropTypes.func,
108
111
  };
109
112
 
110
113
  export default TableField;
@@ -103,14 +103,6 @@ export class ValuesListForm extends React.Component {
103
103
  {value.mandatory && <span className="is_required">*</span>}
104
104
  </List.Content>
105
105
  );
106
- } else if (this.props.type == "file_types") {
107
- return (
108
- <List.Content>
109
- {value.value} /{" "}
110
- {value.text !== "" &&
111
- formatMessage({ id: value.text, defaultMessage: value.text })}
112
- </List.Content>
113
- );
114
106
  } else {
115
107
  return (
116
108
  <List.Content>
@@ -205,57 +197,6 @@ export class ValuesListForm extends React.Component {
205
197
  />
206
198
  </Form.Group>
207
199
  )}
208
- {"file_types" === type && (
209
- <Form.Group size="small" widths="equal" inline>
210
- <Form.Input
211
- fluid
212
- error={error}
213
- name="tuple_value"
214
- value={this.state.tuple_value}
215
- placeholder={formatMessage({
216
- id: "template.field.values.add_format",
217
- })}
218
- onChange={this.handleInputChange}
219
- onKeyPress={this.handleSubmit}
220
- />
221
- <Form.Dropdown
222
- name="tuple_text"
223
- fluid
224
- selection
225
- value={this.state.tuple_text}
226
- placeholder={formatMessage({
227
- id: "template.field.values.add_file_config",
228
- })}
229
- options={[
230
- {
231
- text: formatMessage({
232
- id: "template.widget.copy.char.separator.format",
233
- }),
234
- value: "template.widget.copy.char.separator.format",
235
- },
236
- {
237
- text: formatMessage({
238
- id: "template.widget.copy.without.fixed.column",
239
- }),
240
- value: "template.widget.copy.without.fixed.column",
241
- },
242
- {
243
- text: formatMessage({
244
- id: "template.widget.copy.fixed.column",
245
- }),
246
- value: "template.widget.copy.fixed.column",
247
- },
248
- ]}
249
- onChange={this.handleInputChange}
250
- onKeyPress={this.handleSubmit}
251
- />
252
- <Icon
253
- name="add circle"
254
- link
255
- onClick={() => this.handleSubmit({ key: "Enter" })}
256
- />
257
- </Form.Group>
258
- )}
259
200
  {type == "fixed" && (
260
201
  <Form.Input
261
202
  error={error}
@@ -174,12 +174,6 @@ exports[`<FieldForm /> manages handleCardinalityChange 1`] = `
174
174
  "text": "Date Time",
175
175
  "value": "datetime",
176
176
  },
177
- {
178
- "icon": "file alternate outline",
179
- "key": undefined,
180
- "text": "File Structure",
181
- "value": "copy",
182
- },
183
177
  ]
184
178
  }
185
179
  required={true}
@@ -522,12 +516,6 @@ exports[`<FieldForm /> matches the latest snapshot 1`] = `
522
516
  "text": "Date Time",
523
517
  "value": "datetime",
524
518
  },
525
- {
526
- "icon": "file alternate outline",
527
- "key": undefined,
528
- "text": "File Structure",
529
- "value": "copy",
530
- },
531
519
  ]
532
520
  }
533
521
  required={true}
@@ -815,12 +803,6 @@ exports[`<FieldForm /> renders MandatoryConditional 1`] = `
815
803
  "text": "Date Time",
816
804
  "value": "datetime",
817
805
  },
818
- {
819
- "icon": "file alternate outline",
820
- "key": undefined,
821
- "text": "File Structure",
822
- "value": "copy",
823
- },
824
806
  ]
825
807
  }
826
808
  required={true}
@@ -1163,12 +1145,6 @@ exports[`<FieldForm /> renders ValuesField and manages onChange 1`] = `
1163
1145
  "text": "Date Time",
1164
1146
  "value": "datetime",
1165
1147
  },
1166
- {
1167
- "icon": "file alternate outline",
1168
- "key": undefined,
1169
- "text": "File Structure",
1170
- "value": "copy",
1171
- },
1172
1148
  ]
1173
1149
  }
1174
1150
  required={true}
@@ -8,7 +8,6 @@ const valueTypes = [
8
8
  { id: "template.field.values.role_users", value: "role_users" },
9
9
  { id: "template.field.values.role_groups", value: "role_groups" },
10
10
  { id: "template.field.values.table_columns", value: "table_columns" },
11
- { id: "template.field.values.file_types", value: "file_types" },
12
11
  { id: "template.field.values.domain", value: "domain" },
13
12
  { id: "template.field.values.hierarchy", value: "hierarchy" },
14
13
  ];
@@ -32,7 +31,6 @@ const eligibleValues = {
32
31
  table: { table: ["table_columns"] },
33
32
  password: { string: [null] },
34
33
  image: { image: [null] },
35
- copy: { copy: ["file_types"] },
36
34
  };
37
35
 
38
36
  export const getValues = (widget, fieldType) => {
@@ -41,7 +39,7 @@ export const getValues = (widget, fieldType) => {
41
39
  };
42
40
 
43
41
  export const listFormat = (type) =>
44
- ["fixed", "fixed_tuple", "table_columns", "file_types"].includes(type);
42
+ ["fixed", "fixed_tuple", "table_columns"].includes(type);
45
43
 
46
44
  export const defaultValue = (type, fieldType) =>
47
45
  (!type && _.negate(_.includes(fieldType))(["url", "system", "domain"])) ||
@@ -151,12 +151,4 @@ export const WIDGETS = [
151
151
  cardinalities: ["?", "1"],
152
152
  types: ["datetime"],
153
153
  },
154
- {
155
- key: "copy",
156
- value: "copy",
157
- text: "File Structure",
158
- icon: "file alternate outline",
159
- cardinalities: ["?", "1"],
160
- types: ["copy"],
161
- },
162
154
  ];