-
Notifications
You must be signed in to change notification settings - Fork 319
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[feat] Show logged artifacts in Aim UI (#3114)
* [feat] Add artifacts info in Run's info web API response * [feat] Add ability to specify the icon in CopyToClipboard component * [feat] Add artifacts card component * [feat] Add artifacts card in Run detail page overview tab * [doc] Update changelog
- Loading branch information
1 parent
285dec9
commit f83fe1b
Showing
10 changed files
with
140 additions
and
2 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
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
4 changes: 4 additions & 0 deletions
4
.../pages/RunDetail/RunOverviewTab/components/ArtifactsCard/RunOverviewTabArtifactsCard.d.ts
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,4 @@ | ||
export interface IRunOverviewTabArtifactsCardProps { | ||
artifacts: { [key: string]: string }; | ||
isRunInfoLoading: boolean; | ||
} |
97 changes: 97 additions & 0 deletions
97
...c/pages/RunDetail/RunOverviewTab/components/ArtifactsCard/RunOverviewTabArtifactsCard.tsx
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,97 @@ | ||
import React from 'react'; | ||
|
||
import { IconEye } from '@tabler/icons-react'; | ||
|
||
import { Card, Text } from 'components/kit'; | ||
import ErrorBoundary from 'components/ErrorBoundary/ErrorBoundary'; | ||
import BusyLoaderWrapper from 'components/BusyLoaderWrapper/BusyLoaderWrapper'; | ||
import { ICardProps } from 'components/kit/Card/Card.d'; | ||
import CopyToClipBoard from 'components/CopyToClipBoard/CopyToClipBoard'; | ||
|
||
import { formatValue } from 'utils/formatValue'; | ||
|
||
import { IRunOverviewTabArtifactsCardProps } from './RunOverviewTabArtifactsCard.d'; | ||
|
||
function RunOverviewTabArtifactsCard({ | ||
artifacts, | ||
isRunInfoLoading, | ||
}: IRunOverviewTabArtifactsCardProps) { | ||
const tableData = React.useMemo(() => artifacts, [artifacts]); | ||
|
||
const dataListProps = React.useMemo( | ||
(): ICardProps['dataListProps'] => ({ | ||
calcTableHeight: true, | ||
tableColumns: [ | ||
{ | ||
dataKey: 'name', | ||
key: 'name', | ||
width: '20%', | ||
title: ( | ||
<Text weight={600} size={14} tint={100}> | ||
Name | ||
<Text | ||
weight={600} | ||
size={14} | ||
tint={50} | ||
className='RunOverviewTab__cardBox__tableTitleCount' | ||
> | ||
({tableData.length}) | ||
</Text> | ||
</Text> | ||
), | ||
cellRenderer: ({ cellData }: any) => ( | ||
<p title={cellData}>{cellData}</p> | ||
), | ||
}, | ||
{ | ||
dataKey: 'path', | ||
key: 'path', | ||
width: '40%', | ||
title: 'Path', | ||
cellRenderer: ({ cellData }: any) => ( | ||
<p title={cellData}>{cellData}</p> | ||
), | ||
}, | ||
{ | ||
dataKey: 'uri', | ||
key: 'uri', | ||
width: '40%', | ||
title: 'URI', | ||
cellRenderer: ({ cellData }: any) => ( | ||
<div> | ||
<Text size={14}>{cellData}</Text> | ||
<CopyToClipBoard | ||
iconSize='xSmall' | ||
isURL='true' | ||
copyContent={cellData} | ||
/> | ||
</div> | ||
), | ||
}, | ||
], | ||
tableData, | ||
illustrationConfig: { | ||
size: 'large', | ||
title: 'No Results', | ||
}, | ||
}), | ||
[tableData], | ||
); | ||
return ( | ||
<ErrorBoundary> | ||
<BusyLoaderWrapper isLoading={isRunInfoLoading} height='100%'> | ||
<Card | ||
title='Run Artifacts' | ||
className='RunOverviewTab__cardBox' | ||
dataListProps={dataListProps} | ||
/> | ||
</BusyLoaderWrapper> | ||
</ErrorBoundary> | ||
); | ||
} | ||
|
||
RunOverviewTabArtifactsCard.displayName = 'RunOverviewTabArtifactsCard'; | ||
|
||
export default React.memo<IRunOverviewTabArtifactsCardProps>( | ||
RunOverviewTabArtifactsCard, | ||
); |
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