Add guid to partition type (#1932)

* add guid to partitions and implement pipe in shared to return guid for any disk

* fix bug and clean up
This commit is contained in:
Matt Hill
2022-11-10 10:20:52 -07:00
committed by Aiden McClelland
parent 22b273b145
commit 45a6a930c9
21 changed files with 393 additions and 131 deletions

View File

@@ -10,7 +10,7 @@ import {
BackupRecoverySource,
DiskRecoverySource,
} from 'src/app/services/api/api.service'
import { DiskInfo, ErrorToastService } from '@start9labs/shared'
import { DiskInfo, ErrorToastService, GuidPipe } from '@start9labs/shared'
import { StateService } from 'src/app/services/state.service'
import { PasswordPage } from '../../modals/password/password.page'
import { ActivatedRoute } from '@angular/router'
@@ -19,6 +19,7 @@ import { ActivatedRoute } from '@angular/router'
selector: 'app-embassy',
templateUrl: 'embassy.page.html',
styleUrls: ['embassy.page.scss'],
providers: [GuidPipe],
})
export class EmbassyPage {
storageDrives: DiskInfo[] = []
@@ -32,6 +33,7 @@ export class EmbassyPage {
private readonly stateService: StateService,
private readonly loadingCtrl: LoadingController,
private readonly errorToastService: ErrorToastService,
private readonly guidPipe: GuidPipe,
private route: ActivatedRoute,
) {}
@@ -71,7 +73,10 @@ export class EmbassyPage {
}
async chooseDrive(drive: DiskInfo) {
if (!!drive.partitions.find(p => p.used) || !!drive.guid) {
if (
this.guidPipe.transform(drive) ||
!!drive.partitions.find(p => p.used)
) {
const alert = await this.alertCtrl.create({
header: 'Warning',
subHeader: 'Drive contains data!',