@databiosphere/findable-ui 32.1.1 → 33.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 +16 -0
- package/lib/common/categories/config/utils.d.ts +1 -1
- package/lib/common/categories/config/utils.js +5 -1
- package/lib/common/entities.d.ts +1 -3
- package/lib/components/DataDictionary/dataDictionary.js +2 -2
- package/lib/components/DataDictionary/hooks/UseDataDictionary/hook.js +2 -1
- package/lib/components/DataDictionary/hooks/UseDataDictionary/types.d.ts +1 -0
- package/lib/components/Layout/components/Header/header.styles.js +4 -1
- package/package.json +1 -1
- package/src/common/categories/config/utils.ts +6 -3
- package/src/common/entities.ts +2 -3
- package/src/components/DataDictionary/dataDictionary.tsx +2 -2
- package/src/components/DataDictionary/hooks/UseDataDictionary/hook.ts +2 -1
- package/src/components/DataDictionary/hooks/UseDataDictionary/types.ts +1 -0
- package/src/components/Layout/components/Header/header.styles.ts +6 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [33.0.0](https://github.com/DataBiosphere/findable-ui/compare/v32.1.1...v33.0.0) (2025-05-23)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### ⚠ BREAKING CHANGES
|
|
7
|
+
|
|
8
|
+
* updated allowed annotation values #489 ([#498](https://github.com/DataBiosphere/findable-ui/issues/498))
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* updated allowed annotation values [#489](https://github.com/DataBiosphere/findable-ui/issues/489) ([#498](https://github.com/DataBiosphere/findable-ui/issues/498)) ([78a6d4c](https://github.com/DataBiosphere/findable-ui/commit/78a6d4ca3bd798079ae1596078eb91ae2a1b9ab2))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* fix incorrect labels on filters ([#499](https://github.com/DataBiosphere/findable-ui/issues/499)) ([#500](https://github.com/DataBiosphere/findable-ui/issues/500)) ([d6d85e4](https://github.com/DataBiosphere/findable-ui/commit/d6d85e4d04e2d9b6f441a9a2105a1bd31baf560f))
|
|
18
|
+
|
|
3
19
|
## [32.1.1](https://github.com/DataBiosphere/findable-ui/compare/v32.1.0...v32.1.1) (2025-05-22)
|
|
4
20
|
|
|
5
21
|
|
|
@@ -9,7 +9,7 @@ import { CategoryConfig } from "./types";
|
|
|
9
9
|
* @returns category config.
|
|
10
10
|
*/
|
|
11
11
|
export declare function findCategoryConfig<V extends VIEW_KIND>(viewKind: V, key: Category["key"], configs: CategoryConfig[]): Extract<CategoryConfig, {
|
|
12
|
-
viewKind
|
|
12
|
+
viewKind?: V;
|
|
13
13
|
}> | undefined;
|
|
14
14
|
/**
|
|
15
15
|
* Returns the range category config for the given category config key.
|
|
@@ -7,7 +7,11 @@ import { VIEW_KIND } from "../views/types";
|
|
|
7
7
|
* @returns category config.
|
|
8
8
|
*/
|
|
9
9
|
export function findCategoryConfig(viewKind, key, configs) {
|
|
10
|
-
return configs.find((c) =>
|
|
10
|
+
return configs.find((c) =>
|
|
11
|
+
// When `viewKind` is undefined, it corresponds to a `SelectCategoryConfig`.
|
|
12
|
+
// This predicate ensures that `viewKind` is either explicitly matched or treated as undefined
|
|
13
|
+
// for compatibility with `SelectCategoryConfig` and other explicitly defined view kinds.
|
|
14
|
+
(c.viewKind === undefined || c.viewKind === viewKind) && c.key === key);
|
|
11
15
|
}
|
|
12
16
|
/**
|
|
13
17
|
* Returns the range category config for the given category config key.
|
package/lib/common/entities.d.ts
CHANGED
|
@@ -3,9 +3,7 @@ import { ColumnDef, RowData } from "@tanstack/react-table";
|
|
|
3
3
|
* Model of a value of a metadata class.
|
|
4
4
|
*/
|
|
5
5
|
export interface Attribute {
|
|
6
|
-
annotations?:
|
|
7
|
-
[key in keyof DataDictionaryPrefix]: string;
|
|
8
|
-
};
|
|
6
|
+
annotations?: Record<string, string | string[] | undefined>;
|
|
9
7
|
description: string;
|
|
10
8
|
example?: string;
|
|
11
9
|
multivalued: boolean;
|
|
@@ -10,12 +10,12 @@ import { View } from "./dataDictionary.styles";
|
|
|
10
10
|
import { useDataDictionary } from "./hooks/UseDataDictionary/hook";
|
|
11
11
|
import { useLayoutSpacing } from "./hooks/UseLayoutSpacing/hook";
|
|
12
12
|
export const DataDictionary = ({ className, EntitiesLayout = DefaultEntitiesLayout, Outline = DefaultOutline, OutlineLayout = DefaultOutlineLayout, Title = DefaultTitle, TitleLayout = DefaultTitleLayout, }) => {
|
|
13
|
-
const { classes, columnDefs } = useDataDictionary();
|
|
13
|
+
const { classes, columnDefs, title } = useDataDictionary();
|
|
14
14
|
const { spacing } = useLayoutSpacing();
|
|
15
15
|
const outline = useMemo(() => buildClassesOutline(classes), [classes]);
|
|
16
16
|
return (React.createElement(View, { className: className },
|
|
17
17
|
React.createElement(TitleLayout, { ...spacing },
|
|
18
|
-
React.createElement(Title,
|
|
18
|
+
React.createElement(Title, { title: title })),
|
|
19
19
|
React.createElement(OutlineLayout, { ...spacing },
|
|
20
20
|
React.createElement(Outline, { outline: outline })),
|
|
21
21
|
React.createElement(EntitiesLayout, { ...spacing },
|
|
@@ -6,6 +6,7 @@ export const useDataDictionary = () => {
|
|
|
6
6
|
return useMemo(() => {
|
|
7
7
|
const classes = dataDictionaryConfig?.dataDictionary?.classes || [];
|
|
8
8
|
const columnDefs = dataDictionaryConfig?.columnDefs || [];
|
|
9
|
-
|
|
9
|
+
const title = dataDictionaryConfig?.dataDictionary?.title || "";
|
|
10
|
+
return { classes, columnDefs, title };
|
|
10
11
|
}, [dataDictionaryConfig]);
|
|
11
12
|
};
|
|
@@ -3,6 +3,9 @@ import styled from "@emotion/styled";
|
|
|
3
3
|
import { AppBar as MAppBar } from "@mui/material";
|
|
4
4
|
import { smokeMain } from "../../../../styles/common/mixins/colors";
|
|
5
5
|
import { HEADER_HEIGHT } from "./common/constants";
|
|
6
|
+
// See https://github.com/emotion-js/emotion/issues/1105.
|
|
7
|
+
// See https://github.com/emotion-js/emotion/releases/tag/%40emotion%2Fcache%4011.10.2.
|
|
8
|
+
const ignoreSsrWarning = "/* emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason */";
|
|
6
9
|
export const AppBar = styled(MAppBar) `
|
|
7
10
|
border-bottom: 1px solid ${smokeMain};
|
|
8
11
|
|
|
@@ -31,7 +34,7 @@ export const Left = styled.div `
|
|
|
31
34
|
justify-content: flex-start;
|
|
32
35
|
|
|
33
36
|
.MuiButton-navPrimary {
|
|
34
|
-
&:first-
|
|
37
|
+
&:first-child:not(style)${ignoreSsrWarning} { {
|
|
35
38
|
margin-left: 24px;
|
|
36
39
|
}
|
|
37
40
|
}
|
package/package.json
CHANGED
|
@@ -13,10 +13,13 @@ export function findCategoryConfig<V extends VIEW_KIND>(
|
|
|
13
13
|
viewKind: V,
|
|
14
14
|
key: Category["key"],
|
|
15
15
|
configs: CategoryConfig[]
|
|
16
|
-
): Extract<CategoryConfig, { viewKind
|
|
16
|
+
): Extract<CategoryConfig, { viewKind?: V }> | undefined {
|
|
17
17
|
return configs.find(
|
|
18
|
-
(c): c is Extract<CategoryConfig, { viewKind
|
|
19
|
-
|
|
18
|
+
(c): c is Extract<CategoryConfig, { viewKind?: V }> =>
|
|
19
|
+
// When `viewKind` is undefined, it corresponds to a `SelectCategoryConfig`.
|
|
20
|
+
// This predicate ensures that `viewKind` is either explicitly matched or treated as undefined
|
|
21
|
+
// for compatibility with `SelectCategoryConfig` and other explicitly defined view kinds.
|
|
22
|
+
(c.viewKind === undefined || c.viewKind === viewKind) && c.key === key
|
|
20
23
|
);
|
|
21
24
|
}
|
|
22
25
|
|
package/src/common/entities.ts
CHANGED
|
@@ -4,9 +4,8 @@ import { ColumnDef, RowData } from "@tanstack/react-table";
|
|
|
4
4
|
* Model of a value of a metadata class.
|
|
5
5
|
*/
|
|
6
6
|
export interface Attribute {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
};
|
|
7
|
+
// Prefix to fragment mapping, e.g. cxg: "batch_condition", or, general tags e.g. tier: "Tier 1" and bionetwork: ["gut"]
|
|
8
|
+
annotations?: Record<string, string | string[] | undefined>; // 'undefined' allows for mix of keys across attributes e.g. tier, or tier and cxg, or cxg
|
|
10
9
|
description: string;
|
|
11
10
|
example?: string; // Free text example of attribute
|
|
12
11
|
multivalued: boolean; // True if attribute can have multiple values
|
|
@@ -21,13 +21,13 @@ export const DataDictionary = <T extends RowData = Attribute>({
|
|
|
21
21
|
Title = DefaultTitle,
|
|
22
22
|
TitleLayout = DefaultTitleLayout,
|
|
23
23
|
}: DataDictionaryProps): JSX.Element => {
|
|
24
|
-
const { classes, columnDefs } = useDataDictionary<T>();
|
|
24
|
+
const { classes, columnDefs, title } = useDataDictionary<T>();
|
|
25
25
|
const { spacing } = useLayoutSpacing();
|
|
26
26
|
const outline = useMemo(() => buildClassesOutline(classes), [classes]);
|
|
27
27
|
return (
|
|
28
28
|
<View className={className}>
|
|
29
29
|
<TitleLayout {...spacing}>
|
|
30
|
-
<Title />
|
|
30
|
+
<Title title={title} />
|
|
31
31
|
</TitleLayout>
|
|
32
32
|
<OutlineLayout {...spacing}>
|
|
33
33
|
<Outline outline={outline} />
|
|
@@ -18,6 +18,7 @@ export const useDataDictionary = <
|
|
|
18
18
|
return useMemo(() => {
|
|
19
19
|
const classes = dataDictionaryConfig?.dataDictionary?.classes || [];
|
|
20
20
|
const columnDefs = dataDictionaryConfig?.columnDefs || [];
|
|
21
|
-
|
|
21
|
+
const title = dataDictionaryConfig?.dataDictionary?.title || "";
|
|
22
|
+
return { classes, columnDefs, title };
|
|
22
23
|
}, [dataDictionaryConfig]);
|
|
23
24
|
};
|
|
@@ -4,6 +4,11 @@ import { AppBar as MAppBar } from "@mui/material";
|
|
|
4
4
|
import { smokeMain } from "../../../../styles/common/mixins/colors";
|
|
5
5
|
import { HEADER_HEIGHT } from "./common/constants";
|
|
6
6
|
|
|
7
|
+
// See https://github.com/emotion-js/emotion/issues/1105.
|
|
8
|
+
// See https://github.com/emotion-js/emotion/releases/tag/%40emotion%2Fcache%4011.10.2.
|
|
9
|
+
const ignoreSsrWarning =
|
|
10
|
+
"/* emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason */";
|
|
11
|
+
|
|
7
12
|
export const AppBar = styled(MAppBar)`
|
|
8
13
|
border-bottom: 1px solid ${smokeMain};
|
|
9
14
|
|
|
@@ -34,7 +39,7 @@ export const Left = styled.div`
|
|
|
34
39
|
justify-content: flex-start;
|
|
35
40
|
|
|
36
41
|
.MuiButton-navPrimary {
|
|
37
|
-
&:first-
|
|
42
|
+
&:first-child:not(style)${ignoreSsrWarning} { {
|
|
38
43
|
margin-left: 24px;
|
|
39
44
|
}
|
|
40
45
|
}
|