- Issue created by @penyaskito
- πΊπΈUnited States mglaman WI, USA
Should this be postponed on π Allow XB to be used on all node types Active
- πͺπΈSpain penyaskito Seville π, Spain πͺπΈ, UTC+2 πͺπΊ
I think we should still do this for page + node--article, even if π Allow XB to be used on all node types Active would definitely need to refactor this.
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
This is a because without this, the following will always be visible:
Secondarily, this hard-blocked π Add generic create entity support Active .
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Adjusted the proposal.
Note that this can assume a single XB field per content entity type+bundle, if that changes in π Spike: explore merits of one XB field per exposed slot in content templates Active , it'll be up to that issue to tweak the logic introduced here.
- Merge request !1178#3529895 Added contentEntityCreateOperations to drupalSettings.xb.permissions β (Merged) created by penyaskito
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
- πͺπΈSpain penyaskito Seville π, Spain πͺπΈ, UTC+2 πͺπΊ
Back to Wim per !1178.
I'm 50% on each option, so your call. The client UI will probably need to check the absence of the key anyway. - π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
I wanted to merge this, but on a final pass I'm afraid that the proposal was too incomplete after my adjustment in #6. π
Nope, that's because XB controls the "create entity" route:
experience_builder.api.content.create
β which is why simple booleans suffice, and the XB UI can then call itscontentApi.createContent
.Attaching the patch that I had written locally, but which fails on the way it tries to pass the label via
XbResourceLink
's target attributes, because it's a translatable string, not a plain string. -
wim leers β
committed 3bbebc8f on 0.x authored by
penyaskito β
Issue #3529895 by penyaskito, wim leers: Provide the client with `create...
-
wim leers β
committed 3bbebc8f on 0.x authored by
penyaskito β
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Merged :)
This unblocked π Add generic create entity support Active , and increased the need for π Add access handler cache metadata to ExperienceBuilderController Active .
- π¬π§United Kingdom jessebaker
I'm slightly too late to the party but I've just merged in upstream changes over at β¨ Create React Permission Utilities Active and the shape of the permissions object is now more complex as a result of this and as a result is going to make the FE code more complex to work around it.
Previously xb.permissions was a simple
interface permissions { [key: string]: boolean; }
This made it easy for the FE to quickly assert if a user had or did not have a given permission by simply checking that list of booleans.
Can this new
contentEntityCreateOperations
object be moved into the root ofdrupalSettings.xb
instead of inside thepermissions
object? - π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
#15: or β¦ what about going from this which was merged:
"permissions": { β¦ "contentTemplates": false, "contentEntityCreateOperations":{ "xb_page":{"xb_page":"Page"}, "node":{"article":"Amazing article"} } }
to
"permissions": { β¦ "contentTemplates": false, "create:xb_page": 'Page", "create:node:article": "Amazing article", }
?
(Casting that string to a boolean is trivial.)
- π¬π§United Kingdom jessebaker
The format of contentEntityCreateOperations which was merged is useful - it's easy to iterate over to build the list of "New x" buttons in the UI. Your proposal in #16 means, to build the list of "New x" buttons, I would have to iterate over the permissions object, filter to just keys that starts with 'create:' and then split the key by : to get the entity type and bundle info.
Maybe there is some value to having the permissions listed in the permissions object as you propose, but I think only if that was in addition to still having the info in the original format elsewhere e.g.
drupalSettings.xb.contentEntityCreateOperations
"contentEntityCreateOperations":{ "xb_page":{"xb_page":"Page"}, "node":{"article":"Amazing article"} }
- Merge request !1185#3529895: Move contentEntityCreateOperations out of xb.permissions β (Merged) created by penyaskito
- πͺπΈSpain penyaskito Seville π, Spain πͺπΈ, UTC+2 πͺπΊ
Follow-up MR moving the contentEntityCreateOperations outside of xb.permissions
-
wim leers β
committed 0313cc0e on 0.x authored by
penyaskito β
Issue #3529895 by penyaskito, wim leers, jessebaker: Follow-up: move the...
-
wim leers β
committed 0313cc0e on 0.x authored by
penyaskito β
Automatically closed - issue fixed for 2 weeks with no activity.