@databiosphere/findable-ui 30.0.0 → 32.0.0
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/.release-please-manifest.json +1 -1
- package/CHANGELOG.md +24 -0
- package/lib/common/entities.d.ts +8 -26
- package/lib/components/DataDictionary/components/Entities/entities.d.ts +3 -1
- package/lib/components/DataDictionary/components/Entities/entities.js +1 -1
- package/lib/components/DataDictionary/components/Entities/types.d.ts +5 -5
- package/lib/components/DataDictionary/components/Entity/entity.d.ts +3 -1
- package/lib/components/DataDictionary/components/Entity/entity.js +6 -6
- package/lib/components/DataDictionary/components/Entity/types.d.ts +5 -5
- package/lib/components/DataDictionary/components/Layout/components/EntitiesLayout/entitiesLayout.styles.d.ts +1 -1
- package/lib/components/DataDictionary/components/Layout/components/OutlineLayout/outlineLayout.styles.d.ts +2 -2
- package/lib/components/DataDictionary/components/Layout/components/TitleLayout/titleLayout.styles.d.ts +1 -1
- package/lib/components/DataDictionary/components/Outline/utils.d.ts +3 -2
- package/lib/components/DataDictionary/components/Table/components/BasicCell/basicCell.d.ts +2 -2
- package/lib/components/DataDictionary/components/Table/hook.d.ts +3 -3
- package/lib/components/DataDictionary/components/Table/hook.js +3 -1
- package/lib/components/DataDictionary/components/Table/options/core/constants.d.ts +2 -3
- package/lib/components/DataDictionary/components/Table/options/hook.d.ts +2 -2
- package/lib/components/DataDictionary/components/Table/options/sorting/constants.d.ts +2 -3
- package/lib/components/DataDictionary/components/Table/table.d.ts +2 -1
- package/lib/components/DataDictionary/components/Table/table.js +1 -1
- package/lib/components/DataDictionary/components/Table/types.d.ts +3 -4
- package/lib/components/DataDictionary/dataDictionary.d.ts +3 -1
- package/lib/components/DataDictionary/dataDictionary.styles.d.ts +1 -1
- package/lib/components/DataDictionary/hooks/UseDataDictionary/hook.d.ts +3 -1
- package/lib/components/DataDictionary/hooks/UseDataDictionary/types.d.ts +5 -5
- package/lib/components/Error/error.styles.d.ts +1 -1
- package/lib/components/Export/components/ExportToTerra/components/TerraSetUpForm/components/FormStep/formStep.styles.d.ts +1 -1
- package/lib/components/Export/components/ExportToTerra/components/TerraSetUpForm/terraSetUpForm.styles.d.ts +4 -4
- package/lib/components/Export/components/ManifestDownload/components/ManifestDownloadEntity/manifestDownloadEntity.styles.d.ts +1 -1
- package/lib/components/Filter/components/FilterRange/filterRange.styles.d.ts +1 -1
- package/lib/components/Filter/components/Filters/filters.styles.d.ts +2 -2
- package/lib/components/Filter/components/VariableSizeList/VariableSizeList.d.ts +1 -1
- package/lib/components/Filter/components/VariableSizeList/VariableSizeList.js +1 -1
- package/lib/components/Index/components/EntitiesView/components/ChartView/chartView.styles.d.ts +1 -1
- package/lib/components/Index/index.styles.d.ts +1 -1
- package/lib/components/Layout/components/ContentLayout/contentLayout.styles.d.ts +1 -1
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/AuthenticationMenu/authenticationMenu.styles.d.ts +1 -1
- package/lib/components/Layout/components/Header/components/Content/components/Navigation/navigation.styles.d.ts +1 -1
- package/lib/components/Layout/components/Main/main.styles.d.ts +2 -2
- package/lib/components/Layout/components/Sidebar/components/SidebarPositioner/sidebarPositioner.styles.d.ts +1 -1
- package/lib/components/Login/components/Section/components/Consent/consent.styles.d.ts +1 -1
- package/lib/components/MarkdownRenderer/components/Anchor/anchor.d.ts +19 -0
- package/lib/components/MarkdownRenderer/components/Anchor/anchor.js +21 -0
- package/lib/components/MarkdownRenderer/components/Table/table.d.ts +3 -0
- package/lib/components/MarkdownRenderer/components/Table/table.js +5 -0
- package/lib/components/MarkdownRenderer/components/Table/table.styles.d.ts +4 -0
- package/lib/components/MarkdownRenderer/components/Table/table.styles.js +40 -0
- package/lib/components/MarkdownRenderer/constants.d.ts +2 -0
- package/lib/components/MarkdownRenderer/constants.js +6 -0
- package/lib/components/MarkdownRenderer/markdownRenderer.d.ts +14 -0
- package/lib/components/MarkdownRenderer/markdownRenderer.js +56 -0
- package/lib/components/MarkdownRenderer/markdownRenderer.styles.d.ts +4 -0
- package/lib/components/MarkdownRenderer/markdownRenderer.styles.js +13 -0
- package/lib/components/MarkdownRenderer/types.d.ts +7 -0
- package/lib/components/MarkdownRenderer/types.js +1 -0
- package/lib/components/Stepper/components/Step/components/StepIcon/components/CompletedIcon/completedIcon.styles.d.ts +1 -1
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/label.styles.d.ts +1 -1
- package/lib/components/Support/components/ViewSupport/viewSupport.styles.d.ts +1 -1
- package/lib/components/Table/components/TableCell/components/ChipCell/chipCell.d.ts +2 -1
- package/lib/components/Table/components/TableCell/components/ChipCell/chipCell.js +2 -2
- package/lib/components/Table/components/TableCell/components/LinkCell/linkCell.d.ts +1 -1
- package/lib/components/Table/components/TableCell/components/LinkCell/linkCell.js +2 -2
- package/lib/components/Table/components/TableCell/components/MarkdownCell/markdownCell.d.ts +4 -0
- package/lib/components/Table/components/TableCell/components/MarkdownCell/markdownCell.js +13 -0
- package/lib/components/Table/components/TableCell/components/MarkdownCell/markdownCell.styles.d.ts +3 -0
- package/lib/components/Table/components/TableCell/components/MarkdownCell/markdownCell.styles.js +30 -0
- package/lib/components/Table/components/TableCell/components/MarkdownCell/stories/args.d.ts +4 -0
- package/lib/components/Table/components/TableCell/components/MarkdownCell/stories/args.js +10 -0
- package/lib/components/Table/components/TableCell/components/MarkdownCell/stories/constants.d.ts +5 -0
- package/lib/components/Table/components/TableCell/components/MarkdownCell/stories/constants.js +9 -0
- package/lib/components/Table/components/TableCell/components/MarkdownCell/stories/markdownCell.stories.d.ts +7 -0
- package/lib/components/Table/components/TableCell/components/MarkdownCell/stories/markdownCell.stories.js +25 -0
- package/lib/components/Table/components/TableCell/components/MarkdownCell/stories/types.d.ts +3 -0
- package/lib/components/Table/components/TableCell/components/MarkdownCell/stories/types.js +1 -0
- package/lib/components/Table/components/TableCell/components/MarkdownCell/types.d.ts +3 -0
- package/lib/components/Table/components/TableCell/components/MarkdownCell/types.js +1 -0
- package/lib/components/common/AnchorLink/anchorLink.styles.d.ts +7 -7
- package/lib/components/common/Card/components/CardSecondaryTitle/cardSecondaryTitle.styles.d.ts +1 -1
- package/lib/components/common/Code/code.styles.d.ts +1 -1
- package/lib/components/common/Dot/dot.styles.d.ts +1 -1
- package/lib/components/common/EllipsisContent/ellipsisContent.styles.d.ts +1 -1
- package/lib/components/common/Progress/components/CircularProgress/circularProgress.d.ts +1 -1
- package/lib/components/common/Progress/components/CircularProgress/circularProgress.js +1 -1
- package/lib/components/common/Stack/stack.d.ts +1 -1
- package/lib/components/common/Stack/stack.js +1 -1
- package/lib/components/common/ToggleButtonGroup/hooks/UseToggleButtonGroup/hook.d.ts +1 -1
- package/lib/styles/common/mui/typography.js +1 -0
- package/package.json +8 -1
- package/src/common/entities.ts +8 -31
- package/src/components/DataDictionary/components/Entities/entities.tsx +7 -5
- package/src/components/DataDictionary/components/Entities/types.ts +5 -9
- package/src/components/DataDictionary/components/Entity/entity.tsx +9 -7
- package/src/components/DataDictionary/components/Entity/types.ts +5 -9
- package/src/components/DataDictionary/components/Outline/utils.ts +5 -2
- package/src/components/DataDictionary/components/Table/hook.ts +16 -8
- package/src/components/DataDictionary/components/Table/options/core/constants.ts +2 -3
- package/src/components/DataDictionary/components/Table/options/hook.ts +3 -3
- package/src/components/DataDictionary/components/Table/options/sorting/constants.ts +2 -6
- package/src/components/DataDictionary/components/Table/table.tsx +4 -1
- package/src/components/DataDictionary/components/Table/types.ts +3 -4
- package/src/components/DataDictionary/dataDictionary.tsx +4 -2
- package/src/components/DataDictionary/hooks/UseDataDictionary/hook.ts +9 -2
- package/src/components/DataDictionary/hooks/UseDataDictionary/types.ts +5 -9
- package/src/components/Filter/components/VariableSizeList/VariableSizeList.tsx +1 -1
- package/src/components/MarkdownRenderer/components/Anchor/anchor.tsx +34 -0
- package/src/components/MarkdownRenderer/components/Table/table.styles.ts +41 -0
- package/src/components/MarkdownRenderer/components/Table/table.tsx +13 -0
- package/src/components/MarkdownRenderer/constants.ts +8 -0
- package/src/components/MarkdownRenderer/markdownRenderer.styles.ts +16 -0
- package/src/components/MarkdownRenderer/markdownRenderer.tsx +74 -0
- package/src/components/MarkdownRenderer/types.ts +10 -0
- package/src/components/Table/components/TableCell/components/ChipCell/chipCell.tsx +4 -2
- package/src/components/Table/components/TableCell/components/LinkCell/linkCell.tsx +1 -1
- package/src/components/Table/components/TableCell/components/MarkdownCell/markdownCell.styles.ts +31 -0
- package/src/components/Table/components/TableCell/components/MarkdownCell/markdownCell.tsx +29 -0
- package/src/components/Table/components/TableCell/components/MarkdownCell/stories/args.ts +17 -0
- package/src/components/Table/components/TableCell/components/MarkdownCell/stories/constants.ts +11 -0
- package/src/components/Table/components/TableCell/components/MarkdownCell/stories/markdownCell.stories.tsx +37 -0
- package/src/components/Table/components/TableCell/components/MarkdownCell/stories/types.ts +4 -0
- package/src/components/Table/components/TableCell/components/MarkdownCell/types.ts +3 -0
- package/src/components/common/Progress/components/CircularProgress/circularProgress.tsx +1 -1
- package/src/components/common/Stack/stack.tsx +2 -2
- package/src/styles/common/mui/typography.ts +1 -0
- package/tests/markdownCell.test.tsx +53 -0
- package/tests/useRequestManifest.test.ts +1 -1
- package/types/data-explorer-ui.d.ts +2 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Box } from "@mui/material";
|
|
2
|
+
import { Meta, StoryObj } from "@storybook/react";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { PALETTE } from "../../../../../../../styles/common/constants/palette";
|
|
5
|
+
import { MarkdownCell } from "../markdownCell";
|
|
6
|
+
import { DEFAULT_ARGS, WITH_HTML_ARGS } from "./args";
|
|
7
|
+
|
|
8
|
+
const meta: Meta<typeof MarkdownCell> = {
|
|
9
|
+
component: MarkdownCell,
|
|
10
|
+
decorators: [
|
|
11
|
+
(Story): JSX.Element => (
|
|
12
|
+
<Box
|
|
13
|
+
sx={{
|
|
14
|
+
backgroundColor: PALETTE.COMMON_WHITE,
|
|
15
|
+
fontSize: "14px",
|
|
16
|
+
lineHeight: "20px",
|
|
17
|
+
padding: 3,
|
|
18
|
+
width: 480,
|
|
19
|
+
}}
|
|
20
|
+
>
|
|
21
|
+
<Story />
|
|
22
|
+
</Box>
|
|
23
|
+
),
|
|
24
|
+
],
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export default meta;
|
|
28
|
+
|
|
29
|
+
type Story = StoryObj<typeof meta>;
|
|
30
|
+
|
|
31
|
+
export const Default: Story = {
|
|
32
|
+
args: DEFAULT_ARGS,
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const WithHtml: Story = {
|
|
36
|
+
args: WITH_HTML_ARGS,
|
|
37
|
+
};
|
|
@@ -13,8 +13,8 @@ export interface CircularProgressProps extends MCircularProgressProps {
|
|
|
13
13
|
|
|
14
14
|
export const CircularProgress = ({
|
|
15
15
|
className,
|
|
16
|
-
value,
|
|
17
16
|
Track = CircularProgressTrack,
|
|
17
|
+
value,
|
|
18
18
|
...props /* Spread props to allow for CircularProgress specific props e.g. "disableShrink". */
|
|
19
19
|
}: CircularProgressProps): JSX.Element => {
|
|
20
20
|
return (
|
|
@@ -19,13 +19,13 @@ export interface StackProps {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
export const Stack = ({
|
|
22
|
+
alignItems,
|
|
22
23
|
children,
|
|
23
24
|
className,
|
|
24
25
|
direction = "column",
|
|
25
26
|
divider = undefined,
|
|
26
|
-
justifyContent,
|
|
27
|
-
alignItems,
|
|
28
27
|
gap = 0,
|
|
28
|
+
justifyContent,
|
|
29
29
|
spacing = 0,
|
|
30
30
|
}: StackProps): JSX.Element => {
|
|
31
31
|
return (
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { matchers } from "@emotion/jest";
|
|
2
|
+
import { composeStories } from "@storybook/react";
|
|
3
|
+
import { Column } from "@tanstack/react-table";
|
|
4
|
+
import "@testing-library/jest-dom";
|
|
5
|
+
import { render, screen } from "@testing-library/react";
|
|
6
|
+
import React from "react";
|
|
7
|
+
import {
|
|
8
|
+
ANCHOR_TARGET,
|
|
9
|
+
REL_ATTRIBUTE,
|
|
10
|
+
} from "../src/components/Links/common/entities";
|
|
11
|
+
import { STYLED_ANCHOR } from "../src/components/Table/components/TableCell/components/MarkdownCell/stories/constants";
|
|
12
|
+
import * as stories from "../src/components/Table/components/TableCell/components/MarkdownCell/stories/markdownCell.stories";
|
|
13
|
+
import { MarkdownCellProps } from "../src/components/Table/components/TableCell/components/MarkdownCell/types";
|
|
14
|
+
|
|
15
|
+
expect.extend(matchers);
|
|
16
|
+
|
|
17
|
+
const { Default, WithHtml } = composeStories(stories);
|
|
18
|
+
|
|
19
|
+
describe("MarkdownCell", () => {
|
|
20
|
+
it("renders the markdown content", async () => {
|
|
21
|
+
render(<Default />);
|
|
22
|
+
expect(await screen.findByText("UBERON:0000955")).toBeInTheDocument();
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it("renders HTML and anchor elements", async () => {
|
|
26
|
+
render(<WithHtml />);
|
|
27
|
+
const anchorEl = await screen.findByText("example link");
|
|
28
|
+
expect(anchorEl).toBeInTheDocument();
|
|
29
|
+
expect(anchorEl.getAttribute("href")).toBe("https://www.example.com");
|
|
30
|
+
expect(anchorEl.getAttribute("target")).toBe(ANCHOR_TARGET.BLANK);
|
|
31
|
+
expect(anchorEl.getAttribute("rel")).toBe(
|
|
32
|
+
REL_ATTRIBUTE.NO_OPENER_NO_REFERRER
|
|
33
|
+
);
|
|
34
|
+
expect(anchorEl).toHaveClass("MuiLink-root");
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it("applies the correct className and component", async () => {
|
|
38
|
+
render(
|
|
39
|
+
<WithHtml
|
|
40
|
+
className="css-pygqsj"
|
|
41
|
+
column={
|
|
42
|
+
{
|
|
43
|
+
columnDef: { meta: { components: { a: STYLED_ANCHOR } } },
|
|
44
|
+
} as unknown as Column<unknown, MarkdownCellProps>
|
|
45
|
+
}
|
|
46
|
+
/>
|
|
47
|
+
);
|
|
48
|
+
const anchorEl = await screen.findByText("example link");
|
|
49
|
+
expect(anchorEl).toHaveStyleRule("background-color", "green");
|
|
50
|
+
expect(anchorEl).toHaveStyleRule("color", "white");
|
|
51
|
+
expect(anchorEl.closest(".css-pygqsj")).toBeInTheDocument();
|
|
52
|
+
});
|
|
53
|
+
});
|
|
@@ -172,9 +172,9 @@ describe("useRequestManifest", () => {
|
|
|
172
172
|
* @param testObject.formFacet - Form facet.
|
|
173
173
|
*/
|
|
174
174
|
function testRequestManifest({
|
|
175
|
+
expectedMethod = METHOD.PUT,
|
|
175
176
|
expectedParams = undefined,
|
|
176
177
|
expectedUrl = undefined,
|
|
177
|
-
expectedMethod = METHOD.PUT,
|
|
178
178
|
fileManifestFormat,
|
|
179
179
|
formFacet = FORM_FACET.COMPLETE_SET,
|
|
180
180
|
}: {
|
|
@@ -19,6 +19,7 @@ import type {} from "@mui/material/Toolbar";
|
|
|
19
19
|
import type {} from "@mui/material/Typography";
|
|
20
20
|
import type {} from "@tanstack/react-table";
|
|
21
21
|
import { RowData } from "@tanstack/react-table";
|
|
22
|
+
import { Components } from "rehype-react";
|
|
22
23
|
import { DataLayer } from "../src/common/analytics/entities";
|
|
23
24
|
import { DataDictionaryAnnotation } from "../src/common/entities";
|
|
24
25
|
import {
|
|
@@ -230,6 +231,7 @@ declare module "@tanstack/react-table" {
|
|
|
230
231
|
align?: TableCellProps["align"];
|
|
231
232
|
annotation?: DataDictionaryAnnotation;
|
|
232
233
|
columnPinned?: boolean;
|
|
234
|
+
components?: Partial<Components>; // For `MarkdownRendererCell` component.
|
|
233
235
|
header?: string;
|
|
234
236
|
width?: GridTrackSize;
|
|
235
237
|
}
|