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

Display and updated in process documents in PDF document data metabox #782

Open
wants to merge 24 commits into
base: main
Choose a base branch
from

Conversation

MohamadNateqi
Copy link
Contributor

@MohamadNateqi MohamadNateqi commented Apr 29, 2024

close #756

This PR improves the way document data are displayed in the metabox. It includes a check for pending jobs and displays a message if the document is still in the queue. It also adds an AJAX request that refreshes document data, eliminating the need to refresh the page.

Note: For the Pro extension compatibility, this branch should be used: https://github.com/wpovernight/woocommerce-pdf-ips-pro/pull/407


For test purposes, the below snippet can be used to stop the queue from running jobs:

function wpo_disable_default_runner() {
	if ( class_exists( 'ActionScheduler' ) ) {
		remove_action( 'action_scheduler_run_queue', array( ActionScheduler::runner(), 'run' ) );
	}
}

add_action( 'init', 'wpo_disable_default_runner', 10 );

Then, the job can be manually run to test the AJAX update.

# Conflicts:
#	assets/js/order-script.js
#	includes/class-wcpdf-admin.php
@alexmigf alexmigf added this to the 3.8.4 milestone May 17, 2024
@alexmigf
Copy link
Member

alexmigf commented Jul 8, 2024

@MohamadNateqi can you fix the conflicts?

@MohamadNateqi
Copy link
Contributor Author

@alexmigf Done.

assets/js/order-script.js Outdated Show resolved Hide resolved
includes/class-wcpdf-admin.php Outdated Show resolved Hide resolved
includes/class-wcpdf-admin.php Outdated Show resolved Hide resolved
includes/class-wcpdf-admin.php Outdated Show resolved Hide resolved
includes/class-wcpdf-admin.php Outdated Show resolved Hide resolved
includes/class-wcpdf-admin.php Outdated Show resolved Hide resolved
includes/class-wcpdf-admin.php Outdated Show resolved Hide resolved
includes/class-wcpdf-admin.php Outdated Show resolved Hide resolved
Copy link
Member

@alexmigf alexmigf left a comment

Choose a reason for hiding this comment

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

LGTM!

@Terminator-Barbapapa Terminator-Barbapapa modified the milestones: IPS Free: 3.8.5, IPS Free: 3.9.1 Jul 11, 2024
# Conflicts:
#	includes/class-wcpdf-admin.php
#	includes/wcpdf-functions.php
@alexmigf
Copy link
Member

alexmigf commented Oct 9, 2024

@MohamadNateqi can you fix the conflicts please?

# Conflicts:
#	views/document-data-metabox.php
includes/Admin.php Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improvements for "PDF document data" metabox
3 participants