Skip to content

Commit 25717b4

Browse files
authored
Merge pull request #162 from Codeinwp/development
Fixed library rendering issue. Added git tag check for deployment. Added wraith for visual regression testing.
2 parents 4032767 + 50a9cc8 commit 25717b4

File tree

11 files changed

+104
-60
lines changed

11 files changed

+104
-60
lines changed

.distignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@ phpunit.xml
1515
npm-debug.log
1616
dist
1717
artifact
18-
composer
18+
composer.json
19+
composer.lock

.travis.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ php:
66
- "5.4"
77
- "5.3"
88
- "5.2"
9+
matrix:
10+
include:
11+
- php: "5.6"
12+
before_install: chmod +x bin/wraith.sh
13+
install: true
14+
before_script:
15+
env: TEST_SUITE=Wraith_Visual_Regression_Testing WRAITH_FAIL=5
16+
script: ./bin/wraith.sh
917
sudo: false
1018
branches:
1119
except:
@@ -49,16 +57,7 @@ deploy:
4957
on:
5058
repo: "$UPSTREAM_REPO"
5159
branch: "$MASTER_BRANCH"
52-
condition: $TRAVIS_PHP_VERSION = "7.0"
53-
- provider: releases
54-
api_key: "$GITHUB_TOKEN"
55-
file: artifact/$THEMEISLE_REPO.zip
56-
skip_cleanup: true
57-
on:
58-
tags: false
59-
repo: "$UPSTREAM_REPO"
60-
branch: "$MASTER_BRANCH"
61-
condition: $TRAVIS_PHP_VERSION = "7.0"
60+
condition: $TEST_SUITE = "Wraith_Visual_Regression_Testing"
6261
after_deploy:
6362
- chmod +x bin/deploy.sh
6463
- ". ./bin/deploy.sh"

bin/deploy.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ if ! [ $AFTER_DEPLOY_RUN ] && [ "$TRAVIS_PHP_VERSION" == "7.0" ]; then
1111

1212
git config user.name "selul"
1313
git config user.email ${GITHUB_EMAIL}
14+
git fetch
15+
16+
# Check if we already have a tag with this version.
17+
if ! git rev-parse "v$THEMEISLE_VERSION" >/dev/null 2>&1
18+
then
1419

1520
# Send changelog changes to git.
1621
git checkout $MASTER_BRANCH
@@ -30,7 +35,7 @@ if ! [ $AFTER_DEPLOY_RUN ] && [ "$TRAVIS_PHP_VERSION" == "7.0" ]; then
3035
# to set the body of the release.
3136
API_JSON='{"tag_name": "v'$THEMEISLE_VERSION'","target_commitish": "'$MASTER_BRANCH'","name": "v'$THEMEISLE_VERSION'","body": "'$CHANGES'","draft": false,"prerelease": false}';
3237
curl -s --data "$API_JSON" "https://api.github.com/repos/$UPSTREAM_REPO/releases?access_token="$GITHUB_TOKEN > /dev/null;
33-
38+
fi
3439
# Send update to the store
3540
STORE_JSON='{"version": "'$THEMEISLE_VERSION'","id": "'$THEMEISLE_ID'","body": "'$CHANGES'"}';
3641
curl -s -H "Content-Type: application/json" -H "x-themeisle-auth: $THEMEISLE_AUTH" --data "$STORE_JSON" "$STORE_URL/wp-json/ti-endpoint/v1/update_changelog_new/" > /dev/null

bin/wraith.sh

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/bin/bash
2+
3+
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
4+
5+
# Sending wraith request.
6+
7+
WRAITH_SLUG=$(node -pe "require('./package.json').wraithSlug")
8+
WRAITH_FAIL=${WRAITH_FAIL:-5}
9+
body="{
10+
'request': {
11+
'travis_event_type': '$TRAVIS_EVENT_TYPE',
12+
'travis_pull_request': '$TRAVIS_PULL_REQUEST',
13+
'travis_pull_request_branch': '$TRAVIS_PULL_REQUEST_BRANCH',
14+
'travis_pull_request_slug': '$TRAVIS_PULL_REQUEST_SLUG',
15+
'travis_repo_slug': '$TRAVIS_PULL_REQUEST_SLUG',
16+
'travis_branch': '$TRAVIS_PULL_REQUEST_BRANCH',
17+
'wraithSlug': $WRAITH_SLUG,
18+
'wraithFail': $WRAITH_FAIL
19+
}
20+
}"
21+
22+
echo "Triggering build of $TRAVIS_REPO_SLUG branch $TRAVIS_BRANCH on Travis. Calling Wraith API ..."
23+
24+
output=$(curl -sw "%{http_code}" -X POST \
25+
-H "Content-Type: application/json" \
26+
-H "Accept: application/json" \
27+
-H "Travis-API-Version: 3" \
28+
-d "${body//\'/\"}" \
29+
'http://wraith.themeisle.com?api&travis')
30+
31+
http_code="${output:${#output}-3}"
32+
if [ ${#output} -eq 3 ]; then
33+
body=""
34+
else
35+
body="${output:0:${#output}-3}"
36+
fi
37+
38+
if [ $http_code != 200 ]; then
39+
echo "$output";
40+
exit 1
41+
else
42+
echo "$output";
43+
exit 0
44+
fi
45+
fi

classes/Visualizer/Plugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
class Visualizer_Plugin {
2929

3030
const NAME = 'visualizer';
31-
const VERSION = '2.0.3';
31+
const VERSION = '2.0.4';
3232

3333
// custom post types
3434
const CPT_VISUALIZER = 'visualizer';

classes/Visualizer/Render/Library.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,6 @@ private function _renderLibrary() {
119119
$this->_renderChartBox( $placeholder_id, $chart['id'] );
120120
}
121121
echo '</div>';
122-
if ( is_array( $this->pagination ) ) {
123-
echo '<ul class=" subsubsub">';
124-
foreach ( $this->pagination as $page ) {
125-
echo '<li class="all">', $page, '</li>';
126-
}
127-
echo '</ul>';
128-
}
129122
} else {
130123
echo '<div id="visualizer-library" class="visualizer-clearfix">';
131124
echo '<div class="visualizer-chart">';
@@ -146,6 +139,13 @@ private function _renderLibrary() {
146139
}
147140
$this->_renderSidebar();
148141
echo '</div>';
142+
if ( is_array( $this->pagination ) ) {
143+
echo '<ul class=" subsubsub">';
144+
foreach ( $this->pagination as $page ) {
145+
echo '<li class="all">', $page, '</li>';
146+
}
147+
echo '</ul>';
148+
}
149149
}
150150

151151
/**

css/media.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Version: 2.0.3
2+
Version: 2.0.4
33
*/
44
#visualizer-library-view {
55
padding: 30px 10px 10px 30px;

humans.txt

Lines changed: 0 additions & 12 deletions
This file was deleted.

index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Plugin Name: Visualizer: Charts and Graphs Lite
55
Plugin URI: https://themeisle.com/plugins/visualizer-charts-and-graphs-lite/
66
Description: A simple, easy to use and quite powerful tool to create, manage and embed interactive charts into your WordPress posts and pages. The plugin uses Google Visualization API to render charts, which supports cross-browser compatibility (adopting VML for older IE versions) and cross-platform portability to iOS and new Android releases.
7-
Version: 2.0.3
7+
Version: 2.0.4
88
Author: Themeisle
99
Author URI: http://themeisle.com
1010
License: GPL v2.0 or later

package.json

Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,31 @@
11
{
2-
"name": "visualizer",
3-
"version": "2.0.3",
4-
"description": "Visualizer Lite",
5-
"repository": {
6-
"type": "git",
7-
"url": "git+https://github.com/Codeinwp/visualizer.git"
8-
},
9-
"keywords": [
10-
"wordpress-plugin"
11-
],
12-
"textdomain": "visualizer",
13-
"category": "plugins",
14-
"author": "ThemeIsle <[email protected]>",
15-
"license": "GPL-2.0+",
16-
"bugs": {
17-
"url": "https://github.com/Codeinwp/visualizer/issues"
18-
},
19-
"pot": {
20-
"reportmsgidbugsto": "https://github.com/Codeinwp/visualizer/issues",
21-
"languageteam": "Themeisle Translate <[email protected]>",
22-
"lasttranslator": "Themeisle Translate Team <[email protected]>"
23-
},
24-
"devDependencies": {
25-
"grunt-plugin-fleet": "codeinwp/grunt-plugin-fleet",
26-
"load-project-config": "~0.2.0"
27-
}
2+
"name": "visualizer",
3+
"version": "2.0.4",
4+
"description": "Visualizer Lite",
5+
"repository": {
6+
"type": "git",
7+
"url": "git+https://github.com/Codeinwp/visualizer.git"
8+
},
9+
"keywords": [
10+
"wordpress-plugin"
11+
],
12+
"textdomain": "visualizer",
13+
"category": "plugins",
14+
"author": "ThemeIsle <[email protected]>",
15+
"license": "GPL-2.0+",
16+
"bugs": {
17+
"url": "https://github.com/Codeinwp/visualizer/issues"
18+
},
19+
"pot": {
20+
"reportmsgidbugsto": "https://github.com/Codeinwp/visualizer/issues",
21+
"languageteam": "Themeisle Translate <[email protected]>",
22+
"lasttranslator": "Themeisle Translate Team <[email protected]>"
23+
},
24+
"devDependencies": {
25+
"grunt-plugin-fleet": "codeinwp/grunt-plugin-fleet",
26+
"load-project-config": "~0.2.0"
27+
},
28+
"wraithSlug": [
29+
"visualizer"
30+
]
2831
}

0 commit comments

Comments
 (0)