-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Th2-5212] Add option to change default view type of result group,#di…
…splay-table field, option to view last N results of Notebook, file path and timestamp types (#572) * added endpoint for getting file by path * created DisplayTeble component * created ParametersRow component * added option to change viewType of group * added remove node to store * change position of Results Result * add display-table view type * display cut cells from display-table * update table panel's columns width * update launchNotebook and getResults api * fix toggle on Tree's leafs * update display of DispayTable * add margin bottom for JSON veiw types * increase amount of rows for DisplayTable * change display when none node is selected * change split behaviour on selection * added filepath and timestamp parameters * fixed validation of timestamp parameter * fix typing of string and boolean
- Loading branch information
Showing
18 changed files
with
749 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import React from 'react'; | ||
|
||
const shownCapacity = 50; | ||
|
||
const DisplayTable = ({ value }: { value: string[][] | undefined }) => { | ||
const [shownSize, setShownSize] = React.useState(shownCapacity); | ||
if (!value) return <div className='display-table-error'>#display-table is undefined</div>; | ||
|
||
const header = value[0]; | ||
const rows = value.slice(1); | ||
|
||
return ( | ||
<div className='display-table'> | ||
<table style={{ gridTemplateColumns: `repeat(${header.length}, 1fr) 16px` }}> | ||
<thead> | ||
<tr> | ||
{header.map((key, index) => ( | ||
<th key={index}>{key}</th> | ||
))} | ||
<th style={{ width: '16px' }}></th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{rows.slice(0, shownSize).map((row, index) => ( | ||
<tr key={index}> | ||
{row.slice(0, header.length).map((val, ind) => ( | ||
<td key={ind}>{typeof val === 'string' ? `"${val}"` : String(val)}</td> | ||
))} | ||
{row.length < header.length && | ||
Array(header.length - row.length) | ||
.fill('') | ||
.map((_val, ind) => <td key={ind}></td>)} | ||
<td style={{ width: '16px' }}> | ||
{header.length < row.length && ( | ||
<div | ||
className='display-table-info' | ||
title={`Not included extra cells: ${JSON.stringify(row.slice(header.length))}`} | ||
/> | ||
)} | ||
</td> | ||
</tr> | ||
))} | ||
</tbody> | ||
</table> | ||
{shownSize < rows.length && ( | ||
<button | ||
onClick={() => setShownSize(shownSize + shownCapacity)} | ||
className='actions-list__load-button'> | ||
Show More | ||
</button> | ||
)} | ||
</div> | ||
); | ||
}; | ||
|
||
export default DisplayTable; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.