npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

approval-analytics-frontend

v1.0.0

Published

Short and long processing forms for Forward Financing's underwriting application

Downloads

2

Readme

Codeship Status for ForwardFinancing/approval-analytics-frontend Maintainability Test Coverage

approval-analytics-frontend

This is the front-end for the Underwriting Application's processing forms. Forward Financing's processing team in the Dominican Republic uses these forms to input applications that we receive from our partners.

What's new

Fetch Error Handling

A fetch promise does not reject on HTTP error statuses.

New logic:

Additions:

  • New status constants (FAILURE, SUCCESS, CREATING)
  • catch statement with all fetch
  • New error reducer, filter all FAILURE responses
  • New error object available in store
  • Component Library StatusBar renders when error is present

| FETCH | FETCH | FETCH | |:------------------------------------------------:|:---------------------------------------:|-----------------------------------------| | PROMISE (RECEIVE) | PROMISE (RECEIVE) | NETWORK ERROR (RECEIVE) | | SERVER SUCCESS | SERVER ERROR | CATCH ERROR | | REDUCER FILTERS ON SUCCESS | THROW ERROR | ERROR REDUCER FILTERS ON FAILURE STATUS | | COMPONENT RENDERS | CATCH ERROR | COMPONENT + ERROR STATUS BAR RENDER | | _ | ERROR REDUCER FILTERS ON FAILURE STATUS | | | _ | COMPONENT + ERROR STATUS BAR RENDER | |

Dependencies

  • Node 8.4.0

To manage the above, we need to use a package manager such as asdf

To get started with asdf, perform the following commands:

git clone https://github.com/asdf-vm/asdf.git ~/.asdf

# for bash users
echo '. $HOME/.asdf/asdf.sh' >> ~/.bash_profile
echo '. $HOME/.asdf/completions/asdf.bash' >> ~/.bash_profile
source ~/.bash_profile

# for zsh users
echo '. $HOME/.asdf/asdf.sh' >> ~/.zshrc
echo '. $HOME/.asdf/completions/asdf.bash' >> ~/.zshrc
source ~/.zshrc

asdf plugin-add nodejs

asdf install nodejs 8.4.0
asdf local nodejs 8.4.0
  • run npm install

Running the application

Run the app locally with npm start. The app will run on localhost:3002/short_form

Prerequisites: Be sure to have an underwriting user in both local auth and underwriting databases that have a matching api_key.

Locally, check your environment variables to find a PROCESSING user. env | grep PROCESSING

Run:

cd /path/to/auth && iex -S mix

Auth.Repo.get_by(Auth.User, email: "[email protected]")

Copy api_key field

  • note that you will have to add the below tag to the head in the public/index.html file, to ensure you can authenticate locally
  • ensure that you are changing the public/index.html file
<script type="text/javascript">
  window._t = "paste_api_key_field" ;
</script>

Run:

Use foreman start to ensure sidekiq starts

Use foreman start to ensure sidekiq starts

  • funding

  • auth

  • banking Navigate to localhost:3002/short_form Check the partner dropdown is populated

In order to automate filling the short form, clone chrome extension delorean. Follow readme to install.

Notable Dependencies

This application is built using React 16 with Redux.

  • To get more insight into the application install and enable redux-dev tools
  • see configureStore.js to do this after you have installed the browser extension Styling is handled by the Bulma framework.

Testing

Unit Testing

The test suite for this app uses a combination of Facebook's Jest framework and AirBnB's Enzyme testing utilities.

Run the test suite with npm test.

Review line-by-line coverage in the LCOV report locally:

open ./coverage/lcov-report/index.html

Local QA

Repeatedly filling out the form on the first page of the app can be a PITA.

To speed up testing, Zach made a debugging branch, which hardcodes some valid form values into state.

You can add that to you branch by merging it in and then rebasing it out later: zc-debuggering

Deployment

This project is integrated into our Heroku continuous deployment pipeline.

To Production

Once your feature is successfully verified by the QA team, simply merge your feature branch into develop and merge develop into master.

To Staging

Upon opening up a Pull Request for your feature branch, a review app will be generated!

Open up Heroku and find out the name of your review app in our approval-analytics-frontend pipeline.

You can then access that review app by appending it to the underwriting short_form staging URL as a ?spa= param. For example if your review app name is ff-approval-analytics-s-pr-1234 , navigate to https://secure.staging.forwardfinancing.com/short_form?spa=ff-approval-analytics-s-pr-1234 to see your changes in action.