diff --git a/src/components/ArtifactsPreview/ArtifactsPreview.js b/src/components/ArtifactsPreview/ArtifactsPreview.js
index a7d81b23bd..fb43f498dd 100644
--- a/src/components/ArtifactsPreview/ArtifactsPreview.js
+++ b/src/components/ArtifactsPreview/ArtifactsPreview.js
@@ -21,10 +21,13 @@ import React, { useState } from 'react'
import PropTypes from 'prop-types'
import classnames from 'classnames'
+import Accordion from '../../common/Accordion/Accordion'
import ArtifactsPreviewView from './ArtifactsPreviewView'
import Loader from '../../common/Loader/Loader'
import NoData from '../../common/NoData/NoData'
+import { ReactComponent as Arrow } from 'igz-controls/images/arrow.svg'
+
const ArtifactsPreview = ({ className, extraData, noData, preview, showExtraDataLoader }) => {
const [showErrorBody, setShowErrorBody] = useState(false)
const artifactsPreviewClasses = classnames('artifact-preview', className)
@@ -50,14 +53,20 @@ const ArtifactsPreview = ({ className, extraData, noData, preview, showExtraData
Extra Data
{extraData.map((extraDataItem, index) => (
-
+
}
+ iconClassName="expand-icon"
+ alwaysOpened={false}
+ openByDefault={false}
+ >
+
+
))}
)}
diff --git a/src/components/ArtifactsPreview/ArtifactsPreviewView.js b/src/components/ArtifactsPreview/ArtifactsPreviewView.js
index f93b9bebf4..07762a9575 100644
--- a/src/components/ArtifactsPreview/ArtifactsPreviewView.js
+++ b/src/components/ArtifactsPreview/ArtifactsPreviewView.js
@@ -21,24 +21,15 @@ import React, { useMemo } from 'react'
import PropTypes from 'prop-types'
import Prism from 'prismjs'
-import Accordion from '../../common/Accordion/Accordion'
import DetailsResults from '../DetailsResults/DetailsResults'
import PreviewError from './PreviewError/PreviewError'
import { Tooltip, TextTooltipTemplate } from 'igz-controls/components'
-import { ReactComponent as Arrow } from 'igz-controls/images/arrow.svg'
-
import { ARTIFACT_PREVIEW_TABLE_ROW_LIMIT } from '../../constants'
import './artifactsPreview.scss'
-const ArtifactsPreviewView = ({
- className,
- preview,
- setShowErrorBody,
- showAccordion,
- showErrorBody
-}) => {
+const ArtifactsPreviewView = ({ className, preview, setShowErrorBody, showErrorBody }) => {
const content = useMemo(
() =>
preview.data && preview.data.content
@@ -49,127 +40,109 @@ const ArtifactsPreviewView = ({
return (
!preview?.hidden && (
- : null}
- iconClassName="expand-icon"
- alwaysOpened={!showAccordion}
- openByDefault={!showAccordion}
- >
-
- {preview.header && (
-
-
{preview.header}
-
- )}
-
- {preview?.type === 'error' ? (
-
- ) : (
- <>
- {preview?.type === 'table-results' && (
-
-
+
+ {preview.header && (
+
+
{preview.header}
+
+ )}
+
+ {preview?.type === 'error' ? (
+
+ ) : (
+ <>
+ {preview?.type === 'table-results' && (
+
+
+
+ )}
+ {preview?.type === 'table' && (
+
+
+ {preview.data.headers.map((header, index) => {
+ return (
+
+ }>
+ {header}
+
+
+ )
+ })}
- )}
- {preview?.type === 'table' && (
-
-
- {preview.data.headers.map((header, index) => {
- return (
-
- }>
- {header}
-
-
- )
- })}
-
-
- {content.map((contentItem, index) => (
-
- {Array.isArray(contentItem) ? (
- contentItem.map(value => (
-
}
- >
- {typeof value === 'object' && value !== null
- ? JSON.stringify(value)
- : String(value)}
-
- ))
- ) : (
+
+ {content.map((contentItem, index) => (
+
+ {Array.isArray(contentItem) ? (
+ contentItem.map(value => (
}
+ key={`${value}${Math.random()}`}
+ template={}
>
- {contentItem}
+ {typeof value === 'object' && value !== null
+ ? JSON.stringify(value)
+ : String(value)}
- )}
-
- ))}
-
-
- )}
- {preview?.type === 'text' &&
{preview?.data.content}
}
- {preview?.type === 'html' && (
-
- )}
- {preview?.type === 'json' && (
-
- )}
- {preview?.type === 'yaml' && (
-
- )}
- {preview?.type === 'image' && (
-

- )}
- {preview?.type === 'unknown' && (
-
- {preview?.data?.content ? preview?.data.content : 'No preview'}
+ ))
+ ) : (
+ }
+ >
+ {contentItem}
+
+ )}
+
+ ))}
- )}
- >
- )}
-
+
+ )}
+ {preview?.type === 'text' &&
{preview?.data.content}
}
+ {preview?.type === 'html' && (
+
+ )}
+ {preview?.type === 'json' && (
+
+ )}
+ {preview?.type === 'yaml' && (
+
+ )}
+ {preview?.type === 'image' && (
+

+ )}
+ {preview?.type === 'unknown' && (
+
+ {preview?.data?.content ? preview?.data.content : 'No preview'}
+
+ )}
+ >
+ )}
-
+
)
)
}
diff --git a/src/components/DetailsPreview/DetailsPreview.js b/src/components/DetailsPreview/DetailsPreview.js
index bffd622732..1b487668fa 100644
--- a/src/components/DetailsPreview/DetailsPreview.js
+++ b/src/components/DetailsPreview/DetailsPreview.js
@@ -98,7 +98,9 @@ const DetailsPreview = ({ artifact, handlePreview }) => {
extraData={extraData}
noData={noData}
preview={preview}
- showExtraDataLoader={artifact.extra_data && extraData.length !== artifact.extra_data.length}
+ showExtraDataLoader={
+ artifact.extra_data && extraData.length !== artifact.extra_data.length
+ }
/>
diff --git a/src/components/DetailsResults/DetailsResults.js b/src/components/DetailsResults/DetailsResults.js
index 9d726e1082..4d13ab9fbb 100644
--- a/src/components/DetailsResults/DetailsResults.js
+++ b/src/components/DetailsResults/DetailsResults.js
@@ -63,128 +63,120 @@ const DetailsResults = ({ allowSortBy, defaultSortBy, defaultDirection, excludeS
) : (
-
-
-
- {job.iterationStats && job.iterationStats.length !== 0 && !job.error ? (
- <>
-
-
- {sortedTableHeaders.map(
- ({ headerLabel, headerId, isSortable, ...tableItem }) => {
- return (
- sortTable(headerId) : null}
- >
- }>
-
-
- {tableItem.tip && }
- |
- )
- }
- )}
-
-
-
- {sortedTableContent.map((tableContentItem, index) => (
-
- {tableContentItem.map((contentItemValue, idx) => {
- if (
- typeof value === 'string' &&
- contentItemValue.match(/completed|running|error/gi)
- ) {
- return (
-
-
- }
- >
-
-
- |
- )
- } else if (
- job.results &&
- contentItemValue === job.results.best_iteration &&
- idx === 0
- ) {
- return (
-
- {contentItemValue}
- }
- className="best-iteration"
- >
-
-
- |
- )
- } else {
- return (
-
-
- }
- >
- {roundFloats(contentItemValue, 4)}
-
- |
- )
- }
- })}
-
- ))}
-
- >
- ) : job.iterations?.length === 0 && Object.keys(job.results ?? {}).length !== 0 ? (
-
- {Object.keys(job.results).map(key => {
- const resultValue = isObjectLike(job.results[key])
- ? JSON.stringify(job.results[key])
- : job.results[key]
-
+
+ {job.iterationStats && job.iterationStats.length !== 0 && !job.error ? (
+ <>
+
+
+ {sortedTableHeaders.map(({ headerLabel, headerId, isSortable, ...tableItem }) => {
return (
-
-
- }
- >
- {key}
-
- |
-
- }
- >
- {resultValue}
-
- |
-
+ sortTable(headerId) : null}
+ >
+ }>
+
+
+ {tableItem.tip && }
+ |
)
})}
-
- ) : null}
-
-
-
+
+
+
+ {sortedTableContent.map((tableContentItem, index) => (
+
+ {tableContentItem.map((contentItemValue, idx) => {
+ if (
+ typeof value === 'string' &&
+ contentItemValue.match(/completed|running|error/gi)
+ ) {
+ return (
+
+
+ }
+ >
+
+
+ |
+ )
+ } else if (
+ job.results &&
+ contentItemValue === job.results.best_iteration &&
+ idx === 0
+ ) {
+ return (
+
+ {contentItemValue}
+ }
+ className="best-iteration"
+ >
+
+
+ |
+ )
+ } else {
+ return (
+
+ }
+ >
+ {roundFloats(contentItemValue, 4)}
+
+ |
+ )
+ }
+ })}
+
+ ))}
+
+ >
+ ) : job.iterations?.length === 0 && Object.keys(job.results ?? {}).length !== 0 ? (
+
+ {Object.keys(job.results).map(key => {
+ const resultValue = isObjectLike(job.results[key])
+ ? JSON.stringify(job.results[key])
+ : job.results[key]
+
+ return (
+
+
+ }
+ >
+ {key}
+
+ |
+
+ }
+ >
+ {resultValue}
+
+ |
+
+ )
+ })}
+
+ ) : null}
+
)
}
diff --git a/src/scss/main.scss b/src/scss/main.scss
index db11410368..66c30a9557 100644
--- a/src/scss/main.scss
+++ b/src/scss/main.scss
@@ -213,7 +213,6 @@ main {
flex: 1;
position: relative;
text-align: left;
- width: 100%;
.table {
&-row {
diff --git a/src/utils/createArtifactPreviewContent.js b/src/utils/createArtifactPreviewContent.js
index da9dcbcb8a..199f5c52c3 100644
--- a/src/utils/createArtifactPreviewContent.js
+++ b/src/utils/createArtifactPreviewContent.js
@@ -19,6 +19,10 @@ such restriction.
*/
import { has, isString } from 'lodash'
+const splitStringToArray = str => {
+ return str.split(/,(?! )/g)
+}
+
export const createArtifactPreviewContent = (res, fileFormat, path, artifactName) => {
const artifact = {}
@@ -30,13 +34,13 @@ export const createArtifactPreviewContent = (res, fileFormat, path, artifactName
let content = data.slice(1)
content.pop()
- content = content.map(item => item.split(','))
+ content = content.map(item => splitStringToArray(item))
artifact.type = 'table-results'
artifact.iterationStats = [headers].concat(content)
} else {
let content = data.slice(1)
- content = content.map(item => item.split(','))
+ content = content.map(item => splitStringToArray(item))
content.pop()
artifact.type = 'table'
artifact.data = {