Skip to content

Show non-string solution data as json#23

Merged
schweikart merged 4 commits intodevelopfrom
feat/json-solution-view
Jul 28, 2023
Merged

Show non-string solution data as json#23
schweikart merged 4 commits intodevelopfrom
feat/json-solution-view

Conversation

@Elscrux
Copy link
Copy Markdown
Member

@Elscrux Elscrux commented Jul 8, 2023

Going forward, we will start using non-string solution data that can easily be integrated in other clients other than the toolbox-website. Because of this, the website needs to support non-string formats, currently by using JSON representation of any object that might be returned.

Alternatively, it would be an option to specifically request a string representation of the solution via another endpoint, or a flag we set that tells the server to return a string format.

@Elscrux Elscrux requested a review from schweikart July 8, 2023 16:55
Comment thread src/components/solvers/SolutionView.tsx Outdated
Comment on lines +35 to +41
{typeof c === "string" || c instanceof String ? (
<pre style={{ overflowX: "auto" }}>{c}</pre>
) : (
<pre style={{ overflowX: "auto" }}>
{JSON.stringify(c, null, "\t")}
</pre>
)}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can move the ternary operator to the inside of the <pre> block

@schweikart schweikart merged commit 5034f27 into develop Jul 28, 2023
@schweikart schweikart mentioned this pull request Sep 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants