synapse-react-client
Version:
[](https://badge.fury.io/js/synapse-react-client) [](https://github.com/prettier/prettie
148 lines (147 loc) • 5.27 kB
JavaScript
import { jsx as o, jsxs as t } from "react/jsx-runtime";
import "react";
import "../../synapse-client/SynapseClient.js";
import "@sage-bionetworks/synapse-client/generated/models/ErrorResponseCode";
import "@sage-bionetworks/synapse-client/generated/models/TwoFactorAuthErrorResponse";
import "@sage-bionetworks/synapse-client/util/SynapseClientError";
import { ColumnSingleValueFilterOperator as c } from "@sage-bionetworks/synapse-types";
import "../../utils/functions/EntityTypeUtils.js";
import "../../utils/SynapseConstants.js";
import "lodash-es";
import "@sage-bionetworks/synapse-client/util/synapseClientFetch";
import "../../utils/context/SynapseContext.js";
import "use-deep-compare-effect";
import "../../utils/PermissionLevelToAccessType.js";
import "universal-cookie";
import "../../utils/AppUtils/session/ApplicationSessionContext.js";
import "../../utils/context/FullContextProvider.js";
import "../../utils/context/DocumentMetadataContext.js";
import { useTheme as v, Popover as w, Grid as e, Box as d, Typography as i, Button as y } from "@mui/material";
import '../../style/components/_spinner.css';/* empty css */
import "@tanstack/react-query";
import "@tanstack/query-core";
import "lodash-es/isEmpty";
import "lodash-es/isEqual";
import "lodash-es/xorWith";
import "react-router";
import "@sage-bionetworks/synapse-client";
import "../../utils/types/IsType.js";
import "../../utils/hooks/useCookiePreferences.js";
import { useSourceAppConfigs as C } from "../../utils/hooks/useSourceAppConfigs.js";
function oo({
sourceAppConfigTableID: h = "syn45291362",
anchorEl: p,
onClose: n,
resourceName: a = "Portals",
description: u = "Sage Bionetworks builds and supports community portals as tailored platforms for data sharing and collaboration across diverse research areas.",
filterByType: s,
allResourcesUrl: l
}) {
const x = v(), g = !!p, b = typeof window < "u" ? window.location.hostname : "", m = [
{
concreteType: "org.sagebionetworks.repo.model.table.ColumnSingleValueQueryFilter",
columnName: "isPublicized",
operator: c.EQUAL,
values: ["true"]
}
];
s && m.push({
isDefiningCondition: !1,
concreteType: "org.sagebionetworks.repo.model.table.ColumnSingleValueQueryFilter",
columnName: "portalType",
operator: c.EQUAL,
values: [s]
});
const f = C(
h,
m
);
return /* @__PURE__ */ o(
w,
{
open: g,
anchorEl: p,
onClose: n,
sx: { width: "90%", height: "90%" },
anchorOrigin: { vertical: "bottom", horizontal: "center" },
transformOrigin: { vertical: "top", horizontal: "center" },
children: /* @__PURE__ */ t(e, { container: !0, spacing: 2, sx: { p: "24px" }, children: [
/* @__PURE__ */ o(e, { size: { xs: 12, lg: 3 }, children: /* @__PURE__ */ t(d, { sx: { p: x.spacing(4), pr: "5px" }, children: [
/* @__PURE__ */ o(
i,
{
variant: "headline1",
sx: { fontSize: "30px", pb: "30px", fontWeight: 600 },
children: a
}
),
/* @__PURE__ */ o(i, { variant: "body1", sx: { pb: "10px", fontWeight: 500 }, children: u }),
l && /* @__PURE__ */ t(
y,
{
type: "button",
color: "primary",
variant: "contained",
sx: {
p: "10px 50px",
mt: "30px",
height: "100%",
"&:hover": { color: "white" }
},
href: l,
children: [
"See all ",
a
]
}
)
] }) }),
/* @__PURE__ */ o(e, { size: { xs: 12, lg: 9 }, children: /* @__PURE__ */ o(e, { container: !0, children: f?.filter((r) => r.appURL.toLowerCase().startsWith("http") ? new URL(r.appURL).hostname !== b : !0).map((r) => /* @__PURE__ */ o(
e,
{
size: { xs: 12, sm: 6, lg: 4 },
className: "sourceAppItem",
sx: {
p: "30px",
border: "1px solid #F1F3F5",
"&:hover": {
backgroundColor: "#d7dee433",
cursor: "pointer"
}
},
children: /* @__PURE__ */ t(
"div",
{
onClick: () => {
window.open(r.appURL, "_blank"), n();
},
children: [
/* @__PURE__ */ o(
d,
{
sx: {
pb: "10px",
img: {
maxHeight: "50px",
height: "50px",
maxWidth: "100%"
}
},
children: r.logo
}
),
/* @__PURE__ */ o(i, { variant: "body1", sx: { fontWeight: 500 }, children: r.shortDescription })
]
}
)
},
r.appId
)) }) })
] })
}
);
}
export {
oo as SageResourcesPopover
};
//# sourceMappingURL=SageResourcesPopover.js.map