Skip to content

Commit 722c496

Browse files
Nikita HlopovsNikita Hlopovs
authored andcommitted
Merge branch 'master' of gitlab.com:visual-composer-website-builder/builder
2 parents 9099189 + 4721a39 commit 722c496

File tree

11 files changed

+84
-30
lines changed

11 files changed

+84
-30
lines changed

.gitlab-ci.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,22 @@ test:php:modules:
9595
tags:
9696
- docker
9797

98+
deployEditorsBundle:
99+
image: node:8.6.0
100+
stage: deploy
101+
script:
102+
- bash ci/deploy-editors-bundle.sh
103+
tags:
104+
- docker
105+
106+
deployAssetsBundle:
107+
image: node:8.6.0
108+
stage: deploy
109+
script:
110+
- bash ci/deploy-assets-bundle.sh
111+
tags:
112+
- docker
113+
98114
deploying:
99115
image: wpbakery/ci-wordpress-npm
100116
stage: deploy

ci/deploy-assets-bundle.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
output=$(git log --name-only HEAD~1..HEAD public/sources/assetsLibrary)
4+
5+
if [ -z "$output" ]
6+
then
7+
exit 0
8+
else
9+
echo "curl -X GET -H 'Content-type: application/json' \"$CI_HUB_GROUP_TEST_DOMAIN/api/inner/bundle/create?key=$CI_HUB_GROUP_ELEMENTS_BUILD_KEY&bundle=assets&version=latest&name=Assets\""
10+
curl -X GET -H 'Content-type: application/json' "$CI_HUB_GROUP_TEST_DOMAIN/api/inner/bundle/create?key=$CI_HUB_GROUP_ELEMENTS_BUILD_KEY&bundle=assets&version=latest&name=Assets"
11+
fi

ci/deploy-editors-bundle.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
output=$(git log --name-only HEAD~1..HEAD public/editor public/sources/attributes public/sources/css public/sources/fonts public/sources/images public/sources/less)
4+
5+
if [ -z "$output" ]
6+
then
7+
exit 0
8+
else
9+
echo "curl -X GET -H 'Content-type: application/json' \"$CI_HUB_GROUP_TEST_DOMAIN/api/inner/bundle/create?key=$CI_HUB_GROUP_ELEMENTS_BUILD_KEY&bundle=editors/editors&version=latest&name=Editors\""
10+
curl -X GET -H 'Content-type: application/json' "$CI_HUB_GROUP_TEST_DOMAIN/api/inner/bundle/create?key=$CI_HUB_GROUP_ELEMENTS_BUILD_KEY&bundle=editors/editors&version=latest&name=Editors"
11+
fi

public/bundle-update-main.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import './sources/less/wpupdates/init.less'
2-
import { default as PostUpdater } from './editor/modules/backendSettings/postUpdate'
2+
import {default as PostUpdater} from './editor/modules/backendSettings/postUpdate'
33

