Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use dynamic agenda based on sessionize GridSmart response for 2021 agenda #441

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
1 change: 1 addition & 0 deletions .env.local
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ NEXT_PUBLIC_APPINSIGHTS_INSTRUMENTATIONKEY=2f1d6a9c-1b88-4f3d-bba1-64b11ffd2362
NEXT_PUBLIC_GET_SUBMISSIONS_URL=https://dddperth-functions-test.azurewebsites.net/api/GetSubmissions
NEXT_PUBLIC_SUBMIT_VOTE_URL=https://dddperth-functions-test.azurewebsites.net/api/SubmitVote
NEXT_PUBLIC_GET_AGENDA_URL=https://dddperth-functions-test.azurewebsites.net/api/GetAgenda
NEXT_PUBLIC_GET_AGENDA_SCHEDULE_URL=https://dddperth-functions-test.azurewebsites.net/api/GetAgendaSchedule
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Need someone to add this to the pipeline ... I don't have permission.
@mzaatar

NEXT_PUBLIC_SUBMIT_FEEDBACK_URL=https://dddperth-functions-test.azurewebsites.net/api/SubmitFeedback
NEXT_PUBLIC_TESTING_MODE=true
NEXT_PUBLIC_BASE_URL=http://localhost:3000
Expand Down
2 changes: 2 additions & 0 deletions Context/Config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ interface AppConfig {
baseUrl: string
feedbackUrl: string
getAgendaUrl: string
getAgendaScheduleUrl: string
getSubmissionsUrl: string
instrumentationKey: string
submitVoteUrl: string
Expand Down Expand Up @@ -44,6 +45,7 @@ const ConfigProvider = ({ children }: { children: React.ReactNode }): ReactEleme
baseUrl: process.env.NEXT_PUBLIC_BASE_URL,
feedbackUrl: process.env.NEXT_PUBLIC_SUBMIT_FEEDBACK_URL,
getAgendaUrl: process.env.NEXT_PUBLIC_GET_AGENDA_URL,
getAgendaScheduleUrl: process.env.NEXT_PUBLIC_GET_AGENDA_SCHEDULE_URL,
getSubmissionsUrl: process.env.NEXT_PUBLIC_GET_SUBMISSIONS_URL,
instrumentationKey: process.env.NEXT_PUBLIC_APPINSIGHTS_INSTRUMENTATIONKEY,
submitVoteUrl: process.env.NEXT_PUBLIC_SUBMIT_VOTE_URL,
Expand Down
7 changes: 4 additions & 3 deletions components/Agenda/Agenda.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Router from 'next/router'
import React, { Fragment } from 'react'
import { Session, Sponsor } from 'config/types'
import { AgendaForDisplay, Session, Sponsor } from 'config/types'
import { SafeLink } from 'components/global/safeLink'
import { SessionGroup, useSessionGroups } from 'components/utils/useSessionGroups'
import { StyledCenteredParagraph, StyledSponsorLogo } from 'components/Agenda/Agenda.styled'
Expand All @@ -9,6 +9,7 @@ import { StyledCloseButton, StyledDialogContent, StyledDialogOverlay } from 'com
export type onSelectCallback = (session: Session, sponsor: Sponsor, livestream: string) => void

interface AgendaProps {
agenda?: AgendaForDisplay | null
sessions: Session[]
selectedSessionId: string
acceptingFeedback: boolean
Expand Down Expand Up @@ -56,8 +57,8 @@ function agendaReducer(state: AgendaState, action: AllAgendaActions): AgendaStat
}
}

export const Agenda = ({ sessions, ...props }: AgendaProps) => {
const { nextSessionGroup } = useSessionGroups(sessions)
export const Agenda = ({ sessions, agenda = null, ...props }: AgendaProps) => {
const { nextSessionGroup } = useSessionGroups(sessions, agenda)
const [sessionState, dispatch] = React.useReducer(agendaReducer, { showModal: false })

React.useEffect(() => {
Expand Down
11 changes: 11 additions & 0 deletions components/Agenda/agendaOverrides.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { AgendaForDisplay } from 'config/types'
import { with2022Overrides } from 'pages/agenda/2022'

export function withOverrides(agenda: AgendaForDisplay, instance: string): AgendaForDisplay {
switch (instance) {
case '2022':
return with2022Overrides(agenda)
default:
return agenda
}
}
Loading