@localstack/appinspector-ui 1.0.1 → 1.0.3

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
@@ -2846,8 +2846,7 @@ var SpansList = (props) => {
2846
2846
  };
2847
2847
 
2848
2848
  // src/components/status-message/status-message.tsx
2849
- import ErrorOutlineIcon from "@mui/icons-material/ErrorOutline";
2850
- import InfoOutlinedIcon from "@mui/icons-material/InfoOutlined";
2849
+ import { ErrorOutline, InfoOutlined } from "@mui/icons-material";
2851
2850
  import { Alert as Alert2, AlertTitle, Box as Box5, Button as Button3, Link, Typography as Typography3 } from "@mui/material";
2852
2851
 
2853
2852
  // src/api/errors.ts
@@ -2889,7 +2888,7 @@ var getAppInspectorApiUrl = (localstackEndpoint, endpoint) => {
2889
2888
  };
2890
2889
 
2891
2890
  // src/components/status-message/status-message.tsx
2892
- import { jsx as jsx126, jsxs as jsxs122 } from "react/jsx-runtime";
2891
+ import { Fragment as Fragment2, jsx as jsx126, jsxs as jsxs122 } from "react/jsx-runtime";
2893
2892
  var StatusMessage = ({
2894
2893
  error,
2895
2894
  onRetry,
@@ -2910,7 +2909,7 @@ var StatusMessage = ({
2910
2909
  children: /* @__PURE__ */ jsxs122(
2911
2910
  Alert2,
2912
2911
  {
2913
- icon: /* @__PURE__ */ jsx126(ErrorOutlineIcon, { fontSize: "large" }),
2912
+ icon: /* @__PURE__ */ jsx126(ErrorOutline, { fontSize: "large" }),
2914
2913
  severity: "error",
2915
2914
  sx: { maxWidth: 600, width: "100%" },
2916
2915
  children: [
@@ -2983,7 +2982,7 @@ var StatusMessage = ({
2983
2982
  children: /* @__PURE__ */ jsxs122(
2984
2983
  Alert2,
2985
2984
  {
2986
- icon: /* @__PURE__ */ jsx126(ErrorOutlineIcon, { fontSize: "large" }),
2985
+ icon: /* @__PURE__ */ jsx126(ErrorOutline, { fontSize: "large" }),
2987
2986
  severity: "error",
2988
2987
  sx: { maxWidth: 600, width: "100%" },
2989
2988
  children: [
@@ -3033,7 +3032,7 @@ var StatusMessage = ({
3033
3032
  children: /* @__PURE__ */ jsxs122(
3034
3033
  Alert2,
3035
3034
  {
3036
- icon: /* @__PURE__ */ jsx126(InfoOutlinedIcon, { fontSize: "large" }),
3035
+ icon: /* @__PURE__ */ jsx126(InfoOutlined, { fontSize: "large" }),
3037
3036
  severity: "warning",
3038
3037
  sx: { maxWidth: 600, width: "100%" },
3039
3038
  children: [
@@ -3102,7 +3101,7 @@ var StatusMessage = ({
3102
3101
  children: /* @__PURE__ */ jsxs122(
3103
3102
  Alert2,
3104
3103
  {
3105
- icon: /* @__PURE__ */ jsx126(ErrorOutlineIcon, { fontSize: "large" }),
3104
+ icon: /* @__PURE__ */ jsx126(ErrorOutline, { fontSize: "large" }),
3106
3105
  severity: "error",
3107
3106
  sx: { maxWidth: 600, width: "100%" },
3108
3107
  children: [
@@ -3123,7 +3122,7 @@ var StatusMessage = ({
3123
3122
  }
3124
3123
  );
3125
3124
  }
3126
- return;
3125
+ return /* @__PURE__ */ jsx126(Fragment2, {});
3127
3126
  };
3128
3127
 
3129
3128
  // src/context.tsx
@@ -3460,11 +3459,12 @@ var SpansListPage = () => {
3460
3459
  };
3461
3460
 
3462
3461
  // src/pages/trace-graph-page.tsx
3463
- import { Box as Box12, Drawer, Paper as Paper2 } from "@mui/material";
3462
+ import { ArrowBack } from "@mui/icons-material";
3463
+ import { Box as Box12, Button as Button5, Drawer, Paper as Paper2 } from "@mui/material";
3464
3464
  import { styled } from "@mui/material/styles";
3465
3465
  import { ReactFlowProvider } from "@xyflow/react";
3466
3466
  import { useCallback as useCallback8, useEffect as useEffect6, useState as useState8 } from "react";
3467
- import { useParams, useSearchParams } from "react-router-dom";
3467
+ import { useNavigate as useNavigate2, useParams, useSearchParams } from "react-router-dom";
3468
3468
 
3469
3469
  // src/components/event-details/event-details.tsx
3470
3470
  import { Box as Box9, Chip, Divider, Stack, Typography as Typography6 } from "@mui/material";
@@ -3541,7 +3541,7 @@ var ToggleSection = ({ children, headline, initialOpen = true }) => {
3541
3541
  };
3542
3542
 
3543
3543
  // src/components/event-details/event-details.tsx
3544
- import { Fragment as Fragment2, jsx as jsx131, jsxs as jsxs125 } from "react/jsx-runtime";
3544
+ import { Fragment as Fragment3, jsx as jsx131, jsxs as jsxs125 } from "react/jsx-runtime";
3545
3545
  var EventDetails = ({ selectedEvent }) => {
3546
3546
  if (!selectedEvent) {
3547
3547
  return /* @__PURE__ */ jsx131(Box9, { sx: { p: 3, textAlign: "center" }, children: /* @__PURE__ */ jsx131(Typography6, { color: "text.secondary", variant: "body2", children: "Select an event to view details" }) });
@@ -3605,7 +3605,7 @@ var EventDetails = ({ selectedEvent }) => {
3605
3605
  ),
3606
3606
  selectedEvent.status_message && /* @__PURE__ */ jsx131(Typography6, { variant: "body2", children: selectedEvent.status_message })
3607
3607
  ] }) }),
3608
- selectedEvent.attributes && Object.keys(selectedEvent.attributes).length > 0 && /* @__PURE__ */ jsxs125(Fragment2, { children: [
3608
+ selectedEvent.attributes && Object.keys(selectedEvent.attributes).length > 0 && /* @__PURE__ */ jsxs125(Fragment3, { children: [
3609
3609
  /* @__PURE__ */ jsx131(Divider, {}),
3610
3610
  /* @__PURE__ */ jsx131(ToggleSection, { headline: "Attributes", children: /* @__PURE__ */ jsx131(Box9, { sx: { backgroundColor: "#f5f5f5", borderRadius: 1, p: 1 }, children: /* @__PURE__ */ jsx131("pre", { style: { fontSize: "0.85rem", margin: 0, overflow: "auto" }, children: JSON.stringify(selectedEvent.attributes, void 0, 2) }) }) })
3611
3611
  ] })
@@ -3873,7 +3873,7 @@ var calculateCenterX = (focusNodeX, viewPortPixelWidth, minX, maxX) => {
3873
3873
  };
3874
3874
 
3875
3875
  // src/components/trace-graph/trace-graph.tsx
3876
- import { Fragment as Fragment3, jsx as jsx134, jsxs as jsxs127 } from "react/jsx-runtime";
3876
+ import { Fragment as Fragment4, jsx as jsx134, jsxs as jsxs127 } from "react/jsx-runtime";
3877
3877
  var nodeTypes = {
3878
3878
  service: ServiceNode
3879
3879
  };
@@ -3962,7 +3962,7 @@ var TraceGraph = ({
3962
3962
  onEventSelect(node.data.event);
3963
3963
  updateSelectedNode(node.id);
3964
3964
  }, [onEventSelect, updateSelectedNode]);
3965
- return /* @__PURE__ */ jsxs127(Fragment3, { children: [
3965
+ return /* @__PURE__ */ jsxs127(Fragment4, { children: [
3966
3966
  spans.error && /* @__PURE__ */ jsxs127(
3967
3967
  Alert3,
3968
3968
  {
@@ -4000,7 +4000,7 @@ var TraceGraph = ({
4000
4000
  };
4001
4001
 
4002
4002
  // src/pages/trace-graph-page.tsx
4003
- import { Fragment as Fragment4, jsx as jsx135, jsxs as jsxs128 } from "react/jsx-runtime";
4003
+ import { Fragment as Fragment5, jsx as jsx135, jsxs as jsxs128 } from "react/jsx-runtime";
4004
4004
  var HEADER_HEIGHT = 56;
4005
4005
  var DRAWER_WIDTH = "35%";
4006
4006
  var Main = styled("main", { shouldForwardProp: (property) => property !== "open" })(({ open, theme }) => ({
@@ -4091,7 +4091,13 @@ var TraceGraphPage = () => {
4091
4091
  void checkStatus();
4092
4092
  }, [checkStatus]);
4093
4093
  const shouldShowStatusMessage = Boolean(statusError) || status?.status === "DISABLED";
4094
- return /* @__PURE__ */ jsx135(
4094
+ const navigate = useNavigate2();
4095
+ const { resolveLink } = useAppInspector();
4096
+ const navigateToSpansList = useCallback8(() => {
4097
+ const url = resolveLink({ to: "spans-list" });
4098
+ navigate(url);
4099
+ }, [navigate, resolveLink]);
4100
+ return /* @__PURE__ */ jsxs128(
4095
4101
  Box12,
4096
4102
  {
4097
4103
  "data-testid": "trace-graph-page",
@@ -4099,56 +4105,65 @@ var TraceGraphPage = () => {
4099
4105
  alignItems: "center",
4100
4106
  display: "flex",
4101
4107
  flexDirection: "column",
4108
+ gap: 2,
4102
4109
  height: "100vh",
4103
4110
  overflow: "hidden"
4104
4111
  },
4105
- children: /* @__PURE__ */ jsx135(
4106
- Paper2,
4107
- {
4108
- sx: {
4109
- display: "flex",
4110
- flexGrow: 1,
4111
- overflow: "hidden",
4112
- position: "relative",
4113
- width: "100%"
4114
- },
4115
- children: shouldShowStatusMessage ? /* @__PURE__ */ jsx135(
4116
- StatusMessage,
4117
- {
4118
- error: statusError,
4119
- onRetry: handleRetry,
4120
- status
4121
- }
4122
- ) : /* @__PURE__ */ jsxs128(Fragment4, { children: [
4123
- /* @__PURE__ */ jsx135(Main, { open, children: /* @__PURE__ */ jsx135(
4124
- Box12,
4112
+ children: [
4113
+ /* @__PURE__ */ jsxs128(Box12, { sx: { display: "flex", width: "100%" }, children: [
4114
+ /* @__PURE__ */ jsx135(Button5, { onClick: () => {
4115
+ navigateToSpansList();
4116
+ }, startIcon: /* @__PURE__ */ jsx135(ArrowBack, {}), children: "Go back" }),
4117
+ /* @__PURE__ */ jsx135(Box12, { sx: { flexGrow: 1 } })
4118
+ ] }),
4119
+ /* @__PURE__ */ jsx135(
4120
+ Paper2,
4121
+ {
4122
+ sx: {
4123
+ display: "flex",
4124
+ flexGrow: 1,
4125
+ overflow: "hidden",
4126
+ position: "relative",
4127
+ width: "100%"
4128
+ },
4129
+ children: shouldShowStatusMessage ? /* @__PURE__ */ jsx135(
4130
+ StatusMessage,
4125
4131
  {
4126
- sx: {
4127
- height: "100%",
4128
- overflow: "auto"
4129
- },
4130
- children: traceId !== void 0 && /* @__PURE__ */ jsx135(ReactFlowProvider, { children: /* @__PURE__ */ jsx135(
4131
- TraceGraph,
4132
- {
4133
- initialFocusEventId: spanId,
4134
- onEventSelect: handleEventSelect,
4135
- onRefresh: () => {
4136
- void fetchSpans();
4137
- },
4138
- spans: {
4139
- data: spans,
4140
- error: fetchError,
4141
- loading
4142
- },
4143
- viewPortPixelWidth
4144
- }
4145
- ) })
4132
+ error: statusError,
4133
+ onRetry: handleRetry,
4134
+ status
4146
4135
  }
4147
- ) }),
4148
- /* @__PURE__ */ jsx135(StyledDrawer, { anchor: "right", open, variant: "persistent", children: /* @__PURE__ */ jsx135(EventDetails, { selectedEvent }) })
4149
- ] })
4150
- }
4151
- )
4136
+ ) : /* @__PURE__ */ jsxs128(Fragment5, { children: [
4137
+ /* @__PURE__ */ jsx135(Main, { open, children: /* @__PURE__ */ jsx135(
4138
+ Box12,
4139
+ {
4140
+ sx: {
4141
+ height: "100%",
4142
+ overflow: "auto"
4143
+ },
4144
+ children: traceId !== void 0 && /* @__PURE__ */ jsx135(ReactFlowProvider, { children: /* @__PURE__ */ jsx135(
4145
+ TraceGraph,
4146
+ {
4147
+ initialFocusEventId: spanId,
4148
+ onEventSelect: handleEventSelect,
4149
+ onRefresh: () => {
4150
+ void fetchSpans();
4151
+ },
4152
+ spans: {
4153
+ data: spans,
4154
+ error: fetchError,
4155
+ loading
4156
+ },
4157
+ viewPortPixelWidth
4158
+ }
4159
+ ) })
4160
+ }
4161
+ ) }),
4162
+ /* @__PURE__ */ jsx135(StyledDrawer, { anchor: "right", open, variant: "persistent", children: /* @__PURE__ */ jsx135(EventDetails, { selectedEvent }) })
4163
+ ] })
4164
+ }
4165
+ )
4166
+ ]
4152
4167
  }
4153
4168
  );
4154
4169
  };