MITLibraries / MITlibraries-parent

The parent theme for MIT Libraries on WordPress
https://libraries.mit.edu
GNU General Public License v3.0
1 stars 3 forks source link

Updates hours loader #327

Closed matt-bernhardt closed 4 years ago

matt-bernhardt commented 4 years ago

Status

Use labels (review needed, in progress, or paused) to declare status

What does this PR do?

This will do two things, if approved:

  1. Move the hours loader out of a separate repository, and into this parent theme (which is where it is invoked anyway). This will include moving some libraries into the repo, such as underscore and moment.

  2. Updates that hours loader to cope with the new data format coming out of the Sheets API v4.

Helpful background context (if appropriate)

This change is related to MITLibraries/mitlib-pull-hours#5 - which is updating the Harvester to pull data from the Sheets API v4.

When merged, we will be able to empty out (or delete altogether) two other repos: https://github.com/MITLibraries/libhours-buildjson (directory needed, but nothing else) https://github.com/MITLibraries/libhours (all these files are either no longer needed, or moved into this theme)

How can a reviewer manually see the effects of these changes?

This branch has been deployed to the staging site, and all traces of the old hours loader have been removed.

What are the relevant tickets?

Todo:

Requires new or updated plugins, themes, or libraries?

YES (although they are in this repo)

Requires change to deploy process?

NO

matt-bernhardt commented 4 years ago

CodeClimate is flagging 7 instances of things being too long, one of which is the hours loader object itself. I'm open to feedback that this needs to be structured differently, but I'm not sure about getting the overall file to under 250 lines. I don't know that we've had a discussion about this sort of metric and its usefulness, so maybe we can do that soonish?