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
Remove module list item when force deletion #32662
Conversation
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.
LGTM, after ESLint fix!
Just one question for .hide()
instead of .remove()
. 😄
@@ -423,6 +423,10 @@ export default class ModuleCard { | |||
mainElement.attr('data-installed', '0'); | |||
mainElement.attr('data-active', '0'); | |||
|
|||
if (forceDeletion === 'true' || forceDeletion === true && moduleTechName !== 'ps_distributionapiclient') { | |||
mainElement.hide(); |
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'm not blocking for this, but why not use .remove()
instead?
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 agree, remove is better
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 transition from hide to remove required a small additional tweak. You have to send the event before removing.
( this.eventEmitter.emit('Module Uninstalled', mainElement);
)
Now it is good 😄
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.
We should not be hardcoding a module name in the core, other distributions can have a different marketplace.
Also, we should check if this module is available from an API before removing it from the list, because it will reappear after refresh. 👍
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.
Hello @M0rgan01
It seems the issue still persist, see the attached screen record below:
Pr32662.webm
Waiting for your feedback.
Thanks!
0724667
95066d1
to
84868df
Compare
7e32597
to
9e4bf66
Compare
8430d50
to
b7ad705
Compare
@hibatallahAouadni It is important to be aware that the behavior for a development branch and the behavior for a live version are not the same. If you are on a live version, let's say you use 8.0.4If you uninstall the module pagenotfound and you choose to delete the files from the disk then the module is not available anymore in your If you are on a live version, let's say you use
|
@Hlavtox I propose a new version of my PR :) |
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.
LGTM, I'm not the best at js / ts would be great if others could have a look.
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.
Hello @M0rgan01
Thanks for your PR,the module display issue is solved.LGTM ✔️
See attached screenvideo:
Module.manager.testAniss.mp4
Thanks!
QA approved, well done! Message to the maintainers: do not forget to milestone it before the merge. |
thank you @M0rgan01 |
We do not remove the module from the list if it has a download url, to be able to re-download it if necessary
I also modified the behavior of the dropdowns for the buttons after uninstallation, in fact it was possible to delete a module that was already deleted
Attention, for the modifications to work correctly, the url of the distribution API must be modified for the purposes of the tests. Indeed the recovery of the list of modules for 8.1.x is not yet possible. See https://api.prestashop-project.org/prestashop for versions and modify the PrestaShop/modules/ps_distributionapiclient/src/DistributionApi.php file