-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #888 from mollie/PIPRES-342-addcloudsync
Added cloudsync
- Loading branch information
Showing
8 changed files
with
152 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"dependencies": [ | ||
{ | ||
"name" : "ps_accounts" | ||
}, | ||
{ | ||
"name" : "ps_eventbus" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
$(document).ready(function () { | ||
window?.psaccountsVue?.init(); | ||
|
||
// Cloud Sync | ||
const cdc = window.cloudSyncSharingConsent; | ||
|
||
cdc.init('#prestashop-cloudsync'); | ||
cdc.on('OnboardingCompleted', (isCompleted) => { | ||
console.log('OnboardingCompleted', isCompleted); | ||
|
||
}); | ||
cdc.isOnboardingCompleted((isCompleted) => { | ||
console.log('Onboarding is already Completed', isCompleted); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{* | ||
* 2007-2023 PrestaShop | ||
* | ||
* NOTICE OF LICENSE | ||
* | ||
* This source file is subject to the Academic Free License (AFL 3.0) | ||
* that is bundled with this package in the file LICENSE.txt. | ||
* It is also available through the world-wide-web at this URL: | ||
* http://opensource.org/licenses/afl-3.0.php | ||
* If you did not receive a copy of the license and are unable to | ||
* obtain it through the world-wide-web, please send an email | ||
* to [email protected] so we can send you a copy immediately. | ||
* | ||
* DISCLAIMER | ||
* | ||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer | ||
* versions in the future. If you wish to customize PrestaShop for your | ||
* needs please refer to http://www.prestashop.com for more information. | ||
* | ||
* @author PrestaShop SA <[email protected]> | ||
* @copyright 2007-2023 PrestaShop SA | ||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | ||
* International Registered Trademark & Property of PrestaShop SA | ||
*} | ||
|
||
<prestashop-accounts></prestashop-accounts> | ||
<br> | ||
<div id="prestashop-cloudsync"></div> | ||
|
||
<div id="ps-modal"></div> | ||
|
||
<br> | ||
|
||
<script src="{$urlAccountsCdn|escape:'htmlall':'UTF-8'}" rel=preload></script> | ||
<script src="{$urlCloudsync|escape:'htmlall':'UTF-8'}"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!-- Load cdc library --> | ||
<script src="https://assets.prestashop3.com/dst/mbo/v1/mbo-cdc-dependencies-resolver.umd.js"></script> | ||
|
||
<!-- cdc container --> | ||
<div id="cdc-container"></div> | ||
|
||
<script defer> | ||
const renderMboCdcDependencyResolver = window.mboCdcDependencyResolver.render | ||
const context = { | ||
...{$dependencies|json_encode}, | ||
onDependenciesResolved: () => location.reload(), | ||
onDependencyResolved: (dependencyData) => console.log('Dependency installed', dependencyData), // name, displayName, version | ||
onDependencyFailed: (dependencyData) => console.log('Failed to install dependency', dependencyData), | ||
onDependenciesFailed: () => console.log('There are some errors'), | ||
} | ||
renderMboCdcDependencyResolver(context, '#cdc-container') | ||
</script> |