-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Provide pathId param on browser.js #28219
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
Provide pathId param on browser.js #28219
Conversation
Hi @Nazar65. Thank you for your contribution
❗ Automated tests can be triggered only manually with an appropriate comment:
ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review. For more details, please, review the Magento Contributor Guide documentation. |
@magento run all tests |
@magento run all tests |
@magento run all tests |
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.
Hi @Nazar65 thanks for your pull request, it looks good! Please follow below some comments. Thanks!
app/code/Magento/Cms/Model/Wysiwyg/Gallery/DefaultConfigProvider.php
Outdated
Show resolved
Hide resolved
app/code/Magento/Cms/Test/Mftf/Test/AdminVerifyDefaultCurrentTreePathTest.xml
Outdated
Show resolved
Hide resolved
app/code/Magento/Cms/Test/Mftf/Test/AdminVerifyDefaultCurrentTreePathTest.xml
Outdated
Show resolved
Hide resolved
app/code/Magento/Cms/Test/Mftf/Test/AdminVerifyDefaultCurrentTreePathTest.xml
Outdated
Show resolved
Hide resolved
app/code/Magento/Cms/Test/Mftf/Test/AdminVerifyDefaultCurrentTreePathTest.xml
Outdated
Show resolved
Hide resolved
app/code/Magento/Ui/view/base/web/js/form/element/image-uploader.js
Outdated
Show resolved
Hide resolved
app/code/Magento/Cms/Test/Mftf/Section/TinyMCESection/MediaGallerySection.xml
Outdated
Show resolved
Hide resolved
app/code/Magento/Cms/Test/Mftf/Test/AdminVerifyDefaultCurrentTreePathTest.xml
Outdated
Show resolved
Hide resolved
app/code/Magento/Cms/Test/Mftf/Test/AdminVerifyDefaultCurrentTreePathTest.xml
Outdated
Show resolved
Hide resolved
@magento run all tests |
1 similar comment
@magento run all tests |
@magento run all tests |
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.
Hi @Nazar65, thanks for your changes! Please follow some small comments below.
}; | ||
|
||
$(window).on('reload.MediaGallery', function () { | ||
encodedPath = Base64.decode(window.MediabrowserUtility.pathId.replace(/--|,,/, '==')).split('/'); |
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.
I believe this variable name should be decodedPath since it is decoding the pathId, correct?
tree.jstree('deselect_all'); | ||
|
||
if (encodedPath.length > 1) { | ||
path = _parseCurrentPath(encodedPath); |
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.
The _parseCurrentPath doesn't accept any parameter, I believe we can remove the encodedPath from here.
if (isLastElement) { | ||
paths[i] = window.MediabrowserUtility.pathId.replace(',,', '--'); | ||
} else { | ||
paths[i] = Base64.encode(val).replace('==', '--'); |
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.
I think the replace here isn't correct and may cause other problems, please follow below the way PHP is handling the encode, I believe we have to perform the same behavior on JS.
file: app/code/Magento/Cms/Helper/Wysiwyg/Images.php
method: idEncode
line: 304
return strtr(base64_encode($string), '+/=', ':_-');
@magento run all tests |
@magento run all tests |
@magento run all tests |
@magento run WebAPI Tests |
Hi @gabrieldagama, thank you for the review.
|
✔️ QA Passed Testing Scenario
Steps:
|
Added test steps to already existing scenario on cucumber studio https://studio.cucumber.io/projects/131313/test-plan/folders/1054245/scenarios/4523889 |
Hi @Nazar65, thank you for your contribution! |
Description (*)
Fixed Issues (if relevant)
Manual testing scenarios (*)
Expected result (*)
Questions or comments
Contribution checklist (*)