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

Schedule Builder Feature #867

Open
wants to merge 58 commits into
base: dev
Choose a base branch
from
Open

Schedule Builder Feature #867

wants to merge 58 commits into from

Conversation

kmd2zjw
Copy link
Contributor

@kmd2zjw kmd2zjw commented Jul 29, 2024

Schedule builder feature with edit, create, and delete capabilities.

NOTE: add to schedule from search page is not implemented on this branch and is left for future work

kmd2zjw and others added 30 commits November 24, 2023 12:49
@kmd2zjw kmd2zjw linked an issue Jul 29, 2024 that may be closed by this pull request
1 task
@barrett-ruth
Copy link
Contributor

@kmd2zjw can you resolve merge conflicts?

@kmd2zjw
Copy link
Contributor Author

kmd2zjw commented Jul 30, 2024

Ok, I went ahead and merged dev into this branch. Let me know what else you think.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are there changes to this file? We currently have a finnicky node module setup - are these changes necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think they are necessary, I don't remember importing any dependencies.

tcf_website/models/models.py Outdated Show resolved Hide resolved
tcf_website/models/models.py Outdated Show resolved Hide resolved
tcf_website/models/models.py Outdated Show resolved Hide resolved

return scheduled_courses

def calculate_total_rating(self, rating):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add python type annotations to this function and everywhere. This will make sure you handle cases where this function returns None, for example.

return ret;
}

function parseTime(time_string) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For all functions in this file, I would DEFINITELY comment an example input and output. It is very difficulty to see what's actually happening here.


function consolidateTimes(times) {
selected_classes_meeting_times = [[],[],[],[],[]]
for (var selected_class = 0; selected_class < times.length; selected_class++) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let not var

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, once again, the organization of this data makes think function very odd. Wouldn't it make more sense, for example, to have a list of selected class identifiers that map to meeting times explicitly, rather than implicityl through an array structure?

@@ -0,0 +1,89 @@
/* eslint-disable */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't disable - LMK if you are having trouble configuring your IDE. I recommend the eslint plugin and configuring auto-formatting. Artie added VSCode setup docs

<script>

function buttonDoubleSubmit() {
// this function is for preventing a double submit
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean by this - "double-submit" on forms is usually handled via a sort of threshold/debounce time.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code basically does that.

if(isConflict){
// if there is a conflict, alert the user and return
event.preventDefault();
alert("Error: new course has a time conflict with this schedule. Select another section time and try again.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you specify more specifically about the specific course with a conflict?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's possible, but I think it would be very complicated with the current code. For now it might be better to save this for a future ticket, I think.

@alex-yung-github
Copy link
Contributor

Some of the bugs when testing around with the feature so far:
https://docs.google.com/document/d/10LU_-e_PkhBpyYSt8YtyD1xTcC4M8F0KFw6xAiRf0O8/edit?usp=sharing

@kmd2zjw
Copy link
Contributor Author

kmd2zjw commented Aug 29, 2024

Some of the bugs when testing around with the feature so far: https://docs.google.com/document/d/10LU_-e_PkhBpyYSt8YtyD1xTcC4M8F0KFw6xAiRf0O8/edit?usp=sharing

I put some comments in the document.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Personalization: Schedule Builder
5 participants