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

Quick Edit and Bulk edit #350

Merged
merged 21 commits into from
Jul 9, 2024
Merged

Quick Edit and Bulk edit #350

merged 21 commits into from
Jul 9, 2024

Conversation

dhanendran
Copy link
Member

Description of the Change

Added option to Quick edit and Bulk edit redirect's HTTPS status and Force Https meta on the post list table.

Closes #98

Screenshot 2023-09-08 at 4 05 20 PM
Screenshot 2023-09-08 at 4 05 29 PM

How to test the Change

  1. Goto Safe Redirect Manager's list page
  2. Hover over any redirect and confirm the "Quick Edit" option available
  3. On the Quick Edit, confirm the Https status code and Force Https meta fields available to edit
  4. Confirm the updates are saved to the post
  5. Select multiple posts and select the "Edit" option from the bulk actions dropdown
  6. Confirm the data updated to respective posts

Changelog Entry

Added - Option to quick edit and bulk edit redirect's https status and force https meta.

Credits

Props @dhanendran

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

@dhanendran dhanendran requested a review from a team as a code owner September 8, 2023 10:40
@dhanendran dhanendran requested review from faisal-alvi and removed request for a team September 8, 2023 10:40
@dhanendran dhanendran self-assigned this Sep 8, 2023
@github-actions github-actions bot added this to the Future Release milestone Sep 8, 2023
@github-actions github-actions bot added the needs:code-review This requires code review. label Sep 8, 2023
@dhanendran dhanendran changed the title Quick and Bulk edit Quick Edit and Bulk edit Sep 8, 2023
@jeffpaul jeffpaul modified the milestones: Future Release, 2.2.0 Sep 8, 2023
Copy link
Member

@faisal-alvi faisal-alvi left a comment

Choose a reason for hiding this comment

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

@dhanendran thanks for the PR.

I have tested and the functionality is working as expected.

image

However, I just added some code changes below which should be addressed before we proceed with the merge.

assets/js/quick-bulk-edit.js Outdated Show resolved Hide resolved
assets/js/quick-bulk-edit.js Outdated Show resolved Hide resolved
inc/classes/class-srm-post-type.php Outdated Show resolved Hide resolved
@dhanendran
Copy link
Member Author

@faisal-alvi I have addressed your comments.

@@ -746,6 +801,7 @@ public function load_resources() {
if ( 'redirect_rule' === get_post_type() ) {
wp_enqueue_style( 'redirectjs', plugin_dir_url( 'safe-redirect-manager/safe-redirect-manager.php' ) . 'assets/css/redirect.css', array(), SRM_VERSION );
wp_enqueue_script( 'redirectjs', plugin_dir_url( 'safe-redirect-manager/safe-redirect-manager.php' ) . 'assets/js/redirect.js', array( 'jquery' ), SRM_VERSION );
wp_enqueue_script( 'quick-bulk-editjs', plugin_dir_url( 'safe-redirect-manager/safe-redirect-manager.php' ) . 'assets/js/quick-bulk-edit.js', array( 'jquery', 'inline-edit-post' ), SRM_VERSION );
Copy link
Contributor

@ravinderk ravinderk Sep 15, 2023

Choose a reason for hiding this comment

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

@dhanendran, I suggest not using a hard-coded plugin file name. It could cause an issue if the plugin directory name does not match.

cc: @faisal-alvi @dkotter

Copy link
Contributor

@ravinderk ravinderk left a comment

Choose a reason for hiding this comment

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

@dhanendran

  • When editing settings from quick edit options, It breaks the UI.
image
  • Newly added setting fields are not aligned. You added an HTML class to align the setting fields to the right side, and each fieldset HTML tag adds a top margin, which looks bad.
image

var forceHttps = $('.srm_redirect_rule_force_https', postRow).text();

$('select[name="srm_redirect_rule_status_code"]', editRow).val(statusCode);
if ('✓' === forceHttps) {
Copy link
Contributor

Choose a reason for hiding this comment

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

@dhanendran I think we should not use symbols for comparison.

@dkotter do you have any thoughts?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, this seems prone to breaking. Is there anything more specific we could target on, maybe we look for an empty string instead?

Copy link
Member

Choose a reason for hiding this comment

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

@10up/open-source-practice curious if anyone else has insight on how to handle here?

Copy link
Member Author

Choose a reason for hiding this comment

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

@ravinderk @dkotter @jeffpaul I'm using x character for comparison now.

Copy link
Member

@faisal-alvi faisal-alvi left a comment

Choose a reason for hiding this comment

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

@dhanendran thanks for the work on this.

  1. I tested and found the bulk checkbox is not working.

350-bulk-check

  1. Can you please also address the code review comments starting from Quick Edit and Bulk edit #350 (comment)?

@dhanendran
Copy link
Member Author

@ravinderk @faisal-alvi I have addressed your comments.

@faisal-alvi The bulk select checkbox working fine for me. Can you test this again please?

@faisal-alvi
Copy link
Member

faisal-alvi commented Jun 14, 2024

@dhanendran Thanks for the changes. I retested again in a different setup but the bulk select is not working there too. I am on WP v6.5.4, could you please try to replicate it in that version if you are not already on it?

350-gif-2

@qasumitbagthariya
Copy link
Contributor

QA Update ❌


@dhanendran @faisal-alvi
I've checked with a different setup but the bulk select is not working.

Jun-16-2024 15-22-05

Testing Environment

  • WordPress: 6.5.4
  • Theme: Twenty Twenty-Four 1.1
  • PHP: 8.0.30
  • Web Server: Nginx 1.20.2
  • Browser: Chrome
  • OS: macOS Ventura 13.3

@Sidsector9 Sidsector9 modified the milestones: 2.1.2, 2.1.3 Jun 20, 2024
@jeffpaul jeffpaul requested a review from dkotter July 1, 2024 15:59
Copy link
Member

@faisal-alvi faisal-alvi left a comment

Choose a reason for hiding this comment

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

@mehul0810 Thanks for the fixes. The bulk select checkbox issue is resolved now. I have a minor "new line removal" suggestion below. Additionally, I'm curious about the necessity of custom JS code for bulk edit and bulk checkbox select functionalities. Why doesn't the WordPress core handle these features by default?

Please also have a look at E2E failures.

safe-redirect-manager.php Show resolved Hide resolved
@faisal-alvi faisal-alvi removed the request for review from ravinderk July 3, 2024 10:50
@mehul0810
Copy link
Contributor

@faisal-alvi Removed the extra line and added a fix for the E2E tests.

Additionally, I'm curious about the necessity of custom JS code for bulk edit and bulk checkbox select functionalities. Why doesn't the WordPress core handle these features by default?

A custom Bulk Edit JS was already there and Bulk Select JS is something I have added after investigating the issue. We are not using an actual custom post type or WP_LIST_TABLE due to which the core functionality for bulk select or bulk edit was not working so we need to add those functionality. Let me know if you have any other questions. Thanks!

@jeffpaul jeffpaul requested a review from faisal-alvi July 8, 2024 13:07
@jeffpaul jeffpaul merged commit 0980ab8 into develop Jul 9, 2024
14 checks passed
@jeffpaul jeffpaul deleted the feat/issue-98 branch July 9, 2024 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs:code-review This requires code review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Quick Edit and Bulk Edit
8 participants