Closed feejin closed 4 years ago
That's kind of related to https://github.com/silverstripe/silverstripe-asset-admin/issues/756 and https://github.com/silverstripe/silverstripe-asset-admin/issues/785.
@chillu @clarkepaul Might be worthwhile having an epic for the insert media modal of the WYSIWY/UploadField.
The original concept was to have the details editable, but with a confirmation to ensure people know they are edit globally (eg information possibly used in other placements).
@clarkepaul That would make sense, the global edit warning would be good as it's caught people (me) out in the past in SS3.
Hi, this issue is significantly affecting our product. Wondering if there is any plan to solve this issue. Or is there any way to extend SilverStripe CMS to achieve this?
Hey just to add a few ideas from my original issue, here is a few things i'd like to be considered:
:-) well anyway I think there is room for improvement there!
Thanks @lekoala for the detailed description, this will require some UI changes and it is on our radar to make the improvements. This one is best going through the UX team to review to look at the different options. Totally agree that editing should be possible when uploading a file directly. When it comes to files used in multiple locations we will advise on a solution.
Click the link Editing files: https://projects.invisionapp.com/dsm/silver-stripe/silver-stripe/folder/components/5c68f96ffb26bb0018525d29
The feedback link above isn't working for me. Is there any timeline for folding this into a release, or perhaps a temporary work-around? I've finally begun upgrading projects to SS4 and I agree that this is a major workflow issue for a lot of clients.
I've updated the link @bscarola. Looks like its basically turning the readonly fields into standard editable fields. When editing an existing file, I've flagged that there should probably be some sort of messaging to let a user know they might be editing a file which is used in several locations—for uploading that message wouldn't be required.
hey @clarkepaul is it me or this only covers tinymce/filemanager usage? What about regular upload fields directly visible through getCMSFields?
This should cover both ideally, I'd leave separating it into two issues to whoever picks it up. Thanks for mentioning it @lekoala
Just a quick note to say that I think this should be very high priority. Editing an image title (or focus point) at the moment is a very awkward experience - especially for clients coming from SilverStripe 3 who could do this with one click from the uploadField before (and understood this to be an upgrade to their previous version).
Just had a chat with @newleeland to talk over his design. The design introduces a somewhat different state in the insert modal to edit the detail of the image. This will probably require a bit more work than if we had just made the current read-only form editable, but it should provide a much nicer experience for the user.
This change will reuse functionality and UI elements uses elsewhere. Changes to the back end logic should be trivial ... juts minor tweaks to FileFormFactory
. Most of the work will probably be in React.
Some things to keep in mind when implementing/testing this:
I'd like to see how much more effort this would be as I think it would be really useful functionality.
The other actions (archiving, unpublishing, replacing the file) will not be available.
I don't think it would be technically difficult. It might add more edge case for us to consider.
The thing I'm not sure is if the user will be in a good head space to make those decision. e.g.: You decide to edit the "about us" page, you decide to replace a file without realising it's use on a bunch of other pages.
That's the same issue when in the files area, at least they have the "used on" tab. The way I see it is that as soon as you go away from the "Placement" view you've changed the mindset of what you are doing.
I see this as urgent, so I'd push for the fastest/simplest solution to be rolled into the next minor update - if that's simply changing the the current read-only form to be editable I think that should happen. Even better if there's a warning message about affecting all versions of the image.
https://invis.io/WCMZMHHXRJV#/381953634_Files_Tiny_Insert_Files_new_File_start https://invis.io/WCMZMHHXRJV#/381953633_Files_Tiny_Insert_Files_existing_File_start
Comments on any edge cases are welcomed
Looking at the new designs... is the intention to remove all of the read-only tabs except from the 'Placement' tab, until the user edits the image?
I would have thought this information would still make sense for users without access to edit files to see?
We removed the tabs from the place view so there is no confusion with all of the actions... we can't have Insert mixed with Save/Publish but you do have a good point. We can't keep the preview tab when going to the edit view so there would be some inconsistency with what tabs are showing (unless we put placement into read-only).
How about if the action at the top was "File details" (or "Details" for short) implying it is for both viewing and editing?
We could leave the read-only file details in the placement view but it is only a click away, we thought the separation of placement and file details was the best thing to do here. In saying that there might be a better UI for navigating between views than we have here.
@clarkepaul I see this issue is still only about usage of files inside TinyMCE. Was there another issue created to track usage in file uploads? It might be just me (but I don't think so!) but for me, it's also a matter to easily edit files attached through UploadFields. In SS3, it was really easy to do so, and more specifically adding new fields for an image ("credits" fields for instance). For instance, how would a "image cropper" module be implemented with the current designs? I wish there would be a way to have files simply scoped within the page or dataobject they belong with. Shared assets is really not my common use case : most of the time, my files only make sense in the context of a specific page or dataobject.
@lekoala Yup this caters to both TinyMCE and Uploadfield for editing, but placement details only apply to TinyMCE placement, we are considering how to attach ALT text field to UploadField items but not included in this work. Here are some of the issues for the file usage tab information https://github.com/silverstripe/silverstripe-asset-admin/issues/943 https://github.com/silverstripe/silverstripe-asset-admin/pull/998 https://github.com/dnadesign/silverstripe-elemental/pull/734
These proposed designs will allow images to be edited from the context of the page. This issue doesn't go into how to add additional fields but I don't see this as being a problem UX wise.
I tried restoring the edit feature when edit mode is "TYPE_SELECT", which restored the editability, but causes javascript errors when trying to save.
It's because ACTION_TYPES.UPLOADFIELD_ADD_FILE is triggered when saving. UploadField treats any action as "insert", not only the actual "insert" action.
This is what I would like to get working.
This is the error I get when trying to save.
@unclecheese do you have any insights? Is there a "quick fix" to allow edit mode to work (when manually turned on)?
Looking at the new designs... is the intention to remove all of the read-only tabs except from the 'Placement' tab, until the user edits the image?
I would have thought this information would still make sense for users without access to edit files to see?
We've rename the button to "File details" to accommodate this secondary flow of viewing and editing file details.
I've tracked the issue to InsertMediaModal.js (used by uploadfield).
/**
* Handles the insert form submission, does not continue the regular form submission within the
* asset admin section.
*
* @param {object} data
* @param {string} action
* @param {function} submitFn
* @param {object} file
*/
handleSubmit(data, action, submitFn, file) {
if (action === 'action_createfolder') {
return submitFn();
}
return this.props.onInsert(data, file);
}
Basically, any action other than "createFolder" is being treated as an insert.
git diff to enable editable files during insert:
diff --git a/code/Forms/FileFormFactory.php b/code/Forms/FileFormFactory.php
index 2e4f884..d113b5c 100644
--- a/code/Forms/FileFormFactory.php
+++ b/code/Forms/FileFormFactory.php
@@ -66,7 +66,7 @@ class FileFormFactory extends AssetFormFactory
$tabs->unshift($this->getFormFieldLinkOptionsTab($record, $context));
break;
case static::TYPE_SELECT:
- $tabs->setReadonly(true);
+ //$tabs->setReadonly(true);
break;
}
@@ -281,6 +281,8 @@ class FileFormFactory extends AssetFormFactory
$actionItems = [];
if ($type === static::TYPE_INSERT_MEDIA || $type === static::TYPE_SELECT) {
$actionItems = array_filter([
+ $this->getSaveAction($record),
+ $this->getPublishAction($record),
$this->getInsertAction($record),
]);
} elseif ($type === static::TYPE_INSERT_LINK) {
This fixes it. :)
handleSubmit(data, action, submitFn, file) {
if (action === 'action_insert') {
return this.props.onInsert(data, file);
}
// Standard form actions (e.g. publish)
return submitFn();
}
Bugfix to the specific JS error at https://github.com/silverstripe/silverstripe-asset-admin/pull/1005
Note: This does not address the major issue, which is the negative user experience out of the box. :)
By the way, I got the above working in my client project, and the client is very happy with the result.
In the upload field, you just need to click the "eye" icon beside any uploaded file, and you can immediately edit the file (as per the above screenshot).
You get all 3 menu actions (save, publish, insert) beside each file.
@tractorcow we choose not to do that for the Editor insert as the positioning is not part of the versioning for the file, but probably all good for the Upload Field. Do you know if there's any information for a file which is likely is added to an Upload Field which wouldn't be versioned? (e.g. do developers add positioning, additional fields like ALT text).
I'm thinking for a file to have an ALT text field included in the versioning so it can be used in the Upload Field instance. Do you have some other edge cases for Upload Fields which you might have seen before?
@tractorcow we choose not to do that for the Editor insert as the positioning is not part of the versioning for the file, but probably all good for the Upload Field though. Do you know if there any information for a file which is likely is added to an Upload Field which wouldn't be versioned? (e.g. do developers add positioning, additional fields like ALT text).
I would probably version everything regardless.
My use case is only for uploadfield assignment, I agree with you regarding the html editor media dialog. :) In the case of uploadfield though, the data for that record can only be stored on the file (unless we are somehow adding metadata to the uploadfield assignment; Possible future enhancement).
How I'm thinking of approaching this:
FileFormFactory
so it doesn't return all the fields for the Insert Media and Insert Link form and returns a "Edit original" form action insteadEdit details
button componentJust a quick update on where I'm at:
Next steps:
I think the UploadField issue is a much simpler approach, leaving everything behaving exactly as-is but allowing editing from the Uploadfield without the 'Edit Original File' button (And perhaps with a sentence explaining that this will edit the file anywhere it is currently used).
Should the Uploadfield have a separate issue? The original post here says "This improvement is for the WYSIWYG modal only, and the uploadfield modal should be handled in a separate issue." but a couple of issues that have been opened about it have been closed as duplicates of this?
@neilcreagh I'm half way through fixing this. From looking at the WYSIWYG modal, I don't think it's going to be terribly difficult to get the Upload field working. I'll add stretch goal to "Implement this feature in the Upload Field Modal or raise a seperate issue for it".
Once I'm done, I'll be in a better position to know how difficult it's going to be.
@silverstripeux I got this in something resembling a usable state.
Here's a few notes:
Right now, when you do an action in Asset-Admin or in the asset modal that will cause you to loose some changes, you don't get any warning. That's what in modal editing is doing right now. Maybe it's a bigger card, that need to be address somewhere else. Maybe we can address part of the issue here first.
If I start editing the placement information and then I edit the file details, what should happen?
We'll have the same problem with the edit detail form.
The way I've approach this, we could in theory get a form that opens another form, that opens another form, etc.
For example, we could use this to display "Add to campaign" form in the asset-admin panel instead of using a separate modal. Or we could display delete/unpublish confirmation message for the file you are currently editing there.
Thanks @maxime-rainville I'll have a look and get back to you this week.
@sachajudd Already gave me some feedback and I made a fair bit of progress since I wrote that message. Maybe hold off looking into it until tomorrow. I'll try to get my updates into a presentable state and you can review the greatest and latest.
@maxime-rainville any update on dealing with UploadFields and allowing editing files from there easily in a customisable fashion?
@maxime-rainville any updates?
Hey @lekoala , @martinviolet88 you could check the related pull requests (in the original description) for some more detail on the progress of the issue. Currently the focus is still being spent on the WYSIWYG modal, before the UploadField modal is looked at.
There's a few related PRs, but if you would like to check these out and provide any feedback/ test notes, that would be much appreciated!
Ran it all of the combined PR's through travis cwp-recipe-kitchen-sink - there was a single regression
https://travis-ci.org/github/creative-commoners/cwp-recipe-kitchen-sink/builds/676011738
Note: ignore the failure in 'recipe_content_blocks' that's an existing failure
Note: this is a kinda special travis build, you can't restart the build to get the latest changes, you need to run composer update on your local and recommit the composer.lock file
Everything is done. There's a related PR against the focuspoint module. I've let the module maintainer that it's coming.
FYI The related focus point PR has been merged. https://github.com/jonom/silverstripe-focuspoint/pull/78
When viewing image info the details (Title, Filename etc) appear to be form fields but are not editable, they can only be edited by clicking Edit Original File which opens in a new tab.
It's more noticeable with the FocusPoint module when you want to just make a quick change as soon as you upload the image. Makes for quite a jarring user experience and I have to explain this to non-technical clients.
tl;dr make asset details editable without having to go via Edit Original File.
User story
As a CMS user, I want to be able to stay in the current modal when editing a file, so that I can make quick updates to the file without loosing context of the area related to the file.
Acceptance Criteria
[x] 'Editing' a file keeps the user in the same modal
[x] There is a button that initiates the file in a new editable state.
[x] When editing the file, you can save/publish.
[x] When editing the file, the other actions are also available (archiving, unpublishing, replacing the file).
[ ] A prompt will warn the user that edits will be applied globally.
[x] There is a clear flow of inserting the image after editing.
[x] Editing a file in the modal might change its draft/live state. When you're done editing these changes should be reflected in the rest of the modal.
[ ] This improvement is for the WYSIWYG modal only, and the uploadfield modal should be handled in a separate issue.
Stretch Goal
Suggested designs
Pull Requests