@truedat/core 8.12.7 → 8.12.9

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": "8.12.7",
3
+ "version": "8.12.9",
4
4
  "description": "Truedat Web Core",
5
5
  "sideEffects": [
6
6
  "**/*.css",
@@ -57,7 +57,7 @@
57
57
  "@testing-library/jest-dom": "^6.6.3",
58
58
  "@testing-library/react": "^16.3.0",
59
59
  "@testing-library/user-event": "^14.6.1",
60
- "@truedat/test": "8.12.7",
60
+ "@truedat/test": "8.12.8",
61
61
  "identity-obj-proxy": "^3.0.0",
62
62
  "jest": "^29.7.0",
63
63
  "redux-saga-test-plan": "^4.0.6"
@@ -71,7 +71,7 @@
71
71
  "@tiptap/react": "3.31.3",
72
72
  "@tiptap/starter-kit": "3.31.3",
73
73
  "@xyflow/react": "^12.6.4",
74
- "axios": "^1.15.0",
74
+ "axios": "^1.20.0",
75
75
  "dompurify": "^3.4.11",
76
76
  "elkjs": "^0.10.0",
77
77
  "graphql": "^16.11.0",
@@ -99,5 +99,5 @@
99
99
  "swr": "^2.3.3",
100
100
  "turndown": "^7.2.2"
101
101
  },
102
- "gitHead": "dae06fd2f915163d5f1e7e3f26c414c8ee9bf055"
102
+ "gitHead": "daeb646a9077620db07b6a385b705fe8b8dd62ed"
103
103
  }
@@ -41,7 +41,7 @@ const DEFAULT_NODE_HEIGHT = 44;
41
41
  const TRANSLATE_EXTENT_MIN_PADDING = 8000;
42
42
  const TRANSLATE_EXTENT_SIZE_MULTIPLIER = 4;
43
43
  const DEFAULT_GRAPH_HEIGHT = "640px";
44
- const EXPANDED_GRAPH_HEIGHT = "82vh";
44
+ const EXPANDED_GRAPH_HEIGHT = "100%";
45
45
  const DEFAULT_MIN_ZOOM = 0.03;
46
46
  const DEFAULT_MAX_ZOOM = 2;
47
47
  const FIT_VIEW_PADDING = 0.15;
