@@ -105,11 +104,9 @@ import { MarketplacePkgSideload } from './sideload.utils'
],
})
export class SideloadPackageComponent {
- private readonly loader = inject(LoadingService)
- private readonly api = inject(ApiService)
- private readonly errorService = inject(ErrorService)
private readonly exver = inject(Exver)
private readonly patch = inject
>(PatchDB)
+ private readonly dialog = inject(DialogService)
// @Input({ required: true })
// pkg!: MarketplacePkgSideload
@@ -133,20 +130,17 @@ export class SideloadPackageComponent {
readonly flavor$ = this.local$.pipe(map(pkg => !pkg))
- onStatic(type: 'License' | 'Instructions') {
- // @TODO Matt display License or Instructions
- }
-
- async upload() {
- const loader = this.loader.open('Starting upload').subscribe()
-
- try {
- const { upload } = await this.api.sideloadPackage()
- this.api.uploadPackage(upload, this.file).catch(console.error)
- } catch (e: any) {
- this.errorService.handleError(e)
- } finally {
- loader.unsubscribe()
- }
+ // @TODO Alex, struggling to get this working. I don't understand how to use this markdown component, only one other example, and it's very different.
+ onStatic(type: 'license' | 'instructions') {
+ this.dialog
+ .openComponent(MARKDOWN, {
+ label: type === 'license' ? 'License' : 'Instructions',
+ size: 'l',
+ data: {
+ content:
+ this.pkg[type === 'license' ? 'fullLicense' : 'instructions'],
+ },
+ })
+ .subscribe()
}
}
diff --git a/web/projects/ui/src/app/routes/portal/routes/sideload/sideload.utils.ts b/web/projects/ui/src/app/routes/portal/routes/sideload/sideload.utils.ts
index ad1e76901..4d69a301c 100644
--- a/web/projects/ui/src/app/routes/portal/routes/sideload/sideload.utils.ts
+++ b/web/projects/ui/src/app/routes/portal/routes/sideload/sideload.utils.ts
@@ -41,7 +41,7 @@ async function parseS9pk(file: File): Promise {
icon: await s9pk.icon(),
sourceVersion: s9pk.manifest.canMigrateFrom,
flavor: ExtendedVersion.parse(s9pk.manifest.version).flavor,
- license: await s9pk.license(),
+ fullLicense: await s9pk.license(),
instructions: await s9pk.instructions(),
}
}
@@ -77,6 +77,6 @@ function compare(a: Uint8Array, b: Uint8Array) {
}
export type MarketplacePkgSideload = MarketplacePkgBase & {
- license: string
instructions: string
+ fullLicense: string
}