@localstack/appinspector-ui 1.0.144 → 1.0.145

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
@@ -15284,13 +15284,14 @@ function parseIAMEvent(payloadString) {
15284
15284
 
15285
15285
  // src/components/cells/status-cell.tsx
15286
15286
  var import_jsx_runtime124 = require("react/jsx-runtime");
15287
- var StatusIcon = ({ errorLevel, spanStatusCode }) => {
15287
+ var StatusIcon = ({ errorLevel, operationStatus, spanStatusCode }) => {
15288
15288
  switch (errorLevel) {
15289
15289
  case ErrorLevel.ERROR: {
15290
15290
  return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_icons_material.Cancel, { sx: { color: "red" } });
15291
15291
  }
15292
15292
  case ErrorLevel.IAM_PERMISSION: {
15293
- return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_icons_material.GppBad, { sx: { color: spanStatusCode === 2 ? "red" : "warning.main" } });
15293
+ const isDenial = operationStatus ? operationStatus === "iam_explicit_deny" || operationStatus === "iam_implicit_deny" : spanStatusCode === 2;
15294
+ return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_icons_material.GppBad, { sx: { color: isDenial ? "red" : "warning.main" } });
15294
15295
  }
15295
15296
  case ErrorLevel.WARNING: {
15296
15297
  return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_icons_material.Error, { sx: { color: "orange" } });
@@ -15301,6 +15302,22 @@ var StatusIcon = ({ errorLevel, spanStatusCode }) => {
15301
15302
  }
15302
15303
  };
15303
15304
  var calculateHighestErrorLevel = (span) => {
15305
+ if (span.operation_status) {
15306
+ switch (span.operation_status) {
15307
+ case "error": {
15308
+ return ErrorLevel.ERROR;
15309
+ }
15310
+ case "iam_explicit_deny":
15311
+ case "iam_explicit_warn":
15312
+ case "iam_implicit_deny":
15313
+ case "iam_implicit_warn": {
15314
+ return ErrorLevel.IAM_PERMISSION;
15315
+ }
15316
+ default: {
15317
+ return ErrorLevel.OK;
15318
+ }
15319
+ }
15320
+ }
15304
15321
  const hasIamDenial = span.events.some((event) => {
15305
15322
  if (!event.event_type?.toLowerCase().includes("iam")) return false;
15306
15323
  if (typeof event.attributes?.payload !== "string") return false;
@@ -15344,7 +15361,7 @@ var buildTooltipContent = (span) => {
15344
15361
  var StatusIconWithTooltip = ({ span }) => {
15345
15362
  const errorLevel = calculateHighestErrorLevel(span);
15346
15363
  if (errorLevel !== ErrorLevel.ERROR && errorLevel !== ErrorLevel.IAM_PERMISSION) return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_jsx_runtime124.Fragment, {});
15347
- return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_material4.Tooltip, { title: buildTooltipContent(span), children: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_material4.Box, { sx: { alignItems: "center", cursor: "default", display: "flex" }, children: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(StatusIcon, { errorLevel, spanStatusCode: span.status_code }) }) });
15364
+ return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_material4.Tooltip, { title: buildTooltipContent(span), children: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_material4.Box, { sx: { alignItems: "center", cursor: "default", display: "flex" }, children: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(StatusIcon, { errorLevel, operationStatus: span.operation_status, spanStatusCode: span.status_code }) }) });
15348
15365
  };
15349
15366
 
15350
15367
  // src/components/spans-list/span-count-badge.tsx
@@ -31760,14 +31777,16 @@ var ServiceNode = (0, import_react56.memo)(({ data, selected }) => {
31760
31777
  const theme = (0, import_material19.useTheme)();
31761
31778
  const [isHovered, setIsHovered] = (0, import_react56.useState)(false);
31762
31779
  const nodeRef = (0, import_react56.useRef)(null);
31763
- const isError = data.event.status_code === 2;
31764
- const hasPermissionEvents = (0, import_react56.useMemo)(
31780
+ const { operation_status } = data.event;
31781
+ const hasPermissionEventsLegacy = (0, import_react56.useMemo)(
31765
31782
  () => data.event.events.some(
31766
31783
  (event) => event.event_type === "iam.policy_evaluation" && event.name === "iam.policy.denied"
31767
31784
  ),
31768
31785
  [data.event.events]
31769
31786
  );
31770
- const isWarning = !isError && data.event.status_code === 1 && hasPermissionEvents;
31787
+ const isError = operation_status ? operation_status === "error" || operation_status === "iam_explicit_deny" || operation_status === "iam_implicit_deny" : data.event.status_code === 2;
31788
+ const isWarning = operation_status ? operation_status === "iam_explicit_warn" || operation_status === "iam_implicit_warn" : !isError && data.event.status_code === 1 && hasPermissionEventsLegacy;
31789
+ const hasPermissionEvents = operation_status ? operation_status.startsWith("iam_") : hasPermissionEventsLegacy;
31771
31790
  const outlineColor = isError ? theme.palette.error.main : isWarning ? theme.palette.warning.main : void 0;
31772
31791
  const sharedBoxSx = {
31773
31792
  backgroundColor: theme.palette.background.paper,