synapse-react-client 4.0.21 → 4.0.23
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/dist/SWC.index.d.ts +1 -0
- package/dist/SWC.index.d.ts.map +1 -1
- package/dist/SWC.index.js +2 -1
- package/dist/SWC.index.js.map +1 -1
- package/dist/assets/icons/GeneticsIcon.d.ts +3 -0
- package/dist/assets/icons/GeneticsIcon.d.ts.map +1 -0
- package/dist/assets/icons/GeneticsIcon.js +14 -0
- package/dist/assets/icons/GeneticsIcon.js.map +1 -0
- package/dist/components/CardContainer/CardContainer.d.ts.map +1 -1
- package/dist/components/CardContainer/CardContainer.js +43 -49
- package/dist/components/CardContainer/CardContainer.js.map +1 -1
- package/dist/components/CardContainerLogic/CardContainerLogic.d.ts +13 -0
- package/dist/components/CardContainerLogic/CardContainerLogic.d.ts.map +1 -1
- package/dist/components/CardContainerLogic/CardContainerLogic.js +64 -40
- package/dist/components/CardContainerLogic/CardContainerLogic.js.map +1 -1
- package/dist/components/ChallengeSubmission/ChallengeSubmissionStepper.js +1 -1
- package/dist/components/ChallengeSubmission/ChallengeSubmissionStepper.js.map +1 -1
- package/dist/components/DataExplorer/DataExplorer.css +1 -1
- package/dist/components/DataExplorer/DataExplorer.module.js +16 -16
- package/dist/components/DataExplorer/DataExplorer.module.js.map +1 -1
- package/dist/components/DataExplorer/DataExplorer.module.scss +0 -1
- package/dist/components/DataGrid/DataGrid.d.ts +1 -0
- package/dist/components/DataGrid/DataGrid.d.ts.map +1 -1
- package/dist/components/DataGrid/DataGrid.js +72 -72
- package/dist/components/DataGrid/DataGrid.js.map +1 -1
- package/dist/components/DataGrid/SynapseGrid.d.ts.map +1 -1
- package/dist/components/DataGrid/SynapseGrid.js +209 -206
- package/dist/components/DataGrid/SynapseGrid.js.map +1 -1
- package/dist/components/DataGrid/components/ColumnHeaderWithTooltip.d.ts +2 -1
- package/dist/components/DataGrid/components/ColumnHeaderWithTooltip.d.ts.map +1 -1
- package/dist/components/DataGrid/components/ColumnHeaderWithTooltip.js +51 -42
- package/dist/components/DataGrid/components/ColumnHeaderWithTooltip.js.map +1 -1
- package/dist/components/DataGrid/useDataGridWebsocket.d.ts.map +1 -1
- package/dist/components/DataGrid/useDataGridWebsocket.js +68 -67
- package/dist/components/DataGrid/useDataGridWebsocket.js.map +1 -1
- package/dist/components/DataGrid/utils/columnFactory.d.ts +1 -0
- package/dist/components/DataGrid/utils/columnFactory.d.ts.map +1 -1
- package/dist/components/DataGrid/utils/columnFactory.js +4 -3
- package/dist/components/DataGrid/utils/columnFactory.js.map +1 -1
- package/dist/components/DataGrid/utils/modelColsToGrid.d.ts +1 -1
- package/dist/components/DataGrid/utils/modelColsToGrid.d.ts.map +1 -1
- package/dist/components/DataGrid/utils/modelColsToGrid.js +15 -14
- package/dist/components/DataGrid/utils/modelColsToGrid.js.map +1 -1
- package/dist/components/DataGrid/utils/normalizeWebsocketError.d.ts +7 -0
- package/dist/components/DataGrid/utils/normalizeWebsocketError.d.ts.map +1 -0
- package/dist/components/DataGrid/utils/normalizeWebsocketError.js +8 -0
- package/dist/components/DataGrid/utils/normalizeWebsocketError.js.map +1 -0
- package/dist/components/EntityCitation/EntityCitation.d.ts.map +1 -1
- package/dist/components/EntityCitation/EntityCitation.js +23 -8
- package/dist/components/EntityCitation/EntityCitation.js.map +1 -1
- package/dist/components/GenericCard/DuoTermTags/DuoTermTags.d.ts +18 -0
- package/dist/components/GenericCard/DuoTermTags/DuoTermTags.d.ts.map +1 -0
- package/dist/components/GenericCard/DuoTermTags/DuoTermTags.js +112 -0
- package/dist/components/GenericCard/DuoTermTags/DuoTermTags.js.map +1 -0
- package/dist/components/GenericCard/DuoTermTags/duoTerms.d.ts +31 -0
- package/dist/components/GenericCard/DuoTermTags/duoTerms.d.ts.map +1 -0
- package/dist/components/GenericCard/DuoTermTags/duoTerms.js +198 -0
- package/dist/components/GenericCard/DuoTermTags/duoTerms.js.map +1 -0
- package/dist/components/GenericCard/SynapseCardLabel.d.ts.map +1 -1
- package/dist/components/GenericCard/SynapseCardLabel.js +4 -8
- package/dist/components/GenericCard/SynapseCardLabel.js.map +1 -1
- package/dist/components/GenericCard/TableRowGenericCard.d.ts +6 -0
- package/dist/components/GenericCard/TableRowGenericCard.d.ts.map +1 -1
- package/dist/components/GenericCard/TableRowGenericCard.js +168 -153
- package/dist/components/GenericCard/TableRowGenericCard.js.map +1 -1
- package/dist/components/Goals/Goals.d.ts +8 -0
- package/dist/components/Goals/Goals.d.ts.map +1 -1
- package/dist/components/Goals/Goals.js +54 -40
- package/dist/components/Goals/Goals.js.map +1 -1
- package/dist/components/IconSvg/IconSvg.d.ts +1 -1
- package/dist/components/IconSvg/IconSvg.d.ts.map +1 -1
- package/dist/components/IconSvg/IconSvg.js +19 -18
- package/dist/components/IconSvg/IconSvg.js.map +1 -1
- package/dist/components/ProjectVisibilityChip/ProjectVisibilityChip.d.ts +9 -0
- package/dist/components/ProjectVisibilityChip/ProjectVisibilityChip.d.ts.map +1 -0
- package/dist/components/ProjectVisibilityChip/ProjectVisibilityChip.js +69 -0
- package/dist/components/ProjectVisibilityChip/ProjectVisibilityChip.js.map +1 -0
- package/dist/components/ProjectVisibilityChip/getProjectVisibilityFromACL.d.ts +13 -0
- package/dist/components/ProjectVisibilityChip/getProjectVisibilityFromACL.d.ts.map +1 -0
- package/dist/components/ProjectVisibilityChip/getProjectVisibilityFromACL.js +11 -0
- package/dist/components/ProjectVisibilityChip/getProjectVisibilityFromACL.js.map +1 -0
- package/dist/components/ProjectVisibilityChip/index.d.ts +5 -0
- package/dist/components/ProjectVisibilityChip/index.d.ts.map +1 -0
- package/dist/components/ProjectVisibilityChip/index.js +7 -0
- package/dist/components/ProjectVisibilityChip/index.js.map +1 -0
- package/dist/components/QueryVisualizationWrapper/QueryVisualizationContext.d.ts +21 -0
- package/dist/components/QueryVisualizationWrapper/QueryVisualizationContext.d.ts.map +1 -1
- package/dist/components/QueryVisualizationWrapper/QueryVisualizationContext.js.map +1 -1
- package/dist/components/QueryVisualizationWrapper/QueryVisualizationWrapper.d.ts +10 -0
- package/dist/components/QueryVisualizationWrapper/QueryVisualizationWrapper.d.ts.map +1 -1
- package/dist/components/QueryVisualizationWrapper/QueryVisualizationWrapper.js +66 -60
- package/dist/components/QueryVisualizationWrapper/QueryVisualizationWrapper.js.map +1 -1
- package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.d.ts +1 -1
- package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.d.ts.map +1 -1
- package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.js +2 -0
- package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.js.map +1 -1
- package/dist/components/QueryWrapperPlotNav/RowSetView.d.ts.map +1 -1
- package/dist/components/QueryWrapperPlotNav/RowSetView.js +9 -12
- package/dist/components/QueryWrapperPlotNav/RowSetView.js.map +1 -1
- package/dist/components/RssFeedCards/RssFeedCards.d.ts +7 -15
- package/dist/components/RssFeedCards/RssFeedCards.d.ts.map +1 -1
- package/dist/components/RssFeedCards/RssFeedCards.js +114 -123
- package/dist/components/RssFeedCards/RssFeedCards.js.map +1 -1
- package/dist/components/SearchQueryWrapper/SearchQueryUseQueryOptions.d.ts +33 -6
- package/dist/components/SearchQueryWrapper/SearchQueryUseQueryOptions.d.ts.map +1 -1
- package/dist/components/SearchQueryWrapper/SearchQueryUseQueryOptions.js +93 -55
- package/dist/components/SearchQueryWrapper/SearchQueryUseQueryOptions.js.map +1 -1
- package/dist/components/SearchQueryWrapper/SearchQueryWrapper.d.ts +3 -0
- package/dist/components/SearchQueryWrapper/SearchQueryWrapper.d.ts.map +1 -1
- package/dist/components/SearchQueryWrapper/SearchQueryWrapper.js +39 -37
- package/dist/components/SearchQueryWrapper/SearchQueryWrapper.js.map +1 -1
- package/dist/components/SearchQueryWrapperPlotNav/SearchQueryWrapperPlotNav.d.ts +3 -1
- package/dist/components/SearchQueryWrapperPlotNav/SearchQueryWrapperPlotNav.d.ts.map +1 -1
- package/dist/components/SearchQueryWrapperPlotNav/SearchQueryWrapperPlotNav.js +4 -0
- package/dist/components/SearchQueryWrapperPlotNav/SearchQueryWrapperPlotNav.js.map +1 -1
- package/dist/components/UserCardList/UserCardList.d.ts +2 -20
- package/dist/components/UserCardList/UserCardList.d.ts.map +1 -1
- package/dist/components/UserCardList/UserCardList.js +49 -72
- package/dist/components/UserCardList/UserCardList.js.map +1 -1
- package/dist/components/UserCardList/UserCardListRotate.d.ts +13 -0
- package/dist/components/UserCardList/UserCardListRotate.d.ts.map +1 -1
- package/dist/components/UserCardList/UserCardListRotate.js +82 -57
- package/dist/components/UserCardList/UserCardListRotate.js.map +1 -1
- package/dist/components/entity/page/action_menu/EntityActionMenu.d.ts +5 -2
- package/dist/components/entity/page/action_menu/EntityActionMenu.d.ts.map +1 -1
- package/dist/components/entity/page/action_menu/EntityActionMenu.js +68 -51
- package/dist/components/entity/page/action_menu/EntityActionMenu.js.map +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/menu/ComplexMenu.d.ts +8 -1
- package/dist/components/menu/ComplexMenu.d.ts.map +1 -1
- package/dist/components/menu/ComplexMenu.js +50 -20
- package/dist/components/menu/ComplexMenu.js.map +1 -1
- package/dist/components/widgets/facet-nav/FacetValueChip.d.ts +25 -0
- package/dist/components/widgets/facet-nav/FacetValueChip.d.ts.map +1 -0
- package/dist/components/widgets/facet-nav/FacetValueChip.js +40 -0
- package/dist/components/widgets/facet-nav/FacetValueChip.js.map +1 -0
- package/dist/components/widgets/facet-nav/SelectionCriteriaPill.d.ts +10 -5
- package/dist/components/widgets/facet-nav/SelectionCriteriaPill.d.ts.map +1 -1
- package/dist/components/widgets/facet-nav/SelectionCriteriaPill.js +10 -17
- package/dist/components/widgets/facet-nav/SelectionCriteriaPill.js.map +1 -1
- package/dist/components/widgets/facet-nav/SelectionCriteriaPills.d.ts.map +1 -1
- package/dist/components/widgets/facet-nav/SelectionCriteriaPills.js +11 -10
- package/dist/components/widgets/facet-nav/SelectionCriteriaPills.js.map +1 -1
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilter.d.ts.map +1 -1
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilter.js +70 -54
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilter.js.map +1 -1
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterOption.d.ts +2 -1
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterOption.d.ts.map +1 -1
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterOption.js +17 -1
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterOption.js.map +1 -1
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterUI.d.ts +2 -0
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterUI.d.ts.map +1 -1
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterUI.js +7 -7
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterUI.js.map +1 -1
- package/dist/features/curator/dashboard/components/CurationTaskCard.d.ts.map +1 -1
- package/dist/features/curator/dashboard/components/CurationTaskCard.js +99 -45
- package/dist/features/curator/dashboard/components/CurationTaskCard.js.map +1 -1
- package/dist/features/entity/metadata-task/components/CreateOrUpdateCurationTaskDialog.d.ts.map +1 -1
- package/dist/features/entity/metadata-task/components/CreateOrUpdateCurationTaskDialog.js +174 -149
- package/dist/features/entity/metadata-task/components/CreateOrUpdateCurationTaskDialog.js.map +1 -1
- package/dist/features/entity/metadata-task/utils/constants.d.ts +6 -0
- package/dist/features/entity/metadata-task/utils/constants.d.ts.map +1 -1
- package/dist/features/entity/metadata-task/utils/constants.js +19 -2
- package/dist/features/entity/metadata-task/utils/constants.js.map +1 -1
- package/dist/style/abstracts/_cssVariables.scss +1 -0
- package/dist/style/components/_total-query-results.scss +10 -34
- package/dist/style/main.css +1 -1
- package/dist/synapse-queries/KeyFactory.d.ts +1 -0
- package/dist/synapse-queries/KeyFactory.d.ts.map +1 -1
- package/dist/synapse-queries/KeyFactory.js +3 -0
- package/dist/synapse-queries/KeyFactory.js.map +1 -1
- package/dist/synapse-queries/curation/task/useCurationTask.d.ts.map +1 -1
- package/dist/synapse-queries/curation/task/useCurationTask.js +1 -1
- package/dist/synapse-queries/curation/task/useCurationTask.js.map +1 -1
- package/dist/synapse-queries/index.js +46 -44
- package/dist/synapse-queries/user/index.js +3 -3
- package/dist/synapse-queries/user/useUserBundle.d.ts +12 -0
- package/dist/synapse-queries/user/useUserBundle.d.ts.map +1 -1
- package/dist/synapse-queries/user/useUserBundle.js +50 -36
- package/dist/synapse-queries/user/useUserBundle.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utils/AppUtils/session/SessionInitializedGuard.d.ts +10 -5
- package/dist/utils/AppUtils/session/SessionInitializedGuard.d.ts.map +1 -1
- package/dist/utils/AppUtils/session/SessionInitializedGuard.js +13 -9
- package/dist/utils/AppUtils/session/SessionInitializedGuard.js.map +1 -1
- package/dist/utils/functions/SqlFunctions.d.ts +1 -1
- package/dist/utils/functions/SqlFunctions.d.ts.map +1 -1
- package/dist/utils/functions/SqlFunctions.js +1 -1
- package/dist/utils/functions/SqlFunctions.js.map +1 -1
- package/package.json +4 -4
|
@@ -19,25 +19,27 @@ import { EntityDownloadConfirmation as de } from "../EntityDownloadConfirmation/
|
|
|
19
19
|
import "../EntityDownloadConfirmation/index.js";
|
|
20
20
|
import { useQueryContext as fe } from "../QueryContext/QueryContext.js";
|
|
21
21
|
import pe from "../IconList.js";
|
|
22
|
-
import {
|
|
22
|
+
import { parseDuoModifiers as me } from "./DuoTermTags/duoTerms.js";
|
|
23
|
+
import he from "./DuoTermTags/DuoTermTags.js";
|
|
24
|
+
import { useQueryVisualizationContext as ge } from "../QueryVisualizationWrapper/QueryVisualizationContext.js";
|
|
23
25
|
import "../QueryVisualizationWrapper/index.js";
|
|
24
|
-
import
|
|
25
|
-
import { GenericCard as
|
|
26
|
+
import _e from "../ShareThisPage/ShareThisPage.js";
|
|
27
|
+
import { GenericCard as ve } from "./GenericCard.js";
|
|
26
28
|
import { SynapseCardLabel as l } from "./SynapseCardLabel.js";
|
|
27
|
-
import { useResolvedSynapseEntity as
|
|
28
|
-
import { useCallback as
|
|
29
|
-
import { Box as
|
|
30
|
-
import { Fragment as
|
|
31
|
-
import { ColumnTypeEnum as
|
|
32
|
-
import { GetAppTwoTone as
|
|
33
|
-
import { useInView as
|
|
29
|
+
import { useResolvedSynapseEntity as ye } from "./useResolvedSynapseEntity.js";
|
|
30
|
+
import { useCallback as be, useMemo as u, useState as d } from "react";
|
|
31
|
+
import { Box as xe, Collapse as Se, Link as Ce, Stack as f, Typography as we } from "@mui/material";
|
|
32
|
+
import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
33
|
+
import { ColumnTypeEnum as Te } from "@sage-bionetworks/synapse-types";
|
|
34
|
+
import { GetAppTwoTone as Ee } from "@mui/icons-material";
|
|
35
|
+
import { useInView as De } from "react-intersection-observer";
|
|
34
36
|
//#region src/components/GenericCard/TableRowGenericCard.tsx
|
|
35
|
-
function
|
|
37
|
+
function Oe(e) {
|
|
36
38
|
let { synapseId: n, version: r } = e;
|
|
37
|
-
return /* @__PURE__ */
|
|
39
|
+
return /* @__PURE__ */ h("span", { children: [
|
|
38
40
|
r,
|
|
39
41
|
"\xA0\xA0",
|
|
40
|
-
/* @__PURE__ */
|
|
42
|
+
/* @__PURE__ */ m("a", {
|
|
41
43
|
target: s.NEW_WINDOW,
|
|
42
44
|
rel: "noopener noreferrer",
|
|
43
45
|
href: `${t.PORTAL}Synapse:${n}.${r}`,
|
|
@@ -45,136 +47,148 @@ function De(e) {
|
|
|
45
47
|
})
|
|
46
48
|
] });
|
|
47
49
|
}
|
|
48
|
-
function
|
|
49
|
-
let [s,
|
|
50
|
-
|
|
51
|
-
value:
|
|
52
|
-
columnName:
|
|
53
|
-
selectColumns:
|
|
54
|
-
columnModels:
|
|
50
|
+
function g(t) {
|
|
51
|
+
let [s, g] = d(!1), [ke, Ae] = d(!1), { entityId: je, versionNumber: Me } = fe(), { getColumnDisplayName: _ } = ge(), { ref: Ne, inView: Pe } = De(), { data: v } = ee(je, Me), { schema: y, data: b, rowId: x, versionNumber: Fe, genericCardSchema: S, secondaryLabelLimit: Ie, sharePageLinkButtonProps: Le, selectColumns: C, columnModels: w, iconOptions: Re, useTypeColumnForIcon: T = !1, isHeader: E = !1, sustainabilityScorecard: ze, headerCardVariant: Be, titleLinkConfig: D, ctaLinkConfig: O, ctaLinkPosition: Ve, labelLinkConfig: He, descriptionConfig: Ue, columnIconOptions: k, CardTypeAdornment: A, charCountCutoff: We } = t, { link: Ge = "", type: j, includeCitation: Ke, includeShareButton: qe, defaultCitationFormat: Je, citationBoilerplateText: Ye, downloadCartSynId: M, portalDoiConfiguration: N } = S, P = b[y[S.title]], F = S.subTitle && b[y[S.subTitle]];
|
|
52
|
+
F = S.subTitle && ne({
|
|
53
|
+
value: F,
|
|
54
|
+
columnName: S.subTitle,
|
|
55
|
+
selectColumns: C,
|
|
56
|
+
columnModels: w
|
|
55
57
|
}).str;
|
|
56
|
-
let
|
|
58
|
+
let Xe = b[y[S.description || ""]], I = b[y[S.icon || ""]], L = b[y[S.dataTypeIconNames || ""]], R = b[y[S.imageFileHandleColumnName || ""]], Ze = w?.find((e) => S.link === e.name)?.columnType, z = b[y[Ge]] || "", { href: Qe, target: $e } = c(z, D, b, y, x), et = S.synapseEntityConfig, B = be((e) => {
|
|
57
59
|
if (!e) return;
|
|
58
|
-
let t =
|
|
59
|
-
if (t !== void 0) return
|
|
60
|
-
}, [
|
|
61
|
-
let
|
|
60
|
+
let t = y[e];
|
|
61
|
+
if (t !== void 0) return b[t];
|
|
62
|
+
}, [y, b]), V = u(() => {
|
|
63
|
+
let e = S.dataUseModifiersColumnName;
|
|
62
64
|
if (!e) return;
|
|
63
|
-
let t =
|
|
65
|
+
let t = me(b[y[e]]);
|
|
66
|
+
if (t.length !== 0) return /* @__PURE__ */ m(he, { terms: t });
|
|
67
|
+
}, [
|
|
68
|
+
S,
|
|
69
|
+
b,
|
|
70
|
+
y
|
|
71
|
+
]), tt = u(() => {
|
|
72
|
+
let { titleAreaDetails: e } = S;
|
|
73
|
+
if (!e) return;
|
|
74
|
+
let t = typeof e == "function" ? e(y, b) : e;
|
|
64
75
|
if (t.length === 0) return;
|
|
65
76
|
let n = t.map((e) => {
|
|
66
|
-
let t = y[
|
|
77
|
+
let t = b[y[e]];
|
|
67
78
|
return t ? {
|
|
68
|
-
name:
|
|
79
|
+
name: _(e),
|
|
69
80
|
rawValue: t,
|
|
70
81
|
columnName: e
|
|
71
82
|
} : null;
|
|
72
83
|
}).filter(Boolean);
|
|
73
|
-
if (n.length !== 0) return /* @__PURE__ */
|
|
84
|
+
if (n.length !== 0) return /* @__PURE__ */ m(f, {
|
|
74
85
|
direction: "column",
|
|
75
86
|
gap: "4px",
|
|
76
|
-
children: n.map(({ name: e, rawValue: t, columnName: n }) => /* @__PURE__ */
|
|
87
|
+
children: n.map(({ name: e, rawValue: t, columnName: n }) => /* @__PURE__ */ h(f, {
|
|
77
88
|
direction: "row",
|
|
78
89
|
gap: "4px",
|
|
79
90
|
alignItems: "center",
|
|
80
|
-
children: [/* @__PURE__ */
|
|
91
|
+
children: [/* @__PURE__ */ h(we, {
|
|
81
92
|
component: "span",
|
|
82
93
|
variant: "body1",
|
|
83
94
|
children: [e, ":"]
|
|
84
|
-
}), /* @__PURE__ */
|
|
95
|
+
}), /* @__PURE__ */ m(l, {
|
|
85
96
|
value: t,
|
|
86
97
|
columnName: n,
|
|
87
98
|
labelLink: void 0,
|
|
88
|
-
isHeader:
|
|
89
|
-
selectColumns:
|
|
90
|
-
columnModels:
|
|
91
|
-
rowData:
|
|
92
|
-
columnIconOptions:
|
|
99
|
+
isHeader: E,
|
|
100
|
+
selectColumns: C,
|
|
101
|
+
columnModels: w,
|
|
102
|
+
rowData: b,
|
|
103
|
+
columnIconOptions: k
|
|
93
104
|
})]
|
|
94
105
|
}, n))
|
|
95
106
|
});
|
|
96
107
|
}, [
|
|
97
|
-
x,
|
|
98
|
-
y,
|
|
99
|
-
v,
|
|
100
|
-
g,
|
|
101
|
-
T,
|
|
102
108
|
S,
|
|
109
|
+
b,
|
|
110
|
+
y,
|
|
111
|
+
_,
|
|
112
|
+
E,
|
|
103
113
|
C,
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
+
w,
|
|
115
|
+
k
|
|
116
|
+
]), { entityId: H, entityVersionNumber: U } = ye({
|
|
117
|
+
synapseEntityConfig: et,
|
|
118
|
+
getColumnValue: B,
|
|
119
|
+
rowId: x,
|
|
120
|
+
rowVersionNumber: Fe
|
|
121
|
+
}), W = H, G = U;
|
|
122
|
+
if (M) {
|
|
123
|
+
let e = a(B(M) ?? "");
|
|
124
|
+
W = e?.targetId, G = e?.targetVersionNumber;
|
|
114
125
|
}
|
|
115
|
-
let
|
|
116
|
-
data: u(() => le(
|
|
117
|
-
portalDoiConfiguration:
|
|
118
|
-
}),
|
|
119
|
-
portalId:
|
|
120
|
-
resourceId:
|
|
121
|
-
}),
|
|
122
|
-
if (
|
|
126
|
+
let K = se({
|
|
127
|
+
data: u(() => le(b, y), [b, y]),
|
|
128
|
+
portalDoiConfiguration: N
|
|
129
|
+
}), nt = ce({
|
|
130
|
+
portalId: N?.portalId,
|
|
131
|
+
resourceId: K
|
|
132
|
+
}), q = [], { secondaryLabels: J = [] } = S, Y = S.customSecondaryLabelConfig;
|
|
133
|
+
if (V && q.push({
|
|
134
|
+
columnDisplayName: "Data Usage Restrictions",
|
|
135
|
+
value: V
|
|
136
|
+
}), nt && N && K && Pe && q.push({
|
|
123
137
|
columnDisplayName: "DOI",
|
|
124
|
-
value: /* @__PURE__ */
|
|
125
|
-
portalId:
|
|
126
|
-
resourceId:
|
|
138
|
+
value: /* @__PURE__ */ m(oe, {
|
|
139
|
+
portalId: N.portalId,
|
|
140
|
+
resourceId: K
|
|
127
141
|
})
|
|
128
|
-
}),
|
|
129
|
-
let { key: e, value: t } =
|
|
130
|
-
|
|
142
|
+
}), Y?.isVisible(y, b)) {
|
|
143
|
+
let { key: e, value: t } = Y;
|
|
144
|
+
W ? q.push({
|
|
131
145
|
columnDisplayName: "HOW TO DOWNLOAD",
|
|
132
|
-
value: /* @__PURE__ */
|
|
133
|
-
onClick: () =>
|
|
146
|
+
value: /* @__PURE__ */ m(Ce, {
|
|
147
|
+
onClick: () => g((e) => !e),
|
|
134
148
|
children: "Click here to add to Synapse download list"
|
|
135
149
|
})
|
|
136
|
-
}) :
|
|
150
|
+
}) : q.push({
|
|
137
151
|
columnDisplayName: e,
|
|
138
152
|
value: t
|
|
139
153
|
});
|
|
140
154
|
}
|
|
141
|
-
let
|
|
142
|
-
for (let e = 0; e <
|
|
143
|
-
let t =
|
|
155
|
+
let rt = v && !i(v);
|
|
156
|
+
for (let e = 0; e < J.length; e += 1) {
|
|
157
|
+
let t = J[e], i = b[y[t]], a = i, o;
|
|
144
158
|
if (a && i !== "[]" && i !== "[\"\"]") {
|
|
145
|
-
if (r(
|
|
146
|
-
else if (
|
|
147
|
-
let e = y
|
|
148
|
-
a = /* @__PURE__ */
|
|
159
|
+
if (r(v) && t === "datasetSizeInBytes") o = "Size", a = n(parseInt(i));
|
|
160
|
+
else if (rt && t === "currentVersion") {
|
|
161
|
+
let e = b[y.id];
|
|
162
|
+
a = /* @__PURE__ */ m(Oe, {
|
|
149
163
|
synapseId: e,
|
|
150
164
|
version: i
|
|
151
165
|
}), o = "Version";
|
|
152
166
|
} else {
|
|
153
|
-
let e =
|
|
154
|
-
a = /* @__PURE__ */
|
|
167
|
+
let e = He?.find((e) => e.matchColumnName === t);
|
|
168
|
+
a = /* @__PURE__ */ m(l, {
|
|
155
169
|
value: i,
|
|
156
170
|
columnName: t,
|
|
157
171
|
labelLink: e,
|
|
158
|
-
isHeader:
|
|
159
|
-
selectColumns:
|
|
160
|
-
columnModels:
|
|
161
|
-
rowData:
|
|
162
|
-
columnIconOptions:
|
|
163
|
-
}), o =
|
|
172
|
+
isHeader: E,
|
|
173
|
+
selectColumns: C,
|
|
174
|
+
columnModels: w,
|
|
175
|
+
rowData: b,
|
|
176
|
+
columnIconOptions: k
|
|
177
|
+
}), o = _(t);
|
|
164
178
|
}
|
|
165
|
-
|
|
179
|
+
q.push({
|
|
166
180
|
columnDisplayName: o,
|
|
167
181
|
value: a,
|
|
168
182
|
columnName: t
|
|
169
183
|
});
|
|
170
184
|
}
|
|
171
185
|
}
|
|
172
|
-
let
|
|
173
|
-
let t = y[
|
|
186
|
+
let X = te(v, R || z, b[y.id]), it = _(S.description || ""), Z = o("doi", C, w), Q = Z === void 0 ? void 0 : b[Z], at = (O ? Array.isArray(O) ? O : [O] : []).map((e) => {
|
|
187
|
+
let t = b[y[e.link]] || "";
|
|
174
188
|
if (!t) return null;
|
|
175
|
-
let { href: n, target: r } = c(t, void 0,
|
|
189
|
+
let { href: n, target: r } = c(t, void 0, b, y, x);
|
|
176
190
|
return {
|
|
177
|
-
text: e.endIcon ? /* @__PURE__ */
|
|
191
|
+
text: e.endIcon ? /* @__PURE__ */ h("div", {
|
|
178
192
|
style: {
|
|
179
193
|
display: "flex",
|
|
180
194
|
alignItems: "center",
|
|
@@ -185,98 +199,99 @@ function h(t) {
|
|
|
185
199
|
href: n,
|
|
186
200
|
target: r
|
|
187
201
|
};
|
|
188
|
-
}).filter(Boolean),
|
|
189
|
-
|
|
190
|
-
datasetId:
|
|
191
|
-
datasetVersionNumber:
|
|
202
|
+
}).filter(Boolean), ot = /* @__PURE__ */ m(p, {});
|
|
203
|
+
H != null && U != null && (ot = /* @__PURE__ */ m(ie, {
|
|
204
|
+
datasetId: H,
|
|
205
|
+
datasetVersionNumber: U
|
|
192
206
|
}));
|
|
193
|
-
let
|
|
194
|
-
schema:
|
|
195
|
-
data:
|
|
207
|
+
let st = A ? /* @__PURE__ */ m(A, {
|
|
208
|
+
schema: y,
|
|
209
|
+
data: b
|
|
196
210
|
}) : null, $ = !0;
|
|
197
|
-
return
|
|
198
|
-
ref:
|
|
199
|
-
icon: $ ? /* @__PURE__ */
|
|
200
|
-
type:
|
|
201
|
-
useTypeForIcon:
|
|
202
|
-
thumbnailRequiresPadding:
|
|
203
|
-
imageFileHandleId:
|
|
204
|
-
fileHandleAssociation:
|
|
205
|
-
iconOptions:
|
|
206
|
-
iconValue:
|
|
211
|
+
return E && !R && !I && ($ = !1), /* @__PURE__ */ m(ve, {
|
|
212
|
+
ref: Ne,
|
|
213
|
+
icon: $ ? /* @__PURE__ */ m(ae, {
|
|
214
|
+
type: T ? b[y.type] : S.type,
|
|
215
|
+
useTypeForIcon: T,
|
|
216
|
+
thumbnailRequiresPadding: S.thumbnailRequiresPadding,
|
|
217
|
+
imageFileHandleId: R,
|
|
218
|
+
fileHandleAssociation: X,
|
|
219
|
+
iconOptions: Re,
|
|
220
|
+
iconValue: I
|
|
207
221
|
}) : void 0,
|
|
208
|
-
isHeader:
|
|
209
|
-
sustainabilityScorecard:
|
|
210
|
-
headerCardVariant:
|
|
211
|
-
type:
|
|
212
|
-
title:
|
|
213
|
-
subtitle:
|
|
222
|
+
isHeader: E,
|
|
223
|
+
sustainabilityScorecard: ze,
|
|
224
|
+
headerCardVariant: Be,
|
|
225
|
+
type: j,
|
|
226
|
+
title: P,
|
|
227
|
+
subtitle: F,
|
|
214
228
|
titleLinkConfiguration: {
|
|
215
|
-
target:
|
|
216
|
-
href:
|
|
229
|
+
target: $e,
|
|
230
|
+
href: Qe
|
|
217
231
|
},
|
|
218
|
-
cardTypeAdornment:
|
|
219
|
-
titleAsFileHandleLinkConfiguration: !
|
|
220
|
-
fileHandleAssociation:
|
|
221
|
-
showDownloadIcon:
|
|
232
|
+
cardTypeAdornment: st,
|
|
233
|
+
titleAsFileHandleLinkConfiguration: !D && Ze === Te.FILEHANDLEID && X ? {
|
|
234
|
+
fileHandleAssociation: X,
|
|
235
|
+
showDownloadIcon: j !== e
|
|
222
236
|
} : void 0,
|
|
223
|
-
ctaLinkConfig:
|
|
224
|
-
ctaLinkPosition:
|
|
225
|
-
titleAreaRightContent:
|
|
226
|
-
description:
|
|
227
|
-
descriptionSubTitle:
|
|
228
|
-
descriptionConfig:
|
|
229
|
-
charCountCutoff:
|
|
230
|
-
labels:
|
|
231
|
-
secondaryLabelLimit:
|
|
232
|
-
useStylesForDisplayedImage: !!
|
|
233
|
-
cardTopContent:
|
|
237
|
+
ctaLinkConfig: at.length > 0 ? at : void 0,
|
|
238
|
+
ctaLinkPosition: Ve,
|
|
239
|
+
titleAreaRightContent: tt,
|
|
240
|
+
description: Xe,
|
|
241
|
+
descriptionSubTitle: it,
|
|
242
|
+
descriptionConfig: Ue,
|
|
243
|
+
charCountCutoff: We,
|
|
244
|
+
labels: q,
|
|
245
|
+
secondaryLabelLimit: Ie,
|
|
246
|
+
useStylesForDisplayedImage: !!R,
|
|
247
|
+
cardTopContent: /* @__PURE__ */ m(p, { children: W && /* @__PURE__ */ m(Se, {
|
|
234
248
|
in: s,
|
|
235
|
-
children: /* @__PURE__ */
|
|
236
|
-
entityId:
|
|
237
|
-
versionNumber:
|
|
238
|
-
handleClose: () =>
|
|
249
|
+
children: /* @__PURE__ */ m(de, {
|
|
250
|
+
entityId: W,
|
|
251
|
+
versionNumber: G,
|
|
252
|
+
handleClose: () => g(!1),
|
|
239
253
|
onIsLoadingChange: (e) => {
|
|
240
|
-
|
|
254
|
+
Ae(e);
|
|
241
255
|
}
|
|
242
256
|
})
|
|
243
|
-
}),
|
|
244
|
-
renderedIconList:
|
|
257
|
+
}) }),
|
|
258
|
+
renderedIconList: k?.columns?.dataType && L?.length && /* @__PURE__ */ m("div", {
|
|
245
259
|
style: { marginTop: "20px" },
|
|
246
|
-
children: /* @__PURE__ */
|
|
247
|
-
iconConfigs:
|
|
248
|
-
iconNames: JSON.parse(
|
|
260
|
+
children: /* @__PURE__ */ m(pe, {
|
|
261
|
+
iconConfigs: k.columns.dataType,
|
|
262
|
+
iconNames: JSON.parse(L),
|
|
249
263
|
commonIconProps: { sx: { fontSize: "40px" } },
|
|
250
264
|
useBackground: !0,
|
|
251
265
|
useTheme: !0
|
|
252
266
|
})
|
|
253
267
|
}),
|
|
254
|
-
cardTopButtons: /* @__PURE__ */
|
|
268
|
+
cardTopButtons: /* @__PURE__ */ h(xe, {
|
|
255
269
|
sx: {
|
|
256
270
|
display: "flex",
|
|
257
|
-
gap: 1
|
|
271
|
+
gap: 1,
|
|
272
|
+
alignItems: "center"
|
|
258
273
|
},
|
|
259
274
|
children: [
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
onClick: () =>
|
|
275
|
+
ot,
|
|
276
|
+
W && /* @__PURE__ */ m(re, {
|
|
277
|
+
onClick: () => g((e) => !e),
|
|
263
278
|
variant: "outlined",
|
|
264
|
-
startIcon: /* @__PURE__ */
|
|
265
|
-
loading:
|
|
279
|
+
startIcon: /* @__PURE__ */ m(Ee, { sx: { height: "12px" } }),
|
|
280
|
+
loading: ke,
|
|
266
281
|
children: "Download"
|
|
267
282
|
}),
|
|
268
|
-
|
|
269
|
-
title:
|
|
270
|
-
doi:
|
|
271
|
-
boilerplateText:
|
|
272
|
-
defaultCitationFormat:
|
|
283
|
+
Ke && Q && /* @__PURE__ */ m(ue, {
|
|
284
|
+
title: P,
|
|
285
|
+
doi: Q,
|
|
286
|
+
boilerplateText: Ye,
|
|
287
|
+
defaultCitationFormat: Je
|
|
273
288
|
}),
|
|
274
|
-
|
|
289
|
+
qe && E && /* @__PURE__ */ m(_e, { ...Le })
|
|
275
290
|
]
|
|
276
291
|
})
|
|
277
292
|
});
|
|
278
293
|
}
|
|
279
294
|
//#endregion
|
|
280
|
-
export {
|
|
295
|
+
export { g as TableRowGenericCard, g as default };
|
|
281
296
|
|
|
282
297
|
//# sourceMappingURL=TableRowGenericCard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableRowGenericCard.js","names":[],"sources":["../../../src/components/GenericCard/TableRowGenericCard.tsx"],"sourcesContent":["import { CommonCardProps } from '@/components/CardContainer/CardConfiguration'\nimport {\n getFileHandleAssociation,\n getLinkParams,\n getValueOrMultiValue,\n} from '@/components/GenericCard/CardUtils'\nimport CroissantButton from '@/components/GenericCard/CroissantButton/CroissantButton'\nimport { GenericCardIcon } from '@/components/GenericCard/GenericCardIcon'\nimport PortalDOI from '@/components/GenericCard/PortalDOI/PortalDOI'\nimport {\n getCandidateDoiId,\n useShowDoiCardLabel,\n} from '@/components/GenericCard/PortalDOI/PortalDOIUtils'\nimport { mapRowToRecord } from '@/components/SynapseTable/SynapseTableUtils'\nimport { useGetEntity } from '@/synapse-queries'\nimport { calculateFriendlyFileSize } from '@/utils/functions/calculateFriendlyFileSize'\nimport {\n isDatasetCollection,\n isTableEntity,\n} from '@/utils/functions/EntityTypeUtils'\nimport { PRODUCTION_ENDPOINT_CONFIG } from '@/utils/functions/getEndpoint'\nimport { parseSynId } from '@/utils/functions/RegularExpressions'\nimport { getColumnIndex } from '@/utils/functions/SqlFunctions'\nimport { TargetEnum } from '@/utils/html/TargetEnum'\nimport * as SynapseConstants from '@/utils/SynapseConstants'\nimport { GetAppTwoTone } from '@mui/icons-material'\nimport { Box, Collapse, Link, Stack, Typography } from '@mui/material'\nimport {\n ColumnModel,\n ColumnTypeEnum,\n Entity,\n SelectColumn,\n Table,\n} from '@sage-bionetworks/synapse-types'\nimport React, { useCallback, useMemo, useState } from 'react'\nimport { useInView } from 'react-intersection-observer'\nimport CitationPopover from '../CitationPopover'\nimport { EntityDownloadConfirmation } from '../EntityDownloadConfirmation'\nimport { HeaderCardVariant } from '../HeaderCard'\nimport IconList from '../IconList'\nimport { useQueryContext } from '../QueryContext/QueryContext'\nimport { useQueryVisualizationContext } from '../QueryVisualizationWrapper'\nimport ShareThisPage, {\n ShareThisPageProps,\n} from '../ShareThisPage/ShareThisPage'\nimport { SustainabilityScorecardProps } from '../SustainabilityScorecard/SustainabilityScorecard'\nimport GenericCard from './GenericCard'\nimport GenericCardActionButton from './GenericCardActionButton'\nimport { PortalDOIConfiguration } from './PortalDOI/PortalDOIConfiguration'\nimport { SynapseCardLabel } from './SynapseCardLabel'\nimport { useResolvedSynapseEntity } from './useResolvedSynapseEntity'\n\ntype RowSynapseEntityConfig = {\n /** Use the table rowId to resolve the Synapse entity ID. */\n id: {\n source: 'rowId'\n }\n /** Use the table rowVersionNumber to resolve the Synapse entity version (if available). */\n version?: {\n source: 'rowVersionNumber'\n }\n}\n\ntype ColumnSynapseEntityConfig = {\n /** Use a column value to resolve the Synapse entity ID. */\n id: {\n source: 'column'\n columnName: string\n }\n /** Use a column value to resolve the Synapse entity version. */\n version?: {\n source: 'column'\n columnName: string\n }\n}\n\nexport type SynapseEntityConfig =\n | RowSynapseEntityConfig\n | ColumnSynapseEntityConfig\n\n/**\n * Maps a table query result to a GenericCard.\n */\nexport type TableToGenericCardMapping = {\n /** The 'type' of resource a card refers to. Renders a label on the card with this string value.\n * Can be hidden by setting it to '' (empty string)\n */\n type: string\n /** The column name whose data contains the title of the card */\n title: string\n /** The column name whose data contains the subtitle of the card */\n subTitle?: string\n /** The column name whose data contains the description of the card */\n description?: string\n /** If true, a 'Cite As' button will be displayed for those cards with a DOI in the 'doi' column */\n includeCitation?: boolean\n /** If true, a 'Share this page' button will be displayed */\n includeShareButton?: boolean\n /**\n * Configuration for displaying the SustainabilityScorecard component\n */\n sustainabilityScorecard?: SustainabilityScorecardProps\n /** The initial citation format to use in the 'Cite As' UI */\n defaultCitationFormat?: 'bibtex' | 'apa' | 'ieee' | 'nature' | 'science'\n /** Static text displayed in the 'Cite As' UI */\n citationBoilerplateText?: string\n /** The column name whose data contains the value used to map to the icon */\n icon?: string\n /** The column name whose data contains an image file handle to be displayed on the card */\n imageFileHandleColumnName?: string\n /** Static boolean value used if the image displayed using `imageFileHandleColumnName` requires extra padding */\n thumbnailRequiresPadding?: boolean\n /** Array of column names to be used for labels in the Card Footer */\n secondaryLabels?: string[]\n /** Can be used to add a custom secondary label */\n customSecondaryLabelConfig?: {\n /** The displayed label key */\n key: string\n /** The value to display */\n value: React.ReactNode\n /** Callback to determine visibility of the label\n * @param schema the mapping of columnName to data index\n * @param data the row data\n */\n isVisible: (schema: Record<string, number>, data: string[]) => boolean\n }\n /** Column name of the link value if the title should be linked */\n link?: string\n /** Column name of the STRING_LIST column that includes icon names that represent icons that should be displayed on the card */\n dataTypeIconNames?: string\n /**\n * Ordered list of column names to display to the right of the title area.\n * Each renders as \"Display Name: Value\" on its own line. Rows with empty values are skipped.\n * The display name is derived from getColumnDisplayName (respects column aliases and unCamelCase).\n *\n * Can also be a function that receives the schema and row data and returns the list of column\n * names to display, allowing the displayed details to vary based on the row's actual values.\n */\n titleAreaDetails?:\n | string[]\n | ((schema: Record<string, number>, data: string[]) => string[])\n /** Configuration for resolving the Synapse entity ID/version represented by each card row.\n * The ID and version sources must both reference either row-based values or column-based values.\n */\n synapseEntityConfig?: SynapseEntityConfig\n /** The column name whose data contains a synId that can be used to show a button to add the corresponding entity to the download cart. */\n downloadCartSynId?: string\n /** Configuration to display a DOI, as well as the ability to create one for users with such permission */\n portalDoiConfiguration?: PortalDOIConfiguration\n}\n\nexport type TableRowGenericCardProps = {\n /** The schema that maps a table result to the GenericCard UI */\n genericCardSchema: TableToGenericCardMapping\n /** The table's SelectColumns */\n selectColumns?: SelectColumn[]\n /** The table's ColumnModels */\n columnModels?: ColumnModel[]\n /** If true, the 'type' column will be used as the icon string to choose the icon */\n useTypeColumnForIcon?: boolean\n /** If true, render the card as a HeaderCard */\n isHeader?: boolean\n /** If isHeader is true, use this variant of HeaderCard */\n headerCardVariant?: HeaderCardVariant\n isAlignToLeftNav?: boolean\n /** Mapping of column name to row data index */\n schema: Record<string, number>\n /** The row data */\n data: string[]\n /** The ID of the table row */\n rowId?: number\n /** The versionNumber of the table row */\n versionNumber?: number\n /** Optional props for the ShareThisPage component */\n sharePageLinkButtonProps?: ShareThisPageProps\n /** Optional function that receives schema and data and returns a ReactNode to be rendered next to the card type */\n CardTypeAdornment?: React.ComponentType<{\n schema: Record<string, number>\n data: string[]\n }>\n} & CommonCardProps\n\n// SWC-6115: special rendering of the version column (for Views)\nfunction VersionLabel(props: { synapseId: string; version: string }) {\n const { synapseId, version } = props\n return (\n <span>\n {version} \n <a\n target={TargetEnum.NEW_WINDOW}\n rel=\"noopener noreferrer\"\n href={`${PRODUCTION_ENDPOINT_CONFIG.PORTAL}Synapse:${synapseId}.${version}`}\n >\n (Show Version History on Synapse)\n </a>\n </span>\n )\n}\n\n/**\n * Maps a table row to a GenericCard.\n */\nexport function TableRowGenericCard(props: TableRowGenericCardProps) {\n const [showDownloadConfirmation, setShowDownloadConfirmation] =\n useState(false)\n const [downloadButtonLoading, setDownloadButtonLoading] = useState(false)\n\n const { entityId, versionNumber } = useQueryContext()\n const { getColumnDisplayName } = useQueryVisualizationContext()\n\n const { ref, inView: cardIsInView } = useInView()\n\n const { data: table } = useGetEntity<Table>(entityId, versionNumber)\n\n const {\n schema,\n data,\n rowId,\n versionNumber: rowVersionNumber,\n genericCardSchema,\n secondaryLabelLimit,\n sharePageLinkButtonProps,\n selectColumns,\n columnModels,\n iconOptions,\n useTypeColumnForIcon = false,\n isHeader = false,\n sustainabilityScorecard,\n headerCardVariant,\n titleLinkConfig,\n ctaLinkConfig,\n ctaLinkPosition,\n labelLinkConfig,\n descriptionConfig,\n columnIconOptions,\n CardTypeAdornment,\n charCountCutoff,\n } = props\n\n const {\n link = '',\n type,\n includeCitation,\n includeShareButton,\n defaultCitationFormat,\n citationBoilerplateText,\n downloadCartSynId,\n portalDoiConfiguration,\n } = genericCardSchema\n const title = data[schema[genericCardSchema.title]]\n let subTitle =\n genericCardSchema.subTitle && data[schema[genericCardSchema.subTitle]]\n subTitle =\n genericCardSchema.subTitle &&\n getValueOrMultiValue({\n value: subTitle,\n columnName: genericCardSchema.subTitle,\n selectColumns,\n columnModels,\n }).str\n const description = data[schema[genericCardSchema.description || '']]\n const iconValue = data[schema[genericCardSchema.icon || '']]\n const dataTypeIconNames =\n data[schema[genericCardSchema.dataTypeIconNames || '']]\n const imageFileHandleIdValue =\n data[schema[genericCardSchema.imageFileHandleColumnName || '']]\n const titleColumnModel = columnModels?.find(\n el => genericCardSchema.link === el.name,\n )\n const titleColumnType = titleColumnModel?.columnType\n // wrap link in parens because undefined would throw an error\n const linkValue: string = data[schema[link]] || ''\n const { href, target } = getLinkParams(\n linkValue,\n titleLinkConfig,\n data,\n schema,\n rowId,\n )\n\n const synapseEntityConfig = genericCardSchema.synapseEntityConfig\n\n const getColumnValue = useCallback(\n (columnName?: string) => {\n if (!columnName) {\n return undefined\n }\n const columnIndex = schema[columnName]\n if (columnIndex === undefined) {\n return undefined\n }\n return data[columnIndex]\n },\n [schema, data],\n )\n\n const resolvedTitleAreaRightContent = useMemo(() => {\n const { titleAreaDetails } = genericCardSchema\n if (!titleAreaDetails) return undefined\n const columns =\n typeof titleAreaDetails === 'function'\n ? titleAreaDetails(schema, data)\n : titleAreaDetails\n if (columns.length === 0) return undefined\n const rows = columns\n .map(columnName => {\n const rawValue: string | undefined = data[schema[columnName]]\n if (!rawValue) return null\n return { name: getColumnDisplayName(columnName), rawValue, columnName }\n })\n .filter(Boolean) as {\n name: string\n rawValue: string\n columnName: string\n }[]\n if (rows.length === 0) return undefined\n return (\n <Stack direction=\"column\" gap=\"4px\">\n {rows.map(({ name, rawValue, columnName }) => (\n <Stack key={columnName} direction=\"row\" gap=\"4px\" alignItems=\"center\">\n <Typography component=\"span\" variant=\"body1\">\n {name}:\n </Typography>\n <SynapseCardLabel\n value={rawValue}\n columnName={columnName}\n labelLink={undefined}\n isHeader={isHeader}\n selectColumns={selectColumns}\n columnModels={columnModels}\n rowData={data}\n columnIconOptions={columnIconOptions}\n />\n </Stack>\n ))}\n </Stack>\n )\n }, [\n genericCardSchema,\n data,\n schema,\n getColumnDisplayName,\n isHeader,\n selectColumns,\n columnModels,\n columnIconOptions,\n ])\n\n const {\n entityId: resolvedSynapseEntityId,\n entityVersionNumber: resolvedSynapseEntityVersionNumber,\n } = useResolvedSynapseEntity({\n synapseEntityConfig,\n getColumnValue,\n rowId,\n rowVersionNumber,\n })\n\n let resolvedDownloadCartSynIdValue = resolvedSynapseEntityId\n let resolvedDownloadCartVersionNumber = resolvedSynapseEntityVersionNumber\n\n if (downloadCartSynId) {\n const reference = parseSynId(getColumnValue(downloadCartSynId) ?? '')\n resolvedDownloadCartSynIdValue = reference?.targetId\n resolvedDownloadCartVersionNumber = reference?.targetVersionNumber\n }\n\n // Transform the row to a record of (columnName, value) pairs for compatibility with getCandidateDoiId\n const dataAsRecord: Record<string, string | null> = useMemo(\n () => mapRowToRecord(data, schema),\n [data, schema],\n )\n\n const candidateDoiId = getCandidateDoiId({\n data: dataAsRecord,\n portalDoiConfiguration,\n })\n\n const showDoiCardLabel = useShowDoiCardLabel({\n portalId: portalDoiConfiguration?.portalId,\n resourceId: candidateDoiId,\n })\n\n const values: {\n columnDisplayName: string\n value: React.ReactNode\n columnName?: string\n }[] = []\n const { secondaryLabels = [] } = genericCardSchema\n const customLabelConfig = genericCardSchema.customSecondaryLabelConfig\n\n // PORTALS-3549 - if a DOI exists or can be created by the current user, show it\n if (\n showDoiCardLabel &&\n portalDoiConfiguration &&\n candidateDoiId &&\n cardIsInView\n ) {\n values.push({\n columnDisplayName: 'DOI',\n value: (\n <PortalDOI\n portalId={portalDoiConfiguration.portalId}\n resourceId={candidateDoiId}\n />\n ),\n })\n }\n\n // Overwrite the 'HOW TO DOWNLOAD' link if a synapse ID is available\n if (customLabelConfig?.isVisible(schema, data)) {\n const { key, value } = customLabelConfig\n if (resolvedDownloadCartSynIdValue) {\n values.push({\n columnDisplayName: 'HOW TO DOWNLOAD',\n value: (\n <Link onClick={() => setShowDownloadConfirmation(val => !val)}>\n Click here to add to Synapse download list\n </Link>\n ),\n })\n } else {\n values.push({ columnDisplayName: key, value })\n }\n }\n\n const isView = table && !isTableEntity(table)\n for (let i = 0; i < secondaryLabels.length; i += 1) {\n const columnName = secondaryLabels[i]\n const rawValue: string | undefined = data[schema[columnName]]\n let renderedValue: React.ReactNode = rawValue\n let columnDisplayName\n if (renderedValue && rawValue !== '[]' && rawValue !== '[\"\"]') {\n // PORTALS-2750: special rendering of the datasetSizeInBytes (for Dataset Collections)\n if (\n isDatasetCollection(table as Entity) &&\n columnName === 'datasetSizeInBytes'\n ) {\n columnDisplayName = 'Size'\n renderedValue = calculateFriendlyFileSize(parseInt(rawValue))\n } // SWC-6115: special rendering of the version column (for Views)\n else if (isView && columnName === 'currentVersion') {\n const synapseId = data[schema.id]\n renderedValue = (\n <VersionLabel synapseId={synapseId} version={rawValue} />\n )\n columnDisplayName = 'Version'\n } else {\n const labelLink = labelLinkConfig?.find(\n el => el.matchColumnName === columnName,\n )\n renderedValue = (\n <SynapseCardLabel\n value={rawValue}\n columnName={columnName}\n labelLink={labelLink}\n isHeader={isHeader}\n selectColumns={selectColumns}\n columnModels={columnModels}\n rowData={data}\n columnIconOptions={columnIconOptions}\n />\n )\n columnDisplayName = getColumnDisplayName(columnName)\n }\n values.push({ columnDisplayName, value: renderedValue, columnName })\n }\n }\n\n const fileHandleId = imageFileHandleIdValue || linkValue\n\n /**\n * To show a direct download link to a file, we need to determine the association that gives permission to download the file.\n */\n const fileHandleAssociation = getFileHandleAssociation(\n table,\n fileHandleId,\n data[schema.id],\n )\n\n const descriptionSubTitle = getColumnDisplayName(\n genericCardSchema.description || '',\n )\n\n const doiColumnIndex = getColumnIndex('doi', selectColumns, columnModels)\n const doiValue =\n doiColumnIndex !== undefined ? data[doiColumnIndex] : undefined\n\n // Normalize ctaLinkConfig to array and resolve each config\n const ctaLinkConfigs = ctaLinkConfig\n ? Array.isArray(ctaLinkConfig)\n ? ctaLinkConfig\n : [ctaLinkConfig]\n : []\n const resolvedCtaLinkConfigs = ctaLinkConfigs\n .map(config => {\n const ctaLinkValue: string = data[schema[config.link]] || ''\n if (!ctaLinkValue) return null\n const { href, target } = getLinkParams(\n ctaLinkValue,\n undefined, //card link config\n data,\n schema,\n rowId,\n )\n return {\n text: config.endIcon ? (\n <div style={{ display: 'flex', alignItems: 'center', gap: '10px' }}>\n {config.text}\n {config.endIcon}\n </div>\n ) : (\n config.text\n ),\n href,\n target,\n }\n })\n .filter(Boolean) as { text: string; href: string; target?: string }[]\n\n let croissantButton = <></>\n if (\n resolvedSynapseEntityId != null &&\n resolvedSynapseEntityVersionNumber != null\n ) {\n croissantButton = (\n <CroissantButton\n datasetId={resolvedSynapseEntityId}\n datasetVersionNumber={resolvedSynapseEntityVersionNumber}\n />\n )\n }\n\n const resolvedCardTypeAdornment = CardTypeAdornment ? (\n <CardTypeAdornment schema={schema} data={data} />\n ) : null\n\n let isRenderingIcon = true\n if (isHeader && !imageFileHandleIdValue && !iconValue) {\n // For header cards, if there is no image or explicit icon value, we don't show an icon at all\n isRenderingIcon = false\n }\n return (\n <GenericCard\n ref={ref}\n icon={\n isRenderingIcon ? (\n <GenericCardIcon\n type={\n useTypeColumnForIcon\n ? data[schema['type']]\n : genericCardSchema.type\n }\n useTypeForIcon={useTypeColumnForIcon}\n thumbnailRequiresPadding={\n genericCardSchema.thumbnailRequiresPadding\n }\n imageFileHandleId={imageFileHandleIdValue}\n fileHandleAssociation={fileHandleAssociation}\n iconOptions={iconOptions}\n iconValue={iconValue}\n />\n ) : undefined\n }\n isHeader={isHeader}\n sustainabilityScorecard={sustainabilityScorecard}\n headerCardVariant={headerCardVariant}\n type={type}\n title={title}\n subtitle={subTitle}\n titleLinkConfiguration={{ target, href }}\n cardTypeAdornment={resolvedCardTypeAdornment}\n titleAsFileHandleLinkConfiguration={\n !titleLinkConfig &&\n titleColumnType === ColumnTypeEnum.FILEHANDLEID &&\n fileHandleAssociation\n ? {\n fileHandleAssociation: fileHandleAssociation,\n showDownloadIcon: type !== SynapseConstants.EXPERIMENTAL,\n }\n : undefined\n }\n ctaLinkConfig={\n resolvedCtaLinkConfigs.length > 0 ? resolvedCtaLinkConfigs : undefined\n }\n ctaLinkPosition={ctaLinkPosition}\n titleAreaRightContent={resolvedTitleAreaRightContent}\n description={description}\n descriptionSubTitle={descriptionSubTitle}\n descriptionConfig={descriptionConfig}\n charCountCutoff={charCountCutoff}\n labels={values}\n secondaryLabelLimit={secondaryLabelLimit}\n useStylesForDisplayedImage={Boolean(imageFileHandleIdValue)}\n cardTopContent={\n resolvedDownloadCartSynIdValue && (\n <Collapse in={showDownloadConfirmation}>\n <EntityDownloadConfirmation\n entityId={resolvedDownloadCartSynIdValue}\n versionNumber={resolvedDownloadCartVersionNumber}\n handleClose={() => setShowDownloadConfirmation(false)}\n onIsLoadingChange={isLoading => {\n setDownloadButtonLoading(isLoading)\n }}\n />\n </Collapse>\n )\n }\n renderedIconList={\n // If the portal configs has columnIconOptions.columns.dataType option\n // and the column value is not null, display the card data type icons\n columnIconOptions?.columns?.dataType &&\n dataTypeIconNames?.length && (\n <div style={{ marginTop: '20px' }}>\n <IconList\n iconConfigs={columnIconOptions.columns.dataType}\n iconNames={JSON.parse(dataTypeIconNames) as string[]}\n commonIconProps={{\n sx: { fontSize: '40px' },\n }}\n useBackground={true}\n useTheme={true}\n />\n </div>\n )\n }\n cardTopButtons={\n <Box sx={{ display: 'flex', gap: 1 }}>\n {croissantButton}\n {/* PORTALS-3386 Use synapseLink in schema to add entity to download cart */}\n {resolvedDownloadCartSynIdValue && (\n <GenericCardActionButton\n onClick={() => setShowDownloadConfirmation(val => !val)}\n variant=\"outlined\"\n startIcon={<GetAppTwoTone sx={{ height: '12px' }} />}\n loading={downloadButtonLoading}\n >\n Download\n </GenericCardActionButton>\n )}\n {includeCitation && doiValue && (\n <CitationPopover\n title={title}\n doi={doiValue}\n boilerplateText={citationBoilerplateText}\n defaultCitationFormat={defaultCitationFormat}\n />\n )}\n {includeShareButton && isHeader && (\n <ShareThisPage {...s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ACV,wBAAwB;GAAE;GAAQ;EAAK;EACvC,mBAAmB;EACnB,oCACE,CAAC,KACD,OAAoB,GAAe,gBACnC,IACI;GACyB;GACvB,kBAAkB,MAAS;EAC7B,IACA,KAAA;EAEN,eACE,EAAuB,SAAS,IAAI,IAAyB,KAAA;EAE9C;EACjB,uBAAuB;EACV;EACQ;EACF;EACF;EACjB,QAAQ;EACa;EACrB,4BAA4B,EAAQ;EACpC,gBACE,KACE,kBAAC,IAAD;GAAU,IAAI;aACZ,kBAAC,IAAD;IACE,UAAU;IACV,eAAe;IACf,mBAAmB,EAA4B,EAAK;IACpD,oBAAmB,MAAa;KAC9B,GAAyB,CAAS;IACpC;GACD,CAAA;EACO,CAAA;EAGd,kBAGE,GAAmB,SAAS,YAC5B,GAAmB,UACjB,kBAAC,OAAD;GAAK,OAAO,EAAE,WAAW,OAAO;aAC9B,kBAAC,IAAD;IACE,aAAa,EAAkB,QAAQ;IACvC,WAAW,KAAK,MAAM,CAAiB;IACvC,iBAAiB,EACf,IAAI,EAAE,UAAU,OAAO,EACzB;IACA,eAAe;IACf,UAAU;GACX,CAAA;EACE,CAAA;EAGT,gBACE,kBAAC,IAAD;GAAK,IAAI;IAAE,SAAS;IAAQ,KAAK;GAAE;aAAnC;IACG;IAEA,KACC,kBAAC,IAAD;KACE,eAAe,GAA4B,MAAO,CAAC,CAAG;KACtD,SAAQ;KACR,WAAW,kBAAC,IAAD,EAAe,IAAI,EAAE,QAAQ,OAAO,EAAI,CAAA;KACnD,SAAS;eACV;IAEwB,CAAA;IAE1B,MAAmB,KAClB,kBAAC,IAAD;KACS;KACP,KAAK;KACL,iBAAiB;KACM;IACxB,CAAA;IAEF,MAAsB,KACrB,kBAAC,IAAD,EAAe,GAAI,GAA2B,CAAA;GAE7C;;CAER,CAAA;AAEL"}
|
|
1
|
+
{"version":3,"file":"TableRowGenericCard.js","names":[],"sources":["../../../src/components/GenericCard/TableRowGenericCard.tsx"],"sourcesContent":["import { CommonCardProps } from '@/components/CardContainer/CardConfiguration'\nimport {\n getFileHandleAssociation,\n getLinkParams,\n getValueOrMultiValue,\n} from '@/components/GenericCard/CardUtils'\nimport CroissantButton from '@/components/GenericCard/CroissantButton/CroissantButton'\nimport { GenericCardIcon } from '@/components/GenericCard/GenericCardIcon'\nimport PortalDOI from '@/components/GenericCard/PortalDOI/PortalDOI'\nimport {\n getCandidateDoiId,\n useShowDoiCardLabel,\n} from '@/components/GenericCard/PortalDOI/PortalDOIUtils'\nimport { mapRowToRecord } from '@/components/SynapseTable/SynapseTableUtils'\nimport { useGetEntity } from '@/synapse-queries'\nimport { calculateFriendlyFileSize } from '@/utils/functions/calculateFriendlyFileSize'\nimport {\n isDatasetCollection,\n isTableEntity,\n} from '@/utils/functions/EntityTypeUtils'\nimport { PRODUCTION_ENDPOINT_CONFIG } from '@/utils/functions/getEndpoint'\nimport { parseSynId } from '@/utils/functions/RegularExpressions'\nimport { getColumnIndex } from '@/utils/functions/SqlFunctions'\nimport { TargetEnum } from '@/utils/html/TargetEnum'\nimport * as SynapseConstants from '@/utils/SynapseConstants'\nimport { GetAppTwoTone } from '@mui/icons-material'\nimport { Box, Collapse, Link, Stack, Typography } from '@mui/material'\nimport {\n ColumnModel,\n ColumnTypeEnum,\n Entity,\n SelectColumn,\n Table,\n} from '@sage-bionetworks/synapse-types'\nimport React, { useCallback, useMemo, useState } from 'react'\nimport { useInView } from 'react-intersection-observer'\nimport CitationPopover from '../CitationPopover'\nimport { EntityDownloadConfirmation } from '../EntityDownloadConfirmation'\nimport { HeaderCardVariant } from '../HeaderCard'\nimport IconList from '../IconList'\nimport { useQueryContext } from '../QueryContext/QueryContext'\nimport { useQueryVisualizationContext } from '../QueryVisualizationWrapper'\nimport ShareThisPage, {\n ShareThisPageProps,\n} from '../ShareThisPage/ShareThisPage'\nimport { SustainabilityScorecardProps } from '../SustainabilityScorecard/SustainabilityScorecard'\nimport GenericCard from './GenericCard'\nimport GenericCardActionButton from './GenericCardActionButton'\nimport DuoTermTags from './DuoTermTags/DuoTermTags'\nimport { parseDuoModifiers } from './DuoTermTags/duoTerms'\nimport { PortalDOIConfiguration } from './PortalDOI/PortalDOIConfiguration'\nimport { SynapseCardLabel } from './SynapseCardLabel'\nimport { useResolvedSynapseEntity } from './useResolvedSynapseEntity'\n\ntype RowSynapseEntityConfig = {\n /** Use the table rowId to resolve the Synapse entity ID. */\n id: {\n source: 'rowId'\n }\n /** Use the table rowVersionNumber to resolve the Synapse entity version (if available). */\n version?: {\n source: 'rowVersionNumber'\n }\n}\n\ntype ColumnSynapseEntityConfig = {\n /** Use a column value to resolve the Synapse entity ID. */\n id: {\n source: 'column'\n columnName: string\n }\n /** Use a column value to resolve the Synapse entity version. */\n version?: {\n source: 'column'\n columnName: string\n }\n}\n\nexport type SynapseEntityConfig =\n | RowSynapseEntityConfig\n | ColumnSynapseEntityConfig\n\n/**\n * Maps a table query result to a GenericCard.\n */\nexport type TableToGenericCardMapping = {\n /** The 'type' of resource a card refers to. Renders a label on the card with this string value.\n * Can be hidden by setting it to '' (empty string)\n */\n type: string\n /** The column name whose data contains the title of the card */\n title: string\n /** The column name whose data contains the subtitle of the card */\n subTitle?: string\n /** The column name whose data contains the description of the card */\n description?: string\n /** If true, a 'Cite As' button will be displayed for those cards with a DOI in the 'doi' column */\n includeCitation?: boolean\n /** If true, a 'Share this page' button will be displayed */\n includeShareButton?: boolean\n /**\n * Configuration for displaying the SustainabilityScorecard component\n */\n sustainabilityScorecard?: SustainabilityScorecardProps\n /** The initial citation format to use in the 'Cite As' UI */\n defaultCitationFormat?: 'bibtex' | 'apa' | 'ieee' | 'nature' | 'science'\n /** Static text displayed in the 'Cite As' UI */\n citationBoilerplateText?: string\n /** The column name whose data contains the value used to map to the icon */\n icon?: string\n /** The column name whose data contains an image file handle to be displayed on the card */\n imageFileHandleColumnName?: string\n /** Static boolean value used if the image displayed using `imageFileHandleColumnName` requires extra padding */\n thumbnailRequiresPadding?: boolean\n /** Array of column names to be used for labels in the Card Footer */\n secondaryLabels?: string[]\n /** Can be used to add a custom secondary label */\n customSecondaryLabelConfig?: {\n /** The displayed label key */\n key: string\n /** The value to display */\n value: React.ReactNode\n /** Callback to determine visibility of the label\n * @param schema the mapping of columnName to data index\n * @param data the row data\n */\n isVisible: (schema: Record<string, number>, data: string[]) => boolean\n }\n /** Column name of the link value if the title should be linked */\n link?: string\n /** Column name of the STRING_LIST column that includes icon names that represent icons that should be displayed on the card */\n dataTypeIconNames?: string\n /**\n * Ordered list of column names to display to the right of the title area.\n * Each renders as \"Display Name: Value\" on its own line. Rows with empty values are skipped.\n * The display name is derived from getColumnDisplayName (respects column aliases and unCamelCase).\n *\n * Can also be a function that receives the schema and row data and returns the list of column\n * names to display, allowing the displayed details to vary based on the row's actual values.\n */\n titleAreaDetails?:\n | string[]\n | ((schema: Record<string, number>, data: string[]) => string[])\n /** Configuration for resolving the Synapse entity ID/version represented by each card row.\n * The ID and version sources must both reference either row-based values or column-based values.\n */\n synapseEntityConfig?: SynapseEntityConfig\n /** The column name whose data contains a synId that can be used to show a button to add the corresponding entity to the download cart. */\n downloadCartSynId?: string\n /** Configuration to display a DOI, as well as the ability to create one for users with such permission */\n portalDoiConfiguration?: PortalDOIConfiguration\n /**\n * Column name of a STRING_LIST of Data Use Ontology (DUO) values (ontology\n * codes or term names). When set, the values are rendered as DUO tags in a\n * \"Data Usage Restrictions\" row in the card's metadata section.\n */\n dataUseModifiersColumnName?: string\n}\n\nexport type TableRowGenericCardProps = {\n /** The schema that maps a table result to the GenericCard UI */\n genericCardSchema: TableToGenericCardMapping\n /** The table's SelectColumns */\n selectColumns?: SelectColumn[]\n /** The table's ColumnModels */\n columnModels?: ColumnModel[]\n /** If true, the 'type' column will be used as the icon string to choose the icon */\n useTypeColumnForIcon?: boolean\n /** If true, render the card as a HeaderCard */\n isHeader?: boolean\n /** If isHeader is true, use this variant of HeaderCard */\n headerCardVariant?: HeaderCardVariant\n isAlignToLeftNav?: boolean\n /** Mapping of column name to row data index */\n schema: Record<string, number>\n /** The row data */\n data: string[]\n /** The ID of the table row */\n rowId?: number\n /** The versionNumber of the table row */\n versionNumber?: number\n /** Optional props for the ShareThisPage component */\n sharePageLinkButtonProps?: ShareThisPageProps\n /** Optional function that receives schema and data and returns a ReactNode to be rendered next to the card type */\n CardTypeAdornment?: React.ComponentType<{\n schema: Record<string, number>\n data: string[]\n }>\n} & CommonCardProps\n\n// SWC-6115: special rendering of the version column (for Views)\nfunction VersionLabel(props: { synapseId: string; version: string }) {\n const { synapseId, version } = props\n return (\n <span>\n {version} \n <a\n target={TargetEnum.NEW_WINDOW}\n rel=\"noopener noreferrer\"\n href={`${PRODUCTION_ENDPOINT_CONFIG.PORTAL}Synapse:${synapseId}.${version}`}\n >\n (Show Version History on Synapse)\n </a>\n </span>\n )\n}\n\n/**\n * Maps a table row to a GenericCard.\n */\nexport function TableRowGenericCard(props: TableRowGenericCardProps) {\n const [showDownloadConfirmation, setShowDownloadConfirmation] =\n useState(false)\n const [downloadButtonLoading, setDownloadButtonLoading] = useState(false)\n\n const { entityId, versionNumber } = useQueryContext()\n const { getColumnDisplayName } = useQueryVisualizationContext()\n\n const { ref, inView: cardIsInView } = useInView()\n\n const { data: table } = useGetEntity<Table>(entityId, versionNumber)\n\n const {\n schema,\n data,\n rowId,\n versionNumber: rowVersionNumber,\n genericCardSchema,\n secondaryLabelLimit,\n sharePageLinkButtonProps,\n selectColumns,\n columnModels,\n iconOptions,\n useTypeColumnForIcon = false,\n isHeader = false,\n sustainabilityScorecard,\n headerCardVariant,\n titleLinkConfig,\n ctaLinkConfig,\n ctaLinkPosition,\n labelLinkConfig,\n descriptionConfig,\n columnIconOptions,\n CardTypeAdornment,\n charCountCutoff,\n } = props\n\n const {\n link = '',\n type,\n includeCitation,\n includeShareButton,\n defaultCitationFormat,\n citationBoilerplateText,\n downloadCartSynId,\n portalDoiConfiguration,\n } = genericCardSchema\n const title = data[schema[genericCardSchema.title]]\n let subTitle =\n genericCardSchema.subTitle && data[schema[genericCardSchema.subTitle]]\n subTitle =\n genericCardSchema.subTitle &&\n getValueOrMultiValue({\n value: subTitle,\n columnName: genericCardSchema.subTitle,\n selectColumns,\n columnModels,\n }).str\n const description = data[schema[genericCardSchema.description || '']]\n const iconValue = data[schema[genericCardSchema.icon || '']]\n const dataTypeIconNames =\n data[schema[genericCardSchema.dataTypeIconNames || '']]\n const imageFileHandleIdValue =\n data[schema[genericCardSchema.imageFileHandleColumnName || '']]\n const titleColumnModel = columnModels?.find(\n el => genericCardSchema.link === el.name,\n )\n const titleColumnType = titleColumnModel?.columnType\n // wrap link in parens because undefined would throw an error\n const linkValue: string = data[schema[link]] || ''\n const { href, target } = getLinkParams(\n linkValue,\n titleLinkConfig,\n data,\n schema,\n rowId,\n )\n\n const synapseEntityConfig = genericCardSchema.synapseEntityConfig\n\n const getColumnValue = useCallback(\n (columnName?: string) => {\n if (!columnName) {\n return undefined\n }\n const columnIndex = schema[columnName]\n if (columnIndex === undefined) {\n return undefined\n }\n return data[columnIndex]\n },\n [schema, data],\n )\n\n // DUO (Data Use Ontology) tags, when a dataUseModifiers column is configured.\n // Rendered as a \"Data Usage Restrictions\" row in the metadata section.\n const duoContent = useMemo(() => {\n const col = genericCardSchema.dataUseModifiersColumnName\n if (!col) {\n return undefined\n }\n const terms = parseDuoModifiers(data[schema[col]])\n if (terms.length === 0) {\n return undefined\n }\n return <DuoTermTags terms={terms} />\n }, [genericCardSchema, data, schema])\n\n const resolvedTitleAreaRightContent = useMemo(() => {\n const { titleAreaDetails } = genericCardSchema\n if (!titleAreaDetails) return undefined\n const columns =\n typeof titleAreaDetails === 'function'\n ? titleAreaDetails(schema, data)\n : titleAreaDetails\n if (columns.length === 0) return undefined\n const rows = columns\n .map(columnName => {\n const rawValue: string | undefined = data[schema[columnName]]\n if (!rawValue) return null\n return { name: getColumnDisplayName(columnName), rawValue, columnName }\n })\n .filter(Boolean) as {\n name: string\n rawValue: string\n columnName: string\n }[]\n if (rows.length === 0) return undefined\n return (\n <Stack direction=\"column\" gap=\"4px\">\n {rows.map(({ name, rawValue, columnName }) => (\n <Stack key={columnName} direction=\"row\" gap=\"4px\" alignItems=\"center\">\n <Typography component=\"span\" variant=\"body1\">\n {name}:\n </Typography>\n <SynapseCardLabel\n value={rawValue}\n columnName={columnName}\n labelLink={undefined}\n isHeader={isHeader}\n selectColumns={selectColumns}\n columnModels={columnModels}\n rowData={data}\n columnIconOptions={columnIconOptions}\n />\n </Stack>\n ))}\n </Stack>\n )\n }, [\n genericCardSchema,\n data,\n schema,\n getColumnDisplayName,\n isHeader,\n selectColumns,\n columnModels,\n columnIconOptions,\n ])\n\n const {\n entityId: resolvedSynapseEntityId,\n entityVersionNumber: resolvedSynapseEntityVersionNumber,\n } = useResolvedSynapseEntity({\n synapseEntityConfig,\n getColumnValue,\n rowId,\n rowVersionNumber,\n })\n\n let resolvedDownloadCartSynIdValue = resolvedSynapseEntityId\n let resolvedDownloadCartVersionNumber = resolvedSynapseEntityVersionNumber\n\n if (downloadCartSynId) {\n const reference = parseSynId(getColumnValue(downloadCartSynId) ?? '')\n resolvedDownloadCartSynIdValue = reference?.targetId\n resolvedDownloadCartVersionNumber = reference?.targetVersionNumber\n }\n\n // Transform the row to a record of (columnName, value) pairs for compatibility with getCandidateDoiId\n const dataAsRecord: Record<string, string | null> = useMemo(\n () => mapRowToRecord(data, schema),\n [data, schema],\n )\n\n const candidateDoiId = getCandidateDoiId({\n data: dataAsRecord,\n portalDoiConfiguration,\n })\n\n const showDoiCardLabel = useShowDoiCardLabel({\n portalId: portalDoiConfiguration?.portalId,\n resourceId: candidateDoiId,\n })\n\n const values: {\n columnDisplayName: string\n value: React.ReactNode\n columnName?: string\n }[] = []\n const { secondaryLabels = [] } = genericCardSchema\n const customLabelConfig = genericCardSchema.customSecondaryLabelConfig\n\n // DUO tags rendered as a metadata row (alongside \"How to download\", size, …).\n if (duoContent) {\n values.push({\n columnDisplayName: 'Data Usage Restrictions',\n value: duoContent,\n })\n }\n\n // PORTALS-3549 - if a DOI exists or can be created by the current user, show it\n if (\n showDoiCardLabel &&\n portalDoiConfiguration &&\n candidateDoiId &&\n cardIsInView\n ) {\n values.push({\n columnDisplayName: 'DOI',\n value: (\n <PortalDOI\n portalId={portalDoiConfiguration.portalId}\n resourceId={candidateDoiId}\n />\n ),\n })\n }\n\n // Overwrite the 'HOW TO DOWNLOAD' link if a synapse ID is available\n if (customLabelConfig?.isVisible(schema, data)) {\n const { key, value } = customLabelConfig\n if (resolvedDownloadCartSynIdValue) {\n values.push({\n columnDisplayName: 'HOW TO DOWNLOAD',\n value: (\n <Link onClick={() => setShowDownloadConfirmation(val => !val)}>\n Click here to add to Synapse download list\n </Link>\n ),\n })\n } else {\n values.push({ columnDisplayName: key, value })\n }\n }\n\n const isView = table && !isTableEntity(table)\n for (let i = 0; i < secondaryLabels.length; i += 1) {\n const columnName = secondaryLabels[i]\n const rawValue: string | undefined = data[schema[columnName]]\n let renderedValue: React.ReactNode = rawValue\n let columnDisplayName\n if (renderedValue && rawValue !== '[]' && rawValue !== '[\"\"]') {\n // PORTALS-2750: special rendering of the datasetSizeInBytes (for Dataset Collections)\n if (\n isDatasetCollection(table as Entity) &&\n columnName === 'datasetSizeInBytes'\n ) {\n columnDisplayName = 'Size'\n renderedValue = calculateFriendlyFileSize(parseInt(rawValue))\n } // SWC-6115: special rendering of the version column (for Views)\n else if (isView && columnName === 'currentVersion') {\n const synapseId = data[schema.id]\n renderedValue = (\n <VersionLabel synapseId={synapseId} version={rawValue} />\n )\n columnDisplayName = 'Version'\n } else {\n const labelLink = labelLinkConfig?.find(\n el => el.matchColumnName === columnName,\n )\n renderedValue = (\n <SynapseCardLabel\n value={rawValue}\n columnName={columnName}\n labelLink={labelLink}\n isHeader={isHeader}\n selectColumns={selectColumns}\n columnModels={columnModels}\n rowData={data}\n columnIconOptions={columnIconOptions}\n />\n )\n columnDisplayName = getColumnDisplayName(columnName)\n }\n values.push({ columnDisplayName, value: renderedValue, columnName })\n }\n }\n\n const fileHandleId = imageFileHandleIdValue || linkValue\n\n /**\n * To show a direct download link to a file, we need to determine the association that gives permission to download the file.\n */\n const fileHandleAssociation = getFileHandleAssociation(\n table,\n fileHandleId,\n data[schema.id],\n )\n\n const descriptionSubTitle = getColumnDisplayName(\n genericCardSchema.description || '',\n )\n\n const doiColumnIndex = getColumnIndex('doi', selectColumns, columnModels)\n const doiValue =\n doiColumnIndex !== undefined ? data[doiColumnIndex] : undefined\n\n // Normalize ctaLinkConfig to array and resolve each config\n const ctaLinkConfigs = ctaLinkConfig\n ? Array.isArray(ctaLinkConfig)\n ? ctaLinkConfig\n : [ctaLinkConfig]\n : []\n const resolvedCtaLinkConfigs = ctaLinkConfigs\n .map(config => {\n const ctaLinkValue: string = data[schema[config.link]] || ''\n if (!ctaLinkValue) return null\n const { href, target } = getLinkParams(\n ctaLinkValue,\n undefined, //card link config\n data,\n schema,\n rowId,\n )\n return {\n text: config.endIcon ? (\n <div style={{ display: 'flex', alignItems: 'center', gap: '10px' }}>\n {config.text}\n {config.endIcon}\n </div>\n ) : (\n config.text\n ),\n href,\n target,\n }\n })\n .filter(Boolean) as { text: string; href: string; target?: string }[]\n\n let croissantButton = <></>\n if (\n resolvedSynapseEntityId != null &&\n resolvedSynapseEntityVersionNumber != null\n ) {\n croissantButton = (\n <CroissantButton\n datasetId={resolvedSynapseEntityId}\n datasetVersionNumber={resolvedSynapseEntityVersionNumber}\n />\n )\n }\n\n const resolvedCardTypeAdornment = CardTypeAdornment ? (\n <CardTypeAdornment schema={schema} data={data} />\n ) : null\n\n let isRenderingIcon = true\n if (isHeader && !imageFileHandleIdValue && !iconValue) {\n // For header cards, if there is no image or explicit icon value, we don't show an icon at all\n isRenderingIcon = false\n }\n const iconNode = isRenderingIcon ? (\n <GenericCardIcon\n type={\n useTypeColumnForIcon ? data[schema['type']] : genericCardSchema.type\n }\n useTypeForIcon={useTypeColumnForIcon}\n thumbnailRequiresPadding={genericCardSchema.thumbnailRequiresPadding}\n imageFileHandleId={imageFileHandleIdValue}\n fileHandleAssociation={fileHandleAssociation}\n iconOptions={iconOptions}\n iconValue={iconValue}\n />\n ) : undefined\n return (\n <GenericCard\n ref={ref}\n icon={iconNode}\n isHeader={isHeader}\n sustainabilityScorecard={sustainabilityScorecard}\n headerCardVariant={headerCardVariant}\n type={type}\n title={title}\n subtitle={subTitle}\n titleLinkConfiguration={{ target, href }}\n cardTypeAdornment={resolvedCardTypeAdornment}\n titleAsFileHandleLinkConfiguration={\n !titleLinkConfig &&\n titleColumnType === ColumnTypeEnum.FILEHANDLEID &&\n fileHandleAssociation\n ? {\n fileHandleAssociation: fileHandleAssociation,\n showDownloadIcon: type !== SynapseConstants.EXPERIMENTAL,\n }\n : undefined\n }\n ctaLinkConfig={\n resolvedCtaLinkConfigs.length > 0 ? resolvedCtaLinkConfigs : undefined\n }\n ctaLinkPosition={ctaLinkPosition}\n titleAreaRightContent={resolvedTitleAreaRightContent}\n description={description}\n descriptionSubTitle={descriptionSubTitle}\n descriptionConfig={descriptionConfig}\n charCountCutoff={charCountCutoff}\n labels={values}\n secondaryLabelLimit={secondaryLabelLimit}\n useStylesForDisplayedImage={Boolean(imageFileHandleIdValue)}\n cardTopContent={\n <>\n {resolvedDownloadCartSynIdValue && (\n <Collapse in={showDownloadConfirmation}>\n <EntityDownloadConfirmation\n entityId={resolvedDownloadCartSynIdValue}\n versionNumber={resolvedDownloadCartVersionNumber}\n handleClose={() => setShowDownloadConfirmation(false)}\n onIsLoadingChange={isLoading => {\n setDownloadButtonLoading(isLoading)\n }}\n />\n </Collapse>\n )}\n </>\n }\n renderedIconList={\n // If the portal configs has columnIconOptions.columns.dataType option\n // and the column value is not null, display the card data type icons\n columnIconOptions?.columns?.dataType &&\n dataTypeIconNames?.length && (\n <div style={{ marginTop: '20px' }}>\n <IconList\n iconConfigs={columnIconOptions.columns.dataType}\n iconNames={JSON.parse(dataTypeIconNames) as string[]}\n commonIconProps={{\n sx: { fontSize: '40px' },\n }}\n useBackground={true}\n useTheme={true}\n />\n </div>\n )\n }\n cardTopButtons={\n <Box sx={{ display: 'flex', gap: 1, alignItems: 'center' }}>\n {croissantButton}\n {/* PORTALS-3386 Use synapseLink in schema to add entity to download cart */}\n {resolvedDownloadCartSynIdValue && (\n <GenericCardActionButton\n onClick={() => setShowDownloadConfirmation(val => !val)}\n variant=\"outlined\"\n startIcon={<GetAppTwoTone sx={{ height: '12px' }} />}\n loading={downloadButtonLoading}\n >\n Download\n </GenericCardActionButton>\n )}\n {includeCitation && doiValue && (\n <CitationPopover\n title={title}\n doi={doiValue}\n boilerplateText={citationBoilerplateText}\n defaultCitationFormat={defaultCitationFormat}\n />\n )}\n {includeShareButton && isHeader && (\n <ShareThisPage {...sharePageLinkButtonProps} />\n )}\n </Box>\n }\n />\n )\n}\n\nexport default TableRowGenericCard\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+LA,SAAS,GAAa,GAA+C;CACnE,IAAM,EAAE,cAAW,eAAY;CAC/B,OACE,kBAAC,QAAD,EAAA,UAAA;EACG;EAAQ;EACT,kBAAC,KAAD;GACE,QAAQ,EAAW;GACnB,KAAI;GACJ,MAAM,GAAG,EAA2B,OAAO,UAAU,EAAU,GAAG;aACnE;EAEE,CAAA;CACC,EAAA,CAAA;AAEV;AAKA,SAAgB,EAAoB,GAAiC;CACnE,IAAM,CAAC,GAA0B,KAC/B,EAAS,EAAK,GACV,CAAC,IAAuB,MAA4B,EAAS,EAAK,GAElE,EAAE,cAAU,sBAAkB,GAAgB,GAC9C,EAAE,4BAAyB,GAA6B,GAExD,EAAE,SAAK,QAAQ,OAAiB,GAAU,GAE1C,EAAE,MAAM,MAAU,GAAoB,IAAU,EAAa,GAE7D,EACJ,WACA,SACA,UACA,eAAe,IACf,sBACA,yBACA,8BACA,kBACA,iBACA,iBACA,0BAAuB,IACvB,cAAW,IACX,6BACA,uBACA,oBACA,kBACA,qBACA,qBACA,uBACA,sBACA,sBACA,wBACE,GAEE,EACJ,WAAO,IACP,SACA,qBACA,wBACA,2B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UACjB,kBAAC,OAAD;GAAK,OAAO,EAAE,WAAW,OAAO;aAC9B,kBAAC,IAAD;IACE,aAAa,EAAkB,QAAQ;IACvC,WAAW,KAAK,MAAM,CAAiB;IACvC,iBAAiB,EACf,IAAI,EAAE,UAAU,OAAO,EACzB;IACA,eAAe;IACf,UAAU;GACX,CAAA;EACE,CAAA;EAGT,gBACE,kBAAC,IAAD;GAAK,IAAI;IAAE,SAAS;IAAQ,KAAK;IAAG,YAAY;GAAS;aAAzD;IACG;IAEA,KACC,kBAAC,IAAD;KACE,eAAe,GAA4B,MAAO,CAAC,CAAG;KACtD,SAAQ;KACR,WAAW,kBAAC,IAAD,EAAe,IAAI,EAAE,QAAQ,OAAO,EAAI,CAAA;KACnD,SAAS;eACV;IAEwB,CAAA;IAE1B,MAAmB,KAClB,kBAAC,IAAD;KACS;KACP,KAAK;KACL,iBAAiB;KACM;IACxB,CAAA;IAEF,MAAsB,KACrB,kBAAC,IAAD,EAAe,GAAI,GAA2B,CAAA;GAE7C;;CAER,CAAA;AAEL"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { QueryBundleRequest } from '@sage-bionetworks/synapse-types';
|
|
2
|
+
import { QueryClient } from '@tanstack/react-query';
|
|
1
3
|
export type GoalsProps = {
|
|
2
4
|
entityId: string;
|
|
3
5
|
isAssetIcon?: boolean;
|
|
@@ -13,6 +15,12 @@ export type GoalsDataProps = {
|
|
|
13
15
|
isAssetIcon: boolean;
|
|
14
16
|
linkText?: string;
|
|
15
17
|
};
|
|
18
|
+
export declare function buildGoalsQueryBundleRequest(entityId: string): QueryBundleRequest;
|
|
16
19
|
export declare function Goals(props: GoalsProps): import("react/jsx-runtime").JSX.Element;
|
|
17
20
|
export default Goals;
|
|
21
|
+
/**
|
|
22
|
+
* Prefetches the Goals table query into a QueryClient for use with HydrationBoundary.
|
|
23
|
+
* Uses anonymous access; warm-caches for unauthenticated users.
|
|
24
|
+
*/
|
|
25
|
+
export declare function prefetchGoals(queryClient: QueryClient, entityId: string): Promise<void>;
|
|
18
26
|
//# sourceMappingURL=Goals.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Goals.d.ts","sourceRoot":"","sources":["../../../src/components/Goals/Goals.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Goals.d.ts","sourceRoot":"","sources":["../../../src/components/Goals/Goals.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAA;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAOnD,MAAM,MAAM,UAAU,GAAG;IACvB,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,OAAO,CAAA;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAcD,wBAAgB,4BAA4B,CAC1C,QAAQ,EAAE,MAAM,GACf,kBAAkB,CAapB;AAED,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,2CAwHtC;AACD,eAAe,KAAK,CAAA;AAEpB;;;GAGG;AACH,wBAAsB,aAAa,CACjC,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC,CAYf"}
|