Skip to content

Commit

Permalink
fix(ui-debug): issue to display json file in outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
skamril committed Sep 29, 2023
1 parent 58656e0 commit 3a2f695
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function StudyFileView(props: PropTypes) {
setLoaded(false);
try {
const res = await getStudyData(study, url);
if (typeof res === "object") {
if (Array.isArray(res)) {
setData(res.join("\n"));
} else {
setData(res);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,15 @@ export const getStudyParams = (
path: string,
itemkey: string
): StudyParams | undefined => {
if (typeof data !== "object") {
console.log({

Check warning on line 18 in webapp/src/components/App/Singlestudy/explore/Modelization/DebugView/StudyTreeView/utils.ts

View workflow job for this annotation

GitHub Actions / npm-test (ubuntu-20.04)

Unexpected console statement
data,
path,
itemkey,
});
if (typeof data === "string") {
const tmp = data.split("://");
if (tmp && tmp.length > 0) {
if (tmp[0] === "json") {
if (tmp[0] === "json" || tmp[1].endsWith(".json")) {
return {
type: "json",
data: `${path}/${itemkey}`,
Expand Down

0 comments on commit 3a2f695

Please sign in to comment.