Conversation
Mateusz-Dobrzynski
left a comment
There was a problem hiding this comment.
I can confirm, the /tournaments/{tournament_id}/debates/{debate_id} endpoint returns 500; I'm creating a task for it. However, you do not need this endpoint to complete the task. You only need to use /users/{user_id}/tournaments/{tournament_id}/roles to check user roles and this endpoint works just fine (refer to the testing section).
There are some problems with this PR.
- The component does not look the way it should:
Original design
Current implementation
- Problems with the code need to be resolved.
- Pass
motionto the component and remove other props. - Write unit tests for the component:
- Mock /users/{user_id}/tournaments/{tournament_id}/roles and check if the component is rendered/not rendered depending on whether the user is a Marshal or not.
- Ensure the button contains a valid link when you pass a
motionto it.
- Change component styling to match the design.
There was a problem hiding this comment.
Again: do not translate Polish strings; it will be done later by a native speaker.
There was a problem hiding this comment.
You could have skipped creating this file, though I understand it might have been created due to a misunderstanding about the scope of the task that we had.
| const conductDebateHref = `https://tools.debateco.re/oxford-debate/setup?motion=${encodeURIComponent( | ||
| motion | ||
| )}`; |
There was a problem hiding this comment.
Why did you create this variable in the outer scope? It can be defined inside the component.
| export function MarshalPanel({ | ||
| title, | ||
| buttonLabel, | ||
| href, | ||
| }: MarshalPanelProps) { |
There was a problem hiding this comment.
Why did you make the props generic so that all logic must be handled outside of the component? Instead, you can only pass motion and generate the href here. Displayed strings can be handled as static translations, as they will not change. Refer to the design.
SCRUM-61 – Implement conduct debate button
Implemented the "Conduct Debate" button on the debate details page.
What was done
Added a new debate details page (/debates/[debate_id])
Created MarshalPanel component to display marshal actions
Integrated data fetching:
/auth/me to get current user
/tournaments/{id}/debates/{debate_id} to fetch debate details
/users/{id}/tournaments/{id}/roles to determine user roles
Implemented conditional rendering:
Button is only visible for users with Marshal or Organizer roles
Added external link to DebateCore with encoded motion
Notes / Limitations
Could not fully validate the feature end-to-end because the backend currently returns no debates (GET /tournaments/{id}/debates returns an empty array)
As a result, it was not possible to access a real debate details page to visually confirm the button rendering
The implementation is complete from the frontend side and should work correctly once a valid debate is available in the backend.