Skip to content

Commit

Permalink
chore: add some missing app configs and env variables
Browse files Browse the repository at this point in the history
Add the variables to the example file that are missing from env.example,
but are listed in the AppConfig, and the opposite.

Start using the appConfigs for venue details page.
  • Loading branch information
nikomakela committed Feb 6, 2023
1 parent e7a5454 commit 1178c37
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 4 deletions.
3 changes: 2 additions & 1 deletion apps/events-helsinki/.env.local.example
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ NEXT_PUBLIC_MATOMO_ENABLED="false"
NEXTJS_DISABLE_SENTRY="true"
NEXTJS_DEBUG_I18N="true"
NEXT_PUBLIC_ALLOW_UNAUTHORIZED_REQUESTS="true"
DOCKER_BUILDKIT="true"
DOCKER_BUILDKIT="true"
NEXT_PUBLIC_SHOW_SIMILAR_EVENTS="true"
3 changes: 2 additions & 1 deletion apps/hobbies-helsinki/.env.local.example
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ NEXT_PUBLIC_MATOMO_ENABLED="false"
NEXTJS_DISABLE_SENTRY="true"
NEXTJS_DEBUG_I18N="true"
NEXT_PUBLIC_ALLOW_UNAUTHORIZED_REQUESTS="true"
DOCKER_BUILDKIT="true"
DOCKER_BUILDKIT="true"
NEXT_PUBLIC_SHOW_SIMILAR_EVENTS="true"
5 changes: 4 additions & 1 deletion apps/sports-helsinki/.env.local.example
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,7 @@ NEXT_PUBLIC_MATOMO_ENABLED="false"
NEXTJS_DISABLE_SENTRY="true"
NEXTJS_DEBUG_I18N="true"
NEXT_PUBLIC_ALLOW_UNAUTHORIZED_REQUESTS="true"
DOCKER_BUILDKIT="true"
DOCKER_BUILDKIT="true"
NEXT_PUBLIC_SHOW_SIMILAR_EVENTS="true"
NEXT_PUBLIC_SHOW_SIMILAR_VENUES="true"
NEXT_PUBLIC_SHOW_VENUES_UPCOMING_EVENTS="true"
12 changes: 12 additions & 0 deletions apps/sports-helsinki/src/domain/app/AppConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,18 @@ class AppConfig {
);
}

static get showSimilarVenues() {
return Boolean(
parseEnvValue(process.env.NEXT_PUBLIC_SHOW_SIMILAR_VENUES, true)
);
}

static get showVenuesUpcomingEvents() {
return Boolean(
parseEnvValue(process.env.NEXT_PUBLIC_SHOW_VENUES_UPCOMING_EVENTS, true)
);
}

static get URLRewriteMapping() {
return {
[AppConfig.linkedEventsEventEndpoint]: ROUTES.COURSES.replace(
Expand Down
9 changes: 8 additions & 1 deletion apps/sports-helsinki/src/pages/venues/[venueId]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,14 @@ const Event: NextPage<{
<RHHCPage
className="pageLayout"
navigation={<Navigation />}
content={<VenuePageContainer venue={venue} loading={loading} />}
content={
<VenuePageContainer
venue={venue}
loading={loading}
showSimilarVenues={AppConfig.showSimilarVenues}
showUpcomingEvents={AppConfig.showVenuesUpcomingEvents}
/>
}
footer={<FooterSection menu={footerMenu} />}
/>
</MatomoWrapper>
Expand Down

0 comments on commit 1178c37

Please sign in to comment.