-
Notifications
You must be signed in to change notification settings - Fork 80
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
Allow user to edit file information directly in the modal #1038
Allow user to edit file information directly in the modal #1038
Conversation
979f650
to
a303471
Compare
Things left to do to get this PR over the line:
|
a04a1ce
to
46b81c2
Compare
534a2ab
to
f2739ff
Compare
GGRGRGRGR!!!! This seems to have broken the UploadField!!! |
346eec0
to
8c0713c
Compare
Fixed the UploadField |
221c239
to
cd08e1f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Epic work.
Main thing for me was rename the new Breadcrumb container to something slightly different so that we don't have a confusing situation with two Breadcrumbs
.travis.yml
Outdated
@@ -59,7 +59,7 @@ before_script: | |||
# Install composer | |||
- composer validate | |||
- if [[ $DB == PGSQL ]]; then composer require --no-update silverstripe/postgresql:2.x-dev --prefer-dist; fi | |||
- composer require silverstripe/recipe-testing:^1 silverstripe/recipe-cms 4.x-dev --no-update --prefer-dist | |||
- composer require silverstripe/recipe-testing:^1 silverstripe/recipe-cms:4.x-dev silverstripe/frameworktest:dev-master --no-update --prefer-dist |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed on slack:
- including frameworktest as dev-dependency in composer WILL NOT require frameworktest unless it's the in the project root.
- means it won't do anything on your local if you're doing development from the vendor folder (as most of us are)
- in the case of asset-admin being the root project, which it will in travis, it is functionally the same, though it's clearer being in travis.yml because it shows the intent better
Seems like the bigger question though is why is frameworktest a requirement for behat tests in the first place? I've always seen frameworktest as a quick and dirty way to create lots of records for manual testing. We're including dev-master here because we don't bother versioning frameworktest
Rather then rely on frameworktest for behat fixture creation, seems like it would be much cleaner to create them the old fashioned way i.e. yml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a precedent for using frameworktests ... it gets installed by the CWP kitchen sink.
I can't just rely on creating fixtures with YML because I need an DataObject with an has_many
relationship to Image or File. Off the top of my head, I don't think we have a recipe that has that particular set up out of the box
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can probably guess what I'm going to say next :-)
Just create a TestOnly DataObject in asset-admin and use that. Much cleaner and safer than using frameworktest that has no versioning and could change at any point.
Also means you can run behat tests locally without having frameworktest installed (and which isn't specified any where but in .travis.yml that it's a requirement)
Fairly minor UX issue, happy for this to be created as a new issue resolved sometime later on post-merge. When I edit a page |
@maxime-rainville On the main branch, they are read-only in the details tab |
@emteknetnz I can't see the actual experience but from what I recall... as the image is already inserted, you are just updating it. If you were to remove it and re-insert it you get the "insert" button label again. |
That's correct for already inserted images. However you can still get this 'Update image' (or 'Update file' for pdfs) for "uninserted" Images/Files. It still functions correctly as it will insert the file, it's just it shows the wrong text |
I've got a fix for the two fields that should be readonly. @clarkepaul Would you have a problem if updated the modal so that the button always says "Insert" even if you are updating an image that has previously been inserted? The logic for this part is kind of clunky (which is why it's broken in the first place). I could probably make it work at the cost of adding an extra layer of clunkiness. If we're OK with the button always saying "Insert", I can actually remove some clunky code. |
Just had a Zoom catch up with Paul to discuss how to handle the Insert/Update button issue. The 3 options discussed were:
Paul says he's happy to live with the bug since it's not on the primary path most users will take and it's kind of minor anyway. |
@maxime-rainville has just walked me through the UX button label bug. I'm okay with leaving the bug as-is for now if we can raise it as a separate issue that would be good.
From my experience, cms users are more concerned about the presentation of a file initially, editing the file details is a secondary thought (although the main benefits of this issue). Returning without making any edits at all would be subset of people. For the remaining people, I think they would complete the intended action of inserting the file with the button label being "Update" without too many concerns. Obviously I'd prefer it fixed but I don't see this as a blocker to getting the issue across the line. |
Nice work everyone!! 🎉 |
Much discussion and back and forth on this one.
The button takes you to the file Details tab, so having a button with the same name made some sense here. Edit details was also considered but it tested fine without the word edit. This was the terminology which was already being used navigating between the Placement tab and Details tab. This one doesn't the best experience you could ever want but hopefully it's an improvement from what was there. |
Ah, thanks Paul, after reading your comments, I've realised this button appears in two different screens: 1. Above the Placement tab, when dealing with a WYSIWYG image:In this context, everything you said makes sense and changing it to just say "Edit" would be unclear. 2. Above a read-only Details tab, when dealing with an image in an UploadField:It is in this context where the Details button is currently confusing. As you are already viewing the Details tab. A primary use case of this button is when using the FocusPoint module. I presume there is a reason why the fields just aren't immediately editable in the latter view. So, perhaps the best solution is to change the button to say Edit Details so that it's action is clear in both contexts? |
This PR adds the ability to edit the detail of a file within the file insertion modal.
Other improvement
getFormSchema
out of AssetAdminParent issue