-
Notifications
You must be signed in to change notification settings - Fork 702
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Chart View v2 and other minor changes (#1892)
- Loading branch information
Andres Martinez Gotor
committed
Jul 28, 2020
1 parent
55b916a
commit c8b5673
Showing
34 changed files
with
869 additions
and
128 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
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
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,73 @@ | ||
import ChartMaintainers from "components/ChartView/ChartMaintainers"; | ||
import React from "react"; | ||
import { IChartAttributes, IChartVersion } from "shared/types"; | ||
|
||
interface IChartSummaryProps { | ||
version: IChartVersion; | ||
chartAttrs: IChartAttributes; | ||
} | ||
|
||
function isKubernetesCharts(repoURL: string) { | ||
return ( | ||
repoURL === "https://kubernetes-charts.storage.googleapis.com" || | ||
repoURL === "https://kubernetes-charts-incubator.storage.googleapis.com" | ||
); | ||
} | ||
|
||
export default function ChartSummary({ version, chartAttrs }: IChartSummaryProps) { | ||
return ( | ||
<div className="left-menu"> | ||
{version.attributes.app_version && ( | ||
<section className="left-menu-subsection" aria-labelledby="chartinfo-versions"> | ||
<h5 className="left-menu-subsection-title" id="chartinfo-versions"> | ||
App Version | ||
</h5> | ||
<div>{version.attributes.app_version}</div> | ||
</section> | ||
)} | ||
{chartAttrs.home && ( | ||
<section className="left-menu-subsection" aria-labelledby="chartinfo-versions"> | ||
<h5 className="left-menu-subsection-title" id="chartinfo-versions"> | ||
Home | ||
</h5> | ||
<div> | ||
<a href={chartAttrs.home} target="_blank" rel="noopener noreferrer"> | ||
{chartAttrs.home} | ||
</a> | ||
</div> | ||
</section> | ||
)} | ||
{chartAttrs.maintainers?.length > 0 && ( | ||
<section className="left-menu-subsection" aria-labelledby="chartinfo-versions"> | ||
<h5 className="left-menu-subsection-title" id="chartinfo-versions"> | ||
Maintainers | ||
</h5> | ||
<div> | ||
<ChartMaintainers | ||
maintainers={chartAttrs.maintainers} | ||
githubIDAsNames={isKubernetesCharts(chartAttrs.repo.url)} | ||
/> | ||
</div> | ||
</section> | ||
)} | ||
{chartAttrs.sources?.length > 0 && ( | ||
<section className="left-menu-subsection" aria-labelledby="chartinfo-versions"> | ||
<h5 className="left-menu-subsection-title" id="chartinfo-versions"> | ||
Related | ||
</h5> | ||
<div> | ||
<ul> | ||
{chartAttrs.sources.map((s, i) => ( | ||
<li key={i}> | ||
<a href={s} target="_blank" rel="noopener noreferrer"> | ||
{s} | ||
</a> | ||
</li> | ||
))} | ||
</ul> | ||
</div> | ||
</section> | ||
)} | ||
</div> | ||
); | ||
} |
Oops, something went wrong.