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

101 lines (100 loc) 3.47 kB
import { jsxs as L, jsx as r } from "react/jsx-runtime"; import k from "../../synapse-queries/entity/useGetQueryResultBundle.js"; import "../../utils/PermissionLevelToAccessType.js"; import { BUNDLE_MASK_QUERY_SELECT_COLUMNS as G, BUNDLE_MASK_QUERY_RESULTS as T } 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 } from "@mui/material"; import "@sage-bionetworks/synapse-client"; import b 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 e } from "../../utils/functions/queryUtils.js"; import g from "../../utils/hooks/useGetGoalData.js"; import { ErrorBanner as h } from "../error/ErrorBanner.js"; import v from "./GoalsV3.Desktop.js"; import K from "./GoalsV3.Mobile.js"; const M = 1200, Ro = ({ entityId: n, svgComponentMap: f }) => { const m = b(M), x = { concreteType: "org.sagebionetworks.repo.model.table.QueryBundleRequest", entityId: n, partMask: G | T, query: { sql: `select * from ${n} order by ItemOrder` } }, { data: t } = k(x), { error: p } = g(n, t), u = e( "TableId", t ), s = e( "CountSql", t ), y = e( "Title", t ), C = e( "Summary", t ), S = e("Link", t), E = e( "iconKey", t ), I = t?.queryResult.queryResults.rows.map((l) => { const o = l.values; o.some((D) => D === null) && console.warn("Row has null value(s) when no nulls expected"); const c = u > -1 ? o[u] : void 0; let i; s > -1 && o[s] !== null ? i = o[s] : c && (i = `SELECT * FROM ${c}`); const q = o[y], _ = o[C], w = o[S], a = o[E], B = a ? f?.[a.toLowerCase().replace(/\s+/g, "_")] : void 0; return { countSql: i, title: q, summary: _, link: w, svgIconComponent: B }; }) ?? [], R = m ? v : K; return /* @__PURE__ */ L(d, { children: [ p && /* @__PURE__ */ r(h, { error: p }), /* @__PURE__ */ r("div", { className: "Goals", children: /* @__PURE__ */ r( d, { sx: { display: "flex", gap: m ? "10px" : "0", flexDirection: m ? "row" : "column", justifyContent: "center" }, children: I.map((l, o) => /* @__PURE__ */ r(R, { ...l }, o)) } ) }) ] }); }; export { Ro as default }; //# sourceMappingURL=GoalsV3.js.map