mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-31 04:23:40 +00:00
0.3.0 refactor
ui: adds overlay layer to patch-db-client ui: getting towards mocks ui: cleans up factory init ui: nice type hack ui: live api for patch ui: api service source + http starts up ui: api source + http ui: rework patchdb config, pass stashTimeout into patchDbModel wires in temp patching into api service ui: example of wiring patchdbmodel into page begin integration remove unnecessary method linting first data rendering rework app initialization http source working for ssh delete call temp patches working entire Embassy tab complete not in kansas anymore ripping, saving progress progress for API request response types and endoint defs Update data-model.ts shambles, but in a good way progress big progress progress installed list working big progress progress progress begin marketplace redesign Update api-types.ts Update api-types.ts marketplace improvements cosmetic dependencies and recommendations begin nym auth approach install wizard restore flow and donations
This commit is contained in:
committed by
Aiden McClelland
parent
46f32cb90b
commit
8d01ebe8b2
@@ -1,9 +1,9 @@
|
||||
import { Component, Input, OnInit } from '@angular/core'
|
||||
import { BehaviorSubject, from, Subject } from 'rxjs'
|
||||
import { takeUntil, tap } from 'rxjs/operators'
|
||||
import { DependentBreakage } from 'src/app/models/app-types'
|
||||
import { Breakages } from 'src/app/services/api/api-types'
|
||||
import { markAsLoadingDuring$ } from 'src/app/services/loader.service'
|
||||
import { capitalizeFirstLetter } from 'src/app/util/misc.util'
|
||||
import { capitalizeFirstLetter, isEmptyObject } from 'src/app/util/misc.util'
|
||||
import { Loadable } from '../loadable'
|
||||
import { WizardAction } from '../wizard-types'
|
||||
|
||||
@@ -17,7 +17,7 @@ export class DependentsComponent implements OnInit, Loadable {
|
||||
title: string,
|
||||
action: WizardAction, //Are you sure you want to *uninstall*...,
|
||||
verb: string, // *Uninstalling* will cause problems...
|
||||
fetchBreakages: () => Promise<DependentBreakage[]>,
|
||||
fetchBreakages: () => Promise<Breakages>,
|
||||
skipConfirmationDialogue?: boolean
|
||||
}
|
||||
@Input() transitions: {
|
||||
@@ -27,34 +27,33 @@ export class DependentsComponent implements OnInit, Loadable {
|
||||
error: (e: Error) => void
|
||||
}
|
||||
|
||||
|
||||
dependentBreakages: DependentBreakage[]
|
||||
dependentBreakages: Breakages
|
||||
hasDependentViolation: boolean
|
||||
longMessage: string | null = null
|
||||
$color$ = new BehaviorSubject('medium') // this will display disabled while loading
|
||||
$loading$ = new BehaviorSubject(false)
|
||||
$cancel$ = new Subject<void>()
|
||||
color$ = new BehaviorSubject('medium') // this will display disabled while loading
|
||||
loading$ = new BehaviorSubject(false)
|
||||
cancel$ = new Subject<void>()
|
||||
|
||||
constructor () { }
|
||||
ngOnInit () { }
|
||||
|
||||
load () {
|
||||
this.$color$.next('medium')
|
||||
markAsLoadingDuring$(this.$loading$, from(this.params.fetchBreakages())).pipe(
|
||||
takeUntil(this.$cancel$),
|
||||
tap(breakages => this.dependentBreakages = breakages || []),
|
||||
this.color$.next('medium')
|
||||
markAsLoadingDuring$(this.loading$, from(this.params.fetchBreakages())).pipe(
|
||||
takeUntil(this.cancel$),
|
||||
tap(breakages => this.dependentBreakages = breakages),
|
||||
).subscribe(
|
||||
{
|
||||
complete: () => {
|
||||
this.hasDependentViolation = this.dependentBreakages && this.dependentBreakages.length > 0
|
||||
this.hasDependentViolation = this.dependentBreakages && !isEmptyObject(this.dependentBreakages)
|
||||
if (this.hasDependentViolation) {
|
||||
this.longMessage = `${capitalizeFirstLetter(this.params.verb)} ${this.params.title} will cause the following services to STOP running. Starting them again will require additional actions.`
|
||||
this.$color$.next('warning')
|
||||
this.color$.next('warning')
|
||||
} else if (this.params.skipConfirmationDialogue) {
|
||||
this.transitions.next()
|
||||
} else {
|
||||
this.longMessage = `No other services installed on your Embassy will be affected by this action.`
|
||||
this.$color$.next('success')
|
||||
this.color$.next('success')
|
||||
}
|
||||
},
|
||||
error: (e: Error) => this.transitions.error(new Error(`Fetching dependent service information failed: ${e.message || e}`)),
|
||||
|
||||
Reference in New Issue
Block a user