Git Product home page Git Product logo

order-splitter's People

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

order-splitter's Issues

Refactor Order API so it's not stateful

Seems like we were trying to mimic the Java builder pattern but only went half way and ended up with a stateful API that leaves a lot of room for bugs. If we actually implemented the builder pattern, we'd have a OrderBuilder type (where orderBuilder.build() returns the actual Order object). Instead that functionality is just baked into Order. So now Order has a lot of potential illegal states.

I don't think the Builder pattern is necessary or helpful in javascript. I think the Order constructor should just accept a JSON object with all the properties once and for all. You won't even need to call order.split() because that will be performed implicitly in the constructor.

Stateless FTW.

copy to clipboard adds an extra $

Actual

Dawn   $$13.07
Larry  $$13.07
Austin $$13.07

https://jonsmithers.github.io/order-splitter/?tax=1.86&fee=4.98&tip=5.39&Dawn=8.99&Larry=8.99&Austin=8.99

expected:

Dawn   $13.07
Larry  $13.07
Austin $13.07

https://jonsmithers.github.io/order-splitter/?tax=1.86&fee=4.98&tip=5.39&Dawn=8.99&Larry=8.99&Austin=8.99

Incorrect caching behavior

We are definitely doing something wrong with our caching. I just deployed a new version, reloaded the page, and now I'm out of sync with myself:

screen shot 2017-06-12 at 6 28 26 pm

Move totals row to the bottom

Some people seem to think that the totals should be on the bottom row and rightmost column, as opposed to the topmost row and leftmost column which is what we have currently. This is more like Excel.

Fair order splitter is not fair

Why are fees split evenly instead of prorated? If I buy a $2 side item, I shouldn't have to pay $4 for it. Instead, I will just not order it and everyone else will pay more.

Idea: bookmarklet

It's Garret's idea. We can provide a link for people to drag to their bookmark bar. That link is a script that extracts details from the orderup.com DOM and then opens the order splitter website with the details filled in. So they just click that bookmark when they make their order.

Fundamentally redesign parser

I think the input/parser design is fundamentally limiting. When the user copies the orderup receipt and pastes it into our textarea, it gets transformed from html into plaintext, so we lose lots of useful information. Consequently, we're make the user enter sales tax, processing fee, and delivery fee manually.

We can just let the user paste html instead of plain text by using the contenteditable attribute on on a <div>. Then we'd have the html to work with. (Also, we could re-use the same parser in a "live preview" in the chrome-extension.)

tl;dr The parser should be html-based, not text-based.

Introduce React Framework

Would be nice to have a UI framework to help with development and aesthetics. React seems cool.

There's a section in the docs entitled Adding React to an Existing Application.

The installation docs say that we can try out react without having to set up a whole build pipeline. Maybe, for starters, we shouldn't worry about getting JSX to work just yet.

Allow for Plugins

We could structure the code to allow for order parsers to be added more easily

Update browserify

The following syntax causes browserify to explode:

Object.entries({a:1,b:2}).forEach(([key, value]) => { });

We're using gulp-browserify which is no longer maintained and several years out of date. It seems to me this syntax bug is long gone in current versions.

Workarounds:

  • use function instead of =>
  • assign function to a variable first

Sleek look and feel

I think it would be preferable to using the drab user agent stylesheet.

#3 will help a lot with helping us create a sleek look and feel.

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.