Giter Club home page Giter Club logo

example-invoice's People

Contributors

dependabot[bot] avatar jzajpt avatar leonardoelias avatar peterp avatar thedavidprice avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

example-invoice's Issues

Authentication tracking issue

Project structure

  • Create packages workspace
  • Add @redwoodjs/auth package

Web side

  • Create a Provider with common Context for auth0 and Netlify Identity
  • Allow auth0 to be passed into Provider
  • Map auth0 methods to our own hooks, and exports
  • Create "User tools" in header that allows a user to signup, login, view log in state or log out
  • Make the RedwoodProvider an optional consumer of the AuthProvider so that it can pass the authToken along with the requests to the api side.

API side

  • Get an user object from the headers

Error when running yarn rw dev

After installing all the deps and running db up / db generate I'm getting this error:

/example-invoice/node_modules/.bin/rw dev
  ✔ Generating the Prisma client...
error Command "prisma2" not found.
error Command "dev-server" not found.
error Command "webpack-dev-server" not found.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
09:45:30 api | cd /Users/<user>/workspace/projects/testapps/example-invoice/api && yarn dev-server exited with code 1
09:45:30  db | cd /Users/<user>/workspace/projects/testapps/example-invoice/api && yarn prisma2 generate --watch exited with code 1
09:45:30 web | cd /Users/<user>/workspace/projects/testapps/example-invoice/web && yarn webpack-dev-server --config ../node_modules/@redwoodjs/core/config/webpack.development.js exited with code 1
09:45:30 api | cd /Users/<user>/workspace/projects/testapps/example-invoice/api && yarn dev-server restarted
09:45:30  db | cd /Users/<user>/workspace/projects/testapps/example-invoice/api && yarn prisma2 generate --watch restarted
09:45:30 web | cd /Users/<user>/workspace/projects/testapps/example-invoice/web && yarn webpack-dev-server --config ../node_modules/@redwoodjs/core/config/webpack.development.js restarted
undefined

I have everything setup, afaik

$ webpack-dev-server --version
webpack-dev-server 3.10.3
webpack 4.41.6
$ prisma2 --version
[email protected], binary version: 377df4fe30aa992f13f1ba152cf83d5770bdbc85

App fails to refresh/restart after "Save"

The most recent code is in master. I pulled in changes from pp-deploy-to-netlify, including file updates from the latest CRA and RWJS v0.2.5. And then created netlify-deploy-example with specific settings for deploy. Deploy is working, however, I disabled the "Save" button.

I could have sworn the "Save" functionality worked at once point in time. But now, if you make a change and Save, the app errors on refresh or restart. Here's the console message:

Uncaught TypeError: Cannot read property '0' of null
    at LineItems.js:36
    at Array.map (<anonymous>)
    at LineItems (LineItems.js:15)
    at renderWithHooks (react-dom.development.js:14825)
    at mountIndeterminateComponent (react-dom.development.js:17505)
    at beginWork (react-dom.development.js:18629)
    at HTMLUnknownElement.callCallback (react-dom.development.js:188)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:237)
    at invokeGuardedCallback (react-dom.development.js:292)
    at beginWork$1 (react-dom.development.js:23234)

Deploy blocked by local and product DB migrations out of sync

@peterp Would it be possible to drop the Production DB _migrations table so we can deploy the latest code in main? Here's the most recent deploy log and error output:

https://app.netlify.com/sites/redwood-example-invoice/deploys/5f84cbd921618a000779e858

2:36:53 PM: Migrate database up... [started]
2:36:53 PM: $ /opt/build/repo/node_modules/.bin/prisma migrate up --experimental --create-db --auto-approve
2:36:55 PM: Error: Local and remote migrations are not in lockstep. We have migration 20200730175800-migration locally and 20200227093425 remotely at the same position in the history.
2:36:55 PM: error Command failed with exit code 1.
2:36:55 PM: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
2:36:56 PM: Migrate database up... [failed]
2:36:56 PM: → Command failed with exit code 1: yarn prisma migrate up --experimental --create-db --auto-approve
2:36:56 PM: Command failed with exit code 1: yarn prisma migrate up --experimental --create-db --auto-approve

cc @dale-french

Error when db seed

After installing the dependencies and do "db up" the comment "db seed" returns the following error message:
Argument id: Got invalid value 1 on prisma.findOneInvoice. Provided Int, expected String.

Improve Login and Fix Logout redirects

continued from #43

cc @dale-french

Here's the current behavior actual / expected.

Use an existing account to log in:

  • Actual: redirected to /invoices after logging in
  • This is expected 👍

Create a new account, verify, and auto-login:

  • Actual: logged in automatically after clicking the email verification, close modal, no redirect
  • Expected: after closing the modal, should be redirected to /invoices

Logout

  • Actual: the user is logged out but not redirected
  • Expected: the user is redirected to /home after log out

"Save" is broken; currently removed from site

The Save button was creating DB and GraphQL error upon refresh and restart. (Sorry, didn't think to copy console messages here.) Most likely due to update in Prisma2 package in our v0.2.5

To Do

NOTE: currently this is deployed to Netlify as a live example. Once this is fixed, we don't want the SAVE functionality deployed ('cause people...). We should either:
a) create a separate deploy branch for Netlify with SAVE disabled, or
b) add instructions to README about how to enable

Seed.js not working properly

The Invoice service relies on "context.currentUser?.id" to create an Invoice, which doesn't work running "yarn rw db seed"

Seems tricky to establish user context within the seed.js file, so I was trying to seed a user first and providing that but couldn't get it to work.

Still learning the ins and outs of Prisma and Redwood and don't totally understand the input types it asks for while creating the Invoice while providing a User but it seems possible

Encountered error when seeding database for invoice example

Got the following error when attempting to seed the database. I checked the code and it seems that the context object is not defined or something like. I am very new react and JS in general but I am will participate in getting this resolved.

/Users/xxxx/project/JS/example-invoice/node_modules/.bin/rw db seed Seeding your database... [started] PrismaClientValidationError: Invalidprisma.invoice.create()` invocation in
/Users/aaliu/project/JS/example-invoice/api/prisma/seeds.js:36:38

{
data: {
invoiceNumber: '2020001',
date: '03/12/2020',
body: '{"title":"I N V O I C E","companyName":"Example Inc.","companyInfo":"example.com\[email protected]","recipient":"Michael Scott Paper Company Inc.\n1725 Slough Avenue\nScranton, Pennsylvania","information":[[{"value":"Invoice #"},{"value":"044"}],[{"value":"Date"},{"value":"7/25/2020"}]],"lineItems":[[{"value":"Description"},{"value":"Quantity"},{"value":"Price"}],[{"value":"Wheel of cheese"},{"value":1},{"value":500}],[{"value":"Jar of sausages"},{"value":2},{"value":2.99}],[{"value":"Tin of waffles"},{"value":2},{"value":3.01}]],"summary":[[{"value":"Subtotal"},null,"0.0"],[{"value":"Tax Rate"},{"value":0},"0.0"],[{"value":"Total"},{"value":"$"},"0.0"]],"notesA":"","notesB":"Invoice by billable.me"}',

  • user: {
  • create?: UserCreateWithoutInvoicesInput,
    
  • connect?: UserWhereUniqueInput
    
  • },
    ? createdAt?: DateTime,
    ? updatedAt?: DateTime
    }
    }

Argument user for data.user is missing.

`
Let me if you have questions.

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.