synapse-react-client
Version:
[](https://badge.fury.io/js/synapse-react-client) [](https://github.com/prettier/prettie
64 lines (63 loc) • 1.87 kB
JavaScript
import { jsxs as c, Fragment as l, jsx as o } from "react/jsx-runtime";
import { EntityTypeGroup as d } from "../../utils/functions/EntityTypeUtils.js";
import { Typography as i } from "@mui/material";
import { EntityType as E } from "@sage-bionetworks/synapse-client";
import { useMemo as T } from "react";
import { FinderScope as y } from "../EntityFinder/tree/EntityTree.js";
import { VersionSelectionType as f } from "../EntityFinder/VersionSelectionType.js";
import { EntityHeaderTable as S } from "../EntityHeaderTable/EntityHeaderTable.js";
const u = d.CONTAINER, g = [E.project];
function v(n) {
const { scopeIds: e, isProjectView: r = !1, onChange: p, disabled: a } = n, m = T(
() => e.map((t) => ({ targetId: t })),
[e]
);
return /* @__PURE__ */ c(l, { children: [
/* @__PURE__ */ o(
i,
{
variant: "body1",
sx: {
mb: 1.25,
fontWeight: 700
},
children: "Scope"
}
),
e.length === 0 && /* @__PURE__ */ o(
i,
{
variant: "smallText1",
sx: {
color: "grey.600"
},
children: "Empty! Add items to populate your view"
}
),
/* @__PURE__ */ o(
S,
{
references: m,
isEditable: !0,
disabled: a,
onUpdate: (t) => {
p(t.map((s) => s.targetId));
},
removeSelectedRowsButtonText: "Remove Selected Items from View Scope",
objectNameCopy: r ? "project" : "container",
hideTextFieldToPasteValue: !0,
entityFinderConfiguration: {
selectMultiple: !0,
versionSelection: f.DISALLOWED,
initialScope: y.ALL_PROJECTS,
initialContainer: "root",
selectableTypes: r ? g : u
}
}
)
] });
}
export {
v as default
};
//# sourceMappingURL=EntityViewScopeEditor.js.map