Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/add/update-legacy-notice-styling…
Browse files Browse the repository at this point in the history
…' into add/update-legacy-notice-styling

# Conflicts:
#	includes/helper/class-wp-job-manager-helper.php
  • Loading branch information
anaemnesis committed May 18, 2023
2 parents 450d0c5 + f66f610 commit 8755fa3
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 13 deletions.
5 changes: 4 additions & 1 deletion assets/css/admin-notices.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ $notice-success: #43af99;

// Spacing.
gap: 10px;
padding: 10px 12px;
padding-top: 10px !important;
padding-bottom: 10px !important;
padding-left: 12px;
padding-right: 12px;

&--error {
border-left-color: $notice-error;
Expand Down
10 changes: 6 additions & 4 deletions includes/admin/class-wp-job-manager-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,15 @@ public function admin_enqueue_scripts() {
WP_Job_Manager::register_select2_assets();

$screen = get_current_screen();
if ( in_array( $screen->id, apply_filters( 'job_manager_admin_screen_ids', [ 'edit-job_listing', 'edit-job_listing_category', 'plugins', 'job_listing', 'job_listing_page_job-manager-settings', 'job_listing_page_job-manager-addons', 'edit-job_listing_type', 'dashboard' ] ), true ) ) {

if ( in_array( $screen->id, apply_filters( 'job_manager_admin_screen_ids', [ 'edit-job_listing', 'plugins', 'job_listing', 'job_listing_page_job-manager-settings', 'job_listing_page_job-manager-addons', 'edit-job_listing_type' ] ), true ) ) {

wp_enqueue_style( 'jquery-ui' );
wp_enqueue_style( 'select2' );

WP_Job_Manager::register_style( 'job_manager_admin_css', 'css/admin.css', [] );
wp_enqueue_style( 'job_manager_admin_css' );

WP_Job_Manager::register_style( 'job_manager_admin_notices_css', 'css/admin-notices.css', [] );
wp_enqueue_style( 'job_manager_admin_notices_css' );

wp_enqueue_script( 'wp-job-manager-datepicker' );
wp_register_script( 'jquery-tiptip', JOB_MANAGER_PLUGIN_URL . '/assets/lib/jquery-tiptip/jquery.tipTip.min.js', [ 'jquery' ], JOB_MANAGER_VERSION, true );

Expand Down Expand Up @@ -129,6 +128,9 @@ public function admin_enqueue_scripts() {

WP_Job_Manager::register_style( 'job_manager_admin_menu_css', 'css/menu.css', [] );
wp_enqueue_style( 'job_manager_admin_menu_css' );

WP_Job_Manager::register_style( 'job_manager_admin_notices_css', 'css/admin-notices.css', [] );
wp_enqueue_style( 'job_manager_admin_notices_css' );
}

/**
Expand Down
4 changes: 2 additions & 2 deletions includes/helper/class-wp-job-manager-helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
}

/**
* Helper functions used in WP Job Manager regarding addons and licenses.
* Helper functions used in WP Job Manager regarding addons and licences.
*
* @package wp-job-manager
* @since 1.29.0
*/
class WP_Job_Manager_Helper {
/**
* License messages to display to the user.
* Licence messages to display to the user.
*
* @var array Messages when updating licences.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,29 +234,29 @@ public function test_plugins_api_valid_plugin() {
* @covers WP_Job_Manager_Helper::plugin_links
* @requires PHP 5.3.0
*/
public function test_plugin_links_valid_plugin_valid_license() {
public function test_plugin_links_valid_plugin_valid_licence() {
$instance = $this->getMockHelper();
$this->enable_update_plugins_cap();
$actions = $instance->plugin_links( [], 'test/test.php' );
$this->disable_update_plugins_cap();
$this->assertCount( 1, $actions );
$this->assertContains( __( 'Manage License', 'wp-job-manager' ), $actions[0] );
$this->assertContains( __( 'Manage licence', 'wp-job-manager' ), $actions[0] );
}

/**
* @since 1.29.0
* @covers WP_Job_Manager_Helper::plugin_links
* @requires PHP 5.3.0
*/
public function test_plugin_links_valid_plugin_invalid_license() {
public function test_plugin_links_valid_plugin_invalid_licence() {
$instance = $this->getMockHelper();
$this->enable_update_plugins_cap();
WP_Job_Manager_Helper_Options::delete( 'test', 'licence_key' );
WP_Job_Manager_Helper_Options::delete( 'test', 'email' );
$actions = $instance->plugin_links( [], 'test/test.php' );
$this->disable_update_plugins_cap();
$this->assertCount( 1, $actions );
$this->assertContains( __( 'Activate License', 'wp-job-manager' ), $actions[0] );
$this->assertContains( __( 'Activate licence', 'wp-job-manager' ), $actions[0] );
}

/**
Expand Down Expand Up @@ -333,7 +333,7 @@ public function test_has_licenced_products_false() {
* @since 1.29.0
* @covers WP_Job_Manager_Helper::get_plugin_licence
*/
public function test_get_plugin_license_valid() {
public function test_get_plugin_licence_valid() {
WP_Job_Manager_Helper_Options::update( 'rhino', 'licence_key', '1234' );
WP_Job_Manager_Helper_Options::update( 'rhino', 'email', 'test@local.dev' );
WP_Job_Manager_Helper_Options::update( 'rhino', 'errors', null );
Expand All @@ -354,7 +354,7 @@ public function test_get_plugin_license_valid() {
* @since 1.29.0
* @covers WP_Job_Manager_Helper::get_plugin_info
*/
public function test_get_plugin_license_invalid() {
public function test_get_plugin_licence_invalid() {
$instance = new WP_Job_Manager_Helper();
$result = $instance->get_plugin_licence( 'rhino' );
$expected = [
Expand Down

0 comments on commit 8755fa3

Please sign in to comment.