Conversation
|
View your CI Pipeline Execution ↗ for commit b8120cd
☁️ Nx Cloud last updated this comment at |
🚀 Preview Deploy Report✅ Successfully deployed preview here |
|
For venues, please try |
|
|
||
| @for (item of content(); track $index) { | ||
| <ng-container *hraContentTemplateOutlet="item" /> | ||
| @if (item['tagline'] === 'Venues and events') { |
There was a problem hiding this comment.
Remove! You need to turn the venues table into a content template component like everything else and have it specified in the data.yaml instead of special casing it like this.
|
|
||
| /** header content data */ | ||
| /** Venues data for the venues table */ | ||
| readonly venues = input<VenueData>([]); |
| TableOfContentsLayoutModule, | ||
| NavigationModule, | ||
| FooterComponent, | ||
| VenuesTableComponent, |
package.json
Outdated
| "qs": "^6.15.0", | ||
| "rapidoc": "^9.3.8", | ||
| "rxjs": "^7.8.2", | ||
| "slugify": "^1.6.8", |
There was a problem hiding this comment.
Remove! Please don't add random packages
| import { VenueData, VenueItem } from '../../schemas/venues.schema'; | ||
|
|
||
| /** Base URL for Scimaps */ | ||
| const BASE_URL = 'https://scimaps.org/'; |
There was a problem hiding this comment.
Pass this as an input to the component
| } | ||
| if (venue.venueImages) { | ||
| links.push( | ||
| `[Photo gallery](${[BASE_URL, 'venues/gallery', this.getSegmentedDate(venue.dateStart), this.toSlug(venue.title)].join('/')})`, |
There was a problem hiding this comment.
Refactor url building to a method
buildLinkUrl(path, date, title, extra) {
const dateSegment = ...
const titleSegment = ...
return [
this.linkBaseHref(),
path,
dateSegment,
titleSegment,
extra,
].filter(s => !!s).join('/);
}| private getSegmentedDate(date: Date): string { | ||
| const fullDate = new Date(date); | ||
| const year = fullDate.getUTCFullYear(); | ||
| const day = ('0' + fullDate.getUTCDate()).slice(-2); |
There was a problem hiding this comment.
Use String(date.getUTCDate()).padStart(2, '0')
| const fullDate = new Date(date); | ||
| const year = fullDate.getUTCFullYear(); | ||
| const day = ('0' + fullDate.getUTCDate()).slice(-2); | ||
| const month = ('0' + (fullDate.getUTCMonth() + 1)).slice(-2); |
There was a problem hiding this comment.
Use String(date.getUTCMonth() + 1).padStart(2, '0')
| * @returns URL-friendly slug generated from the input string | ||
| */ | ||
| private toSlug(str: string): string { | ||
| return slugify(str, { lower: true, strict: true }); |
There was a problem hiding this comment.
Look at the SlugifyPipe implementation for slugifying things
| readonly venues = input<VenueData>([]); | ||
|
|
||
| /** Columns for the venues table */ | ||
| readonly columns = signal<TableColumn[]>([ |
There was a problem hiding this comment.
You don't need to put a constant inside a signal, just do readonly columns = [...] and in the template use [columns]="columns"
Uh oh!
There was an error while loading. Please reload this page.