@databiosphere/findable-ui 15.0.0 → 15.0.1
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 +7 -0
- package/lib/components/Layout/components/Footer/components/VersionInfo/constants.d.ts +2 -0
- package/lib/components/Layout/components/Footer/components/VersionInfo/constants.js +5 -0
- package/lib/components/Layout/components/Footer/components/VersionInfo/versionInfo.js +6 -4
- package/lib/components/Layout/components/Footer/footer.js +3 -1
- package/lib/components/utils.d.ts +7 -0
- package/lib/components/utils.js +8 -0
- package/package.json +1 -1
- package/src/components/Layout/components/Footer/components/VersionInfo/constants.ts +7 -0
- package/src/components/Layout/components/Footer/components/VersionInfo/versionInfo.tsx +6 -5
- package/src/components/Layout/components/Footer/footer.tsx +3 -1
- package/src/components/utils.ts +10 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [15.0.1](https://github.com/DataBiosphere/findable-ui/compare/v15.0.0...v15.0.1) (2024-11-20)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* access NEXT_PUBLIC environment variables directly from the environment ([#272](https://github.com/DataBiosphere/findable-ui/issues/272)) ([#273](https://github.com/DataBiosphere/findable-ui/issues/273)) ([0926331](https://github.com/DataBiosphere/findable-ui/commit/0926331f4dbe4c069e03789b97fa8888ebfc898a))
|
|
9
|
+
|
|
3
10
|
## [15.0.0](https://github.com/DataBiosphere/findable-ui/compare/v14.0.0...v15.0.0) (2024-11-19)
|
|
4
11
|
|
|
5
12
|
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { Tooltip } from "@mui/material";
|
|
2
2
|
import React from "react";
|
|
3
|
+
import { useCatalog } from "../../../../../../hooks/useCatalog";
|
|
3
4
|
import { Title } from "./components/Tooltip/components/Title/title";
|
|
4
|
-
import { CHIP_PROPS, TOOLTIP_PROPS } from "./constants";
|
|
5
|
+
import { CHIP_PROPS, TOOLTIP_PROPS, VERSION_INFO } from "./constants";
|
|
5
6
|
import { getLabel } from "./utils";
|
|
6
7
|
import { StyledChip } from "./versionInfo.styles";
|
|
7
|
-
export const VersionInfo = ({ chipProps, className, tooltipProps, versionInfo, }) => {
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
export const VersionInfo = ({ chipProps, className, tooltipProps, versionInfo = VERSION_INFO, }) => {
|
|
9
|
+
const catalog = useCatalog();
|
|
10
|
+
return (React.createElement(Tooltip, { ...TOOLTIP_PROPS, title: React.createElement(Title, { versionInfo: { catalog, ...versionInfo } }), ...tooltipProps },
|
|
11
|
+
React.createElement(StyledChip, { ...CHIP_PROPS, className: className, label: getLabel({ catalog, ...versionInfo }), ...chipProps })));
|
|
10
12
|
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Toolbar } from "@mui/material";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { ANCHOR_TARGET } from "../../../Links/common/entities";
|
|
4
|
+
import { isNodeBoolean } from "../../../utils";
|
|
5
|
+
import { VersionInfo } from "./components/VersionInfo/versionInfo";
|
|
4
6
|
import { AppBar, Link, Links, Socials } from "./footer.styles";
|
|
5
7
|
export const Footer = ({ Branding, className, navLinks, socials, versionInfo, }) => {
|
|
6
8
|
return (React.createElement(AppBar, { className: className, color: "inherit", component: "footer", variant: "footer" },
|
|
@@ -10,5 +12,5 @@ export const Footer = ({ Branding, className, navLinks, socials, versionInfo, })
|
|
|
10
12
|
navLinks &&
|
|
11
13
|
navLinks.map(({ label, target = ANCHOR_TARGET.SELF, url }, i) => (React.createElement(Link, { key: `${url}${i}`, label: label, target: target, url: url }))),
|
|
12
14
|
socials && React.createElement(Socials, { buttonSize: "small", socials: socials }),
|
|
13
|
-
versionInfo)))));
|
|
15
|
+
isNodeBoolean(versionInfo) ? React.createElement(VersionInfo, null) : versionInfo)))));
|
|
14
16
|
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Type guard for ReactNode; returns true if the value is a boolean.
|
|
4
|
+
* @param value - Value to check.
|
|
5
|
+
* @returns true if the value is a boolean.
|
|
6
|
+
*/
|
|
7
|
+
export declare function isNodeBoolean(value: ReactNode): value is boolean;
|
package/package.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ChipProps, TooltipProps } from "@mui/material";
|
|
2
2
|
import { CHIP_PROPS as MUI_CHIP_PROPS } from "../../../../../../styles/common/mui/chip";
|
|
3
|
+
import { VersionInfo } from "./types";
|
|
3
4
|
|
|
4
5
|
export const CHIP_PROPS: Partial<ChipProps> = {
|
|
5
6
|
color: MUI_CHIP_PROPS.COLOR.DEFAULT,
|
|
@@ -28,3 +29,9 @@ export const TOOLTIP_PROPS: Partial<TooltipProps> = {
|
|
|
28
29
|
},
|
|
29
30
|
},
|
|
30
31
|
};
|
|
32
|
+
|
|
33
|
+
export const VERSION_INFO: VersionInfo = {
|
|
34
|
+
buildDate: process.env.NEXT_PUBLIC_BUILD_DATE,
|
|
35
|
+
gitHash: process.env.NEXT_PUBLIC_GIT_HASH,
|
|
36
|
+
version: process.env.NEXT_PUBLIC_VERSION,
|
|
37
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Tooltip } from "@mui/material";
|
|
2
2
|
import React from "react";
|
|
3
|
+
import { useCatalog } from "../../../../../../hooks/useCatalog";
|
|
3
4
|
import { BaseComponentProps } from "../../../../../types";
|
|
4
5
|
import { Title } from "./components/Tooltip/components/Title/title";
|
|
5
|
-
import { CHIP_PROPS, TOOLTIP_PROPS } from "./constants";
|
|
6
|
+
import { CHIP_PROPS, TOOLTIP_PROPS, VERSION_INFO } from "./constants";
|
|
6
7
|
import { VersionInfoProps } from "./types";
|
|
7
|
-
|
|
8
8
|
import { getLabel } from "./utils";
|
|
9
9
|
import { StyledChip } from "./versionInfo.styles";
|
|
10
10
|
|
|
@@ -12,18 +12,19 @@ export const VersionInfo = ({
|
|
|
12
12
|
chipProps,
|
|
13
13
|
className,
|
|
14
14
|
tooltipProps,
|
|
15
|
-
versionInfo,
|
|
15
|
+
versionInfo = VERSION_INFO,
|
|
16
16
|
}: BaseComponentProps & VersionInfoProps): JSX.Element | null => {
|
|
17
|
+
const catalog = useCatalog();
|
|
17
18
|
return (
|
|
18
19
|
<Tooltip
|
|
19
20
|
{...TOOLTIP_PROPS}
|
|
20
|
-
title={<Title versionInfo={versionInfo} />}
|
|
21
|
+
title={<Title versionInfo={{ catalog, ...versionInfo }} />}
|
|
21
22
|
{...tooltipProps}
|
|
22
23
|
>
|
|
23
24
|
<StyledChip
|
|
24
25
|
{...CHIP_PROPS}
|
|
25
26
|
className={className}
|
|
26
|
-
label={getLabel(versionInfo)}
|
|
27
|
+
label={getLabel({ catalog, ...versionInfo })}
|
|
27
28
|
{...chipProps}
|
|
28
29
|
/>
|
|
29
30
|
</Tooltip>
|
|
@@ -2,7 +2,9 @@ import { Toolbar } from "@mui/material";
|
|
|
2
2
|
import React, { ReactNode } from "react";
|
|
3
3
|
import { Social } from "../../../common/Socials/socials";
|
|
4
4
|
import { ANCHOR_TARGET } from "../../../Links/common/entities";
|
|
5
|
+
import { isNodeBoolean } from "../../../utils";
|
|
5
6
|
import { NavLinkItem } from "../Header/components/Content/components/Navigation/navigation";
|
|
7
|
+
import { VersionInfo } from "./components/VersionInfo/versionInfo";
|
|
6
8
|
import { AppBar, Link, Links, Socials } from "./footer.styles";
|
|
7
9
|
|
|
8
10
|
export interface FooterProps {
|
|
@@ -41,7 +43,7 @@ export const Footer = ({
|
|
|
41
43
|
/>
|
|
42
44
|
))}
|
|
43
45
|
{socials && <Socials buttonSize="small" socials={socials} />}
|
|
44
|
-
{versionInfo}
|
|
46
|
+
{isNodeBoolean(versionInfo) ? <VersionInfo /> : versionInfo}
|
|
45
47
|
</Links>
|
|
46
48
|
)}
|
|
47
49
|
</Toolbar>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Type guard for ReactNode; returns true if the value is a boolean.
|
|
5
|
+
* @param value - Value to check.
|
|
6
|
+
* @returns true if the value is a boolean.
|
|
7
|
+
*/
|
|
8
|
+
export function isNodeBoolean(value: ReactNode): value is boolean {
|
|
9
|
+
return typeof value === "boolean";
|
|
10
|
+
}
|