Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Front UI create election #127

Merged
merged 24 commits into from
May 30, 2022
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
b93184a
Adds accordionSubject
badrlarhdir May 12, 2022
2c4aea4
Fixes election UI
badrlarhdir May 17, 2022
c1b1044
Adds question Modal
badrlarhdir May 18, 2022
fecb4a4
Removes updateFile drag and drop
badrlarhdir May 21, 2022
e70364d
Changes height of modal
badrlarhdir May 21, 2022
b8b42b3
Validates questions data before saving
badrlarhdir May 24, 2022
5c7f620
Refactors handle add question
badrlarhdir May 24, 2022
f7835d1
Adds line before remove element in dropdown
badrlarhdir May 24, 2022
835287e
Fixes MinMaxValue for Rank
badrlarhdir May 24, 2022
1b0e678
Removes react-dropzone
badrlarhdir May 25, 2022
15a4974
Fixes rank min/max value input
badrlarhdir May 25, 2022
be7b4a4
Adds tab for small screens
badrlarhdir May 25, 2022
c64dd3c
Fixes small ref problem
badrlarhdir May 25, 2022
50571fc
Fixes displayExtraFields for text
badrlarhdir May 25, 2022
bd79a44
Fixes small bug update in displayExtraFields
badrlarhdir May 25, 2022
211bf50
Fixes maxLength being possibly 0
badrlarhdir May 25, 2022
de72625
Fixes small visual problem with preview padding
badrlarhdir May 25, 2022
9f6ae49
Adds removeElementModal and functionnality
badrlarhdir May 25, 2022
e450fb8
Changes text's choices text
badrlarhdir May 25, 2022
b5bbb0d
Fixes all usability problems in questions
badrlarhdir May 30, 2022
a04b03b
Adds proptype to SubjectDropdown
badrlarhdir May 30, 2022
a13edaa
Adds padding and translation keys
badrlarhdir May 30, 2022
0cadb93
Merge branch 'main' into front-ui-create-election
badrlarhdir May 30, 2022
3f42bf4
Removing unrecheable code
badrlarhdir May 30, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 0 additions & 59 deletions web/frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion web/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"react": "^17.0.2",
"react-beautiful-dnd": "^13.1.0",
"react-dom": "^17.0.2",
"react-dropzone": "^12.0.4",
"react-i18next": "^11.15.3",
"react-router": "^6.2.1",
"react-router-dom": "^6.2.1",
Expand Down
2 changes: 1 addition & 1 deletion web/frontend/src/components/buttons/DownloadButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const DownloadButton: FC<DownloadButtonProps> = ({ exportData, children }) => {
return (
<button
type="button"
className="flex inline-flex my-2 mx-2 items-center px-4 py-2 border border-transparent rounded-md shadow-sm text-sm shadow-md font-medium hover:text-indigo-500"
className="inline-flex my-2 mx-2 items-center px-4 py-2 border rounded-md text-sm font-medium hover:text-indigo-500"
onClick={exportData}>
<CloudDownloadIcon className="-ml-1 mr-2 h-5 w-5" aria-hidden="true" />
{children}
Expand Down
25 changes: 24 additions & 1 deletion web/frontend/src/language/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,22 @@
"notFoundLink": "Go to home page",
"results": "results",
"showing": "Showing",
"saveQuestion": "Save",
"addRank": "Add rank",
"editrank": "Edit rank",
"removerank": "Remove rank",
"addSelect": "Add select",
"editselect": "Edit select",
"removeselect": "Remove select",
"addText": "Add text",
"edittext": "Edit text",
"removetext": "Remove text",
"removeSubject": "Remove subject",
"addSubject": "Add subject",
"addQuestionrank": "Rank",
"addQuestionselect": "Select",
"addQuestiontext": "Text",
"importFile": "Import JSON file",
"enterSciper": "Please give the sciper of the user",
"adminDetails": "Add or remove roles of users from the admin table",
"navBarCreateElection": "Create election",
Expand All @@ -41,10 +57,17 @@
"combine": "Combine shares",
"createElec": "Create election",
"clearElec": "Clear election",
"confirmRemovesubject": "Do you really want to remove this subject?",
"confirmRemovetext": "Do you really want to remove this text?",
"confirmRemoverank": "Do you really want to remove this rank?",
"confirmRemoveselect": "Do you really want to remove this select?",
"upload": "Choose a json file from your computer:",
"notJson": "The file needs to have the .json extension.",
"noFile": "No file found",
"create": "Create a new election by filling out the information below or by uploading a json file",
"createElecDesc": "Create a new election by filling out the information below or by",
"uploadJSON": "uploading a JSON file",
"enterMainTitle": "Enter the Main Title",
"enterSubjectTitle": "Enter the Subject Title",
"errorCandidates": "You must add at least one candidate!",
"errorNewCandidate": "Are you sure you don't want to add ",
"errorRetrievingElection": "An error seems to have occurred while retrieving all the elections from our server. Contact the administrator of this website.",
Expand Down
5 changes: 2 additions & 3 deletions web/frontend/src/pages/election/New.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@ const ElectionCreate: FC = () => {
const { t } = useTranslation();

return (
<div className="font-sans">
<div className="px-4 py-4">
<div className="w-[70rem] font-sans md:px-4 md:py-4">
<div className="px-4 pt-4">
<h2 className="text-2xl font-bold leading-7 text-gray-900 sm:text-3xl sm:truncate">
{t('navBarCreate')}
</h2>
<div className="pt-2">{t('create')}</div>
</div>
<ElectionForm />
</div>
Expand Down
Loading