Code Monkey home page Code Monkey logo

kuali-research-workshop's Introduction

Kuali Research API Workshop

Setup

  • Install Node/NPM. 4.x or newer, 6.9.1 recommended.
    • Download Node
    • Alternatively on Mac/Linux use nvm curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.32.1/install.sh | bash
  • Get a copy of the workshop files
  • In the folder with the workshop files
    • npm install
    • npm start

Exercise 1 -- Institutional Proposals - Proposals.js

  • Fetch the list of proposals when the component mounts
    • using fetch load a list of proposals from /instprop/api/v1/institutional-proposals/ and set it into the local state as proposals
    • alternatively use the pre-built method this.fetchProposals
  • Fetch related data to replace the codes with the actual descriptions
    • using fetch grab the list of proposal types from /research-common/api/v1/proposal-types/ and using lodashes keyBy create a hash of the types by code and set the result into the local state as proposalTypes
  • Fetch other related data similar to above for other data being displayed
    • activity types from /research-common/api/v1/activity-types/ into state as activityTypes
    • proposal statuses from /instprop/api/v1/proposal-statuses/ into state as proposalStatues
    • units from /research-common/api/v1/units/ into state as units
  • Tie filtering into the proposal search so that when you click the filter button it only shows relevant results
    • do this by appending to the url ?key=value. The key is stored in this.state.filterBy and the value is in this.state.filter
  • You can find the final version in Proposals.final.js

Exercise 2 -- Awards - Award.js

  • Part 1: Fix the fetch command in the componentDidMount method so it successfully pulls in the award summaries.
    • The url should be /award/api/v1/awards/?summary
  • Part 2: Enable the BarGraph
    • Remove the false condition before the BarGraph
    • Populate the data attribute in the bar graph by using the included function generateAwardCountStatsBySponsor and passing in the awards that are in the local component state.
  • Part 3: Pull down all award amount infos
    • Perform a fetch, similar to the award summary one, but against /award/api/v1/award-amount-infos/ and store the result in the component state.
  • Part 4: Update the BarGraph to display dollar amounts.
  • Update the data attribute to instead use generateAwardDollarAmountBySponsor and pass in both the awards and the award amount infos from the state.

kuali-research-workshop's People

Contributors

blackcathacker avatar iambrandonn avatar jwillia avatar

Watchers

Travis Schneeberger avatar James Cloos avatar Eric Westfall avatar  avatar Jerry Neal avatar Gayathri Athreya avatar  avatar Peri Subrahmanya avatar

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.