reactbridge-sdk 0.2.5 → 0.2.6
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnalyticsDashboard.d.ts","sourceRoot":"","sources":["../../../src/components/analytics/AnalyticsDashboard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAKnD,OAAO,KAAK,EAEV,uBAAuB,EACxB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEzC,MAAM,WAAW,uBAAuB;IACtC,iBAAiB,EAAE,uBAAuB,CAAC;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;AAED,wBAAgB,kBAAkB,CAAC,EACjC,iBAAiB,EACjB,SAAc,EACd,WAAkB,EAClB,mBAAuB,EACvB,KAAK,EAAE,WAAW,GACnB,EAAE,uBAAuB,
|
|
1
|
+
{"version":3,"file":"AnalyticsDashboard.d.ts","sourceRoot":"","sources":["../../../src/components/analytics/AnalyticsDashboard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAKnD,OAAO,KAAK,EAEV,uBAAuB,EACxB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEzC,MAAM,WAAW,uBAAuB;IACtC,iBAAiB,EAAE,uBAAuB,CAAC;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;AAED,wBAAgB,kBAAkB,CAAC,EACjC,iBAAiB,EACjB,SAAc,EACd,WAAkB,EAClB,mBAAuB,EACvB,KAAK,EAAE,WAAW,GACnB,EAAE,uBAAuB,qBAgzBzB"}
|
package/dist/index.esm.js
CHANGED
|
@@ -2156,6 +2156,8 @@ function AnalyticsDashboard({ onDirectiveAction, className = "", showRefresh = t
|
|
|
2156
2156
|
const theme = customTheme || contextTheme;
|
|
2157
2157
|
const [selectedAnalytics, setSelectedAnalytics] = useState(null);
|
|
2158
2158
|
const [directiveFilter, setDirectiveFilter] = useState("all");
|
|
2159
|
+
// Directive type filter (by action)
|
|
2160
|
+
const [directiveType, setDirectiveType] = useState("all");
|
|
2159
2161
|
// Fetch analytics configurations
|
|
2160
2162
|
const { configs, isLoading: configsLoading, error: configsError, refetch: refetchConfigs, } = useAnalyticsConfigs();
|
|
2161
2163
|
// Fetch latest result for selected analytics
|
|
@@ -2194,10 +2196,18 @@ function AnalyticsDashboard({ onDirectiveAction, className = "", showRefresh = t
|
|
|
2194
2196
|
// Refetch result to get updated directive statuses
|
|
2195
2197
|
refetchResult();
|
|
2196
2198
|
});
|
|
2199
|
+
// Get all unique directive types (actions)
|
|
2200
|
+
const directiveTypes = React.useMemo(() => {
|
|
2201
|
+
if (!(result === null || result === void 0 ? void 0 : result.directives))
|
|
2202
|
+
return [];
|
|
2203
|
+
const types = Array.from(new Set(result.directives.map((d) => d.action)));
|
|
2204
|
+
return types;
|
|
2205
|
+
}, [result === null || result === void 0 ? void 0 : result.directives]);
|
|
2206
|
+
// Filter directives by status and type
|
|
2197
2207
|
const filteredDirectives = (result === null || result === void 0 ? void 0 : result.directives.filter((d) => {
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
return
|
|
2208
|
+
const statusMatch = directiveFilter === "all" || d.status === directiveFilter;
|
|
2209
|
+
const typeMatch = directiveType === "all" || d.action === directiveType;
|
|
2210
|
+
return statusMatch && typeMatch;
|
|
2201
2211
|
})) || [];
|
|
2202
2212
|
const selectedConfig = configs === null || configs === void 0 ? void 0 : configs.find((c) => c.analyticsType === selectedAnalytics);
|
|
2203
2213
|
const proposedCount = (result === null || result === void 0 ? void 0 : result.directives.filter((d) => d.status === "proposed").length) || 0;
|
|
@@ -2469,6 +2479,8 @@ function AnalyticsDashboard({ onDirectiveAction, className = "", showRefresh = t
|
|
|
2469
2479
|
display: "flex",
|
|
2470
2480
|
justifyContent: "space-between",
|
|
2471
2481
|
alignItems: "center",
|
|
2482
|
+
flexWrap: "wrap",
|
|
2483
|
+
gap: theme.spacing.sm,
|
|
2472
2484
|
} },
|
|
2473
2485
|
React.createElement("h3", { style: { margin: 0, fontSize: theme.fontSizes.lg } }, "Recommended actions"),
|
|
2474
2486
|
React.createElement("div", { style: { display: "flex", gap: theme.spacing.xs } },
|
|
@@ -2503,7 +2515,22 @@ function AnalyticsDashboard({ onDirectiveAction, className = "", showRefresh = t
|
|
|
2503
2515
|
: theme.colors.text }) },
|
|
2504
2516
|
"Declined (",
|
|
2505
2517
|
declinedCount,
|
|
2506
|
-
")"))
|
|
2518
|
+
")")),
|
|
2519
|
+
directiveTypes.length > 1 && (React.createElement("select", { value: directiveType, onChange: e => setDirectiveType(e.target.value), style: {
|
|
2520
|
+
padding: `${theme.spacing.xs} ${theme.spacing.sm}`,
|
|
2521
|
+
borderRadius: theme.borderRadius,
|
|
2522
|
+
border: `1px solid ${theme.colors.border}`,
|
|
2523
|
+
background: theme.colors.surface,
|
|
2524
|
+
color: theme.colors.text,
|
|
2525
|
+
fontSize: theme.fontSizes.sm,
|
|
2526
|
+
fontWeight: 500,
|
|
2527
|
+
outline: "none",
|
|
2528
|
+
minWidth: 120,
|
|
2529
|
+
marginLeft: theme.spacing.sm,
|
|
2530
|
+
cursor: "pointer",
|
|
2531
|
+
} },
|
|
2532
|
+
React.createElement("option", { value: "all" }, "All types"),
|
|
2533
|
+
directiveTypes.map(type => (React.createElement("option", { key: type, value: type }, type)))))),
|
|
2507
2534
|
filteredDirectives.length === 0 && (React.createElement("div", { style: placeholderStyle }, "No directives match the selected filter.")),
|
|
2508
2535
|
React.createElement("div", { style: {
|
|
2509
2536
|
display: "flex",
|