This repository was archived by the owner on Jan 3, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Add Public Waiting List Tab #295
Merged
Merged
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
2247165
Waiting List Frontend
FinnIckler b509b0d
Merge branch 'main' into feature/public-waiting-list
FinnIckler 6b4b04c
implement waiting list management
FinnIckler 52b8ec6
run rubocop
FinnIckler 5b7214e
fix eslint
FinnIckler 8085fa2
correctly show the number of waiting competitors
FinnIckler 591beb9
check length of waiting too
FinnIckler 63e5a30
don't force organizers to update the waitlist everytime someone is ap…
FinnIckler 23c4e0e
adding tests for waiting list
dunkOnIT 6e84a32
Merge branch 'main' into feature/public-waiting-list
dunkOnIT 4a15623
waiting list tests passing
dunkOnIT 55d0642
refactored waiting list functions
dunkOnIT aef04b2
added cache invalidations
dunkOnIT b148ee6
corrected typing of test values and updated type acceptance tests
dunkOnIT 3a45ed1
added tests for waiting list position outside of min/max boundary
dunkOnIT df81d68
re-enabled cache
dunkOnIT 2121616
caching tests
dunkOnIT 82e4e14
Fixed caches not updating and introduced a method in lib
FinnIckler 5050fed
corrected cache behaviour
dunkOnIT 2108e2d
removed puts statements
dunkOnIT 32765dd
removed get/set and refactored to use minmax
dunkOnIT 4ec7744
removed caching-test config files
dunkOnIT d0472d7
remove cache_test fro mgemfile
dunkOnIT c8cc997
refactored list_waiting to use get_by_status
dunkOnIT 7139c59
skipping jwt validation on list_waiting temproarily
dunkOnIT dc967ca
removed caching of waiting list
dunkOnIT 4d84bca
removed commented code and unnecessary docs
dunkOnIT f10c549
fix issue with worker not loading lane
FinnIckler b1bdeb8
fix issue with multiple updates not waiting before the other completes
FinnIckler 880622d
Merge branch 'main' into feature/public-waiting-list
FinnIckler 337c5ad
fix typo
FinnIckler 52a215b
Add Segment for Waiting List
FinnIckler 298f2f3
run eslint
FinnIckler 304e809
added redis to backend-test compose file
dunkOnIT File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import backendFetch from '../../helper/backend_fetch' | ||
import { components } from '../../schema' | ||
|
||
export async function getWaitingCompetitors( | ||
competitionId: string | ||
): Promise<components['schemas']['registration'][]> { | ||
return backendFetch(`/registrations/${competitionId}/waiting`, 'GET', { | ||
needsAuthentication: false, | ||
}) as Promise< | ||
components['schemas']['registration'][] | ||
> | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { useQuery } from '@tanstack/react-query' | ||
import { useContext } from 'react' | ||
import { Table } from 'semantic-ui-react' | ||
import { CompetitionContext } from '../../../api/helper/context/competition_context' | ||
import { getWaitingCompetitors } from '../../../api/registration/get/get_waiting' | ||
import { setMessage } from '../../../ui/events/messages' | ||
import LoadingMessage from '../../../ui/messages/loadingMessage' | ||
|
||
export default function WaitingList() { | ||
const { competitionInfo } = useContext(CompetitionContext) | ||
const { isLoading, data: waiting } = useQuery({ | ||
queryKey: ['waiting', competitionInfo.id], | ||
queryFn: () => getWaitingCompetitors(competitionInfo.id), | ||
retry: false, | ||
onError: (err) => { | ||
setMessage(err.message, 'error') | ||
}, | ||
}) | ||
return isLoading ? ( | ||
<LoadingMessage /> | ||
) : ( | ||
FinnIckler marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<Table> | ||
<Table.Header> | ||
<Table.Row> | ||
<Table.HeaderCell>Name</Table.HeaderCell> | ||
<Table.HeaderCell>Position</Table.HeaderCell> | ||
</Table.Row> | ||
</Table.Header> | ||
<Table.Body> | ||
{waiting.map((w, i) => ( | ||
<Table.Row key={w.user_id}> | ||
<Table.Cell>{w.user_id}</Table.Cell> | ||
<Table.Cell>{i}</Table.Cell> | ||
</Table.Row> | ||
))} | ||
</Table.Body> | ||
</Table> | ||
) | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import React from 'react' | ||
import { Header } from 'semantic-ui-react' | ||
import WaitingList from './components/WaitingList' | ||
|
||
export default function Registrations() { | ||
FinnIckler marked this conversation as resolved.
Show resolved
Hide resolved
|
||
return ( | ||
<div> | ||
<Header>Competitors:</Header> | ||
<WaitingList /> | ||
</div> | ||
) | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thoughts on using "waitlist" everywhere? I think that's quite standard, at least in North America. It also makes all the file and variable names a bit shorter and consistent (sometimes it's
waiting
, sometimeswaiting_list
, etc. at the moment).