GithubHelp home page GithubHelp logo

uoft-tapp / tapp-cp Goto Github PK

View Code? Open in Web Editor NEW
8.0 8.0 6.0 3.52 MB

TA assignment and matching application (TAPP) & Contract Presentment helper (CP) at the Department of Computer Science, University of Toronto

Ruby 41.21% JavaScript 48.86% CoffeeScript 0.03% CSS 3.06% HTML 6.18% Shell 0.47% Dockerfile 0.18% Sass 0.02%

tapp-cp's People

Contributors

freeatnet avatar jmzaleski avatar michellemtchai avatar mishaschwartz avatar reidka avatar simpslandyy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tapp-cp's Issues

printing contracts awkward on windows

PDF of contracts were previewing as blank in browser preview.
Lloyd thinks might be something to do with pdf "layers".
(Adobe acrobat shows and prints correctly, supporting Lloyd's theory.)

maybe rely on adobe client opening automatically on downloaded PDF?

application of ddah templates broken

This is a really weird one. No sense of whether it's front end or back end..
Basic issue is that when I apply a template for the second time the TA the template was applied to PREVIOUSLY seems to be set back to some empty default condition.

Okay, it's weird, so here's a detailed recipe for the simplest case I could find, namely applying one template to another. BTW, as will become clear below, only happens when you save the second template.

At time of writing HEAD of master was d24fed2

I started with a clean image. down -v all around.

  1. hack fetch.js to pretend you are some instructor (zaleskim)
iff --git a/app/javascript/cp/fetch.js b/app/javascript/cp/fetch.js
index 2a9b57d..1bf48ce 100644
--- a/app/javascript/cp/fetch.js
+++ b/app/javascript/cp/fetch.js
@@ -1274,7 +1274,7 @@ function fetchAuth() {
                 appState.setCurrentUserRoles(['cp_admin', 'hr_assistant', 'instructor']);
                 // default to cp_admin as selected user role
                 appState.selectUserRole('cp_admin');
-                appState.setCurrentUserName('DEV');
+                appState.setCurrentUserName('zaleskim'); //HACK: fake shib authentication
             } else {
                 // filter out roles not relevant to this application
                 let roles = resp.roles.filter(role =>
  1. up --build
  2. docker-compose run rails-app rake db:migrate db:seed
  3. visit http://localhost:3000/tapp/summary and import AS COURSE
    db/seeds/make-fake-chass-applicant-import-CSC300.json
  4. visit http://localhost:3000/cp and import db/seeds/matz-fake-offer-for-csc300-tas.json
  5. visit http://localhost:3000/cp/ddahs
  6. now switch roles to instructor (this is what above fetch.js hack makes possible)
  7. create a ddah template. Call it t1. put a recognizable line in it
  8. SAVE t1
  9. create a second ddah template. Call it t2. apply t1.
  10. SAVE t2
  11. holy smokes.. t1 just became empty!

If you do not save t2 after applying t1, but instead cancel out then t1 survives. IT IS THE SAVE

HLP courses are not in the app

Port of TAPP issue #175: uoft-tapp/tapp#175

@reidka:

The HLP courses appear in the JSON file exported from CHASS, but do not appear in the app after import.

For example, the following appears in the JSON, but I don't see the course anywhere in the app.

        {
            "course_id": "HLP101H1",
            "course_name": "Help Centre TA",
            "round_id": "110",
            "enrollment": "N/A",
            "n_positions": "6",

@gabriellesc:

Would it be possible for @alynch to change the dates input fields in CHASS to date inputs, or something equivalent such that the dates are always in a consistent format?

@reidka:

Maybe. We can ask.

@alynch:

The JSON file has date/time fields of the form:
"last_updated": "2017-07-31 23:57:09"

which is valid ISO_8601 format [1]. What format would you prefer?

[1] (a) The separator between date and time is normally 'T', but it's allowed to omit it by agreement between the parties. (b) We are not using a time zone designator.

@reidka:

Hi @alynch, the field in question sis the "dates" field in the courses. It is a text box in the application, and I filled it in (at least) two different ways.

@alynch:

Oh, sorry, my misunderstanding. Unfortunately the 'dates' field is a text field that departments use to indicate the duration of the appointment, and sometimes they use the field to add extra details. It would be quite a bit of work to convert it to two date fields (and a extra text field for extra info).

@gabriellesc:

@alynch would it be possible to add helptext and/or formatting validation to the field to suggest and/or enforce that the data is entered in a fixed format - while still allowing additional text? For example:

<input type="text" placeholder="dd/mm/yy - dd/mm/yy" pattern="[0-9]{2}/[0-9]{2}/[0-9]{2} - [0-9]{2}/[0-9]{2}/[0-9]{2}.*" />

which would enforce the date format "dd/mm/yy - dd/mm/yy" but allow as much subsequent additional text as desired?

Fix and enhance DDAH UI

  • Simplify the template form to use CSS/HTML instead of the pdf view.
  • Allow TAs to create templates and enter data

run experiment to find out if EXPOSE 3000 is redundant in tapp/Dockerfile

Port of TAPP issue #196: uoft-tapp/tapp#196

@jmzaleski:

My reading of the docker-compose literature suggests that the port command in tapp/docker-compose.yml is what actually makes this work.

More suspicious yet when I notice that cp/Dockerfile expose port 3000 also -- but then cp/docker-compose.yml says 5000:5000 and that's where we appear to wind up listening.

@freeatnet:

My 2 cents: my read of things suggests that keeping EXPOSE directive in the Dockerfile, even if it's made slightly redundant by the use of docker-compose, is a good practice, because it provides documentation of which port(s) an image is capable of publishing and DRYs up use of container in other setups (ie., Docker Swarm / Docker Cloud).

Networks created by docker-compose conflict with private ips used @dcs

Port of TAPP issue #186: uoft-tapp/tapp#186

@lloyd-uot-cs:

We configured the docker daemon to have the docker0 interface use 192.168.152.0
instead of the default 172.17.0.0 (which collides with red.sandbox on dcs machines).

This works when just the docker daemon is running:

tapp@doc:~/tapp$ netstat -ar
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
default router.pub.sand 0.0.0.0 UG 0 0 0 ens160
localnet * 255.255.255.0 U 0 0 0 ens160
192.168.152.0 * 255.255.255.0 U 0 0 0 docker0

Once we launch the tapp app, docker-compose spins up two more
network interfaces, (tapp_internal and tapp_external) and they are
allocated 172.17.0.0 and 172.18.0.0, which again collide:

tapp@doc:~/tapp$ docker-compose up -d
Creating network "tapp_internal" with driver "bridge"
Creating network "tapp_external" with driver "bridge"
Creating tapp_postgres_1
Creating tapp_rails-app

tapp@doc:~/tapp$ netstat -ar
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
default router.pub.sand 0.0.0.0 UG 0 0 0 ens160
172.17.0.0 * 255.255.0.0 U 0 0 0 br-c489d67e84d7
172.18.0.0 * 255.255.0.0 U 0 0 0 br-3824b523e9aa
localnet * 255.255.255.0 U 0 0 0 ens160
192.168.152.0 * 255.255.255.0 U 0 0 0 docker0

Unlike docker0, this isn't a docker install issue, it is specific to tapp because
if I bring up a generic docker container that serves web pages it doesn't
add additional interfaces and I can access the host from a red net machine.

pocadmin@doc:~/mytest$ docker run -it --rm --name my-apache-app -p80:80 -v "$(pwd)":/usr/local/apache2/htdocs/ httpd:2.4

tapp@doc:~/tapp$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
ae8beb922348 httpd:2.4 "httpd-foreground" 3 seconds ago Up 3 seconds 0.0.0.0:80->80/tcp my-apache-app
tapp@doc:~/tapp$ netstat -ar
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
default router.pub.sand 0.0.0.0 UG 0 0 0 ens160
localnet * 255.255.255.0 U 0 0 0 ens160
192.168.152.0 * 255.255.255.0 U 0 0 0 docker0

I assume this explains something about a solution
https://docs.docker.com/compose/compose-file/#external-1

external

If set to true, specifies that this network has been created outside of Compose.
docker-compose up will not attempt to create it, and will raise an error if it doesn’t exist.

lloyd

@jmzaleski:

I have an idea (Peter Marbach made me think this).
Clue: we are trying to route non-routable IPs
Hence: don't

Instead, put the reverse proxy onto a separate VM -- hence it's routing won't be polluted by all of dockers fancy bridge network adapters.

Like so:
img_20170818_170258

@lloyd-uot-cs:

Fixed on doc.pub.sandbox with:

# docker network create --driver=bridge --subnet=192.168.153.0/24 --ip-range=192.168.153.0/24 --gateway=192.168.153.254 frontend
# docker network create --driver=bridge --subnet=192.168.154.0/24 --ip-range=192.168.154.0/24 --gateway=192.168.154.254 backend

Changed ~tapp/tapp/docker-compose.yml to have :

networks:
# Names of the networks will be prefixed with project name by docker
backend:
external: true

frontend:
external: true

Rebuilt app, populated database from backup, now can reach
http://doc.pub.sandbox:3000/index.html/summary from a red subnet machine.

I have a /etc/daemon/daemon.json file that I think does the docker network create
at boot time... still testing.

@lloyd-uot-cs:

I don't have the daemon.json file syntax right, but will fiddle with the network(s) to remove their ability to route for

Instructor Panel "Dept." Filter

In the Instructor Panel view,

  • The filter 'Dept.' is missing most of the departments in the table. Fill this dropdown list dynamically based on the existing departments in the table rows within the same course panel. (i.e. don't add a department to the dropdown that does not exist in the table).

Instructor Panel layout

In the Instructor Panel view,

  • Responsive layout is nice, but unreadable at narrow viewports. consider adding css of min-width, and allow the dreaded horizontal scroll.
  • 'Personal Information' section of the modal breaks at narrow viewports.
  • Column 'other' is used to list other Current Assignment statuses of the TA. Reduce the width of this field to either a max-width, or to fit to the widest cell of this column.
  • Table header cells don't line up with table column vertical lines.
  • CoursePanel heading should be (visibly) emphasized.

exporting is broken

In TAPP, I have an application that is not locked. I export to JSON, get the popup message, and then I get a red popup that should contain an error message, but it is empty and the export does not succeed.

restart after host crash - Using Compose in production

Port of TAPP issue #188: uoft-tapp/tapp#188

@lloyd-uot-cs:

We need to do this so that if tapp.cs reboots the app comes back up
... "Specifying a restart policy (e.g., restart: always) to avoid downtime"

https://docs.docker.com/compose/production/

Using Compose in production

When you define your app with Compose in development, you can use this definition to run your application in different environments such as CI, staging, and production.

The easiest way to deploy an application is to run it on a single server, similar to how you would run your development environment. If you want to scale up your application, you can run Compose apps on a Swarm cluster.

Modify your Compose file for production

You’ll almost certainly want to make changes to your app configuration that are more appropriate to a live environment. These changes may include:

Removing any volume bindings for application code, so that code stays inside the container and can’t be changed from outside
Binding to different ports on the host
Setting environment variables differently (e.g., to decrease the verbosity of logging, or to enable email sending)
Specifying a restart policy (e.g., restart: always) to avoid downtime
Adding extra services (e.g., a log aggregator)

For this reason, you’ll probably want to define an additional Compose file, say production.yml, which specifies production-appropriate configuration. This configuration file only needs to include the changes you’d like to make from the original Compose file. The additional Compose file can be applied over the original docker-compose.yml to create a new configuration.

Create an API specification

(Perhaps using Swagger?)

After that, it would probably be worth going through all of the front-end fetching functions and verifying that they handle error responses from the server correctly.

Browser incompatabilities

Port of TAPP issue #190: uoft-tapp/tapp#190

@lloyd-uot-cs:

Firefox on Windows non-admin account can delete instructors,
but don't get the cursor to type in replacements. Firefox on Windows
admin account works fine

Internet Explorer doesn't work as admin or non-admin

@gabriellesc:

@lloyd-uot-cs Might this have been resolved subsequent to #174?

@lloyd-uot-cs:

You're right! I did a git pull on my test machine and Firefox works now,
but Internet Explorer still has problems with the site...

The IE debugger console says: Error SCRIPT5009: 'fetch' is undefined
File: app-8dacd81794b2a8e58520.js, Line: 1, Column: 109240

Not really sure if that is what's wrong.

@gabriellesc:

@lloyd-uot-cs Is there a way to set up a development/testing environment on my machine with IE? ...Is there even a point supporting IE now that it's being replaced with Edge?

Improve CP `can-*` error messages

Currently, the error message produced when an offer cannot be sent/nagged/processed/printed refers only to the offer number, which is not useful to the user.

How to handle subsequent appointments

Port of TAPP issue #176: uoft-tapp/tapp#176

@reidka:

(This is a longer term issue that won't be solved now)

Looking through the PhD students who indicated that they would accept the subsequent appointment guarantees, quite a few did not apply to TA.

Without opening a new round, they can't apply through CHASS, so there is the open question of how to get their application information.

To resolve this issue there will need to be some discussion of best approach and integration with CHASS.

Add instructors to courses

It would be nice to be able to add instructors to courses when the instructor is not already in the data base.

This means that we would need to get extra information (email utorid?) about the instructor.

Instructor Panel URI

In the Instructor Panel view,

  • Set up route to /instructorPanel

To reproduce, in the top-right corner select 'instructor:zeleskim' to change URI to "localhost:3000/tapp/instructorPanel". Now notice the page cannot be reloaded (Instructor Panel view changes to Summary view).

Add more error checking in the importer

Port of TAPP issue #187: uoft-tapp/tapp#187

@reidka:

There may be a few places in the importer where a record fails to be imported, but no error message is generated. Even if the error message has to be unspecific, we need to know about anything that was not imported.

This was discovered but not fully addressed (I think?) in #175.

Create instructor landing page

When instructors log in, show important information such as courses they are involved in with respect to DDAH forms.

Also think of use cases for instructors and test with plenty of TAs with different parameters (e.g. number of hours).

Instructor Panel modal

In the Instructor Panel view,

  • Clicking Instructor Pref. should not bring up the modal of TA applicant info.
  • Clicking row (except for preference dropdown or lock icon) should bring up the modal of TA applicant info.
  • Add a more visual cue for click to bring up modal (existing is bold last name). Examples: row colour, hand cursor, more underline or bold...

Replace all uses of 'enrollment' with 'enrolment' in the backend for consistency

Port of TAPP issue #201: uoft-tapp/tapp#201

@gabriellesc:

Should be able to use the following command from the root tapp directory:

for f in `grep [Ee]nrollment * -rl`; do
    sed -i 's/enrollment/enrolment/' $f
    sed -i 's/Enrollment/Enrolment/' $f
done

We should also rename the files that use enrollment in their names.
Should be able to use the following command from the root tapp directory:

for f in `find * -name '*[Ee]nrollment*'`; do
    mv $f `echo $f | sed 's/enrollment/enrolment/' | sed 's/Enrollment/Enrolment/'`
done

Note: Will also need to do this replacement in fetch.js and appState.js

...specifically, TAPP's fetch.js and appState.js

You are attempting to run a destructive action against your 'production' database.

Port of TAPP issue #207: uoft-tapp/tapp#207

@lloyd-uot-cs:

Stashing this error message here.

I don't recall seeing it before, but it sounds like a sane sanity check since it is a production database I was destroying.

tapp@doc:~/tapp$ docker-compose run rails-app rake db:drop
rake aborted!
ActiveRecord::ProtectedEnvironmentError: You are attempting to run a destructive action against your 'production' database.
If you are sure you want to continue, run the same command with the environment variable:
DISABLE_DATABASE_ENVIRONMENT_CHECK=1
/srv/app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.1/lib/active_record/tasks/database_tasks.rb:59:in check_protected_environments!' /srv/app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.1/lib/active_record/railties/databases.rake:11:in block (2 levels) in <top (required)>'
/srv/app/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
Tasks: TOP => db:drop => db:check_protected_environments
(See full trace by running task with --trace)

Replace the current applicant tables with lazy-loading/-rendering tables

Port of TAPP issue #166: uoft-tapp/tapp#166

@gabriellesc:

We want the following features:

  • fixed header (the table body scrolls but the header remains at the top)
  • cell content wrapping and/or scrolling -> requires variable row heights or horizontal scrolling (respectively)
  • customizable column widths
  • styling (or the ability to style the table adequately ourselves)

https://techblog.commercetools.com/advanced-data-tables-in-react-dbe33f8345ab may be a starting point (although it is outdated).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.