Skip to content

Commit

Permalink
Merge pull request #15 from cloudnativedaysjp/feat/exclude_cancelled_…
Browse files Browse the repository at this point in the history
…talks

feat: Exclude cancelled talks
  • Loading branch information
Gaku-Kunimi authored Dec 12, 2023
2 parents 5c47635 + f352206 commit ab1127d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ NEXT_PUBLIC_EVENT_ABBR=cndt2023
NEXT_PUBLIC_TRANS_TIME_PAGE1='21.6'
NEXT_PUBLIC_TRANS_TIME_PAGE2='21.6'
NEXT_PUBLIC_TRANS_TIME_PAGE3='103.5'
NEXT_PUBLIC_EXCLUDED_TALKS='2056'
9 changes: 7 additions & 2 deletions src/components/models/talkView.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import config from '@/config'
import { Speaker, Talk, Track } from '@/generated/dreamkast-api.generated'
import { getTime } from '@/utils/time'
import { Optional } from '@/utils/types'
Expand All @@ -21,7 +22,9 @@ export class TalkView {
}

private allTalksOnTimeTable(): Talk[] {
return this.allTalks.filter((talk) => talk.showOnTimetable)
return this.allTalks.filter(
(talk) => talk.showOnTimetable && !config.excludedTalks.includes(talk.id)
)
}

private talksInTrack(trackId: number): Talk[] {
Expand Down Expand Up @@ -99,7 +102,9 @@ export class MenuView {
}

private allTalksOnTimeTable(): Talk[] {
return this.allTalks.filter((talk) => talk.showOnTimetable)
return this.allTalks.filter(
(talk) => talk.showOnTimetable && !config.excludedTalks.includes(talk.id)
)
}

timeSlots(): TimeSlot[] {
Expand Down
4 changes: 4 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ const config = {
transTimePage2: parseInt(process.env.NEXT_PUBLIC_TRANS_TIME_PAGE2 ?? '24'),
transTimePage3: parseInt(process.env.NEXT_PUBLIC_TRANS_TIME_PAGE3 ?? '24'),
debug: !!process.env.NEXT_PUBLIC_DEBUG,
excludedTalks:
process.env.NEXT_PUBLIC_EXCLUDED_TALKS?.split(',').map((t) =>
parseInt(t)
) || [],
} as const

export default config

1 comment on commit ab1127d

@vercel
Copy link

@vercel vercel bot commented on ab1127d Dec 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

web-interlude – ./

web-interlude-git-main-tkc66-buzzs-projects.vercel.app
web-interlude-tkc66-buzzs-projects.vercel.app

Please sign in to comment.