mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 02:11:53 +00:00
Feat/marketplace show links (#2105)
* closes #2084, rearranges marketplace show, app show, and donation link for Start9 * use url query param if present when fetching license and instructions * remove log * chore: Add some checking * chore: Update something about validation * chore: Update to use correct default Co-authored-by: BluJ <mogulslayer@gmail.com>
This commit is contained in:
committed by
Aiden McClelland
parent
212e94756b
commit
46222e9352
@@ -36,6 +36,19 @@
|
||||
</ion-label>
|
||||
<ion-icon slot="end" name="chevron-forward"></ion-icon>
|
||||
</ion-item>
|
||||
<ion-item
|
||||
[href]="manifest['marketing-site']"
|
||||
[disabled]="!manifest['marketing-site']"
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
detail="false"
|
||||
>
|
||||
<ion-label>
|
||||
<h2>Marketing Site</h2>
|
||||
<p>{{ manifest['marketing-site'] || 'Not provided' }}</p>
|
||||
</ion-label>
|
||||
<ion-icon slot="end" name="open-outline"></ion-icon>
|
||||
</ion-item>
|
||||
</ion-item-group>
|
||||
</ion-col>
|
||||
<ion-col sizeXs="12" sizeMd="6">
|
||||
@@ -77,6 +90,19 @@
|
||||
</ion-label>
|
||||
<ion-icon slot="end" name="open-outline"></ion-icon>
|
||||
</ion-item>
|
||||
<ion-item
|
||||
[href]="manifest['donation-url']"
|
||||
[disabled]="!manifest['donation-url']"
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
detail="false"
|
||||
>
|
||||
<ion-label>
|
||||
<h2>Donation Link</h2>
|
||||
<p>{{ manifest['donation-url'] || 'Not provided' }}</p>
|
||||
</ion-label>
|
||||
<ion-icon slot="end" name="open-outline"></ion-icon>
|
||||
</ion-item>
|
||||
</ion-item-group>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { Inject, Pipe, PipeTransform } from '@angular/core'
|
||||
import { Pipe, PipeTransform } from '@angular/core'
|
||||
import { ActivatedRoute } from '@angular/router'
|
||||
import { DOCUMENT } from '@angular/common'
|
||||
import { AlertController, ModalController, NavController } from '@ionic/angular'
|
||||
import { ModalController, NavController } from '@ionic/angular'
|
||||
import { MarkdownComponent } from '@start9labs/shared'
|
||||
import {
|
||||
DataModel,
|
||||
@@ -26,8 +25,6 @@ export interface Button {
|
||||
})
|
||||
export class ToButtonsPipe implements PipeTransform {
|
||||
constructor(
|
||||
@Inject(DOCUMENT) private readonly document: Document,
|
||||
private readonly alertCtrl: AlertController,
|
||||
private readonly route: ActivatedRoute,
|
||||
private readonly navCtrl: NavController,
|
||||
private readonly modalCtrl: ModalController,
|
||||
@@ -97,13 +94,6 @@ export class ToButtonsPipe implements PipeTransform {
|
||||
},
|
||||
// view in marketplace
|
||||
this.viewInMarketplaceButton(pkg),
|
||||
// donate
|
||||
{
|
||||
action: () => this.donate(pkg),
|
||||
title: 'Donate',
|
||||
description: `Support ${pkgTitle}`,
|
||||
icon: 'logo-bitcoin',
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
@@ -148,17 +138,4 @@ export class ToButtonsPipe implements PipeTransform {
|
||||
|
||||
return button
|
||||
}
|
||||
|
||||
private async donate({ manifest }: PackageDataEntry): Promise<void> {
|
||||
const url = manifest['donation-url']
|
||||
if (url) {
|
||||
this.document.defaultView?.open(url, '_blank', 'noreferrer')
|
||||
} else {
|
||||
const alert = await this.alertCtrl.create({
|
||||
header: 'Not Accepting Donations',
|
||||
message: `The developers of ${manifest.title} have not provided a donation URL. Please contact them directly if you insist on giving them money.`,
|
||||
})
|
||||
await alert.present()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -519,6 +519,19 @@ export class ServerShowPage {
|
||||
detail: true,
|
||||
disabled$: of(false),
|
||||
},
|
||||
{
|
||||
title: 'Donate to Start9',
|
||||
description: `Support embassyOS development`,
|
||||
icon: 'logo-bitcoin',
|
||||
action: () =>
|
||||
this.document.defaultView?.open(
|
||||
'https://donate.start9.com',
|
||||
'_blank',
|
||||
'noreferrer',
|
||||
),
|
||||
detail: true,
|
||||
disabled$: of(false),
|
||||
},
|
||||
],
|
||||
Power: [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user