Coder Social home page Coder Social logo

wb-composting's Introduction

WBComposting README

Run with Vagrant

Installing

  1. Download Install VirtualBox

  2. Download Install Vagrant

  3. Install Ansible, preferably from source

    cd ~/
    git clone git://github.com/ansible/ansible.git
    cd ./ansible
    source ./hacking/env-setup
    

    If you don’t have pip installed in your version of Python, install pip (No harm running it if its already installed):

    sudo easy_install pip
    

    Install Ansible's requirements

    sudo pip install paramiko PyYAML jinja2 httplib2
    
  4. Change back into the project's directory

    cd /path/to/this/project
    
  5. Clone the Ona playbooks repo (into a different directory)

    git clone [email protected]:onaio/playbooks.git ~/playbooks
    
  6. Make a symbolic link to the playbooks directory

    ln -s ~/playbooks ansible
    
  7. Bring up the virtual machine with Vagrant

    vagrant up
    

    NOTE: This will keep the virtual machine running until you halt it via vagrant halt

  8. Provision using ansible

    vagrant provision
    

    NOTE: To update to the latest version at any time, run the provision command again.

Running

  1. ssh into the virtual machine

    vagrant ssh
    
  2. Change into the project's directory

    cd /vagrant
    
  3. Activate the virtual environment

    source ~/.virtualenvs/composting/bin/activate
    
  4. Run the server

    pserve development --reload
    

    Load the app in your browser at http://192.168.33.15:6543/

    You can now make edits from your host (read OSX) and have them reflected when you refresh the browser.

wb-composting's People

Contributors

larryweya avatar geoffreymuchai avatar wmucheru avatar ukanga avatar royrutto avatar

Stargazers

Peter Lubell-Doughtie avatar

Watchers

Peter Lubell-Doughtie avatar Matt Berg avatar  avatar Kelvin Jayanoris avatar Simon Kiarie avatar Wambere avatar Morris Mukiri avatar James Cloos avatar Roy Rutto avatar Rodgers Andati avatar  avatar Carolyn Footitt avatar Emmanuel Tarus avatar Njagi Mwaniki avatar  avatar Tychus avatar  avatar Antonate Maritim avatar Brian Mwasi avatar  avatar Winnie Kiragu avatar Lincoln Simba avatar L≡ZRS avatar Isabel Shaw avatar Ephraim (Keyman) Muhia avatar kahammer avatar Doris Njihia avatar Bella avatar Rosalia Lorenzen avatar hngondoki avatar Kipchirchir Cheroigin avatar Kelvin Muchiri avatar  avatar  avatar Henry Wambugu avatar

wb-composting's Issues

Actionable items count should probably take into account the filter criteria

While viewing a monthly registry e.g. monthly density, we always show the number of un-approved items in the navigation regardless of period. The result is that when viewing by e.g. June but an un-approved record exists for May, the navigation shows a count of 1 while loading the page you don't see any records.

Perhaps the best fix would be to show data grouped by month, similar to how its done within the daily waste register.

Dont allow daily waste approval until a monthly density is available

Because the dialy waste's tonnage calculation depends on the monthly density, it was suggested that daily wastes should not be approvable unless the monthly density has been determined.

This adds a layer of complexity and might not make much sense, because, as long as the data in the daily waste is valid, it shouldn't matter what the monthly density is. If there is a problem with the monthly density, it should be fixed within the monthly density.

Give the user a hint on why a submission cannot be approved

There are 2 possible reasons why a daily waste submission cannot be verified:

  1. If the skip type is invalid, the solution is to edit the submission and fix the skip type
  2. If the monthly density cannot be calculated e.g. when we dont have the reuqired no. of monthly density records.

In both cases, we simply don't allow approval by not displaying the button. The user has no clue why the submission cannot be approved so we need a way of hinting why that is and allowing them to fix it.

The Submission.can_approve function was initially meant to figure out whether or not to show the button, I think we should separate the logic that determines if the button should be shown from whether the submission has issues that need to be fixed before it is approved.

Save or display times in EAT

Currently, the data collection time is in EAT while the _submission_time is in Eastern Time Zone (NY) so submission time is always earlier than record capture time

Show "No results" instead of blank tables

Taking the Monthly Solid Waste Composition register as an example, it shows a blank table when there are no records to show. Use a simple for ... else within the jinja template to do this.

Edit functionality

In cases where the data needs to be edited, once the data is submitted back into ona.io, the platform will update the record and then send the JSON to our dashboard. The dashboard currently has no way of distinguishing duplicates from new data. To allow updates, we will make use of the _id field within the JSON payload. If a record with a matching _id exists, update the JSON with the new data.

For better performance, add an _id field to to the submissions schema for lookups.

Maintain filter across POSTs

When you e.g. approve a record from a filtered view, the response returns to an un-filtered state, which is a bit unnerving.

Clear test data

Clear test data from the dashboard in readiness for launch

Dont allow daily waste approval if the referenced skip type is not valid

If the skip within a daily waste record is not a compressor, its volume is determined from the skip type. Since the skip types are created from the dashboard, a user might mistakenly enter an invalid skip type. If the skip type does not exist within the municipality, the records approval should not be allowed until the skip type is resolved, likely via editing the record.

Option to archive unused municipalities

Instead of completely deleting a municipality, which could be disastrous allow archiving so as not to clatter the municipalities list view.

Also add a filter to the archived ones can be filtered in.

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.