Skip to content
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

Big trash refactor #16600

Merged
merged 8 commits into from
Oct 8, 2024
Merged

Big trash refactor #16600

merged 8 commits into from
Oct 8, 2024

Conversation

GulomovCreative
Copy link
Contributor

@GulomovCreative GulomovCreative commented Aug 16, 2024

What does it do?

  1. Adds new "Trash" menu item to the top menu
  2. Fixes Don't work middle mouse button click on Trash manager button #14190
  3. Fixes trash button icon color change when its inactive
  4. Removes unnecessary styles
  5. Adds a purge button to the edit resource page
  6. The resource tree and trash button state are now updates when a resource is deleted/undeleted on the resource update page
  7. Fixes trash button tooltip information when purging resources on the trash page
  8. Now when a resource have been delete/undelete in the resource tree, the state of the resource update form (checkbox and buttons) updates
  9. Fixes undefined text of the trash button tooltip
  10. Adds purge resource menu item to the context menu in the resource tree

Why is it needed?

There are many errors when deleting/restoring/purging resources

How to test

  1. Click by the middle mouse button on the trash button on the toolbar
  2. Hover over the trash button when its inactive, before the icon changed color, now when inactive it does not
  3. Open the edit resource page, delete it and you will see a new purging button
  4. If you delete or restore a resource on the edit page, the resource tree and the trash button in the toolbar remain unchanged. Now the resource tree and the trash button will change their state
  5. On the trash page when purging resources, the state of the trash button in the toolbar was not updated, now it will be
  6. Create a resource, open its edit page and delete the resource in the resource tree, the state of the checkbox and buttons in the edit form will not change. Now everything works as it should.
  7. If you delete a resource and when you hover the trash button, it will be undefined in the tooltip. Now the information will be correct
  8. Open the context menu of resource tree, delete the resource and open again

Related issue(s)/PR(s)

#14190

Copy link

codecov bot commented Aug 19, 2024

Codecov Report

Attention: Patch coverage is 16.66667% with 5 lines in your changes missing coverage. Please review.

Project coverage is 21.55%. Comparing base (69c7efb) to head (09cc4c5).
Report is 9 commits behind head on 3.x.

Files Patch % Lines
...src/Revolution/Processors/Resource/Trash/Purge.php 0.00% 3 Missing ⚠️
...re/src/Revolution/Processors/Resource/GetNodes.php 0.00% 1 Missing ⚠️
.../src/Revolution/Processors/Resource/GetToolbar.php 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##                3.x   #16600      +/-   ##
============================================
- Coverage     21.57%   21.55%   -0.03%     
- Complexity    10599    10600       +1     
============================================
  Files           561      561              
  Lines         32095    32107      +12     
============================================
- Hits           6926     6922       -4     
- Misses        25169    25185      +16     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

theboxer

This comment was marked as outdated.

Copy link
Member

@theboxer theboxer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thank you!

The only thing that's missing is an update script to add the new menu during upgrade.

@rthrash
Copy link
Member

rthrash commented Aug 29, 2024

@GulomovCreative do you think you’ll have time to get the update script for adding the new menu during an upgrade done?

@GulomovCreative
Copy link
Contributor Author

@GulomovCreative do you think you’ll have time to get the update script for adding the new menu during an upgrade done?

@rthrash Can I see some examples? I don't know how it works

@theboxer
Copy link
Member

theboxer commented Sep 4, 2024

@GulomovCreative here are current upgrade scripts https://github.com/modxcms/revolution/blob/3.x/setup/includes/upgrades/mysql/3.1.0-pl.php you can check those or older ones for samples

@theboxer
Copy link
Member

theboxer commented Sep 5, 2024

Added the upgrade script & adjusted the lexicon for context menu in the tree

@rthrash rthrash added this to the v3.1.0 milestone Sep 12, 2024
@theboxer
Copy link
Member

theboxer commented Oct 7, 2024

@opengeek rebased to 3.x

@opengeek opengeek merged commit e155f60 into modxcms:3.x Oct 8, 2024
6 checks passed
jenswittmann pushed a commit to jenswittmann/revolution that referenced this pull request Dec 23, 2024
### What does it do?

1. Adds new "Trash" menu item to the top menu
2. Fixes modxcms#14190
3. Fixes trash button icon color change when its inactive
4. Removes unnecessary styles
5. Adds a purge button to the edit resource page
6. The resource tree and trash button state are now updates when a
resource is deleted/undeleted on the resource update page
7. Fixes trash button tooltip information when purging resources on the
trash page
8. Now when a resource have been delete/undelete in the resource tree,
the state of the resource update form (checkbox and buttons) updates
9. Fixes undefined text of the trash button tooltip
10. Adds purge resource menu item to the context menu in the resource
tree

### Why is it needed?

There are many errors when deleting/restoring/purging resources

### How to test

1. —
2. Click by the middle mouse button on the trash button on the toolbar
3. Hover over the trash button when its inactive, before the icon
changed color, now when inactive it does not
4. —
5. Open the edit resource page, delete it and you will see a new purging
button
6. If you delete or restore a resource on the edit page, the resource
tree and the trash button in the toolbar remain unchanged. Now the
resource tree and the trash button will change their state
7. On the trash page when purging resources, the state of the trash
button in the toolbar was not updated, now it will be
8. Create a resource, open its edit page and delete the resource **in
the resource tree**, the state of the checkbox and buttons in the edit
form will not change. Now everything works as it should.
9. If you delete a resource and when you hover the trash button, it will
be undefined in the tooltip. Now the information will be correct
10. Open the context menu of resource tree, delete the resource and open
again

### Related issue(s)/PR(s)
modxcms#14190

---------

Co-authored-by: Jan Peca <pecajan@gmail.com>
Co-authored-by: Jason Coward <jason@opengeek.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Don't work middle mouse button click on Trash manager button
6 participants