Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
andergmartins committed Feb 22, 2019
2 parents 63cf958 + 5fc7cb1 commit 6f2ac6f
Show file tree
Hide file tree
Showing 15 changed files with 3,145 additions and 497 deletions.
22 changes: 6 additions & 16 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,21 +1,10 @@
{
"presets": [
[
"@babel/react",
{
"modules": false,
"targets": {
"browsers": [
"last 2 Chrome versions",
"last 2 Firefox versions",
"last 2 Safari versions",
"last 2 iOS versions",
"last 1 Android version",
"last 1 ChromeAndroid version",
"ie 11"
]
}
}
"@wordpress/babel-preset-default"
],
[
"minify"
]
],
"plugins": [
Expand All @@ -25,5 +14,6 @@
"pragma": "wp.element.createElement"
}
]
]
],
"sourceMaps": "inline"
}
4 changes: 2 additions & 2 deletions build.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>

<project name="PublishPress Plugin Builder" default="build">
<import file="vendor/publishpress/wordpress-plugin-builder/build.xml"/>
</project>
<import file="vendor/alledia/wordpress-plugin-builder/build.xml"/>
</project>
8 changes: 2 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
}
],
"repositories": [
{
"type": "git",
"url": "https://github.com/OSTraining/WordPress-Plugin-Builder"
},
{
"type": "git",
"url": "https://github.com/OSTraining/WordPress-EDD-License-Integration"
Expand All @@ -27,8 +23,8 @@
},
"require": {
"pimple/pimple": "~3.0",
"publishpress/wordpress-edd-license-integration": "~2.1",
"publishpress/wordpress-plugin-builder": "^2"
"alledia/wordpress-plugin-builder": "dev-development",
"publishpress/wordpress-edd-license-integration": "~2.1"
},
"minimum-stability": "stable"
}
2 changes: 1 addition & 1 deletion includes.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ function pp_checklist_admin_version_error()
if ( ! defined(PP_HALT_CONSTANT)) {
define('PP_CONTENT_CHECKLIST_ITEM_ID', '6465');
define('PP_CONTENT_CHECKLIST_PATH_BASE', plugin_dir_path(__FILE__));
define('PUBLISHPRESS_CONTENT_CHECKLIST_VERSION', '1.4.4');
define('PUBLISHPRESS_CONTENT_CHECKLIST_VERSION', '1.4.5');
define('PP_CONTENT_CHECKLIST_FILE', 'publishpress-content-checklist/publishpress-content-checklist.php');
define('PP_CONTENT_CHECKLIST_MODULE_PATH', __DIR__ . '/modules/checklist');
define('PP_CONTENT_CHECKLIST_ITEM_NAME', 'Content Checklist for PublishPress');
Expand Down
10 changes: 8 additions & 2 deletions modules/checklist/assets/js/checklist-admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
this.elems.publish_button.trigger('click');
}.bind(this));

if ( ! PP_Content_Checklist.is_gutenberg_active()) {
if (!PP_Content_Checklist.is_gutenberg_active()) {
// Hook to the submit button
$('form#post').submit(function (event) {
// Reset the should_block state
Expand Down Expand Up @@ -227,6 +227,12 @@
return;
}

// Check if the publish button was pressed, without Gutenberg.
if (!this.state.is_publishing && !PP_Content_Checklist.is_gutenberg_active()) {
return;
}


var list_unchecked = {
'block': [],
'warning': []
Expand Down Expand Up @@ -271,7 +277,7 @@

// Check if we don't have any unchecked block req
if (0 === list_unchecked.block.length) {
if ( ! PP_Content_Checklist.is_gutenberg_active()) {
if (!PP_Content_Checklist.is_gutenberg_active()) {
// Only display a warning
message = ppChecklist.msg_missed_optional + '<div class="pp-checklist-modal-list"><ul><li>' + list_unchecked.warning.join('</li><li>') + '</li></ul></div>';

Expand Down
55 changes: 0 additions & 55 deletions modules/checklist/assets/js/gutenberg-warning.js

This file was deleted.

1 change: 0 additions & 1 deletion modules/checklist/assets/js/gutenberg-warning.js.map

This file was deleted.

35 changes: 16 additions & 19 deletions modules/checklist/assets/js/gutenberg-warning.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
const { Component } = React;

const { __ } = wp.i18n;

const { Fragment } = wp.element;

const { PluginPrePublishPanel } = wp.editPost;

const { registerPlugin } = wp.plugins;
let {Component} = React;
let {__} = wp.i18n;
let {Fragment} = wp.element;
let {PluginPrePublishPanel} = wp.editPost;
let {registerPlugin} = wp.plugins;

class PPChecklistWarning extends Component {
constructor () {
Expand All @@ -21,34 +17,35 @@ class PPChecklistWarning extends Component {
wp.hooks.addAction('publishpress-content-checklist.update-failed-requirements', 'publishpress/content-checklist', this.updateFailedRequirements, 10);
};

updateFailedRequirements(failedRequirements) {
updateFailedRequirements (failedRequirements) {
this.setState({requirements: failedRequirements});
};

render() {
render () {
if (this.state.requirements.length === 0) {
return (null);
}

return ( <Fragment>
return (<Fragment>
<PluginPrePublishPanel
name="gutenberg-boilerplate-sidebar"
title={ __( 'Checklist' ) }
title={__('Checklist')}
initialOpen="true"
>
<div class="pp-checklist-failed-requirements-warning">
<p>{ __('The following requirements are not completed yet. Are you sure you want to publish', 'publishpress-content-checklist') }</p>
<p>{__('The following requirements are not completed yet. Are you sure you want to publish', 'publishpress-content-checklist')}</p>
<ul>
{this.state.requirements.map((item, i) => <li><span className="dashicons dashicons-no"></span><span>{ item }</span></li>)}
{this.state.requirements.map((item, i) => <li><span
className="dashicons dashicons-no"></span><span>{item}</span></li>)}
</ul>
</div>
</PluginPrePublishPanel>
</Fragment> );
</Fragment>);
}
}

registerPlugin( 'publishpress-content-checklist-warning', {
registerPlugin('publishpress-content-checklist-warning', {
icon: 'admin-site',
render: () => (<PPChecklistWarning />),
} );
render: () => (<PPChecklistWarning/>)
});

Loading

0 comments on commit 6f2ac6f

Please sign in to comment.