mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-04-04 14:29:45 +00:00
working
This commit is contained in:
committed by
Aiden McClelland
parent
635072bf29
commit
f6a351b903
@@ -12,6 +12,7 @@ import { pauseFor } from 'src/app/util/misc.util'
|
|||||||
import { AvailableShow } from 'src/app/services/api/api-types'
|
import { AvailableShow } from 'src/app/services/api/api-types'
|
||||||
import { PatchDbModel } from 'src/app/models/patch-db/patch-db-model'
|
import { PatchDbModel } from 'src/app/models/patch-db/patch-db-model'
|
||||||
import { PackageState } from 'src/app/models/patch-db/data-model'
|
import { PackageState } from 'src/app/models/patch-db/data-model'
|
||||||
|
import { ReleaseNoteModel } from '../app-release-notes-list/release-notes'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-available-show',
|
selector: 'app-available-show',
|
||||||
@@ -41,6 +42,7 @@ export class AppAvailableShowPage {
|
|||||||
private readonly popoverController: PopoverController,
|
private readonly popoverController: PopoverController,
|
||||||
private readonly emver: Emver,
|
private readonly emver: Emver,
|
||||||
public readonly patch: PatchDbModel,
|
public readonly patch: PatchDbModel,
|
||||||
|
public releaseNotesModel: ReleaseNoteModel,
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
async ngOnInit () {
|
async ngOnInit () {
|
||||||
@@ -53,6 +55,7 @@ export class AppAvailableShowPage {
|
|||||||
this.loading = true
|
this.loading = true
|
||||||
try {
|
try {
|
||||||
this.pkg = await this.apiService.getAvailableShow({ id: this.pkgId, version })
|
this.pkg = await this.apiService.getAvailableShow({ id: this.pkgId, version })
|
||||||
|
this.releaseNotesModel.releaseNotes = this.pkg['release-notes']
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e)
|
console.error(e)
|
||||||
this.error = e.message
|
this.error = e.message
|
||||||
|
|||||||
@@ -8,10 +8,10 @@
|
|||||||
</ion-header>
|
</ion-header>
|
||||||
|
|
||||||
<ion-content>
|
<ion-content>
|
||||||
<ion-spinner *ngIf="!pkg; else loaded" class="center" name="lines" color="warning"></ion-spinner>
|
<ion-spinner *ngIf="!releaseNotes; else loaded" class="center" name="lines" color="warning"></ion-spinner>
|
||||||
|
|
||||||
<ng-template #loaded>
|
<ng-template #loaded>
|
||||||
<div *ngFor="let note of pkg['release-notes'] | keyvalue : asIsOrder">
|
<div *ngFor="let note of releaseNotes | keyvalue : asIsOrder">
|
||||||
<ion-button (click)="setSelected(note.key)" expand="full" color="light" style="height: 50px;" >
|
<ion-button (click)="setSelected(note.key)" expand="full" color="light" style="height: 50px;" >
|
||||||
<p style="position: absolute; left: 10px;">{{note.key | displayEmver}}</p>
|
<p style="position: absolute; left: 10px;">{{note.key | displayEmver}}</p>
|
||||||
</ion-button>
|
</ion-button>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Component } from '@angular/core'
|
import { Component } from '@angular/core'
|
||||||
import { ActivatedRoute } from '@angular/router'
|
import { ActivatedRoute } from '@angular/router'
|
||||||
import { AvailableShow } from 'src/app/services/api/api-types'
|
|
||||||
import { ApiService } from 'src/app/services/api/api.service'
|
import { ApiService } from 'src/app/services/api/api.service'
|
||||||
|
import { ReleaseNoteModel } from './release-notes'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-release-notes-list',
|
selector: 'app-release-notes-list',
|
||||||
@@ -9,32 +9,34 @@ import { ApiService } from 'src/app/services/api/api.service'
|
|||||||
styleUrls: ['./app-release-notes-list.page.scss'],
|
styleUrls: ['./app-release-notes-list.page.scss'],
|
||||||
})
|
})
|
||||||
export class AppReleaseNotesListPage {
|
export class AppReleaseNotesListPage {
|
||||||
loading = true
|
|
||||||
error = ''
|
error = ''
|
||||||
pkgId: string
|
pkgId: string
|
||||||
pkg: AvailableShow
|
releaseNotes: { [version: string]: string}
|
||||||
selected: string
|
selected: string
|
||||||
|
|
||||||
constructor (
|
constructor (
|
||||||
private readonly route: ActivatedRoute,
|
private readonly route: ActivatedRoute,
|
||||||
private readonly apiService: ApiService,
|
private readonly apiService: ApiService,
|
||||||
|
private releaseNoteModel: ReleaseNoteModel,
|
||||||
) { }
|
) {
|
||||||
|
console.log('model model', releaseNoteModel.releaseNotes)
|
||||||
|
this.releaseNotes = releaseNoteModel.releaseNotes
|
||||||
|
}
|
||||||
|
|
||||||
ngOnInit () {
|
ngOnInit () {
|
||||||
this.pkgId = this.route.snapshot.paramMap.get('pkgId')
|
this.pkgId = this.route.snapshot.paramMap.get('pkgId')
|
||||||
this.getPkg()
|
if (!this.releaseNotes) {
|
||||||
|
this.getReleaseNotes()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async getPkg (version?: string): Promise<void> {
|
async getReleaseNotes (version?: string): Promise<void> {
|
||||||
this.loading = true
|
|
||||||
try {
|
try {
|
||||||
this.pkg = await this.apiService.getAvailableShow({ id: this.pkgId, version })
|
const pkg = await this.apiService.getAvailableShow({ id: this.pkgId, version })
|
||||||
|
this.releaseNotes = pkg['release-notes']
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e)
|
console.error(e)
|
||||||
this.error = e.message
|
this.error = e.message
|
||||||
} finally {
|
|
||||||
this.loading = false
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
import { Injectable } from '@angular/core'
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root',
|
||||||
|
})
|
||||||
|
export class ReleaseNoteModel {
|
||||||
|
releaseNotes: { [version: string]: string}
|
||||||
|
|
||||||
|
constructor () { }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user