synapse-react-client
Version:
[](https://badge.fury.io/js/synapse-react-client) [](https://github.com/prettier/prettie
96 lines (95 loc) • 3.74 kB
JavaScript
import { jsx as r, Fragment as p, jsxs 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 { getColumnIndex as o } from "../../utils/functions/SqlFunctions.js";
import "../../utils/functions/EntityTypeUtils.js";
import { BUNDLE_MASK_QUERY_RESULTS as C } 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 "@sage-bionetworks/synapse-types";
import { useTheme as R, useMediaQuery as _, Box as d, Typography 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 x } from "../../synapse-queries/entity/useGetQueryResultBundle.js";
import { trendingProjectsGridTemplateColumns as h, SynapseTrendingProjectItem as g } from "./SynapseTrendingProjectsItem.js";
function ir({
past30DaysDownloadMetricsTable: n
}) {
const { data: l } = x({
entityId: n,
query: {
sql: `SELECT * FROM ${n}`,
limit: 10,
sort: [
{ column: "last_updated", direction: "DESC" },
// likely unnecessary (I think this MV always contains only the most recent snapshot)
{ column: "N_UNIQUE_USERS", direction: "DESC" }
]
},
partMask: C,
concreteType: "org.sagebionetworks.repo.model.table.QueryBundleRequest"
}), c = R(), s = _(c.breakpoints.down("sm")), e = l?.responseBody?.queryResult?.queryResults, t = e?.headers, u = o("PROJECT_ID", t), y = o("N_UNIQUE_USERS", t), I = o("ALTERNATE_LINK", t), E = o(
"ESTIMATED_PROJECT_SIZE_IN_GIB",
t
), S = o(
"PROJECT_DESCRIPTION",
t
);
return !e || e.rows.length == 0 ? /* @__PURE__ */ r(p, {}) : /* @__PURE__ */ a(p, { children: [
/* @__PURE__ */ a(
d,
{
sx: {
color: "primary.100",
display: s ? "none" : "grid",
...h,
justifyItems: "start"
},
children: [
/* @__PURE__ */ r(i, { variant: "body1", sx: { ml: "15px" }, children: "Rank" }),
/* @__PURE__ */ r(i, { variant: "body1", children: "Project" }),
/* @__PURE__ */ r(i, { variant: "body1", children: "Project Data" }),
/* @__PURE__ */ r(i, { variant: "body1", children: "Unique Teams" }),
/* @__PURE__ */ r(d, {})
]
}
),
e.rows.map((m, T) => /* @__PURE__ */ r(
g,
{
rank: T + 1,
rowValues: m.values,
entityIdColIndex: u,
egressSizeGbColIndex: E,
nUniqueUsersColIndex: y,
projectDescriptionColumnIndex: S,
altLinkColIndex: I,
isMobileView: s
},
m.rowId
))
] });
}
export {
ir as SynapseTrendingProjects
};
//# sourceMappingURL=SynapseTrendingProjects.js.map