bcgov / DBC-APIM

DataBC OPEN API Services
Apache License 2.0
1 stars 0 forks source link

Heartbeat - Code cleanup and duplicates #43

Closed BK01 closed 7 years ago

BK01 commented 7 years ago

Skills / SW:

Background: https://github.com/bcgov/dbcrss/blob/master/heartbeat/README.md

Description:

Examine the JavaScript (d3) and HTML files used (see Master for reference, gh-pages for live) and determine if it is possible to create a generic approach where one JS and one HTML file could be used by any API rather than hard coding in the source txt file in the JS file, and hadrdcoding the JS file name in the HTML file. Is this the best we can do? Or is there another option with parameters?

Fork and adjust as necessary. This repo uses both master and gh-pages branch.

banders commented 7 years ago

I forked the repo and committed a patch which reduces the amount of redundancy in the js files. The pull request is here.

BK01 commented 7 years ago

To separate

BK01 commented 7 years ago

Add new folder to Master branch called 'data'. Separates data from source code.

Update textfile path in Javascript (in both Master and gh-pages) branches. Also update the filepath in the Heartbeat.py file.

banders commented 7 years ago

@BK01 @ll911 I think we should also separate heartbeat.py from the text files, otherwise we'll get conflicts when we try to merge pull requests related to heartbeat.py changes.

I suggest we reporganize the repo into these branches:

In addition, I suggest we stop using the master branch in this repo because each of the above is essentially a master for a different set of files, but the branch names above are more descriptive than "master".

Thoughts?

banders commented 7 years ago

I removed redundant js code and reorganized the gh-pages and master branches. gh-pages now has the only copy of the HTML, JS and CSS code. master now contains the heartbeat pythons script and the data files generated by that script.

The relevant pull requests (here and here) have already been merged.