dont hard code alpha and beta, use substring detection instead (#2135)

This commit is contained in:
Matt Hill
2023-01-24 11:54:43 -07:00
committed by Aiden McClelland
parent cf70933e21
commit c16404bb2d
4 changed files with 27 additions and 31 deletions

View File

@@ -9,9 +9,7 @@
},
"marketplace": {
"start9": "https://registry.start9.com/",
"community": "https://community-registry.start9.com/",
"beta": "https://beta-registry.start9.com/",
"alpha": "https://alpha-registry-x.start9.com/"
"community": "https://community-registry.start9.com/"
},
"mocks": {
"maskAs": "tor",

View File

@@ -12,8 +12,6 @@ export type WorkspaceConfig = {
marketplace: {
start9: 'https://registry.start9.com/'
community: 'https://community-registry.start9.com/'
beta: 'https://beta-registry.start9.com/'
alpha: 'https://alpha-registry-x.start9.com/'
}
mocks: {
maskAs: 'tor' | 'lan'

View File

@@ -33,30 +33,31 @@ export class MarketplaceListPage {
readonly details$ = this.marketplaceService.getSelectedHost$().pipe(
map(({ url, name }) => {
const { start9, community, beta } = this.config.marketplace
const { start9, community } = this.config.marketplace
let color: string
let description: string
switch (url) {
case start9:
if (url === start9) {
color = 'success'
description =
'Services from this registry are packaged and maintained by the Start9 team. If you experience an issue or have a questions related to a service from this registry, one of our dedicated support staff will be happy to assist you.'
break
case community:
} else if (url === community) {
color = 'tertiary'
description =
'Services from this registry are packaged and maintained by members of the Start9 community. <b>Install at your own risk</b>. If you experience an issue or have a question related to a service in this marketplace, please reach out to the package developer for assistance.'
break
case beta:
color = 'primary'
} else if (url.includes('beta')) {
color = 'warning'
description =
'Services from this registry are undergoing active testing and may contain bugs. <b>Install at your own risk</b>. If you discover a bug or have a suggestion for improvement, please report it to the Start9 team in our community testing channel on Matrix.'
break
default:
'Services from this registry are undergoing <b>beta</b> testing and may contain bugs. <b>Install at your own risk</b>.'
} else if (url.includes('alpha')) {
color = 'danger'
description =
'Services from this registry are undergoing <b>alpha</b> testing. They are expected to contain bugs and could damage your system. <b>Install at your own risk</b>.'
} else {
// alt marketplace
color = 'warning'
description =
'This is a Custom Registry. Start9 cannot verify the integrity or functionality of services from this registry, and they may cause harm to your system. <b>Install at your own risk</b>.'
'This is a Custom Registry. Start9 cannot verify the integrity or functionality of services from this registry, and they could damage your system. <b>Install at your own risk</b>.'
}
return {

View File

@@ -47,10 +47,9 @@ export class UpdatesPage {
]).pipe(
map(([devMode, knownHosts]) => {
if (devMode) return knownHosts
return knownHosts.filter(h => {
const { alpha, beta } = this.config.marketplace
return ![alpha, beta].includes(h.url as any)
})
return knownHosts.filter(
({ url }) => url.includes('alpha') || url.includes('beta'),
)
}),
)