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

97 lines (96 loc) 3.59 kB
import { jsx as t, Fragment as A } 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 "@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 i } from "@mui/material"; 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 "@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 N } from "../../synapse-queries/entity/useGetQueryResultBundle.js"; import { SynapseInActionItem as H } from "./SynapseInActionItem.js"; function co({ tableId: r }) { const { data: m } = N({ entityId: r, query: { sql: `SELECT * FROM ${r}`, sort: [{ column: "order", direction: "ASC" }] }, partMask: B, concreteType: "org.sagebionetworks.repo.model.table.QueryBundleRequest" }), n = m?.responseBody?.queryResult?.queryResults, e = n?.headers, s = e?.findIndex( (o) => o.name == "title" ), l = e?.findIndex( (o) => o.name == "description" ), d = e?.findIndex( (o) => o.name == "tags" ), a = e?.findIndex( (o) => o.name == "image" ), p = e?.findIndex( (o) => o.name == "mobileImage" ), c = e?.findIndex( (o) => o.name == "logo" ), u = e?.findIndex( (o) => o.name == "url" ), x = e?.findIndex( (o) => o.name == "friendlyName" ), I = e?.findIndex( (o) => o.name == "primaryColor" ), y = e?.findIndex( (o) => o.name == "secondaryColor" ); return !n || n.rows.length == 0 ? /* @__PURE__ */ t(A, {}) : /* @__PURE__ */ t(i, { sx: { m: "auto", maxWidth: "1500px" }, children: n.rows.map((o, f) => { const C = o.values[s], g = o.values[l], v = JSON.parse(o.values[d]), S = o.values[a], F = o.values[p], h = o.values[c], R = o.values[u], k = o.values[x], E = o.values[I], b = o.values[y], q = f % 2 ? "#E9F2F1" : void 0; return /* @__PURE__ */ t( i, { sx: { py: { xs: "30px", sm: "0px" }, backgroundColor: { backgroundColor: q } }, children: /* @__PURE__ */ t( H, { tableId: r, friendlyName: k, title: C, description: g, logoFileHandleId: h, tags: v, link: R, primaryColor: E, secondaryColor: b, imageFileHandleId: S, mobileImageFileHandleId: F } ) }, o.rowId ); }) }); } export { co as SynapseInAction }; //# sourceMappingURL=SynapseInAction.js.map