chore: cleanup and small misc fixes

display success alert if on latest EOS after check for update

fix bug with loader dismiss after alert present

fix restart button on update complete alert and fix mocks to account for this state

fix make clean and adjust default registry names
This commit is contained in:
Lucy Cifferello
2022-06-14 18:38:36 -06:00
committed by Lucy C
parent 4ad9886517
commit 37304a9d92
28 changed files with 221 additions and 130 deletions

View File

@@ -1,7 +1,6 @@
.bulb {
position: absolute !important;
left: 9px !important;
top: 8px !important;
top: 6px !important;
height: 14px;
width: 14px;
border-radius: 100%;
@@ -10,7 +9,6 @@
.warning-icon {
position: absolute !important;
left: 6px !important;
top: 6px !important;
font-size: 12px;
border-radius: 100%;
@@ -21,7 +19,6 @@
.spinner {
position: absolute !important;
left: 6px !important;
top: 6px !important;
width: 18px;
}

View File

@@ -12,19 +12,10 @@ import { ValueSpecObject } from 'src/app/pkg-config/config-types'
import { GenericFormPage } from 'src/app/modals/generic-form/generic-form.page'
import { PatchDbService } from '../../../services/patch-db/patch-db.service'
import { v4 } from 'uuid'
import {
UIData,
UIMarketplaceData,
} from '../../../services/patch-db/data-model'
import { UIMarketplaceData } from '../../../services/patch-db/data-model'
import { ConfigService } from '../../../services/config.service'
import { MarketplaceService } from 'src/app/services/marketplace.service'
import {
distinctUntilChanged,
finalize,
first,
map,
startWith,
} from 'rxjs/operators'
import { distinctUntilChanged, finalize, first } from 'rxjs/operators'
type Marketplaces = {
id: string | undefined
@@ -55,11 +46,8 @@ export class MarketplacesPage {
ngOnInit() {
this.patch
.watch$('ui')
.pipe(
map((ui: UIData) => ui.marketplace),
distinctUntilChanged(),
)
.watch$('ui', 'marketplace')
.pipe(distinctUntilChanged())
.subscribe((mp: UIMarketplaceData | undefined) => {
let marketplaces: Marketplaces = [
{
@@ -114,8 +102,7 @@ export class MarketplacesPage {
async presentAction(id: string = '') {
// no need to view actions if is selected marketplace
if (!id || id === this.patch.getData().ui.marketplace?.['selected-id'])
return
if (id === this.patch.getData().ui.marketplace?.['selected-id']) return
const buttons: ActionSheetButton[] = [
{

View File

@@ -16,6 +16,7 @@ import { WizardDefs } from 'src/app/components/app-wizard/wizard-defs'
import { exists, isEmptyObject, ErrorToastService } from '@start9labs/shared'
import { EOSService } from 'src/app/services/eos.service'
import { LocalStorageService } from 'src/app/services/local-storage.service'
import { RecoveredPackageDataEntry } from 'src/app/services/patch-db/data-model'
@Component({
selector: 'server-show',
@@ -47,7 +48,7 @@ export class ServerShowPage {
this.patch
.watch$('recovered-packages')
.pipe(filter(exists), take(1))
.subscribe(rps => {
.subscribe((rps: { [id: string]: RecoveredPackageDataEntry }) => {
this.hasRecoveredPackage = !isEmptyObject(rps)
})
}
@@ -233,16 +234,36 @@ export class ServerShowPage {
try {
const updateAvailable = await this.eosService.getEOS()
await loader.dismiss()
if (updateAvailable) {
this.updateEos()
} else {
this.presentAlertLatest()
}
} catch (e: any) {
await loader.dismiss()
this.errToast.present(e)
} finally {
loader.dismiss()
}
}
async presentAlertLatest() {
const alert = await this.alertCtrl.create({
header: 'Up to date!',
message: 'You are on the latest version of EmbassyOS.',
buttons: [
{
text: 'OK',
role: 'cancel',
cssClass: 'enter-click',
},
],
cssClass: 'alert-success-message',
})
alert.present()
}
settings: ServerSettings = {
Backups: [
{
@@ -332,8 +353,8 @@ export class ServerShowPage {
disabled: of(false),
},
{
title: 'Manually install a service',
description: `Install a service by drag n' drop`,
title: 'Manually Install A Service',
description: `Install a service by drag and drop`,
icon: 'push-outline',
action: () =>
this.navCtrl.navigateForward(['sideload'], {

View File

@@ -3,7 +3,7 @@
<ion-buttons slot="start">
<ion-back-button defaultHref="embassy"></ion-back-button>
</ion-buttons>
<ion-title>Manually install a service</ion-title>
<ion-title>Manually Install A Service</ion-title>
</ion-toolbar>
</ion-header>