Skip to content

Commit

Permalink
Merge pull request #212 from PrestaShopCorp/v5
Browse files Browse the repository at this point in the history
V5
  • Loading branch information
hschoenenberger authored Sep 6, 2021
2 parents 8ef0878 + 2b6932d commit 39938a0
Show file tree
Hide file tree
Showing 91 changed files with 3,436 additions and 1,700 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/accounts-qc-php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ jobs:
NEON_FILE=${{steps.neon.outputs.filename}} \
make phpstan
phpunit:
name: PHPUNIT
runs-on: ubuntu-latest
Expand All @@ -84,7 +85,7 @@ jobs:
- name: Install dependencies
run: composer install

- name: PHPUnit PrestaShop latest
- name: PHPUnit tests
run: |
PS_VERSION="latest" make phpunit
Expand Down
38 changes: 20 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ clean:
git -c core.excludesfile=/dev/null clean -X -d -f

# target: bundle - Bundle local sources into a ZIP file
bundle: bundle-prod
bundle: bundle-inte bundle-prod

# target: zip - Alias of target: bundle
zip: bundle
Expand All @@ -43,24 +43,24 @@ version:

# target: bundle-prod - Bundle a production zip
bundle-prod: dist ./vendor ./views/index.php
rm -f .env
cd .. && zip -r ${PACKAGE}_prod.zip ${MODULE} -x '*.git*' \
${MODULE}/_dev/\* \
${MODULE}/dist/\* \
${MODULE}/composer.phar \
${MODULE}/Makefile
mv ../${PACKAGE}_prod.zip ./dist

# target: bundle-prod - Bundle an integration zip
bundle-inte: dist .env.inte ./vendor ./views/index.php
cp .env.inte .env
# target: bundle-inte - Bundle an integration zip
bundle-inte: dist ./vendor ./views/index.php
cp config/config.yml config/config.yml.local
cp config/config.preprod.yml config/config.yml
cd .. && zip -r ${PACKAGE}_inte.zip ${MODULE} -x '*.git*' \
${MODULE}/_dev/\* \
${MODULE}/dist/\* \
${MODULE}/composer.phar \
${MODULE}/Makefile
mv ../${PACKAGE}_inte.zip ./dist
rm -f .env
mv config/config.yml.local config/config.yml

# target: build - Setup PHP & Node.js locally
build: build-front build-back
Expand Down Expand Up @@ -111,25 +111,27 @@ endif
phpstan/phpstan:${PHPSTAN_VERSION} analyse \
--configuration=/web/module/tests/phpstan/${NEON_FILE}


# target: phpunit - Start phpunit
phpunit: vendor/phpunit/phpunit
ifndef DOCKER
$(error "DOCKER is unavailable on your system")
endif
docker pull phpunit/phpunit:${PHPUNIT_VERSION}
docker pull prestashop/prestashop:${PS_VERSION}
docker run --rm -d -v ps-volume:/var/www/html --entrypoint /bin/sleep --name test-phpunit prestashop/prestashop:${PS_VERSION} 2s
docker run --rm --volumes-from test-phpunit \
-v ${PWD}:/app:ro \
-v ${PWD}/vendor:/vendor:ro \
-e _PS_ROOT_DIR_=/var/www/html \
--workdir /app \
--entrypoint /vendor/phpunit/phpunit/phpunit \
phpunit/phpunit:${PHPUNIT_VERSION} \
--configuration ./phpunit.xml \
--bootstrap ./tests/bootstrap.php
docker run --rm -d -e PS_DOMAIN=localhost -e PS_ENABLE_SSL=0 -e PS_DEV_MODE=1 --name test-phpunit prestashop/docker-internal-images:1.7
docker container exec test-phpunit sh -c "rm -rf /var/www/html/modules/ps_accounts"
cp ./config/config.yml.dist ./config/config.yml
docker cp . test-phpunit:/var/www/html/modules/ps_accounts
docker container exec -u www-data test-phpunit sh -c "sleep 1 && ./bin/console prestashop:module install ps_accounts"
docker container exec -u www-data --workdir /var/www/html/modules/ps_accounts test-phpunit ./vendor/bin/phpunit
@echo phpunit passed

