-
Notifications
You must be signed in to change notification settings - Fork 15
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
New resource url params #48
Comments
I really like this idea, on paper this would allow for pre-filling data in general, which could be really helpful. But I just want to play devil's advocate here and point this out - this could potential abuse. For example, something like association in URL, nefarious admins could change Another thing is, it's really tricky with association - the association experience isn't that great yet. I'm talking more in terms of how the UI/UX should look. I'm veering a bit off topic since this is more about association, but I think the context might be helpful as you're talking about associations specifically here. For example, a Then let's say Right now the idea is, there's a small data-table view that displays the The reason Backoffice don't know what routes are available has to do with the way Backoffice work - it sits right within your router, so there's no centralised place that we can do I am very much open to help with the association part, I'm at a bit of a loss so I would appreciate any help there. |
Whoa! The potential for abuse is something I had not even considered.
Do you mean something like /admin/classes/new? Is this something we can just add to the form field as an option that can be passed to has_many? This would work, but would not be as elegant as automatically rerouting to the correct page. Is it possible to provide the course_id inside the socket when we reroute from the course page to the create a new class page? That would remove the attack vector but allow us to pass values forward. By the way, is there a way to specify which fields to display on an association? |
But that's the issue, let's say You would expect to see a Routes are defined in your In your I have a hackish idea that implements a stub protocol for everything that This is a glaring mistake of my initial idea of letting users own their routes (explicitness), but if this is a big hindrance to association support I am willing to change it. Can you elaborate on what you mean by fields to display on an association? Is this the |
If we wanted to retain the flexibility, we would only need to require users to provide the corresponding page. Something like:
This would create a When the button is clicked, we could internally get the redirect path using:
This would have the additional benefit of giving control over whether or not creating an associated schema is allowed. If a
I'm not sure...I like the flexibility Backoffice provides in naming routes and choosing which schemas and fields to make visible. I believe this is a feature not a bug, I always feel in control of the library. The solution above might not be the correct way of going about things, but if I understand correctly, one of the core goals of Backoffice is expliciteness. I am not sure if |
Apologies for the late reply! That's actually a really elegant solution that I absolutely did not think of, that's awesome! I think we don't have to call it
That's a really big point that I wanted when I first started out the project, I'm really glad to hear that you feel the same way :)
Can you elaborate on what you mean here? Right now there's By the way, I gave a talk on Backoffice during Code BEAM V recently (part of the reason why I was too busy to reply), and I worked up a demo here - https://github.com/edisonywh/backoffice-demo that could probably help out in developing/showcasing some ideas. The video should be available in a couple of months but if you can't wait just DM/email me somewhere (Elixir Slack/Twitter) and I'll get you hooked up! |
I am referring to this:
Your idea, if I understand it correctly would have specified that for a resource that is associated with a resource named Class, clicking Add on the parent resource would open the path for I was suggesting that instead of enforcing a naming convention, we could let users supply the name of the module to be used for creating associations. |
Yeah I definitely agree with you there, I much prefer what you suggested - allow users to pass in target resource itself:
|
Do you think it would be useful to allow links to the new resource page to accept parameters that could allow loading of values into the changeset?
For example, lets say I was dealing with university courses and wanted to add a new class/unit to an existing course.
The ideal experience would be to go to the course I want to change and click on an
Add class
.This would load the url
/class/new?course_id=1
and open the create form with the course already provided.The text was updated successfully, but these errors were encountered: