@localstack/appinspector-ui 1.0.182 → 1.0.183

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.cjs CHANGED
@@ -2519,7 +2519,7 @@ var SERVICE_NODE_SERVICE_NAME_TEST_ID = "service-node-service-name";
2519
2519
  var SERVICE_NODE_OPERATION_NAME_TEST_ID = "service-node-operation-name";
2520
2520
  var EMULATOR_VERSION_BANNER_TEST_ID = "emulator-version-banner";
2521
2521
  var SPANS_FILTER_NO_MATCH_TEST_ID = "spans-filter-no-match";
2522
- var FILTER_ISSUES_TEST_ID = "filter-issues";
2522
+ var FILTER_STATUS_TEST_ID = "filter-status";
2523
2523
  var FILTER_PRODUCER_TEST_ID = "filter-producer";
2524
2524
  var FILTER_CONSUMER_TEST_ID = "filter-consumer";
2525
2525
  var HIDDEN_OPS_NOTE_TEST_ID = "hidden-ops-note";
@@ -15684,20 +15684,6 @@ var NATIVE_SCROLLBARS = {
15684
15684
  var import_jsx_runtime127 = require("react/jsx-runtime");
15685
15685
  var SHOW_EXCLUSIONS = false;
15686
15686
  var toggle = (list, item) => list.includes(item) ? list.filter((other) => other !== item) : [...list, item];
15687
- var ISSUE_LABELS = { error: "Errors", ok: "No issues", warning: "Warnings" };
15688
- var issueOptionIcon = (value) => {
15689
- switch (value) {
15690
- case "error": {
15691
- return /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_icons_material4.Cancel, { sx: { color: "error.main", fontSize: 16 } });
15692
- }
15693
- case "warning": {
15694
- return /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_icons_material4.Error, { sx: { color: "warning.main", fontSize: 16 } });
15695
- }
15696
- default: {
15697
- return void 0;
15698
- }
15699
- }
15700
- };
15701
15687
  var FilterDropdown = ({ "data-testid": testId, label, onChange, options, value }) => {
15702
15688
  const [anchorElement, setAnchorElement] = (0, import_react37.useState)();
15703
15689
  const open = Boolean(anchorElement);
@@ -15781,7 +15767,6 @@ var FilterDropdown = ({ "data-testid": testId, label, onChange, options, value }
15781
15767
  }
15782
15768
  ),
15783
15769
  !!option.serviceCode && /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_material7.Box, { sx: { borderRadius: "4px", flexShrink: 0, lineHeight: 0, mr: 1, overflow: "hidden" }, children: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(AwsServiceIcon, { hideTooltip: true, service: option.serviceCode, size: "medium" }) }),
15784
- !!option.icon && /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_material7.Box, { sx: { alignItems: "center", display: "flex", flexShrink: 0, mr: 1 }, children: option.icon }),
15785
15770
  /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
15786
15771
  import_material7.ListItemText,
15787
15772
  {
@@ -15825,7 +15810,42 @@ var FilterDropdown = ({ "data-testid": testId, label, onChange, options, value }
15825
15810
  )
15826
15811
  ] });
15827
15812
  };
15828
- var SpansFilterBar = ({ facets, onQueryChange, query: query2 }) => {
15813
+ var StatusCount = ({ count: count2, "data-testid": testId }) => /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_material7.Typography, { color: "text.secondary", component: "span", "data-testid": testId, variant: "caption", children: count2.toLocaleString() });
15814
+ var StatusFilter = ({ counts, onChange, value }) => {
15815
+ const selected = value.included.length === 0 ? "all" : value.included.length === 1 ? value.included[0] : void 0;
15816
+ return /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(
15817
+ import_material7.ToggleButtonGroup,
15818
+ {
15819
+ "aria-label": "Status",
15820
+ "data-testid": FILTER_STATUS_TEST_ID,
15821
+ exclusive: true,
15822
+ onChange: (_event, next) => {
15823
+ if (next) onChange({ excluded: [], included: next === "all" ? [] : [next] });
15824
+ },
15825
+ size: "small",
15826
+ sx: { "& .MuiToggleButton-root": { gap: 0.5, lineHeight: 1.5, px: 1.25, py: 0.5, textTransform: "none" }, "flexShrink": 0 },
15827
+ value: selected,
15828
+ children: [
15829
+ /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(import_material7.ToggleButton, { value: "all", children: [
15830
+ "All",
15831
+ /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(StatusCount, { count: counts.all })
15832
+ ] }),
15833
+ /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(import_material7.ToggleButton, { value: "error", children: [
15834
+ /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_icons_material4.Cancel, { sx: { color: "error.main", fontSize: 16 } }),
15835
+ "Errors",
15836
+ /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(StatusCount, { count: counts.error, "data-testid": ERROR_COUNT_TEST_ID })
15837
+ ] }),
15838
+ /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(import_material7.ToggleButton, { value: "warning", children: [
15839
+ /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_icons_material4.Error, { sx: { color: "warning.main", fontSize: 16 } }),
15840
+ "Warnings",
15841
+ /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(StatusCount, { count: counts.warning, "data-testid": WARNING_COUNT_TEST_ID })
15842
+ ] })
15843
+ ]
15844
+ }
15845
+ );
15846
+ };
15847
+ var SpansFilterBar = ({ facets, onQueryChange, query: query2, totalCount }) => {
15848
+ const issueCount = (value) => facets.issues.find((facet) => facet.value === value)?.count ?? 0;
15829
15849
  const dropdown = (key, label, facetValues, toOption, testId) => {
15830
15850
  const value = getQueryValues(query2, key);
15831
15851
  const loaded = new Set(facetValues.map((facet) => facet.value));
@@ -15843,17 +15863,29 @@ var SpansFilterBar = ({ facets, onQueryChange, query: query2 }) => {
15843
15863
  }
15844
15864
  );
15845
15865
  };
15846
- return /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(import_material7.Box, { sx: { alignItems: "center", display: "flex", gap: 1 }, children: [
15847
- dropdown("producer", "Producer", facets.producer, (facet) => facet.value === EXTERNAL_PRODUCER ? { label: "External producer" } : { label: getServiceDisplayName(facet.value), serviceCode: facet.value }, FILTER_PRODUCER_TEST_ID),
15848
- dropdown("service", "Consumer", facets.service, (facet) => ({ label: getServiceDisplayName(facet.value), serviceCode: facet.value }), FILTER_CONSUMER_TEST_ID),
15849
- dropdown("status", "Issues", facets.issues, (facet) => ({ icon: issueOptionIcon(facet.value), label: ISSUE_LABELS[facet.value] ?? facet.value }), FILTER_ISSUES_TEST_ID)
15850
- ] });
15866
+ return (
15867
+ // Its controls wrap as items of the parent's controls row.
15868
+ /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(import_material7.Box, { sx: { display: "contents" }, children: [
15869
+ /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
15870
+ StatusFilter,
15871
+ {
15872
+ counts: { all: totalCount, error: issueCount("error"), warning: issueCount("warning") },
15873
+ onChange: (next) => {
15874
+ onQueryChange(setQueryValues(query2, "status", next));
15875
+ },
15876
+ value: getQueryValues(query2, "status")
15877
+ }
15878
+ ),
15879
+ dropdown("producer", "Producer", facets.producer, (facet) => facet.value === EXTERNAL_PRODUCER ? { label: "External producer" } : { label: getServiceDisplayName(facet.value), serviceCode: facet.value }, FILTER_PRODUCER_TEST_ID),
15880
+ dropdown("service", "Consumer", facets.service, (facet) => ({ label: getServiceDisplayName(facet.value), serviceCode: facet.value }), FILTER_CONSUMER_TEST_ID)
15881
+ ] })
15882
+ );
15851
15883
  };
15852
15884
 
15853
15885
  // src/components/spans-list/spans-data-grid.tsx
15854
15886
  var import_jsx_runtime128 = require("react/jsx-runtime");
15855
15887
  var SHOW_FILTERS_IN_SEARCH = false;
15856
- var FILTER_NAMES = [["producer", "Producer"], ["service", "Consumer"], ["status", "Issues"]];
15888
+ var FILTER_NAMES = [["producer", "Producer"], ["service", "Consumer"], ["status", "Status"]];
15857
15889
  var columnHelper = createColumnHelper();
15858
15890
  var newSpanBackgroundColor = {
15859
15891
  dark: { from: "rgba(255, 193, 7, 0.14)", to: "rgba(255, 193, 7, 0)" },
@@ -16023,8 +16055,6 @@ var SpansDataGrid = ({
16023
16055
  if (!spansLoaded) return;
16024
16056
  return compute.topLevelIds.map((spanId) => getSpan(spanId)).filter((span) => span !== void 0);
16025
16057
  }, [compute.topLevelIds, getSpan, spansLoaded]);
16026
- const errorCount = compute.allIds.filter((spanId) => compute.rows[spanId]?.error).length;
16027
- const warningCount = compute.allIds.filter((spanId) => compute.rows[spanId]?.warning).length;
16028
16058
  const downstreamOf = (0, import_react38.useCallback)((spanId) => compute.rows[spanId]?.downstream, [compute.rows]);
16029
16059
  const columns = (0, import_react38.useMemo)(() => [
16030
16060
  columnHelper.display({
@@ -16142,8 +16172,8 @@ var SpansDataGrid = ({
16142
16172
  }, [order2, spans?.length, lastSpanId]);
16143
16173
  return /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(import_jsx_runtime128.Fragment, { children: [
16144
16174
  /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_material8.Grid, { item: true, xs: 12, children: /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(import_material8.Box, { sx: { display: "flex", flexDirection: "column", gap: "0.5rem", pt: 1, px: 1 }, children: [
16145
- /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(import_material8.Box, { sx: { alignItems: "center", display: "flex", flexWrap: "wrap", gap: "0.5rem" }, children: [
16146
- /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_material8.Box, { sx: { flex: 1, maxWidth: 220, minWidth: 96, order: 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
16175
+ /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(import_material8.Box, { sx: { alignItems: "center", containerType: "inline-size", display: "flex", flexWrap: "wrap", gap: "0.5rem" }, children: [
16176
+ /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_material8.Box, { sx: { flex: "1 1 160px", maxWidth: 220, order: -1 }, children: /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
16147
16177
  SpansSearchField,
16148
16178
  {
16149
16179
  onChange: (value) => {
@@ -16153,16 +16183,16 @@ var SpansDataGrid = ({
16153
16183
  value: searchText
16154
16184
  }
16155
16185
  ) }),
16156
- /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_material8.Box, { sx: { order: { md: 2, xs: 4 }, width: { md: "auto", xs: "100%" } }, children: /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
16186
+ /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
16157
16187
  SpansFilterBar,
16158
16188
  {
16159
16189
  facets: compute.facets,
16160
16190
  onQueryChange: updateDropdownQuery,
16161
- query: dropdownQuery
16191
+ query: dropdownQuery,
16192
+ totalCount: compute.totalCount
16162
16193
  }
16163
- ) }),
16164
- /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_material8.Box, { sx: { flex: 1, order: { md: 3, xs: 2 } } }),
16165
- /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_material8.Box, { sx: { flexShrink: 0, order: { md: 4, xs: 3 } }, children: /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
16194
+ ),
16195
+ /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_material8.Box, { sx: { "@container (min-width: 960px)": { order: 1 }, "flexShrink": 0, "ml": "auto", "order": -1 }, children: /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
16166
16196
  import_material8.Button,
16167
16197
  {
16168
16198
  "data-testid": CLEAR_SPANS_TEST_ID,
@@ -16171,7 +16201,8 @@ var SpansDataGrid = ({
16171
16201
  startIcon: /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_icons_material5.DeleteForeverOutlined, {}),
16172
16202
  children: "Clear Operations"
16173
16203
  }
16174
- ) })
16204
+ ) }),
16205
+ /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_material8.Box, { sx: { "@container (min-width: 960px)": { display: "none" }, "flexBasis": "100%", "mt": "-0.5rem", "order": -1 } })
16175
16206
  ] }),
16176
16207
  /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(import_material8.Box, { sx: { alignItems: "center", display: "flex", gap: "0.5rem", pl: 0.5 }, children: [
16177
16208
  /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
@@ -16204,50 +16235,6 @@ var SpansDataGrid = ({
16204
16235
  }
16205
16236
  )
16206
16237
  ] })
16207
- ] }),
16208
- errorCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(import_jsx_runtime128.Fragment, { children: [
16209
- /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_material8.Typography, { color: "text.secondary", variant: "caption", children: "\xB7" }),
16210
- /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_material8.Tooltip, { title: "Number of errors detected across all operations", children: /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(
16211
- import_material8.Box,
16212
- {
16213
- "data-testid": ERROR_COUNT_TEST_ID,
16214
- sx: {
16215
- alignItems: "center",
16216
- borderBottom: "1px dotted",
16217
- borderColor: "error.main",
16218
- cursor: "help",
16219
- display: "flex",
16220
- gap: 0.5,
16221
- mb: "-1px"
16222
- },
16223
- children: [
16224
- /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_material8.Typography, { color: "error", variant: "body2", children: errorCount.toLocaleString() }),
16225
- /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_material8.Typography, { color: "error", variant: "caption", children: errorCount === 1 ? "error" : "errors" })
16226
- ]
16227
- }
16228
- ) })
16229
- ] }),
16230
- warningCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(import_jsx_runtime128.Fragment, { children: [
16231
- /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_material8.Typography, { color: "text.secondary", variant: "caption", children: "\xB7" }),
16232
- /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_material8.Tooltip, { title: "Number of warnings detected across all operations", children: /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(
16233
- import_material8.Box,
16234
- {
16235
- "data-testid": WARNING_COUNT_TEST_ID,
16236
- sx: {
16237
- alignItems: "center",
16238
- borderBottom: "1px dotted",
16239
- borderColor: "warning.main",
16240
- cursor: "help",
16241
- display: "flex",
16242
- gap: 0.5,
16243
- mb: "-1px"
16244
- },
16245
- children: [
16246
- /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_material8.Typography, { color: "warning.main", variant: "body2", children: warningCount.toLocaleString() }),
16247
- /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_material8.Typography, { color: "warning.main", variant: "caption", children: warningCount === 1 ? "warning" : "warnings" })
16248
- ]
16249
- }
16250
- ) })
16251
16238
  ] })
16252
16239
  ] })
16253
16240
  ] }) }),