@trops/dash-core 0.1.150 → 0.1.151
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.esm.js +20 -0
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -10743,9 +10743,14 @@ var PanelEditItemSchedule = function PanelEditItemSchedule(_ref2) {
|
|
|
10743
10743
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
10744
10744
|
taskStates = _useState12[0],
|
|
10745
10745
|
setTaskStates = _useState12[1];
|
|
10746
|
+
var _useState13 = React.useState(true),
|
|
10747
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
10748
|
+
isLoading = _useState14[0],
|
|
10749
|
+
setIsLoading = _useState14[1];
|
|
10746
10750
|
React.useEffect(function () {
|
|
10747
10751
|
var _window$mainApi4;
|
|
10748
10752
|
if (scheduledTaskDefs.length > 0 && widgetUuid && (_window$mainApi4 = window.mainApi) !== null && _window$mainApi4 !== void 0 && (_window$mainApi4 = _window$mainApi4.scheduler) !== null && _window$mainApi4 !== void 0 && _window$mainApi4.getTasks) {
|
|
10753
|
+
setIsLoading(true);
|
|
10749
10754
|
window.mainApi.scheduler.getTasks(widgetUuid).then(function (tasks) {
|
|
10750
10755
|
var stateMap = {};
|
|
10751
10756
|
var _iterator = _createForOfIteratorHelper$b(tasks || []),
|
|
@@ -10761,10 +10766,25 @@ var PanelEditItemSchedule = function PanelEditItemSchedule(_ref2) {
|
|
|
10761
10766
|
_iterator.f();
|
|
10762
10767
|
}
|
|
10763
10768
|
setTaskStates(stateMap);
|
|
10769
|
+
setIsLoading(false);
|
|
10764
10770
|
});
|
|
10771
|
+
} else {
|
|
10772
|
+
setIsLoading(false);
|
|
10765
10773
|
}
|
|
10766
10774
|
}, [widgetUuid, scheduledTaskDefs.length]);
|
|
10767
10775
|
if (!item || scheduledTaskDefs.length === 0) return null;
|
|
10776
|
+
if (isLoading) {
|
|
10777
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
10778
|
+
className: "flex flex-col flex-1 min-h-0 p-6",
|
|
10779
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.SubHeading3, {
|
|
10780
|
+
title: "Schedule",
|
|
10781
|
+
padding: false
|
|
10782
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
10783
|
+
className: "text-sm opacity-50 mt-4",
|
|
10784
|
+
children: "Loading schedules..."
|
|
10785
|
+
})]
|
|
10786
|
+
});
|
|
10787
|
+
}
|
|
10768
10788
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
10769
10789
|
className: "flex flex-col flex-1 min-h-0 overflow-y-auto p-6 space-y-4",
|
|
10770
10790
|
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.SubHeading3, {
|