@bnjmnm walked me through the MR and his reasoning and it makes sense to me. Yes global window object is side-eyed sometimes, but I think with the ComponentInstanceForm being special and unique in that it can get updated via React or AJAX, it is a valid use case to use the window object since the conventional ReactContext did not completely fulfill our needs by itself. And it is also prefixed with an underscore which is common convention for internal usage and is used in other apps including React which he pointed out.
It did make me wonder if the transforms are static, why don't we store them client-side in a static object so the ComponentInstanceForm always has access to it instead of getting it from the backend?
But after reading redux-integrated-field-widgets.md
specifically 3.4.1 Defining your own transform , looks like at least one of the big reasons is for extensibility, so someone can define their own transforms in JS or PHP then the FE would have access to it since the server is the source of truth.
hooroomoo → made their first commit to this issue’s fork.
hooroomoo → made their first commit to this issue’s fork.
Expected API here :-)
And have it in a way where the frontend can just render the JSON directly without any re-ordering/manipulating based on @lauriii's guidelines in #25?
{
"id": "some-unique-id"
"label": "Image",
"source": <opaque JSON object>,
"items": [
{ "id": "some-unique-id", "label": "Changed", "source": <opaque JSON object> },
{ "id": "some-unique-id", "label": "Created", "source": <opaque JSON object> },
{ "id": "some-unique-id", "label": "File size", "source": <opaque JSON object> },
]
},
Removing needs design/needs product tag since we have a path forward now
Or does that happen already and this is to catch the case where the entity was deleted but the UI hasn't been refreshed yet (or if the user visits an out of date url with the id in the params?)?
Yes this, now if a user refreshes from being on an out of date URL, it will redirect to /canvas/template/node/{bundle}/{viewMode}
which will either re-route to the new suggestedEntityId
or if there is no more content, to the "No content available" screen.
@jessebaker based on #11, I can open a follow-up for that?
Also after adding the feedback Ben left, the Settings tab stays in the panel and only the form refreshes.
Crazy work (very complimentary), left a comment about debounce
Responded in https://www.drupal.org/project/canvas/issues/3547598#comment-16279558 📌 Refine API response with DynamicPropSource suggestions to provide better UX Active
We can do something like this where we utilize separators and labels to differentiate between a field pointing to a field on another entity
and a field of which only a subset is consumed (and this could also be a reference field!)
I mocked this up in Figma really quick using the example @wimleers gave in #11 (last code block):
So we could use a label in this case ("File") for fields for another entity and add a separator after it.
Added these issues relating to mapping props to field types to their own category, feel free to rename category or move them to a different one, just want to capture them in the META.
✨
Support linking image and video field to props in a `ContentTemplate`
Active
✨
Support linking User/author field to props in a `ContentTemplate`
Active
✨
Support linking field types marked SUPPORTED from #3512433 to props in a `ContentTemplate`
Active
chungus ✨ Allow linking a component prop of a template to a dynamic field Active is in! 🚨🔥
Added 2 FE follow-ups for that issue:
📌
Follow-up for #3541037: Contextual panel flickers when linking prop to field
Active
📌
Follow-up for #3541037: Improve how list of field suggestions is displayed in the UI for `ContentTemplates`
Active
Not sure if there is another MR that's supposed to happen here: 📌 Refine API response with DynamicPropSource suggestions to provide better UX Active that would be good to have before starting this MR
Updated IS to specify media vs file upload image
- Video (media)
- Image (media)
- Image (file upload)
#3 Ok, I'll try to see if it shows up after marking required.
@wim leers So in my blog content type, I have both a "Media: image" field and a "File upload: image" field.
Neither shows up in the list of suggestions for any of the components I have that have an image prop (code component with image prop, Card component SDC, Canvas test SDC for image gallery)
Images work:
Is this referring to "File upload: image" field?
+ 1 for addressing the flicker to avoid stale data in a follow-up so this can get in.
hooroomoo → made their first commit to this issue’s fork.
Added FE 📌 UI polish for `ContentTemplates` feature Active
Added FE merged 📌 Redirect to Content Template after creating first node of bundle Active and todo: 📌 Redirect 404 when the suggestedEntityId content has been deleted for a content template Active
Opened 📌 Redirect 404 when the suggestedEntityId content has been deleted for a content template Active i ran into while testing this
hooroomoo → made their first commit to this issue’s fork.
updated IS to link to correct MR comment (previous link wasn't pointing to the MR comment)
not currently working on this anymore so unassigning myself in case someone else wants to pick it up
Added small FE bug
🐛
ContentPreviewSelector for templates should not show when code editor is open
Active
Couldn't get to this today, un-assigning myself in case someone out of EST time wants to work on it
otherwise I'll pick it back up tomorrow