Skip to content

Commit

Permalink
Merge branch 'develop' for 1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
helen committed Mar 8, 2019
2 parents 8593d88 + d0d03d1 commit 930b12a
Show file tree
Hide file tree
Showing 84 changed files with 2,812 additions and 1,762 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ before_script:
script:
- if [ -n "$AWS_ACCESS_KEY" ]; then ./vendor/bin/wpsnapshots configure 10up --aws_key=$AWS_ACCESS_KEY --aws_secret=$SECRET_ACCESS_KEY --user_name=Travis [email protected]; fi
- if [ -n "$AWS_ACCESS_KEY" ]; then bash run-wpacceptance.sh; fi
- composer run-script lint
- ./vendor/bin/phpunit
- composer run-script lint
notifications:
email: false
sudo: required
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

All notable changes to this project will be documented in this file, per [the Keep a Changelog standard](http://keepachangelog.com/).

## [ 1.4.0 ] - 2019-03-07
### Added
* Clearer instructions and help text when adding an external connection.
* Log image sideloading failures when using `DISTRIBUTOR_DEBUG`.

### Fixed
* Allow attachments to be distributed from local environments.
* Ensure pagination is reset when switching views on the pull content screen.
* Remove extraneous checkboxes from pulled content screen.
* Suppress a PHP warning when no meta is being distributed for attachments.

## [ 1.3.9 ] - 2019-02-21
### Fixed
* Ensure posts distributed as draft can be published.
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ The plugin contains a standard test suite compatible with PHPUnit. If you want t

You can define a constant `DISTRIBUTOR_DEBUG` to `true` to increase the ease of debugging in Distributor. This will make all remote requests blocking and expose the subscription post type.

Enabling this will also provide more debugging information in your error log for image side loading issues. The specific logging method may change in the future.

### Work with us

<a href="http://10up.com/contact/"><img src="https://10updotcom-wpengine.s3.amazonaws.com/uploads/2016/10/10up-Github-Banner.png" width="850"></a>
10 changes: 9 additions & 1 deletion assets/css/admin-external-connection.css
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,15 @@

#dt_external_connection_details p,
#dt_external_connection_details .connection-field-wrap {
margin-bottom: 3em;
margin-bottom: 2em;
}

#dt_external_connection_details .card {
margin-bottom: 2em;
}

#dt_external_connection_details .card p {
margin-bottom: 1em;
}

.endpoint-errors {
Expand Down
54 changes: 40 additions & 14 deletions assets/js/admin-pull.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import jQuery from 'jquery';
const chooseConnection = document.getElementById( 'pull_connections' );
const choosePostType = document.getElementById( 'pull_post_type' );
const choosePostTypeBtn = document.getElementById( 'pull_post_type_submit' );
const searchField = document.getElementById( 'post-search-input' );
const searchBtn = document.getElementById( 'search-submit' );
const form = document.getElementById( 'posts-filter' );

jQuery( chooseConnection ).on( 'change', ( event ) => {
Expand All @@ -12,23 +14,47 @@ jQuery( chooseConnection ).on( 'change', ( event ) => {
document.body.className += ' ' + 'dt-loading';
} );

if ( chooseConnection && choosePostType && choosePostTypeBtn && form ) {
jQuery( choosePostTypeBtn ).on( 'click', ( event ) => {
if ( chooseConnection && choosePostType && form ) {

event.preventDefault();
if ( choosePostTypeBtn ) {
jQuery( choosePostTypeBtn ).on( 'click', ( event ) => {

const postType = choosePostType.options[ choosePostType.selectedIndex ].value;
const url = chooseConnection.options[ chooseConnection.selectedIndex ].getAttribute( 'data-pull-url' );
let status = 'new';
event.preventDefault();

if ( -1 < ( ' ' + form.className + ' ' ).indexOf( ' status-skipped ' ) ) {
status = 'skipped';
} else if ( -1 < ( ' ' + form.className + ' ' ).indexOf( ' status-pulled ' ) ) {
status = 'pulled';
}
document.location = getURL();

document.location = url + '&pull_post_type=' + postType + '&status=' + status;
document.body.className += ' ' + 'dt-loading';
} );
}

document.body.className += ' ' + 'dt-loading';
} );
if ( searchField && searchBtn ) {
jQuery( searchBtn ).on( 'click', ( event ) => {
event.preventDefault();

const search = searchField.value;

document.location = getURL() + '&s=' + search;

document.body.className += ' ' + 'dt-loading';
} );
}
}

/**
* Build our Distribution URL.
*
* @return {string}
*/
const getURL = () => {
const postType = choosePostType.options[ choosePostType.selectedIndex ].value;
const baseURL = chooseConnection.options[ chooseConnection.selectedIndex ].getAttribute( 'data-pull-url' );
let status = 'new';

if ( -1 < ( ' ' + form.className + ' ' ).indexOf( ' status-skipped ' ) ) {
status = 'skipped';
} else if ( -1 < ( ' ' + form.className + ' ' ).indexOf( ' status-pulled ' ) ) {
status = 'pulled';
}

return baseURL + '&pull_post_type=' + postType + '&status=' + status;
};
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
}
},
"require-dev": {
"10up/wp_mock": "dev-dev",
"10up/phpcs-composer": "dev-master",
"phpunit/phpunit": "^6.5",
"10up/wpacceptance": "~0.10.0"
"10up/wpacceptance": "~0.12.0",
"10up/wp_mock": "~0.4",
"phpunit/phpunit": "~7.5",
"10up/phpcs-composer": "dev-master"
},
"scripts": {
"lint": "phpcs .",
"lint-fix": "phpcbf ."
"lint": "./vendor/bin/phpcs . --runtime-set testVersion 5.6-",
"lint-fix": "phpcbf . --runtime-set testVersion 5.6-"
},
"minimum-stability": "dev",
"prefer-stable": true
Expand Down
Loading

0 comments on commit 930b12a

Please sign in to comment.