diff --git a/web/projects/marketplace/package.json b/web/projects/marketplace/package.json index 7eb90d775..93b55aac3 100644 --- a/web/projects/marketplace/package.json +++ b/web/projects/marketplace/package.json @@ -1,6 +1,6 @@ { "name": "@start9labs/marketplace", - "version": "0.3.27", + "version": "0.3.28", "peerDependencies": { "@angular/common": ">=13.2.0", "@angular/core": ">=13.2.0", diff --git a/web/projects/marketplace/src/pages/release-notes/release-notes.component.ts b/web/projects/marketplace/src/pages/release-notes/release-notes.component.ts index a5262b404..8268cf541 100644 --- a/web/projects/marketplace/src/pages/release-notes/release-notes.component.ts +++ b/web/projects/marketplace/src/pages/release-notes/release-notes.component.ts @@ -39,7 +39,21 @@ export class ReleaseNotesComponent { } asIsOrder(a: KeyValue, b: KeyValue) { - return a.key > b.key ? -1 : b.key > a.key ? 1 : 0 + const a1 = a.key.split('.') + const b1 = b.key.split('.') + // contingency in case there's a 4th or 5th version + const len = Math.min(a1.length, b1.length) + // look through each version number and compare. + for (let i = 0; i < len; i++) { + const a2 = +a1[i] || 0 + const b2 = +b1[i] || 0 + + if (a2 !== b2) { + // sort descending + return a2 > b2 ? -1 : 1 + } + } + return a1.length - b1.length } async showReleaseNotes(content: PolymorpheusContent) { diff --git a/web/projects/marketplace/src/pages/show/dependencies/dependency-item.component.ts b/web/projects/marketplace/src/pages/show/dependencies/dependency-item.component.ts index bad76e438..e37e31cc8 100644 --- a/web/projects/marketplace/src/pages/show/dependencies/dependency-item.component.ts +++ b/web/projects/marketplace/src/pages/show/dependencies/dependency-item.component.ts @@ -125,13 +125,15 @@ export class MarketplaceDepItemComponent { getImage(key: string, marketplace: StoreIdentity | null) { const icon = this.pkg.dependencyMetadata[key]?.icon + const camelToSnakeCase = (str: string) => + str.replace(/[A-Z]/g, letter => `-${letter.toLowerCase()}`) if (icon) { try { const iconUrl = new URL(icon) return iconUrl.href } catch (e) { - return `${marketplace?.url}package/v0/icon/${key}` + return `${marketplace?.url}package/v0/icon/${camelToSnakeCase(key)}` } } else { return key.substring(0, 2)