Coder Social home page Coder Social logo

kobotoolbox / kpi Goto Github PK

View Code? Open in Web Editor NEW
129.0 31.0 172.0 57.11 MB

kpi is the (frontend) server for KoboToolbox. It includes an API for users to access data and manage their forms, question library, sharing settings, create reports, and export data.

Home Page: https://www.kobotoolbox.org

License: GNU Affero General Public License v3.0

Python 51.30% CSS 0.10% HTML 0.78% JavaScript 14.19% CoffeeScript 5.70% Shell 0.13% Dockerfile 0.10% Handlebars 0.01% SCSS 6.23% TypeScript 21.46%

kpi's Issues

dropdowns and input fields show at bottom of page

When creating or editing a dropdown or input field in the question settings (e.g. hint, default, skip logic condition dropdowns, appearance field dropdown), the elements are displayed at the bottom of the page (lower left, behind sidebar), and the view scrolls to these areas at the bottom of the page.

image

separate asset list into 2

/#/forms view

  • show only forms

/#/blocks-and-questions view

  • Create and modify collections
  • remove sharing view from blocks-and-questions

Asset API fails unceremoniously when not logged in

https://kf2.kbtdev.org/assets/ayJAkW7Tc8kXksViqNbmhH/

Traceback:
File "/home/ubuntu/.virtualenvs/kf/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  111.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/ubuntu/.virtualenvs/kf/local/lib/python2.7/site-packages/django/views/decorators/csrf.py" in wrapped_view
  57.         return view_func(*args, **kwargs)
File "/home/ubuntu/.virtualenvs/kf/local/lib/python2.7/site-packages/rest_framework/viewsets.py" in view
  85.             return self.dispatch(request, *args, **kwargs)
File "/home/ubuntu/.virtualenvs/kf/local/lib/python2.7/site-packages/rest_framework/views.py" in dispatch
  454.         self.response = self.finalize_response(request, response, *args, **kwargs)
File "./kpi/views.py" in finalize_response
  451.         if request.accepted_renderer.format == 'xls':
File "/home/ubuntu/.virtualenvs/kf/local/lib/python2.7/site-packages/rest_framework/request.py" in __getattribute__
  497.                 six.reraise(info[0], info[1], info[2].tb_next)

Exception Type: AttributeError at /assets/ayJAkW7Tc8kXksViqNbmhH/
Exception Value: 'Request' object has no attribute 'accepted_renderer'

User should see confirmation/warning before deleting form

When deleting a form the user should always see a warning message - similar to deleting a question from the builder. Currently a form is just removed without confirmation, making accidental deletions of potentially complex forms possible.

Once we have a 'trash' folder available we might not need a confirmation, but until then we need it.

* default library queryset

the default qlib sidebar view should show a special queryset of assets since the space is very limited and it's no longer constrained to just the users own assets.

For now, i'm hard coding a "libraryDefaultSearch()" to "/assets/?tag=examples" but we'll want to adapt this in the future

Calculations break form builder

The formbuilder is currently not able to display calculate questions, and opening forms with calculations breaks the builder.

To reproduce import this form. Expected: Should show 4 questions, including the calculate formulas. Instead: Shows only 'this form is empty' plus two questions, without calculate formulas.

image

* change root URL default view

change it to a view that's consistent with the react views. we could potentially generate the html template from the react app (and commit it into the repository?)

Model-level permissions are not automatically assigned to existing users

DevStaging
In [2]: User.objects.get(pk=-1).get_all_permissions()
Out[2]: 
{u'kpi.add_asset',
 u'kpi.add_collection',
 u'kpi.change_asset',
 u'kpi.change_collection',
 u'kpi.delete_asset',
 u'kpi.delete_collection',
 u'kpi.share_asset',
 u'kpi.share_collection',
 u'kpi.view_asset',
 u'kpi.view_collection',
 u'odk_logger.add_note',
 u'odk_logger.add_xform',
 u'odk_logger.change_note',
 u'odk_logger.change_xform',
 u'odk_logger.delete_note',
 u'odk_logger.delete_xform',
 u'odk_logger.view_xform'}
In [2]: User.objects.get(pk=-1).get_all_permissions()
Out[2]: 
{u'logger.add_note',
 u'logger.add_xform',
 u'logger.change_note',
 u'logger.change_xform',
 u'logger.delete_note',
 u'logger.delete_xform',
 u'logger.move_xform',
 u'logger.report_xform',
 u'logger.transfer_xform',
 u'logger.view_note',
 u'logger.view_xform'}

* cloning feature

Done in a RESTful way in KPI.
Suggested-- POST to /assets/ with an attribute that's like "duplicate=a123uid"

in the process, verify that the user has permissions to view 'a123uid'

form search and filter placeholders should be removed

The search field and radio buttons are not working to filter forms. Also the radio button "shared with me" shows as "shared with k c" somehow.

We should just disable / hide this for release prep / demo if it's not yet working.

image

/users/ returns full user list

When querying /users/

Would be nice to use this provide a dropdown and/or autocomplete of available users to grant new sharing permissions with.

when users are ___ it should return ___

  • not logged in ... empty list
  • logged in ... no random users (so i can't use it to see who everyone who's created an account). but show all users who the user would want to share an asset with. How do we decide this? Maybe based on existing links with other users through permissions.

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.