-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6064018
commit bc7d4e9
Showing
15 changed files
with
124 additions
and
59 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
19 changes: 19 additions & 0 deletions
19
ontrack-web-core/components/framework/search/SearchResultComponent.js
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,19 @@ | ||
import {Space, Typography} from "antd"; | ||
import Link from "next/link"; | ||
|
||
export default function SearchResultComponent({title, link, description}) { | ||
return ( | ||
<> | ||
<Space direction="vertical"> | ||
{ | ||
link && | ||
<Link href={link}>{title}</Link> | ||
} | ||
{ | ||
!link && title | ||
} | ||
<Typography.Paragraph type="secondary">{description}</Typography.Paragraph> | ||
</Space> | ||
</> | ||
) | ||
} |
8 changes: 8 additions & 0 deletions
8
ontrack-web-core/components/framework/search/branch/Result.js
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,8 @@ | ||
import SearchResultComponent from "@components/framework/search/SearchResultComponent"; | ||
|
||
export default function Result({data}) { | ||
return <SearchResultComponent | ||
title="TODO" | ||
description={JSON.stringify(data)} | ||
/> | ||
} |
8 changes: 8 additions & 0 deletions
8
ontrack-web-core/components/framework/search/build-link/Result.js
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,8 @@ | ||
import SearchResultComponent from "@components/framework/search/SearchResultComponent"; | ||
|
||
export default function Result({data}) { | ||
return <SearchResultComponent | ||
title="TODO" | ||
description={JSON.stringify(data)} | ||
/> | ||
} |
8 changes: 8 additions & 0 deletions
8
ontrack-web-core/components/framework/search/build-meta-info/Result.js
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,8 @@ | ||
import SearchResultComponent from "@components/framework/search/SearchResultComponent"; | ||
|
||
export default function Result({data}) { | ||
return <SearchResultComponent | ||
title="TODO" | ||
description={JSON.stringify(data)} | ||
/> | ||
} |
8 changes: 8 additions & 0 deletions
8
ontrack-web-core/components/framework/search/build-release/Result.js
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,8 @@ | ||
import SearchResultComponent from "@components/framework/search/SearchResultComponent"; | ||
|
||
export default function Result({data}) { | ||
return <SearchResultComponent | ||
title="TODO" | ||
description={JSON.stringify(data)} | ||
/> | ||
} |
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,8 @@ | ||
import SearchResultComponent from "@components/framework/search/SearchResultComponent"; | ||
|
||
export default function Result({data}) { | ||
return <SearchResultComponent | ||
title="TODO" | ||
description={JSON.stringify(data)} | ||
/> | ||
} |
8 changes: 8 additions & 0 deletions
8
ontrack-web-core/components/framework/search/git-branch/Result.js
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,8 @@ | ||
import SearchResultComponent from "@components/framework/search/SearchResultComponent"; | ||
|
||
export default function Result({data}) { | ||
return <SearchResultComponent | ||
title="TODO" | ||
description={JSON.stringify(data)} | ||
/> | ||
} |
10 changes: 6 additions & 4 deletions
10
ontrack-web-core/components/framework/search/git-commit/Result.js
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 |
---|---|---|
@@ -1,6 +1,8 @@ | ||
import SearchResultComponent from "@components/framework/search/SearchResultComponent"; | ||
|
||
export default function Result({data}) { | ||
return { | ||
title: data.item.commitShort, | ||
description: data.item.commitMessage, | ||
} | ||
return <SearchResultComponent | ||
title={data.item.commitShort} | ||
description={data.item.commitMessage} | ||
/> | ||
} |
8 changes: 8 additions & 0 deletions
8
ontrack-web-core/components/framework/search/git-issue/Result.js
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,8 @@ | ||
import SearchResultComponent from "@components/framework/search/SearchResultComponent"; | ||
|
||
export default function Result({data}) { | ||
return <SearchResultComponent | ||
title="TODO" | ||
description={JSON.stringify(data)} | ||
/> | ||
} |
9 changes: 9 additions & 0 deletions
9
ontrack-web-core/components/framework/search/project/Result.js
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,9 @@ | ||
import SearchResultComponent from "@components/framework/search/SearchResultComponent"; | ||
import ProjectLink from "@components/projects/ProjectLink"; | ||
|
||
export default function Result({data}) { | ||
return <SearchResultComponent | ||
title={<ProjectLink project={data.project}/>} | ||
description="" | ||
/> | ||
} |
8 changes: 8 additions & 0 deletions
8
ontrack-web-core/components/framework/search/scm-catalog/Result.js
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,8 @@ | ||
import SearchResultComponent from "@components/framework/search/SearchResultComponent"; | ||
|
||
export default function Result({data}) { | ||
return <SearchResultComponent | ||
title="TODO" | ||
description={JSON.stringify(data)} | ||
/> | ||
} |
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 |
---|---|---|
@@ -1,43 +1,9 @@ | ||
import {Space, Typography} from "antd"; | ||
import Link from "next/link"; | ||
import {callDynamicFunction} from "@components/common/DynamicFunction"; | ||
import {useEffect, useState} from "react"; | ||
import {Dynamic} from "@components/common/Dynamic"; | ||
|
||
export default function SearchResult({type, result}) { | ||
|
||
const [typedResult, setTypedResult] = useState({ | ||
title: '', | ||
link: '', | ||
description: '' | ||
}) | ||
|
||
useEffect(() => { | ||
|
||
const loadTypedResult = async () => { | ||
const data = await callDynamicFunction(`framework/search/${type.id}/Result`, result); | ||
setTypedResult(data) | ||
} | ||
|
||
// noinspection JSIgnoredPromiseFromCall | ||
loadTypedResult() | ||
}, [type, result]) | ||
|
||
|
||
return ( | ||
<> | ||
{ | ||
typedResult && | ||
<Space direction="vertical"> | ||
{ | ||
typedResult.link && | ||
<Link href={typedResult.link}>{typedResult.title}</Link> | ||
} | ||
{ | ||
!typedResult.link && typedResult.title | ||
} | ||
<Typography.Paragraph type="secondary">{typedResult.description}</Typography.Paragraph> | ||
</Space> | ||
} | ||
<Dynamic path={`framework/search/${type.id}/Result`} props={result}/> | ||
</> | ||
) | ||
} |
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