diff --git a/.github/workflows/build-branch.yml b/.github/workflows/build-branch.yml index 693855d2..70760968 100644 --- a/.github/workflows/build-branch.yml +++ b/.github/workflows/build-branch.yml @@ -2,7 +2,7 @@ name: build container image when branches are pushed on: push: - branches: ["*"] + branches: jobs: build: diff --git a/public/cndw2024/ui/background.jpg b/public/cndw2024/ui/background.jpg new file mode 100644 index 00000000..626fb82d Binary files /dev/null and b/public/cndw2024/ui/background.jpg differ diff --git a/public/cndw2024/ui/cndw2024_header_logo.png b/public/cndw2024/ui/cndw2024_header_logo.png new file mode 100644 index 00000000..e5b2e5e3 Binary files /dev/null and b/public/cndw2024/ui/cndw2024_header_logo.png differ diff --git a/public/cndw2024/ui/cndw2024_trademark.png b/public/cndw2024/ui/cndw2024_trademark.png new file mode 100644 index 00000000..2f3128b3 Binary files /dev/null and b/public/cndw2024/ui/cndw2024_trademark.png differ diff --git a/public/cndw2024/ui/talk_icon.png b/public/cndw2024/ui/talk_icon.png new file mode 100644 index 00000000..1e392498 Binary files /dev/null and b/public/cndw2024/ui/talk_icon.png differ diff --git a/public/cndw2024/ui/wave.jpg b/public/cndw2024/ui/wave.jpg new file mode 100644 index 00000000..025366ea Binary files /dev/null and b/public/cndw2024/ui/wave.jpg differ diff --git a/public/cndw2024/ui/x_logo.png b/public/cndw2024/ui/x_logo.png new file mode 100644 index 00000000..2609e580 Binary files /dev/null and b/public/cndw2024/ui/x_logo.png differ diff --git a/schemas/swagger.yml b/schemas/swagger.yml index e121c637..335b635e 100644 --- a/schemas/swagger.yml +++ b/schemas/swagger.yml @@ -459,6 +459,26 @@ paths: $ref: '#/components/schemas/Sponsor' '400': description: Invalid params supplied + /api/v1/print_node_printers: + get: + tags: + - PrintNodePrinter + parameters: + - name: eventAbbr + in: query + description: abbr of event (e.g. cndt2020) + required: true + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PrintNodePrinter' /api/v1/booths/{boothId}: get: tags: @@ -1578,6 +1598,8 @@ components: type: string checkInTimestamp: type: number + printerId: + type: string required: - profileId - eventAbbr @@ -1598,7 +1620,13 @@ components: - profileId - talkId - checkInTimestamp - + PrintNodePrinter: + type: object + properties: + id: + type: string + name: + type: string # dreamkast-function Vote: diff --git a/src/components/CheckIn/CheckIn.tsx b/src/components/CheckIn/CheckIn.tsx index 53a28968..d75c993d 100644 --- a/src/components/CheckIn/CheckIn.tsx +++ b/src/components/CheckIn/CheckIn.tsx @@ -14,6 +14,7 @@ export type CheckInType = 'event' | 'session' type Props = { checkInType: CheckInType eventAbbr: string + printerId?: string talk?: Talk debug?: boolean } @@ -23,12 +24,14 @@ type CheckInData = { eventAbbr: string profileId: string checkInTimestamp: number + printerId?: string talkId?: string } export const CheckIn: React.FC = ({ checkInType, eventAbbr, + printerId, talk, debug, }) => { @@ -74,6 +77,9 @@ export const CheckIn: React.FC = ({ if (checkInType === 'session') { value.talkId = talk?.id.toString() } + if (checkInType == 'event') { + value.printerId = printerId + } localStorage.setItem(key, JSON.stringify(value)) setStoredKeys((prev) => [...prev, key]) } diff --git a/src/generated/dreamkast-api.generated.ts b/src/generated/dreamkast-api.generated.ts index 2a94105f..f4e4af36 100644 --- a/src/generated/dreamkast-api.generated.ts +++ b/src/generated/dreamkast-api.generated.ts @@ -10,6 +10,7 @@ export const addTagTypes = [ 'VideoRegistration', 'ChatMessage', 'Sponsor', + 'PrintNodePrinter', 'Booth', 'Point', 'Vote', @@ -211,6 +212,16 @@ const injectedRtkApi = api }), providesTags: ['Sponsor'], }), + getApiV1PrintNodePrinters: build.query< + GetApiV1PrintNodePrintersApiResponse, + GetApiV1PrintNodePrintersApiArg + >({ + query: (queryArg) => ({ + url: `/api/v1/print_node_printers`, + params: { eventAbbr: queryArg.eventAbbr }, + }), + providesTags: ['PrintNodePrinter'], + }), getApiV1BoothsByBoothId: build.query< GetApiV1BoothsByBoothIdApiResponse, GetApiV1BoothsByBoothIdApiArg @@ -438,6 +449,12 @@ export type GetApiV1SponsorsApiArg = { /** abbr of event (e.g. cndt2020) */ eventAbbr: string } +export type GetApiV1PrintNodePrintersApiResponse = + /** status 200 OK */ PrintNodePrinter[] +export type GetApiV1PrintNodePrintersApiArg = { + /** abbr of event (e.g. cndt2020) */ + eventAbbr: string +} export type GetApiV1BoothsByBoothIdApiResponse = /** status 200 OK */ Booth export type GetApiV1BoothsByBoothIdApiArg = { /** ID of booth */ @@ -527,6 +544,7 @@ export type CheckInEvent = { profileId: string eventAbbr: string checkInTimestamp: number + printerId?: string | undefined } export type CheckInTalk = { profileId: string @@ -672,6 +690,10 @@ export type Sponsor = { } | undefined } +export type PrintNodePrinter = { + id?: string | undefined + name?: string | undefined +} export type Booth = { id: number sponsorId: number @@ -762,6 +784,7 @@ export const { usePostApiV1ChatMessagesMutation, usePutApiV1ChatMessagesByMessageIdMutation, useGetApiV1SponsorsQuery, + useGetApiV1PrintNodePrintersQuery, useGetApiV1BoothsByBoothIdQuery, useGetApiV1ProfileByProfileIdPointsQuery, useOptionsApiV1ProfileByProfileIdPointsMutation, diff --git a/src/pages/[eventAbbr]/ui/admin/check_in_event/index.tsx b/src/pages/[eventAbbr]/ui/admin/check_in_event/index.tsx index 0f724af5..bb24aac7 100644 --- a/src/pages/[eventAbbr]/ui/admin/check_in_event/index.tsx +++ b/src/pages/[eventAbbr]/ui/admin/check_in_event/index.tsx @@ -1,11 +1,15 @@ import { NextPage } from 'next' -import React, { useMemo } from 'react' +import React, { useEffect, useMemo, useState } from 'react' import { Layout } from '../../../../../components/Layout' -import { useGetApiV1EventsByEventAbbrQuery } from '../../../../../generated/dreamkast-api.generated' +import { + PrintNodePrinter, + useGetApiV1EventsByEventAbbrQuery, + useGetApiV1PrintNodePrintersQuery, +} from '../../../../../generated/dreamkast-api.generated' import { useRouter } from 'next/router' import Error404 from '../../../../404' import { CheckIn } from '../../../../../components/CheckIn/CheckIn' -import { Typography } from '@material-ui/core' +import { MenuItem, Select, Typography } from '@material-ui/core' import { useSelector } from 'react-redux' import { authSelector } from '../../../../../store/auth' import { ENV } from '../../../../../config' @@ -30,7 +34,30 @@ const IndexMain = () => { { eventAbbr }, { skip }, ) + const [printers, setPrinters] = useState([]) + const { data, isLoading, isError, error } = useGetApiV1PrintNodePrintersQuery( + { eventAbbr }, + ) + useEffect(() => { + if (isLoading) { + return + } + if (isError) { + throw error + } + if (data) { + console.log(data) + setPrinters(data) + } + }, [data, isLoading, isError]) + const [selectedPrinter, setSelectedPrinter] = + useState(null) + const handleSelectChange = (event: React.ChangeEvent<{ value: unknown }>) => { + setSelectedPrinter( + printers.find((printer) => printer.id === event.target.value) || null, + ) + } if (event) { if (isAdminRole) { return ( @@ -38,7 +65,22 @@ const IndexMain = () => { イベント受付 ({event.abbr.toUpperCase()}) - + ( + + ) + ) } else {