Skip to content

Commit

Permalink
Add redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
ArendPeter committed Jan 16, 2025
1 parent c4b58fe commit d528d79
Show file tree
Hide file tree
Showing 5 changed files with 137 additions and 0 deletions.
Binary file modified docs/favicon.ico
Binary file not shown.
Binary file added docs/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
131 changes: 131 additions & 0 deletions packages/backend/src/OpenApi/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,25 @@
],
"type": "object"
},
"BallotSubmitStatus": {
"properties": {
"message": {
"type": "string"
},
"success": {
"type": "boolean"
},
"voter_id": {
"type": "string"
}
},
"required": [
"message",
"success",
"voter_id"
],
"type": "object"
},
"Candidate": {
"properties": {
"bio": {
Expand Down Expand Up @@ -729,6 +748,21 @@
],
"type": "object"
},
"NewBallotWithVoterID": {
"properties": {
"ballot": {
"$ref": "#/components/schemas/NewBallot"
},
"voter_id": {
"type": "string"
}
},
"required": [
"ballot",
"voter_id"
],
"type": "object"
},
"NewElection": {
"properties": {
"admin_ids": {
Expand Down Expand Up @@ -1151,6 +1185,8 @@
"canInvalidateElectionRoll",
"canSendEmails",
"canUnflagElectionRoll",
"canUpdatePublicArchive",
"canUploadBallots",
"canViewBallot",
"canViewBallots",
"canViewElection",
Expand Down Expand Up @@ -1201,6 +1237,12 @@
},
"type": "array"
},
"logs": {
"items": {
"$ref": "#/components/schemas/tabulatorLog"
},
"type": "array"
},
"other": {
"items": {
"$ref": "#/components/schemas/candidate"
Expand Down Expand Up @@ -1235,6 +1277,7 @@
},
"required": [
"elected",
"logs",
"other",
"roundResults",
"summaryData",
Expand Down Expand Up @@ -2564,6 +2607,94 @@
}
}
},
"/Election/{id}/uploadBallots": {
"post": {
"summary": "Upload ballots for an election",
"tags": [
"Ballots"
],
"security": [
{
"ApiKeyAuth": []
}
],
"parameters": [
{
"in": "path",
"name": "id",
"schema": {
"type": "string"
},
"required": true,
"description": "The election ID"
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"ballots": {
"type": "array",
"items": {
"type": "object",
"properties": {
"ballot": {
"type": "object",
"$ref": "#/components/schemas/NewBallot"
},
"voter_id": {
"type": "string"
}
}
}
}
}
}
}
}
},
"respon ses": {
"200": {
"description": "All Ballots Processed",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"responses": {
"type": "array",
"items": {
"type": "object",
"properties": {
"voter_id": {
"type": "string",
"description": "id of voter"
},
"success": {
"type": "boolean",
"description": "If ballot was uploaded"
},
"message": {
"type": "string",
"description": "Corresponding message"
}
}
}
}
}
}
}
}
},
"404": {
"description": "Election not found"
}
}
}
},
"/Election/{id}": {
"get": {
"summary": "Get election by ID",
Expand Down
2 changes: 2 additions & 0 deletions packages/frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import './i18n/i18n'
import ReturnToClassicDialog, { ReturnToClassicContextProvider } from './components/ReturnToClassicDialog'
import { useSubstitutedTranslation } from './components/util'
import UploadElections from './components/UploadElections'
import Redirect from './components/Redirect'

const App = () => {
const {t} = useSubstitutedTranslation();
Expand Down Expand Up @@ -60,6 +61,7 @@ const App = () => {
<Route path='/Election/:id/*' element={<Election />} />
<Route path='/:id/*' element={<Election />} />
<Route path='/Sandbox' element={<Sandbox />} />
<Route path='/Volunteer' element={<Redirect href={'https://docs.bettervoting.com/contributions/0_contribution_guide.html'}/>} />
</Routes>
</Box>
<Footer />
Expand Down
4 changes: 4 additions & 0 deletions packages/frontend/src/components/Redirect.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export default ({href}) => {
window.location.href = href;
return <></>
}

0 comments on commit d528d79

Please sign in to comment.