synapse-react-client 3.1.47 → 3.1.48
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 +159 -119
- package/dist/index.mjs +92 -52
- package/dist/umd/synapse-react-client.development.js +49 -16
- 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
package/dist/index.mjs
CHANGED
|
@@ -37381,7 +37381,7 @@ __publicField(ModalDownload, "contextType", SynapseContext);
|
|
|
37381
37381
|
var ModalDownload_default = ModalDownload;
|
|
37382
37382
|
|
|
37383
37383
|
// src/components/QueryWrapper/QueryWrapper.tsx
|
|
37384
|
-
import React198, { useCallback as
|
|
37384
|
+
import React198, { useCallback as useCallback19, useEffect as useEffect44, useMemo as useMemo26, useState as useState43 } from "react";
|
|
37385
37385
|
import { useDeepCompareEffectNoCheck } from "use-deep-compare-effect";
|
|
37386
37386
|
|
|
37387
37387
|
// src/utils/hooks/useImmutableTableQuery/useImmutableTableQuery.ts
|
|
@@ -37813,7 +37813,33 @@ function isSortableColumn(column) {
|
|
|
37813
37813
|
}
|
|
37814
37814
|
|
|
37815
37815
|
// src/components/QueryWrapper/useTableRowSelection.ts
|
|
37816
|
-
import { useState as useState41 } from "react";
|
|
37816
|
+
import { useCallback as useCallback18, useState as useState41 } from "react";
|
|
37817
|
+
import { isEqual as isEqual4 } from "lodash-es";
|
|
37818
|
+
function getRowSelectionEqualityComparator(row, columnModels, rowSelectionPrimaryKey) {
|
|
37819
|
+
let comparator = isEqual4;
|
|
37820
|
+
if (rowSelectionPrimaryKey && columnModels) {
|
|
37821
|
+
comparator = (r1, r2) => {
|
|
37822
|
+
const r1PrimaryKeyValues = rowSelectionPrimaryKey.map(
|
|
37823
|
+
(key) => r1.values[columnModels.findIndex((cm) => cm.name === key)]
|
|
37824
|
+
);
|
|
37825
|
+
const r2PrimaryKeyValues = rowSelectionPrimaryKey.map(
|
|
37826
|
+
(key) => r2.values[columnModels.findIndex((cm) => cm.name === key)]
|
|
37827
|
+
);
|
|
37828
|
+
return isEqual4(r1PrimaryKeyValues, r2PrimaryKeyValues);
|
|
37829
|
+
};
|
|
37830
|
+
} else if (row.rowId) {
|
|
37831
|
+
comparator = (r1, r2) => r1.rowId === r2.rowId;
|
|
37832
|
+
}
|
|
37833
|
+
return comparator;
|
|
37834
|
+
}
|
|
37835
|
+
function isRowSelected(row, selectedRows, columnModels, rowSelectionPrimaryKey) {
|
|
37836
|
+
const comparator = getRowSelectionEqualityComparator(
|
|
37837
|
+
row,
|
|
37838
|
+
columnModels,
|
|
37839
|
+
rowSelectionPrimaryKey
|
|
37840
|
+
);
|
|
37841
|
+
return selectedRows.some((selectedRow) => comparator(selectedRow, row));
|
|
37842
|
+
}
|
|
37817
37843
|
function useTableRowSelection(options2) {
|
|
37818
37844
|
const { isRowSelectionVisible = false, entity, columnModels } = options2;
|
|
37819
37845
|
let { rowSelectionPrimaryKey } = options2;
|
|
@@ -37821,12 +37847,24 @@ function useTableRowSelection(options2) {
|
|
|
37821
37847
|
if (!rowSelectionPrimaryKey && isFileViewOrDataset(entity) && columnModels?.find((cm) => cm.name === "id")) {
|
|
37822
37848
|
rowSelectionPrimaryKey = ["id"];
|
|
37823
37849
|
}
|
|
37850
|
+
const getIsRowSelected = useCallback18(
|
|
37851
|
+
(row) => {
|
|
37852
|
+
return isRowSelected(
|
|
37853
|
+
row,
|
|
37854
|
+
selectedRows,
|
|
37855
|
+
columnModels,
|
|
37856
|
+
rowSelectionPrimaryKey
|
|
37857
|
+
);
|
|
37858
|
+
},
|
|
37859
|
+
[columnModels, rowSelectionPrimaryKey, selectedRows]
|
|
37860
|
+
);
|
|
37824
37861
|
return {
|
|
37825
37862
|
isRowSelectionVisible,
|
|
37826
37863
|
rowSelectionPrimaryKey,
|
|
37827
37864
|
selectedRows,
|
|
37828
37865
|
setSelectedRows,
|
|
37829
|
-
hasSelectedRows: isRowSelectionVisible && selectedRows.length > 0
|
|
37866
|
+
hasSelectedRows: isRowSelectionVisible && selectedRows.length > 0,
|
|
37867
|
+
getIsRowSelected
|
|
37830
37868
|
};
|
|
37831
37869
|
}
|
|
37832
37870
|
|
|
@@ -38045,7 +38083,7 @@ function QueryWrapper(props) {
|
|
|
38045
38083
|
const request = getCurrentQueryRequest();
|
|
38046
38084
|
return hasResettableFilters(request.query, lockedColumn);
|
|
38047
38085
|
}, [getCurrentQueryRequest, lockedColumn]);
|
|
38048
|
-
const getColumnModel =
|
|
38086
|
+
const getColumnModel = useCallback19(
|
|
38049
38087
|
(columnName) => {
|
|
38050
38088
|
return data?.columnModels?.find((cm) => cm.name === columnName) ?? null;
|
|
38051
38089
|
},
|
|
@@ -38056,7 +38094,8 @@ function QueryWrapper(props) {
|
|
|
38056
38094
|
rowSelectionPrimaryKey,
|
|
38057
38095
|
hasSelectedRows,
|
|
38058
38096
|
selectedRows,
|
|
38059
|
-
setSelectedRows
|
|
38097
|
+
setSelectedRows,
|
|
38098
|
+
getIsRowSelected
|
|
38060
38099
|
} = useTableRowSelection({
|
|
38061
38100
|
entity,
|
|
38062
38101
|
columnModels: data?.columnModels,
|
|
@@ -38092,6 +38131,7 @@ function QueryWrapper(props) {
|
|
|
38092
38131
|
hasSelectedRows,
|
|
38093
38132
|
selectedRows,
|
|
38094
38133
|
setSelectedRows,
|
|
38134
|
+
getIsRowSelected,
|
|
38095
38135
|
addValueToSelectedFacet,
|
|
38096
38136
|
combineRangeFacetConfig,
|
|
38097
38137
|
...paginationControls
|
|
@@ -43735,7 +43775,7 @@ var TopLevelControls_default = TopLevelControls;
|
|
|
43735
43775
|
import React317, { useEffect as useEffect54, useMemo as useMemo35, useState as useState72 } from "react";
|
|
43736
43776
|
|
|
43737
43777
|
// src/components/widgets/query-filter/FacetFilterControls.tsx
|
|
43738
|
-
import React311, { useCallback as
|
|
43778
|
+
import React311, { useCallback as useCallback20 } from "react";
|
|
43739
43779
|
import { useDeepCompareEffectNoCheck as useDeepCompareEffectNoCheck2 } from "use-deep-compare-effect";
|
|
43740
43780
|
|
|
43741
43781
|
// src/components/widgets/query-filter/EnumFacetFilter.tsx
|
|
@@ -44621,7 +44661,7 @@ function FacetFilterControls(props) {
|
|
|
44621
44661
|
);
|
|
44622
44662
|
}, [facets]);
|
|
44623
44663
|
const columnModels = data.selectColumns;
|
|
44624
|
-
const applyChanges =
|
|
44664
|
+
const applyChanges = useCallback20(
|
|
44625
44665
|
(facets2) => {
|
|
44626
44666
|
executeQueryRequest(
|
|
44627
44667
|
(queryRequest) => {
|
|
@@ -44634,7 +44674,7 @@ function FacetFilterControls(props) {
|
|
|
44634
44674
|
},
|
|
44635
44675
|
[executeQueryRequest]
|
|
44636
44676
|
);
|
|
44637
|
-
const toggleShowFacetFilter =
|
|
44677
|
+
const toggleShowFacetFilter = useCallback20(
|
|
44638
44678
|
(facet) => {
|
|
44639
44679
|
const newFacetFilterShown = new Set(facetFiltersShown);
|
|
44640
44680
|
if (newFacetFilterShown.has(facet.columnName)) {
|
|
@@ -44715,7 +44755,7 @@ function FacetFilterControlsOrLoader(props) {
|
|
|
44715
44755
|
// src/components/widgets/facet-nav/FacetNavPanel.tsx
|
|
44716
44756
|
import { InfoOutlined as InfoOutlined2 } from "@mui/icons-material";
|
|
44717
44757
|
import Plotly2 from "plotly.js-basic-dist";
|
|
44718
|
-
import React313, { useCallback as
|
|
44758
|
+
import React313, { useCallback as useCallback21, useState as useState71 } from "react";
|
|
44719
44759
|
import { Dropdown as Dropdown5 } from "react-bootstrap";
|
|
44720
44760
|
import createPlotlyComponent2 from "react-plotly.js/factory";
|
|
44721
44761
|
import { SizeMe } from "react-sizeme";
|
|
@@ -45192,7 +45232,7 @@ var FacetNavPanel = (props) => {
|
|
|
45192
45232
|
const { getColumnDisplayName } = useQueryVisualizationContext();
|
|
45193
45233
|
const [showModal, setShowModal] = useState71(false);
|
|
45194
45234
|
const plotTitle = getColumnDisplayName(facetToPlot.columnName);
|
|
45195
|
-
const getColumnType =
|
|
45235
|
+
const getColumnType = useCallback21(
|
|
45196
45236
|
() => data?.columnModels?.find(
|
|
45197
45237
|
(columnModel) => columnModel.name === facetToPlot.columnName
|
|
45198
45238
|
)?.columnType,
|
|
@@ -45350,7 +45390,7 @@ var MAX_VALUES_IN_FILTER_FOR_INDIVIDUAL_PILLS = 4;
|
|
|
45350
45390
|
function getPillPropsFromColumnQueryFilter(queryFilter, queryContext, queryVisualizationContext) {
|
|
45351
45391
|
const { getColumnDisplayName } = queryVisualizationContext;
|
|
45352
45392
|
const columnModel = queryContext.getColumnModel(queryFilter.columnName);
|
|
45353
|
-
if (queryFilter.values.length > MAX_VALUES_IN_FILTER_FOR_INDIVIDUAL_PILLS) {
|
|
45393
|
+
if (queryFilter.values.length > MAX_VALUES_IN_FILTER_FOR_INDIVIDUAL_PILLS || !columnModel) {
|
|
45354
45394
|
const text = `${pluralize3(
|
|
45355
45395
|
getColumnDisplayName(queryFilter.columnName)
|
|
45356
45396
|
)} (${queryFilter.values.length.toLocaleString()})`;
|
|
@@ -45424,7 +45464,7 @@ function getPillPropsFromFacetFilters(selectedFacets, queryContext, queryVisuali
|
|
|
45424
45464
|
const columnModel = queryContext.getColumnModel(selectedFacet.columnName);
|
|
45425
45465
|
const { getColumnDisplayName, getDisplayValue: getDisplayValue2 } = queryVisualizationContext;
|
|
45426
45466
|
if (isFacetColumnValuesRequest(selectedFacet)) {
|
|
45427
|
-
if (selectedFacet.facetValues.length > MAX_VALUES_IN_FILTER_FOR_INDIVIDUAL_PILLS) {
|
|
45467
|
+
if (selectedFacet.facetValues.length > MAX_VALUES_IN_FILTER_FOR_INDIVIDUAL_PILLS || !columnModel) {
|
|
45428
45468
|
const text = `${pluralize3(
|
|
45429
45469
|
getColumnDisplayName(selectedFacet.columnName)
|
|
45430
45470
|
)} (${selectedFacet.facetValues.length.toLocaleString()})`;
|
|
@@ -47140,7 +47180,7 @@ var CardContainer_default2 = CardContainer;
|
|
|
47140
47180
|
|
|
47141
47181
|
// src/components/SynapseTable/SynapseTable.tsx
|
|
47142
47182
|
import ColumnResizer from "column-resizer";
|
|
47143
|
-
import { cloneDeep as cloneDeep6, eq, isEqual as
|
|
47183
|
+
import { cloneDeep as cloneDeep6, eq, isEqual as isEqual5 } from "lodash-es";
|
|
47144
47184
|
import React350 from "react";
|
|
47145
47185
|
|
|
47146
47186
|
// src/components/AddToDownloadListV2.tsx
|
|
@@ -48679,7 +48719,7 @@ var SynapseTable = class extends React350.Component {
|
|
|
48679
48719
|
createTableRows(rows, headers, isShowingAccessColumn, isShowingDownloadColumn, isShowingAddToV2DownloadListColumn, isRowSelectionVisible) {
|
|
48680
48720
|
const rowsFormatted = [];
|
|
48681
48721
|
const {
|
|
48682
|
-
queryContext: { data, selectedRows, setSelectedRows },
|
|
48722
|
+
queryContext: { data, selectedRows, setSelectedRows, getIsRowSelected },
|
|
48683
48723
|
queryVisualizationContext: { columnsToShowInTable },
|
|
48684
48724
|
columnLinks = []
|
|
48685
48725
|
} = this.props;
|
|
@@ -48787,14 +48827,14 @@ var SynapseTable = class extends React350.Component {
|
|
|
48787
48827
|
Checkbox,
|
|
48788
48828
|
{
|
|
48789
48829
|
label: "",
|
|
48790
|
-
checked:
|
|
48830
|
+
checked: getIsRowSelected(row),
|
|
48791
48831
|
onChange: (checked) => {
|
|
48792
48832
|
const cloneSelectedRows = [...selectedRows];
|
|
48793
48833
|
if (checked) {
|
|
48794
48834
|
cloneSelectedRows.push(row);
|
|
48795
48835
|
} else {
|
|
48796
48836
|
const index = cloneSelectedRows.findIndex(
|
|
48797
|
-
(selectedRow) =>
|
|
48837
|
+
(selectedRow) => isEqual5(selectedRow, row)
|
|
48798
48838
|
);
|
|
48799
48839
|
if (index > -1) {
|
|
48800
48840
|
cloneSelectedRows.splice(index, 1);
|
|
@@ -52490,16 +52530,16 @@ function ChallengeDetailPage({ projectId }) {
|
|
|
52490
52530
|
}
|
|
52491
52531
|
|
|
52492
52532
|
// src/components/ChallengeDataDownload/ChallengeDataDownload.tsx
|
|
52493
|
-
import React441, { useCallback as
|
|
52533
|
+
import React441, { useCallback as useCallback29 } from "react";
|
|
52494
52534
|
import AddCircleTwoToneIcon from "@mui/icons-material/AddCircleTwoTone";
|
|
52495
52535
|
|
|
52496
52536
|
// src/components/EntityFinder/useEntitySelection.ts
|
|
52497
|
-
import { useCallback as
|
|
52537
|
+
import { useCallback as useCallback27, useReducer } from "react";
|
|
52498
52538
|
import { Map as Map2 } from "immutable";
|
|
52499
52539
|
|
|
52500
52540
|
// src/components/EntityFinder/EntityFinder.tsx
|
|
52501
52541
|
import pluralize5 from "pluralize";
|
|
52502
|
-
import React437, { useCallback as
|
|
52542
|
+
import React437, { useCallback as useCallback26, useEffect as useEffect81, useMemo as useMemo42, useRef as useRef43, useState as useState113 } from "react";
|
|
52503
52543
|
import ArrowBackOutlinedIcon from "@mui/icons-material/ArrowBackOutlined";
|
|
52504
52544
|
import ClearIcon from "@mui/icons-material/Clear";
|
|
52505
52545
|
import SearchIcon2 from "@mui/icons-material/Search";
|
|
@@ -52546,7 +52586,7 @@ import BaseTable, {
|
|
|
52546
52586
|
AutoResizer,
|
|
52547
52587
|
Column
|
|
52548
52588
|
} from "@sage-bionetworks/react-base-table";
|
|
52549
|
-
import React428, { useCallback as
|
|
52589
|
+
import React428, { useCallback as useCallback23, useEffect as useEffect77, useMemo as useMemo40, useState as useState107 } from "react";
|
|
52550
52590
|
import { useQueryClient as useQueryClient10 } from "react-query";
|
|
52551
52591
|
|
|
52552
52592
|
// src/components/EntityFinder/details/view/DetailsViewTableRenderers.tsx
|
|
@@ -52605,7 +52645,7 @@ import React424, { useRef as useRef42, useState as useState105 } from "react";
|
|
|
52605
52645
|
// src/components/SchemaDrivenAnnotationEditor/SchemaDrivenAnnotationEditor.tsx
|
|
52606
52646
|
import Form4 from "@rjsf/mui";
|
|
52607
52647
|
import isEmpty6 from "lodash-es/isEmpty";
|
|
52608
|
-
import React421, { useCallback as
|
|
52648
|
+
import React421, { useCallback as useCallback22, useEffect as useEffect74, useMemo as useMemo39, useRef as useRef41 } from "react";
|
|
52609
52649
|
|
|
52610
52650
|
// src/assets/icons/AddToList.tsx
|
|
52611
52651
|
import React401 from "react";
|
|
@@ -52626,7 +52666,7 @@ var AddToList = (props) => {
|
|
|
52626
52666
|
var AddToList_default = AddToList;
|
|
52627
52667
|
|
|
52628
52668
|
// src/components/SchemaDrivenAnnotationEditor/field/AdditionalPropertiesSchemaField.tsx
|
|
52629
|
-
import { isEqual as
|
|
52669
|
+
import { isEqual as isEqual6 } from "lodash-es";
|
|
52630
52670
|
import React403, { useEffect as useEffect71, useState as useState101 } from "react";
|
|
52631
52671
|
|
|
52632
52672
|
// src/components/SchemaDrivenAnnotationEditor/AnnotationEditorUtils.ts
|
|
@@ -52814,7 +52854,7 @@ function AdditionalPropertiesSchemaField(props) {
|
|
|
52814
52854
|
nextPropertyType
|
|
52815
52855
|
);
|
|
52816
52856
|
if (dataIsEmpty || nextPropertyType !== propertyType) {
|
|
52817
|
-
if (
|
|
52857
|
+
if (isEqual6(formData, coercedList)) {
|
|
52818
52858
|
setPropertyType(nextPropertyType);
|
|
52819
52859
|
}
|
|
52820
52860
|
}
|
|
@@ -53720,7 +53760,7 @@ function SchemaDrivenAnnotationEditor(props) {
|
|
|
53720
53760
|
() => getPatternPropertiesBannedKeys(entityJson?.concreteType),
|
|
53721
53761
|
[entityJson?.concreteType]
|
|
53722
53762
|
);
|
|
53723
|
-
const transformErrors =
|
|
53763
|
+
const transformErrors = useCallback22(
|
|
53724
53764
|
getTransformErrors(entityJson?.concreteType),
|
|
53725
53765
|
[entityJson?.concreteType]
|
|
53726
53766
|
);
|
|
@@ -54752,7 +54792,7 @@ var DetailsView = ({
|
|
|
54752
54792
|
selectableTypes,
|
|
54753
54793
|
visibleTypes
|
|
54754
54794
|
]);
|
|
54755
|
-
const NameRenderer =
|
|
54795
|
+
const NameRenderer = useCallback23(
|
|
54756
54796
|
(props) => {
|
|
54757
54797
|
if (setCurrentContainer && isContainerType(props.rowData.entityType)) {
|
|
54758
54798
|
return /* @__PURE__ */ React428.createElement(
|
|
@@ -55279,7 +55319,7 @@ var EntityPathDisplay = ({ entity, toggleSelection }) => {
|
|
|
55279
55319
|
|
|
55280
55320
|
// src/components/EntityFinder/tree/EntityTree.tsx
|
|
55281
55321
|
import React436, {
|
|
55282
|
-
useCallback as
|
|
55322
|
+
useCallback as useCallback25,
|
|
55283
55323
|
useEffect as useEffect80,
|
|
55284
55324
|
useMemo as useMemo41,
|
|
55285
55325
|
useState as useState112
|
|
@@ -55289,7 +55329,7 @@ import { Dropdown as Dropdown6 } from "react-bootstrap";
|
|
|
55289
55329
|
// src/components/EntityFinder/tree/VirtualizedTree.tsx
|
|
55290
55330
|
import { cloneDeep as cloneDeep7 } from "lodash-es";
|
|
55291
55331
|
import dayjs18 from "dayjs";
|
|
55292
|
-
import React435, { useCallback as
|
|
55332
|
+
import React435, { useCallback as useCallback24, useEffect as useEffect79, useState as useState111 } from "react";
|
|
55293
55333
|
import { useInView as useInView8 } from "react-intersection-observer";
|
|
55294
55334
|
import AutoSizer from "react-virtualized-auto-sizer";
|
|
55295
55335
|
import {
|
|
@@ -55400,7 +55440,7 @@ function Node4(props) {
|
|
|
55400
55440
|
getNextPageOfChildren();
|
|
55401
55441
|
}
|
|
55402
55442
|
}, [node, inView, getNextPageOfChildren]);
|
|
55403
|
-
const toggleExpand =
|
|
55443
|
+
const toggleExpand = useCallback24(async () => {
|
|
55404
55444
|
if (hasMoreChildren(node)) {
|
|
55405
55445
|
setLoading(true);
|
|
55406
55446
|
await getNextPageOfChildren();
|
|
@@ -55556,7 +55596,7 @@ var VirtualizedTree = (props) => {
|
|
|
55556
55596
|
useEffect79(() => {
|
|
55557
55597
|
setRootNode(rootNodeConfiguration);
|
|
55558
55598
|
}, [rootNodeConfiguration, rootNodeConfiguration.children]);
|
|
55559
|
-
const itemSize =
|
|
55599
|
+
const itemSize = useCallback24(
|
|
55560
55600
|
(index) => {
|
|
55561
55601
|
if (index === 0 && !rootNodeConfiguration.show) {
|
|
55562
55602
|
return 0;
|
|
@@ -55565,7 +55605,7 @@ var VirtualizedTree = (props) => {
|
|
|
55565
55605
|
},
|
|
55566
55606
|
[treeNodeType, rootNodeConfiguration.show]
|
|
55567
55607
|
);
|
|
55568
|
-
const fetchNextPageOfChildren =
|
|
55608
|
+
const fetchNextPageOfChildren = useCallback24(
|
|
55569
55609
|
// Because we update the root node with a copy at the end of this function, we can write to the node under update.
|
|
55570
55610
|
async (node) => {
|
|
55571
55611
|
const children = await synapse_client_default.getEntityChildren(
|
|
@@ -55586,7 +55626,7 @@ var VirtualizedTree = (props) => {
|
|
|
55586
55626
|
},
|
|
55587
55627
|
[rootNode, accessToken, visibleTypes]
|
|
55588
55628
|
);
|
|
55589
|
-
const memoizedTreeWalker =
|
|
55629
|
+
const memoizedTreeWalker = useCallback24(
|
|
55590
55630
|
getTreeWalkerFunction(
|
|
55591
55631
|
rootNode,
|
|
55592
55632
|
setSelectedId,
|
|
@@ -55684,7 +55724,7 @@ function EntityTree(props) {
|
|
|
55684
55724
|
setDetailsViewConfiguration(DEFAULT_CONFIGURATION);
|
|
55685
55725
|
}
|
|
55686
55726
|
}, []);
|
|
55687
|
-
const setSelectedId =
|
|
55727
|
+
const setSelectedId = useCallback25(
|
|
55688
55728
|
(entityId) => {
|
|
55689
55729
|
if (toggleSelection) {
|
|
55690
55730
|
toggleSelection({ targetId: entityId });
|
|
@@ -55893,7 +55933,7 @@ function EntityTree(props) {
|
|
|
55893
55933
|
fetchNextPageProjects
|
|
55894
55934
|
]
|
|
55895
55935
|
);
|
|
55896
|
-
const shouldAutoExpand =
|
|
55936
|
+
const shouldAutoExpand = useCallback25(
|
|
55897
55937
|
(entityId) => {
|
|
55898
55938
|
if (entityId === "root") {
|
|
55899
55939
|
return true;
|
|
@@ -55995,7 +56035,7 @@ var EntityFinder = ({
|
|
|
55995
56035
|
);
|
|
55996
56036
|
const [currentContainer, setCurrentContainer] = useState113(initialContainer);
|
|
55997
56037
|
const handleError = useErrorHandler4();
|
|
55998
|
-
const setBreadcrumbs =
|
|
56038
|
+
const setBreadcrumbs = useCallback26(
|
|
55999
56039
|
(items) => {
|
|
56000
56040
|
setBreadcrumbsProps({
|
|
56001
56041
|
items
|
|
@@ -56004,13 +56044,13 @@ var EntityFinder = ({
|
|
|
56004
56044
|
[setBreadcrumbsProps]
|
|
56005
56045
|
);
|
|
56006
56046
|
const [selectedEntities, toggleSelection] = useEntitySelection(selectMultiple);
|
|
56007
|
-
const isIdSelected =
|
|
56047
|
+
const isIdSelected = useCallback26(
|
|
56008
56048
|
(entity) => {
|
|
56009
56049
|
return selectedEntities.has(entity.id);
|
|
56010
56050
|
},
|
|
56011
56051
|
[selectedEntities]
|
|
56012
56052
|
);
|
|
56013
|
-
const isSelectable =
|
|
56053
|
+
const isSelectable = useCallback26(
|
|
56014
56054
|
(entity) => {
|
|
56015
56055
|
const type = getEntityTypeFromHeader(entity);
|
|
56016
56056
|
return selectableTypes.includes(type);
|
|
@@ -56233,7 +56273,7 @@ var EntityFinder_default = EntityFinder;
|
|
|
56233
56273
|
|
|
56234
56274
|
// src/components/EntityFinder/useEntitySelection.ts
|
|
56235
56275
|
function useEntitySelection(selectMultiple) {
|
|
56236
|
-
const isSelected =
|
|
56276
|
+
const isSelected = useCallback27(
|
|
56237
56277
|
(entity, selected) => {
|
|
56238
56278
|
const match = selected.get(entity.targetId);
|
|
56239
56279
|
if (match == null) {
|
|
@@ -56246,7 +56286,7 @@ function useEntitySelection(selectMultiple) {
|
|
|
56246
56286
|
},
|
|
56247
56287
|
[]
|
|
56248
56288
|
);
|
|
56249
|
-
const entitySelectionReducer =
|
|
56289
|
+
const entitySelectionReducer = useCallback27(
|
|
56250
56290
|
(selected, toggledReferences) => {
|
|
56251
56291
|
const newSelected = selected.withMutations((map) => {
|
|
56252
56292
|
if (!Array.isArray(toggledReferences)) {
|
|
@@ -56281,7 +56321,7 @@ import BaseTable2, {
|
|
|
56281
56321
|
AutoResizer as AutoResizer2,
|
|
56282
56322
|
Column as Column2
|
|
56283
56323
|
} from "@sage-bionetworks/react-base-table";
|
|
56284
|
-
import React439, { useCallback as
|
|
56324
|
+
import React439, { useCallback as useCallback28, useEffect as useEffect82, useMemo as useMemo43, useState as useState114 } from "react";
|
|
56285
56325
|
import { useQueryClient as useQueryClient11 } from "react-query";
|
|
56286
56326
|
|
|
56287
56327
|
// src/components/ChallengeDataDownload/Renderers.tsx
|
|
@@ -56494,7 +56534,7 @@ var ChallengeDataTable = ({
|
|
|
56494
56534
|
selectableTypes,
|
|
56495
56535
|
visibleTypes
|
|
56496
56536
|
]);
|
|
56497
|
-
const NameRenderer =
|
|
56537
|
+
const NameRenderer = useCallback28(
|
|
56498
56538
|
(props) => {
|
|
56499
56539
|
if (setCurrentContainer && isContainerType(props.rowData.entityType)) {
|
|
56500
56540
|
return /* @__PURE__ */ React439.createElement(
|
|
@@ -56750,13 +56790,13 @@ function ChallengeDataDownload({
|
|
|
56750
56790
|
);
|
|
56751
56791
|
}
|
|
56752
56792
|
});
|
|
56753
|
-
const isIdSelected =
|
|
56793
|
+
const isIdSelected = useCallback29(
|
|
56754
56794
|
(entity) => {
|
|
56755
56795
|
return selectedEntities.has(entity.id);
|
|
56756
56796
|
},
|
|
56757
56797
|
[selectedEntities]
|
|
56758
56798
|
);
|
|
56759
|
-
const onAddClick =
|
|
56799
|
+
const onAddClick = useCallback29(() => {
|
|
56760
56800
|
const entities = selectedEntities.toArray().map((entity) => {
|
|
56761
56801
|
return {
|
|
56762
56802
|
fileEntityId: entity[0],
|
|
@@ -59103,7 +59143,7 @@ import { Card as Card3, Col as Col3, Form as Form8, FormControl as FormControl4,
|
|
|
59103
59143
|
import dayjs22 from "dayjs";
|
|
59104
59144
|
|
|
59105
59145
|
// src/components/Evaluation/round_limits/EvaluationRoundLimitOptionsList.tsx
|
|
59106
|
-
import React462, { useCallback as
|
|
59146
|
+
import React462, { useCallback as useCallback30, useEffect as useEffect91 } from "react";
|
|
59107
59147
|
import { CloseTwoTone as CloseTwoTone2, AddBox } from "@mui/icons-material";
|
|
59108
59148
|
|
|
59109
59149
|
// src/components/Evaluation/round_limits/EvaluationRoundLimitOptions.tsx
|
|
@@ -59169,7 +59209,7 @@ var EvaluationRoundLimitOptionsList = ({ limitInputs, handleChange, handleDelete
|
|
|
59169
59209
|
const selectedTypes = new Set(
|
|
59170
59210
|
limitInputs.map((limit) => limit.type)
|
|
59171
59211
|
);
|
|
59172
|
-
const addNewLimit =
|
|
59212
|
+
const addNewLimit = useCallback30(() => {
|
|
59173
59213
|
onAddNewLimit({
|
|
59174
59214
|
type: selectUnusedType(selectedTypes),
|
|
59175
59215
|
maxSubmissionString: ""
|
|
@@ -60528,7 +60568,7 @@ function useDeleteReply(options2) {
|
|
|
60528
60568
|
}
|
|
60529
60569
|
|
|
60530
60570
|
// src/synapse-queries/forum/useThread.ts
|
|
60531
|
-
import { useCallback as
|
|
60571
|
+
import { useCallback as useCallback31 } from "react";
|
|
60532
60572
|
import {
|
|
60533
60573
|
useQuery as useQuery31,
|
|
60534
60574
|
useQueryClient as useQueryClient14,
|
|
@@ -60542,7 +60582,7 @@ function useGetThread(threadId) {
|
|
|
60542
60582
|
);
|
|
60543
60583
|
const { mutate: pinThread2 } = usePinThread();
|
|
60544
60584
|
const { mutate: unPinThread2 } = useUnPinThread();
|
|
60545
|
-
const togglePin =
|
|
60585
|
+
const togglePin = useCallback31(() => {
|
|
60546
60586
|
if (threadData) {
|
|
60547
60587
|
if (threadData?.isPinned) {
|
|
60548
60588
|
unPinThread2(threadData);
|
|
@@ -60739,13 +60779,13 @@ import { FormControl as FormControl5 } from "react-bootstrap";
|
|
|
60739
60779
|
import React478, { useRef as useRef44, useState as useState135, useEffect as useEffect98 } from "react";
|
|
60740
60780
|
|
|
60741
60781
|
// src/components/Markdown/UserMentionModal.tsx
|
|
60742
|
-
import React477, { useCallback as
|
|
60782
|
+
import React477, { useCallback as useCallback32 } from "react";
|
|
60743
60783
|
var UserMentionModal = ({
|
|
60744
60784
|
show,
|
|
60745
60785
|
onClose,
|
|
60746
60786
|
handleUserTag
|
|
60747
60787
|
}) => {
|
|
60748
|
-
const onUserChange =
|
|
60788
|
+
const onUserChange = useCallback32(
|
|
60749
60789
|
(selected, header) => {
|
|
60750
60790
|
if (selected && header) {
|
|
60751
60791
|
handleUserTag(header.userName);
|
|
@@ -61073,7 +61113,7 @@ import {
|
|
|
61073
61113
|
useQuery as useQuery32,
|
|
61074
61114
|
useQueryClient as useQueryClient15
|
|
61075
61115
|
} from "react-query";
|
|
61076
|
-
import { useCallback as
|
|
61116
|
+
import { useCallback as useCallback33 } from "react";
|
|
61077
61117
|
function useGetSubscribers(topic, options2) {
|
|
61078
61118
|
const { accessToken, keyFactory } = useSynapseContext();
|
|
61079
61119
|
return useQuery32(
|
|
@@ -61224,7 +61264,7 @@ var useSubscription = (objectId, objectType) => {
|
|
|
61224
61264
|
const { mutate: postSubscription2, isLoading: isLoadingPost } = usePostSubscription();
|
|
61225
61265
|
const { mutate: deleteSubscription2, isLoading: isLoadingDelete } = useDeleteSubscription();
|
|
61226
61266
|
const isLoading = isLoadingGet || isLoadingPost || isLoadingDelete;
|
|
61227
|
-
const toggleSubscribed =
|
|
61267
|
+
const toggleSubscribed = useCallback33(() => {
|
|
61228
61268
|
if (subscription) {
|
|
61229
61269
|
deleteSubscription2(subscription);
|
|
61230
61270
|
} else {
|
|
@@ -61916,7 +61956,7 @@ var Goals = (props) => {
|
|
|
61916
61956
|
|
|
61917
61957
|
// src/components/GoogleMap/GoogleMap.tsx
|
|
61918
61958
|
import { GoogleMap, LoadScript } from "@react-google-maps/api";
|
|
61919
|
-
import React490, { useCallback as
|
|
61959
|
+
import React490, { useCallback as useCallback34, useMemo as useMemo45, useState as useState143 } from "react";
|
|
61920
61960
|
import { useQuery as useQuery34 } from "react-query";
|
|
61921
61961
|
|
|
61922
61962
|
// src/components/GoogleMap/SynapseUserMarker.tsx
|
|
@@ -61973,7 +62013,7 @@ function Map3(props) {
|
|
|
61973
62013
|
},
|
|
61974
62014
|
{ useErrorBoundary: true }
|
|
61975
62015
|
);
|
|
61976
|
-
const onLoad =
|
|
62016
|
+
const onLoad = useCallback34(
|
|
61977
62017
|
function callback(map) {
|
|
61978
62018
|
if (geoData) {
|
|
61979
62019
|
const bounds = new google.maps.LatLngBounds();
|
|
@@ -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.48",
|
|
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);
|
|
@@ -143019,7 +143058,7 @@ ${e3.message}`);
|
|
|
143019
143058
|
function getPillPropsFromColumnQueryFilter(queryFilter, queryContext, queryVisualizationContext) {
|
|
143020
143059
|
const { getColumnDisplayName } = queryVisualizationContext;
|
|
143021
143060
|
const columnModel = queryContext.getColumnModel(queryFilter.columnName);
|
|
143022
|
-
if (queryFilter.values.length > MAX_VALUES_IN_FILTER_FOR_INDIVIDUAL_PILLS) {
|
|
143061
|
+
if (queryFilter.values.length > MAX_VALUES_IN_FILTER_FOR_INDIVIDUAL_PILLS || !columnModel) {
|
|
143023
143062
|
const text = `${(0, import_pluralize3.default)(
|
|
143024
143063
|
getColumnDisplayName(queryFilter.columnName)
|
|
143025
143064
|
)} (${queryFilter.values.length.toLocaleString()})`;
|
|
@@ -143095,7 +143134,7 @@ ${e3.message}`);
|
|
|
143095
143134
|
const columnModel = queryContext.getColumnModel(selectedFacet.columnName);
|
|
143096
143135
|
const { getColumnDisplayName, getDisplayValue: getDisplayValue2 } = queryVisualizationContext;
|
|
143097
143136
|
if (isFacetColumnValuesRequest(selectedFacet)) {
|
|
143098
|
-
if (selectedFacet.facetValues.length > MAX_VALUES_IN_FILTER_FOR_INDIVIDUAL_PILLS) {
|
|
143137
|
+
if (selectedFacet.facetValues.length > MAX_VALUES_IN_FILTER_FOR_INDIVIDUAL_PILLS || !columnModel) {
|
|
143099
143138
|
const text = `${(0, import_pluralize3.default)(
|
|
143100
143139
|
getColumnDisplayName(selectedFacet.columnName)
|
|
143101
143140
|
)} (${selectedFacet.facetValues.length.toLocaleString()})`;
|
|
@@ -148100,7 +148139,7 @@ ${e3.message}`);
|
|
|
148100
148139
|
createTableRows(rows, headers, isShowingAccessColumn, isShowingDownloadColumn, isShowingAddToV2DownloadListColumn, isRowSelectionVisible) {
|
|
148101
148140
|
const rowsFormatted = [];
|
|
148102
148141
|
const {
|
|
148103
|
-
queryContext: { data, selectedRows, setSelectedRows },
|
|
148142
|
+
queryContext: { data, selectedRows, setSelectedRows, getIsRowSelected },
|
|
148104
148143
|
queryVisualizationContext: { columnsToShowInTable },
|
|
148105
148144
|
columnLinks = []
|
|
148106
148145
|
} = this.props;
|
|
@@ -148209,7 +148248,7 @@ ${e3.message}`);
|
|
|
148209
148248
|
Checkbox3,
|
|
148210
148249
|
{
|
|
148211
148250
|
label: "",
|
|
148212
|
-
checked:
|
|
148251
|
+
checked: getIsRowSelected(row),
|
|
148213
148252
|
onChange: (checked) => {
|
|
148214
148253
|
const cloneSelectedRows = [...selectedRows];
|
|
148215
148254
|
if (checked) {
|
|
@@ -177391,6 +177430,7 @@ dl_list_file_entities = syn.get_download_list()`;
|
|
|
177391
177430
|
const DASHBOARD_LINK = `${getEndpoint(
|
|
177392
177431
|
1 /* PORTAL_ENDPOINT */
|
|
177393
177432
|
)}#!Profile:v/projects`;
|
|
177433
|
+
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
177434
|
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
177435
|
"img",
|
|
177396
177436
|
{
|
|
@@ -177677,19 +177717,12 @@ dl_list_file_entities = syn.get_download_list()`;
|
|
|
177677
177717
|
target: "_blank"
|
|
177678
177718
|
},
|
|
177679
177719
|
"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(
|
|
177720
|
+
), " ", "and", " ", /* @__PURE__ */ import_react482.default.createElement(Link_default, { href: contactUsHref, target: "_blank" }, "contact us"), " ", "to get started."), /* @__PURE__ */ import_react482.default.createElement(
|
|
177688
177721
|
Button_default,
|
|
177689
177722
|
{
|
|
177690
177723
|
variant: "contained",
|
|
177691
177724
|
target: "_blank",
|
|
177692
|
-
href:
|
|
177725
|
+
href: contactUsHref,
|
|
177693
177726
|
sx: { marginTop: "25px" }
|
|
177694
177727
|
},
|
|
177695
177728
|
"Contact us for more information"
|