Comments (6)
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.
And open and focus on the first error input...
from reaction-admin.
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:
- Stop the attempt to publish so that we don't get a server error
- Open the appropriate panel for the field that failed validation
- Highlight the field(s) that are/is failing validation
- Focus on the first failing field
- Show a validation error message e.g. "Title is Required"
Things it should not do
- 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.
@zenweasel That UX feels right. Thanks for detailing that.
from reaction-admin.
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.
Referenced UI is gone
from reaction-admin.
Related Issues (20)
- Include in Sitemap? Checkbox Not Functional
- When we create a product variant compareAtPrice is mandatory
- Email panel causes Admin instances to crash HOT 7
- Invited shop manager does not have acces to shop HOT 1
- Discount minimum order amount condition is forced to 0
- Order detail page link is broken
- Product can be published and displayed on storefront with only a variant attribute HOT 2
- Add pre-commit hooks for linting commit message
- "Print invoice" link isn't working
- Navigation page doesn't render the navigation tree anymore HOT 14
- Enable docker push only for trunk
- Enable semantic-release of reaction-admin HOT 1
- Product metadata breaking admin panel HOT 1
- `roleCheck` and `hasPermissions` can break the "new product" flow HOT 1
- initApollo.js: WebSocket is closed before the connection is established. HOT 1
- Navigation page errors out HOT 1
- Upgrade to Meteor 2.5 HOT 2
- Storefront navigation using tags gives 404 error HOT 2
- Order has status "new" and primary shop owner can nothing to do with it HOT 2
- Replica set check requires "clusterManager" database role
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from reaction-admin.