Prowadzacy widzial zakladke, ktora u niego nie mogla zadzialac: endpoint `/offer-form` szuka tokenu w `registrations`, a prelegent tam nie istnieje (nie przechodzi przez formularz zapisu i ma wlasny token w `webinar_speakers`). Zadanie konczylo sie bledem 404, a panel zostawal na "Wczytywanie..." bez konca, bo front nie obslugiwal bledu. Zakladka i tak nie mialaby sensu: zapytanie ofertowe wysyla uczestnik, a prowadzacy oglada zgloszenia w panelu prowadzenia. Warunek jest w dwoch miejscach celowo: przy liscie zakladek i przy renderowaniu tresci. Stan `tab` przezywa zmiane roli, wiec sama krotsza lista nie wystarcza. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -93,17 +93,29 @@ export function InteractionPanel({
|
|||||||
const chatOff = history.chatMode === 'DISABLED'
|
const chatOff = history.chatMode === 'DISABLED'
|
||||||
const speakersOnly = history.chatMode === 'SPEAKERS_ONLY' && !history.speaker
|
const speakersOnly = history.chatMode === 'SPEAKERS_ONLY' && !history.speaker
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Zapytanie ofertowe wysyla UCZESTNIK, wiec prowadzacy tej zakladki nie ma.
|
||||||
|
*
|
||||||
|
* Endpoint `/offer-form` szuka tokenu w `registrations`, a prelegent tam nie
|
||||||
|
* istnieje: nie przechodzi przez formularz zapisu i ma wlasny token
|
||||||
|
* w `webinar_speakers`. Zapytanie konczylo sie wiec bledem 404, a panel
|
||||||
|
* zostawal na "Wczytywanie..." bez konca. Zakladka i tak nie mialaby sensu:
|
||||||
|
* prowadzacy nie wysyla zapytania ofertowego sam do siebie, a zgloszenia
|
||||||
|
* uczestnikow oglada w panelu prowadzenia.
|
||||||
|
*/
|
||||||
|
const tabs = (
|
||||||
|
[
|
||||||
|
['chat', 'Czat', 'message-square', unread.chat],
|
||||||
|
['questions', 'Pytania', 'circle-alert', unread.questions],
|
||||||
|
['tasks', 'Zadania', 'check-circle', 0],
|
||||||
|
['offer', 'Oferta', 'send', 0],
|
||||||
|
] as const
|
||||||
|
).filter(([id]) => !(id === 'offer' && history.speaker))
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex h-full min-h-0 flex-col bg-white">
|
<div className="flex h-full min-h-0 flex-col bg-white">
|
||||||
<nav role="tablist" aria-label="Interakcje" className="flex border-b border-slate-200">
|
<nav role="tablist" aria-label="Interakcje" className="flex border-b border-slate-200">
|
||||||
{(
|
{tabs.map(([id, label, icon, count]) => (
|
||||||
[
|
|
||||||
['chat', 'Czat', 'message-square', unread.chat],
|
|
||||||
['questions', 'Pytania', 'circle-alert', unread.questions],
|
|
||||||
['tasks', 'Zadania', 'check-circle', 0],
|
|
||||||
['offer', 'Oferta', 'send', 0],
|
|
||||||
] as const
|
|
||||||
).map(([id, label, icon, count]) => (
|
|
||||||
<button
|
<button
|
||||||
key={id}
|
key={id}
|
||||||
type="button"
|
type="button"
|
||||||
@@ -150,7 +162,7 @@ export function InteractionPanel({
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
{tab === 'tasks' && <TasksTab token={token} webinarId={history.webinarId} />}
|
{tab === 'tasks' && <TasksTab token={token} webinarId={history.webinarId} />}
|
||||||
{tab === 'offer' && <OfferTab token={token} />}
|
{tab === 'offer' && !history.speaker && <OfferTab token={token} />}
|
||||||
|
|
||||||
{tab === 'chat' ? (
|
{tab === 'chat' ? (
|
||||||
<ChatTab
|
<ChatTab
|
||||||
|
|||||||
Reference in New Issue
Block a user