Skip to content

Commit 9f32e24

Browse files
Copilotcschleiden
andcommitted
Move formatAttributesForDisplay function to separate utils.ts file
Co-authored-by: cschleiden <[email protected]>
1 parent baa6fd2 commit 9f32e24

11 files changed

+37
-32
lines changed

diag/app/build/asset-manifest.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"files": {
33
"main.css": "./static/css/main.8b0db0ad.css",
4-
"main.js": "./static/js/main.2241337e.js",
4+
"main.js": "./static/js/main.1d3b50fb.js",
55
"index.html": "./index.html",
66
"main.8b0db0ad.css.map": "./static/css/main.8b0db0ad.css.map",
7-
"main.2241337e.js.map": "./static/js/main.2241337e.js.map"
7+
"main.1d3b50fb.js.map": "./static/js/main.1d3b50fb.js.map"
88
},
99
"entrypoints": [
1010
"static/css/main.8b0db0ad.css",
11-
"static/js/main.2241337e.js"
11+
"static/js/main.1d3b50fb.js"
1212
]
1313
}

diag/app/build/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><title>go-workflows</title><script defer="defer" src="./static/js/main.2241337e.js"></script><link href="./static/css/main.8b0db0ad.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
1+
<!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><title>go-workflows</title><script defer="defer" src="./static/js/main.1d3b50fb.js"></script><link href="./static/css/main.8b0db0ad.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>

diag/app/build/static/js/main.2241337e.js renamed to diag/app/build/static/js/main.1d3b50fb.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
File renamed without changes.

diag/app/build/static/js/main.1d3b50fb.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

diag/app/build/static/js/main.2241337e.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

diag/app/package-lock.json

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

diag/app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,6 @@
5151
"homepage": ".",
5252
"devDependencies": {
5353
"@types/react-router-bootstrap": "^0.24.5",
54-
"rimraf": "3.0.2"
54+
"rimraf": "^3.0.2"
5555
}
5656
}

diag/app/src/Components.tsx

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -50,27 +50,7 @@ export function decodePayloads(payload: { [key: string]: any }): any {
5050
return r;
5151
}
5252

53-
export function formatAttributesForDisplay(attributes: { [key: string]: any }): string {
54-
const decoded = decodePayloads(attributes);
55-
56-
// Custom replacer function to handle already-pretty-printed JSON strings in inputs
57-
const replacer = (key: string, value: any) => {
58-
if (key === "inputs" && Array.isArray(value)) {
59-
// For inputs, we want to parse the pretty-printed JSON strings back to objects
60-
// so they display nicely in the final JSON
61-
return value.map(input => {
62-
try {
63-
return JSON.parse(input);
64-
} catch {
65-
return input;
66-
}
67-
});
68-
}
69-
return value;
70-
};
71-
72-
return JSON.stringify(decoded, replacer, 2);
73-
}
53+
7454

7555
export const Payload: React.FC<{ payloads: string[] }> = ({ payloads }) => {
7656
return (

diag/app/src/Instance.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import {
88
WorkflowInstanceState,
99
decodePayload,
1010
decodePayloads,
11-
formatAttributesForDisplay,
1211
} from "./Components";
12+
import { formatAttributesForDisplay } from "./utils";
1313
import {
1414
ExecutionCompletedAttributes,
1515
ExecutionStartedAttributes,

0 commit comments

Comments
 (0)