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

@@ -0,0 +1,8 @@
import { NgModule } from '@angular/core'
import { GuidPipe } from './guid.pipe'
@NgModule({
declarations: [GuidPipe],
exports: [GuidPipe],
})
export class GuidPipePipesModule {}

View File

@@ -0,0 +1,11 @@
import { Pipe, PipeTransform } from '@angular/core'
import { DiskInfo } from '../../types/api'
@Pipe({
name: 'guid',
})
export class GuidPipe implements PipeTransform {
transform(disk: DiskInfo): string | null {
return disk.guid || disk.partitions.find(p => p.guid)?.guid || null
}
}