Giter Site home page Giter Site logo

Comments (3)

uzquiano avatar uzquiano commented on July 16, 2024

Can you provide a specific example of where this is applicable?

A few thoughts -

  1. If we have a JSON structure which is inherently invalid (given a schema), then it's invalid regardless of whether the fields on it are readonly or not. That is to say, all fields should always be validated and the structure as a whole should be considered invalid regardless of the user interface or the user's ability to do anything about it.
  2. If a field is marked as readonly, then as you point out, the user cannot do anything about it. So perhaps what you're saying is that the user interface elements (the red box) should not appear since it is provoking the user to do something, when in fact, they can't do anything. Which is confusing... is that right?
  3. If we solve #2 by removing the red box, it wouldn't change the fact that the JSON is invalid. Thus, "saving a form" or taking action with it should still be prevented. However, without the red box or some kind of indication to to the end user as to why they cannot proceed, it could also be confusing.

In the latter case, I think the issue is really the app developers then because they've coded a form that the end user cannot work with. So perhaps we need to detect that and have the warning log to console (debug) that a developer could catch.

What do you think?

from alpaca.

uzquiano avatar uzquiano commented on July 16, 2024

I checked in a change that implements what was described. The user interface "red-box" stuff is restrained so the end user doesn't see it. However, the top object still reports that it is invalid (i.e. control.isValid(true) === false) since one of its child elements is invalid.

The fact that the child element is invalid and also readonly (meaning that the app developer has stranded the end user in an unfortunate and helpless position) is now logged to console at WARN level.

warn

Let me know if this implementation aligns with what you were thinking?

from alpaca.

uzquiano avatar uzquiano commented on July 16, 2024

Going to mark this as closed. Please indicate if there's something still amiss or if we should make other adjustments?

Thanks!

from alpaca.

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.