diff --git a/src/ui/src/app/chart-details/chart-details-versions/chart-details-versions.component.html b/src/ui/src/app/chart-details/chart-details-versions/chart-details-versions.component.html index 264f5cc7b..bd1231498 100644 --- a/src/ui/src/app/chart-details/chart-details-versions/chart-details-versions.component.html +++ b/src/ui/src/app/chart-details/chart-details-versions/chart-details-versions.component.html @@ -1,12 +1,15 @@

Chart Versions

-
+
{{ version.attributes.version }} - {{ version.attributes.created | date: 'MMM d, y' }}
+

Application Version

diff --git a/src/ui/src/app/chart-details/chart-details-versions/chart-details-versions.component.scss b/src/ui/src/app/chart-details/chart-details-versions/chart-details-versions.component.scss index 48b791938..d11221aed 100644 --- a/src/ui/src/app/chart-details/chart-details-versions/chart-details-versions.component.scss +++ b/src/ui/src/app/chart-details/chart-details-versions/chart-details-versions.component.scss @@ -3,6 +3,9 @@ h1 { margin-top: 0; } + .more-link { + margin-top: .5em; + } } .version { diff --git a/src/ui/src/app/chart-details/chart-details-versions/chart-details-versions.component.ts b/src/ui/src/app/chart-details/chart-details-versions/chart-details-versions.component.ts index badcaa949..a1c5327e5 100644 --- a/src/ui/src/app/chart-details/chart-details-versions/chart-details-versions.component.ts +++ b/src/ui/src/app/chart-details/chart-details-versions/chart-details-versions.component.ts @@ -10,6 +10,7 @@ import { ChartAttributes } from '../../shared/models/chart'; export class ChartDetailsVersionsComponent implements OnInit { @Input() versions: ChartVersion[] @Input() currentVersion: ChartVersion + showAllVersions: boolean constructor() { } ngOnInit() { } @@ -22,4 +23,19 @@ export class ChartDetailsVersionsComponent implements OnInit { isSelected(version: ChartVersion): boolean { return version.attributes.version == this.currentVersion.attributes.version; } + + showMoreLink(): boolean { + return this.versions && this.versions.length > 5 && !this.showAllVersions; + } + + setShowAllVersions() { + this.showAllVersions = true; + } + + shownVersions(versions: ChartVersion[]): ChartVersion[] { + if (this.versions) { + return this.showAllVersions ? this.versions : this.versions.slice(0, 5); + } + return []; + } }