-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PayloadDecoder #1651
PayloadDecoder #1651
Conversation
* make prettier and eslint play nice * add lint:ci so will fail in ci * format all the files * organize imports on save * update snaps from tailwind class order changes * update snaps * add recommended extensions * pr feedback
* Use CodeMirror for event history payloads * Add readonly prop * WIP: add copy icon to copy content in JSONEditor * Make codemirror the new CodeBlock. Need to figure out string new lines and how to update editor on content changes * Add folding, make string the type for content, update styles, make dynamic, remove PRISM * Fix extra stringifying * Fix small issues * Remove null check * Use margin * Fix CodeBlock testid * Add editable class to codeblock * Fix playwright payload tests, better extension logic to prevent lineWrapping on inline codeblocks * Make it more readable, add back storageState
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
…issue with json. Add loading to timeline
copySuccessIconTitle={translate('copy-success-icon-title')} | ||
/> | ||
{#if decodeEventHistory} | ||
{#key [index, decodeEventHistory]} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL you can do array keys. is the decodeEventHistory
necessary so that we re-render encoded/decoded payloads when the switch is toggled on and off?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup exactly
Description & motivation 💭
Use the PayloadDecoder component to decode payloads and pass to the CodeBlock instead of decoding everything upfront.
The PayloadDecoder accepts
PotentiallyDecodable | EventAttribute | WorkflowEvent
as a value. It will iterate over the value and decode each payload. You can also pass a key prop to return a value of the decoded object. This is mostly to not show { payloads: "thing" } and instead show "thing".There is no caching of decoded values. So when a PayloadDecoder is rerendered, it will send another decode request. It is up to the codec server implementation to handle caching.
Screenshots (if applicable) 📸
Design Considerations 🎨
Testing 🧪
How was this tested 👻
Steps for others to test: 🚶🏽♂️🚶🏽♀️
Checklists
Draft Checklist
Merge Checklist
Issue(s) closed
Docs
Any docs updates needed?