backup-config-yml:
@if [ -f ./config/config.yml ]; then mv ./config/config.yml ./config/.config.yml.bak; fi

phpunit-local: backup-config-yml phpunit
@if [ -f ./config/.config.yml.bak ]; then mv ./config/.config.yml.bak ./config/config.yml; fi
@docker container rm -f test-phpunit

vendor/phpunit/phpunit:
./composer.phar install

Expand Down
1 change: 1 addition & 0 deletions _dev/.eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
**/store-saga
**/utils
**/prestashop_accounts_vue_components
2 changes: 1 addition & 1 deletion _dev/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"moment": "^2.26.0",
"moment-range": "^4.0.2",
"prestakit": "^1.1.0",
"prestashop_accounts_vue_components": "^1.5.5",
"prestashop_accounts_vue_components": "^2.0.0",
"regenerator-runtime": "^0.13.5",
"tailwindcss": "^1.8.10",
"tween.js": "^16.6.0",
Expand Down
Binary file added _dev/src/assets/prestashop-logo-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed _dev/src/assets/prestashop-logo.png
Binary file not shown.
72 changes: 28 additions & 44 deletions _dev/src/core/app/components/panel/ConfigInformation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,14 @@
*-->
<template>
<b-container class="m-auto p-0" id="config-information">
<div class="d-flex">
<b-col sm="4" md="4" lg="4" class="p-16 m-auto text-center">
<img src="@/assets/prestashop-logo.png" width="300" />
<div class="d-flex col-left">
<b-col sm="4" md="4" lg="4" class="p-16 m-auto text-center d-flex">
<img src="@/assets/prestashop-logo-2.png" width="50" height="50" />
<h1><span class="white-text">Prestashop</span> Account</h1>
</b-col>

