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
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
|
|
@@ -40467,6 +40507,10 @@ function UnmanagedACTAccessRequirementItem(props) {
|
|
|
40467
40507
|
const { accessRequirement, entityId, onHide } = props;
|
|
40468
40508
|
const { accessToken } = useSynapseContext();
|
|
40469
40509
|
const { data: accessRequirementStatus, isLoading: isLoadingStatus } = useGetAccessRequirementStatus(String(accessRequirement.id));
|
|
40510
|
+
const { data: wikiPage } = useGetAccessRequirementWikiPageKey(
|
|
40511
|
+
accessRequirement.id.toString()
|
|
40512
|
+
// ACT ARs may have the contact info embedded in the AR or may have an associated Wiki.
|
|
40513
|
+
);
|
|
40470
40514
|
const isApproved = accessRequirementStatus?.isApproved;
|
|
40471
40515
|
const [showACTContactInfoInstructions, setShowACTContactInfoInstructions] = useState53(false);
|
|
40472
40516
|
let acceptButtonText = "";
|
|
@@ -40502,6 +40546,19 @@ function UnmanagedACTAccessRequirementItem(props) {
|
|
|
40502
40546
|
}
|
|
40503
40547
|
];
|
|
40504
40548
|
}
|
|
40549
|
+
let renderedTerms = /* @__PURE__ */ React233.createElement(React233.Fragment, null);
|
|
40550
|
+
if (actContactInfo) {
|
|
40551
|
+
renderedTerms = /* @__PURE__ */ React233.createElement(MarkdownSynapse_default, { markdown: actContactInfo });
|
|
40552
|
+
} else if (wikiPage) {
|
|
40553
|
+
renderedTerms = /* @__PURE__ */ React233.createElement(
|
|
40554
|
+
MarkdownSynapse_default,
|
|
40555
|
+
{
|
|
40556
|
+
wikiId: wikiPage?.wikiPageId,
|
|
40557
|
+
ownerId: wikiPage?.ownerObjectId,
|
|
40558
|
+
objectType: wikiPage?.ownerObjectType
|
|
40559
|
+
}
|
|
40560
|
+
);
|
|
40561
|
+
}
|
|
40505
40562
|
return /* @__PURE__ */ React233.createElement(
|
|
40506
40563
|
RequirementItem,
|
|
40507
40564
|
{
|
|
@@ -40518,7 +40575,7 @@ function UnmanagedACTAccessRequirementItem(props) {
|
|
|
40518
40575
|
)
|
|
40519
40576
|
},
|
|
40520
40577
|
showACTContactInfoInstructions ? "Hide Instructions" : "View Instructions"
|
|
40521
|
-
)), showACTContactInfoInstructions && /* @__PURE__ */ React233.createElement(Box_default, { sx: { my: 1 } },
|
|
40578
|
+
)), showACTContactInfoInstructions && /* @__PURE__ */ React233.createElement(Box_default, { sx: { my: 1 } }, renderedTerms)) : renderedTerms
|
|
40522
40579
|
);
|
|
40523
40580
|
}
|
|
40524
40581
|
|
|
@@ -40684,9 +40741,8 @@ function SelfSignAccessRequirementItem(props) {
|
|
|
40684
40741
|
const { data: accessRequirementStatus, isLoading: isLoadingStatus } = useGetAccessRequirementStatus(String(accessRequirement.id));
|
|
40685
40742
|
const isApproved = accessRequirementStatus?.isApproved;
|
|
40686
40743
|
const { data: wikiPage } = useGetAccessRequirementWikiPageKey(
|
|
40687
|
-
accessRequirement.id.toString()
|
|
40688
|
-
// TermsOfUse ARs have the terms embedded in the AR
|
|
40689
|
-
{ enabled: !isTermsOfUse }
|
|
40744
|
+
accessRequirement.id.toString()
|
|
40745
|
+
// TermsOfUse ARs may have the terms embedded in the AR or an associated Wiki.
|
|
40690
40746
|
);
|
|
40691
40747
|
const [showTerms, setShowTerms] = useState55(false);
|
|
40692
40748
|
const {
|
|
@@ -40708,7 +40764,7 @@ function SelfSignAccessRequirementItem(props) {
|
|
|
40708
40764
|
createAccessApproval2(accessApprovalRequest);
|
|
40709
40765
|
};
|
|
40710
40766
|
let renderedTerms = /* @__PURE__ */ React235.createElement(React235.Fragment, null);
|
|
40711
|
-
if (isTermsOfUse) {
|
|
40767
|
+
if (isTermsOfUse && accessRequirement.termsOfUse) {
|
|
40712
40768
|
renderedTerms = /* @__PURE__ */ React235.createElement(MarkdownSynapse_default, { markdown: accessRequirement.termsOfUse });
|
|
40713
40769
|
} else if (wikiPage) {
|
|
40714
40770
|
renderedTerms = /* @__PURE__ */ React235.createElement(
|
|
@@ -43735,7 +43791,7 @@ var TopLevelControls_default = TopLevelControls;
|
|
|
43735
43791
|
import React317, { useEffect as useEffect54, useMemo as useMemo35, useState as useState72 } from "react";
|
|
43736
43792
|
|
|
43737
43793
|
// src/components/widgets/query-filter/FacetFilterControls.tsx
|
|
43738
|
-
import React311, { useCallback as
|
|
43794
|
+
import React311, { useCallback as useCallback20 } from "react";
|
|
43739
43795
|
import { useDeepCompareEffectNoCheck as useDeepCompareEffectNoCheck2 } from "use-deep-compare-effect";
|
|
43740
43796
|
|
|
43741
43797
|
// src/components/widgets/query-filter/EnumFacetFilter.tsx
|
|
@@ -44621,7 +44677,7 @@ function FacetFilterControls(props) {
|
|
|
44621
44677
|
);
|
|
44622
44678
|
}, [facets]);
|
|
44623
44679
|
const columnModels = data.selectColumns;
|
|
44624
|
-
const applyChanges =
|
|
44680
|
+
const applyChanges = useCallback20(
|
|
44625
44681
|
(facets2) => {
|
|
44626
44682
|
executeQueryRequest(
|
|
44627
44683
|
(queryRequest) => {
|
|
@@ -44634,7 +44690,7 @@ function FacetFilterControls(props) {
|
|
|
44634
44690
|
},
|
|
44635
44691
|
[executeQueryRequest]
|
|
44636
44692
|
);
|
|
44637
|
-
const toggleShowFacetFilter =
|
|
44693
|
+
const toggleShowFacetFilter = useCallback20(
|
|
44638
44694
|
(facet) => {
|
|
44639
44695
|
const newFacetFilterShown = new Set(facetFiltersShown);
|
|
44640
44696
|
if (newFacetFilterShown.has(facet.columnName)) {
|
|
@@ -44715,7 +44771,7 @@ function FacetFilterControlsOrLoader(props) {
|
|
|
44715
44771
|
// src/components/widgets/facet-nav/FacetNavPanel.tsx
|
|
44716
44772
|
import { InfoOutlined as InfoOutlined2 } from "@mui/icons-material";
|
|
44717
44773
|
import Plotly2 from "plotly.js-basic-dist";
|
|
44718
|
-
import React313, { useCallback as
|
|
44774
|
+
import React313, { useCallback as useCallback21, useState as useState71 } from "react";
|
|
44719
44775
|
import { Dropdown as Dropdown5 } from "react-bootstrap";
|
|
44720
44776
|
import createPlotlyComponent2 from "react-plotly.js/factory";
|
|
44721
44777
|
import { SizeMe } from "react-sizeme";
|
|
@@ -45192,7 +45248,7 @@ var FacetNavPanel = (props) => {
|
|
|
45192
45248
|
const { getColumnDisplayName } = useQueryVisualizationContext();
|
|
45193
45249
|
const [showModal, setShowModal] = useState71(false);
|
|
45194
45250
|
const plotTitle = getColumnDisplayName(facetToPlot.columnName);
|
|
45195
|
-
const getColumnType =
|
|
45251
|
+
const getColumnType = useCallback21(
|
|
45196
45252
|
() => data?.columnModels?.find(
|
|
45197
45253
|
(columnModel) => columnModel.name === facetToPlot.columnName
|
|
45198
45254
|
)?.columnType,
|
|
@@ -45350,7 +45406,7 @@ var MAX_VALUES_IN_FILTER_FOR_INDIVIDUAL_PILLS = 4;
|
|
|
45350
45406
|
function getPillPropsFromColumnQueryFilter(queryFilter, queryContext, queryVisualizationContext) {
|
|
45351
45407
|
const { getColumnDisplayName } = queryVisualizationContext;
|
|
45352
45408
|
const columnModel = queryContext.getColumnModel(queryFilter.columnName);
|
|
45353
|
-
if (queryFilter.values.length > MAX_VALUES_IN_FILTER_FOR_INDIVIDUAL_PILLS) {
|
|
45409
|
+
if (queryFilter.values.length > MAX_VALUES_IN_FILTER_FOR_INDIVIDUAL_PILLS || !columnModel) {
|
|
45354
45410
|
const text = `${pluralize3(
|
|
45355
45411
|
getColumnDisplayName(queryFilter.columnName)
|
|
45356
45412
|
)} (${queryFilter.values.length.toLocaleString()})`;
|
|
@@ -45424,7 +45480,7 @@ function getPillPropsFromFacetFilters(selectedFacets, queryContext, queryVisuali
|
|
|
45424
45480
|
const columnModel = queryContext.getColumnModel(selectedFacet.columnName);
|
|
45425
45481
|
const { getColumnDisplayName, getDisplayValue: getDisplayValue2 } = queryVisualizationContext;
|
|
45426
45482
|
if (isFacetColumnValuesRequest(selectedFacet)) {
|
|
45427
|
-
if (selectedFacet.facetValues.length > MAX_VALUES_IN_FILTER_FOR_INDIVIDUAL_PILLS) {
|
|
45483
|
+
if (selectedFacet.facetValues.length > MAX_VALUES_IN_FILTER_FOR_INDIVIDUAL_PILLS || !columnModel) {
|
|
45428
45484
|
const text = `${pluralize3(
|
|
45429
45485
|
getColumnDisplayName(selectedFacet.columnName)
|
|
45430
45486
|
)} (${selectedFacet.facetValues.length.toLocaleString()})`;
|
|
@@ -47140,7 +47196,7 @@ var CardContainer_default2 = CardContainer;
|
|
|
47140
47196
|
|
|
47141
47197
|
// src/components/SynapseTable/SynapseTable.tsx
|
|
47142
47198
|
import ColumnResizer from "column-resizer";
|
|
47143
|
-
import { cloneDeep as cloneDeep6, eq, isEqual as
|
|
47199
|
+
import { cloneDeep as cloneDeep6, eq, isEqual as isEqual5 } from "lodash-es";
|
|
47144
47200
|
import React350 from "react";
|
|
47145
47201
|
|
|
47146
47202
|
// src/components/AddToDownloadListV2.tsx
|
|
@@ -48679,7 +48735,7 @@ var SynapseTable = class extends React350.Component {
|
|
|
48679
48735
|
createTableRows(rows, headers, isShowingAccessColumn, isShowingDownloadColumn, isShowingAddToV2DownloadListColumn, isRowSelectionVisible) {
|
|
48680
48736
|
const rowsFormatted = [];
|
|
48681
48737
|
const {
|
|
48682
|
-
queryContext: { data, selectedRows, setSelectedRows },
|
|
48738
|
+
queryContext: { data, selectedRows, setSelectedRows, getIsRowSelected },
|
|
48683
48739
|
queryVisualizationContext: { columnsToShowInTable },
|
|
48684
48740
|
columnLinks = []
|
|
48685
48741
|
} = this.props;
|
|
@@ -48787,14 +48843,14 @@ var SynapseTable = class extends React350.Component {
|
|
|
48787
48843
|
Checkbox,
|
|
48788
48844
|
{
|
|
48789
48845
|
label: "",
|
|
48790
|
-
checked:
|
|
48846
|
+
checked: getIsRowSelected(row),
|
|
48791
48847
|
onChange: (checked) => {
|
|
48792
48848
|
const cloneSelectedRows = [...selectedRows];
|
|
48793
48849
|
if (checked) {
|
|
48794
48850
|
cloneSelectedRows.push(row);
|
|
48795
48851
|
} else {
|
|
48796
48852
|
const index = cloneSelectedRows.findIndex(
|
|
48797
|
-
(selectedRow) =>
|
|
48853
|
+
(selectedRow) => isEqual5(selectedRow, row)
|
|
48798
48854
|
);
|
|
48799
48855
|
if (index > -1) {
|
|
48800
48856
|
cloneSelectedRows.splice(index, 1);
|
|
@@ -52490,16 +52546,16 @@ function ChallengeDetailPage({ projectId }) {
|
|
|
52490
52546
|
}
|
|
52491
52547
|
|
|
52492
52548
|
// src/components/ChallengeDataDownload/ChallengeDataDownload.tsx
|
|
52493
|
-
import React441, { useCallback as
|
|
52549
|
+
import React441, { useCallback as useCallback29 } from "react";
|
|
52494
52550
|
import AddCircleTwoToneIcon from "@mui/icons-material/AddCircleTwoTone";
|
|
52495
52551
|
|
|
52496
52552
|
// src/components/EntityFinder/useEntitySelection.ts
|
|
52497
|
-
import { useCallback as
|
|
52553
|
+
import { useCallback as useCallback27, useReducer } from "react";
|
|
52498
52554
|
import { Map as Map2 } from "immutable";
|
|
52499
52555
|
|
|
52500
52556
|
// src/components/EntityFinder/EntityFinder.tsx
|
|
52501
52557
|
import pluralize5 from "pluralize";
|
|
52502
|
-
import React437, { useCallback as
|
|
52558
|
+
import React437, { useCallback as useCallback26, useEffect as useEffect81, useMemo as useMemo42, useRef as useRef43, useState as useState113 } from "react";
|
|
52503
52559
|
import ArrowBackOutlinedIcon from "@mui/icons-material/ArrowBackOutlined";
|
|
52504
52560
|
import ClearIcon from "@mui/icons-material/Clear";
|
|
52505
52561
|
import SearchIcon2 from "@mui/icons-material/Search";
|
|
@@ -52546,7 +52602,7 @@ import BaseTable, {
|
|
|
52546
52602
|
AutoResizer,
|
|
52547
52603
|
Column
|
|
52548
52604
|
} from "@sage-bionetworks/react-base-table";
|
|
52549
|
-
import React428, { useCallback as
|
|
52605
|
+
import React428, { useCallback as useCallback23, useEffect as useEffect77, useMemo as useMemo40, useState as useState107 } from "react";
|
|
52550
52606
|
import { useQueryClient as useQueryClient10 } from "react-query";
|
|
52551
52607
|
|
|
52552
52608
|
// src/components/EntityFinder/details/view/DetailsViewTableRenderers.tsx
|
|
@@ -52605,7 +52661,7 @@ import React424, { useRef as useRef42, useState as useState105 } from "react";
|
|
|
52605
52661
|
// src/components/SchemaDrivenAnnotationEditor/SchemaDrivenAnnotationEditor.tsx
|
|
52606
52662
|
import Form4 from "@rjsf/mui";
|
|
52607
52663
|
import isEmpty6 from "lodash-es/isEmpty";
|
|
52608
|
-
import React421, { useCallback as
|
|
52664
|
+
import React421, { useCallback as useCallback22, useEffect as useEffect74, useMemo as useMemo39, useRef as useRef41 } from "react";
|
|
52609
52665
|
|
|
52610
52666
|
// src/assets/icons/AddToList.tsx
|
|
52611
52667
|
import React401 from "react";
|
|
@@ -52626,7 +52682,7 @@ var AddToList = (props) => {
|
|
|
52626
52682
|
var AddToList_default = AddToList;
|
|
52627
52683
|
|
|
52628
52684
|
// src/components/SchemaDrivenAnnotationEditor/field/AdditionalPropertiesSchemaField.tsx
|
|
52629
|
-
import { isEqual as
|
|
52685
|
+
import { isEqual as isEqual6 } from "lodash-es";
|
|
52630
52686
|
import React403, { useEffect as useEffect71, useState as useState101 } from "react";
|
|
52631
52687
|
|
|
52632
52688
|
// src/components/SchemaDrivenAnnotationEditor/AnnotationEditorUtils.ts
|
|
@@ -52814,7 +52870,7 @@ function AdditionalPropertiesSchemaField(props) {
|
|
|
52814
52870
|
nextPropertyType
|
|
52815
52871
|
);
|
|
52816
52872
|
if (dataIsEmpty || nextPropertyType !== propertyType) {
|
|
52817
|
-
if (
|
|
52873
|
+
if (isEqual6(formData, coercedList)) {
|
|
52818
52874
|
setPropertyType(nextPropertyType);
|
|
52819
52875
|
}
|
|
52820
52876
|
}
|
|
@@ -53720,7 +53776,7 @@ function SchemaDrivenAnnotationEditor(props) {
|
|
|
53720
53776
|
() => getPatternPropertiesBannedKeys(entityJson?.concreteType),
|
|
53721
53777
|
[entityJson?.concreteType]
|
|
53722
53778
|
);
|
|
53723
|
-
const transformErrors =
|
|
53779
|
+
const transformErrors = useCallback22(
|
|
53724
53780
|
getTransformErrors(entityJson?.concreteType),
|
|
53725
53781
|
[entityJson?.concreteType]
|
|
53726
53782
|
);
|
|
@@ -54752,7 +54808,7 @@ var DetailsView = ({
|
|
|
54752
54808
|
selectableTypes,
|
|
54753
54809
|
visibleTypes
|
|
54754
54810
|
]);
|
|
54755
|
-
const NameRenderer =
|
|
54811
|
+
const NameRenderer = useCallback23(
|
|
54756
54812
|
(props) => {
|
|
54757
54813
|
if (setCurrentContainer && isContainerType(props.rowData.entityType)) {
|
|
54758
54814
|
return /* @__PURE__ */ React428.createElement(
|
|
@@ -55279,7 +55335,7 @@ var EntityPathDisplay = ({ entity, toggleSelection }) => {
|
|
|
55279
55335
|
|
|
55280
55336
|
// src/components/EntityFinder/tree/EntityTree.tsx
|
|
55281
55337
|
import React436, {
|
|
55282
|
-
useCallback as
|
|
55338
|
+
useCallback as useCallback25,
|
|
55283
55339
|
useEffect as useEffect80,
|
|
55284
55340
|
useMemo as useMemo41,
|
|
55285
55341
|
useState as useState112
|
|
@@ -55289,7 +55345,7 @@ import { Dropdown as Dropdown6 } from "react-bootstrap";
|
|
|
55289
55345
|
// src/components/EntityFinder/tree/VirtualizedTree.tsx
|
|
55290
55346
|
import { cloneDeep as cloneDeep7 } from "lodash-es";
|
|
55291
55347
|
import dayjs18 from "dayjs";
|
|
55292
|
-
import React435, { useCallback as
|
|
55348
|
+
import React435, { useCallback as useCallback24, useEffect as useEffect79, useState as useState111 } from "react";
|
|
55293
55349
|
import { useInView as useInView8 } from "react-intersection-observer";
|
|
55294
55350
|
import AutoSizer from "react-virtualized-auto-sizer";
|
|
55295
55351
|
import {
|
|
@@ -55400,7 +55456,7 @@ function Node4(props) {
|
|
|
55400
55456
|
getNextPageOfChildren();
|
|
55401
55457
|
}
|
|
55402
55458
|
}, [node, inView, getNextPageOfChildren]);
|
|
55403
|
-
const toggleExpand =
|
|
55459
|
+
const toggleExpand = useCallback24(async () => {
|
|
55404
55460
|
if (hasMoreChildren(node)) {
|
|
55405
55461
|
setLoading(true);
|
|
55406
55462
|
await getNextPageOfChildren();
|
|
@@ -55556,7 +55612,7 @@ var VirtualizedTree = (props) => {
|
|
|
55556
55612
|
useEffect79(() => {
|
|
55557
55613
|
setRootNode(rootNodeConfiguration);
|
|
55558
55614
|
}, [rootNodeConfiguration, rootNodeConfiguration.children]);
|
|
55559
|
-
const itemSize =
|
|
55615
|
+
const itemSize = useCallback24(
|
|
55560
55616
|
(index) => {
|
|
55561
55617
|
if (index === 0 && !rootNodeConfiguration.show) {
|
|
55562
55618
|
return 0;
|
|
@@ -55565,7 +55621,7 @@ var VirtualizedTree = (props) => {
|
|
|
55565
55621
|
},
|
|
55566
55622
|
[treeNodeType, rootNodeConfiguration.show]
|
|
55567
55623
|
);
|
|
55568
|
-
const fetchNextPageOfChildren =
|
|
55624
|
+
const fetchNextPageOfChildren = useCallback24(
|
|
55569
55625
|
// Because we update the root node with a copy at the end of this function, we can write to the node under update.
|
|
55570
55626
|
async (node) => {
|
|
55571
55627
|
const children = await synapse_client_default.getEntityChildren(
|
|
@@ -55586,7 +55642,7 @@ var VirtualizedTree = (props) => {
|
|
|
55586
55642
|
},
|
|
55587
55643
|
[rootNode, accessToken, visibleTypes]
|
|
55588
55644
|
);
|
|
55589
|
-
const memoizedTreeWalker =
|
|
55645
|
+
const memoizedTreeWalker = useCallback24(
|
|
55590
55646
|
getTreeWalkerFunction(
|
|
55591
55647
|
rootNode,
|
|
55592
55648
|
setSelectedId,
|
|
@@ -55684,7 +55740,7 @@ function EntityTree(props) {
|
|
|
55684
55740
|
setDetailsViewConfiguration(DEFAULT_CONFIGURATION);
|
|
55685
55741
|
}
|
|
55686
55742
|
}, []);
|
|
55687
|
-
const setSelectedId =
|
|
55743
|
+
const setSelectedId = useCallback25(
|
|
55688
55744
|
(entityId) => {
|
|
55689
55745
|
if (toggleSelection) {
|
|
55690
55746
|
toggleSelection({ targetId: entityId });
|
|
@@ -55893,7 +55949,7 @@ function EntityTree(props) {
|
|
|
55893
55949
|
fetchNextPageProjects
|
|
55894
55950
|
]
|
|
55895
55951
|
);
|
|
55896
|
-
const shouldAutoExpand =
|
|
55952
|
+
const shouldAutoExpand = useCallback25(
|
|
55897
55953
|
(entityId) => {
|
|
55898
55954
|
if (entityId === "root") {
|
|
55899
55955
|
return true;
|
|
@@ -55995,7 +56051,7 @@ var EntityFinder = ({
|
|
|
55995
56051
|
);
|
|
55996
56052
|
const [currentContainer, setCurrentContainer] = useState113(initialContainer);
|
|
55997
56053
|
const handleError = useErrorHandler4();
|
|
55998
|
-
const setBreadcrumbs =
|
|
56054
|
+
const setBreadcrumbs = useCallback26(
|
|
55999
56055
|
(items) => {
|
|
56000
56056
|
setBreadcrumbsProps({
|
|
56001
56057
|
items
|
|
@@ -56004,13 +56060,13 @@ var EntityFinder = ({
|
|
|
56004
56060
|
[setBreadcrumbsProps]
|
|
56005
56061
|
);
|
|
56006
56062
|
const [selectedEntities, toggleSelection] = useEntitySelection(selectMultiple);
|
|
56007
|
-
const isIdSelected =
|
|
56063
|
+
const isIdSelected = useCallback26(
|
|
56008
56064
|
(entity) => {
|
|
56009
56065
|
return selectedEntities.has(entity.id);
|
|
56010
56066
|
},
|
|
56011
56067
|
[selectedEntities]
|
|
56012
56068
|
);
|
|
56013
|
-
const isSelectable =
|
|
56069
|
+
const isSelectable = useCallback26(
|
|
56014
56070
|
(entity) => {
|
|
56015
56071
|
const type = getEntityTypeFromHeader(entity);
|
|
56016
56072
|
return selectableTypes.includes(type);
|
|
@@ -56233,7 +56289,7 @@ var EntityFinder_default = EntityFinder;
|
|
|
56233
56289
|
|
|
56234
56290
|
// src/components/EntityFinder/useEntitySelection.ts
|
|
56235
56291
|
function useEntitySelection(selectMultiple) {
|
|
56236
|
-
const isSelected =
|
|
56292
|
+
const isSelected = useCallback27(
|
|
56237
56293
|
(entity, selected) => {
|
|
56238
56294
|
const match = selected.get(entity.targetId);
|
|
56239
56295
|
if (match == null) {
|
|
@@ -56246,7 +56302,7 @@ function useEntitySelection(selectMultiple) {
|
|
|
56246
56302
|
},
|
|
56247
56303
|
[]
|
|
56248
56304
|
);
|
|
56249
|
-
const entitySelectionReducer =
|
|
56305
|
+
const entitySelectionReducer = useCallback27(
|
|
56250
56306
|
(selected, toggledReferences) => {
|
|
56251
56307
|
const newSelected = selected.withMutations((map) => {
|
|
56252
56308
|
if (!Array.isArray(toggledReferences)) {
|
|
@@ -56281,7 +56337,7 @@ import BaseTable2, {
|
|
|
56281
56337
|
AutoResizer as AutoResizer2,
|
|
56282
56338
|
Column as Column2
|
|
56283
56339
|
} from "@sage-bionetworks/react-base-table";
|
|
56284
|
-
import React439, { useCallback as
|
|
56340
|
+
import React439, { useCallback as useCallback28, useEffect as useEffect82, useMemo as useMemo43, useState as useState114 } from "react";
|
|
56285
56341
|
import { useQueryClient as useQueryClient11 } from "react-query";
|
|
56286
56342
|
|
|
56287
56343
|
// src/components/ChallengeDataDownload/Renderers.tsx
|
|
@@ -56494,7 +56550,7 @@ var ChallengeDataTable = ({
|
|
|
56494
56550
|
selectableTypes,
|
|
56495
56551
|
visibleTypes
|
|
56496
56552
|
]);
|
|
56497
|
-
const NameRenderer =
|
|
56553
|
+
const NameRenderer = useCallback28(
|
|
56498
56554
|
(props) => {
|
|
56499
56555
|
if (setCurrentContainer && isContainerType(props.rowData.entityType)) {
|
|
56500
56556
|
return /* @__PURE__ */ React439.createElement(
|
|
@@ -56750,13 +56806,13 @@ function ChallengeDataDownload({
|
|
|
56750
56806
|
);
|
|
56751
56807
|
}
|
|
56752
56808
|
});
|
|
56753
|
-
const isIdSelected =
|
|
56809
|
+
const isIdSelected = useCallback29(
|
|
56754
56810
|
(entity) => {
|
|
56755
56811
|
return selectedEntities.has(entity.id);
|
|
56756
56812
|
},
|
|
56757
56813
|
[selectedEntities]
|
|
56758
56814
|
);
|
|
56759
|
-
const onAddClick =
|
|
56815
|
+
const onAddClick = useCallback29(() => {
|
|
56760
56816
|
const entities = selectedEntities.toArray().map((entity) => {
|
|
56761
56817
|
return {
|
|
56762
56818
|
fileEntityId: entity[0],
|
|
@@ -59103,7 +59159,7 @@ import { Card as Card3, Col as Col3, Form as Form8, FormControl as FormControl4,
|
|
|
59103
59159
|
import dayjs22 from "dayjs";
|
|
59104
59160
|
|
|
59105
59161
|
// src/components/Evaluation/round_limits/EvaluationRoundLimitOptionsList.tsx
|
|
59106
|
-
import React462, { useCallback as
|
|
59162
|
+
import React462, { useCallback as useCallback30, useEffect as useEffect91 } from "react";
|
|
59107
59163
|
import { CloseTwoTone as CloseTwoTone2, AddBox } from "@mui/icons-material";
|
|
59108
59164
|
|
|
59109
59165
|
// src/components/Evaluation/round_limits/EvaluationRoundLimitOptions.tsx
|
|
@@ -59169,7 +59225,7 @@ var EvaluationRoundLimitOptionsList = ({ limitInputs, handleChange, handleDelete
|
|
|
59169
59225
|
const selectedTypes = new Set(
|
|
59170
59226
|
limitInputs.map((limit) => limit.type)
|
|
59171
59227
|
);
|
|
59172
|
-
const addNewLimit =
|
|
59228
|
+
const addNewLimit = useCallback30(() => {
|
|
59173
59229
|
onAddNewLimit({
|
|
59174
59230
|
type: selectUnusedType(selectedTypes),
|
|
59175
59231
|
maxSubmissionString: ""
|
|
@@ -60528,7 +60584,7 @@ function useDeleteReply(options2) {
|
|
|
60528
60584
|
}
|
|
60529
60585
|
|
|
60530
60586
|
// src/synapse-queries/forum/useThread.ts
|
|
60531
|
-
import { useCallback as
|
|
60587
|
+
import { useCallback as useCallback31 } from "react";
|
|
60532
60588
|
import {
|
|
60533
60589
|
useQuery as useQuery31,
|
|
60534
60590
|
useQueryClient as useQueryClient14,
|
|
@@ -60542,7 +60598,7 @@ function useGetThread(threadId) {
|
|
|
60542
60598
|
);
|
|
60543
60599
|
const { mutate: pinThread2 } = usePinThread();
|
|
60544
60600
|
const { mutate: unPinThread2 } = useUnPinThread();
|
|
60545
|
-
const togglePin =
|
|
60601
|
+
const togglePin = useCallback31(() => {
|
|
60546
60602
|
if (threadData) {
|
|
60547
60603
|
if (threadData?.isPinned) {
|
|
60548
60604
|
unPinThread2(threadData);
|
|
@@ -60739,13 +60795,13 @@ import { FormControl as FormControl5 } from "react-bootstrap";
|
|
|
60739
60795
|
import React478, { useRef as useRef44, useState as useState135, useEffect as useEffect98 } from "react";
|
|
60740
60796
|
|
|
60741
60797
|
// src/components/Markdown/UserMentionModal.tsx
|
|
60742
|
-
import React477, { useCallback as
|
|
60798
|
+
import React477, { useCallback as useCallback32 } from "react";
|
|
60743
60799
|
var UserMentionModal = ({
|
|
60744
60800
|
show,
|
|
60745
60801
|
onClose,
|
|
60746
60802
|
handleUserTag
|
|
60747
60803
|
}) => {
|
|
60748
|
-
const onUserChange =
|
|
60804
|
+
const onUserChange = useCallback32(
|
|
60749
60805
|
(selected, header) => {
|
|
60750
60806
|
if (selected && header) {
|
|
60751
60807
|
handleUserTag(header.userName);
|
|
@@ -61073,7 +61129,7 @@ import {
|
|
|
61073
61129
|
useQuery as useQuery32,
|
|
61074
61130
|
useQueryClient as useQueryClient15
|
|
61075
61131
|
} from "react-query";
|
|
61076
|
-
import { useCallback as
|
|
61132
|
+
import { useCallback as useCallback33 } from "react";
|
|
61077
61133
|
function useGetSubscribers(topic, options2) {
|
|
61078
61134
|
const { accessToken, keyFactory } = useSynapseContext();
|
|
61079
61135
|
return useQuery32(
|
|
@@ -61224,7 +61280,7 @@ var useSubscription = (objectId, objectType) => {
|
|
|
61224
61280
|
const { mutate: postSubscription2, isLoading: isLoadingPost } = usePostSubscription();
|
|
61225
61281
|
const { mutate: deleteSubscription2, isLoading: isLoadingDelete } = useDeleteSubscription();
|
|
61226
61282
|
const isLoading = isLoadingGet || isLoadingPost || isLoadingDelete;
|
|
61227
|
-
const toggleSubscribed =
|
|
61283
|
+
const toggleSubscribed = useCallback33(() => {
|
|
61228
61284
|
if (subscription) {
|
|
61229
61285
|
deleteSubscription2(subscription);
|
|
61230
61286
|
} else {
|
|
@@ -61916,7 +61972,7 @@ var Goals = (props) => {
|
|
|
61916
61972
|
|
|
61917
61973
|
// src/components/GoogleMap/GoogleMap.tsx
|
|
61918
61974
|
import { GoogleMap, LoadScript } from "@react-google-maps/api";
|
|
61919
|
-
import React490, { useCallback as
|
|
61975
|
+
import React490, { useCallback as useCallback34, useMemo as useMemo45, useState as useState143 } from "react";
|
|
61920
61976
|
import { useQuery as useQuery34 } from "react-query";
|
|
61921
61977
|
|
|
61922
61978
|
// src/components/GoogleMap/SynapseUserMarker.tsx
|
|
@@ -61973,7 +62029,7 @@ function Map3(props) {
|
|
|
61973
62029
|
},
|
|
61974
62030
|
{ useErrorBoundary: true }
|
|
61975
62031
|
);
|
|
61976
|
-
const onLoad =
|
|
62032
|
+
const onLoad = useCallback34(
|
|
61977
62033
|
function callback(map) {
|
|
61978
62034
|
if (geoData) {
|
|
61979
62035
|
const bounds = new google.maps.LatLngBounds();
|