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.
Files changed (108) hide show
  1. package/dist/SWC.index.d.ts +1 -0
  2. package/dist/SWC.index.d.ts.map +1 -1
  3. package/dist/SWC.index.js +2 -1
  4. package/dist/SWC.index.js.map +1 -1
  5. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DataAccessRequestAccessorsFilesForm/DataAccessRequestAccessorsFilesForm.js.map +1 -1
  6. package/dist/components/AclEditor/useUpdateAcl.js.map +1 -1
  7. package/dist/components/Authentication/TwoFactorBackupCodes.js.map +1 -1
  8. package/dist/components/Authentication/TwoFactorEnrollmentForm.js.map +1 -1
  9. package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +3 -0
  10. package/dist/components/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
  11. package/dist/components/Breadcrumbs/Breadcrumbs.js +43 -30
  12. package/dist/components/Breadcrumbs/Breadcrumbs.js.map +1 -1
  13. package/dist/components/CannedRejectionDialog/CannedRejectionDialog.js.map +1 -1
  14. package/dist/components/ChallengeSubmission/SubmissionDirectoryList.js.map +1 -1
  15. package/dist/components/CopyToClipboardString/CopyToClipboardString.d.ts +7 -1
  16. package/dist/components/CopyToClipboardString/CopyToClipboardString.d.ts.map +1 -1
  17. package/dist/components/CopyToClipboardString/CopyToClipboardString.js +22 -16
  18. package/dist/components/CopyToClipboardString/CopyToClipboardString.js.map +1 -1
  19. package/dist/components/EntityCitation/EntityCitation.d.ts.map +1 -1
  20. package/dist/components/EntityCitation/EntityCitation.js +28 -26
  21. package/dist/components/EntityCitation/EntityCitation.js.map +1 -1
  22. package/dist/components/EntityFinder/tree/EntityTree.js.map +1 -1
  23. package/dist/components/EntityFinder/tree/VirtualizedTree.js.map +1 -1
  24. package/dist/components/EntityIcon.d.ts +1 -0
  25. package/dist/components/EntityIcon.d.ts.map +1 -1
  26. package/dist/components/EntityIcon.js +37 -36
  27. package/dist/components/EntityIcon.js.map +1 -1
  28. package/dist/components/EntitySidebar/EntitySidebar.css +1 -0
  29. package/dist/components/EntitySidebar/EntitySidebar.d.ts +7 -0
  30. package/dist/components/EntitySidebar/EntitySidebar.d.ts.map +1 -0
  31. package/dist/components/EntitySidebar/EntitySidebar.js +62 -0
  32. package/dist/components/EntitySidebar/EntitySidebar.js.map +1 -0
  33. package/dist/components/EntitySidebar/EntitySidebar.module.js +17 -0
  34. package/dist/components/EntitySidebar/EntitySidebar.module.js.map +1 -0
  35. package/dist/components/EntitySidebar/EntitySidebar.module.scss +87 -0
  36. package/dist/components/Evaluation/EvaluationRoundEditorList.js.map +1 -1
  37. package/dist/components/GenericCard/BioregistryRules.js.map +1 -1
  38. package/dist/components/IconSvg/IconSvg.d.ts +2 -1
  39. package/dist/components/IconSvg/IconSvg.d.ts.map +1 -1
  40. package/dist/components/IconSvg/IconSvg.js +112 -89
  41. package/dist/components/IconSvg/IconSvg.js.map +1 -1
  42. package/dist/components/Plot/SynapsePlot.d.ts +4 -0
  43. package/dist/components/Plot/SynapsePlot.d.ts.map +1 -1
  44. package/dist/components/Plot/SynapsePlot.js +57 -44
  45. package/dist/components/Plot/SynapsePlot.js.map +1 -1
  46. package/dist/components/Plot/UpsetPlot.js.map +1 -1
  47. package/dist/components/QueryWrapperPlotNav/QueryWrapperSynapsePlot.d.ts.map +1 -1
  48. package/dist/components/QueryWrapperPlotNav/QueryWrapperSynapsePlot.js +77 -34
  49. package/dist/components/QueryWrapperPlotNav/QueryWrapperSynapsePlot.js.map +1 -1
  50. package/dist/components/SchemaDrivenAnnotationEditor/field/AdditionalPropertiesSchemaField.js.map +1 -1
  51. package/dist/components/SearchQueryWrapperPlotNav/SearchQueryWrapperPlotNav.d.ts.map +1 -1
  52. package/dist/components/SearchQueryWrapperPlotNav/SearchQueryWrapperPlotNav.js +1 -0
  53. package/dist/components/SearchQueryWrapperPlotNav/SearchQueryWrapperPlotNav.js.map +1 -1
  54. package/dist/components/StorybookComponentWrapper.js.map +1 -1
  55. package/dist/components/SynapseTable/TablePagination.js.map +1 -1
  56. package/dist/components/SynapseTable/datasets/DatasetItemsEditor.js.map +1 -1
  57. package/dist/components/TableColumnSchemaEditor/TableColumnSchemaForm.js.map +1 -1
  58. package/dist/components/TanStackTable/StyledTanStackTable.js.map +1 -1
  59. package/dist/components/entity/page/action_menu/EntityActionMenu.d.ts +2 -0
  60. package/dist/components/entity/page/action_menu/EntityActionMenu.d.ts.map +1 -1
  61. package/dist/components/entity/page/action_menu/EntityActionMenu.js +46 -27
  62. package/dist/components/entity/page/action_menu/EntityActionMenu.js.map +1 -1
  63. package/dist/components/entity/page/breadcrumbs/EntityPageBreadcrumbs.d.ts +1 -8
  64. package/dist/components/entity/page/breadcrumbs/EntityPageBreadcrumbs.d.ts.map +1 -1
  65. package/dist/components/entity/page/breadcrumbs/EntityPageBreadcrumbs.js +17 -13
  66. package/dist/components/entity/page/breadcrumbs/EntityPageBreadcrumbs.js.map +1 -1
  67. package/dist/components/entity/page/title_bar/EntityPageTitleBar.d.ts +1 -0
  68. package/dist/components/entity/page/title_bar/EntityPageTitleBar.d.ts.map +1 -1
  69. package/dist/components/entity/page/title_bar/EntityPageTitleBar.js +35 -22
  70. package/dist/components/entity/page/title_bar/EntityPageTitleBar.js.map +1 -1
  71. package/dist/components/entity/page/title_bar/EntityTitleBarVersionInfo.d.ts.map +1 -1
  72. package/dist/components/entity/page/title_bar/EntityTitleBarVersionInfo.js +34 -20
  73. package/dist/components/entity/page/title_bar/EntityTitleBarVersionInfo.js.map +1 -1
  74. package/dist/components/entity/page/title_bar/TitleBarProperties.d.ts +0 -1
  75. package/dist/components/entity/page/title_bar/TitleBarProperties.d.ts.map +1 -1
  76. package/dist/components/entity/page/title_bar/TitleBarProperties.js +17 -82
  77. package/dist/components/entity/page/title_bar/TitleBarProperties.js.map +1 -1
  78. package/dist/components/entity/page/title_bar/useGetEntityTitleBarProperties.d.ts.map +1 -1
  79. package/dist/components/entity/page/title_bar/useGetEntityTitleBarProperties.js +3 -4
  80. package/dist/components/entity/page/title_bar/useGetEntityTitleBarProperties.js.map +1 -1
  81. package/dist/components/favorites/FavoriteButton.d.ts +1 -0
  82. package/dist/components/favorites/FavoriteButton.d.ts.map +1 -1
  83. package/dist/components/favorites/FavoriteButton.js +8 -8
  84. package/dist/components/favorites/FavoriteButton.js.map +1 -1
  85. package/dist/components/menu/ComplexMenu.d.ts.map +1 -1
  86. package/dist/components/menu/ComplexMenu.js +5 -3
  87. package/dist/components/menu/ComplexMenu.js.map +1 -1
  88. package/dist/components/menu/DropdownMenu.d.ts +1 -0
  89. package/dist/components/menu/DropdownMenu.d.ts.map +1 -1
  90. package/dist/components/menu/DropdownMenu.js +24 -24
  91. package/dist/components/menu/DropdownMenu.js.map +1 -1
  92. package/dist/components/widgets/facet-nav/FacetNavPanel.d.ts.map +1 -1
  93. package/dist/components/widgets/facet-nav/FacetNavPanel.js +59 -49
  94. package/dist/components/widgets/facet-nav/FacetNavPanel.js.map +1 -1
  95. package/dist/components/widgets/facet-nav/PlotsContainer.d.ts.map +1 -1
  96. package/dist/components/widgets/facet-nav/PlotsContainer.js +8 -2
  97. package/dist/components/widgets/facet-nav/PlotsContainer.js.map +1 -1
  98. package/dist/style/components/facet_nav/_facet-nav-panel.scss +11 -0
  99. package/dist/style/main.css +1 -1
  100. package/dist/testutils/ReactQueryMockUtils.js.map +1 -1
  101. package/dist/tsconfig.build.tsbuildinfo +1 -1
  102. package/dist/types/ThemeTypes.d.ts +2 -2
  103. package/dist/utils/functions/IsEqualTreatUndefinedAsMissing.js.map +1 -1
  104. package/dist/utils/hooks/useDebouncedEffect.js.map +1 -1
  105. package/dist/utils/hooks/useDetectSSOCode.js.map +1 -1
  106. package/dist/utils/hooks/useImmutableTableQuery/useImmutableTableQuery.js.map +1 -1
  107. package/dist/utils/hooks/useLogin.js.map +1 -1
  108. 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":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAEzC,KAAK,cAAc,GAAG;IAEpB,IAAI,EAAE,MAAM,CAAA;IAEZ,OAAO,CAAC,EAAE,OAAO,CAAA;IAEjB,EAAE,CAAC,EAAE,MAAM,CAAA;IAEX,IAAI,CAAC,EAAE,MAAM,CAAA;IAEb,OAAO,CAAC,EAAE,iBAAiB,CAAA;CAC5B,CAAA;AAED,KAAK,0BAA0B,GAAG;IAChC,KAAK,EAAE,cAAc,EAAE,CAAA;IACvB,EAAE,CAAC,EAAE,OAAO,CAAA;CACb,CAAA;AAoBD,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAC3C,KAAK,EAAE,0BAA0B,2CAUlC"}
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 40px",
7
- backgroundColor: "grey.200",
8
- "& .MuiLink-root": {
9
- color: "text.secondary",
10
- letterSpacing: 0,
11
- "&:visited": { color: "text.secondary" }
6
+ padding: "10px 32px",
7
+ "& .MuiTypography-root": {
8
+ fontWeight: 440,
9
+ lineHeight: "20px",
10
+ color: r
12
11
  },
13
- "& .MuiSvgIcon-root": { color: "grey.500" }
12
+ "& .MuiLink-root": { "&:visited": { color: r } },
13
+ "& .MuiSvgIcon-root": {
14
+ fontWeight: "300",
15
+ color: r
16
+ }
14
17
  };
