Update Marketplace (#2742)

* update abstract marketplace for usage accuracy andrename store to registry

* use new abstract functions

* fix(marketplace): get rid of `AbstractMarketplaceService`

* bump shared marketplace lib

* update marketplace to use query params for registry url; comment out updates page - will be refactored

* cleanup

* cleanup duplicate

* cleanup unused imports

* rework setting registry url when loading marketplace

* cleanup marketplace service

* fix background

---------

Co-authored-by: Matt Hill <mattnine@protonmail.com>
Co-authored-by: waterplea <alexander@inkin.ru>
Co-authored-by: Matt Hill <MattDHill@users.noreply.github.com>
This commit is contained in:
Lucy
2024-10-09 11:23:08 -06:00
committed by GitHub
parent a9569d0ed9
commit dfda2f7d5d
26 changed files with 688 additions and 807 deletions

View File

@@ -28,7 +28,7 @@
</ng-template>
<!-- license -->
<marketplace-additional-item
(click)="presentModalMd('License')"
(click)="static.emit('License')"
[data]="pkg.license"
label="License"
icon="@tui.chevron-right"
@@ -36,7 +36,7 @@
/>
<!-- instructions -->
<marketplace-additional-item
(click)="presentModalMd('Instructions')"
(click)="static.emit('Instructions')"
data="Click to view instructions"
label="Instructions"
icon="@tui.chevron-right"

View File

@@ -1,15 +1,14 @@
import {
ChangeDetectionStrategy,
Component,
inject,
EventEmitter,
Input,
Output,
} from '@angular/core'
import { ActivatedRoute } from '@angular/router'
import { CopyService } from '@start9labs/shared'
import { TuiDialogService } from '@taiga-ui/core'
import { PolymorpheusComponent } from '@taiga-ui/polymorpheus'
import { CopyService, MarkdownComponent } from '@start9labs/shared'
import { MarketplacePkg } from '../../../types'
import { AbstractMarketplaceService } from '../../../services/marketplace.service'
@Component({
selector: 'marketplace-additional',
@@ -21,7 +20,8 @@ export class AdditionalComponent {
@Input({ required: true })
pkg!: MarketplacePkg
private readonly marketplaceService = inject(AbstractMarketplaceService)
@Output()
readonly static = new EventEmitter<string>()
constructor(
readonly copyService: CopyService,
@@ -30,19 +30,4 @@ export class AdditionalComponent {
) {}
readonly url = this.route.snapshot.queryParamMap.get('url') || undefined
presentModalMd(label: string) {
this.dialogs
.open(new PolymorpheusComponent(MarkdownComponent), {
label,
size: 'l',
data: {
content: this.marketplaceService.fetchStatic$(
this.pkg,
label === 'License' ? 'LICENSE.md' : 'instructions.md',
),
},
})
.subscribe()
}
}

View File

@@ -18,6 +18,7 @@ import { MarketplacePkg } from '../../../types'
tuiCell
[routerLink]="[]"
[queryParams]="{ id: pkg.id, flavor: pkg.flavor }"
queryParamsHandling="merge"
>
<tui-avatar [src]="pkg.icon | trustUrl" />
<span tuiTitle>