synapse-react-client 4.0.23 → 4.0.25
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/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DataAccessRequestAccessorsFilesForm/DataAccessRequestAccessorsFilesForm.js.map +1 -1
- package/dist/components/AclEditor/useUpdateAcl.js.map +1 -1
- package/dist/components/Authentication/TwoFactorBackupCodes.js.map +1 -1
- package/dist/components/Authentication/TwoFactorEnrollmentForm.js.map +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +3 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.js +43 -30
- package/dist/components/Breadcrumbs/Breadcrumbs.js.map +1 -1
- package/dist/components/CannedRejectionDialog/CannedRejectionDialog.js.map +1 -1
- package/dist/components/ChallengeSubmission/SubmissionDirectoryList.js.map +1 -1
- package/dist/components/CopyToClipboardString/CopyToClipboardString.d.ts +7 -1
- package/dist/components/CopyToClipboardString/CopyToClipboardString.d.ts.map +1 -1
- package/dist/components/CopyToClipboardString/CopyToClipboardString.js +22 -16
- package/dist/components/CopyToClipboardString/CopyToClipboardString.js.map +1 -1
- package/dist/components/EntityCitation/EntityCitation.d.ts.map +1 -1
- package/dist/components/EntityCitation/EntityCitation.js +28 -26
- package/dist/components/EntityCitation/EntityCitation.js.map +1 -1
- package/dist/components/EntityFinder/tree/EntityTree.js.map +1 -1
- package/dist/components/EntityFinder/tree/VirtualizedTree.js.map +1 -1
- package/dist/components/EntityIcon.d.ts +1 -0
- package/dist/components/EntityIcon.d.ts.map +1 -1
- package/dist/components/EntityIcon.js +37 -36
- package/dist/components/EntityIcon.js.map +1 -1
- package/dist/components/EntitySidebar/EntitySidebar.css +1 -0
- package/dist/components/EntitySidebar/EntitySidebar.d.ts +7 -0
- package/dist/components/EntitySidebar/EntitySidebar.d.ts.map +1 -0
- package/dist/components/EntitySidebar/EntitySidebar.js +62 -0
- package/dist/components/EntitySidebar/EntitySidebar.js.map +1 -0
- package/dist/components/EntitySidebar/EntitySidebar.module.js +17 -0
- package/dist/components/EntitySidebar/EntitySidebar.module.js.map +1 -0
- package/dist/components/EntitySidebar/EntitySidebar.module.scss +87 -0
- package/dist/components/Evaluation/EvaluationRoundEditorList.js.map +1 -1
- package/dist/components/GenericCard/BioregistryRules.js.map +1 -1
- package/dist/components/IconSvg/IconSvg.d.ts +2 -1
- package/dist/components/IconSvg/IconSvg.d.ts.map +1 -1
- package/dist/components/IconSvg/IconSvg.js +112 -89
- package/dist/components/IconSvg/IconSvg.js.map +1 -1
- package/dist/components/Plot/SynapsePlot.d.ts +4 -0
- package/dist/components/Plot/SynapsePlot.d.ts.map +1 -1
- package/dist/components/Plot/SynapsePlot.js +57 -44
- package/dist/components/Plot/SynapsePlot.js.map +1 -1
- package/dist/components/Plot/UpsetPlot.js.map +1 -1
- package/dist/components/QueryWrapperPlotNav/QueryWrapperSynapsePlot.d.ts.map +1 -1
- package/dist/components/QueryWrapperPlotNav/QueryWrapperSynapsePlot.js +77 -34
- package/dist/components/QueryWrapperPlotNav/QueryWrapperSynapsePlot.js.map +1 -1
- package/dist/components/SchemaDrivenAnnotationEditor/field/AdditionalPropertiesSchemaField.js.map +1 -1
- package/dist/components/SearchQueryWrapperPlotNav/SearchQueryWrapperPlotNav.d.ts.map +1 -1
- package/dist/components/SearchQueryWrapperPlotNav/SearchQueryWrapperPlotNav.js +1 -0
- package/dist/components/SearchQueryWrapperPlotNav/SearchQueryWrapperPlotNav.js.map +1 -1
- package/dist/components/StorybookComponentWrapper.js.map +1 -1
- package/dist/components/SynapseTable/TablePagination.js.map +1 -1
- package/dist/components/SynapseTable/datasets/DatasetItemsEditor.js.map +1 -1
- package/dist/components/TableColumnSchemaEditor/TableColumnSchemaForm.js.map +1 -1
- package/dist/components/TanStackTable/StyledTanStackTable.js.map +1 -1
- package/dist/components/entity/page/action_menu/EntityActionMenu.d.ts +2 -0
- package/dist/components/entity/page/action_menu/EntityActionMenu.d.ts.map +1 -1
- package/dist/components/entity/page/action_menu/EntityActionMenu.js +46 -27
- package/dist/components/entity/page/action_menu/EntityActionMenu.js.map +1 -1
- package/dist/components/entity/page/breadcrumbs/EntityPageBreadcrumbs.d.ts +1 -8
- package/dist/components/entity/page/breadcrumbs/EntityPageBreadcrumbs.d.ts.map +1 -1
- package/dist/components/entity/page/breadcrumbs/EntityPageBreadcrumbs.js +17 -13
- package/dist/components/entity/page/breadcrumbs/EntityPageBreadcrumbs.js.map +1 -1
- package/dist/components/entity/page/title_bar/EntityPageTitleBar.d.ts +1 -0
- package/dist/components/entity/page/title_bar/EntityPageTitleBar.d.ts.map +1 -1
- package/dist/components/entity/page/title_bar/EntityPageTitleBar.js +35 -22
- package/dist/components/entity/page/title_bar/EntityPageTitleBar.js.map +1 -1
- package/dist/components/entity/page/title_bar/EntityTitleBarVersionInfo.d.ts.map +1 -1
- package/dist/components/entity/page/title_bar/EntityTitleBarVersionInfo.js +34 -20
- package/dist/components/entity/page/title_bar/EntityTitleBarVersionInfo.js.map +1 -1
- package/dist/components/entity/page/title_bar/TitleBarProperties.d.ts +0 -1
- package/dist/components/entity/page/title_bar/TitleBarProperties.d.ts.map +1 -1
- package/dist/components/entity/page/title_bar/TitleBarProperties.js +17 -82
- package/dist/components/entity/page/title_bar/TitleBarProperties.js.map +1 -1
- package/dist/components/entity/page/title_bar/useGetEntityTitleBarProperties.d.ts.map +1 -1
- package/dist/components/entity/page/title_bar/useGetEntityTitleBarProperties.js +3 -4
- package/dist/components/entity/page/title_bar/useGetEntityTitleBarProperties.js.map +1 -1
- package/dist/components/favorites/FavoriteButton.d.ts +1 -0
- package/dist/components/favorites/FavoriteButton.d.ts.map +1 -1
- package/dist/components/favorites/FavoriteButton.js +8 -8
- package/dist/components/favorites/FavoriteButton.js.map +1 -1
- package/dist/components/menu/ComplexMenu.d.ts.map +1 -1
- package/dist/components/menu/ComplexMenu.js +5 -3
- package/dist/components/menu/ComplexMenu.js.map +1 -1
- package/dist/components/menu/DropdownMenu.d.ts +1 -0
- package/dist/components/menu/DropdownMenu.d.ts.map +1 -1
- package/dist/components/menu/DropdownMenu.js +24 -24
- package/dist/components/menu/DropdownMenu.js.map +1 -1
- package/dist/components/widgets/facet-nav/FacetNavPanel.d.ts.map +1 -1
- package/dist/components/widgets/facet-nav/FacetNavPanel.js +59 -49
- package/dist/components/widgets/facet-nav/FacetNavPanel.js.map +1 -1
- package/dist/components/widgets/facet-nav/PlotsContainer.d.ts.map +1 -1
- package/dist/components/widgets/facet-nav/PlotsContainer.js +8 -2
- package/dist/components/widgets/facet-nav/PlotsContainer.js.map +1 -1
- package/dist/style/components/facet_nav/_facet-nav-panel.scss +11 -0
- package/dist/style/main.css +1 -1
- package/dist/testutils/ReactQueryMockUtils.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/ThemeTypes.d.ts +2 -2
- package/dist/utils/functions/IsEqualTreatUndefinedAsMissing.js.map +1 -1
- package/dist/utils/hooks/useDebouncedEffect.js.map +1 -1
- package/dist/utils/hooks/useDetectSSOCode.js.map +1 -1
- package/dist/utils/hooks/useImmutableTableQuery/useImmutableTableQuery.js.map +1 -1
- package/dist/utils/hooks/useLogin.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,12 +1,5 @@
|
|
|
1
|
+
import { BreadcrumbItem } from '@/components/Breadcrumbs/Breadcrumbs';
|
|
1
2
|
import { SxProps } from '@mui/material';
|
|
2
|
-
import { MouseEventHandler } from 'react';
|
|
3
|
-
type BreadcrumbItem = {
|
|
4
|
-
text: string;
|
|
5
|
-
current?: boolean;
|
|
6
|
-
to?: string;
|
|
7
|
-
href?: string;
|
|
8
|
-
onClick?: MouseEventHandler;
|
|
9
|
-
};
|
|
10
3
|
type EntityPageBreadcrumbsProps = {
|
|
11
4
|
items: BreadcrumbItem[];
|
|
12
5
|
sx?: SxProps;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityPageBreadcrumbs.d.ts","sourceRoot":"","sources":["../../../../../src/components/entity/page/breadcrumbs/EntityPageBreadcrumbs.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"EntityPageBreadcrumbs.d.ts","sourceRoot":"","sources":["../../../../../src/components/entity/page/breadcrumbs/EntityPageBreadcrumbs.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,cAAc,EACf,MAAM,sCAAsC,CAAA;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAEvC,KAAK,0BAA0B,GAAG;IAChC,KAAK,EAAE,cAAc,EAAE,CAAA;IACvB,EAAE,CAAC,EAAE,OAAO,CAAA;CACb,CAAA;AA0BD,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAC3C,KAAK,EAAE,0BAA0B,2CAWlC"}
|
|
@@ -1,26 +1,30 @@
|
|
|
1
1
|
import { Breadcrumbs as e } from "../../../Breadcrumbs/Breadcrumbs.js";
|
|
2
2
|
import { jsx as t } from "react/jsx-runtime";
|
|
3
3
|
//#region src/components/entity/page/breadcrumbs/EntityPageBreadcrumbs.tsx
|
|
4
|
-
var n = 32, r = {
|
|
4
|
+
var n = 32, r = "#4D535A", i = {
|
|
5
5
|
marginTop: "0px",
|
|
6
|
-
padding: "10px
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"&:visited": { color: "text.secondary" }
|
|
6
|
+
padding: "10px 32px",
|
|
7
|
+
"& .MuiTypography-root": {
|
|
8
|
+
fontWeight: 440,
|
|
9
|
+
lineHeight: "20px",
|
|
10
|
+
color: r
|
|
12
11
|
},
|
|
13
|
-
"& .
|
|
12
|
+
"& .MuiLink-root": { "&:visited": { color: r } },
|
|
13
|
+
"& .MuiSvgIcon-root": {
|
|
14
|
+
fontWeight: "300",
|
|
15
|
+
color: r
|
|
16
|
+
}
|
|
14
17
|
};
|
|
15
|
-
function
|
|
16
|
-
let { items: a } =
|
|
18
|
+
function a(r) {
|
|
19
|
+
let { items: a } = r;
|
|
17
20
|
return /* @__PURE__ */ t(e, {
|
|
18
21
|
items: a,
|
|
19
|
-
sx:
|
|
20
|
-
maxBreadcrumbLength: n
|
|
22
|
+
sx: i,
|
|
23
|
+
maxBreadcrumbLength: n,
|
|
24
|
+
iconVariant: "outlined"
|
|
21
25
|
});
|
|
22
26
|
}
|
|
23
27
|
//#endregion
|
|
24
|
-
export {
|
|
28
|
+
export { a as default };
|
|
25
29
|
|
|
26
30
|
//# sourceMappingURL=EntityPageBreadcrumbs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityPageBreadcrumbs.js","names":[],"sources":["../../../../../src/components/entity/page/breadcrumbs/EntityPageBreadcrumbs.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"EntityPageBreadcrumbs.js","names":[],"sources":["../../../../../src/components/entity/page/breadcrumbs/EntityPageBreadcrumbs.tsx"],"sourcesContent":["import {\n Breadcrumbs,\n BreadcrumbItem,\n} from '@/components/Breadcrumbs/Breadcrumbs'\nimport { SxProps } from '@mui/material'\n\ntype EntityPageBreadcrumbsProps = {\n items: BreadcrumbItem[]\n sx?: SxProps\n}\n\nconst ENTITY_PAGE_MAX_BREADCRUMB_LENGTH = 32\nconst ENTITY_PAGE_TEXT_COLOR = '#4D535A'\n\nconst breadcrumbTextStyle: SxProps = {\n fontWeight: 440,\n lineHeight: '20px',\n color: ENTITY_PAGE_TEXT_COLOR,\n}\n\nconst entityPageBreadcrumbStyle: SxProps = {\n marginTop: '0px',\n padding: '10px 32px',\n ['& .MuiTypography-root']: breadcrumbTextStyle,\n ['& .MuiLink-root']: {\n '&:visited': {\n color: ENTITY_PAGE_TEXT_COLOR,\n },\n },\n ['& .MuiSvgIcon-root']: {\n fontWeight: '300',\n color: ENTITY_PAGE_TEXT_COLOR,\n },\n}\n\nexport default function EntityPageBreadcrumbs(\n props: EntityPageBreadcrumbsProps,\n) {\n const { items } = props\n return (\n <Breadcrumbs\n items={items}\n sx={entityPageBreadcrumbStyle}\n maxBreadcrumbLength={ENTITY_PAGE_MAX_BREADCRUMB_LENGTH}\n iconVariant=\"outlined\"\n />\n )\n}\n"],"mappings":";;;AAWA,IAAM,IAAoC,IACpC,IAAyB,WAQzB,IAAqC;CACzC,WAAW;CACX,SAAS;CACR,yBAA0B;EAR3B,YAAY;EACZ,YAAY;EACZ,OAAO;CAMoB;CAC1B,mBAAoB,EACnB,aAAa,EACX,OAAO,EACT,EACF;CACC,sBAAuB;EACtB,YAAY;EACZ,OAAO;CACT;AACF;AAEA,SAAwB,EACtB,GACA;CACA,IAAM,EAAE,aAAU;CAClB,OACE,kBAAC,GAAD;EACS;EACP,IAAI;EACJ,qBAAqB;EACrB,aAAY;CACb,CAAA;AAEL"}
|
|
@@ -5,6 +5,7 @@ export type EntityPageTitleBarProps = {
|
|
|
5
5
|
entityActionMenuProps?: EntityActionMenuProps;
|
|
6
6
|
onActMemberClickAddConditionsForUse: () => void;
|
|
7
7
|
};
|
|
8
|
+
export declare const FAVORITE_BUTTON_ICON_COLOR = "#9EAAB7";
|
|
8
9
|
/**
|
|
9
10
|
* The EntityPageTitleBar component is shown on every Entity page in Synapse, and shows an Entity's metadata and
|
|
10
11
|
* provides controls to view and manipulate the Entity.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityPageTitleBar.d.ts","sourceRoot":"","sources":["../../../../../src/components/entity/page/title_bar/EntityPageTitleBar.tsx"],"names":[],"mappings":"AAMA,OAAyB,EACvB,qBAAqB,EACtB,MAAM,iCAAiC,CAAA;AAIxC,MAAM,MAAM,uBAAuB,GAAG;IACpC,QAAQ,EAAE,MAAM,CAAA;IAChB,aAAa,CAAC,EAAE,MAAM,CAAA;IAEtB,qBAAqB,CAAC,EAAE,qBAAqB,CAAA;IAE7C,mCAAmC,EAAE,MAAM,IAAI,CAAA;CAChD,CAAA;AAED;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,
|
|
1
|
+
{"version":3,"file":"EntityPageTitleBar.d.ts","sourceRoot":"","sources":["../../../../../src/components/entity/page/title_bar/EntityPageTitleBar.tsx"],"names":[],"mappings":"AAMA,OAAyB,EACvB,qBAAqB,EACtB,MAAM,iCAAiC,CAAA;AAIxC,MAAM,MAAM,uBAAuB,GAAG;IACpC,QAAQ,EAAE,MAAM,CAAA;IAChB,aAAa,CAAC,EAAE,MAAM,CAAA;IAEtB,qBAAqB,CAAC,EAAE,qBAAqB,CAAA;IAE7C,mCAAmC,EAAE,MAAM,IAAI,CAAA;CAChD,CAAA;AAED,eAAO,MAAM,0BAA0B,YAAY,CAAA;AAKnD;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,2CAwGxE"}
|
|
@@ -10,18 +10,23 @@ import c from "./TitleBarProperties.js";
|
|
|
10
10
|
import { Avatar as l, Box as u, Skeleton as d, Stack as f, Typography as p } from "@mui/material";
|
|
11
11
|
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
12
12
|
//#region src/components/entity/page/title_bar/EntityPageTitleBar.tsx
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
var g = "#9EAAB7", _ = "#EAF0F5", v = "#497097", y = "#33373D";
|
|
14
|
+
function b(g) {
|
|
15
|
+
let { entityId: b, versionNumber: x, entityActionMenuProps: S } = g, C = S?.actionConfiguration.SHOW_VERSION_HISTORY?.onClick, { data: w, isLoading: T } = t(b, x), E = w?.entity && e(w.entity) ? w.entity.repositoryName : w?.entity?.name;
|
|
15
16
|
return /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m(u, {
|
|
16
17
|
sx: {
|
|
17
18
|
padding: "20px 40px",
|
|
18
|
-
backgroundColor:
|
|
19
|
+
backgroundColor: _,
|
|
20
|
+
borderRadius: "5px"
|
|
19
21
|
},
|
|
20
22
|
children: /* @__PURE__ */ h(f, {
|
|
21
|
-
sx: {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
sx: {
|
|
24
|
+
flexDirection: {
|
|
25
|
+
xs: "column",
|
|
26
|
+
md: "row"
|
|
27
|
+
},
|
|
28
|
+
alignItems: "center"
|
|
29
|
+
},
|
|
25
30
|
children: [/* @__PURE__ */ h(f, {
|
|
26
31
|
direction: "row",
|
|
27
32
|
sx: {
|
|
@@ -29,19 +34,20 @@ function g(g) {
|
|
|
29
34
|
flexGrow: 1
|
|
30
35
|
},
|
|
31
36
|
children: [/* @__PURE__ */ m(i, {
|
|
32
|
-
condition:
|
|
37
|
+
condition: T,
|
|
33
38
|
wrapper: d,
|
|
34
39
|
wrapperProps: { variant: "circular" },
|
|
35
40
|
children: /* @__PURE__ */ m(l, {
|
|
36
41
|
sx: {
|
|
37
|
-
bgcolor:
|
|
42
|
+
bgcolor: v,
|
|
38
43
|
height: 48,
|
|
39
|
-
width: 48
|
|
44
|
+
width: 48,
|
|
45
|
+
borderRadius: "3px"
|
|
40
46
|
},
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
47
|
+
variant: "square",
|
|
48
|
+
children: w?.entityType && /* @__PURE__ */ m(n, {
|
|
49
|
+
icon: w?.entityType ? r[w.entityType] : "file",
|
|
50
|
+
wrap: !1
|
|
45
51
|
})
|
|
46
52
|
})
|
|
47
53
|
}), /* @__PURE__ */ h(u, {
|
|
@@ -56,24 +62,31 @@ function g(g) {
|
|
|
56
62
|
gap: "3px"
|
|
57
63
|
},
|
|
58
64
|
children: [/* @__PURE__ */ m(i, {
|
|
59
|
-
condition:
|
|
65
|
+
condition: T,
|
|
60
66
|
wrapper: d,
|
|
61
67
|
children: /* @__PURE__ */ m(p, {
|
|
62
68
|
variant: "headline2",
|
|
63
|
-
|
|
69
|
+
sx: {
|
|
70
|
+
color: y,
|
|
71
|
+
fontWeight: 540
|
|
72
|
+
},
|
|
73
|
+
children: E ?? "Name not set"
|
|
64
74
|
})
|
|
65
|
-
}),
|
|
75
|
+
}), w?.entity?.id && /* @__PURE__ */ m(a, {
|
|
76
|
+
entityId: w.entity.id,
|
|
77
|
+
iconColor: "#9EAAB7"
|
|
78
|
+
})]
|
|
66
79
|
}), /* @__PURE__ */ m(s, {
|
|
67
|
-
entityId:
|
|
68
|
-
versionNumber:
|
|
69
|
-
toggleShowVersionHistory:
|
|
80
|
+
entityId: b,
|
|
81
|
+
versionNumber: x,
|
|
82
|
+
toggleShowVersionHistory: C
|
|
70
83
|
})]
|
|
71
84
|
})]
|
|
72
|
-
}),
|
|
85
|
+
}), S && /* @__PURE__ */ m(o, { ...S })]
|
|
73
86
|
})
|
|
74
87
|
}), /* @__PURE__ */ m(c, { ...g })] });
|
|
75
88
|
}
|
|
76
89
|
//#endregion
|
|
77
|
-
export { g as default };
|
|
90
|
+
export { g as FAVORITE_BUTTON_ICON_COLOR, b as default };
|
|
78
91
|
|
|
79
92
|
//# sourceMappingURL=EntityPageTitleBar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityPageTitleBar.js","names":[],"sources":["../../../../../src/components/entity/page/title_bar/EntityPageTitleBar.tsx"],"sourcesContent":["import ConditionalWrapper from '@/components/utils/ConditionalWrapper'\nimport { useGetEntityBundle } from '@/synapse-queries'\nimport { isDockerRepository } from '@/utils/types/IsType'\nimport { Avatar, Box, Skeleton, Stack, Typography } from '@mui/material'\nimport FavoriteButton from '../../../favorites/FavoriteButton'\nimport IconSvg, { type2SvgIconName } from '../../../IconSvg/IconSvg'\nimport EntityActionMenu, {\n EntityActionMenuProps,\n} from '../action_menu/EntityActionMenu'\nimport { EntityTitleBarVersionInfo } from './EntityTitleBarVersionInfo'\nimport TitleBarProperties from './TitleBarProperties'\n\nexport type EntityPageTitleBarProps = {\n entityId: string\n versionNumber?: number\n /* Props that will be passed through to an EntityActionMenu component */\n entityActionMenuProps?: EntityActionMenuProps\n /* Callback invoked when an ACT member clicks \"Add Conditions for Use\". */\n onActMemberClickAddConditionsForUse: () => void\n}\n\n/**\n * The EntityPageTitleBar component is shown on every Entity page in Synapse, and shows an Entity's metadata and\n * provides controls to view and manipulate the Entity.\n */\nexport default function EntityPageTitleBar(props: EntityPageTitleBarProps) {\n const { entityId, versionNumber, entityActionMenuProps } = props\n\n const toggleShowVersionHistory =\n entityActionMenuProps?.actionConfiguration['SHOW_VERSION_HISTORY']?.onClick\n\n const { data: bundle, isLoading } = useGetEntityBundle(\n entityId,\n versionNumber,\n )\n\n const name =\n bundle?.entity && isDockerRepository(bundle.entity)\n ? bundle.entity.repositoryName\n : bundle?.entity?.name\n\n return (\n <div>\n <Box\n sx={{\n padding: '20px 40px',\n backgroundColor: '
|
|
1
|
+
{"version":3,"file":"EntityPageTitleBar.js","names":[],"sources":["../../../../../src/components/entity/page/title_bar/EntityPageTitleBar.tsx"],"sourcesContent":["import ConditionalWrapper from '@/components/utils/ConditionalWrapper'\nimport { useGetEntityBundle } from '@/synapse-queries'\nimport { isDockerRepository } from '@/utils/types/IsType'\nimport { Avatar, Box, Skeleton, Stack, Typography } from '@mui/material'\nimport FavoriteButton from '../../../favorites/FavoriteButton'\nimport IconSvg, { type2SvgIconName } from '../../../IconSvg/IconSvg'\nimport EntityActionMenu, {\n EntityActionMenuProps,\n} from '../action_menu/EntityActionMenu'\nimport { EntityTitleBarVersionInfo } from './EntityTitleBarVersionInfo'\nimport TitleBarProperties from './TitleBarProperties'\n\nexport type EntityPageTitleBarProps = {\n entityId: string\n versionNumber?: number\n /* Props that will be passed through to an EntityActionMenu component */\n entityActionMenuProps?: EntityActionMenuProps\n /* Callback invoked when an ACT member clicks \"Add Conditions for Use\". */\n onActMemberClickAddConditionsForUse: () => void\n}\n\nexport const FAVORITE_BUTTON_ICON_COLOR = '#9EAAB7'\nconst TITLE_BAR_BACKGROUND_COLOR = '#EAF0F5'\nconst AVATAR_BACKGROUND_COLOR = '#497097'\nconst TITLE_NAME_COLOR = '#33373D'\n\n/**\n * The EntityPageTitleBar component is shown on every Entity page in Synapse, and shows an Entity's metadata and\n * provides controls to view and manipulate the Entity.\n */\nexport default function EntityPageTitleBar(props: EntityPageTitleBarProps) {\n const { entityId, versionNumber, entityActionMenuProps } = props\n\n const toggleShowVersionHistory =\n entityActionMenuProps?.actionConfiguration['SHOW_VERSION_HISTORY']?.onClick\n\n const { data: bundle, isLoading } = useGetEntityBundle(\n entityId,\n versionNumber,\n )\n\n const name =\n bundle?.entity && isDockerRepository(bundle.entity)\n ? bundle.entity.repositoryName\n : bundle?.entity?.name\n\n return (\n <div>\n <Box\n sx={{\n padding: '20px 40px',\n backgroundColor: TITLE_BAR_BACKGROUND_COLOR,\n borderRadius: '5px',\n }}\n >\n <Stack\n sx={{\n flexDirection: { xs: 'column', md: 'row' },\n alignItems: 'center',\n }}\n >\n <Stack\n direction={'row'}\n sx={{\n alignItems: 'center',\n flexGrow: 1,\n }}\n >\n <ConditionalWrapper\n condition={isLoading}\n wrapper={Skeleton}\n wrapperProps={{\n variant: 'circular',\n }}\n >\n <Avatar\n sx={{\n bgcolor: AVATAR_BACKGROUND_COLOR,\n height: 48,\n width: 48,\n borderRadius: '3px',\n }}\n variant={'square'}\n >\n {bundle?.entityType && (\n <IconSvg\n icon={\n bundle?.entityType\n ? type2SvgIconName[bundle.entityType]\n : 'file'\n }\n wrap={false}\n />\n )}\n </Avatar>\n </ConditionalWrapper>\n <Box sx={{ marginLeft: '10px', flexGrow: 1 }}>\n <Stack\n direction={'row'}\n sx={{\n alignItems: 'center',\n gap: '3px',\n }}\n >\n <ConditionalWrapper condition={isLoading} wrapper={Skeleton}>\n <Typography\n variant={'headline2'}\n sx={{ color: TITLE_NAME_COLOR, fontWeight: 540 }}\n >\n {name ?? 'Name not set'}\n </Typography>\n </ConditionalWrapper>\n {bundle?.entity?.id && (\n <FavoriteButton\n entityId={bundle.entity.id}\n iconColor={FAVORITE_BUTTON_ICON_COLOR}\n />\n )}\n </Stack>\n <EntityTitleBarVersionInfo\n entityId={entityId}\n versionNumber={versionNumber}\n toggleShowVersionHistory={toggleShowVersionHistory}\n />\n </Box>\n </Stack>\n {entityActionMenuProps && (\n <EntityActionMenu {...entityActionMenuProps} />\n )}\n </Stack>\n </Box>\n <TitleBarProperties {...props} />\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;AAqBA,IAAa,IAA6B,WACpC,IAA6B,WAC7B,IAA0B,WAC1B,IAAmB;AAMzB,SAAwB,EAAmB,GAAgC;CACzE,IAAM,EAAE,aAAU,kBAAe,6BAA0B,GAErD,IACJ,GAAuB,oBAAoB,sBAAyB,SAEhE,EAAE,MAAM,GAAQ,iBAAc,EAClC,GACA,CACF,GAEM,IACJ,GAAQ,UAAU,EAAmB,EAAO,MAAM,IAC9C,EAAO,OAAO,iBACd,GAAQ,QAAQ;CAEtB,OACE,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,GAAD;EACE,IAAI;GACF,SAAS;GACT,iBAAiB;GACjB,cAAc;EAChB;YAEA,kBAAC,GAAD;GACE,IAAI;IACF,eAAe;KAAE,IAAI;KAAU,IAAI;IAAM;IACzC,YAAY;GACd;aAJF,CAME,kBAAC,GAAD;IACE,WAAW;IACX,IAAI;KACF,YAAY;KACZ,UAAU;IACZ;cALF,CAOE,kBAAC,GAAD;KACE,WAAW;KACX,SAAS;KACT,cAAc,EACZ,SAAS,WACX;eAEA,kBAAC,GAAD;MACE,IAAI;OACF,SAAS;OACT,QAAQ;OACR,OAAO;OACP,cAAc;MAChB;MACA,SAAS;gBAER,GAAQ,cACP,kBAAC,GAAD;OACE,MACE,GAAQ,aACJ,EAAiB,EAAO,cACxB;OAEN,MAAM;MACP,CAAA;KAEG,CAAA;IACU,CAAA,GACpB,kBAAC,GAAD;KAAK,IAAI;MAAE,YAAY;MAAQ,UAAU;KAAE;eAA3C,CACE,kBAAC,GAAD;MACE,WAAW;MACX,IAAI;OACF,YAAY;OACZ,KAAK;MACP;gBALF,CAOE,kBAAC,GAAD;OAAoB,WAAW;OAAW,SAAS;iBACjD,kBAAC,GAAD;QACE,SAAS;QACT,IAAI;SAAE,OAAO;SAAkB,YAAY;QAAI;kBAE9C,KAAQ;OACC,CAAA;MACM,CAAA,GACnB,GAAQ,QAAQ,MACf,kBAAC,GAAD;OACE,UAAU,EAAO,OAAO;OACxB,WAAA;MACD,CAAA,CAEE;SACP,kBAAC,GAAD;MACY;MACK;MACW;KAC3B,CAAA,CACE;MACA;OACN,KACC,kBAAC,GAAD,EAAkB,GAAI,EAAwB,CAAA,CAE3C;;CACJ,CAAA,GACL,kBAAC,GAAD,EAAoB,GAAI,EAAQ,CAAA,CAC7B,EAAA,CAAA;AAET"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityTitleBarVersionInfo.d.ts","sourceRoot":"","sources":["../../../../../src/components/entity/page/title_bar/EntityTitleBarVersionInfo.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAA;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAA;AAGrE,MAAM,MAAM,8BAA8B,GAAG;IAC3C,QAAQ,EAAE,MAAM,CAAA;IAChB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,wBAAwB,EAAE,mBAAmB,CAAC,SAAS,CAAC,CAAA;CACzD,CAAA;AAED,iBAAS,wBAAwB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAQ/D;AAED,iBAAS,yBAAyB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAWhE;
|
|
1
|
+
{"version":3,"file":"EntityTitleBarVersionInfo.d.ts","sourceRoot":"","sources":["../../../../../src/components/entity/page/title_bar/EntityTitleBarVersionInfo.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAA;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAA;AAGrE,MAAM,MAAM,8BAA8B,GAAG;IAC3C,QAAQ,EAAE,MAAM,CAAA;IAChB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,wBAAwB,EAAE,mBAAmB,CAAC,SAAS,CAAC,CAAA;CACzD,CAAA;AAED,iBAAS,wBAAwB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAQ/D;AAED,iBAAS,yBAAyB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAWhE;AAuBD,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,8BAA8B,kDA4DtC;AAED,eAAO,MAAM,yBAAyB;;;CAGrC,CAAA"}
|
|
@@ -13,12 +13,36 @@ function p(r) {
|
|
|
13
13
|
return n(r) ? t(r) && r.isLatestVersion ? e(r) ? "Draft Version" : "Current Version" : `V${r.versionNumber}${r.isLatestVersion ? " (Current)" : ""}` : null;
|
|
14
14
|
}
|
|
15
15
|
function m(e) {
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
return n(e) ? e.versionComment ?? null : null;
|
|
17
|
+
}
|
|
18
|
+
var h = /* @__PURE__ */ l(c, {
|
|
19
|
+
component: "span",
|
|
20
|
+
variant: "smallText1",
|
|
21
|
+
sx: {
|
|
22
|
+
color: "grey.700",
|
|
23
|
+
marginLeft: "5px",
|
|
24
|
+
marginRight: "5px"
|
|
25
|
+
},
|
|
26
|
+
children: "/"
|
|
27
|
+
});
|
|
28
|
+
function g(e) {
|
|
29
|
+
let { entityId: t, versionNumber: g, toggleShowVersionHistory: _ } = e, { data: v } = i(t, g), y = v?.entity && n(v.entity), b = v?.entity && f(v.entity), x = b ? r(b, d) : void 0, S = v?.entity && p(v.entity), C = v?.entity && m(v.entity);
|
|
30
|
+
return y ? /* @__PURE__ */ u(a, {
|
|
18
31
|
sx: { marginTop: "3px" },
|
|
19
32
|
children: [
|
|
20
33
|
/* @__PURE__ */ l(s, {
|
|
21
|
-
title:
|
|
34
|
+
title: "Click to show version history",
|
|
35
|
+
placement: "top",
|
|
36
|
+
children: /* @__PURE__ */ l(o, {
|
|
37
|
+
onClick: _,
|
|
38
|
+
variant: "smallText1",
|
|
39
|
+
sx: { fontWeight: 400 },
|
|
40
|
+
children: S
|
|
41
|
+
})
|
|
42
|
+
}),
|
|
43
|
+
b && S && h,
|
|
44
|
+
/* @__PURE__ */ l(s, {
|
|
45
|
+
title: b,
|
|
22
46
|
placement: "bottom",
|
|
23
47
|
children: /* @__PURE__ */ l(c, {
|
|
24
48
|
component: "span",
|
|
@@ -27,37 +51,27 @@ function m(e) {
|
|
|
27
51
|
color: "grey.700",
|
|
28
52
|
fontStyle: "italic"
|
|
29
53
|
},
|
|
30
|
-
children:
|
|
54
|
+
children: x
|
|
31
55
|
})
|
|
32
56
|
}),
|
|
33
|
-
|
|
57
|
+
C && h,
|
|
58
|
+
/* @__PURE__ */ l(c, {
|
|
34
59
|
component: "span",
|
|
35
60
|
variant: "smallText1",
|
|
36
61
|
sx: {
|
|
37
62
|
color: "grey.700",
|
|
38
|
-
|
|
39
|
-
marginRight: "5px"
|
|
63
|
+
fontStyle: "italic"
|
|
40
64
|
},
|
|
41
|
-
children:
|
|
42
|
-
}),
|
|
43
|
-
/* @__PURE__ */ l(s, {
|
|
44
|
-
title: "Click to show version history",
|
|
45
|
-
placement: "top",
|
|
46
|
-
children: /* @__PURE__ */ l(o, {
|
|
47
|
-
onClick: h,
|
|
48
|
-
variant: "smallText1",
|
|
49
|
-
sx: { fontWeight: 400 },
|
|
50
|
-
children: b
|
|
51
|
-
})
|
|
65
|
+
children: C
|
|
52
66
|
})
|
|
53
67
|
]
|
|
54
68
|
}) : null;
|
|
55
69
|
}
|
|
56
|
-
var
|
|
70
|
+
var _ = {
|
|
57
71
|
getDisplayedVersionLabel: f,
|
|
58
72
|
getDisplayedVersionNumber: p
|
|
59
73
|
};
|
|
60
74
|
//#endregion
|
|
61
|
-
export {
|
|
75
|
+
export { _ as EXPORTED_FOR_UNIT_TESTING, g as EntityTitleBarVersionInfo };
|
|
62
76
|
|
|
63
77
|
//# sourceMappingURL=EntityTitleBarVersionInfo.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityTitleBarVersionInfo.js","names":[],"sources":["../../../../../src/components/entity/page/title_bar/EntityTitleBarVersionInfo.tsx"],"sourcesContent":["import { useGetEntityBundle } from '@/synapse-queries'\nimport {\n isEntityRefCollectionView,\n isTable,\n isVersionableEntity,\n} from '@/utils/functions/EntityTypeUtils'\nimport { truncateString } from '@/utils/functions/StringUtils'\nimport { Box, Link, Tooltip, Typography } from '@mui/material'\nimport { Entity } from '@sage-bionetworks/synapse-types'\nimport { ActionConfiguration } from '../action_menu/EntityActionMenu'\n\nconst MAX_VERSION_LABEL_LENGTH = 50\nexport type EntityTitleBarVersionInfoProps = {\n entityId: string\n versionNumber?: number\n toggleShowVersionHistory: ActionConfiguration['onClick']\n}\n\nfunction getDisplayedVersionLabel(entity: Entity): string | null {\n if (!isVersionableEntity(entity)) {\n return null\n }\n if (isTable(entity) && entity.isLatestVersion) {\n return null\n }\n return entity.versionLabel ?? null\n}\n\nfunction getDisplayedVersionNumber(entity: Entity): string | null {\n if (!isVersionableEntity(entity)) {\n return null\n }\n if (isTable(entity) && entity.isLatestVersion) {\n if (isEntityRefCollectionView(entity)) {\n return 'Draft Version'\n }\n return 'Current Version'\n }\n return `V${entity.versionNumber}${entity.isLatestVersion ? ' (Current)' : ''}`\n}\n\nexport function EntityTitleBarVersionInfo(\n props: EntityTitleBarVersionInfoProps,\n) {\n const { entityId, versionNumber, toggleShowVersionHistory } = props\n\n const { data: bundle } = useGetEntityBundle(entityId, versionNumber)\n\n const isVersionable = bundle?.entity && isVersionableEntity(bundle.entity)\n\n const fullVersionLabel =\n bundle?.entity && getDisplayedVersionLabel(bundle.entity)\n const truncatedVersionLabel = fullVersionLabel\n ? truncateString(fullVersionLabel, MAX_VERSION_LABEL_LENGTH)\n : undefined\n\n const versionNumberDisplay =\n bundle?.entity && getDisplayedVersionNumber(bundle.entity)\n\n if (!isVersionable) {\n return null\n }\n
|
|
1
|
+
{"version":3,"file":"EntityTitleBarVersionInfo.js","names":[],"sources":["../../../../../src/components/entity/page/title_bar/EntityTitleBarVersionInfo.tsx"],"sourcesContent":["import { useGetEntityBundle } from '@/synapse-queries'\nimport {\n isEntityRefCollectionView,\n isTable,\n isVersionableEntity,\n} from '@/utils/functions/EntityTypeUtils'\nimport { truncateString } from '@/utils/functions/StringUtils'\nimport { Box, Link, Tooltip, Typography } from '@mui/material'\nimport { Entity } from '@sage-bionetworks/synapse-types'\nimport { ActionConfiguration } from '../action_menu/EntityActionMenu'\n\nconst MAX_VERSION_LABEL_LENGTH = 50\nexport type EntityTitleBarVersionInfoProps = {\n entityId: string\n versionNumber?: number\n toggleShowVersionHistory: ActionConfiguration['onClick']\n}\n\nfunction getDisplayedVersionLabel(entity: Entity): string | null {\n if (!isVersionableEntity(entity)) {\n return null\n }\n if (isTable(entity) && entity.isLatestVersion) {\n return null\n }\n return entity.versionLabel ?? null\n}\n\nfunction getDisplayedVersionNumber(entity: Entity): string | null {\n if (!isVersionableEntity(entity)) {\n return null\n }\n if (isTable(entity) && entity.isLatestVersion) {\n if (isEntityRefCollectionView(entity)) {\n return 'Draft Version'\n }\n return 'Current Version'\n }\n return `V${entity.versionNumber}${entity.isLatestVersion ? ' (Current)' : ''}`\n}\n\nfunction getDisplayedVersionComment(entity: Entity): string | null {\n if (!isVersionableEntity(entity)) {\n return null\n }\n return entity.versionComment ?? null\n}\n\nconst forwardSlash = (\n <Typography\n component={'span'}\n variant=\"smallText1\"\n sx={{\n color: 'grey.700',\n marginLeft: '5px',\n marginRight: '5px',\n }}\n >\n /\n </Typography>\n)\n\nexport function EntityTitleBarVersionInfo(\n props: EntityTitleBarVersionInfoProps,\n) {\n const { entityId, versionNumber, toggleShowVersionHistory } = props\n\n const { data: bundle } = useGetEntityBundle(entityId, versionNumber)\n\n const isVersionable = bundle?.entity && isVersionableEntity(bundle.entity)\n\n const fullVersionLabel =\n bundle?.entity && getDisplayedVersionLabel(bundle.entity)\n const truncatedVersionLabel = fullVersionLabel\n ? truncateString(fullVersionLabel, MAX_VERSION_LABEL_LENGTH)\n : undefined\n\n const versionNumberDisplay =\n bundle?.entity && getDisplayedVersionNumber(bundle.entity)\n\n const versionComment =\n bundle?.entity && getDisplayedVersionComment(bundle.entity)\n\n if (!isVersionable) {\n return null\n }\n return (\n <Box sx={{ marginTop: '3px' }}>\n <Tooltip title={'Click to show version history'} placement={'top'}>\n <Link\n onClick={toggleShowVersionHistory}\n variant=\"smallText1\"\n sx={{ fontWeight: 400 }}\n >\n {versionNumberDisplay}\n </Link>\n </Tooltip>\n {fullVersionLabel && versionNumberDisplay && forwardSlash}\n <Tooltip title={fullVersionLabel} placement={'bottom'}>\n <Typography\n component={'span'}\n variant=\"smallText1\"\n sx={{\n color: 'grey.700',\n fontStyle: 'italic',\n }}\n >\n {truncatedVersionLabel}\n </Typography>\n </Tooltip>\n {versionComment && forwardSlash}\n <Typography\n component={'span'}\n variant=\"smallText1\"\n sx={{\n color: 'grey.700',\n fontStyle: 'italic',\n }}\n >\n {versionComment}\n </Typography>\n </Box>\n )\n}\n\nexport const EXPORTED_FOR_UNIT_TESTING = {\n getDisplayedVersionLabel,\n getDisplayedVersionNumber,\n}\n"],"mappings":";;;;;;;AAWA,IAAM,IAA2B;AAOjC,SAAS,EAAyB,GAA+B;CAO/D,OANI,CAAC,EAAoB,CAAM,KAG3B,EAAQ,CAAM,KAAK,EAAO,kBACrB,OAEF,EAAO,gBAAgB;AAChC;AAEA,SAAS,EAA0B,GAA+B;CAUhE,OATK,EAAoB,CAAM,IAG3B,EAAQ,CAAM,KAAK,EAAO,kBACxB,EAA0B,CAAM,IAC3B,kBAEF,oBAEF,IAAI,EAAO,gBAAgB,EAAO,kBAAkB,eAAe,OARjE;AASX;AAEA,SAAS,EAA2B,GAA+B;CAIjE,OAHK,EAAoB,CAAM,IAGxB,EAAO,kBAAkB,OAFvB;AAGX;AAEA,IAAM,IACJ,kBAAC,GAAD;CACE,WAAW;CACX,SAAQ;CACR,IAAI;EACF,OAAO;EACP,YAAY;EACZ,aAAa;CACf;WACD;AAEW,CAAA;AAGd,SAAgB,EACd,GACA;CACA,IAAM,EAAE,aAAU,kBAAe,gCAA6B,GAExD,EAAE,MAAM,MAAW,EAAmB,GAAU,CAAa,GAE7D,IAAgB,GAAQ,UAAU,EAAoB,EAAO,MAAM,GAEnE,IACJ,GAAQ,UAAU,EAAyB,EAAO,MAAM,GACpD,IAAwB,IAC1B,EAAe,GAAkB,CAAwB,IACzD,KAAA,GAEE,IACJ,GAAQ,UAAU,EAA0B,EAAO,MAAM,GAErD,IACJ,GAAQ,UAAU,EAA2B,EAAO,MAAM;CAK5D,OAHK,IAIH,kBAAC,GAAD;EAAK,IAAI,EAAE,WAAW,MAAM;YAA5B;GACE,kBAAC,GAAD;IAAS,OAAO;IAAiC,WAAW;cAC1D,kBAAC,GAAD;KACE,SAAS;KACT,SAAQ;KACR,IAAI,EAAE,YAAY,IAAI;eAErB;IACG,CAAA;GACC,CAAA;GACR,KAAoB,KAAwB;GAC7C,kBAAC,GAAD;IAAS,OAAO;IAAkB,WAAW;cAC3C,kBAAC,GAAD;KACE,WAAW;KACX,SAAQ;KACR,IAAI;MACF,OAAO;MACP,WAAW;KACb;eAEC;IACS,CAAA;GACL,CAAA;GACR,KAAkB;GACnB,kBAAC,GAAD;IACE,WAAW;IACX,SAAQ;IACR,IAAI;KACF,OAAO;KACP,WAAW;IACb;cAEC;GACS,CAAA;EACT;MArCE;AAuCX;AAEA,IAAa,IAA4B;CACvC;CACA;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TitleBarProperties.d.ts","sourceRoot":"","sources":["../../../../../src/components/entity/page/title_bar/TitleBarProperties.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TitleBarProperties.d.ts","sourceRoot":"","sources":["../../../../../src/components/entity/page/title_bar/TitleBarProperties.tsx"],"names":[],"mappings":"AAGA,MAAM,MAAM,uBAAuB,GAAG;IACpC,QAAQ,EAAE,MAAM,CAAA;IAEhB,mCAAmC,EAAE,MAAM,IAAI,CAAA;CAChD,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,2CAkBxE"}
|
|
@@ -1,89 +1,24 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import {
|
|
3
|
-
import "
|
|
4
|
-
import { FeatureFlagEnum as n } from "../../../../utils/featureflag/FeatureFlags.js";
|
|
5
|
-
import r from "../../../AccessRequirement/AddConditionsForUseButton/AddConditionsForUseButton.js";
|
|
6
|
-
import { useGetEntityTitleBarProperties as i } from "./useGetEntityTitleBarProperties.js";
|
|
7
|
-
import { useState as a } from "react";
|
|
8
|
-
import { Box as o, Divider as s, Link as c, Stack as l, Typography as u } from "@mui/material";
|
|
9
|
-
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
1
|
+
import e from "../../../AccessRequirement/AddConditionsForUseButton/AddConditionsForUseButton.js";
|
|
2
|
+
import { Box as t } from "@mui/material";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
10
4
|
//#region src/components/entity/page/title_bar/TitleBarProperties.tsx
|
|
11
|
-
function
|
|
12
|
-
let {
|
|
13
|
-
return /* @__PURE__ */
|
|
14
|
-
|
|
15
|
-
children: /* @__PURE__ */
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
variant: "smallText1",
|
|
24
|
-
children: n
|
|
25
|
-
}) })] });
|
|
26
|
-
}
|
|
27
|
-
function m(u) {
|
|
28
|
-
let { entityId: m, versionNumber: h, onActMemberClickAddConditionsForUse: g } = u, { data: _ } = e(m, h), v = t(n.DESCRIPTION_FIELD), y = i(m, h), [b, x] = a(!1);
|
|
29
|
-
return /* @__PURE__ */ f(o, {
|
|
30
|
-
sx: { padding: "20px 40px" },
|
|
31
|
-
children: [
|
|
32
|
-
/* @__PURE__ */ f(l, {
|
|
33
|
-
direction: "row",
|
|
34
|
-
sx: {
|
|
35
|
-
justifyContent: "space-between",
|
|
36
|
-
alignItems: "flex-start"
|
|
37
|
-
},
|
|
38
|
-
children: [/* @__PURE__ */ f(l, {
|
|
39
|
-
direction: "row",
|
|
40
|
-
divider: /* @__PURE__ */ d(s, {
|
|
41
|
-
orientation: "vertical",
|
|
42
|
-
flexItem: !0
|
|
43
|
-
}),
|
|
44
|
-
spacing: 2,
|
|
45
|
-
sx: { alignItems: "flex-start" },
|
|
46
|
-
children: [
|
|
47
|
-
/* @__PURE__ */ d("table", { children: /* @__PURE__ */ d("tbody", { children: y.slice(0, 2).map((e) => /* @__PURE__ */ d(p, {
|
|
48
|
-
title: e.title,
|
|
49
|
-
value: e.value
|
|
50
|
-
}, e.key)) }) }),
|
|
51
|
-
y.length > 2 && /* @__PURE__ */ d("table", { children: /* @__PURE__ */ d("tbody", { children: y.slice(2, 4).map((e) => /* @__PURE__ */ d(p, {
|
|
52
|
-
title: e.title,
|
|
53
|
-
value: e.value
|
|
54
|
-
}, e.key)) }) }),
|
|
55
|
-
(y.length === 5 || y.length === 6) && /* @__PURE__ */ d("table", { children: /* @__PURE__ */ d("tbody", { children: y.slice(4, 6).map((e) => /* @__PURE__ */ d(p, {
|
|
56
|
-
title: e.title,
|
|
57
|
-
value: e.value
|
|
58
|
-
}, e.key)) }) }),
|
|
59
|
-
y.length > 6 && /* @__PURE__ */ d(c, {
|
|
60
|
-
onClick: () => x((e) => !e),
|
|
61
|
-
children: b ? "Hide properties" : `${y.length - 4} more properties`
|
|
62
|
-
})
|
|
63
|
-
]
|
|
64
|
-
}), /* @__PURE__ */ d(r, {
|
|
65
|
-
entityId: m,
|
|
66
|
-
onACTMemberClick: g
|
|
67
|
-
})]
|
|
68
|
-
}),
|
|
69
|
-
b && /* @__PURE__ */ d(o, {
|
|
70
|
-
sx: { pt: "20px" },
|
|
71
|
-
children: /* @__PURE__ */ d("table", { children: /* @__PURE__ */ d("tbody", { children: y.slice(4, Infinity).map((e) => /* @__PURE__ */ d(p, {
|
|
72
|
-
title: e.title,
|
|
73
|
-
value: e.value
|
|
74
|
-
}, e.key)) }) })
|
|
75
|
-
}),
|
|
76
|
-
_?.entity?.description && v && /* @__PURE__ */ d(o, {
|
|
77
|
-
sx: {
|
|
78
|
-
marginTop: "10px",
|
|
79
|
-
maxWidth: "720px"
|
|
80
|
-
},
|
|
81
|
-
children: _?.entity?.description
|
|
5
|
+
function r(r) {
|
|
6
|
+
let { entityId: i, onActMemberClickAddConditionsForUse: a } = r;
|
|
7
|
+
return /* @__PURE__ */ n(t, {
|
|
8
|
+
sx: { padding: "20px 0" },
|
|
9
|
+
children: /* @__PURE__ */ n(t, {
|
|
10
|
+
sx: {
|
|
11
|
+
display: "flex",
|
|
12
|
+
justifyContent: "flex-end"
|
|
13
|
+
},
|
|
14
|
+
children: /* @__PURE__ */ n(e, {
|
|
15
|
+
entityId: i,
|
|
16
|
+
onACTMemberClick: a
|
|
82
17
|
})
|
|
83
|
-
|
|
18
|
+
})
|
|
84
19
|
});
|
|
85
20
|
}
|
|
86
21
|
//#endregion
|
|
87
|
-
export {
|
|
22
|
+
export { r as default };
|
|
88
23
|
|
|
89
24
|
//# sourceMappingURL=TitleBarProperties.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TitleBarProperties.js","names":[],"sources":["../../../../../src/components/entity/page/title_bar/TitleBarProperties.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"TitleBarProperties.js","names":[],"sources":["../../../../../src/components/entity/page/title_bar/TitleBarProperties.tsx"],"sourcesContent":["import { Box } from '@mui/material'\nimport AddConditionsForUseButton from '../../../AccessRequirement/AddConditionsForUseButton/AddConditionsForUseButton'\n\nexport type TitleBarPropertiesProps = {\n entityId: string\n /* Callback invoked when an ACT member clicks \"Add Conditions for Use\". */\n onActMemberClickAddConditionsForUse: () => void\n}\n\n/**\n * The TitleBarProperties component displays a tabular view of the entity metadata on the Entity page.\n */\nexport default function TitleBarProperties(props: TitleBarPropertiesProps) {\n const { entityId, onActMemberClickAddConditionsForUse } = props\n\n return (\n <Box sx={{ padding: '20px 0' }}>\n <Box\n sx={{\n display: 'flex',\n justifyContent: 'flex-end',\n }}\n >\n <AddConditionsForUseButton\n entityId={entityId}\n onACTMemberClick={onActMemberClickAddConditionsForUse}\n />\n </Box>\n </Box>\n )\n}\n"],"mappings":";;;;AAYA,SAAwB,EAAmB,GAAgC;CACzE,IAAM,EAAE,aAAU,2CAAwC;CAE1D,OACE,kBAAC,GAAD;EAAK,IAAI,EAAE,SAAS,SAAS;YAC3B,kBAAC,GAAD;GACE,IAAI;IACF,SAAS;IACT,gBAAgB;GAClB;aAEA,kBAAC,GAAD;IACY;IACV,kBAAkB;GACnB,CAAA;EACE,CAAA;CACF,CAAA;AAET"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGetEntityTitleBarProperties.d.ts","sourceRoot":"","sources":["../../../../../src/components/entity/page/title_bar/useGetEntityTitleBarProperties.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,SAAS,EAAY,MAAM,OAAO,CAAA;AAQ3C,MAAM,MAAM,cAAc,GAAG;IAC3B,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,SAAS,CAAA;CACjB,CAAA;AAED;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAC5C,QAAQ,EAAE,MAAM,EAChB,aAAa,CAAC,EAAE,MAAM,GACrB,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"useGetEntityTitleBarProperties.d.ts","sourceRoot":"","sources":["../../../../../src/components/entity/page/title_bar/useGetEntityTitleBarProperties.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,SAAS,EAAY,MAAM,OAAO,CAAA;AAQ3C,MAAM,MAAM,cAAc,GAAG;IAC3B,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,SAAS,CAAA;CACjB,CAAA;AAED;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAC5C,QAAQ,EAAE,MAAM,EAChB,aAAa,CAAC,EAAE,MAAM,GACrB,cAAc,EAAE,CAmLlB"}
|
|
@@ -54,11 +54,10 @@ function b(b, x) {
|
|
|
54
54
|
W && {
|
|
55
55
|
key: "doi",
|
|
56
56
|
title: "DOI",
|
|
57
|
-
value: /* @__PURE__ */ g(
|
|
57
|
+
value: /* @__PURE__ */ g(d, {
|
|
58
|
+
value: W,
|
|
58
59
|
href: W,
|
|
59
|
-
|
|
60
|
-
target: "_blank",
|
|
61
|
-
children: W
|
|
60
|
+
useRoundedIcon: !0
|
|
62
61
|
})
|
|
63
62
|
},
|
|
64
63
|
G && {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGetEntityTitleBarProperties.js","names":[],"sources":["../../../../../src/components/entity/page/title_bar/useGetEntityTitleBarProperties.tsx"],"sourcesContent":["import { useGetEntityChildren } from '@/synapse-queries'\nimport { useGetDOIAssociation } from '@/synapse-queries/doi/useDOI'\nimport { calculateFriendlyFileSize } from '@/utils/functions/calculateFriendlyFileSize'\nimport {\n isEntityRefCollectionView,\n isVersionableEntity,\n} from '@/utils/functions/EntityTypeUtils'\nimport useGetEntityMetadata from '@/utils/hooks/useGetEntityMetadata'\nimport { Box, Link } from '@mui/material'\nimport { DoiObjectType, EntityType } from '@sage-bionetworks/synapse-client'\nimport { EntityRefCollectionView } from '@sage-bionetworks/synapse-types'\nimport { ReactNode, useState } from 'react'\nimport CopyToClipboardString from '../../../CopyToClipboardString/CopyToClipboardString'\nimport { HasAccessV2 } from '../../../HasAccess/HasAccessV2'\nimport { CitationsDialog } from './CitationsDialog'\nimport { maxCitationCount, useDataCiteUsage } from './useDataCiteUsage'\nimport { useGetMentions } from './useGetMentions'\nimport Linkify from '@/components/GenericCard/Linkify'\n\nexport type EntityProperty = {\n key: string\n title: string\n value: ReactNode\n}\n\n/**\n * This hook fetches all the entity metadata shown on the Entity page, and transforms the data into an ordered list of\n * render-able key-value pairs.\n * @param entityId\n * @param versionNumber\n */\nexport function useGetEntityTitleBarProperties(\n entityId: string,\n versionNumber?: number,\n): EntityProperty[] {\n const {\n entityBundle: bundle,\n fileHandle: dataFileHandle,\n downloadAlias,\n isContainer,\n fileHandleStorageInfo,\n uploadDestinationString,\n } = useGetEntityMetadata(entityId, versionNumber)\n const [dataCiteCitationsDialogOpen, setDataCiteCitationsDialogOpen] =\n useState(false)\n const [mentionsDialogOpen, setMentionsDialogOpen] = useState(false)\n const { data: entityChildrenResponse } = useGetEntityChildren(\n {\n parentId: entityId,\n includeTypes: Object.values(EntityType),\n includeTotalChildCount: true,\n },\n { enabled: isContainer },\n )\n\n // If this is the latest entity version, show the \"versionless\" DOI if it exists.\n const useFallbackVersionlessDOI =\n bundle &&\n !bundle.doiAssociation &&\n isVersionableEntity(bundle.entity) &&\n bundle.entity.isLatestVersion\n const { data: versionlessDOIAssociation } = useGetDOIAssociation(\n { id: entityId, version: undefined, type: DoiObjectType.ENTITY },\n {\n enabled: useFallbackVersionlessDOI,\n },\n )\n\n const size =\n dataFileHandle?.contentSize &&\n calculateFriendlyFileSize(dataFileHandle.contentSize)\n const storageLocation =\n fileHandleStorageInfo &&\n 'location' in fileHandleStorageInfo &&\n fileHandleStorageInfo.location\n const endpoint =\n fileHandleStorageInfo &&\n 'endpoint' in fileHandleStorageInfo &&\n fileHandleStorageInfo.endpoint\n const bucket =\n fileHandleStorageInfo &&\n 'bucket' in fileHandleStorageInfo &&\n fileHandleStorageInfo.bucket\n const fileKey =\n fileHandleStorageInfo &&\n 'fileKey' in fileHandleStorageInfo &&\n fileHandleStorageInfo.fileKey\n const externalUrl =\n fileHandleStorageInfo &&\n 'url' in fileHandleStorageInfo &&\n fileHandleStorageInfo.url\n\n const md5 = dataFileHandle?.contentMd5\n\n // If there is no version-specific DOI, fall back to the versionless DOI\n const doiAssociation = useFallbackVersionlessDOI\n ? versionlessDOIAssociation\n : bundle?.doiAssociation\n const { data: dataCiteUsage } = useDataCiteUsage(doiAssociation?.doiUri)\n const doi = doiAssociation && `https://doi.org/${doiAssociation?.doiUri}`\n const isDoiUsage = !!dataCiteUsage && dataCiteUsage.citationCount > 0\n const containerItems = entityChildrenResponse?.totalChildCount\n\n const datasetItems =\n bundle?.entity && isEntityRefCollectionView(bundle.entity)\n ? ((bundle?.entity as EntityRefCollectionView).items ?? []).length\n : null\n\n const { data: mentions } = useGetMentions(entityId)\n const isMentions = !!mentions && mentions.length > 0\n return [\n {\n key: 'id',\n title: 'SynID',\n value: <CopyToClipboardString value={entityId} />,\n },\n {\n key: 'access',\n title: 'Access',\n value: <HasAccessV2 entityId={entityId} />,\n },\n size && { key: 'fileSize', title: 'Size', value: size },\n containerItems != null && {\n key: 'containerItems',\n title: 'Items',\n value: containerItems.toLocaleString(),\n },\n datasetItems != null && {\n key: 'entityRefCollectionItems',\n title: 'Items',\n value: datasetItems.toLocaleString(),\n },\n doi && {\n key: 'doi',\n title: 'DOI',\n value:
|
|
1
|
+
{"version":3,"file":"useGetEntityTitleBarProperties.js","names":[],"sources":["../../../../../src/components/entity/page/title_bar/useGetEntityTitleBarProperties.tsx"],"sourcesContent":["import { useGetEntityChildren } from '@/synapse-queries'\nimport { useGetDOIAssociation } from '@/synapse-queries/doi/useDOI'\nimport { calculateFriendlyFileSize } from '@/utils/functions/calculateFriendlyFileSize'\nimport {\n isEntityRefCollectionView,\n isVersionableEntity,\n} from '@/utils/functions/EntityTypeUtils'\nimport useGetEntityMetadata from '@/utils/hooks/useGetEntityMetadata'\nimport { Box, Link } from '@mui/material'\nimport { DoiObjectType, EntityType } from '@sage-bionetworks/synapse-client'\nimport { EntityRefCollectionView } from '@sage-bionetworks/synapse-types'\nimport { ReactNode, useState } from 'react'\nimport CopyToClipboardString from '../../../CopyToClipboardString/CopyToClipboardString'\nimport { HasAccessV2 } from '../../../HasAccess/HasAccessV2'\nimport { CitationsDialog } from './CitationsDialog'\nimport { maxCitationCount, useDataCiteUsage } from './useDataCiteUsage'\nimport { useGetMentions } from './useGetMentions'\nimport Linkify from '@/components/GenericCard/Linkify'\n\nexport type EntityProperty = {\n key: string\n title: string\n value: ReactNode\n}\n\n/**\n * This hook fetches all the entity metadata shown on the Entity page, and transforms the data into an ordered list of\n * render-able key-value pairs.\n * @param entityId\n * @param versionNumber\n */\nexport function useGetEntityTitleBarProperties(\n entityId: string,\n versionNumber?: number,\n): EntityProperty[] {\n const {\n entityBundle: bundle,\n fileHandle: dataFileHandle,\n downloadAlias,\n isContainer,\n fileHandleStorageInfo,\n uploadDestinationString,\n } = useGetEntityMetadata(entityId, versionNumber)\n const [dataCiteCitationsDialogOpen, setDataCiteCitationsDialogOpen] =\n useState(false)\n const [mentionsDialogOpen, setMentionsDialogOpen] = useState(false)\n const { data: entityChildrenResponse } = useGetEntityChildren(\n {\n parentId: entityId,\n includeTypes: Object.values(EntityType),\n includeTotalChildCount: true,\n },\n { enabled: isContainer },\n )\n\n // If this is the latest entity version, show the \"versionless\" DOI if it exists.\n const useFallbackVersionlessDOI =\n bundle &&\n !bundle.doiAssociation &&\n isVersionableEntity(bundle.entity) &&\n bundle.entity.isLatestVersion\n const { data: versionlessDOIAssociation } = useGetDOIAssociation(\n { id: entityId, version: undefined, type: DoiObjectType.ENTITY },\n {\n enabled: useFallbackVersionlessDOI,\n },\n )\n\n const size =\n dataFileHandle?.contentSize &&\n calculateFriendlyFileSize(dataFileHandle.contentSize)\n const storageLocation =\n fileHandleStorageInfo &&\n 'location' in fileHandleStorageInfo &&\n fileHandleStorageInfo.location\n const endpoint =\n fileHandleStorageInfo &&\n 'endpoint' in fileHandleStorageInfo &&\n fileHandleStorageInfo.endpoint\n const bucket =\n fileHandleStorageInfo &&\n 'bucket' in fileHandleStorageInfo &&\n fileHandleStorageInfo.bucket\n const fileKey =\n fileHandleStorageInfo &&\n 'fileKey' in fileHandleStorageInfo &&\n fileHandleStorageInfo.fileKey\n const externalUrl =\n fileHandleStorageInfo &&\n 'url' in fileHandleStorageInfo &&\n fileHandleStorageInfo.url\n\n const md5 = dataFileHandle?.contentMd5\n\n // If there is no version-specific DOI, fall back to the versionless DOI\n const doiAssociation = useFallbackVersionlessDOI\n ? versionlessDOIAssociation\n : bundle?.doiAssociation\n const { data: dataCiteUsage } = useDataCiteUsage(doiAssociation?.doiUri)\n const doi = doiAssociation && `https://doi.org/${doiAssociation?.doiUri}`\n const isDoiUsage = !!dataCiteUsage && dataCiteUsage.citationCount > 0\n const containerItems = entityChildrenResponse?.totalChildCount\n\n const datasetItems =\n bundle?.entity && isEntityRefCollectionView(bundle.entity)\n ? ((bundle?.entity as EntityRefCollectionView).items ?? []).length\n : null\n\n const { data: mentions } = useGetMentions(entityId)\n const isMentions = !!mentions && mentions.length > 0\n return [\n {\n key: 'id',\n title: 'SynID',\n value: <CopyToClipboardString value={entityId} />,\n },\n {\n key: 'access',\n title: 'Access',\n value: <HasAccessV2 entityId={entityId} />,\n },\n size && { key: 'fileSize', title: 'Size', value: size },\n containerItems != null && {\n key: 'containerItems',\n title: 'Items',\n value: containerItems.toLocaleString(),\n },\n datasetItems != null && {\n key: 'entityRefCollectionItems',\n title: 'Items',\n value: datasetItems.toLocaleString(),\n },\n doi && {\n key: 'doi',\n title: 'DOI',\n value: <CopyToClipboardString value={doi} href={doi} useRoundedIcon />,\n },\n isDoiUsage && {\n key: 'citations',\n title: 'Citations',\n value: (\n <>\n <Link onClick={() => setDataCiteCitationsDialogOpen(true)}>\n {dataCiteUsage.citationCount.toLocaleString()}\n {dataCiteUsage.citationCount == maxCitationCount && '+'}\n </Link>\n <CitationsDialog\n open={dataCiteCitationsDialogOpen}\n onClose={() => setDataCiteCitationsDialogOpen(false)}\n citations={dataCiteUsage.citations}\n />\n </>\n ),\n },\n isMentions && {\n key: 'mentions',\n title: 'Mentions',\n value: (\n <>\n <Link onClick={() => setMentionsDialogOpen(true)}>\n {mentions.length.toLocaleString()}\n </Link>\n <CitationsDialog\n open={mentionsDialogOpen}\n onClose={() => setMentionsDialogOpen(false)}\n citations={mentions}\n title=\"Mentioned in\"\n />\n </>\n ),\n },\n md5 && {\n key: 'fileMd5',\n title: 'MD5',\n value: <CopyToClipboardString value={md5} />,\n },\n !isContainer &&\n storageLocation && {\n key: 'fileStorageLocation',\n title: 'Storage Location',\n value: storageLocation,\n },\n isContainer &&\n uploadDestinationString && {\n key: 'uploadDestination',\n title: 'Upload Destination',\n value: uploadDestinationString,\n },\n endpoint && {\n key: 'externalFileEndpoint',\n title: 'Endpoint',\n value: endpoint,\n },\n externalUrl && {\n key: 'externalUrl',\n title: 'URL',\n value: <Linkify text={externalUrl} />,\n },\n bucket && { key: 'externalFileBucket', title: 'Bucket', value: bucket },\n fileKey && { key: 'externalFileKey', title: 'File Key', value: fileKey },\n downloadAlias && {\n key: 'fileAlias',\n title: 'Alias',\n value: (\n <>\n {'Name when downloaded will be: '}\n <Box sx={{ display: 'inline', fontFamily: 'monospace' }}>\n {downloadAlias}\n </Box>\n </>\n ),\n },\n ].filter(item => !!item) as EntityProperty[]\n}\n"],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FavoriteButton.d.ts","sourceRoot":"","sources":["../../../src/components/favorites/FavoriteButton.tsx"],"names":[],"mappings":"AAUA,MAAM,MAAM,mBAAmB,GAAG;IAEhC,QAAQ,EAAE,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"FavoriteButton.d.ts","sourceRoot":"","sources":["../../../src/components/favorites/FavoriteButton.tsx"],"names":[],"mappings":"AAUA,MAAM,MAAM,mBAAmB,GAAG;IAEhC,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,KAAK,EAAE,mBAAmB,2CAkDhE"}
|
|
@@ -7,24 +7,24 @@ import { IconButton as o, Skeleton as s, Tooltip as c } from "@mui/material";
|
|
|
7
7
|
import { jsx as l } from "react/jsx-runtime";
|
|
8
8
|
//#region src/components/favorites/FavoriteButton.tsx
|
|
9
9
|
function u(u) {
|
|
10
|
-
let { entityId: d } = u, { isAuthenticated:
|
|
11
|
-
return
|
|
12
|
-
condition:
|
|
10
|
+
let { entityId: d, iconColor: f } = u, { isAuthenticated: p } = e(), { isFavorite: m, isLoading: h } = n(d), { mutate: g, isPending: _ } = t(), { mutate: v, isPending: y } = r(), b = h || _ || y || !p, x = "Add to Favorites";
|
|
11
|
+
return p ? m && (x = "Remove from Favorites") : x = "Sign in to add this to your favorites", /* @__PURE__ */ l(a, {
|
|
12
|
+
condition: h,
|
|
13
13
|
wrapper: s,
|
|
14
14
|
children: /* @__PURE__ */ l(c, {
|
|
15
|
-
title:
|
|
15
|
+
title: x,
|
|
16
16
|
placement: "top",
|
|
17
17
|
children: /* @__PURE__ */ l("span", { children: /* @__PURE__ */ l(o, {
|
|
18
18
|
size: "small",
|
|
19
|
-
disabled:
|
|
19
|
+
disabled: b,
|
|
20
20
|
onClick: () => {
|
|
21
|
-
|
|
21
|
+
m ? v(d) : g(d);
|
|
22
22
|
},
|
|
23
23
|
sx: { padding: "2px" },
|
|
24
24
|
children: /* @__PURE__ */ l(i, {
|
|
25
|
-
icon:
|
|
25
|
+
icon: m ? "fav" : "favOutline",
|
|
26
26
|
sx: {
|
|
27
|
-
color: "tertiary.main",
|
|
27
|
+
color: m ? "tertiary.main" : f ?? "tertiary.main",
|
|
28
28
|
width: "21px",
|
|
29
29
|
height: "21px"
|
|
30
30
|
},
|