44
(($) => {
55
$(() => {
66
const localizations = window.VCV_I18N && window.VCV_I18N()
77
const bundleUpdateFailed = localizations ? localizations.bundleUpdateFailed : 'Bundle update failed... Please try again.'
88
const downloadingAssetsText = localizations ? localizations.downloadingAssets : 'Downloading assets {i} of {cnt}'
99
const savingResultsText = localizations ? localizations.savingResults : 'Saving Results'
10+
const postUpdateText = localizations ? localizations.postUpdateText : 'Update posts {i} in {cnt}: {name}'
1011

1112
let $loader = $('[data-vcv-loader]')
1213
let $errorPopup = $('.vcv-popup-error')
@@ -105,17 +106,17 @@ import { default as PostUpdater } from './editor/modules/backendSettings/postUpd
105106
let requestFailed = false
106107

107108
function doAction (i, finishCb) {
108-
let action = actions[ i ]
109+
let action = actions[i]
109110
const testPattern = new RegExp('^updatePosts$')
110111
if (action.action && testPattern.test(action.action)) {
111112
const postUpdater = new PostUpdater(window.vcvElementsGlobalsUrl, window.vcvVendorUrl, window.vcvUpdaterUrl)
112-
const postUpdateText = 'Update posts {i} in {cnt}: {name}'
113113
const doUpdatePostAction = async (posts, postsIndex, finishCb) => {
114-
const postData = posts[ postsIndex ]
114+
const postData = posts[postsIndex]
115115
$heading.text(postUpdateText.replace('{i}', postsIndex + 1).replace('{cnt}', posts.length).replace('{name}', postData.name || 'No name'))
116116
try {
117117
await postUpdater.update(postData)
118-
} catch (e) {}
118+
} catch (e) {
119+
}
119120
if (postsIndex + 1 < posts.length) {
120121
return doUpdatePostAction(posts, postsIndex + 1, finishCb)
121122
} else {

public/editor/modules/backendSettings/actions.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {showError} from './errors'
22
import {showFirstScreen, loadLastScreen, showLoadingScreen, showOopsScreen} from './screens'
3-
import { default as PostUpdater } from './postUpdate'
3+
import {default as PostUpdater} from './postUpdate'
44

55
(($) => {
66
let doneActions = (requestFailed, $heading, downloadingInitialExtensionsText, savingResultsText, $errorPopup, activationFailedText, $popup, loadAnimation) => {
@@ -84,17 +84,19 @@ import { default as PostUpdater } from './postUpdate'
8484
}
8585

8686
function doAction (i, finishCb) {
87-
let action = actions[ i ]
87+
let action = actions[i]
8888
const testPattern = new RegExp('^updatePosts$')
8989
if (action.action && testPattern.test(action.action)) {
9090
const postUpdater = new PostUpdater(window.vcvElementsGlobalsUrl, window.vcvVendorUrl, window.vcvUpdaterUrl)
91-
const postUpdateText = 'Update posts {i} in {cnt}: {name}'
91+
const localizations = window.VCV_I18N && window.VCV_I18N()
92+
const postUpdateText = localizations ? localizations.postUpdateText : 'Update posts {i} in {cnt}: {name}'
9293
const doUpdatePostAction = async (posts, postsIndex, finishCb) => {
93-
const postData = posts[ postsIndex ]
94+
const postData = posts[postsIndex]
9495
$heading.text(postUpdateText.replace('{i}', postsIndex + 1).replace('{cnt}', posts.length).replace('{name}', postData.name || 'No name'))
9596
try {
9697
await postUpdater.update(postData)
97-
} catch (e) {}
98+
} catch (e) {
99+
}
98100
if (postsIndex + 1 < posts.length) {
99101
return doUpdatePostAction(posts, postsIndex + 1, finishCb)
100102
} else {
@@ -169,5 +171,5 @@ import { default as PostUpdater } from './postUpdate'
169171
}
170172
}
171173

172-
module.exports = { doneActions: doneActions, processActions: processActions }
174+
module.exports = {doneActions: doneActions, processActions: processActions}
173175
})(window.jQuery)

visualcomposer/Helpers/Localizations.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ public function getLocalizations()
155155
'hideOn' => __('Hide: On', 'vcwb'),
156156
'downloadingInitialExtensions' => __('Downloading initial extensions', 'vcwb'),
157157
'downloadingAssets' => __('Downloading assets {i} of {cnt}: {name}', 'vcwb'),
158+
'postUpdateText' => __('Updating posts {i} in {cnt}: {name}', 'vcwb'),
158159
];
159160

160161
return $locale;

visualcomposer/Modules/Editors/DataAjax/Controller.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ private function setData(
123123
$post = get_post($sourceId);
124124
if ($post) {
125125
if ($requestHelper->input('vcv-updatePost') === '1') {
126-
vchelper('Filters')->fire('vcv:hub:removePostUpdate:post/' . $sourceId, $sourceId);
126+
vchelper('Events')->fire('vcv:hub:removePostUpdate:post/' . $sourceId, $sourceId);
127127
}
128128

129129
return $this->updatePostData($post, $sourceId, $response);

visualcomposer/Modules/FrontEnd/PluginsInfoController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ protected function addMetaGenerator()
3030
'Powered by Visual Composer Website Builder %s - fast and easy to use drag and drop builder for experts and beginners.',
3131
'vcwb'
3232
),
33-
VCV_VERSION . ' (Lite)'
33+
VCV_VERSION
3434
);
3535
echo sprintf(
3636
'<meta name="generator" content="%s"/>',
@@ -42,7 +42,7 @@ protected function addMetaGenerator()
4242
protected function addBodyClass($classes)
4343
{
4444
$classes[] = 'vcwb';
45-
$classes[] = sprintf('vcwb-ver-%s-lite', VCV_VERSION);
45+
$classes[] = sprintf('vcwb-ver-%s', VCV_VERSION);
4646

4747
return $classes;
4848
}

visualcomposer/Modules/Hub/Download/Actions/PostUpdateAction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function __construct()
2121
{
2222
/** @see \VisualComposer\Modules\Hub\Download\Actions\PostUpdateAction::getUpdateablePosts */
2323
$this->addFilter('vcv:hub:findUpdatePosts:element/*', 'getUpdateablePosts');
24-
$this->addFilter('vcv:hub:removePostUpdate:post/*', 'removePostFromUpdatesList');
24+
$this->addEvent('vcv:hub:removePostUpdate:post/*', 'removePostFromUpdatesList');
2525
}
2626

2727
protected function getUpdateablePosts($posts, $payload)

visualcomposer/Modules/Hub/Download/JsonActionsController.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,14 @@ protected function ajaxGetRequiredActions(
4141
$response['actions'] = $requiredActions;
4242
if (count($reRenderPosts) > 0 && vcvenv('VCV_TF_POSTS_RERENDER', false)) {
4343
$postsActions = $this->createPostUpdateObjects($reRenderPosts);
44-
$response['vcvUpdaterUrl'] = $urlHelper->to('public/dist/wpPostRebuild.bundle.js');
45-
$response['vcvVendorUrl'] = $urlHelper->to('public/dist/vendor.bundle.js');
46-
$response['actions'] = array_merge($response['actions'], $postsActions);
44+
if (vcvenv('VCV_ENV_EXTENSION_DOWNLOAD')) {
45+
$response['vcvUpdaterUrl'] = content_url() . '/' . VCV_PLUGIN_ASSETS_DIRNAME . '/editor/wpPostRebuild.bundle.js';
46+
$response['vcvVendorUrl'] = content_url() . '/' . VCV_PLUGIN_ASSETS_DIRNAME . '/editor/vendor.bundle.js';
47+
} else {
48+
$response['vcvUpdaterUrl'] = $urlHelper->to('public/dist/wpPostRebuild.bundle.js');
49+
$response['vcvVendorUrl'] = $urlHelper->to('public/dist/vendor.bundle.js');
50+
}
51+
$response['actions'] = array_merge($response['actions'], $postsActions);
4752
}
4853
} else {
4954
$loggerHelper->log(

0 commit comments

Comments
 (0)