synapse-react-client 3.1.47 → 3.1.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -0
- package/dist/index.js +180 -124
- package/dist/index.mjs +113 -57
- package/dist/umd/synapse-react-client.development.js +70 -21
- package/dist/umd/synapse-react-client.development.js.map +3 -3
- package/dist/umd/synapse-react-client.production.min.js +94 -94
- package/package.json +1 -1
|
@@ -61481,7 +61481,7 @@ Please use another name.` : (0, _utils.formatMuiErrorMessage)(18));
|
|
|
61481
61481
|
"package.json"(exports2, module2) {
|
|
61482
61482
|
module2.exports = {
|
|
61483
61483
|
name: "synapse-react-client",
|
|
61484
|
-
version: "3.1.
|
|
61484
|
+
version: "3.1.49",
|
|
61485
61485
|
private: false,
|
|
61486
61486
|
main: "./dist/index.js",
|
|
61487
61487
|
module: "./dist/index.mjs",
|
|
@@ -135520,6 +135520,31 @@ ${e3.message}`);
|
|
|
135520
135520
|
|
|
135521
135521
|
// src/components/QueryWrapper/useTableRowSelection.ts
|
|
135522
135522
|
var import_react160 = __toESM(require_react());
|
|
135523
|
+
function getRowSelectionEqualityComparator(row, columnModels, rowSelectionPrimaryKey) {
|
|
135524
|
+
let comparator = isEqual_default;
|
|
135525
|
+
if (rowSelectionPrimaryKey && columnModels) {
|
|
135526
|
+
comparator = (r1, r22) => {
|
|
135527
|
+
const r1PrimaryKeyValues = rowSelectionPrimaryKey.map(
|
|
135528
|
+
(key) => r1.values[columnModels.findIndex((cm) => cm.name === key)]
|
|
135529
|
+
);
|
|
135530
|
+
const r2PrimaryKeyValues = rowSelectionPrimaryKey.map(
|
|
135531
|
+
(key) => r22.values[columnModels.findIndex((cm) => cm.name === key)]
|
|
135532
|
+
);
|
|
135533
|
+
return isEqual_default(r1PrimaryKeyValues, r2PrimaryKeyValues);
|
|
135534
|
+
};
|
|
135535
|
+
} else if (row.rowId) {
|
|
135536
|
+
comparator = (r1, r22) => r1.rowId === r22.rowId;
|
|
135537
|
+
}
|
|
135538
|
+
return comparator;
|
|
135539
|
+
}
|
|
135540
|
+
function isRowSelected(row, selectedRows, columnModels, rowSelectionPrimaryKey) {
|
|
135541
|
+
const comparator = getRowSelectionEqualityComparator(
|
|
135542
|
+
row,
|
|
135543
|
+
columnModels,
|
|
135544
|
+
rowSelectionPrimaryKey
|
|
135545
|
+
);
|
|
135546
|
+
return selectedRows.some((selectedRow) => comparator(selectedRow, row));
|
|
135547
|
+
}
|
|
135523
135548
|
function useTableRowSelection(options3) {
|
|
135524
135549
|
const { isRowSelectionVisible = false, entity, columnModels } = options3;
|
|
135525
135550
|
let { rowSelectionPrimaryKey } = options3;
|
|
@@ -135527,12 +135552,24 @@ ${e3.message}`);
|
|
|
135527
135552
|
if (!rowSelectionPrimaryKey && isFileViewOrDataset(entity) && (columnModels == null ? void 0 : columnModels.find((cm) => cm.name === "id"))) {
|
|
135528
135553
|
rowSelectionPrimaryKey = ["id"];
|
|
135529
135554
|
}
|
|
135555
|
+
const getIsRowSelected = (0, import_react160.useCallback)(
|
|
135556
|
+
(row) => {
|
|
135557
|
+
return isRowSelected(
|
|
135558
|
+
row,
|
|
135559
|
+
selectedRows,
|
|
135560
|
+
columnModels,
|
|
135561
|
+
rowSelectionPrimaryKey
|
|
135562
|
+
);
|
|
135563
|
+
},
|
|
135564
|
+
[columnModels, rowSelectionPrimaryKey, selectedRows]
|
|
135565
|
+
);
|
|
135530
135566
|
return {
|
|
135531
135567
|
isRowSelectionVisible,
|
|
135532
135568
|
rowSelectionPrimaryKey,
|
|
135533
135569
|
selectedRows,
|
|
135534
135570
|
setSelectedRows,
|
|
135535
|
-
hasSelectedRows: isRowSelectionVisible && selectedRows.length > 0
|
|
135571
|
+
hasSelectedRows: isRowSelectionVisible && selectedRows.length > 0,
|
|
135572
|
+
getIsRowSelected
|
|
135536
135573
|
};
|
|
135537
135574
|
}
|
|
135538
135575
|
|
|
@@ -135769,7 +135806,8 @@ ${e3.message}`);
|
|
|
135769
135806
|
rowSelectionPrimaryKey,
|
|
135770
135807
|
hasSelectedRows,
|
|
135771
135808
|
selectedRows,
|
|
135772
|
-
setSelectedRows
|
|
135809
|
+
setSelectedRows,
|
|
135810
|
+
getIsRowSelected
|
|
135773
135811
|
} = useTableRowSelection({
|
|
135774
135812
|
entity,
|
|
135775
135813
|
columnModels: data == null ? void 0 : data.columnModels,
|
|
@@ -135805,6 +135843,7 @@ ${e3.message}`);
|
|
|
135805
135843
|
hasSelectedRows,
|
|
135806
135844
|
selectedRows,
|
|
135807
135845
|
setSelectedRows,
|
|
135846
|
+
getIsRowSelected,
|
|
135808
135847
|
addValueToSelectedFacet,
|
|
135809
135848
|
combineRangeFacetConfig
|
|
135810
135849
|
}, paginationControls);
|
|
@@ -138113,6 +138152,10 @@ ${e3.message}`);
|
|
|
138113
138152
|
const { accessRequirement, entityId, onHide } = props;
|
|
138114
138153
|
const { accessToken } = useSynapseContext();
|
|
138115
138154
|
const { data: accessRequirementStatus, isLoading: isLoadingStatus } = useGetAccessRequirementStatus(String(accessRequirement.id));
|
|
138155
|
+
const { data: wikiPage } = useGetAccessRequirementWikiPageKey(
|
|
138156
|
+
accessRequirement.id.toString()
|
|
138157
|
+
// ACT ARs may have the contact info embedded in the AR or may have an associated Wiki.
|
|
138158
|
+
);
|
|
138116
138159
|
const isApproved = accessRequirementStatus == null ? void 0 : accessRequirementStatus.isApproved;
|
|
138117
138160
|
const [showACTContactInfoInstructions, setShowACTContactInfoInstructions] = (0, import_react195.useState)(false);
|
|
138118
138161
|
let acceptButtonText = "";
|
|
@@ -138148,6 +138191,19 @@ ${e3.message}`);
|
|
|
138148
138191
|
}
|
|
138149
138192
|
];
|
|
138150
138193
|
}
|
|
138194
|
+
let renderedTerms = /* @__PURE__ */ import_react195.default.createElement(import_react195.default.Fragment, null);
|
|
138195
|
+
if (actContactInfo) {
|
|
138196
|
+
renderedTerms = /* @__PURE__ */ import_react195.default.createElement(MarkdownSynapse_default, { markdown: actContactInfo });
|
|
138197
|
+
} else if (wikiPage) {
|
|
138198
|
+
renderedTerms = /* @__PURE__ */ import_react195.default.createElement(
|
|
138199
|
+
MarkdownSynapse_default,
|
|
138200
|
+
{
|
|
138201
|
+
wikiId: wikiPage == null ? void 0 : wikiPage.wikiPageId,
|
|
138202
|
+
ownerId: wikiPage == null ? void 0 : wikiPage.ownerObjectId,
|
|
138203
|
+
objectType: wikiPage == null ? void 0 : wikiPage.ownerObjectType
|
|
138204
|
+
}
|
|
138205
|
+
);
|
|
138206
|
+
}
|
|
138151
138207
|
return /* @__PURE__ */ import_react195.default.createElement(
|
|
138152
138208
|
RequirementItem,
|
|
138153
138209
|
{
|
|
@@ -138164,7 +138220,7 @@ ${e3.message}`);
|
|
|
138164
138220
|
)
|
|
138165
138221
|
},
|
|
138166
138222
|
showACTContactInfoInstructions ? "Hide Instructions" : "View Instructions"
|
|
138167
|
-
)), showACTContactInfoInstructions && /* @__PURE__ */ import_react195.default.createElement(Box_default, { sx: { my: 1 } },
|
|
138223
|
+
)), showACTContactInfoInstructions && /* @__PURE__ */ import_react195.default.createElement(Box_default, { sx: { my: 1 } }, renderedTerms)) : renderedTerms
|
|
138168
138224
|
);
|
|
138169
138225
|
}
|
|
138170
138226
|
|
|
@@ -138331,9 +138387,8 @@ ${e3.message}`);
|
|
|
138331
138387
|
const { data: accessRequirementStatus, isLoading: isLoadingStatus } = useGetAccessRequirementStatus(String(accessRequirement.id));
|
|
138332
138388
|
const isApproved = accessRequirementStatus == null ? void 0 : accessRequirementStatus.isApproved;
|
|
138333
138389
|
const { data: wikiPage } = useGetAccessRequirementWikiPageKey(
|
|
138334
|
-
accessRequirement.id.toString()
|
|
138335
|
-
// TermsOfUse ARs have the terms embedded in the AR
|
|
138336
|
-
{ enabled: !isTermsOfUse }
|
|
138390
|
+
accessRequirement.id.toString()
|
|
138391
|
+
// TermsOfUse ARs may have the terms embedded in the AR or an associated Wiki.
|
|
138337
138392
|
);
|
|
138338
138393
|
const [showTerms, setShowTerms] = (0, import_react198.useState)(false);
|
|
138339
138394
|
const {
|
|
@@ -138355,7 +138410,7 @@ ${e3.message}`);
|
|
|
138355
138410
|
createAccessApproval2(accessApprovalRequest);
|
|
138356
138411
|
};
|
|
138357
138412
|
let renderedTerms = /* @__PURE__ */ import_react198.default.createElement(import_react198.default.Fragment, null);
|
|
138358
|
-
if (isTermsOfUse) {
|
|
138413
|
+
if (isTermsOfUse && accessRequirement.termsOfUse) {
|
|
138359
138414
|
renderedTerms = /* @__PURE__ */ import_react198.default.createElement(MarkdownSynapse_default, { markdown: accessRequirement.termsOfUse });
|
|
138360
138415
|
} else if (wikiPage) {
|
|
138361
138416
|
renderedTerms = /* @__PURE__ */ import_react198.default.createElement(
|
|
@@ -143019,7 +143074,7 @@ ${e3.message}`);
|
|
|
143019
143074
|
function getPillPropsFromColumnQueryFilter(queryFilter, queryContext, queryVisualizationContext) {
|
|
143020
143075
|
const { getColumnDisplayName } = queryVisualizationContext;
|
|
143021
143076
|
const columnModel = queryContext.getColumnModel(queryFilter.columnName);
|
|
143022
|
-
if (queryFilter.values.length > MAX_VALUES_IN_FILTER_FOR_INDIVIDUAL_PILLS) {
|
|
143077
|
+
if (queryFilter.values.length > MAX_VALUES_IN_FILTER_FOR_INDIVIDUAL_PILLS || !columnModel) {
|
|
143023
143078
|
const text = `${(0, import_pluralize3.default)(
|
|
143024
143079
|
getColumnDisplayName(queryFilter.columnName)
|
|
143025
143080
|
)} (${queryFilter.values.length.toLocaleString()})`;
|
|
@@ -143095,7 +143150,7 @@ ${e3.message}`);
|
|
|
143095
143150
|
const columnModel = queryContext.getColumnModel(selectedFacet.columnName);
|
|
143096
143151
|
const { getColumnDisplayName, getDisplayValue: getDisplayValue2 } = queryVisualizationContext;
|
|
143097
143152
|
if (isFacetColumnValuesRequest(selectedFacet)) {
|
|
143098
|
-
if (selectedFacet.facetValues.length > MAX_VALUES_IN_FILTER_FOR_INDIVIDUAL_PILLS) {
|
|
143153
|
+
if (selectedFacet.facetValues.length > MAX_VALUES_IN_FILTER_FOR_INDIVIDUAL_PILLS || !columnModel) {
|
|
143099
143154
|
const text = `${(0, import_pluralize3.default)(
|
|
143100
143155
|
getColumnDisplayName(selectedFacet.columnName)
|
|
143101
143156
|
)} (${selectedFacet.facetValues.length.toLocaleString()})`;
|
|
@@ -148100,7 +148155,7 @@ ${e3.message}`);
|
|
|
148100
148155
|
createTableRows(rows, headers, isShowingAccessColumn, isShowingDownloadColumn, isShowingAddToV2DownloadListColumn, isRowSelectionVisible) {
|
|
148101
148156
|
const rowsFormatted = [];
|
|
148102
148157
|
const {
|
|
148103
|
-
queryContext: { data, selectedRows, setSelectedRows },
|
|
148158
|
+
queryContext: { data, selectedRows, setSelectedRows, getIsRowSelected },
|
|
148104
148159
|
queryVisualizationContext: { columnsToShowInTable },
|
|
148105
148160
|
columnLinks = []
|
|
148106
148161
|
} = this.props;
|
|
@@ -148209,7 +148264,7 @@ ${e3.message}`);
|
|
|
148209
148264
|
Checkbox3,
|
|
148210
148265
|
{
|
|
148211
148266
|
label: "",
|
|
148212
|
-
checked:
|
|
148267
|
+
checked: getIsRowSelected(row),
|
|
148213
148268
|
onChange: (checked) => {
|
|
148214
148269
|
const cloneSelectedRows = [...selectedRows];
|
|
148215
148270
|
if (checked) {
|
|
@@ -177391,6 +177446,7 @@ dl_list_file_entities = syn.get_download_list()`;
|
|
|
177391
177446
|
const DASHBOARD_LINK = `${getEndpoint(
|
|
177392
177447
|
1 /* PORTAL_ENDPOINT */
|
|
177393
177448
|
)}#!Profile:v/projects`;
|
|
177449
|
+
const contactUsHref = "https://sagebionetworks.jira.com/servicedesk/customer/portal/9/group/16/create/85?summary=Synapse%20Hosting%20Plan%20Request&description=%3CPlease%20add%20a%20paragraph%20describing%20your%20project%20and%20your%20expected%20data%20storage%20need%20(e.g.%2C%20duration%20and%20expected%20volume)%3E";
|
|
177394
177450
|
return /* @__PURE__ */ import_react482.default.createElement("div", { className: "SynapseHomepage" }, /* @__PURE__ */ import_react482.default.createElement("div", { className: "SynapseHomepage__Section PrimaryBackground" }, /* @__PURE__ */ import_react482.default.createElement("div", { className: "HeroContainer" }, /* @__PURE__ */ import_react482.default.createElement("div", { className: "Headline WhiteText" }, /* @__PURE__ */ import_react482.default.createElement("div", { className: "SynapseLogoContainer" }, /* @__PURE__ */ import_react482.default.createElement(SynapseFullLogo_default, null)), /* @__PURE__ */ import_react482.default.createElement("div", { className: "HeadlineSentence" }, /* @__PURE__ */ import_react482.default.createElement("span", { className: "Headline-Strong" }, "Organize"), /* @__PURE__ */ import_react482.default.createElement("span", { className: "Headline-Light" }, " ", "your digital research assets.")), /* @__PURE__ */ import_react482.default.createElement("div", { className: "HeadlineSentence" }, /* @__PURE__ */ import_react482.default.createElement("span", { className: "Headline-Strong" }, "Get credit"), /* @__PURE__ */ import_react482.default.createElement("span", { className: "Headline-Light" }, " for your research.")), /* @__PURE__ */ import_react482.default.createElement("div", { className: "HeadlineSentence" }, /* @__PURE__ */ import_react482.default.createElement("span", { className: "Headline-Strong" }, "Collaborate"), /* @__PURE__ */ import_react482.default.createElement("span", { className: "Headline-Light" }, " ", "with your colleagues and the public."))), /* @__PURE__ */ import_react482.default.createElement(
|
|
177395
177451
|
"img",
|
|
177396
177452
|
{
|
|
@@ -177677,19 +177733,12 @@ dl_list_file_entities = syn.get_download_list()`;
|
|
|
177677
177733
|
target: "_blank"
|
|
177678
177734
|
},
|
|
177679
177735
|
"Learn more"
|
|
177680
|
-
), " ", "and", " ", /* @__PURE__ */ import_react482.default.createElement(
|
|
177681
|
-
Link_default,
|
|
177682
|
-
{
|
|
177683
|
-
href: "https://sagebionetworks.jira.com/servicedesk/customer/portal/9",
|
|
177684
|
-
target: "_blank"
|
|
177685
|
-
},
|
|
177686
|
-
"contact us"
|
|
177687
|
-
), " ", "to get started."), /* @__PURE__ */ import_react482.default.createElement(
|
|
177736
|
+
), " ", "and", " ", /* @__PURE__ */ import_react482.default.createElement(Link_default, { href: contactUsHref, target: "_blank" }, "contact us"), " ", "to get started."), /* @__PURE__ */ import_react482.default.createElement(
|
|
177688
177737
|
Button_default,
|
|
177689
177738
|
{
|
|
177690
177739
|
variant: "contained",
|
|
177691
177740
|
target: "_blank",
|
|
177692
|
-
href:
|
|
177741
|
+
href: contactUsHref,
|
|
177693
177742
|
sx: { marginTop: "25px" }
|
|
177694
177743
|
},
|
|
177695
177744
|
"Contact us for more information"
|