UNPKG

synapse-react-client

Version:

[![npm version](https://badge.fury.io/js/synapse-react-client.svg)](https://badge.fury.io/js/synapse-react-client) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettie

119 lines (118 loc) 3.97 kB
import { jsxs as D, jsx as e } from "react/jsx-runtime"; import T from "../../synapse-queries/entity/useGetQueryResultBundle.js"; import "../../utils/PermissionLevelToAccessType.js"; import { BUNDLE_MASK_QUERY_SELECT_COLUMNS as _, BUNDLE_MASK_QUERY_RESULTS as w } from "../../utils/SynapseConstants.js"; 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 "@sage-bionetworks/synapse-types"; import "../../utils/functions/EntityTypeUtils.js"; import "lodash-es"; import "@sage-bionetworks/synapse-client/util/synapseClientFetch"; import "../../utils/context/SynapseContext.js"; import "use-deep-compare-effect"; import "@tanstack/react-query"; import "@tanstack/query-core"; import "lodash-es/isEmpty"; import "lodash-es/isEqual"; import "lodash-es/xorWith"; import { Box as d, alpha as L } from "@mui/material"; import "@sage-bionetworks/synapse-client"; import G from "../../utils/hooks/useShowDesktop.js"; import "../../utils/hooks/useCookiePreferences.js"; import "../../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 "react-router"; import "../../utils/types/IsType.js"; import { getFieldIndex as n } from "../../utils/functions/queryUtils.js"; import M from "../../utils/hooks/useGetGoalData.js"; import { ErrorBanner as A } from "../error/ErrorBanner.js"; import N from "../PortalSectionHeader/PortalSectionHeader.js"; import O from "./GoalsV2.Desktop.js"; import U from "./GoalsV2.Mobile.js"; const v = 1200, bo = (x) => { const { entityId: s, dataLink: f } = x, p = G(v), y = { concreteType: "org.sagebionetworks.repo.model.table.QueryBundleRequest", entityId: s, partMask: _ | w, query: { sql: `select * from ${s} order by ItemOrder` } }, { data: o } = T(y), { assets: S, error: a } = M( s, o ), u = n( "TableId", o ), m = n( "CountSql", o ), E = n( "Title", o ), C = n( "Summary", o ), I = n("Link", o), g = o?.queryResult.queryResults.rows.map((r, i) => { const t = r.values; t.some((B) => B === null) && console.warn("Row has null value(s) when no nulls expected"); const c = u > -1 ? t[u] : void 0; let l; m > -1 && t[m] ? l = t[m] : c && (l = `SELECT * FROM ${c}`); const R = t[E], q = t[C], b = t[I], k = S?.[i] ?? ""; return { countSql: l, title: R, summary: q, link: b, asset: k }; }) ?? [], h = p ? O : U; return /* @__PURE__ */ D( d, { sx: { minHeight: "560px", padding: { xs: "40px", lg: "80px" } }, children: [ /* @__PURE__ */ e( N, { centered: !0, title: "What's in the Portal?", buttonText: "Start Exploring Data", link: f, sx: (r) => ({ h2: { borderColor: L(r.palette.primary.main, 0.2) }, a: { marginTop: "24px", marginBottom: "30px" } }) } ), a && /* @__PURE__ */ e(A, { error: a }), /* @__PURE__ */ e("div", { className: "Goals", children: /* @__PURE__ */ e( d, { sx: { display: "flex", justifyContent: "space-between", flexDirection: p ? "row" : "column" }, children: g.map((r, i) => /* @__PURE__ */ e(h, { ...r }, i)) } ) }) ] } ); }; export { bo as GoalsV2, bo as default }; //# sourceMappingURL=GoalsV2.js.map