Skip to content

Commit

Permalink
Web: Source Code Facets (#2833)
Browse files Browse the repository at this point in the history
* Adding source code facets.

* Adding source code facets.

Signed-off-by: phix <[email protected]>

---------

Signed-off-by: phix <[email protected]>
Co-authored-by: phix <[email protected]>
  • Loading branch information
phixMe and phix committed Jun 5, 2024
1 parent 635ad9b commit 8bfea3f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions web/src/components/core/code/MqCode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ interface OwnProps {
}

const MqCode: React.FC<OwnProps> = ({ code, description, language }) => {
if (!code) {
return null
}
return (
<Box>
{description && (
Expand Down
13 changes: 13 additions & 0 deletions web/src/components/jobs/RunInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ export interface SqlFacet {
query: string
}

export interface SourceCodeFacet {
language: string
sourceCode: string
_producer: string
_schemaURL: string
}

type RunInfoProps = {
run: Run
} & JobFacetsProps &
Expand All @@ -52,6 +59,12 @@ const RunInfo: FunctionComponent<RunInfoProps> = (props) => {
return (
<Box>
{<MqCode code={(jobFacets?.sql as SqlFacet)?.query} language={'sql'} />}
{
<MqCode
code={(jobFacets.sourceCode as SourceCodeFacet)?.sourceCode}
language={(jobFacets.sourceCode as SourceCodeFacet)?.language}
/>
}
{run.facets && (
<Box mt={2}>
<Box mb={1}>
Expand Down

0 comments on commit 8bfea3f

Please sign in to comment.