<b-col sm="8" md="8" lg="8" class="p-4">
<h1>{{ $t("configure.incentivePanel.title") }}</h1>
<section>
<div v-if="'settings' === app">
<h2>{{ $t("configure.incentivePanel.howTo") }}</h2>
<p>
<!--span class="material-icons">check_circle</span-->
{{ $t("configure.incentivePanel.createPsAccount") }}
</p>
<p>
<!--span class="material-icons">check_circle</span-->
{{ $t("configure.incentivePanel.linkPsAccount") }}
</p>
</div>
</section>
<b-col sm="8" md="8" lg="8" class="col-right py-5">
<h2>{{ $t("configure.incentivePanel.howTo") }}</h2>
</b-col>
</div>
</b-container>
Expand All @@ -58,37 +46,33 @@ export default {

<style lang="scss">
#config-information {
background-color: #fff;
background-color: #011638;
@apply rounded;

h1 {
font-size: 18px;
}
h2 {
font-size: 16px;
}
img {
max-width: 100%;
}
.material-icons {
color: #4cbb6c;
}
section {
margin-left: 30px;
ul {
padding-left: 15px;
color: #6c868e;
.col-left > .d-flex {
@apply items-center justify-start pl-16;

h1 {
font-size: 18px;
color: #6B868F;
@apply font-light my-0 mx-2;

li {
padding-left: 10px;
line-height: 26px;
span.white-text {
@apply text-white font-bold;
}
}
.dashboard-app {
text-align: center;

.btn-primary {
color: #fff !important;
}
img {
max-width: 100%;
}
}
div.col-right {
@apply flex justify-end pr-16;

h2 {
font-size: 22px;
max-width: 50%;
@apply text-white font-bold mb-0;
}
}
}
Expand Down
8 changes: 6 additions & 2 deletions _dev/src/core/settings/pages/OnBoardingApp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,17 @@
<script>
/* eslint-disable */
import ConfigInformation from "@/core/app/components/panel/ConfigInformation";
import { PsAccounts } from "prestashop_accounts_vue_components";
import { mapSagas } from "@/lib/store-saga";

let PsAccounts = window?.psaccountsVue?.PsAccounts;
if (!PsAccounts) {
PsAccounts = require('prestashop_accounts_vue_components').PsAccounts;
}

export default {
components: {
PsAccounts,
ConfigInformation,
PsAccounts,
},
methods: {
...mapSagas({
Expand Down
4 changes: 2 additions & 2 deletions _dev/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import store from "@/core/app/store";
import router from "@/core/app/router";
import StoreSaga from "@/lib/store-saga";
import AppContainer from "@/core/app/pages/AppContainer";
import psAccountsVueComponents from "prestashop_accounts_vue_components";
import VueCompositionAPI from "@vue/composition-api";
import "@/lib/error";
import "@/core/app/assets/_global.scss";
Expand All @@ -37,7 +36,6 @@ Vue.use(VueCompositionAPI);
Vue.use(Router);
Vue.use(BootstrapVue, BootstrapVueIcons);
Vue.use(VueCollapse);
Vue.use(psAccountsVueComponents, { locale: i18n.locale });
Vue.use(StoreSaga, { store });
// Vue.use(VueSegment, {
// id: "Vxk9VEvePTRlBmjkjzbUG6saW5yAmgb2",
Expand All @@ -50,6 +48,8 @@ Vue.config.productionTip = process.env.NODE_ENV === "production";
Vue.config.debug = process.env.NODE_ENV !== "production";
Vue.config.devtools = process.env.NODE_ENV !== "production";

window.Vue = Vue;

window.onload = () => {
new Vue({
router,
Expand Down
82 changes: 77 additions & 5 deletions _dev/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2006,6 +2006,15 @@ bcrypt-pbkdf@^1.0.0:
dependencies:
tweetnacl "^0.14.3"

belter@^1.0.123, belter@^1.0.41:
version "1.0.164"
resolved "https://registry.yarnpkg.com/belter/-/belter-1.0.164.tgz#3f0218f87ee5443c8b917a0e11bad4da5c15439f"
integrity sha512-aDRwk/yvRmesbEXixhbJ0kGeFmJth2kXZtqB8Dpk5xpfU79VPu+AX5DkE3b4Q6wCINNIetYhSZdSE255IKao2g==
dependencies:
cross-domain-safe-weakmap "^1"
cross-domain-utils "^2"
zalgo-promise "^1"

bfj@^6.1.1:
version "6.1.2"
resolved "https://registry.yarnpkg.com/bfj/-/bfj-6.1.2.tgz#325c861a822bcb358a41c78a33b8e6e2086dde7f"
Expand Down Expand Up @@ -2983,6 +2992,20 @@ create-hmac@^1.1.0, create-hmac@^1.1.4, create-hmac@^1.1.7:
safe-buffer "^5.0.1"
sha.js "^2.4.8"

cross-domain-safe-weakmap@^1, cross-domain-safe-weakmap@^1.0.1:
version "1.0.28"
resolved "https://registry.yarnpkg.com/cross-domain-safe-weakmap/-/cross-domain-safe-weakmap-1.0.28.tgz#d6c3c5af954340ce5f9d4ee5f3c38dba9513a165"
integrity sha512-gfQiQYSdWr9cYFVpmzp+b6MyTnefefDHr+fvm+JVv20hQxetV5J6chZOAusrpM/kFpTTbVDnHCziBFaREvgc0Q==
dependencies:
cross-domain-utils "^2.0.0"

cross-domain-utils@^2, cross-domain-utils@^2.0.0, cross-domain-utils@^2.0.33:
version "2.0.34"
resolved "https://registry.yarnpkg.com/cross-domain-utils/-/cross-domain-utils-2.0.34.tgz#3f8dc8d82a5434213787433f17b76f51c316e382"
integrity sha512-ke4PirGRXwEElEmE/7k5aCvCW+EqbgseT7AOObzFfaVnOLuEVN9SjVWoOfS/qAT0rDPn3ggmNDW6mguMBy4HgA==
dependencies:
zalgo-promise "^1.0.11"

cross-spawn@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-3.0.1.tgz#1256037ecb9f0c5f79e3d6ef135e30770184b982"
Expand Down Expand Up @@ -6121,6 +6144,11 @@ material-design-icons-iconfont@^5.0.1:
resolved "https://registry.yarnpkg.com/material-design-icons-iconfont/-/material-design-icons-iconfont-5.0.1.tgz#371875ed7fe9c8c520bc7123c3231feeab731c31"
integrity sha512-Xg6rIdGrfySTqiTZ6d+nQbcFepS6R4uKbJP0oAqyeZXJY/bX6mZDnOmmUJusqLXfhIwirs0c++a6JpqVa8RFvA==

material-design-icons-iconfont@^6.1.0:
version "6.1.0"
resolved "https://registry.yarnpkg.com/material-design-icons-iconfont/-/material-design-icons-iconfont-6.1.0.tgz#ffad21a71f2000336fd410cbeba36ddbf301f0f2"
integrity sha512-wRJtOo1v1ch+gN8PRsj0IGJznk+kQ8mz13ds/nuhLI+Qyf/931ZlRpd92oq0IRPpZIb+bhX8pRjzIVdcPDKmiQ==

md5.js@^1.3.4:
version "1.3.5"
resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f"
Expand Down Expand Up @@ -7268,6 +7296,17 @@ posix-character-classes@^0.1.0:
resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab"
integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=

post-robot@^10:
version "10.0.42"
resolved "https://registry.yarnpkg.com/post-robot/-/post-robot-10.0.42.tgz#0371d2147ba465271c7362c492e0b5b332850de5"
integrity sha512-fuIuJblIbiAUJVKvttYZ1ZABhvrtAJgxZZ/TsWzzAdQGzkXOaewwgvFiGOSZRr0DywRaQs0Wvgxa7bFCYh8pfg==
dependencies:
belter "^1.0.41"
cross-domain-safe-weakmap "^1.0.1"
cross-domain-utils "^2.0.0"
universal-serialize "^1.0.4"
zalgo-promise "^1.0.3"

postcss-calc@^7.0.1:
version "7.0.5"
resolved "https://registry.yarnpkg.com/postcss-calc/-/postcss-calc-7.0.5.tgz#f8a6e99f12e619c2ebc23cf6c486fdc15860933e"
Expand Down Expand Up @@ -7663,7 +7702,7 @@ prepend-http@^1.0.0:
resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc"
integrity sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=

prestakit@^1.1.0, prestakit@^1.2.1:
prestakit@^1.1.0:
version "1.2.1"
resolved "https://registry.yarnpkg.com/prestakit/-/prestakit-1.2.1.tgz#f7345396ef0f937fcf880caad6d08d4964f2dd89"
integrity sha512-lxVGZMEQ6U/sDgOmoDfWAa51u6pMCpACjA37ip48cSSqdxIA3hYR+0bJO/gIW1I0fgJ2rkjaAobplJc4wo7xag==
Expand All @@ -7675,10 +7714,22 @@ prestakit@^1.1.0, prestakit@^1.2.1:
select2 "^4.0.5"
select2-bootstrap-theme "0.1.0-beta.10"

prestashop_accounts_vue_components@^1.5.5:
version "1.5.5"
resolved "https://registry.yarnpkg.com/prestashop_accounts_vue_components/-/prestashop_accounts_vue_components-1.5.5.tgz#c4835a9ef74b0367770fcaae0b3800c82385b37a"
integrity sha512-UJzjmXapeKdL7Je6O3z2Jyh2AfnOFifMGUeQzilCXm3uCT4mpe7MGKvgRCp+IQdTPceJBy+BqE9+ZaF8Snc6Ag==
prestakit@^1.2.1:
version "1.2.3"
resolved "https://registry.yarnpkg.com/prestakit/-/prestakit-1.2.3.tgz#c00a5c8557c640d96c552da0bba0de3c1aece835"
integrity sha512-OSEfaEvcvckXF8puDwIB9qVuLvljHs9yH/D3vt/Wsj5qqJ/afaGZ7sXz0cBtFvrTrtU01vfKo7U04JW3FM0kBg==
dependencies:
bootstrap "^4.4.1"
jquery.growl "^1.3.5"
material-design-icons-iconfont "^6.1.0"
open-sans-fonts "^1.6.2"
select2 "^4.0.5"
select2-bootstrap-theme "0.1.0-beta.10"

prestashop_accounts_vue_components@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/prestashop_accounts_vue_components/-/prestashop_accounts_vue_components-2.0.0.tgz#557c6be552c7b0f62652f1f26a66982029bc345f"
integrity sha512-eqkZpIS/gE/evIoY+MRwKxocDhMWk8RQchnaDMA05DhtLJPvCQOqeL1gnoskhIpwHEBaXfO1fmicbyH22y67Cw==
dependencies:
"@hapi/joi" "^17.1.1"
"@prestashopcorp/segment-vue" "^1.2.10"
Expand All @@ -7691,6 +7742,7 @@ prestashop_accounts_vue_components@^1.5.5:
react-is "^16.13.1"
v-click-outside "^3.1.2"
vue "^2.6.11"
zoid "^9.0.63"

prettier-linter-helpers@^1.0.0:
version "1.0.0"
Expand Down Expand Up @@ -9420,6 +9472,11 @@ unique-slug@^2.0.0:
dependencies:
imurmurhash "^0.1.4"

universal-serialize@^1.0.4:
version "1.0.8"
resolved "https://registry.yarnpkg.com/universal-serialize/-/universal-serialize-1.0.8.tgz#93470f043a9ed30094104824c02d21f607b61e6a"
integrity sha512-AhC3D26asmMkxAadYjCUJh98AUV/Fpp9uStVz4OuigpaGqIwY+i95EWE392P+4ObOPFHw8TUk/GazyiSGDtxhA==

universalify@^0.1.0:
version "0.1.2"
resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66"
Expand Down Expand Up @@ -10031,3 +10088,18 @@ yorkie@^2.0.0:
is-ci "^1.0.10"
normalize-path "^1.0.0"
strip-indent "^2.0.0"

zalgo-promise@^1, zalgo-promise@^1.0.11, zalgo-promise@^1.0.3, zalgo-promise@^1.0.45:
version "1.0.46"
resolved "https://registry.yarnpkg.com/zalgo-promise/-/zalgo-promise-1.0.46.tgz#325988d75d0be4cd63a266bad5e18f8f6cd85675"
integrity sha512-tzPpQRqaQQavxl17TY98nznvmr+judUg3My7ugsUcRDbdqisYOE2z79HNNDgXnyX3eA0mf2bMOJrqHptt00npg==

zoid@^9.0.63:
version "9.0.63"
resolved "https://registry.yarnpkg.com/zoid/-/zoid-9.0.63.tgz#87ca9585c11788a33db4de6a515cef8a02faf63c"
integrity sha512-c9OccNUlOV9KuTKJJRhCU3B5SRHObTTiPAUayKkBQ0/qZugfh59MDW+zkFDR8IZN+c7NB/R90FCIpAfBp8+U/g==
dependencies:
belter "^1.0.123"
cross-domain-utils "^2.0.33"
post-robot "^10"
zalgo-promise "^1.0.45"
Loading

0 comments on commit 39938a0

Please sign in to comment.