synapse-react-client
Version:
[](https://badge.fury.io/js/synapse-react-client) [](https://github.com/prettier/prettie
136 lines (135 loc) • 4.51 kB
JavaScript
import { jsx as a, Fragment as f, jsxs as p } from "react/jsx-runtime";
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 m } from "@sage-bionetworks/synapse-types";
import "../../utils/functions/EntityTypeUtils.js";
import { BUNDLE_MASK_QUERY_RESULTS as b } from "../../utils/SynapseConstants.js";
import "lodash-es";
import "@sage-bionetworks/synapse-client/util/synapseClientFetch";
import "@tanstack/react-query";
import "../../utils/PermissionLevelToAccessType.js";
import "react";
import "../../utils/context/SynapseContext.js";
import "use-deep-compare-effect";
import { Box as l, Typography as S, Link as k } from "@mui/material";
import "../../utils/hooks/useCookiePreferences.js";
import { useSourceAppConfigs as w } from "../../utils/hooks/useSourceAppConfigs.js";
import "universal-cookie";
import "../../utils/AppUtils/session/ApplicationSessionContext.js";
import "../../utils/context/FullContextProvider.js";
import "../../utils/context/DocumentMetadataContext.js";
import '../../style/components/_spinner.css';/* empty css */
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 { useGetQueryResultBundleWithAsyncStatus as C } from "../../synapse-queries/entity/useGetQueryResultBundle.js";
function er({
entityIds: e,
dataCatalogEntityId: s = "syn61609402",
sourceAppConfigTableID: u = "syn45291362"
}) {
const c = e.length > 0 ? [
{
concreteType: "org.sagebionetworks.repo.model.table.ColumnSingleValueQueryFilter",
columnName: "id",
operator: m.IN,
values: e
}
] : [], { data: d } = C(
{
entityId: s,
query: {
sql: `SELECT appId, link FROM ${s}`,
additionalFilters: c
},
partMask: b,
concreteType: "org.sagebionetworks.repo.model.table.QueryBundleRequest"
},
{
enabled: e.length > 0
}
), o = d?.responseBody?.queryResult?.queryResults, g = !!o && o?.rows.length > 0, t = o?.rows.map((r) => r.values[0]), h = t && t.length > 0 ? [
{
concreteType: "org.sagebionetworks.repo.model.table.ColumnSingleValueQueryFilter",
columnName: "appId",
operator: m.IN,
values: t
}
] : [], i = w(
u,
h
), x = !!i && i.length > 0;
return !g || !x ? null : /* @__PURE__ */ a(f, { children: i.map((r, y) => /* @__PURE__ */ p(
l,
{
sx: {
display: "flex",
padding: "32px",
backgroundColor: "secondary.100",
borderRadius: "8px",
width: "100%",
transition: "background-color 0.3s",
justifyContent: "space-between",
alignItems: "center",
gap: "50px",
boxShadow: "0 4px 10px 0 rgba(0, 0, 0, 0.10), 0 1px 1px 0 rgba(0, 0, 0, 0.05)"
},
children: [
/* @__PURE__ */ a(l, { children: /* @__PURE__ */ p(
S,
{
variant: "smallText1",
sx: { color: "grey.900", mt: "4px", lineHeight: "20px" },
children: [
"Looks like you’re searching for information about",
" ",
r.area,
". ",
/* @__PURE__ */ p(
k,
{
component: "a",
href: r.appURL,
target: "_blank",
rel: "noopener noreferrer",
sx: {
color: (n) => `${n.palette.grey[900]} !important`,
textDecorationColor: (n) => `${n.palette.grey[900]} !important`
},
children: [
"Visit the ",
r.friendlyName
]
}
),
"."
]
}
) }),
/* @__PURE__ */ a(
l,
{
sx: {
"> *": {
height: "48px",
width: "auto"
}
},
children: r?.logo
}
)
]
},
y
)) });
}
export {
er as default
};
//# sourceMappingURL=SearchPagePortalBanners.js.map