Skip to content

Commit

Permalink
Merge pull request #2709 from Start9Labs/fix-build
Browse files Browse the repository at this point in the history
fix: fix build after minor merged into major
  • Loading branch information
MattDHill authored Aug 16, 2024
2 parents b43ad93 + 0abe08f commit 76eb0f1
Show file tree
Hide file tree
Showing 198 changed files with 974 additions and 3,993 deletions.
18 changes: 0 additions & 18 deletions web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
"@taiga-ui/cdk": "4.0.0-rc.7",
"@taiga-ui/core": "4.0.0-rc.7",
"@taiga-ui/event-plugins": "^4.0.1",
"@taiga-ui/experimental": "4.0.0-rc.7",
"@taiga-ui/icons": "4.0.0-rc.7",
"@taiga-ui/kit": "4.0.0-rc.7",
"@taiga-ui/layout": "4.0.0-rc.7",
Expand Down
2 changes: 2 additions & 0 deletions web/projects/marketplace/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"@angular/core": ">=13.2.0",
"@start9labs/shared": ">=0.3.2",
"@taiga-ui/cdk": "4.0.0-rc.6",
"@taiga-ui/core": "4.0.0-rc.6",
"@taiga-ui/layout": "4.0.0-rc.6",
"@tinkoff/ng-dompurify": ">=4.0.0",
"fuse.js": "^6.4.6"
},
Expand Down
90 changes: 90 additions & 0 deletions web/projects/marketplace/src/modals/release-notes.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
import { CommonModule } from '@angular/common'
import {
ChangeDetectionStrategy,
Component,
inject,
Input,
} from '@angular/core'
import { Exver, MarkdownPipeModule } from '@start9labs/shared'
import { TuiButton, TuiLoader } from '@taiga-ui/core'
import { TuiCardLarge } from '@taiga-ui/layout'
import { PolymorpheusComponent } from '@taiga-ui/polymorpheus'
import { map } from 'rxjs'
import { AbstractMarketplaceService } from '../services/marketplace.service'
import { MarketplacePkg } from '../types'

@Component({
standalone: true,
template: `
@if (notes$ | async; as notes) {
@for (note of notes | keyvalue: asIsOrder; track $index) {
<button tuiButton (click)="setSelected(note.key)">
{{ note.key }}
</button>
<div
tuiCardLarge
#element
[id]="note.key"
[style.max-height.px]="getDocSize(note.key, element)"
[innerHTML]="note.value | markdown"
></div>
}
} @else {
<tui-loader textContent="Loading Release Notes" />
}
`,
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [
CommonModule,
TuiButton,
TuiLoader,
TuiCardLarge,
MarkdownPipeModule,
],
})
export class ReleaseNotesComponent {
@Input() pkg!: MarketplacePkg

private selected: string | null = null
private readonly exver = inject(Exver)

readonly notes$ = inject(AbstractMarketplaceService)
.getSelectedStore$()
.pipe(
map(s => {
return Object.entries(this.pkg.otherVersions)
.filter(
([v, _]) =>
this.exver.getFlavor(v) === this.pkg.flavor &&
this.exver.compareExver(this.pkg.version, v) === 1,
)
.reduce(
(obj, [version, info]) => ({
...obj,
[version]: info.releaseNotes,
}),
{
[`${this.pkg.version} (current)`]: this.pkg.releaseNotes,
},
)
}),
)

isSelected(key: string): boolean {
return this.selected === key
}

setSelected(selected: string) {
this.selected = this.isSelected(selected) ? null : selected
}

getDocSize(key: string, { scrollHeight }: HTMLElement) {
return this.isSelected(key) ? scrollHeight : 0
}

asIsOrder(a: any, b: any) {
return 0
}
}

export const RELEASE_NOTES = new PolymorpheusComponent(ReleaseNotesComponent)

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
<button
*ngFor="let cat of categories || ['', '', '', '', '', '']"
(click)="switchCategory(cat)"
[class.category_selected]="cat === category"
*ngFor="let cat of categories || fallback | keyvalue"
(click)="switchCategory(cat.key)"
[class.category_selected]="cat.key === category"
>
<div
class="category-wrapper"
[class.tui-skeleton]="!categories"
[class.tui-skeleton_rounded]="!categories"
>
<tui-icon tuiAppearance="icon" icon="{{ determineIcon(cat) }}"></tui-icon>
<tui-icon tuiAppearance="icon" [icon]="determineIcon(cat.key)" />
</div>
<span
class="category-title"
[class.tui-skeleton]="!categories"
[class.tui-skeleton_rounded]="!categories"
>
{{
cat === 'ai'
? (cat | uppercase)
: (cat | titlecase) || 'Loading category...'
cat.key === 'ai'
? (cat.key | uppercase)
: (cat.value.name | titlecase) || 'Loading category...'
}}
</span>
</button>
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,22 @@ import { T } from '@start9labs/start-sdk'
})
export class CategoriesComponent {
@Input()
categories!: Map<string, T.Category>
categories?: Record<string, T.Category>

@Input()
category = ''

@Output()
readonly categoryChange = new EventEmitter<string>()

readonly fallback: Record<string, T.Category> = {
a: { name: 'a', description: { short: 'a', long: 'a' } },
b: { name: 'a', description: { short: 'a', long: 'a' } },
c: { name: 'a', description: { short: 'a', long: 'a' } },
d: { name: 'a', description: { short: 'a', long: 'a' } },
e: { name: 'a', description: { short: 'a', long: 'a' } },
}

switchCategory(category: string): void {
this.category = category
this.categoryChange.emit(category)
Expand Down
Loading

0 comments on commit 76eb0f1

Please sign in to comment.