Giter Site home page Giter Site logo

Comments (6)

brent-hoover avatar brent-hoover commented on September 12, 2024 1

Right, I think I covered that in point one, but it stands to be said again. This is webdev 101, validate on the client before validating on the server. If we are still getting server errors, this ticket is not complete.

from reaction-admin.

aaronjudd avatar aaronjudd commented on September 12, 2024

And open and focus on the first error input...

from reaction-admin.

brent-hoover avatar brent-hoover commented on September 12, 2024

So we've written about ten issues for this same problem now and can't seem to get this solved. So I think the requirements here are:

If a new product fail validation from Simple Schema it should:

  1. Stop the attempt to publish so that we don't get a server error
  2. Open the appropriate panel for the field that failed validation
  3. Highlight the field(s) that are/is failing validation
  4. Focus on the first failing field
  5. Show a validation error message e.g. "Title is Required"

Things it should not do

  1. Do a specific validation for a field in code. (e.g. if (!contains("label")) Validation should come from Simple Schema so that it's extensible.

from reaction-admin.

rymorgan avatar rymorgan commented on September 12, 2024

@zenweasel That UX feels right. Thanks for detailing that.

from reaction-admin.

spencern avatar spencern commented on September 12, 2024

I'd like to add that under no (normal) circumstance should saving a Product cause the server to throw an error because of invalid schema.

Exception while invoking method 'revisions/publish' Error: Product Title is required
    at getErrorObject (packages/aldeed_collection2-core.js:480:15)
    at [object Object].doValidate (packages/aldeed_collection2-core.js:462:13)
    at [object Object].Mongo.Collection.(anonymous function) (packages/aldeed_collection2-core.js:214:25)
    at [object Object].Mongo.Collection.(anonymous function) [as update] (packages/dispatch_run-as-user.js:325:19)
    at [object Object].revisionsPublish (imports/plugins/core/revisions/server/methods.js:119:32)
    at packages/check.js:128:16
    at [object Object].EVp.withValue (packages/meteor.js:1134:15)
    at Object.exports.Match._failIfArgumentsAreNotAllChecked (packages/check.js:127:41)
    at maybeAuditArgumentChecks (packages/ddp-server/livedata_server.js:1765:18)
    at packages/ddp-server/livedata_server.js:719:19
    at [object Object].EVp.withValue (packages/meteor.js:1134:15)
    at packages/ddp-server/livedata_server.js:717:46
    at [object Object].EVp.withValue (packages/meteor.js:1134:15)
    at packages/ddp-server/livedata_server.js:715:46
    at [object Object]._.extend.protocol_handlers.method (packages/ddp-server/livedata_server.js:689:23)
    at packages/ddp-server/livedata_server.js:559:43
Sanitized and reported to the client as: Product Title is required [400]

I'm still seeing this error when attempting to publish a product without a title. We should be validating on the client before sending to the server and not relying on the server to respond with an error before informing the user that the fields are invalid.

from reaction-admin.

aldeed avatar aldeed commented on September 12, 2024

Referenced UI is gone

from reaction-admin.

Related Issues (20)

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.