@@ -1607,7 +1607,7 @@ const LayoutFlow = ({
1607
1607
  <GraphControlTooltip
1608
1608
  content={formatMessage({
1609
1609
  id: "graph.controls.return_normal",
1610
- defaultMessage: "Volver a vista normal",
1610
+ defaultMessage: "Return to normal view",
1611
1611
  })}
1612
1612
  >
1613
1613
  <ControlButton
@@ -1615,7 +1615,7 @@ const LayoutFlow = ({
1615
1615
  onClick={onCloseExpanded}
1616
1616
  aria-label={formatMessage({
1617
1617
  id: "graph.controls.return_normal",
1618
- defaultMessage: "Volver a vista normal",
1618
+ defaultMessage: "Return to normal view",
1619
1619
  })}
1620
1620
  >
1621
1621
  <Minimize2 size={20} strokeWidth={2} />
@@ -1817,9 +1817,16 @@ export const Graph = ({
1817
1817
  graphOptions,
1818
1818
  }) => {
1819
1819
  const [expandedOpen, setExpandedOpen] = useState(false);
1820
-
1821
- const openExpanded = useCallback(() => setExpandedOpen(true), []);
1822
- const closeExpanded = useCallback(() => setExpandedOpen(false), []);
1820
+ const expandedTriggerRef = useRef(null);
1821
+ const { formatMessage } = useIntl();
1822
+ const openExpanded = useCallback((event) => {
1823
+ expandedTriggerRef.current = event.currentTarget;
1824
+ setExpandedOpen(true);
1825
+ }, []);
1826
+ const closeExpanded = useCallback(() => {
1827
+ setExpandedOpen(false);
1828
+ expandedTriggerRef.current?.focus();
1829
+ }, []);
1823
1830
 
1824
1831
  return (
1825
1832
  <>
@@ -1843,7 +1850,6 @@ export const Graph = ({
1843
1850
  <Modal
1844
1851
  open={expandedOpen}
1845
1852
  onClose={closeExpanded}
1846
- closeIcon
1847
1853
  size="fullscreen"
1848
1854
  closeOnDimmerClick
1849
1855
  closeOnEscape
@@ -1866,6 +1872,17 @@ export const Graph = ({
1866
1872
  className={canvasClassName}
1867
1873
  graphOptions={graphOptions}
1868
1874
  />
1875
+ <button
1876
+ className="td-graph-expanded-return"
1877
+ onClick={closeExpanded}
1878
+ type="button"
1879
+ >
1880
+ <Minimize2 size={20} strokeWidth={2} aria-hidden="true" />
1881
+ {formatMessage({
1882
+ id: "graph.controls.return_normal",
1883
+ defaultMessage: "Return to normal view",
1884
+ })}
1885
+ </button>
1869
1886
  </Modal.Content>
1870
1887
  </Modal>
1871
1888
  ) : null}
@@ -1,7 +1,7 @@
1
1
  import _ from "lodash/fp";
2
2
  import { useState } from "react";
3
3
  import { FormattedMessage, useIntl } from "react-intl";
4
- import { Label } from "semantic-ui-react";
4
+ import Label from "semantic-ui-react/dist/commonjs/elements/Label";
5
5
  import RuleImplementationLink from "@truedat/dq/components/RuleImplementationLink";
6
6
  import StructureNoteLink from "@truedat/dd/components/StructureNoteLink";
7
7
 
@@ -153,6 +153,27 @@ describe("<Graph />", () => {
153
153
  });
154
154
  });
155
155
 
156
+ it.each([0, 1])(
157
+ "returns from expanded view using exit %s and restores focus",
158
+ async (index) => {
159
+ render(<Graph {...props} />);
160
+ const trigger = screen.getByLabelText("graph.controls.open_expanded");
161
+ fireEvent.click(trigger);
162
+ const buttons = await screen.findAllByRole("button", {
163
+ name: "Return to normal view",
164
+ });
165
+ expect(buttons).toHaveLength(2);
166
+ expect(document.querySelector(".td-graph-modal > .close")).toBeNull();
167
+ fireEvent.click(buttons[index]);
168
+ await waitFor(() =>
169
+ expect(
170
+ screen.queryByRole("button", { name: "Return to normal view" }),
171
+ ).not.toBeInTheDocument(),
172
+ );
173
+ expect(trigger).toHaveFocus();
174
+ },
175
+ );
176
+
156
177
  it("uses horizontal controls by default and keeps vertical controls in fullscreen", async () => {
157
178
  render(
158
179
  <Graph {...props} graphOptions={{ controlsOrientation: "vertical" }} />,
@@ -1,7 +1,10 @@
1
1
  import userEvent from "@testing-library/user-event";
2
- import { render } from "@truedat/test/render";
2
+ import { renderWithIntl as render } from "@truedat/test/renderWithIntl";
3
3
  import { StatusPill, ResponseCell } from "../UploadJobParser";
4
4
 
5
+ jest.mock("@truedat/dq/components/RuleImplementationLink", () => () => null);
6
+ jest.mock("@truedat/dd/components/StructureNoteLink", () => () => null);
7
+
5
8
  describe("<StatusPill />", () => {
6
9
  it("renders with correct color based on status", async () => {
7
10
  const statuses = ["COMPLETED", "FAILED", "ERROR", "INFO", "OTHER"];
@@ -6,11 +6,6 @@ import {
6
6
  useSearchContext,
7
7
  } from "@truedat/core/search/SearchContext";
8
8
 
9
- jest.mock("react-router", () => ({
10
- ...jest.requireActual("react-router"),
11
- useLocation: jest.fn(),
12
- }));
13
-
14
9
  const useFilters = () => ({
15
10
  trigger: () => ({
16
11
  then: (callback) =>
@@ -152,10 +147,6 @@ describe("<SearchContextProvider />", () => {
152
147
  };
153
148
 
154
149
  it(`matches the latest snapshot`, async () => {
155
- jest
156
- .spyOn(require("react-router"), "useLocation")
157
- .mockReturnValue({ pathname: "/concepts" });
158
-
159
150
  const { container, findByText } = render(
160
151
  <SearchContextProvider {...searchProps} defaultFilters={{}}>
161
152
  <ChildComponent />
@@ -23,3 +23,63 @@
23
23
  }
24
24
  }
25
25
  }
26
+
27
+ .ui.dimmer > .ui.fullscreen.modal.td-graph-modal--expanded {
28
+ position: fixed;
29
+ inset: 0 !important;
30
+ width: 100% !important;
31
+ max-width: none;
32
+ height: 100dvh;
33
+ margin: 0 !important;
34
+ padding: 0;
35
+ border: 0;
36
+ border-radius: 0;
37
+
38
+ > .content {
39
+ position: relative;
40
+ height: 100%;
41
+ padding: 0 !important;
42
+ border-radius: 0;
43
+ overflow: hidden;
44
+ }
45
+
46
+ .td-graph-container {
47
+ height: 100%;
48
+ }
49
+ }
50
+
51
+ .td-graph-expanded-return {
52
+ position: absolute;
53
+ bottom: max(20px, env(safe-area-inset-bottom));
54
+ left: 50%;
55
+ z-index: 500;
56
+ display: inline-flex;
57
+ align-items: center;
58
+ justify-content: center;
59
+ gap: 8px;
60
+ width: max-content;
61
+ max-width: calc(100% - 32px);
62
+ min-height: 44px;
63
+ padding: 10px 20px;
64
+ transform: translateX(-50%);
65
+ border: 1px solid #d7dde6;
66
+ border-radius: 999px;
67
+ background: #fff;
68
+ color: #334155;
69
+ box-shadow: 0 4px 16px rgba(15, 23, 42, 0.13);
70
+ font: inherit;
71
+ cursor: pointer;
72
+
73
+ &:hover {
74
+ background: #f1f5f9;
75
+ }
76
+
77
+ &:focus-visible {
78
+ outline: 2px solid var(--td-graph-accent, #ed5c17);
79
+ outline-offset: 2px;
80
+ }
81
+
82
+ svg {
83
+ flex-shrink: 0;
84
+ }
85
+ }