15
- function i(i) {
16
- let { items: a } = i;
18
+ function a(r) {
19
+ let { items: a } = r;
17
20
  return /* @__PURE__ */ t(e, {
18
21
  items: a,
19
- sx: r,
20
- maxBreadcrumbLength: n
22
+ sx: i,
23
+ maxBreadcrumbLength: n,
24
+ iconVariant: "outlined"
21
25
  });
22
26
  }
23
27
  //#endregion
24
- export { i as default };
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 { Breadcrumbs } from '@/components/Breadcrumbs/Breadcrumbs'\nimport { SxProps } from '@mui/material'\nimport { MouseEventHandler } from 'react'\n\ntype BreadcrumbItem = {\n /* The text to show in the breadcrumb item. Strings > 25 characters will be truncated */\n text: string\n /* Whether this item represents the current page. If true, this item will not have a link. Default false */\n current?: boolean\n /* Link for the item, if using react-router */\n to?: string\n /* Link for the item, if it should be a normal anchor */\n href?: string\n /* Event handler fired when the link is clicked */\n onClick?: MouseEventHandler\n}\n\ntype EntityPageBreadcrumbsProps = {\n items: BreadcrumbItem[]\n sx?: SxProps\n}\n\nconst ENTITY_PAGE_MAX_BREADCRUMB_LENGTH = 32\n\nconst entityPageBreadcrumbStyle: SxProps = {\n marginTop: '0px',\n padding: '10px 40px',\n backgroundColor: 'grey.200',\n ['& .MuiLink-root']: {\n color: 'text.secondary',\n letterSpacing: 0,\n '&:visited': {\n color: 'text.secondary',\n },\n },\n '& .MuiSvgIcon-root': {\n color: 'grey.500',\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 />\n )\n}\n"],"mappings":";;;AAsBA,IAAM,IAAoC,IAEpC,IAAqC;CACzC,WAAW;CACX,SAAS;CACT,iBAAiB;CAChB,mBAAoB;EACnB,OAAO;EACP,eAAe;EACf,aAAa,EACX,OAAO,iBACT;CACF;CACA,sBAAsB,EACpB,OAAO,WACT;AACF;AAEA,SAAwB,EACtB,GACA;CACA,IAAM,EAAE,aAAU;CAClB,OACE,kBAAC,GAAD;EACS;EACP,IAAI;EACJ,qBAAqB;CACtB,CAAA;AAEL"}
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,2CAyFxE"}
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
- function g(g) {
14
- let { entityId: _, versionNumber: v, entityActionMenuProps: y } = g, b = y?.actionConfiguration.SHOW_VERSION_HISTORY?.onClick, { data: x, isLoading: S } = t(_, v), C = x?.entity && e(x.entity) ? x.entity.repositoryName : x?.entity?.name;
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: "grey.100"
19
+ backgroundColor: _,
20
+ borderRadius: "5px"
19
21
  },
20
22
  children: /* @__PURE__ */ h(f, {
21
- sx: { flexDirection: {
22
- xs: "column",
23
- sm: "row"
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: S,
37
+ condition: T,
33
38
  wrapper: d,
34
39
  wrapperProps: { variant: "circular" },
35
40
  children: /* @__PURE__ */ m(l, {
36
41
  sx: {
37
- bgcolor: "grey.300",
42
+ bgcolor: v,
38
43
  height: 48,
39
- width: 48
44
+ width: 48,
45
+ borderRadius: "3px"
40
46
  },
41
- children: x?.entityType && /* @__PURE__ */ m(n, {
42
- icon: x?.entityType ? r[x.entityType] : "file",
43
- wrap: !1,
44
- sx: { color: "grey.700" }
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: S,
65
+ condition: T,
60
66
  wrapper: d,
61
67
  children: /* @__PURE__ */ m(p, {
62
68
  variant: "headline2",
63
- children: C ?? "Name not set"
69
+ sx: {
70
+ color: y,
71
+ fontWeight: 540
72
+ },
73
+ children: E ?? "Name not set"
64
74
  })
65
- }), x?.entity?.id && /* @__PURE__ */ m(a, { entityId: x.entity.id })]
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: v,
69
- toggleShowVersionHistory: b
80
+ entityId: b,
81
+ versionNumber: x,
82
+ toggleShowVersionHistory: C
70
83
  })]
71
84
  })]
