Set failed node's output as red (#11358)

| Error | Success |
|--------|--------|
| ![CleanShot 2025-04-02 at 18 18
45@2x](https://github.com/user-attachments/assets/6674d4d2-344a-4e16-9608-a70cde07a376)
| ![CleanShot 2025-04-02 at 18 20
23@2x](https://github.com/user-attachments/assets/55b5a467-528f-4f07-9166-40ed14943ee2)
|

Closes https://github.com/twentyhq/core-team-issues/issues/716
This commit is contained in:
Baptiste Devessier
2025-04-03 08:58:56 +02:00
committed by GitHub
parent 183dc40916
commit bea75b9532
12 changed files with 119 additions and 31 deletions
@@ -29,9 +29,9 @@ export const JsonNode = ({
depth: number;
keyPath: string;
}) => {
const { shouldHighlightNode, emptyStringLabel } = useJsonTreeContextOrThrow();
const { getNodeHighlighting, emptyStringLabel } = useJsonTreeContextOrThrow();
const isHighlighted = shouldHighlightNode?.(keyPath) ?? false;
const highlighting = getNodeHighlighting?.(keyPath);
if (isNull(value)) {
return (
@@ -39,7 +39,7 @@ export const JsonNode = ({
label={label}
valueAsString="null"
Icon={IconCircleOff}
isHighlighted={isHighlighted}
highlighting={highlighting}
/>
);
}
@@ -50,7 +50,7 @@ export const JsonNode = ({
label={label}
valueAsString={isNonEmptyString(value) ? value : emptyStringLabel}
Icon={IconTypography}
isHighlighted={isHighlighted}
highlighting={highlighting}
/>
);
}
@@ -61,7 +61,7 @@ export const JsonNode = ({
label={label}
valueAsString={String(value)}
Icon={IconNumber9}
isHighlighted={isHighlighted}
highlighting={highlighting}
/>
);
}
@@ -72,7 +72,7 @@ export const JsonNode = ({
label={label}
valueAsString={String(value)}
Icon={IconCheckbox}
isHighlighted={isHighlighted}
highlighting={highlighting}
/>
);
}