reactbridge-sdk 0.2.4 → 0.2.5
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.js
CHANGED
|
@@ -2164,6 +2164,7 @@ function AnalyticsDashboard({ onDirectiveAction, className = "", showRefresh = t
|
|
|
2164
2164
|
const { result, isLoading: resultLoading, error: resultError, refetch: refetchResult, } = useAnalyticsResult(selectedAnalytics);
|
|
2165
2165
|
// Handle directive actions
|
|
2166
2166
|
const { handleAction, isProcessing } = useDirectiveAction(onDirectiveAction);
|
|
2167
|
+
const [processingId, setProcessingId] = React.useState(null);
|
|
2167
2168
|
// Auto-select first analytics if none selected
|
|
2168
2169
|
React.useEffect(() => {
|
|
2169
2170
|
if (configs && configs.length > 0 && !selectedAnalytics) {
|
|
@@ -2189,7 +2190,9 @@ function AnalyticsDashboard({ onDirectiveAction, className = "", showRefresh = t
|
|
|
2189
2190
|
}
|
|
2190
2191
|
};
|
|
2191
2192
|
const handleDirectiveAction = (directive, action) => __awaiter(this, void 0, void 0, function* () {
|
|
2193
|
+
setProcessingId(directive.directiveId);
|
|
2192
2194
|
yield handleAction(directive, action);
|
|
2195
|
+
setProcessingId(null);
|
|
2193
2196
|
// Refetch result to get updated directive statuses
|
|
2194
2197
|
refetchResult();
|
|
2195
2198
|
});
|
|
@@ -2547,8 +2550,16 @@ function AnalyticsDashboard({ onDirectiveAction, className = "", showRefresh = t
|
|
|
2547
2550
|
": ",
|
|
2548
2551
|
param.value)))))),
|
|
2549
2552
|
directive.status === "proposed" && (React.createElement("div", { style: { display: "flex", gap: theme.spacing.sm } },
|
|
2550
|
-
React.createElement("button", { type: "button", onClick: () => handleDirectiveAction(directive, "execute"), disabled: isProcessing, style: Object.assign(Object.assign({}, pillStyle(theme.colors.success)), { border: "none", cursor: isProcessing
|
|
2551
|
-
|
|
2553
|
+
React.createElement("button", { type: "button", onClick: () => handleDirectiveAction(directive, "execute"), disabled: isProcessing && processingId === directive.directiveId, style: Object.assign(Object.assign({}, pillStyle(theme.colors.success)), { border: "none", cursor: isProcessing && processingId === directive.directiveId
|
|
2554
|
+
? "not-allowed"
|
|
2555
|
+
: "pointer" }) }, isProcessing && processingId === directive.directiveId
|
|
2556
|
+
? "Processing..."
|
|
2557
|
+
: "Execute"),
|
|
2558
|
+
React.createElement("button", { type: "button", onClick: () => handleDirectiveAction(directive, "decline"), disabled: isProcessing && processingId === directive.directiveId, style: Object.assign(Object.assign({}, pillStyle(theme.colors.error)), { border: "none", cursor: isProcessing && processingId === directive.directiveId
|
|
2559
|
+
? "not-allowed"
|
|
2560
|
+
: "pointer" }) }, isProcessing && processingId === directive.directiveId
|
|
2561
|
+
? "Processing..."
|
|
2562
|
+
: "Decline"))))))))))))));
|
|
2552
2563
|
}
|
|
2553
2564
|
|
|
2554
2565
|
exports.AnalyticsAPI = AnalyticsAPI;
|