Skip to content

Commit

Permalink
Frontend refactor: typescript added, updated packages, directory stru…
Browse files Browse the repository at this point in the history
…cture and functional components (#55)

* folder structure

* TwoSlotDisplay functional component

* functional component and changed folders in components

* typescript added

* added createRoot for react v5

* feedback changes

* frontend package.json chaned

* refactor: remove unused imports

Signed-off-by: Chirag Ghosh <[email protected]>

* fix: all cells now printing

Signed-off-by: Chirag Ghosh <[email protected]>

* chore: update lock file

Signed-off-by: Chirag Ghosh <[email protected]>

* refactor: reove redundant .browserlistrc

Signed-off-by: Chirag Ghosh <[email protected]>

* refactor: remove outdated files

Signed-off-by: Chirag Ghosh <[email protected]>

* fix: add break between lines

Signed-off-by: Chirag Ghosh <[email protected]>

---------

Signed-off-by: Chirag Ghosh <[email protected]>
Co-authored-by: Lakshya Satpal <[email protected]>
Co-authored-by: Chirag Ghosh <[email protected]>
  • Loading branch information
3 people authored Jun 9, 2024
1 parent 28b84dd commit d426ab7
Show file tree
Hide file tree
Showing 30 changed files with 10,838 additions and 7,457 deletions.
8 changes: 4 additions & 4 deletions first-year-scraper/generate_schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ def format_cell(original_value):
return [x for sub in original_value.split("\n") for j in sub.split(" ") for x in j.split(",") if x]

def generate_schedule(valid_sheets, workbook, subjects_dict):
with open("../frontend/src/schedule.json", "r") as json_data:
with open("../frontend/src/data/schedule.json", "r") as json_data:
schedule_dict = json.load(json_data)
with open("../frontend/src/empty_schedule.json", "r") as json_data:
with open("../frontend/src/data/empty_schedule.json", "r") as json_data:
empty_schedule_dict = json.load(json_data)

for sheet in valid_sheets:
Expand Down Expand Up @@ -45,10 +45,10 @@ def generate_schedule(valid_sheets, workbook, subjects_dict):
if(room in empty_schedule_dict[i][j]):
empty_schedule_dict[i][j].remove(room)

with open("../frontend/src/schedule.json", "w") as outfile:
with open("../frontend/src/data/schedule.json", "w") as outfile:
json.dump(schedule_dict, outfile, indent=2)

with open("../frontend/src/empty_schedule.json", "w") as outfile:
with open("../frontend/src/data/empty_schedule.json", "w") as outfile:
json.dump(empty_schedule_dict, outfile, indent=2)


Expand Down
4 changes: 2 additions & 2 deletions first-year-scraper/generate_subjectDetails.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ def generate_subjectDetails():
get_cell_value(5, i+4).upper()+" TUTORIAL",
]

with open("../frontend/src/subjectDetails.json", "r") as json_data:
with open("../frontend/src/data/subjectDetails.json", "r") as json_data:
subject_details = json.load(json_data)

for key in subjects_dict.keys():
subject_details[subjects_dict[key][0]] = subjects_dict[key][1]

with open("../frontend/src/subjectDetails.json", "w") as outfile:
with open("../frontend/src/data/subjectDetails.json", "w") as outfile:
json.dump(subject_details, outfile, indent=2)

return subjects_dict
Expand Down
3 changes: 0 additions & 3 deletions frontend/.browserslistrc

This file was deleted.

32 changes: 25 additions & 7 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@
"dependencies": {
"lodash.chunk": "^4.2.0",
"lodash.intersection": "^4.4.0",
"prop-types": "^15.7.2",
"react": "^16.13.1",
"react-bootstrap": "^0.32.4",
"react-dom": "^16.13.1",
"react-scripts": "^1.1.1",
"react-table": "^6.7.6",
"react": "^18.2.0",
"react-bootstrap": "^2.9.1",
"react-dom": "^18.2.0",
"react-scripts": "^5.0.1",
"react-table": "^7.8.0",
"save-dev": "0.0.1-security"
},
"scripts": {
Expand All @@ -23,6 +22,25 @@
"heroku-prebuild": "npm install -g serve"
},
"devDependencies": {
"gh-pages": "^3.1.0"
"@types/lodash.chunk": "^4.2.9",
"@types/lodash.intersection": "^4.4.9",
"@types/jest": "^29.5.10",
"@types/node": "^20.10.0",
"@types/react": "^18.2.38",
"@types/react-dom": "^18.2.17",
"gh-pages": "^3.1.0",
"typescript": "^5.3.2"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
Loading

0 comments on commit d426ab7

Please sign in to comment.