Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add/edit with pre-filled information requires for a "report no errors"-bounce #1220

Closed
phorward opened this issue Jul 18, 2024 · 5 comments
Closed
Assignees
Labels
bug(fix) Something isn't working or address a specific issue or vulnerability Priority: High After critical issues are fixed, these should be dealt with before any further issues.

Comments

@phorward
Copy link
Member

This issue is a little bit hard to describe... in some cases, the admin calls a module's add or edit function within a context, which pre-fills some bones e.g. a RelationalBone with mybone.dest.key=somekey and should validate them.

Depending on the skeleton, this might already lead in a creation or edit of the entry on initial load.

For this, there should be a special bounce-flag, which does the same as bounce=true, but without error reporting. So the input is parsed into the skeleton and returned as far as possible, but there should be no error reporting, this is done when "Save" is being hit.

Proposal:

  1. bounce=true should do the same as now, parse data, report errors, but don't save.
  2. bounce=silent should do the same as bounce=true, but without returning errors.
@phorward phorward added bug(fix) Something isn't working or address a specific issue or vulnerability discussion These topics must be discussed before completion viur-meeting Issues to discuss in the next ViUR meeting labels Jul 18, 2024
@phorward phorward added this to the ViUR-core v3.7 milestone Jul 18, 2024
@phorward phorward removed the viur-meeting Issues to discuss in the next ViUR meeting label Jul 19, 2024
@phorward phorward added Priority: High After critical issues are fixed, these should be dealt with before any further issues. and removed discussion These topics must be discussed before completion labels Oct 7, 2024
@phorward phorward self-assigned this Oct 7, 2024
@phorward
Copy link
Member Author

Working test scenario:

skeletons/test.py

from viur.core import skeleton
from viur.core.bones import *


class TestSkel(skeleton.Skeleton):
    name = StringBone(
        descr="Name",
        required=True,
        defaultValue="Test",
    )

modules/test.py

from viur.core.prototypes import List


class Test(List):
    pass

Reproduction

Call the vi-admin in an empty tab using http://localhost:8080/vi/s/main.html#/db/test/add?name=Hello, an entry with name "Hello" is immediately created.

@phorward phorward added the viur-meeting Issues to discuss in the next ViUR meeting label Oct 24, 2024
@phorward
Copy link
Member Author

phorward commented Oct 24, 2024

@akelch let's talk about it again tomorrow in the ViUR meeting, because I think this bounce=silent or something is kind of crap, because bounce is a boolean and we actually wanted to get rid of it - if you look at it from the REST API perspective - rather than complicate it even more.

I have now also built a simple test case (see above) where you can see this immediately. I think that the admin tool should be changed here after all, namely to send bounce=true in the initial case and simply ignore the errors, if any occur. Because you would have to install the bounce=silent anyway, and whether you do it this way or without complicating the core would be almost the same in the end, wouldn't it?

@sveneberth
Copy link
Member

Will be solved in the admin

  • Filter out error of bones where client data was missing
  • Use bounce

@phorward
Copy link
Member Author

Replaced/move into viur-framework/vi-admin#49

@sveneberth
Copy link
Member

sveneberth commented Oct 29, 2024

Replaced/move into viur-framework/vi-admin#49

@phorward FYI, you can transfer issues to other repos

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug(fix) Something isn't working or address a specific issue or vulnerability Priority: High After critical issues are fixed, these should be dealt with before any further issues.
Projects
None yet
Development

No branches or pull requests

3 participants