synapse-react-client 4.0.21 → 4.0.23
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/SWC.index.d.ts +1 -0
- package/dist/SWC.index.d.ts.map +1 -1
- package/dist/SWC.index.js +2 -1
- package/dist/SWC.index.js.map +1 -1
- package/dist/assets/icons/GeneticsIcon.d.ts +3 -0
- package/dist/assets/icons/GeneticsIcon.d.ts.map +1 -0
- package/dist/assets/icons/GeneticsIcon.js +14 -0
- package/dist/assets/icons/GeneticsIcon.js.map +1 -0
- package/dist/components/CardContainer/CardContainer.d.ts.map +1 -1
- package/dist/components/CardContainer/CardContainer.js +43 -49
- package/dist/components/CardContainer/CardContainer.js.map +1 -1
- package/dist/components/CardContainerLogic/CardContainerLogic.d.ts +13 -0
- package/dist/components/CardContainerLogic/CardContainerLogic.d.ts.map +1 -1
- package/dist/components/CardContainerLogic/CardContainerLogic.js +64 -40
- package/dist/components/CardContainerLogic/CardContainerLogic.js.map +1 -1
- package/dist/components/ChallengeSubmission/ChallengeSubmissionStepper.js +1 -1
- package/dist/components/ChallengeSubmission/ChallengeSubmissionStepper.js.map +1 -1
- package/dist/components/DataExplorer/DataExplorer.css +1 -1
- package/dist/components/DataExplorer/DataExplorer.module.js +16 -16
- package/dist/components/DataExplorer/DataExplorer.module.js.map +1 -1
- package/dist/components/DataExplorer/DataExplorer.module.scss +0 -1
- package/dist/components/DataGrid/DataGrid.d.ts +1 -0
- package/dist/components/DataGrid/DataGrid.d.ts.map +1 -1
- package/dist/components/DataGrid/DataGrid.js +72 -72
- package/dist/components/DataGrid/DataGrid.js.map +1 -1
- package/dist/components/DataGrid/SynapseGrid.d.ts.map +1 -1
- package/dist/components/DataGrid/SynapseGrid.js +209 -206
- package/dist/components/DataGrid/SynapseGrid.js.map +1 -1
- package/dist/components/DataGrid/components/ColumnHeaderWithTooltip.d.ts +2 -1
- package/dist/components/DataGrid/components/ColumnHeaderWithTooltip.d.ts.map +1 -1
- package/dist/components/DataGrid/components/ColumnHeaderWithTooltip.js +51 -42
- package/dist/components/DataGrid/components/ColumnHeaderWithTooltip.js.map +1 -1
- package/dist/components/DataGrid/useDataGridWebsocket.d.ts.map +1 -1
- package/dist/components/DataGrid/useDataGridWebsocket.js +68 -67
- package/dist/components/DataGrid/useDataGridWebsocket.js.map +1 -1
- package/dist/components/DataGrid/utils/columnFactory.d.ts +1 -0
- package/dist/components/DataGrid/utils/columnFactory.d.ts.map +1 -1
- package/dist/components/DataGrid/utils/columnFactory.js +4 -3
- package/dist/components/DataGrid/utils/columnFactory.js.map +1 -1
- package/dist/components/DataGrid/utils/modelColsToGrid.d.ts +1 -1
- package/dist/components/DataGrid/utils/modelColsToGrid.d.ts.map +1 -1
- package/dist/components/DataGrid/utils/modelColsToGrid.js +15 -14
- package/dist/components/DataGrid/utils/modelColsToGrid.js.map +1 -1
- package/dist/components/DataGrid/utils/normalizeWebsocketError.d.ts +7 -0
- package/dist/components/DataGrid/utils/normalizeWebsocketError.d.ts.map +1 -0
- package/dist/components/DataGrid/utils/normalizeWebsocketError.js +8 -0
- package/dist/components/DataGrid/utils/normalizeWebsocketError.js.map +1 -0
- package/dist/components/EntityCitation/EntityCitation.d.ts.map +1 -1
- package/dist/components/EntityCitation/EntityCitation.js +23 -8
- package/dist/components/EntityCitation/EntityCitation.js.map +1 -1
- package/dist/components/GenericCard/DuoTermTags/DuoTermTags.d.ts +18 -0
- package/dist/components/GenericCard/DuoTermTags/DuoTermTags.d.ts.map +1 -0
- package/dist/components/GenericCard/DuoTermTags/DuoTermTags.js +112 -0
- package/dist/components/GenericCard/DuoTermTags/DuoTermTags.js.map +1 -0
- package/dist/components/GenericCard/DuoTermTags/duoTerms.d.ts +31 -0
- package/dist/components/GenericCard/DuoTermTags/duoTerms.d.ts.map +1 -0
- package/dist/components/GenericCard/DuoTermTags/duoTerms.js +198 -0
- package/dist/components/GenericCard/DuoTermTags/duoTerms.js.map +1 -0
- package/dist/components/GenericCard/SynapseCardLabel.d.ts.map +1 -1
- package/dist/components/GenericCard/SynapseCardLabel.js +4 -8
- package/dist/components/GenericCard/SynapseCardLabel.js.map +1 -1
- package/dist/components/GenericCard/TableRowGenericCard.d.ts +6 -0
- package/dist/components/GenericCard/TableRowGenericCard.d.ts.map +1 -1
- package/dist/components/GenericCard/TableRowGenericCard.js +168 -153
- package/dist/components/GenericCard/TableRowGenericCard.js.map +1 -1
- package/dist/components/Goals/Goals.d.ts +8 -0
- package/dist/components/Goals/Goals.d.ts.map +1 -1
- package/dist/components/Goals/Goals.js +54 -40
- package/dist/components/Goals/Goals.js.map +1 -1
- package/dist/components/IconSvg/IconSvg.d.ts +1 -1
- package/dist/components/IconSvg/IconSvg.d.ts.map +1 -1
- package/dist/components/IconSvg/IconSvg.js +19 -18
- package/dist/components/IconSvg/IconSvg.js.map +1 -1
- package/dist/components/ProjectVisibilityChip/ProjectVisibilityChip.d.ts +9 -0
- package/dist/components/ProjectVisibilityChip/ProjectVisibilityChip.d.ts.map +1 -0
- package/dist/components/ProjectVisibilityChip/ProjectVisibilityChip.js +69 -0
- package/dist/components/ProjectVisibilityChip/ProjectVisibilityChip.js.map +1 -0
- package/dist/components/ProjectVisibilityChip/getProjectVisibilityFromACL.d.ts +13 -0
- package/dist/components/ProjectVisibilityChip/getProjectVisibilityFromACL.d.ts.map +1 -0
- package/dist/components/ProjectVisibilityChip/getProjectVisibilityFromACL.js +11 -0
- package/dist/components/ProjectVisibilityChip/getProjectVisibilityFromACL.js.map +1 -0
- package/dist/components/ProjectVisibilityChip/index.d.ts +5 -0
- package/dist/components/ProjectVisibilityChip/index.d.ts.map +1 -0
- package/dist/components/ProjectVisibilityChip/index.js +7 -0
- package/dist/components/ProjectVisibilityChip/index.js.map +1 -0
- package/dist/components/QueryVisualizationWrapper/QueryVisualizationContext.d.ts +21 -0
- package/dist/components/QueryVisualizationWrapper/QueryVisualizationContext.d.ts.map +1 -1
- package/dist/components/QueryVisualizationWrapper/QueryVisualizationContext.js.map +1 -1
- package/dist/components/QueryVisualizationWrapper/QueryVisualizationWrapper.d.ts +10 -0
- package/dist/components/QueryVisualizationWrapper/QueryVisualizationWrapper.d.ts.map +1 -1
- package/dist/components/QueryVisualizationWrapper/QueryVisualizationWrapper.js +66 -60
- package/dist/components/QueryVisualizationWrapper/QueryVisualizationWrapper.js.map +1 -1
- package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.d.ts +1 -1
- package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.d.ts.map +1 -1
- package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.js +2 -0
- package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.js.map +1 -1
- package/dist/components/QueryWrapperPlotNav/RowSetView.d.ts.map +1 -1
- package/dist/components/QueryWrapperPlotNav/RowSetView.js +9 -12
- package/dist/components/QueryWrapperPlotNav/RowSetView.js.map +1 -1
- package/dist/components/RssFeedCards/RssFeedCards.d.ts +7 -15
- package/dist/components/RssFeedCards/RssFeedCards.d.ts.map +1 -1
- package/dist/components/RssFeedCards/RssFeedCards.js +114 -123
- package/dist/components/RssFeedCards/RssFeedCards.js.map +1 -1
- package/dist/components/SearchQueryWrapper/SearchQueryUseQueryOptions.d.ts +33 -6
- package/dist/components/SearchQueryWrapper/SearchQueryUseQueryOptions.d.ts.map +1 -1
- package/dist/components/SearchQueryWrapper/SearchQueryUseQueryOptions.js +93 -55
- package/dist/components/SearchQueryWrapper/SearchQueryUseQueryOptions.js.map +1 -1
- package/dist/components/SearchQueryWrapper/SearchQueryWrapper.d.ts +3 -0
- package/dist/components/SearchQueryWrapper/SearchQueryWrapper.d.ts.map +1 -1
- package/dist/components/SearchQueryWrapper/SearchQueryWrapper.js +39 -37
- package/dist/components/SearchQueryWrapper/SearchQueryWrapper.js.map +1 -1
- package/dist/components/SearchQueryWrapperPlotNav/SearchQueryWrapperPlotNav.d.ts +3 -1
- package/dist/components/SearchQueryWrapperPlotNav/SearchQueryWrapperPlotNav.d.ts.map +1 -1
- package/dist/components/SearchQueryWrapperPlotNav/SearchQueryWrapperPlotNav.js +4 -0
- package/dist/components/SearchQueryWrapperPlotNav/SearchQueryWrapperPlotNav.js.map +1 -1
- package/dist/components/UserCardList/UserCardList.d.ts +2 -20
- package/dist/components/UserCardList/UserCardList.d.ts.map +1 -1
- package/dist/components/UserCardList/UserCardList.js +49 -72
- package/dist/components/UserCardList/UserCardList.js.map +1 -1
- package/dist/components/UserCardList/UserCardListRotate.d.ts +13 -0
- package/dist/components/UserCardList/UserCardListRotate.d.ts.map +1 -1
- package/dist/components/UserCardList/UserCardListRotate.js +82 -57
- package/dist/components/UserCardList/UserCardListRotate.js.map +1 -1
- package/dist/components/entity/page/action_menu/EntityActionMenu.d.ts +5 -2
- package/dist/components/entity/page/action_menu/EntityActionMenu.d.ts.map +1 -1
- package/dist/components/entity/page/action_menu/EntityActionMenu.js +68 -51
- package/dist/components/entity/page/action_menu/EntityActionMenu.js.map +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/menu/ComplexMenu.d.ts +8 -1
- package/dist/components/menu/ComplexMenu.d.ts.map +1 -1
- package/dist/components/menu/ComplexMenu.js +50 -20
- package/dist/components/menu/ComplexMenu.js.map +1 -1
- package/dist/components/widgets/facet-nav/FacetValueChip.d.ts +25 -0
- package/dist/components/widgets/facet-nav/FacetValueChip.d.ts.map +1 -0
- package/dist/components/widgets/facet-nav/FacetValueChip.js +40 -0
- package/dist/components/widgets/facet-nav/FacetValueChip.js.map +1 -0
- package/dist/components/widgets/facet-nav/SelectionCriteriaPill.d.ts +10 -5
- package/dist/components/widgets/facet-nav/SelectionCriteriaPill.d.ts.map +1 -1
- package/dist/components/widgets/facet-nav/SelectionCriteriaPill.js +10 -17
- package/dist/components/widgets/facet-nav/SelectionCriteriaPill.js.map +1 -1
- package/dist/components/widgets/facet-nav/SelectionCriteriaPills.d.ts.map +1 -1
- package/dist/components/widgets/facet-nav/SelectionCriteriaPills.js +11 -10
- package/dist/components/widgets/facet-nav/SelectionCriteriaPills.js.map +1 -1
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilter.d.ts.map +1 -1
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilter.js +70 -54
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilter.js.map +1 -1
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterOption.d.ts +2 -1
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterOption.d.ts.map +1 -1
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterOption.js +17 -1
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterOption.js.map +1 -1
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterUI.d.ts +2 -0
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterUI.d.ts.map +1 -1
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterUI.js +7 -7
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterUI.js.map +1 -1
- package/dist/features/curator/dashboard/components/CurationTaskCard.d.ts.map +1 -1
- package/dist/features/curator/dashboard/components/CurationTaskCard.js +99 -45
- package/dist/features/curator/dashboard/components/CurationTaskCard.js.map +1 -1
- package/dist/features/entity/metadata-task/components/CreateOrUpdateCurationTaskDialog.d.ts.map +1 -1
- package/dist/features/entity/metadata-task/components/CreateOrUpdateCurationTaskDialog.js +174 -149
- package/dist/features/entity/metadata-task/components/CreateOrUpdateCurationTaskDialog.js.map +1 -1
- package/dist/features/entity/metadata-task/utils/constants.d.ts +6 -0
- package/dist/features/entity/metadata-task/utils/constants.d.ts.map +1 -1
- package/dist/features/entity/metadata-task/utils/constants.js +19 -2
- package/dist/features/entity/metadata-task/utils/constants.js.map +1 -1
- package/dist/style/abstracts/_cssVariables.scss +1 -0
- package/dist/style/components/_total-query-results.scss +10 -34
- package/dist/style/main.css +1 -1
- package/dist/synapse-queries/KeyFactory.d.ts +1 -0
- package/dist/synapse-queries/KeyFactory.d.ts.map +1 -1
- package/dist/synapse-queries/KeyFactory.js +3 -0
- package/dist/synapse-queries/KeyFactory.js.map +1 -1
- package/dist/synapse-queries/curation/task/useCurationTask.d.ts.map +1 -1
- package/dist/synapse-queries/curation/task/useCurationTask.js +1 -1
- package/dist/synapse-queries/curation/task/useCurationTask.js.map +1 -1
- package/dist/synapse-queries/index.js +46 -44
- package/dist/synapse-queries/user/index.js +3 -3
- package/dist/synapse-queries/user/useUserBundle.d.ts +12 -0
- package/dist/synapse-queries/user/useUserBundle.d.ts.map +1 -1
- package/dist/synapse-queries/user/useUserBundle.js +50 -36
- package/dist/synapse-queries/user/useUserBundle.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utils/AppUtils/session/SessionInitializedGuard.d.ts +10 -5
- package/dist/utils/AppUtils/session/SessionInitializedGuard.d.ts.map +1 -1
- package/dist/utils/AppUtils/session/SessionInitializedGuard.js +13 -9
- package/dist/utils/AppUtils/session/SessionInitializedGuard.js.map +1 -1
- package/dist/utils/functions/SqlFunctions.d.ts +1 -1
- package/dist/utils/functions/SqlFunctions.d.ts.map +1 -1
- package/dist/utils/functions/SqlFunctions.js +1 -1
- package/dist/utils/functions/SqlFunctions.js.map +1 -1
- package/package.json +4 -4
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
import { displayToast as e } from "../../../../components/ToastMessage/ToastMessage.js";
|
|
2
|
+
import t from "../../../../synapse-queries/entity/useEntityBundle.js";
|
|
2
3
|
import "../../../../components/index.js";
|
|
3
|
-
import { OPEN_CURATOR_NO_PERMISSION_ON_SOURCE_ERROR_MESSAGE as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
import p from "
|
|
4
|
+
import { OPEN_CURATOR_NO_PERMISSION_ON_SOURCE_ERROR_MESSAGE as n, TASK_STATUS_CONFIG as r } from "../../../entity/metadata-task/utils/constants.js";
|
|
5
|
+
import i from "../../../entity/metadata-task/hooks/useOpenCuratorButton.js";
|
|
6
|
+
import a from "../../../entity/metadata-task/components/CreateOrUpdateCurationTaskDialog.js";
|
|
7
|
+
import o from "./CurationTaskCard.module.js";
|
|
8
|
+
import s from "./NextStepButton.js";
|
|
9
|
+
import c from "./shared.module.js";
|
|
10
|
+
import l from "./UserOrTeamChip.js";
|
|
11
|
+
import { useState as u } from "react";
|
|
12
|
+
import { Box as d, Card as f, Chip as p, Divider as m, IconButton as h, Skeleton as g, Typography as _ } from "@mui/material";
|
|
13
|
+
import { jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
14
|
+
import b from "classnames";
|
|
15
|
+
import x from "@mui/icons-material/SettingsOutlined";
|
|
12
16
|
//#region src/features/curator/dashboard/components/CurationTaskCard.tsx
|
|
13
|
-
function
|
|
14
|
-
let { onClick:
|
|
17
|
+
function S(t) {
|
|
18
|
+
let { onClick: n, isLoading: r, isPending: a, hasPermission: o } = i(t);
|
|
15
19
|
if (!t.task || !t.status) throw Error("Task bundle is missing required properties");
|
|
16
20
|
switch (t.task?.taskProperties?.concreteType) {
|
|
17
21
|
case "org.sagebionetworks.repo.model.curation.metadata.FileBasedMetadataTaskProperties":
|
|
@@ -22,8 +26,9 @@ function m(t) {
|
|
|
22
26
|
principalIds: t.task.assigneePrincipalId ? [t.task.assigneePrincipalId] : [],
|
|
23
27
|
buttonText: "Open Curator",
|
|
24
28
|
taskType: "Curate Data",
|
|
25
|
-
|
|
26
|
-
|
|
29
|
+
statusState: t.status.state,
|
|
30
|
+
onClickNextStep: n,
|
|
31
|
+
isLoading: r,
|
|
27
32
|
isPending: a,
|
|
28
33
|
hasPermission: o
|
|
29
34
|
};
|
|
@@ -36,6 +41,7 @@ function m(t) {
|
|
|
36
41
|
principalIds: t.task.assigneePrincipalId ? [t.task.assigneePrincipalId] : [],
|
|
37
42
|
buttonText: "Continue",
|
|
38
43
|
taskType: "",
|
|
44
|
+
statusState: t.status.state,
|
|
39
45
|
onClickNextStep: () => {
|
|
40
46
|
e("No action defined for this task type", "danger", { title: "Unexpected Error" });
|
|
41
47
|
},
|
|
@@ -44,9 +50,9 @@ function m(t) {
|
|
|
44
50
|
hasPermission: void 0
|
|
45
51
|
};
|
|
46
52
|
}
|
|
47
|
-
function
|
|
53
|
+
function C(e) {
|
|
48
54
|
let { label: t } = e;
|
|
49
|
-
return /* @__PURE__ */
|
|
55
|
+
return /* @__PURE__ */ v(p, {
|
|
50
56
|
sx: {
|
|
51
57
|
fontWeight: 600,
|
|
52
58
|
backgroundColor: "#BFD3ED"
|
|
@@ -54,38 +60,81 @@ function h(e) {
|
|
|
54
60
|
label: t
|
|
55
61
|
});
|
|
56
62
|
}
|
|
57
|
-
function
|
|
58
|
-
let {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
+
function w(e) {
|
|
64
|
+
let { state: t } = e;
|
|
65
|
+
if (!t) return null;
|
|
66
|
+
let { label: n, backgroundColor: i } = r[t];
|
|
67
|
+
return /* @__PURE__ */ v(p, {
|
|
68
|
+
size: "small",
|
|
69
|
+
sx: {
|
|
70
|
+
fontWeight: 600,
|
|
71
|
+
backgroundColor: i
|
|
72
|
+
},
|
|
73
|
+
label: n
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
function T(r) {
|
|
77
|
+
let { taskBundle: i } = r, { title: p, description: T, taskId: E, taskType: D, principalIds: O, buttonText: k, statusState: A, onClickNextStep: j, hasPermission: M, isLoading: N, isPending: P } = S(i), [F, I] = u(!1), L = i.task?.projectId, { data: R } = t(L, void 0, {
|
|
78
|
+
includeEntity: !0,
|
|
79
|
+
includePermissions: !0
|
|
80
|
+
}), z = R?.permissions?.canEdit ?? !1;
|
|
81
|
+
function B() {
|
|
82
|
+
M ? j() : e(n, "danger");
|
|
83
|
+
}
|
|
84
|
+
return /* @__PURE__ */ y(f, {
|
|
85
|
+
className: b(c.card, o.card),
|
|
86
|
+
children: [/* @__PURE__ */ y("div", {
|
|
87
|
+
className: o.cardContent,
|
|
63
88
|
children: [
|
|
64
|
-
/* @__PURE__ */
|
|
65
|
-
className:
|
|
89
|
+
/* @__PURE__ */ y("div", {
|
|
90
|
+
className: o.mainContent,
|
|
66
91
|
children: [
|
|
67
|
-
/* @__PURE__ */
|
|
68
|
-
className:
|
|
92
|
+
/* @__PURE__ */ y("div", {
|
|
93
|
+
className: o.titleChipContainer,
|
|
69
94
|
children: [
|
|
70
|
-
/* @__PURE__ */
|
|
95
|
+
/* @__PURE__ */ v(_, {
|
|
71
96
|
variant: "headline3",
|
|
72
|
-
children:
|
|
97
|
+
children: p
|
|
73
98
|
}),
|
|
74
|
-
|
|
75
|
-
|
|
99
|
+
D && /* @__PURE__ */ v(C, { label: D }),
|
|
100
|
+
z && /* @__PURE__ */ v(h, {
|
|
101
|
+
onClick: () => I(!0),
|
|
102
|
+
"aria-label": "Task settings",
|
|
103
|
+
children: /* @__PURE__ */ v(x, {})
|
|
104
|
+
})
|
|
76
105
|
]
|
|
77
106
|
}),
|
|
78
|
-
/* @__PURE__ */ d
|
|
107
|
+
/* @__PURE__ */ y(d, {
|
|
108
|
+
sx: {
|
|
109
|
+
display: "flex",
|
|
110
|
+
gap: 4
|
|
111
|
+
},
|
|
112
|
+
children: [R?.entity?.name ? /* @__PURE__ */ v(_, {
|
|
113
|
+
variant: "body1",
|
|
114
|
+
children: R.entity.name
|
|
115
|
+
}) : /* @__PURE__ */ v(g, { width: 100 }), E && /* @__PURE__ */ y(_, {
|
|
116
|
+
variant: "body1",
|
|
117
|
+
children: ["Task ID: ", E]
|
|
118
|
+
})]
|
|
119
|
+
}),
|
|
120
|
+
T && /* @__PURE__ */ v(_, {
|
|
79
121
|
variant: "body1",
|
|
80
|
-
children:
|
|
122
|
+
children: T
|
|
81
123
|
}),
|
|
82
|
-
/* @__PURE__ */
|
|
83
|
-
className:
|
|
84
|
-
children:
|
|
124
|
+
/* @__PURE__ */ v("div", {
|
|
125
|
+
className: o.userChipContainer,
|
|
126
|
+
children: O.map((e) => /* @__PURE__ */ v(l, { principalId: e }, e))
|
|
85
127
|
})
|
|
86
128
|
]
|
|
87
129
|
}),
|
|
88
|
-
/* @__PURE__ */ d
|
|
130
|
+
/* @__PURE__ */ v(d, {
|
|
131
|
+
sx: {
|
|
132
|
+
display: "flex",
|
|
133
|
+
alignItems: "center"
|
|
134
|
+
},
|
|
135
|
+
children: /* @__PURE__ */ v(w, { state: A })
|
|
136
|
+
}),
|
|
137
|
+
/* @__PURE__ */ v(m, {
|
|
89
138
|
orientation: "vertical",
|
|
90
139
|
flexItem: !0,
|
|
91
140
|
sx: { display: {
|
|
@@ -93,20 +142,25 @@ function g(n) {
|
|
|
93
142
|
md: "block"
|
|
94
143
|
} }
|
|
95
144
|
}),
|
|
96
|
-
/* @__PURE__ */
|
|
97
|
-
className:
|
|
98
|
-
buttonText:
|
|
99
|
-
onClick:
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
disabled: w,
|
|
103
|
-
loading: T
|
|
145
|
+
/* @__PURE__ */ v(s, {
|
|
146
|
+
className: o.cardButton,
|
|
147
|
+
buttonText: k,
|
|
148
|
+
onClick: B,
|
|
149
|
+
disabled: N,
|
|
150
|
+
loading: P
|
|
104
151
|
})
|
|
105
152
|
]
|
|
106
|
-
})
|
|
153
|
+
}), /* @__PURE__ */ v(a, {
|
|
154
|
+
open: F,
|
|
155
|
+
onCancel: () => I(!1),
|
|
156
|
+
onSuccess: () => I(!1),
|
|
157
|
+
onDeleteSuccess: () => I(!1),
|
|
158
|
+
projectId: L ?? "",
|
|
159
|
+
task: i.task
|
|
160
|
+
}, String(F))]
|
|
107
161
|
});
|
|
108
162
|
}
|
|
109
163
|
//#endregion
|
|
110
|
-
export {
|
|
164
|
+
export { T as default };
|
|
111
165
|
|
|
112
166
|
//# sourceMappingURL=CurationTaskCard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CurationTaskCard.js","names":[],"sources":["../../../../../src/features/curator/dashboard/components/CurationTaskCard.tsx"],"sourcesContent":["import { displayToast } from '@/components'\nimport useOpenCuratorFromTaskButton from '@/features/entity/metadata-task/hooks/useOpenCuratorButton'\nimport { OPEN_CURATOR_NO_PERMISSION_ON_SOURCE_ERROR_MESSAGE } from '@/features/entity/metadata-task/utils/constants'\nimport {
|
|
1
|
+
{"version":3,"file":"CurationTaskCard.js","names":[],"sources":["../../../../../src/features/curator/dashboard/components/CurationTaskCard.tsx"],"sourcesContent":["import { displayToast } from '@/components'\nimport CreateOrUpdateCurationTaskDialog from '@/features/entity/metadata-task/components/CreateOrUpdateCurationTaskDialog'\nimport { TASK_STATUS_CONFIG } from '@/features/entity/metadata-task/utils/constants'\nimport useOpenCuratorFromTaskButton from '@/features/entity/metadata-task/hooks/useOpenCuratorButton'\nimport { OPEN_CURATOR_NO_PERMISSION_ON_SOURCE_ERROR_MESSAGE } from '@/features/entity/metadata-task/utils/constants'\nimport useGetEntityBundle from '@/synapse-queries/entity/useEntityBundle'\nimport {\n Box,\n Card,\n Chip,\n Divider,\n IconButton,\n Skeleton,\n Typography,\n} from '@mui/material'\nimport {\n TaskBundle,\n TaskStatusStateEnum,\n} from '@sage-bionetworks/synapse-client'\nimport classNames from 'classnames'\nimport styles from './CurationTaskCard.module.scss'\nimport NextStepButton from './NextStepButton'\nimport sharedStyles from './shared.module.scss'\nimport UserOrTeamChip from './UserOrTeamChip'\nimport SettingsOutlinedIcon from '@mui/icons-material/SettingsOutlined'\nimport { useState } from 'react'\n\nexport type CurationTaskCardProps = {\n taskBundle: TaskBundle\n}\n\nfunction useUiForTask(taskBundle: TaskBundle) {\n const { onClick, isLoading, isPending, hasPermission } =\n useOpenCuratorFromTaskButton(taskBundle)\n\n if (!taskBundle.task || !taskBundle.status) {\n throw new Error('Task bundle is missing required properties')\n }\n\n switch (taskBundle.task?.taskProperties?.concreteType) {\n case 'org.sagebionetworks.repo.model.curation.metadata.FileBasedMetadataTaskProperties':\n case 'org.sagebionetworks.repo.model.curation.metadata.RecordBasedMetadataTaskProperties':\n return {\n title: taskBundle.task.dataType,\n description: taskBundle.task.instructions ?? '',\n taskId: taskBundle.task.taskId,\n principalIds: taskBundle.task.assigneePrincipalId\n ? [taskBundle.task.assigneePrincipalId]\n : [],\n buttonText: 'Open Curator',\n taskType: 'Curate Data',\n statusState: taskBundle.status.state,\n onClickNextStep: onClick,\n isLoading,\n isPending,\n hasPermission,\n }\n default: {\n console.error(\n 'No UI implemented for task type: ' +\n // @ts-expect-error - the switch should be exhaustive for known types\n taskBundle.task?.taskProperties?.concreteType,\n )\n }\n }\n\n return {\n title: taskBundle.task.dataType,\n description: taskBundle.task.instructions ?? '',\n taskId: taskBundle.task.taskId!,\n principalIds: taskBundle.task.assigneePrincipalId\n ? [taskBundle.task.assigneePrincipalId]\n : [],\n buttonText: 'Continue',\n taskType: '',\n statusState: taskBundle.status.state,\n onClickNextStep: () => {\n displayToast('No action defined for this task type', 'danger', {\n title: 'Unexpected Error',\n })\n },\n isLoading: false,\n isPending: false,\n hasPermission: undefined,\n }\n}\n\nfunction TaskTypeChip(props: { label: string }) {\n const { label } = props\n return (\n <Chip sx={{ fontWeight: 600, backgroundColor: '#BFD3ED' }} label={label} />\n )\n}\n\nfunction TaskStatusChip(props: { state: TaskStatusStateEnum | undefined }) {\n const { state } = props\n if (!state) return null\n const { label, backgroundColor } = TASK_STATUS_CONFIG[state]\n return (\n <Chip\n size=\"small\"\n sx={{ fontWeight: 600, backgroundColor }}\n label={label}\n />\n )\n}\n\n/**\n * Card component for displaying a curation task on the curator dashboard. Shows relevant information about the task and includes a button to proceed to the next step in the workflow.\n */\nexport default function CurationTaskCard(props: CurationTaskCardProps) {\n const { taskBundle } = props\n const {\n title,\n description,\n taskId,\n taskType,\n principalIds,\n buttonText,\n statusState,\n onClickNextStep,\n hasPermission: hasPermissionToOpenGrid,\n isLoading,\n isPending,\n } = useUiForTask(taskBundle)\n\n const [isSettingsOpen, setIsSettingsOpen] = useState(false)\n\n const projectId = taskBundle.task?.projectId\n const { data: bundle } = useGetEntityBundle(projectId, undefined, {\n includeEntity: true,\n includePermissions: true,\n })\n const canEdit = bundle?.permissions?.canEdit ?? false\n\n function onClickAction() {\n if (hasPermissionToOpenGrid) {\n onClickNextStep()\n } else {\n displayToast(OPEN_CURATOR_NO_PERMISSION_ON_SOURCE_ERROR_MESSAGE, 'danger')\n }\n }\n\n return (\n <Card className={classNames(sharedStyles.card, styles.card)}>\n <div className={styles.cardContent}>\n <div className={styles.mainContent}>\n <div className={styles.titleChipContainer}>\n <Typography variant=\"headline3\">{title}</Typography>\n {taskType && <TaskTypeChip label={taskType} />}\n {canEdit && (\n <IconButton\n onClick={() => setIsSettingsOpen(true)}\n aria-label=\"Task settings\"\n >\n <SettingsOutlinedIcon />\n </IconButton>\n )}\n </div>\n <Box sx={{ display: 'flex', gap: 4 }}>\n {bundle?.entity?.name ? (\n <Typography variant=\"body1\">{bundle.entity.name}</Typography>\n ) : (\n <Skeleton width={100} />\n )}\n {taskId && (\n <Typography variant=\"body1\">Task ID: {taskId}</Typography>\n )}\n </Box>\n {description && (\n <Typography variant=\"body1\">{description}</Typography>\n )}\n <div className={styles.userChipContainer}>\n {principalIds.map(principalId => (\n <UserOrTeamChip key={principalId} principalId={principalId} />\n ))}\n </div>\n </div>\n <Box sx={{ display: 'flex', alignItems: 'center' }}>\n <TaskStatusChip state={statusState} />\n </Box>\n <Divider\n orientation=\"vertical\"\n flexItem\n sx={{ display: { xs: 'none', md: 'block' } }}\n />\n <NextStepButton\n className={styles.cardButton}\n buttonText={buttonText}\n onClick={onClickAction}\n disabled={isLoading}\n loading={isPending}\n />\n </div>\n <CreateOrUpdateCurationTaskDialog\n key={String(isSettingsOpen)}\n open={isSettingsOpen}\n onCancel={() => setIsSettingsOpen(false)}\n onSuccess={() => setIsSettingsOpen(false)}\n onDeleteSuccess={() => setIsSettingsOpen(false)}\n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D;OAAK,WAAW,EAAO;iBACpB,EAAa,KAAI,MAChB,kBAAC,GAAD,EAA+C,eAAc,GAAxC,CAAwC,CAC9D;MACE,CAAA;KACF;;IACL,kBAAC,GAAD;KAAK,IAAI;MAAE,SAAS;MAAQ,YAAY;KAAS;eAC/C,kBAAC,GAAD,EAAgB,OAAO,EAAc,CAAA;IAClC,CAAA;IACL,kBAAC,GAAD;KACE,aAAY;KACZ,UAAA;KACA,IAAI,EAAE,SAAS;MAAE,IAAI;MAAQ,IAAI;KAAQ,EAAE;IAC5C,CAAA;IACD,kBAAC,GAAD;KACE,WAAW,EAAO;KACN;KACZ,SAAS;KACT,UAAU;KACV,SAAS;IACV,CAAA;GACE;MACL,kBAAC,GAAD;GAEE,MAAM;GACN,gBAAgB,EAAkB,EAAK;GACvC,iBAAiB,EAAkB,EAAK;GACxC,uBAAuB,EAAkB,EAAK;GAC9C,WAAW,KAAa;GACxB,MAAM,EAAW;EAClB,GAPM,OAAO,CAAc,CAO3B,CACG;;AAEV"}
|
package/dist/features/entity/metadata-task/components/CreateOrUpdateCurationTaskDialog.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateOrUpdateCurationTaskDialog.d.ts","sourceRoot":"","sources":["../../../../../src/features/entity/metadata-task/components/CreateOrUpdateCurationTaskDialog.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CreateOrUpdateCurationTaskDialog.d.ts","sourceRoot":"","sources":["../../../../../src/features/entity/metadata-task/components/CreateOrUpdateCurationTaskDialog.tsx"],"names":[],"mappings":"AAuCA,OAAO,EACL,YAAY,EAMb,MAAM,kCAAkC,CAAA;AA6CzC,MAAM,MAAM,qCAAqC,GAAG;IAClD,IAAI,EAAE,OAAO,CAAA;IACb,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,SAAS,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAA;IACvC;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,IAAI,CAAA;IAC5B,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,YAAY,CAAA;CACpB,CAAA;AAsBD;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,gCAAgC,CACtD,KAAK,EAAE,qCAAqC,2CAsoB7C"}
|