72
- }), y && /* @__PURE__ */ m(o, { ...y })]
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: 'grey.100',\n }}\n >\n <Stack\n sx={{\n flexDirection: { xs: 'column', sm: 'row' },\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 sx={{ bgcolor: 'grey.300', height: 48, width: 48 }}>\n {bundle?.entityType && (\n <IconSvg\n icon={\n bundle?.entityType\n ? type2SvgIconName[bundle.entityType]\n : 'file'\n }\n wrap={false}\n sx={{ color: 'grey.700' }}\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 variant={'headline2'}>\n {name ?? 'Name not set'}\n </Typography>\n </ConditionalWrapper>\n {bundle?.entity?.id && (\n <FavoriteButton entityId={bundle.entity.id} />\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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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
+ {"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,EAA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wB,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;AAED,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,8BAA8B,kDA2DtC;AAED,eAAO,MAAM,yBAAyB;;;CAGrC,CAAA"}
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
- let { entityId: t, versionNumber: m, toggleShowVersionHistory: h } = e, { data: g } = i(t, m), _ = g?.entity && n(g.entity), v = g?.entity && f(g.entity), y = v ? r(v, d) : void 0, b = g?.entity && p(g.entity);
17
- return _ ? /* @__PURE__ */ u(a, {
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: v,
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: y
54
+ children: x
31
55
  })
32
56
  }),
33
- v && b && /* @__PURE__ */ l(c, {
57
+ C && h,
58
+ /* @__PURE__ */ l(c, {
34
59
  component: "span",
35
60
  variant: "smallText1",
36
61
  sx: {
37
62
  color: "grey.700",
38
- marginLeft: "5px",
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 h = {
70
+ var _ = {
57
71
  getDisplayedVersionLabel: f,
58
72
  getDisplayedVersionNumber: p
59
73
  };
60
74
  //#endregion
61
- export { h as EXPORTED_FOR_UNIT_TESTING, m as EntityTitleBarVersionInfo };
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\n return (\n <Box sx={{ marginTop: '3px' }}>\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 {fullVersionLabel && versionNumberDisplay && (\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 <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 </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,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;CAM3D,OAJK,IAKH,kBAAC,GAAD;EAAK,IAAI,EAAE,WAAW,MAAM;YAA5B;GACE,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,KAAoB,KACnB,kBAAC,GAAD;IACE,WAAW;IACX,SAAQ;IACR,IAAI;KACF,OAAO;KACP,YAAY;KACZ,aAAa;IACf;cACD;GAEW,CAAA;GAEd,kBAAC,GAAD;IAAS,OAAO;IAAiC,WAAW;cAC1D,kBAAC,GAAD;KACE,SAAS;KACT,SAAQ;KACR,IAAI,EAAE,YAAY,IAAI;eAErB;IACG,CAAA;GACC,CAAA;EACN;MAvCE;AAyCX;AAEA,IAAa,IAA4B;CACvC;CACA;AACF"}
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,6 +1,5 @@
1
1
  export type TitleBarPropertiesProps = {
2
2
  entityId: string;
3
- versionNumber?: number;
4
3
  onActMemberClickAddConditionsForUse: () => void;
5
4
  };
6
5
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"TitleBarProperties.d.ts","sourceRoot":"","sources":["../../../../../src/components/entity/page/title_bar/TitleBarProperties.tsx"],"names":[],"mappings":"AAOA,MAAM,MAAM,uBAAuB,GAAG;IACpC,QAAQ,EAAE,MAAM,CAAA;IAChB,aAAa,CAAC,EAAE,MAAM,CAAA;IAEtB,mCAAmC,EAAE,MAAM,IAAI,CAAA;CAChD,CAAA;AA8BD;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,2CA8FxE"}
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 "../../../../synapse-queries/entity/useEntityBundle.js";
2
- import { useGetFeatureFlag as t } from "../../../../synapse-queries/featureflags/useGetFeatureFlag.js";
3
- import "../../../../synapse-queries/index.js";
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 p(e) {
12
- let { title: t, value: n } = e;
13
- return /* @__PURE__ */ f("tr", { children: [/* @__PURE__ */ d("td", {
14
- style: { paddingRight: "1em" },
15
- children: /* @__PURE__ */ d(u, {
16
- component: "span",
17
- variant: "smallText1",
18
- sx: { fontWeight: 700 },
19
- children: t
20
- })
21
- }), /* @__PURE__ */ d("td", { children: /* @__PURE__ */ d(u, {
22
- component: "span",
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 { m as default };
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 { useGetEntityBundle, useGetFeatureFlag } from '@/synapse-queries'\nimport { Box, Divider, Link, Stack, Typography } from '@mui/material'\nimport { FeatureFlagEnum } from '@/utils/featureflag/FeatureFlags'\nimport { ReactNode, useState } from 'react'\nimport AddConditionsForUseButton from '../../../AccessRequirement/AddConditionsForUseButton/AddConditionsForUseButton'\nimport { useGetEntityTitleBarProperties } from './useGetEntityTitleBarProperties'\n\nexport type TitleBarPropertiesProps = {\n entityId: string\n versionNumber?: number\n /* Callback invoked when an ACT member clicks \"Add Conditions for Use\". */\n onActMemberClickAddConditionsForUse: () => void\n}\n\ntype PropertyProps = {\n title: string\n value: ReactNode\n}\nfunction Property(props: PropertyProps) {\n const { title, value } = props\n return (\n <tr>\n <td style={{ paddingRight: '1em' }}>\n <Typography\n component={'span'}\n variant={'smallText1'}\n sx={{\n fontWeight: 700,\n }}\n >\n {title}\n </Typography>\n </td>\n <td>\n <Typography component={'span'} variant={'smallText1'}>\n {value}\n </Typography>\n </td>\n </tr>\n )\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, versionNumber, onActMemberClickAddConditionsForUse } = props\n\n // We don't need the entire bundle, but it's fetched for the rest of the title bar and useGetEntityTitleBarProperties below, so the cache will be hot.\n const { data: bundle } = useGetEntityBundle(entityId, versionNumber)\n\n const isFeatureEnabled = useGetFeatureFlag(FeatureFlagEnum.DESCRIPTION_FIELD)\n\n // Actual entity data is fetched and transformed in this custom hook\n const properties = useGetEntityTitleBarProperties(entityId, versionNumber)\n\n const [showAllProperties, setShowAllProperties] = useState(false)\n\n return (\n <Box sx={{ padding: '20px 40px' }}>\n <Stack\n direction={'row'}\n sx={{\n justifyContent: 'space-between',\n alignItems: 'flex-start',\n }}\n >\n <Stack\n direction=\"row\"\n divider={<Divider orientation=\"vertical\" flexItem />}\n spacing={2}\n sx={{\n alignItems: 'flex-start',\n }}\n >\n {/* Always show the first 4 properties*/}\n <table>\n <tbody>\n {properties.slice(0, 2).map(p => {\n return <Property key={p.key} title={p.title} value={p.value} />\n })}\n </tbody>\n </table>\n {properties.length > 2 && (\n <table>\n <tbody>\n {properties.slice(2, 4).map(p => {\n return (\n <Property key={p.key} title={p.title} value={p.value} />\n )\n })}\n </tbody>\n </table>\n )}\n {/* If there are 5 or 6 properties, show them in the last column */}\n {(properties.length === 5 || properties.length === 6) && (\n <table>\n <tbody>\n {properties.slice(4, 6).map(p => {\n return (\n <Property key={p.key} title={p.title} value={p.value} />\n )\n })}\n </tbody>\n </table>\n )}\n {/* If there are more than 6 properties, then just show a button that toggles showing the rest */}\n {properties.length > 6 && (\n <Link onClick={() => setShowAllProperties(v => !v)}>\n {showAllProperties\n ? 'Hide properties'\n : `${properties.length - 4} more properties`}\n </Link>\n )}\n </Stack>\n <AddConditionsForUseButton\n entityId={entityId}\n onACTMemberClick={onActMemberClickAddConditionsForUse}\n />\n </Stack>\n {showAllProperties && (\n <Box sx={{ pt: '20px' }}>\n <table>\n <tbody>\n {/* Show the remaining properties. */}\n {properties.slice(4, Infinity).map(p => {\n return <Property key={p.key} title={p.title} value={p.value} />\n })}\n </tbody>\n </table>\n </Box>\n )}\n {bundle?.entity?.description && isFeatureEnabled && (\n <Box sx={{ marginTop: '10px', maxWidth: '720px' }}>\n {bundle?.entity?.description}\n </Box>\n )}\n </Box>\n )\n}\n"],"mappings":";;;;;;;;;;AAkBA,SAAS,EAAS,GAAsB;CACtC,IAAM,EAAE,UAAO,aAAU;CACzB,OACE,kBAAC,MAAD,EAAA,UAAA,CACE,kBAAC,MAAD;EAAI,OAAO,EAAE,cAAc,MAAM;YAC/B,kBAAC,GAAD;GACE,WAAW;GACX,SAAS;GACT,IAAI,EACF,YAAY,IACd;aAEC;EACS,CAAA;CACV,CAAA,GACJ,kBAAC,MAAD,EAAA,UACE,kBAAC,GAAD;EAAY,WAAW;EAAQ,SAAS;YACrC;CACS,CAAA,EACV,CAAA,CACF,EAAA,CAAA;AAER;AAKA,SAAwB,EAAmB,GAAgC;CACzE,IAAM,EAAE,aAAU,kBAAe,2CAAwC,GAGnE,EAAE,MAAM,MAAW,EAAmB,GAAU,CAAa,GAE7D,IAAmB,EAAkB,EAAgB,iBAAiB,GAGtE,IAAa,EAA+B,GAAU,CAAa,GAEnE,CAAC,GAAmB,KAAwB,EAAS,EAAK;CAEhE,OACE,kBAAC,GAAD;EAAK,IAAI,EAAE,SAAS,YAAY;YAAhC;GACE,kBAAC,GAAD;IACE,WAAW;IACX,IAAI;KACF,gBAAgB;KAChB,YAAY;IACd;cALF,CAOE,kBAAC,GAAD;KACE,WAAU;KACV,SAAS,kBAAC,GAAD;MAAS,aAAY;MAAW,UAAA;KAAU,CAAA;KACnD,SAAS;KACT,IAAI,EACF,YAAY,aACd;eANF;MASE,kBAAC,SAAD,EAAA,UACE,kBAAC,SAAD,EAAA,UACG,EAAW,MAAM,GAAG,CAAC,EAAE,KAAI,MACnB,kBAAC,GAAD;OAAsB,OAAO,EAAE;OAAO,OAAO,EAAE;MAAQ,GAAxC,EAAE,GAAsC,CAC/D,EACI,CAAA,EACF,CAAA;MACN,EAAW,SAAS,KACnB,kBAAC,SAAD,EAAA,UACE,kBAAC,SAAD,EAAA,UACG,EAAW,MAAM,GAAG,CAAC,EAAE,KAAI,MAExB,kBAAC,GAAD;OAAsB,OAAO,EAAE;OAAO,OAAO,EAAE;MAAQ,GAAxC,EAAE,GAAsC,CAE1D,EACI,CAAA,EACF,CAAA;OAGP,EAAW,WAAW,KAAK,EAAW,WAAW,MACjD,kBAAC,SAAD,EAAA,UACE,kBAAC,SAAD,EAAA,UACG,EAAW,MAAM,GAAG,CAAC,EAAE,KAAI,MAExB,kBAAC,GAAD;OAAsB,OAAO,EAAE;OAAO,OAAO,EAAE;MAAQ,GAAxC,EAAE,GAAsC,CAE1D,EACI,CAAA,EACF,CAAA;MAGR,EAAW,SAAS,KACnB,kBAAC,GAAD;OAAM,eAAe,GAAqB,MAAK,CAAC,CAAC;iBAC9C,IACG,oBACA,GAAG,EAAW,SAAS,EAAE;MACzB,CAAA;KAEH;QACP,kBAAC,GAAD;KACY;KACV,kBAAkB;IACnB,CAAA,CACI;;GACN,KACC,kBAAC,GAAD;IAAK,IAAI,EAAE,IAAI,OAAO;cACpB,kBAAC,SAAD,EAAA,UACE,kBAAC,SAAD,EAAA,UAEG,EAAW,MAAM,GAAG,QAAQ,EAAE,KAAI,MAC1B,kBAAC,GAAD;KAAsB,OAAO,EAAE;KAAO,OAAO,EAAE;IAAQ,GAAxC,EAAE,GAAsC,CAC/D,EACI,CAAA,EACF,CAAA;GACJ,CAAA;GAEN,GAAQ,QAAQ,eAAe,KAC9B,kBAAC,GAAD;IAAK,IAAI;KAAE,WAAW;KAAQ,UAAU;IAAQ;cAC7C,GAAQ,QAAQ;GACd,CAAA;EAEJ;;AAET"}
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,CAuLlB"}
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(m, {
57
+ value: /* @__PURE__ */ g(d, {
58
+ value: W,
58
59
  href: W,
59
- rel: "noopener noreferrer",
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: (\n <Link href={doi} rel={'noopener noreferrer'} target={'_blank'}>\n {doi}\n </Link>\n ),\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":";;;;;;;;;;;;;;;;;AA+BA,SAAgB,EACd,GACA,GACkB;CAClB,IAAM,EACJ,cAAc,GACd,YAAY,GACZ,kBACA,gBACA,0BACA,+BACE,EAAqB,GAAU,CAAa,GAC1C,CAAC,GAA6B,KAClC,EAAS,EAAK,GACV,CAAC,GAAoB,KAAyB,EAAS,EAAK,GAC5D,EAAE,MAAM,MAA2B,EACvC;EACE,UAAU;EACV,cAAc,OAAO,OAAO,CAAU;EACtC,wBAAwB;CAC1B,GACA,EAAE,SAAS,EAAY,CACzB,GAGM,IACJ,KACA,CAAC,EAAO,kBACR,EAAoB,EAAO,MAAM,KACjC,EAAO,OAAO,iBACV,EAAE,MAAM,MAA8B,EAC1C;EAAE,IAAI;EAAU,SAAS,KAAA;EAAW,MAAM,EAAc;CAAO,GAC/D,EACE,SAAS,EACX,CACF,GAEM,IACJ,GAAgB,eAChB,EAA0B,EAAe,WAAW,GAChD,IACJ,KACA,cAAc,KACd,EA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K;IACnD,WAAW,EAAc;GAC1B,CAAA,CACD,EAAA,CAAA;EAEN;EACA,KAAc;GACZ,KAAK;GACL,OAAO;GACP,OACE,kBAAA,GAAA,EAAA,UAAA,CACE,kBAAC,GAAD;IAAM,eAAe,EAAsB,EAAI;cAC5C,EAAS,OAAO,eAAe;GAC5B,CAAA,GACN,kBAAC,GAAD;IACE,MAAM;IACN,eAAe,EAAsB,EAAK;IAC1C,WAAW;IACX,OAAM;GACP,CAAA,CACD,EAAA,CAAA;EAEN;EACA,KAAO;GACL,KAAK;GACL,OAAO;GACP,OAAO,kBAAC,GAAD,EAAuB,OAAO,EAAM,CAAA;EAC7C;EACA,CAAC,KACC,KAAmB;GACjB,KAAK;GACL,OAAO;GACP,OAAO;EACT;EACF,KACE,KAA2B;GACzB,KAAK;GACL,OAAO;GACP,OAAO;EACT;EACF,KAAY;GACV,KAAK;GACL,OAAO;GACP,OAAO;EACT;EACA,KAAe;GACb,KAAK;GACL,OAAO;GACP,OAAO,kBAAC,GAAD,EAAS,MAAM,EAAc,CAAA;EACtC;EACA,KAAU;GAAE,KAAK;GAAsB,OAAO;GAAU,OAAO;EAAO;EACtE,KAAW;GAAE,KAAK;GAAmB,OAAO;GAAY,OAAO;EAAQ;EACvE,KAAiB;GACf,KAAK;GACL,OAAO;GACP,OACE,kBAAA,GAAA,EAAA,UAAA,CACG,kCACD,kBAAC,GAAD;IAAK,IAAI;KAAE,SAAS;KAAU,YAAY;IAAY;cACnD;GACE,CAAA,CACL,EAAA,CAAA;EAEN;CACF,EAAE,QAAO,MAAQ,CAAC,CAAC,CAAI;AACzB"}
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":";;;;;;;;;;;;;;;;;AA+BA,SAAgB,EACd,GACA,GACkB;CAClB,IAAM,EACJ,cAAc,GACd,YAAY,GACZ,kBACA,gBACA,0BACA,+BACE,EAAqB,GAAU,CAAa,GAC1C,CAAC,GAA6B,KAClC,EAAS,EAAK,GACV,CAAC,GAAoB,KAAyB,EAAS,EAAK,GAC5D,EAA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;IAAK,IAAI;KAAE,SAAS;KAAU,YAAY;IAAY;cACnD;GACE,CAAA,CACL,EAAA,CAAA;EAEN;CACF,EAAE,QAAO,MAAQ,CAAC,CAAC,CAAI;AACzB"}
@@ -1,5 +1,6 @@
1
1
  export type FavoriteButtonProps = {
2
2
  entityId: string;
3
+ iconColor?: string;
3
4
  };
4
5
  /**
5
6
  * Renders a button that indicates if an entity is favorited by the logged-in user. When clicked, the entity is
@@ -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;CACjB,CAAA;AAED;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,KAAK,EAAE,mBAAmB,2CAgDhE"}
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: f } = e(), { isFavorite: p, isLoading: m } = n(d), { mutate: h, isPending: g } = t(), { mutate: _, isPending: v } = r(), y = m || g || v || !f, b = "Add to Favorites";
11
- return f ? p && (b = "Remove from Favorites") : b = "Sign in to add this to your favorites", /* @__PURE__ */ l(a, {
12
- condition: m,
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: b,
15
+ title: x,
16
16
  placement: "top",
17
17
  children: /* @__PURE__ */ l("span", { children: /* @__PURE__ */ l(o, {
18
18
  size: "small",
19
- disabled: y,
19
+ disabled: b,
20
20
  onClick: () => {
21
- p ? _(d) : h(d);
21
+ m ? v(d) : g(d);
22
22
  },
23
23
  sx: { padding: "2px" },
24
24
  children: /* @__PURE__ */ l(i, {
25
- icon: p ? "fav" : "favOutline",
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
  },