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

Alex-budko/issue491 #501

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open

Alex-budko/issue491 #501

wants to merge 22 commits into from

Conversation

alex-budko
Copy link
Contributor

Fixed the UI for PennCoursePlan to show a download icon next to each calendar, implying that we can independently download/import any one of our named schedules:

Copy link
Contributor

@AaDalal AaDalal left a comment

Choose a reason for hiding this comment

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

Left a few comments -- here's a summary

  1. We should lint front + backend
  2. Let's make sure this is visually consistent. Can you send a screenshot of how it looks in the penn courses channel on slack?
  3. There are some weird dependency adds + dev set up changes on the backend. Let's remove or chat about those.

backend/PennCourses/settings/development.py Outdated Show resolved Hide resolved
backend/Pipfile Outdated
@@ -60,6 +60,9 @@ scikit-learn = "*"
pandas = "*"
python-dateutil = "*"
docutils = "*"
ics = "*"
psycopg2-binary = "*"
Copy link
Contributor

Choose a reason for hiding this comment

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

could we add this under dev packages at the very least?

@@ -0,0 +1,27 @@
# Generated by Django 4.1.5 on 2023-01-15 16:39
Copy link
Contributor

Choose a reason for hiding this comment

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

can we merge this migration with the migrations on master?

@@ -1,15 +1,15 @@
from django.urls import include, path
from django.views.generic import TemplateView
from rest_framework import routers
from rest_framework_nested import routers
Copy link
Contributor

Choose a reason for hiding this comment

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

Wait why do we use rest_framework_nested here?

)

def get(self, *args, **kwargs):
"""
Copy link
Contributor

Choose a reason for hiding this comment

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

we usually document this information in PcxAutoSchema -- see here for an example.

days.append(day_mapping[meeting.day])
first_meeting = list(section.meetings.all())[0]

start_time = str(Meeting.int_to_time(first_meeting.start))
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a general question -- is there a reason we do this from the backend instead of the frontent?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When I first built the feature I had all the logic done on the frontend, but Rohan suggested that logic be moved to the backend to simplify the frontend code and make it look more visually appealing

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok yeah I think the link is maybe more intuitive.

days = []
for meeting in section.meetings.all():
days.append(day_mapping[meeting.day])
first_meeting = list(section.meetings.all())[0]
Copy link
Contributor

Choose a reason for hiding this comment

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

is any sorted order intended here?

@@ -20,5 +20,7 @@
"hooks": {
"pre-commit": "lerna run --concurrency 1 precommit"
}
},
"dependencies": {
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need to have a dependencies obj?

<hr />

<Row className="columns has-text-centered">
<div className="column">
Copy link
Contributor

Choose a reason for hiding this comment

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

nit but I think we use 2 space indentation -- you also may need to lint the frontend

onClick={async () => {
try {
await navigator.clipboard.writeText(url);
toast.info("Copied to clipboard!");
Copy link
Contributor

Choose a reason for hiding this comment

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

how does this toast look? We should make sure it's visually consistent

@AaDalal
Copy link
Contributor

AaDalal commented Aug 23, 2023

One other thing I thought of -- it might be nice to have the calendar show up with a default name when you add the URL to google (not sure if it's possible or how much work it is -- just a thought)

Copy link
Member

@andyjiang3 andyjiang3 left a comment

Choose a reason for hiding this comment

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

Left some small comments. Can we also add some margin between the description text and the ics url and make the ics url label width smaller so that the url is shown more

Screenshot 2023-09-04 at 6 54 16 PM

4. There's just one last complication. Due to some annoying details of Docker networking, you have to expose the server on IP address `0.0.0.0` inside the container, rather than `127.0.0.1` or `localhost` as is default (otherwise the server won't be accessible from outside of the container). To do this, instead of running `python manage.py runserver`, run `python manage.py runserver 0.0.0.0:8000`. In `Dockerfile.dev`, we automatically alias the command `runserver` to the latter, so in the container shell (in `/backend`, as is default) you can simply run the command `runserver` (no `python manage.py` necessary).
- To alias this command, run `echo "alias courses-compose='cd "$PWD"; docker-compose up'" >> ~/.zshrc; source ~/.zshrc` (replacing `~/.zshrc` with `~/.bashrc` or whatever configuration file your shell uses, if you don't use zsh).
- This will spin up a container from which you can run the server (with all required packages preinstalled).
3. In a separate terminal (from any directory), run `docker exec -it backend-development-1 /bin/bash` to open a shell in the container (if this says "no such container", run `docker container ls` and use the name of whatever container most closely matches the `backend_development` image). Just like exiting a Pipenv shell, you can exit the container by pressing `Ctrl+D` (which sends the "end of transmission" / EOF character).
Copy link
Member

Choose a reason for hiding this comment

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

The numbering is off here, should be 2

</a>
</BigText>
</div>
</Row>
Copy link
Member

Choose a reason for hiding this comment

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

Is there a reason why we're removing this? Seems like it would be helpful to include for people that don't know how to use ICS URL

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

Successfully merging this pull request may close these issues.

3 participants