synapse-react-client
Version:
[](https://badge.fury.io/js/synapse-react-client) [](https://github.com/prettier/prettie
186 lines (185 loc) • 6.99 kB
JavaScript
import { jsx as t, jsxs as i, Fragment as U } from "react/jsx-runtime";
import x from "../../utils/ConditionalWrapper.js";
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 { isTable as c, entityTypeToFriendlyName as v, convertToEntityType as C, isDataset as D } from "../../../utils/functions/EntityTypeUtils.js";
import { BUNDLE_MASK_LAST_UPDATED_ON as E } 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, Breadcrumbs as k, Skeleton as B, Typography as n, Tooltip as m, useTheme as A, useMediaQuery as N } 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 { useGetEntity as R } from "../../../synapse-queries/entity/useEntity.js";
import { useGetQueryResultBundleWithAsyncStatus as j } from "../../../synapse-queries/entity/useGetQueryResultBundle.js";
import { formatDate as h } from "../../../utils/functions/DateFormatter.js";
import { InfoTwoTone as y } from "@mui/icons-material";
import u from "dayjs";
import { UserBadge as w } from "../../UserCard/UserBadge.js";
function Q() {
const s = A();
return N(s.breakpoints.down("sm")) ? null : /* @__PURE__ */ t(n, { variant: "breadcrumb1", sx: { color: "grey.700" }, children: "/" });
}
function Se(s) {
const { entityId: r, versionNumber: d } = s, a = `${r}${d ? `.${d}` : ""}`, { data: e } = R(r, d), { data: S } = j(
{
entityId: r,
query: {
sql: `SELECT * FROM ${a} LIMIT 0`
},
partMask: E,
concreteType: "org.sagebionetworks.repo.model.table.QueryBundleRequest"
},
{ enabled: !!(e && c(e)) }
), b = S?.responseBody?.lastUpdatedOn, o = e ? v(C(e.concreteType)) : "", I = "This is the user who created this Dataset. This may not be the same person who generated the files in this Dataset, or who originally uploaded these files to Synapse.", M = /* @__PURE__ */ i(U, { children: [
/* @__PURE__ */ i("p", { children: [
"This is when the configuration of this ",
o,
" was last changed."
] }),
/* @__PURE__ */ t("p", { children: "Configuration changes may be triggered by (for example):" }),
/* @__PURE__ */ i("ul", { children: [
/* @__PURE__ */ i("li", { children: [
"Editing the name of the ",
o
] }),
/* @__PURE__ */ i("li", { children: [
"Updating the schema used by the ",
o
] })
] }),
/* @__PURE__ */ i("p", { children: [
"This does NOT reflect changes to the data displayed in the the",
" ",
o,
"."
] })
] }), $ = `This is when the configuration of this ${o} was last changed.`, O = `When data changes, the ${o} is rebuilt to reflect those changes. This is the last time changes were made to the data.`, f = `${a}-createdByTooltip`, T = `${a}-modifiedByTooltip`, g = `${a}-lastUpdatedTooltip`, l = {
width: "16px",
height: "16px",
ml: "4px",
verticalAlign: "text-bottom"
};
return /* @__PURE__ */ t(
L,
{
sx: (p) => ({
bgcolor: "grey.100",
py: "10px",
[p.breakpoints.down("sm")]: {
p: "24px 40px"
}
}),
children: /* @__PURE__ */ i(
k,
{
separator: /* @__PURE__ */ t(Q, {}),
sx: (p) => ({
"& .MuiBreadcrumbs-ol": {
justifyContent: "center",
[p.breakpoints.down("sm")]: {
gap: "4px"
}
}
}),
children: [
/* @__PURE__ */ t(x, { condition: !e, wrapper: B, children: /* @__PURE__ */ i(
n,
{
sx: { color: "grey.700" },
variant: "breadcrumb1",
"aria-describedby": f,
children: [
o,
" created by ",
/* @__PURE__ */ t(w, { userId: e?.createdBy }),
" ",
"on ",
h(u(e?.createdOn)),
e && D(e) && /* @__PURE__ */ t(
m,
{
id: f,
title: I,
children: /* @__PURE__ */ t(y, { sx: l })
}
)
]
}
) }),
/* @__PURE__ */ t(x, { condition: !e, wrapper: B, children: /* @__PURE__ */ i(
n,
{
sx: { color: "grey.700" },
variant: "breadcrumb1",
"aria-describedby": T,
children: [
e && c(e) ? "Configuration" : o,
" last modified by ",
/* @__PURE__ */ t(w, { userId: e?.modifiedBy }),
" on",
" ",
h(u(e?.modifiedOn)),
e && c(e) && /* @__PURE__ */ t(
m,
{
id: T,
title: M,
"aria-label": $,
children: /* @__PURE__ */ t(y, { sx: l })
}
)
]
}
) }),
b && /* @__PURE__ */ i(
n,
{
sx: { color: "grey.700" },
variant: "breadcrumb1",
"aria-describedby": g,
children: [
o,
" last rebuilt on ",
h(u(b)),
/* @__PURE__ */ t(
m,
{
title: O,
id: g,
children: /* @__PURE__ */ t(y, { sx: l })
}
)
]
}
)
]
}
)
}
);
}
export {
Se as CreatedByModifiedBy,
Se as default
};
//# sourceMappingURL=CreatedByModifiedBy.js.map