-
Notifications
You must be signed in to change notification settings - Fork 13
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
Handle reference document edits #135
Comments
Couple of questions/thoughts: I take it what we're moving away from the selectize-style approach used in the previous incarnation of the app — do we think that didn't work well? Wouldn't this be an easier way to select a referenced document without ever leaving the editor? Perhaps not great for media... By launching both the document list and document edit views in a "nested mode", won't that be confusing to users? Will we be able to maintain a smooth editing workflow without users losing track of where they are in the process? |
That's already part of the design for media, I'm just thinking we extend this to selection of sub documents to avoid effectively recreating the document list view (search, filtering, display) in a selectize style list. |
I see that as a UX challenge. We face this regardless, as this is how media is presented |
I'm happy with this and your URL structure makes perfect sense. We'll need some logic to detect a document ID versus a page number so we can distinguish between the Proposed for selection and Proposed for create/edit URLs, which we could potentially avoid by adding another keyword to the URL. I assume the reasoning to not do it this way is to prevent the URL from getting even longer. I'm happy either way. I've been thinking about how the stores would adapt to this, since at the moment we only store the state of the document currently being edited and now we'll need to keep the state of the parent when editing a nested document. I don't think we should rely on local storage for this, because we should see local storage as an enhancement and not the central source of truth (users may disable access to local storage altogether at browser-level). Instead, I propose we add a Editing a top-level document: {
local: {_id: 1234567, ...},
parents: [],
remote: {_id: 1234567, ...},
remoteStatus: Constants.STATUS_IDLE,
validationErrors: {}
} Editing a nested document: {
local: {_id: 7654321, ...},
parents: [{_id: 1234567, ...}],
remote: {_id: 7654321, ...},
remoteStatus: Constants.STATUS_IDLE,
validationErrors: {}
} This has the following advantages:
If we're happy with this approach, I'm more than happy to start implementing it. Thanks! |
Updated spec after call:
@eduardoboucas have I missed anything? |
No, I think it covers everything. |
Do we have any designs/ideas for how a referenced field that is not an image would look like? For example, if I'm referencing a collection of users from the articles collection, what would we display on the document edit view? Do we want to define some sort of "primary field" (e.g. user name) that would represent the document within the document edit view? On a side note, and I know we have discussed this before and I'm happy with the way we'll reuse the document list view for selecting nested documents, but if we're thinking of a simple use case where we're selecting the author of an article, a selectize-like approach would allow me to type the name of the person and click to select the author, which would take a couple of seconds and I wouldn't need to leave the editor. With the other approach, I need to:
Couldn't we have both options available, and let engineers decide how documents for a particular collection are selected? Maybe this is post-MVP, but I think it's worth having the discussion to make sure we get this right. |
(Pinging @abovebored as he may have some thoughts on this) |
Post-MVP we will look at other ways of displaying referenced docs but for now just focus on the document list view approach. I will create a separate ticket. |
Sure. That doesn't answer my question as to how the referenced document is displayed on the document edit view, though. |
Use the first field, as we do for list view navigation anchor. |
Thanks. |
The concept of a primary field has come up a lot, right? I think it has merit because it follows the age-old database paradigm of primary & foreign keys, but are more human readable for our interface. Is the plan for the media library referenced above still happening? The way that was envisioned is you can't edit a document, just select an existing then it would embed in the document like this. So I imagine for a text only referenced document there would be no thumbnail (but maybe we should link the text to the original document for editing?). Also, agree we should be thinking about how referencing content in general will evolve in general overtime. Some random examples I can think of:
Which I think broadly gives us a reference where the child content is visual and one where it is text based (and a situation of both as above). Also for each we need to know - is it a field (e.g., asset field) or is it within a field (e.g., an inline image). I can see a scenario where the selectize model is much preferred for speed (taxonomy in particular), but we should just start with one which can cover us for now, even if it's a one-size fits all solution for now. |
@abovebored yes the media Reference is going ahead as planned, with a few tweaks to storage. As per Redux:
The main issue we're trying to tackle is how to create and select other Referenced documents. For MVP we'll just replicate the media selection, taking the user to the list view for said collection. When creating a new document, the user will be taken to the document editor as if they were creating a new document directly, but on completion, will return to the parent document. I don't believe that we're going to want to present the user with a select box + search even post MVP as using the document list view for selection has no drawbacks. Please take this conversation to #164 |
@eduardoboucas can this be closed? |
@mingard We don't have the create reference document bit for MVP, which is part of the ticket. But happy to close it if you want to create a separate ticket for that. |
@eduardoboucas I'll leave it open for now |
Overview
When selecting, editing or removing a referenced document we need to present the user with:
Proposal for selection
As per the media interface selection interface, a user will be taken to the collection list view where they'll have similar functionality to the standard list view. Allowing them to select documents. The only action will be ability to add the selected referenced documents.
Proposal for creation
Creation would take you through to the edit view for the document in it's appropriate collection, except the save button will have two options: (Perhaps post MVP)
Create now - Create now and return to parent document
Create on Save - Created when parent document is saved
URL
Current:
{group?}/{collection}/document/edit/{_id}/{section}
Proposed for selection:
{group?}/{collection}/document/edit/{_id}/{section}/{field?}/{page?}
Proposed for create/edit:
{group?}/{collection}/document/edit/{_id}/{section}/{field?}/{_id}
Example selection:
/magazine/articles/document/edit/xxxxxxx/meta/publication
The text was updated successfully, but these errors were encountered: