@truedat/core 4.45.1 → 4.45.8

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/core",
3
- "version": "4.45.1",
3
+ "version": "4.45.8",
4
4
  "description": "Truedat Web Core",
5
5
  "sideEffects": false,
6
6
  "jsnext:main": "src/index.js",
@@ -35,7 +35,7 @@
35
35
  "@testing-library/jest-dom": "^5.16.4",
36
36
  "@testing-library/react": "^12.0.0",
37
37
  "@testing-library/user-event": "^13.2.1",
38
- "@truedat/test": "4.45.1",
38
+ "@truedat/test": "4.45.8",
39
39
  "babel-jest": "^28.1.0",
40
40
  "babel-plugin-dynamic-import-node": "^2.3.3",
41
41
  "babel-plugin-lodash": "^3.3.4",
@@ -112,5 +112,5 @@
112
112
  "react-dom": ">= 16.8.6 < 17",
113
113
  "semantic-ui-react": ">= 0.88.2 < 2.1"
114
114
  },
115
- "gitHead": "c13f37ee357bf4a5e8c8c99eb6bd0c798f468c49"
115
+ "gitHead": "1b5acb1dc1233181e5a47353fd8a5da1424e7a47"
116
116
  }
@@ -7,6 +7,7 @@ export const FiltersLoader = ({
7
7
  fetchFilters,
8
8
  clearSort,
9
9
  selectedFilter,
10
+ defaultFilters = {},
10
11
  filters,
11
12
  }) => {
12
13
  useEffect(() => {
@@ -16,7 +17,14 @@ export const FiltersLoader = ({
16
17
  };
17
18
  }, [clearFilters, clearSort]);
18
19
  useEffect(() => {
19
- fetchFilters({ filters: _.omit([selectedFilter])(filters) });
20
+ const mergedFilters = _.has(selectedFilter)(defaultFilters)
21
+ ? {
22
+ ...defaultFilters,
23
+ ...filters,
24
+ ..._.pick([selectedFilter])(defaultFilters),
25
+ }
26
+ : _.omit([selectedFilter])({ ...defaultFilters, ...filters });
27
+ fetchFilters({ filters: mergedFilters });
20
28
  }, [fetchFilters, filters, selectedFilter]);
21
29
  return null;
22
30
  };
@@ -0,0 +1,42 @@
1
+ import React from "react";
2
+ import PropTypes from "prop-types";
3
+ import { useIntl } from "react-intl";
4
+ import { Menu } from "semantic-ui-react";
5
+ import ConfirmModal from "./ConfirmModal";
6
+
7
+ export const OptionModal = ({
8
+ contentMessage,
9
+ headerMessage,
10
+ iconName,
11
+ iconColor,
12
+ option,
13
+ onConfirm,
14
+ }) => {
15
+ const { formatMessage } = useIntl();
16
+ return (
17
+ <ConfirmModal
18
+ trigger={
19
+ <Menu.Item
20
+ icon={{ name: iconName, color: iconColor }}
21
+ content={formatMessage({ id: option })}
22
+ />
23
+ }
24
+ header={formatMessage({ id: headerMessage })}
25
+ content={formatMessage({ id: contentMessage })}
26
+ onConfirm={onConfirm}
27
+ onOpen={(e) => e.stopPropagation()}
28
+ onClose={(e) => e.stopPropagation()}
29
+ />
30
+ );
31
+ };
32
+
33
+ OptionModal.propTypes = {
34
+ contentMessage: PropTypes.string,
35
+ headerMessage: PropTypes.string,
36
+ iconColor: PropTypes.string,
37
+ iconName: PropTypes.string,
38
+ option: PropTypes.string,
39
+ onConfirm: PropTypes.func,
40
+ };
41
+
42
+ export default OptionModal;
@@ -3,13 +3,19 @@ import React from "react";
3
3
  import PropTypes from "prop-types";
4
4
  import { connect } from "react-redux";
5
5
  import { useAuthorized } from "../hooks";
6
- import { RULES, QUALITY_DASHBOARD, IMPLEMENTATIONS } from "../routes";
6
+ import {
7
+ RULES,
8
+ QUALITY_DASHBOARD,
9
+ IMPLEMENTATIONS,
10
+ IMPLEMENTATIONS_PENDING,
11
+ } from "../routes";
7
12
  import { getQualityDashboardConfig } from "../selectors";
8
13
  import Submenu from "./Submenu";
9
14
 
10
15
  export const ITEMS = [
11
16
  { name: "rules", routes: [RULES] },
12
17
  { name: "implementations", routes: [IMPLEMENTATIONS] },
18
+ { name: "implementations_management", routes: [IMPLEMENTATIONS_PENDING] },
13
19
  { name: "quality_dashboard", routes: [QUALITY_DASHBOARD] },
14
20
  ];
15
21
 
@@ -19,7 +19,7 @@ export const UserFilters = ({
19
19
  {userFilters.map((userFilter, i) => (
20
20
  <Label
21
21
  basic={selectedUserFilter == userFilter.name ? false : true}
22
- circular={true}
22
+ circular
23
23
  key={`label${userFilter.id}.${i}`}
24
24
  >
25
25
  <span
@@ -57,6 +57,19 @@ exports[`<QualityMenu /> matches the latest snapshot 1`] = `
57
57
  Implementations
58
58
  </span>
59
59
  </a>
60
+ <a
61
+ aria-checked="true"
62
+ class="active item"
63
+ href="/pendingImplementations"
64
+ name="implementations_management"
65
+ role="option"
66
+ >
67
+ <span
68
+ class="text"
69
+ >
70
+ Drafts
71
+ </span>
72
+ </a>
60
73
  </div>
61
74
  </div>
62
75
  </div>
@@ -24,6 +24,7 @@ import IngestMenu from "./IngestMenu";
24
24
  import LineageMenu from "./LineageMenu";
25
25
  import Loading from "./Loading";
26
26
  import OptionGroup from "./OptionGroup";
27
+ import OptionModal from "./OptionModal";
27
28
  import Pagination from "./Pagination";
28
29
  import QualityMenu from "./QualityMenu";
29
30
  import Redirector from "./Redirector";
@@ -69,6 +70,7 @@ export {
69
70
  LineageMenu,
70
71
  Loading,
71
72
  OptionGroup,
73
+ OptionModal,
72
74
  Pagination,
73
75
  QualityMenu,
74
76
  Redirector,
@@ -8,8 +8,11 @@ export default {
8
8
  "actions.edit": "Edit",
9
9
  "actions.next": "Next",
10
10
  "actions.prev": "Previous",
11
+ "actions.publish": "Publish",
12
+ "actions.reject": "Reject",
11
13
  "actions.save": "Save",
12
14
  "actions.share": "Share",
15
+ "actions.submit": "Send for approval",
13
16
  "actions.update": "Update",
14
17
  "alert.createComment.failed.header": "Error creating comment",
15
18
  "alert.fetchComments.failed.header": "Error fetching comments list",
@@ -45,6 +48,7 @@ export default {
45
48
  filters: "Filters",
46
49
  "filters.class.raw.field": "Field",
47
50
  "filters.reset": "(reset all filters)",
51
+ "filters.status": "Status",
48
52
  loading: "loading...",
49
53
  "form.validation.required": "{prop} is required",
50
54
  "form.validation.minLength": "{prop} must have at least {value} characters",
@@ -83,6 +87,7 @@ export default {
83
87
  "sidemenu.grants": "Grants",
84
88
  "sidemenu.hide": "Collapse sidebar",
85
89
  "sidemenu.implementations": "Implementations",
90
+ "sidemenu.implementations_management": "Drafts",
86
91
  "sidemenu.ingests": "Data Requests",
87
92
  "sidemenu.jobs": "Jobs",
88
93
  "sidemenu.lineage_events": "My graphs",
@@ -8,8 +8,11 @@ export default {
8
8
  "actions.edit": "Editar",
9
9
  "actions.next": "Siguiente",
10
10
  "actions.prev": "Anterior",
11
+ "actions.publish": "Publicar",
12
+ "actions.reject": "Rechazar",
11
13
  "actions.save": "Guardar",
12
14
  "actions.share": "Compartir",
15
+ "actions.submit": "Solicitar aprobación",
13
16
  "actions.update": "Actualizar",
14
17
  "alert.createComment.failed.header": "Error creando comentario",
15
18
  "alert.fetchComments.failed.header": "Error cargando la lista de comentarios",
@@ -46,6 +49,7 @@ export default {
46
49
  filters: "Filtros",
47
50
  "filters.class.raw.field": "Field",
48
51
  "filters.reset": "(sin filtros)",
52
+ "filters.status": "Estado",
49
53
  "form.validation.required": "{prop} es un campo requerido",
50
54
  "form.validation.minLength": "{prop} debe tener al menos {value} elementos",
51
55
  "form.validation.email.invalid": "Dirección de email inválida",
@@ -86,6 +90,7 @@ export default {
86
90
  "sidemenu.grants": "Accesos",
87
91
  "sidemenu.hide": "Ocultar",
88
92
  "sidemenu.implementations": "Implementaciones",
93
+ "sidemenu.implementations_management": "Borradores",
89
94
  "sidemenu.ingests": "Peticiones de datos",
90
95
  "sidemenu.jobs": "Jobs",
91
96
  "sidemenu.lineage_events": "Mis grafos",
package/src/routes.js CHANGED
@@ -54,6 +54,7 @@ export const GROUPS = "/groups";
54
54
  export const GROUP_CREATE = "/groups/new";
55
55
  export const GROUP_EDIT = "/groups/:id/edit";
56
56
  export const IMPLEMENTATIONS = "/implementations";
57
+ export const IMPLEMENTATIONS_PENDING = "/pendingImplementations";
57
58
  export const IMPLEMENTATION_CONCEPT_LINKS =
58
59
  "/implementations/:implementation_id/links/concepts";
59
60
  export const IMPLEMENTATION_CONCEPT_LINKS_NEW =
@@ -235,6 +236,7 @@ const routes = {
235
236
  GROUP_EDIT,
236
237
  IMPLEMENTATION,
237
238
  IMPLEMENTATIONS,
239
+ IMPLEMENTATIONS_PENDING,
238
240
  IMPLEMENTATION_CLONE,
239
241
  IMPLEMENTATION_CONCEPT_LINKS,
240
242
  IMPLEMENTATION_CONCEPT_LINKS_NEW,
@@ -10,12 +10,12 @@ describe("selectors: makeActiveFiltersSelector", () => {
10
10
  });
11
11
 
12
12
  it("should return a selector that merges defaultFilters with conceptActiveFilters if defaultFilters prop exists", () => {
13
- const defaultFilters = { foo: "baz" };
13
+ const defaultFilters = { status: ["pending"] };
14
14
  const conceptActiveFilters = { foo: "bar" };
15
15
  const state = { conceptActiveFilters };
16
16
  const props = { defaultFilters };
17
17
  expect(
18
18
  makeActiveFiltersSelector("conceptActiveFilters")(state, props)
19
- ).toEqual({ foo: "bar" });
19
+ ).toEqual({ foo: "bar", status: ["pending"] });
20
20
  });
21
21
  });