@@ -58,9 +58,9 @@ export default function MotionsList() {
{isChair && (
sendMessage({type:ChairEvents.RESOLVE_MOTION_EVENT, payload:{motion_id:motion.id!, action:true }} satisfies ResolveMotionEvent)}>Acatar
+ onClick={() => sendMessage({ type: ChairEvents.RESOLVE_MOTION_EVENT, payload: { motion_id: motion.id!, action: true } } satisfies ResolveMotionEvent)}>Acatar
sendMessage({type:ChairEvents.RESOLVE_MOTION_EVENT, payload:{motion_id:motion.id!, action:false }} satisfies ResolveMotionEvent)}>Rejeitar
+ onClick={() => sendMessage({ type: ChairEvents.RESOLVE_MOTION_EVENT, payload: { motion_id: motion.id!, action: false } } satisfies ResolveMotionEvent)}>Rejeitar
)}
diff --git a/frontend/src/components/session/speaker-list.tsx b/frontend/src/components/session/speaker-list.tsx
index b07c3b5..a740831 100644
--- a/frontend/src/components/session/speaker-list.tsx
+++ b/frontend/src/components/session/speaker-list.tsx
@@ -16,7 +16,7 @@ import {
TooltipTrigger,
} from "@/components/ui/tooltip"
import { sendMessage } from "@/context/SessionContext"
-import { type JoinQueueEvent, type SpeakerEvent, ChairEvents, DelegateEvents } from "@/schemas/types.gen"
+import { type JoinQueueEvent, type NextSpeakerEvent, ChairEvents, DelegateEvents } from "@/schemas/types.gen"
import { useSession } from "@/context/SessionContext"
import { SessionRoles } from "@/schemas/types.gen"
@@ -94,7 +94,7 @@ export default function SpeakerList() {
variant="outline"
className="flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap"
disabled={waitingCount === 0}
- onClick={() => sendMessage({ type: ChairEvents.SPEAKER_EVENT, payload: {} } satisfies SpeakerEvent)}
+ onClick={() => sendMessage({ type: ChairEvents.NEXT_SPEAKER_EVENT, payload: {} } satisfies NextSpeakerEvent)}
>
Proximo
Proximo Orador
diff --git a/frontend/src/components/session/timer.tsx b/frontend/src/components/session/timer.tsx
index 6693a67..e6184cf 100644
--- a/frontend/src/components/session/timer.tsx
+++ b/frontend/src/components/session/timer.tsx
@@ -15,7 +15,7 @@ export default function Timer() {
const isChair = role===SessionRoles.CHAIR
const delegations = useCommitteeStore((state) => state.delegations);
const currentSpeaker = useCommitteeStore((state) => state.current_speaker);
- const speaker = currentSpeaker !== null && currentSpeaker !== undefined ? delegations[currentSpeaker] : {
+ let speaker = currentSpeaker !== null && currentSpeaker !== undefined ? delegations[currentSpeaker] : {
id: -1,
seat: "",
name: "Mesa",
diff --git a/frontend/src/components/ui/flags.tsx b/frontend/src/components/ui/flags.tsx
index 05bc728..c64d545 100644
--- a/frontend/src/components/ui/flags.tsx
+++ b/frontend/src/components/ui/flags.tsx
@@ -1,5 +1,5 @@
-import { useState } from "react"
+import { useEffect, useState } from "react"
import { cn } from "@/lib/utils"
export default function Flags({
@@ -15,8 +15,14 @@ export default function Flags({
const [src, setSrc] = useState(baseSrc)
const [usedFallback, setUsedFallback] = useState(false)
+ useEffect(() => {
+ setSrc(baseSrc)
+ setUsedFallback(false)
+ }, [baseSrc])
+
return (
}
}
-
+
diff --git a/frontend/src/schemas/types.gen.ts b/frontend/src/schemas/types.gen.ts
index 3ea3f68..efaf9e0 100644
--- a/frontend/src/schemas/types.gen.ts
+++ b/frontend/src/schemas/types.gen.ts
@@ -4,6 +4,27 @@ export type ClientOptions = {
baseUrl: 'http://localhost:8000' | (string & {});
};
+/**
+ * AddGslSpeakerEvent
+ */
+export type AddGslSpeakerEvent = {
+ /**
+ * Type
+ */
+ type: 'AddGslSpeakerEvent';
+ payload: AddGslSpeakerPayload;
+};
+
+/**
+ * AddGslSpeakerPayload
+ */
+export type AddGslSpeakerPayload = {
+ /**
+ * Representation Id
+ */
+ representation_id: number;
+};
+
/**
* AgendaItem
*/
@@ -50,7 +71,7 @@ export type BodyDummyCommitteesDummyGet = {
/**
* Types
*/
- types: SubmitMotionEvent | SubmitQuestionEvent | CastVoteEvent | AnswerRollCallEvent | JoinQueueEvent | LeaveQueueEvent | OpenSessionEvent | CloseSessionEvent | IncreaseTimerEvent | ToggleTimerEvent | OpenInformalVotingEvent | CloseProceduralVotingEvent | CloseInformalVotingEvent | ResolveMotionEvent | SpeakerEvent | SetAgendaEvent | SetAgendaItemEvent | MarkAgendaItemEvent | DeleteAgendaItemEvent | SetPhaseEvent | MarkRollCallEvent | CloseRollCallEvent | ChairInsertQueueEvent | MarkRollCallBulkEvent;
+ types: SubmitMotionEvent | SubmitQuestionEvent | CastVoteEvent | AnswerRollCallEvent | JoinQueueEvent | LeaveQueueEvent | LogMotionEvent | OpenSessionEvent | CloseSessionEvent | IncreaseTimerEvent | ToggleTimerEvent | OpenInformalVotingEvent | CloseProceduralVotingEvent | CloseInformalVotingEvent | FinishCaucusEvent | ResolveMotionEvent | NextSpeakerEvent | AddGslSpeakerEvent | GrantFloorEvent | SetAgendaEvent | SetAgendaItemEvent | MarkAgendaItemEvent | DeleteAgendaItemEvent | SetPhaseEvent | MarkRollCallEvent | CloseRollCallEvent | MarkRollCallBulkEvent;
schemas: SessionLiveState;
};
@@ -74,19 +95,22 @@ export const ChairEvents = {
INCREASE_TIMER_EVENT: 'IncreaseTimerEvent',
OPEN_INFORMAL_VOTING_EVENT: 'OpenInformalVotingEvent',
RESOLVE_MOTION_EVENT: 'ResolveMotionEvent',
+ LOG_MOTION_EVENT: 'LogMotionEvent',
CLOSE_PROCEDURAL_VOTING_EVENT: 'CloseProceduralVotingEvent',
CLOSE_INFORMAL_VOTING_EVENT: 'CloseInformalVotingEvent',
+ FINISH_CAUCUS_EVENT: 'FinishCaucusEvent',
SET_PHASE_EVENT: 'SetPhaseEvent',
CLOSE_SESSION_EVENT: 'CloseSessionEvent',
SET_AGENDA_ITEM_EVENT: 'SetAgendaItemEvent',
MARK_AGENDA_ITEM_EVENT: 'MarkAgendaItemEvent',
DELETE_AGENDA_ITEM_EVENT: 'DeleteAgendaItemEvent',
SET_AGENDA: 'SetAgenda',
- SPEAKER_EVENT: 'SpeakerEvent',
+ NEXT_SPEAKER_EVENT: 'NextSpeakerEvent',
+ ADD_GSL_SPEAKER_EVENT: 'AddGslSpeakerEvent',
+ GRANT_FLOOR_EVENT: 'GrantFloorEvent',
MARK_ROLL_CALL_EVENT: 'MarkRollCallEvent',
MARK_ROLL_CALL_BULK_EVENT: 'MarkRollCallBulkEvent',
- CLOSE_ROLL_CALL_EVENT: 'CloseRollCallEvent',
- INSERT_QUEUE_EVENT: 'InsertQueueEvent'
+ CLOSE_ROLL_CALL_EVENT: 'CloseRollCallEvent'
} as const;
/**
@@ -94,20 +118,6 @@ export const ChairEvents = {
*/
export type ChairEvents = typeof ChairEvents[keyof typeof ChairEvents];
-/**
- * ChairForceSpeakerPayload
- */
-export type ChairForceSpeakerPayload = {
- /**
- * Speaker Id
- */
- speaker_id?: number | null;
- /**
- * Seconds
- */
- seconds?: number | null;
-};
-
/**
* ChairIncreaseTimerPayload
*/
@@ -119,24 +129,34 @@ export type ChairIncreaseTimerPayload = {
};
/**
- * ChairInsertQueueEvent
+ * ChairMotionPayload
+ *
+ * Extended payload for motions. Used to log motions
*/
-export type ChairInsertQueueEvent = {
+export type ChairMotionPayload = {
+ type: Motions;
+ debate_type?: DebateTypes | null;
/**
- * Type
+ * Total Duration Minutes
*/
- type: 'InsertQueueEvent';
- payload: ChairInsertQueuePayload;
-};
-
-/**
- * ChairInsertQueuePayload
- */
-export type ChairInsertQueuePayload = {
+ total_duration_minutes?: number | null;
+ /**
+ * Per Speaker Seconds
+ */
+ per_speaker_seconds?: number | null;
/**
- * Target
+ * Target Topic
*/
- target: number;
+ target_topic?: string | null;
+ /**
+ * Details
+ */
+ details?: string | null;
+ /**
+ * Representation Id
+ */
+ representation_id: number;
+ decision: MotionDecision;
};
/**
@@ -391,6 +411,42 @@ export type EmptyPayload = {
[key: string]: unknown;
};
+/**
+ * FinishCaucusEvent
+ */
+export type FinishCaucusEvent = {
+ /**
+ * Type
+ */
+ type: 'FinishCaucusEvent';
+ payload: EmptyPayload;
+};
+
+/**
+ * GrantFloorEvent
+ */
+export type GrantFloorEvent = {
+ /**
+ * Type
+ */
+ type: 'GrantFloorEvent';
+ payload: GrantFloorPayload;
+};
+
+/**
+ * GrantFloorPayload
+ */
+export type GrantFloorPayload = {
+ /**
+ * Representation Id
+ */
+ representation_id: number;
+ /**
+ * Seconds
+ */
+ seconds?: number | null;
+};
+
/**
* HTTPValidationError
*/
@@ -444,6 +500,17 @@ export type LeaveQueueEvent = {
};
};
+/**
+ * LogMotionEvent
+ */
+export type LogMotionEvent = {
+ /**
+ * Type
+ */
+ type: 'LogMotionEvent';
+ payload: ChairMotionPayload;
+};
+
/**
* MajorityTypes
*/
@@ -572,6 +639,20 @@ export type MotionContext = {
details?: string | null;
};
+/**
+ * MotionDecision
+ *
+ * Tracks decision for LogMotionEvent for chair
+ */
+export const MotionDecision = { ACCEPT: 'Accept', DENY: 'Deny' } as const;
+
+/**
+ * MotionDecision
+ *
+ * Tracks decision for LogMotionEvent for chair
+ */
+export type MotionDecision = typeof MotionDecision[keyof typeof MotionDecision];
+
/**
* Motions
*/
@@ -598,6 +679,17 @@ export const Motions = {
*/
export type Motions = typeof Motions[keyof typeof Motions];
+/**
+ * NextSpeakerEvent
+ */
+export type NextSpeakerEvent = {
+ /**
+ * Type
+ */
+ type: 'NextSpeakerEvent';
+ payload: EmptyPayload;
+};
+
/**
* OpenInformalVotingEvent
*/
@@ -692,10 +784,7 @@ export type RollCallContext = {
registry?: {
[key: string]: RollCallChoice;
};
- /**
- * Current Delegation
- */
- current_delegation?: number | null;
+ return_state?: States | null;
};
/**
@@ -785,12 +874,6 @@ export type SessionLiveState = {
*/
active_topic_index?: string | null;
voting?: VotingContext | null;
- /**
- * Voting Choice
- */
- voting_choice?: {
- [key: string]: RollCallChoice;
- } | null;
roll_call: RollCallContext;
/**
* Has Veto Power
@@ -866,17 +949,6 @@ export type SetPhaseEvent = {
payload: ChairSetPhasePayload;
};
-/**
- * SpeakerEvent
- */
-export type SpeakerEvent = {
- /**
- * Type
- */
- type: 'SpeakerEvent';
- payload: ChairForceSpeakerPayload;
-};
-
/**
* States
*/
@@ -891,6 +963,7 @@ export const States = {
FINISHED: 'Finished',
MODERATED_CAUCUS: 'Moderated Caucus',
UNMODERATED_CAUCUS: 'Unmoderated Caucus',
+ TOUR_DE_TABLE: 'Tour de Table',
VOTING_EXECUTION: 'Voting Execution',
BETWEEN_DEBATES: 'Between Debates'
} as const;
diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts
index 5b6048f..511f4d2 100644
--- a/frontend/vite.config.ts
+++ b/frontend/vite.config.ts
@@ -14,4 +14,14 @@ export default defineConfig({
"@": path.resolve(__dirname, "./src"),
},
},
+ server: {
+ watch: {
+ usePolling: true, // Alternative to setting environment variables
+ },
+ host: true, // Exposes the server to the local network inside Docker
+ strictPort: true,
+ hmr: {
+ clientPort: 5173, // Forces the browser to connect to the exposed host port
+ },
+ },
})