Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove app wiz and dry calls #1541

Merged
merged 5 commits into from
Jun 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions frontend/projects/diagnostic-ui/src/app/pages/home/home.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ export class HomePage {

async restart(): Promise<void> {
const loader = await this.loadingCtrl.create({
spinner: 'lines',
cssClass: 'loader',
})
await loader.present()
Expand All @@ -108,7 +107,6 @@ export class HomePage {

async forgetDrive(): Promise<void> {
const loader = await this.loadingCtrl.create({
spinner: 'lines',
cssClass: 'loader',
})
await loader.present()
Expand All @@ -126,7 +124,6 @@ export class HomePage {

async repairDrive(): Promise<void> {
const loader = await this.loadingCtrl.create({
spinner: 'lines',
cssClass: 'loader',
})
await loader.present()
Expand All @@ -144,10 +141,9 @@ export class HomePage {

async presentAlertRepairDisk() {
const alert = await this.alertCtrl.create({
header: 'RepairDisk',
message: new IonicSafeString(
`<ion-text color="warning">Warning:</ion-text> This action will attempt to preform a disk repair operation and system reboot. No data will be deleted. This action should only be executed if directed by a Start9 support specialist. We recommend backing up your device before preforming this action. If anything happens to the device during the reboot (between the bep and chime), such as loosing power, a power surge, unplugging the drive, or unplugging the Embassy, the filesystem *will* be in an unrecoverable state. Please proceed with caution.`,
),
header: 'Warning',
message:
'This action will attempt to preform a disk repair operation and system reboot. No data will be deleted. This action should only be executed if directed by a Start9 support specialist. We recommend backing up your device before preforming this action. If anything happens to the device during the reboot (between the bep and chime), such as loosing power, a power surge, unplugging the drive, or unplugging the Embassy, the filesystem *will* be in an unrecoverable state. Please proceed with caution.',
buttons: [
{
text: 'Cancel',
Expand All @@ -167,6 +163,7 @@ export class HomePage {
cssClass: 'enter-click',
},
],
cssClass: 'alert-warning-message',
})
await alert.present()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import { MarketplacePkg } from '../types/marketplace-pkg'
import { Marketplace } from '../types/marketplace'

export abstract class AbstractMarketplaceService {
abstract install(id: string, version?: string): Observable<unknown>

abstract getMarketplace(): Observable<Marketplace>

abstract getReleaseNotes(id: string): Observable<Record<string, string>>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Url } from '@start9labs/shared'

import { Dependency } from './dependency'

export interface MarketplaceManifest<T = unknown> {
Expand All @@ -22,6 +21,7 @@ export interface MarketplaceManifest<T = unknown> {
uninstall: string | null
restore: string | null
start: string | null
stop: string | null
}
dependencies: Record<string, Dependency<T>>
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ export class CifsModal {

async submit(): Promise<void> {
const loader = await this.loadingCtrl.create({
spinner: 'lines',
message: 'Connecting to shared folder...',
cssClass: 'loader',
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ export class EmbassyPage {
this.presentModalPassword(drive)
}
},
cssClass: 'enter-click',
},
],
})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import { Injectable } from '@angular/core'
import { ModalController } from '@ionic/angular'
import { Storage } from '@ionic/storage-angular'
import { Observable, of } from 'rxjs'
import { filter, share, switchMap, take, tap } from 'rxjs/operators'
import { isEmptyObject } from '@start9labs/shared'

import { PatchDbService } from 'src/app/services/patch-db/patch-db.service'
import { AuthService } from 'src/app/services/auth.service'
import { DataModel, UIData } from 'src/app/services/patch-db/data-model'
import { EOSService } from 'src/app/services/eos.service'
import { OSWelcomePage } from 'src/app/modals/os-welcome/os-welcome.page'
Expand Down Expand Up @@ -39,9 +37,7 @@ export class PatchDataService extends Observable<DataModel | null> {

constructor(
private readonly patchMonitor: PatchMonitorService,
private readonly authService: AuthService,
private readonly patch: PatchDbService,
private readonly storage: Storage,
private readonly eosService: EOSService,
private readonly config: ConfigService,
private readonly modalCtrl: ModalController,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ export class UpdateToastService extends Observable<unknown> {
}

LOADER: LoadingOptions = {
spinner: 'lines',
message: 'Restarting...',
}

Expand Down
2 changes: 1 addition & 1 deletion frontend/projects/ui/src/app/app/menu/menu.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
{{ page.title }}
</ion-label>
<ion-icon
*ngIf="page.url === '/embassy' && (eosService.updateAvailable$ | async)"
*ngIf="page.url === '/embassy' && (eosService.showUpdate$ | async)"
color="success"
size="small"
name="rocket-outline"
Expand Down
3 changes: 1 addition & 2 deletions frontend/projects/ui/src/app/app/menu/menu.component.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { ChangeDetectionStrategy, Component } from '@angular/core'
import { AlertController } from '@ionic/angular'

import { ConfigService } from '../../services/config.service'
import { LocalStorageService } from '../../services/local-storage.service'
import { EOSService } from '../../services/eos.service'
Expand Down Expand Up @@ -76,8 +75,8 @@ export class MenuComponent {
},
{
text: 'Logout',
cssClass: 'enter-click',
handler: () => this.logout(),
cssClass: 'enter-click',
},
],
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@
*ngIf="slide.selector === 'alert'"
[params]="slide.params"
></alert>
<notes
#components
*ngIf="slide.selector === 'notes'"
[params]="slide.params"
></notes>
<dependents
#components
*ngIf="slide.selector === 'dependents'"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { RouterModule } from '@angular/router'
import { EmverPipesModule } from '@start9labs/shared'
import { DependentsComponentModule } from './dependents/dependents.component.module'
import { CompleteComponentModule } from './complete/complete.component.module'
import { NotesComponentModule } from './notes/notes.component.module'
import { AlertComponentModule } from './alert/alert.component.module'
import { SwiperModule } from 'swiper/angular'

Expand All @@ -19,7 +18,6 @@ import { SwiperModule } from 'swiper/angular'
EmverPipesModule,
DependentsComponentModule,
CompleteComponentModule,
NotesComponentModule,
AlertComponentModule,
SwiperModule,
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { IonContent, ModalController } from '@ionic/angular'
import { CompleteComponent } from './complete/complete.component'
import { DependentsComponent } from './dependents/dependents.component'
import { AlertComponent } from './alert/alert.component'
import { NotesComponent } from './notes/notes.component'
import { WizardAction } from './wizard-types'
import SwiperCore, { Swiper } from 'swiper'
import { IonicSlides } from '@ionic/angular'
Expand Down Expand Up @@ -87,7 +86,6 @@ export class AppWizardComponent {

export type SlideDefinition =
| { selector: 'alert'; params: AlertComponent['params'] }
| { selector: 'notes'; params: NotesComponent['params'] }
| { selector: 'dependents'; params: DependentsComponent['params'] }
| { selector: 'complete'; params: CompleteComponent['params'] }

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

80 changes: 0 additions & 80 deletions frontend/projects/ui/src/app/components/app-wizard/wizard-defs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,6 @@ export class WizardDefs {
},
}
: undefined,
{
selector: 'dependents',
params: {
verb: 'updating',
title,
Fn: () => this.embassyApi.dryUpdatePackage({ id, version }),
},
},
{
selector: 'complete',
params: {
Expand All @@ -67,54 +59,6 @@ export class WizardDefs {
}
}

updateOS(values: {
version: string
releaseNotes: { [version: string]: string }
headline: string
}): AppWizardComponent['params'] {
const { version, releaseNotes, headline } = values

const versions = Object.keys(releaseNotes)
.sort()
.reverse()
.map(version => {
return {
version,
notes: releaseNotes[version],
}
})

const title = 'EmbassyOS'

const slides: SlideDefinition[] = [
{
selector: 'notes',
params: {
versions,
headline,
},
},
{
selector: 'complete',
params: {
verb: 'beginning update for',
title,
Fn: () =>
this.embassyApi.updateServer({
'marketplace-url': this.config.marketplace.url,
}),
},
},
]
return {
action: 'update',
title,
version,
slides: slides.filter(exists),
submitBtn: 'Begin Update',
}
}

downgrade(values: {
id: string
title: string
Expand All @@ -132,14 +76,6 @@ export class WizardDefs {
},
}
: undefined,
{
selector: 'dependents',
params: {
verb: 'downgrading',
title,
Fn: () => this.embassyApi.dryUpdatePackage({ id, version }),
},
},
{
selector: 'complete',
params: {
Expand Down Expand Up @@ -180,14 +116,6 @@ export class WizardDefs {
message: uninstallAlert || defaultUninstallWarning(title),
},
},
{
selector: 'dependents',
params: {
verb: 'uninstalling',
title,
Fn: () => this.embassyApi.dryUninstallPackage({ id }),
},
},
{
selector: 'complete',
params: {
Expand All @@ -210,14 +138,6 @@ export class WizardDefs {
const { title, id } = values

const slides: SlideDefinition[] = [
{
selector: 'dependents',
params: {
verb: 'stopping',
title,
Fn: () => this.embassyApi.dryStopPackage({ id }),
},
},
{
selector: 'complete',
params: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ export class BackupDrivesComponent {

private async addCifs(value: RR.AddBackupTargetReq): Promise<boolean> {
const loader = await this.loadingCtrl.create({
spinner: 'lines',
message: 'Testing connectivity to shared folder...',
})
await loader.present()
Expand Down Expand Up @@ -200,7 +199,6 @@ export class BackupDrivesComponent {
index: number,
): Promise<void> {
const loader = await this.loadingCtrl.create({
spinner: 'lines',
message: 'Testing connectivity to shared folder...',
})
await loader.present()
Expand All @@ -217,7 +215,6 @@ export class BackupDrivesComponent {

private async deleteCifs(id: string, index: number): Promise<void> {
const loader = await this.loadingCtrl.create({
spinner: 'lines',
message: 'Removing...',
})
await loader.present()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ <h2 style="display: flex; align-items: center">
fill="solid"
color="primary"
[disabled]="saving"
(click)="save()"
(click)="tryConfigure()"
class="enter-click btn-128"
[class.no-click]="saving"
>
Expand Down
Loading