diff --git a/.docker/Dockerfile b/.docker/Dockerfile index ba5cd146df0db..5a6ebf84e7fc3 100644 --- a/.docker/Dockerfile +++ b/.docker/Dockerfile @@ -7,6 +7,7 @@ EXPOSE 443 ARG GROUP_ID ARG USER_ID +ARG NODE_VERSION RUN groupmod -g $GROUP_ID www-data \ && usermod -u $USER_ID -g $GROUP_ID www-data @@ -19,13 +20,19 @@ RUN chown -R www-data:www-data /var/www/.npm RUN mkdir -p /var/www/.composer RUN chown -R www-data:www-data /var/www/.composer -RUN curl -sL https://deb.nodesource.com/setup_16.x | bash - -RUN apt install -y nodejs +ENV NVM_DIR /usr/local/nvm +RUN mkdir -p $NVM_DIR \ + && curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash \ + && . $NVM_DIR/nvm.sh \ + && nvm install $NODE_VERSION \ + && nvm alias default $NODE_VERSION \ + && nvm use default + +ENV NODE_PATH $NVM_DIR/versions/node/v$NODE_VERSION/bin +ENV PATH $PATH:$NODE_PATH # Install mailutils to make sendmail work -RUN apt install -y \ - apt-utils \ - mailutils +RUN apt update && apt install -y mailutils RUN php -r "copy('https://getcomposer.org/installer', '/tmp/composer-setup.php');" && php /tmp/composer-setup.php --no-ansi --install-dir=/usr/local/bin --filename=composer && rm -rf /tmp/composer-setup.php CMD ["/tmp/docker_run_git.sh"] diff --git a/.env b/.env new file mode 100644 index 0000000000000..d868a08c56379 --- /dev/null +++ b/.env @@ -0,0 +1,5 @@ +# You can specify here some variables to use in PrestaShop application +# -> enable a feature flag: PS_FF_{FEATURE_FLAG_NAME}=true + +# Enable new Symfony based front container +PS_FF_FRONT_CONTAINER_V2=false diff --git a/.env.dist b/.env.dist new file mode 100644 index 0000000000000..31e6ca1b618ea --- /dev/null +++ b/.env.dist @@ -0,0 +1 @@ +PS_CONTAINER_V2_FRONT=false diff --git a/.github/ISSUE_TEMPLATE/1_bug_report.yml b/.github/ISSUE_TEMPLATE/1_bug_report.yml index b1ee9bad8c2e0..96c40fa8d2092 100644 --- a/.github/ISSUE_TEMPLATE/1_bug_report.yml +++ b/.github/ISSUE_TEMPLATE/1_bug_report.yml @@ -5,11 +5,12 @@ body: - type: markdown attributes: value: | - Thank you for taking the time to fill out this bug report. Please take the time to provide as much details as possible. Following our [bug report guidelines](https://devdocs.prestashop-project.org/8/contribute/contribute-reporting-issues/#best-practices-for-writing-an-issue) will help maintainers qualify your report faster. - - Reporting bugs with "error 500" or "white page" may not help us reproduce them. This is a universal error that hides what is underneath. Instead, enable debug mode in the Performance section of PrestaShop and try again. You should get a proper error message. - - 🇬🇧 Use English, reports in all other languages will be closed. + ### ❗️ Read this before submitting your bug report: + - **Write in English.** Reports in all other languages will be closed. + - **Provide as much detail as possible** - error logs, screenshots, your exact configuration. If the issue cannot be reproduced, it cannot be fixed. + - **Follow the [bug report guidelines](https://devdocs.prestashop-project.org/8/contribute/contribute-reporting-issues/#best-practices-for-writing-an-issue).** This will help issue managers qualify your report faster. + - **Avoid reporting "error 500" or "white page" errors** - this is a universal error message that does not provide enough information to qualify the issue. Enable debug mode in the Performance section of PrestaShop or manually in `/config/defines.inc.php` and try again. You should get a proper error message. + - If reporting a problem with the upgrade process, open `/admin/autoupgrade/tmp` and attach the last part of `log.txt` to the issue. It may contain information about the upgrade errors helpful in resolving the issue. Do not upload the entire `log.txt` as it contains sensitive data. - type: checkboxes attributes: label: Prerequisites @@ -22,7 +23,7 @@ body: id: what-happened attributes: label: Describe the bug and add attachments - description: What went wrong? If applicable, add screenshots, error logs or screen recordings to help explain your problem. + description: What went wrong? If possible, add screenshots, error logs or screen recordings to help explain your problem. validations: required: true - type: textarea diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 2edff94d1a418..51f219ab37b8e 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -12,13 +12,14 @@ https://devdocs.prestashop-project.org/8/contribute/contribution-guidelines/pull | Questions | Answers | ----------------- | ------------------------------------------------------- -| Branch? | develop / 8.1.x / 8.0.x / 1.7.8.x +| Branch? | develop / 8.1.x | Description? | Please be specific when describing the PR.
Every detail helps: versions, browser/server configuration, specific module/theme, etc. Feel free to add more information below this table. | Type? | bug fix / improvement / new feature / refacto | Category? | FO / BO / CO / IN / WS / TE / LO / ME / PM | BC breaks? | yes / no | Deprecations? | yes / no | How to test? | Indicate how to verify that this change works as expected. -| Fixed ticket? | Fixes #{issue number here}, Fixes #{another issue number here} +| UI Tests | Please run UI tests and paste here the link to the run. [Read this page to know why and how to use this tool.](https://devdocs.prestashop-project.org/8/contribute/contribution-guidelines/ui-tests/). +| Fixed issue or discussion? | Fixes #{issue number here}, Fixes #{another issue number here}, Fixes https://github.com/PrestaShop/PrestaShop/discussions/ {discussion number here} | Related PRs | If theme, autoupgrade or other module change is needed to make this change work, provide a link to related PRs here. | Sponsor company | Your company or customer's name goes here (if applicable). diff --git a/.github/workflows/cron_nightly_gcp.yml b/.github/workflows/cron_nightly_gcp.yml deleted file mode 100644 index 89bd52856f1ef..0000000000000 --- a/.github/workflows/cron_nightly_gcp.yml +++ /dev/null @@ -1,59 +0,0 @@ -# Nightly on GCP for 1.7.8.x (Deprecated if 1.7.8.x is not an active branch) -name: Nightly on 1.7.8.x - -on: - workflow_run: - workflows: [ 'Nightly Build' ] - types: - - requested - -permissions: - contents: read - -jobs: - nightly: - runs-on: ubuntu-latest - name: Nightly - strategy: - matrix: - include: - - branch: 1.7.8.x - instance: release - fail-fast: false - env: - GC_INSTANCE_NAME: ${{ secrets.GC_INSTANCE_NAME }} - GC_PROJECT_ID: ${{ secrets.GC_PROJECT_ID }} - GC_SERVICE_KEY: ${{ secrets.GC_SERVICE_KEY }} - GC_ZONE: ${{ secrets.GC_ZONE }} - GH_BRANCH: ${{ matrix.branch }} - INSTANCE_TYPE: ${{ matrix.instance }} - NIGHTLY_TOKEN: ${{ secrets.NIGHTLY_TOKEN }} - - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - ref: ${{ env.GH_BRANCH }} - - - name: Initialize GCloud Service Key - run: echo $GC_SERVICE_KEY > $HOME/gcloud-service-key.json - - - name: Auth Cloud Sdk - uses: google-github-actions/auth@v0 - with: - credentials_json: ${{ env.GC_SERVICE_KEY }} - project_id: ${{ env.GC_PROJECT_ID }} - - - name: Setup Cloud Sdk - uses: google-github-actions/setup-gcloud@v0 - - - name: Stop the instance if started - run: gcloud compute instances stop --zone $GC_ZONE "${GC_INSTANCE_NAME}-${INSTANCE_TYPE}" - - - name: Add metadata & Start instance - run: | - gcloud compute instances add-metadata "${GC_INSTANCE_NAME}-${INSTANCE_TYPE}" --zone $GC_ZONE --metadata=NIGHTLY_TOKEN=$NIGHTLY_TOKEN && \ - gcloud compute instances add-metadata "${GC_INSTANCE_NAME}-${INSTANCE_TYPE}" --zone $GC_ZONE --metadata=GH_BRANCH=$GH_BRANCH && \ - gcloud compute instances add-metadata "${GC_INSTANCE_NAME}-${INSTANCE_TYPE}" --zone $GC_ZONE --metadata-from-file startup-tests-script=tests/UI/scripts/run-nightly-tests.sh && \ - gcloud compute instances add-metadata "${GC_INSTANCE_NAME}-${INSTANCE_TYPE}" --zone $GC_ZONE --metadata-from-file startup-reports-script=tests/UI/scripts/run-nightly-reports.sh && \ - gcloud compute instances start --zone $GC_ZONE "${GC_INSTANCE_NAME}-${INSTANCE_TYPE}" diff --git a/.github/workflows/cron_nightly_tests_1.7.8.x.yml b/.github/workflows/cron_nightly_tests_1.7.8.x.yml new file mode 100644 index 0000000000000..2bb87c6426a46 --- /dev/null +++ b/.github/workflows/cron_nightly_tests_1.7.8.x.yml @@ -0,0 +1,19 @@ +# This workflow aim to run all UI tests on active branches +# and upload the report on Google cloud platform storage +name: Nightly tests and report - 1.7.8.x + +on: + workflow_run: + workflows: [ 'Nightly Build' ] + types: + - requested + +jobs: + test_1_7_8_x: + uses: ./.github/workflows/cron_nightly_tests_reusable.yml + with: + BRANCH: 1.7.8.x + secrets: + GC_PROJECT_ID: ${{ secrets.GC_PROJECT_ID }} + GC_SERVICE_KEY: ${{ secrets.GC_SERVICE_KEY }} + API_NIGHTLY_IMPORT_TOKEN: ${{ secrets.NIGHTLY_TOKEN }} diff --git a/.github/workflows/cron_nightly_tests_reusable.yml b/.github/workflows/cron_nightly_tests_reusable.yml index f5c59d831f80f..5284339a2612c 100644 --- a/.github/workflows/cron_nightly_tests_reusable.yml +++ b/.github/workflows/cron_nightly_tests_reusable.yml @@ -78,6 +78,7 @@ jobs: - 'functional:BO:shop-parameters:05-07' - 'functional:BO:advanced-parameters:01-06' - 'functional:BO:advanced-parameters:07-10' + - 'functional:BO:advanced-parameters:11-12' - 'functional:BO:header' - 'functional:FO:01-03' - 'functional:FO:04-07' @@ -92,9 +93,36 @@ jobs: - 'modules' - 'regression' exclude: + ## 1.7.8.x + - BRANCH: 1.7.8.x + CAMPAIGN: 'cldr' + - BRANCH: 1.7.8.x + CAMPAIGN: 'functional:BO:advanced-parameters:11-12' + - BRANCH: 1.7.8.x + CAMPAIGN: 'functional:BO:dashboard' + - BRANCH: 1.7.8.x + CAMPAIGN: 'functional:productV2' + - BRANCH: 1.7.8.x + CAMPAIGN: 'functional:API' + - BRANCH: 1.7.8.x + CAMPAIGN: 'functional:FO:classic:01-03' + - BRANCH: 1.7.8.x + CAMPAIGN: 'functional:FO:classic:04-07' + - BRANCH: 1.7.8.x + CAMPAIGN: 'functional:FO:classic:08-12' + - BRANCH: 1.7.8.x + CAMPAIGN: 'functional:FO:hummingbird:01-03' + - BRANCH: 1.7.8.x + CAMPAIGN: 'functional:WS' + - BRANCH: 1.7.8.x + CAMPAIGN: 'modules' + - BRANCH: 1.7.8.x + CAMPAIGN: 'sanity:productV2' ## 8.0.x - BRANCH: 8.0.x CAMPAIGN: 'cldr' + - BRANCH: 8.0.x + CAMPAIGN: 'functional:BO:advanced-parameters:11-12' - BRANCH: 8.0.x CAMPAIGN: 'functional:BO:dashboard' - BRANCH: 8.0.x @@ -114,6 +142,8 @@ jobs: - BRANCH: 8.0.x CAMPAIGN: 'modules' ## 8.1.x + - BRANCH: 8.1.x + CAMPAIGN: 'functional:BO:advanced-parameters:11-12' - BRANCH: 8.1.x CAMPAIGN: 'functional:FO:01-03' - BRANCH: 8.1.x @@ -127,6 +157,8 @@ jobs: CAMPAIGN: 'functional:FO:04-07' - BRANCH: develop CAMPAIGN: 'functional:FO:08-12' + - BRANCH: develop + CAMPAIGN: 'sanity:productV2' env: GH_BRANCH: ${{ matrix.BRANCH }} # Branch to test @@ -135,14 +167,14 @@ jobs: PS_LANGUAGE: 'en' PS_INSTALL_AUTO: 1 PS_DEV_MODE: 0 - PS_ENABLE_SSL: ${{ matrix.BRANCH == '8.0.x' && '0' || '1' }} - PS_DOMAIN: ${{ matrix.BRANCH == '8.0.x' && 'localhost:8001' || 'localhost:8002' }} + PS_ENABLE_SSL: ${{ ((matrix.BRANCH == '8.0.x') || (matrix.BRANCH == '1.7.8.x')) && '0' || '1' }} + PS_DOMAIN: ${{ ((matrix.BRANCH == '8.0.x') || (matrix.BRANCH == '1.7.8.x')) && 'localhost:8001' || 'localhost:8002' }} DB_SERVER: 'mysql' DB_NAME: 'prestashop' DB_PREFIX: 'tst_' DB_USER: 'root' DB_PASSWD: 'prestashop' - ADMIN_PASSWD: 'Correct Horse Battery Staple' + ADMIN_PASSWD: ${{ (matrix.BRANCH == '1.7.8.x') && 'prestashop_demo' || 'Correct Horse Battery Staple' }} steps: - uses: actions/checkout@v3 @@ -177,7 +209,7 @@ jobs: - name: Build and run shop with docker timeout-minutes: 15 env: - URL_FO: ${{ env.GH_BRANCH == '8.0.x' && 'http://localhost:8001/' || 'https://localhost:8002/' }} + URL_FO: ${{ ((env.GH_BRANCH == '8.0.x') || (env.GH_BRANCH == '1.7.8.x')) && 'http://localhost:8001/' || 'https://localhost:8002/' }} run: | USER_ID=$(id -u) GROUP_ID=$(id -g) \ docker-compose -f docker-compose.yml up -d --build @@ -192,13 +224,18 @@ jobs: working-directory: ${{ inputs.TESTS_DIR }} run: npm ci + - name: Install browsers + working-directory: ${{ inputs.TESTS_DIR }} + if: env.GH_BRANCH != '1.7.8.x' + run: npx playwright install --with-deps + # Run tests (if error, we continue for uploading report) - name: Run tests continue-on-error: true working-directory: ${{ inputs.TESTS_DIR }} env: - URL_FO: ${{ env.GH_BRANCH == '8.0.x' && 'http://localhost:8001/' || 'https://localhost:8002/' }} - ENABLE_SSL: true + URL_FO: ${{ ((env.GH_BRANCH == '8.0.x') || (env.GH_BRANCH == '1.7.8.x')) && 'http://localhost:8001/' || 'https://localhost:8002/' }} + ENABLE_SSL: ${{ ((matrix.BRANCH == '8.0.x') || (matrix.BRANCH == '1.7.8.x')) && false || true }} SMTP_SERVER: '172.17.0.1' run: npm run ${{ env.TEST_CAMPAIGN }} @@ -259,6 +296,11 @@ jobs: working-directory: ${{ inputs.TESTS_DIR }} run: npm ci + - name: Install browsers + working-directory: ${{ inputs.TESTS_DIR }} + if: env.GH_BRANCH != '1.7.8.x' + run: npx playwright install --with-deps + - name: Combine reports working-directory: ${{ inputs.TESTS_DIR }} env: diff --git a/.github/workflows/cron_php_update_modules.yml b/.github/workflows/cron_php_update_modules.yml index 9da4eda793961..98d4c5dab8967 100644 --- a/.github/workflows/cron_php_update_modules.yml +++ b/.github/workflows/cron_php_update_modules.yml @@ -20,7 +20,6 @@ jobs: BRANCH: - develop - 8.1.x - - 8.0.x env: GH_BRANCH: ${{ matrix.BRANCH }} diff --git a/.github/workflows/sanity-productV2.yml b/.github/workflows/sanity-productV2.yml deleted file mode 100644 index 095900282f713..0000000000000 --- a/.github/workflows/sanity-productV2.yml +++ /dev/null @@ -1,53 +0,0 @@ -name: UI tests Product V2 -on: - pull_request: - -concurrency: - group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true -jobs: - sanity_product_v2: - runs-on: ubuntu-latest - name: Sanity Product V2 - strategy: - matrix: - php: [ '8.1', '8.2' ] - fail-fast: false - steps: - - uses: actions/checkout@v3 - - - name: Setup environment - uses: ./.github/actions/setup-prestashop-env - with: - php-version: ${{ matrix.php }} - mysql-version: '5.7' - mysql-database: 'prestashop' - mysql-root-password: 'password' - node-version: '16' - npm-version: '7' - ps-auto-install: 'true' - ps-dev-mode: 'false' - github-token: ${{ secrets.GITHUB_TOKEN }} - - - name: Cache Playwright browsers - uses: actions/cache@v3 - with: - path: ~/.cache/ms-playwright/ - key: ${{ runner.os }}-browsers - - - name: Run tests - run: npm ci && npm run test:sanity:productV2:fast-fail - env: - URL_FO: https://localhost/ - DB_NAME: prestashop - DB_PASSWD: password - HEADLESS: true - ENABLE_SSL: true - TAKE_SCREENSHOT_AFTER_FAIL: true - working-directory: ./tests/UI - - - uses: actions/upload-artifact@v3 - if: ${{ always() }} - with: - name: screenshots-${{ matrix.php }} - path: ./tests/UI/screenshots/ diff --git a/.github/workflows/sanity.yml b/.github/workflows/sanity.yml index 16ee7f76c1975..15e9b36b6e7aa 100644 --- a/.github/workflows/sanity.yml +++ b/.github/workflows/sanity.yml @@ -40,8 +40,16 @@ jobs: run: mv .env.ci .env working-directory: ./tests/UI + - name: Install dependencies + working-directory: ./tests/UI + run: npm ci + + - name: Install browsers + working-directory: ./tests/UI + run: npx playwright install --with-deps + - name: Run tests - run: npm ci && npm run test:sanity:fast-fail + run: npm run test:sanity:fast-fail working-directory: ./tests/UI env: ENABLE_SSL: true diff --git a/.github/workflows/ui_tests_code_checks.yml b/.github/workflows/ui_tests_code_checks.yml index a5bc3fd11bc33..c9de7c39eef25 100644 --- a/.github/workflows/ui_tests_code_checks.yml +++ b/.github/workflows/ui_tests_code_checks.yml @@ -42,6 +42,9 @@ jobs: - name: Install dependencies in UI tests directory run: npm ci + - name: Install browsers + run: npx playwright install --with-deps + - name: Check eslint errors run: npm run lint @@ -64,9 +67,6 @@ jobs: with: node-version: ${{ env.NODE_VERSION }} - - name: Setup NPM - run: npm install -g npm@${{ env.NPM_VERSION }} - - name: Install dependencies in UI tests directory run: npm install @@ -95,6 +95,9 @@ jobs: - name: Install dependencies in UI tests directory run: npm ci + - name: Install browsers + run: npx playwright install --with-deps + - name: Generate mocha reports with failed steps run: GENERATE_FAILED_STEPS=true npm run test:all continue-on-error: true diff --git a/.gitignore b/.gitignore index beb018ee125af..9f381fc790847 100644 --- a/.gitignore +++ b/.gitignore @@ -122,6 +122,9 @@ tests-legacy/.phpunit.result.cache !/admin-dev/themes/new-theme/public/theme.rtlfix !/admin-dev/themes/default/public/theme.rtlfix +# Api platform assets +/admin-dev/bundles + themes/*/cache/* themes/core.js.map themes/core.js @@ -134,6 +137,10 @@ themes/*-chunk.js.map # Config +/.env +/.env.local +/.env.local.php +/.env.*.local config/defines_custom.inc.php config/settings.inc.php config/settings.old.php @@ -214,3 +221,8 @@ tools/build/releases/* # Docker configuration install.lock docker-compose.override.yml + +# DotEnv files +/.env.local +/.env.local.php +/.env.*.local diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index fa13540260fdf..75c893e96f79b 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -270,8 +270,10 @@ GitHub contributors: - Fabio Chelly - Fabio Vannini - Fabrice Pantanella +- fatm - Fatma BOUCHEKOI - Fatma Bouchekoua +- Fatima Mazhit - fchellypresta - Felipe Uribe - fetis @@ -677,6 +679,7 @@ GitHub contributors: - Petyuska - Philip Iezzi - PhpMadman +- PICHAT Morgan - Pierre - Pierre Avizou - Pierre Joube @@ -885,6 +888,7 @@ GitHub contributors: - tiledcode - timactive - timsit +- tleon - tmackay - TMMeilleur - tolispy diff --git a/Makefile b/Makefile index 390a039b38230..ab9255bb33e7b 100644 --- a/Makefile +++ b/Makefile @@ -1,41 +1,48 @@ -install: composer assets +help: ## Display this help menu + @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' -composer: +install: composer assets ## Install PHP dependencies and build the static assets + +composer: ## Install PHP dependencies composer install ./bin/console cache:clear --no-warmup -assets: +assets: ## Rebuilds all the static assets, running npm install-clean as needed ./tools/assets/build.sh -front-core: +front-core: ## Building core theme assets ./tools/assets/build.sh front-core -front-classic: +front-classic: ## Building classic theme assets ./tools/assets/build.sh front-classic -admin-default: +admin-default: ## Building admin default theme assets ./tools/assets/build.sh admin-default -admin-new-theme: +admin-new-theme: ## Building admin new theme assets ./tools/assets/build.sh admin-new-theme -admin: admin-default admin-new-theme +admin: admin-default admin-new-theme ## Building admin assets -front: front-core front-classic +front: front-core front-classic ## Building front assets -cs-fixer: +cs-fixer: ## Run php-cs-fixer ./vendor/bin/php-cs-fixer fix -phpstan: +phpstan: ## Run phpstan analysis ./vendor/bin/phpstan analyse -c phpstan.neon.dist -scss-fixer: +scss-fixer: ## Run scss-fix cd admin-dev/themes/new-theme && npm run scss-fix cd admin-dev/themes/default && npm run scss-fix cd themes/classic/_dev && npm run scss-fix -es-linter: +es-linter: ## Run lint-fix cd admin-dev/themes/new-theme && npm run lint-fix cd admin-dev/themes/default && npm run lint-fix cd themes/classic/_dev && npm run lint-fix cd themes && npm run lint-fix + +.PHONY: help install composer assets front-core front-classic admin-default admin-new-theme admin front cs-fixer phpstan scss-fixer es-linter + +.DEFAULT_GOAL := install diff --git a/admin-dev/index.php b/admin-dev/index.php index ca8ae91605d7b..ffaffbed3dcf9 100644 --- a/admin-dev/index.php +++ b/admin-dev/index.php @@ -24,6 +24,7 @@ * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) */ use PrestaShopBundle\Api\Api; +use Symfony\Component\Dotenv\Dotenv; use Symfony\Component\ErrorHandler\Debug; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\RequestStack; @@ -70,18 +71,25 @@ if (_PS_MODE_DEV_) { Debug::enable(); } -require_once __DIR__ . '/../app/AppKernel.php'; +require_once __DIR__ . '/../autoload.php'; -$kernel = new AppKernel(_PS_ENV_, _PS_MODE_DEV_); +// Loads .env file from the root of project +$dotEnvFile = dirname(__FILE__, 2) . '/.env'; +(new Dotenv()) + // DO NOT use putEnv + ->usePutenv(false) + ->loadEnv($dotEnvFile) +; + +$kernel = new AdminKernel(_PS_ENV_, _PS_MODE_DEV_); // When using the HttpCache, you need to call the method in your front controller instead of relying on the configuration parameter //Request::enableHttpMethodParameterOverride(); $request = Request::createFromGlobals(); Request::setTrustedProxies([], Request::HEADER_X_FORWARDED_ALL); -$catch = strpos($request->getRequestUri(), Api::API_BASE_PATH) !== false; +$catch = str_contains($request->getRequestUri(), Api::API_BASE_PATH); try { - require_once __DIR__ . '/../autoload.php'; $response = $kernel->handle($request, HttpKernelInterface::MAIN_REQUEST, $catch); $response->send(); $kernel->terminate($request, $response); diff --git a/admin-dev/themes/default/js/admin-theme.js b/admin-dev/themes/default/js/admin-theme.js index 1c087c4a41473..4c4b41b8479a6 100644 --- a/admin-dev/themes/default/js/admin-theme.js +++ b/admin-dev/themes/default/js/admin-theme.js @@ -338,7 +338,6 @@ $(() => { .removeClass('collapse') .addClass('submenu'); $('.shop-list-title').remove(); - $('.js-non-responsive').hide(); $('.mobile-layer') .addClass('d-none') .removeClass('expanded'); diff --git a/admin-dev/themes/default/js/bundle/admin_parameters/performancePageUI.js b/admin-dev/themes/default/js/bundle/admin_parameters/performancePageUI.js index b6a7dc1b68bd8..cdadd4b95870a 100644 --- a/admin-dev/themes/default/js/bundle/admin_parameters/performancePageUI.js +++ b/admin-dev/themes/default/js/bundle/admin_parameters/performancePageUI.js @@ -26,19 +26,16 @@ const PerformancePageUI = { displaySmartyCache() { const CACHE_ENABLED = '1'; const smartyCacheSelected = document.querySelector('input[name="smarty[cache]"]:checked'); - const smartyCacheOptions = document.querySelectorAll('.smarty-cache-option'); - - if (smartyCacheSelected && smartyCacheSelected.value === CACHE_ENABLED) { - for (let i = 0; i < smartyCacheOptions.length; i += 1) { - smartyCacheOptions[i].classList.remove('d-none'); - } - - return; - } - - for (let i = 0; i < smartyCacheOptions.length; i += 1) { - smartyCacheOptions[i].classList.add('d-none'); - } + document.querySelectorAll('.smarty-cache-option').forEach((element) => { + element.classList.toggle('d-none', smartyCacheSelected.value !== CACHE_ENABLED); + }); + }, + displayDebugModeOptions() { + const DEBUG_MODE_ON = '1'; + const debugModeOn = document.querySelector('input[name="debug_mode[debug_mode]"]:checked'); + document.querySelectorAll('.debug-mode-option').forEach((element) => { + element.classList.toggle('d-none', debugModeOn.value !== DEBUG_MODE_ON); + }); }, displayCacheSystems() { const CACHE_ENABLED = '1'; @@ -83,6 +80,7 @@ const PerformancePageUI = { */ window.addEventListener('load', () => { PerformancePageUI.displaySmartyCache(); + PerformancePageUI.displayDebugModeOptions(); PerformancePageUI.displayCacheSystems(); PerformancePageUI.displayMemcacheServers(); }); @@ -102,6 +100,9 @@ while (length--) { if (name === 'smarty[cache]') { return PerformancePageUI.displaySmartyCache(); } + if (name === 'debug_mode[debug_mode]') { + return PerformancePageUI.displayDebugModeOptions(); + } if (name === 'caching[caching_system]') { return PerformancePageUI.displayMemcacheServers(); } diff --git a/admin-dev/themes/default/js/bundle/product/form.js b/admin-dev/themes/default/js/bundle/product/form.js index 6367d776dd0ff..8d19eb3f01592 100644 --- a/admin-dev/themes/default/js/bundle/product/form.js +++ b/admin-dev/themes/default/js/bundle/product/form.js @@ -31,7 +31,6 @@ $(() => { formCategory.init(); stock.init(); supplier.init(); - warehouseCombinations.init(); customFieldCollection.init(); virtualProduct.init(); attachmentProduct.init(); @@ -543,22 +542,6 @@ window.stock = (function () { } }); - /** if GSA : Show depends_on_stock choice only if advanced_stock_management checked */ - $('#form_step3_advanced_stock_management').on('change', (e) => { - if (e.target.checked) { - $('#depends_on_stock_div').show(); - } else { - $('#depends_on_stock_div').hide(); - } - warehouseCombinations.refresh(); - }); - - /** if GSA activation change on 'depend on stock', update quantities fields */ - // eslint-disable-next-line - $('#form_step3_depends_on_stock_0, #form_step3_depends_on_stock_1, #form_step3_advanced_stock_management').on('change', (e) => { - displayFieldsManager.refresh(); - warehouseCombinations.refresh(); - }); displayFieldsManager.refresh(); }, }; @@ -588,63 +571,6 @@ window.nav = (function () { }; }()); -/** - * Warehouse combination collection management (ASM only) - */ -window.warehouseCombinations = (function () { - const idProduct = $('#form_id_product').val(); - const collectionHolder = $('#warehouse_combination_collection'); - - return { - init() { - // toggle all button action - $(document).on('click', 'div[id^="warehouse_combination_"] button.check_all_warehouse', function () { - const checkboxes = $(this).closest('div[id^="warehouse_combination_"]') - .find('input[type="checkbox"][id$="_activated"]'); - checkboxes.prop('checked', checkboxes.filter(':checked').length === 0); - }); - // location disablation depending on 'stored' checkbox - // eslint-disable-next-line - $(document).on('change', 'div[id^="warehouse_combination_"] input[id^="form_step4_warehouse_combination_"][id$="_activated"]', function () { - const checked = $(this).prop('checked'); - const location = $(this).closest('div.form-group') - .find('input[id^="form_step4_warehouse_combination_"][id$="_location"]'); - location.prop('disabled', !checked); - if (!checked) { - location.val(''); - } - }); - this.locationDisabler(); - }, - locationDisabler() { - // eslint-disable-next-line - $('div[id^="warehouse_combination_"] input[id^="form_step4_warehouse_combination_"][id$="_activated"]', collectionHolder).each(function () { - const checked = $(this).prop('checked'); - const location = $(this).closest('div.form-group') - .find('input[id^="form_step4_warehouse_combination_"][id$="_location"]'); - location.prop('disabled', !checked); - }); - }, - refresh() { - const show = $('input#form_step3_advanced_stock_management:checked').length > 0; - - if (show) { - const url = collectionHolder.attr('data-url').replace(/\/\d+(?=\?.*)/, `/${idProduct}`); - $.ajax({ - url, - success(response) { - collectionHolder.empty().append(response); - collectionHolder.show(); - warehouseCombinations.locationDisabler(); - }, - }); - } else { - collectionHolder.hide(); - } - }, - }; -}()); - /** * Form management */ diff --git a/admin-dev/themes/default/js/bundle/product/product-combinations.js b/admin-dev/themes/default/js/bundle/product/product-combinations.js index f3629600f84fb..e75a962ee8794 100644 --- a/admin-dev/themes/default/js/bundle/product/product-combinations.js +++ b/admin-dev/themes/default/js/bundle/product/product-combinations.js @@ -44,7 +44,6 @@ window.combinations = (function () { elem.removeAttr('disabled'); $('#create-combinations, #apply-on-combinations, #submit, .btn-submit').removeAttr('disabled'); supplierCombinations.refresh(); - warehouseCombinations.refresh(); if ($('.js-combinations-list .combination').length <= 0) { $('#combinations_thead').fadeOut(); } diff --git a/admin-dev/themes/default/scss/partials/_content.scss b/admin-dev/themes/default/scss/partials/_content.scss index d7b292cf3abc8..2bc096ec955cc 100644 --- a/admin-dev/themes/default/scss/partials/_content.scss +++ b/admin-dev/themes/default/scss/partials/_content.scss @@ -383,3 +383,17 @@ body.display-modal { } } } + +div[data-role="search-panels"] { + .panel { + a[target="_blank"]::after { + position: relative; + top: 2px; + left: 10px; + font-family: "Material Icons", sans-serif; + color: #bbcdd2; + content: "\e89e"; + opacity: 0.7; + } + } +} diff --git a/admin-dev/themes/default/scss/partials/_header.scss b/admin-dev/themes/default/scss/partials/_header.scss index e4c137cb61ce9..a4857dc9d6a6a 100644 --- a/admin-dev/themes/default/scss/partials/_header.scss +++ b/admin-dev/themes/default/scss/partials/_header.scss @@ -410,6 +410,15 @@ $search-border-color: #bbcdd2; } a { + &[target="_blank"]::after { + position: relative; + top: 2px; + font-family: "Material Icons", sans-serif; + color: #bbcdd2; + content: "\e89e"; + opacity: 0.7; + } + .material-icons { padding: 0; margin-right: 5px; diff --git a/admin-dev/themes/default/template/controllers/carts/helpers/view/view.tpl b/admin-dev/themes/default/template/controllers/carts/helpers/view/view.tpl deleted file mode 100755 index feb3b3446875d..0000000000000 --- a/admin-dev/themes/default/template/controllers/carts/helpers/view/view.tpl +++ /dev/null @@ -1,213 +0,0 @@ -{** - * Copyright since 2007 PrestaShop SA and Contributors - * PrestaShop is an International Registered Trademark & Property of PrestaShop SA - * - * NOTICE OF LICENSE - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.md. - * It is also available through the world-wide-web at this URL: - * https://opensource.org/licenses/OSL-3.0 - * 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 license@prestashop.com 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 https://devdocs.prestashop.com/ for more information. - * - * @author PrestaShop SA and Contributors - * @copyright Since 2007 PrestaShop SA and Contributors - * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) - *} - -{extends file="helpers/view/view.tpl"} - -{block name="override_tpl"} -
- {$kpi} -
-
-
-
-

{l s='Customer information' d='Admin.Orderscustomers.Feature'}

- {if $customer->id} - {$customer->email} -

- {if $customer->id_gender == 1} - - {elseif $customer->id_gender == 2} - - {else} - - {/if} - {$customer->firstname} {$customer->lastname}

-
-
- -

{dateFormat date=$customer->date_add}

-
-
- -

{$customer_stats.nb_orders}

-
-
- -

{displayWtPriceWithCurrency price=$customer_stats.total_orders currency=$currency}

-
-
- {else} -

{l s='Guest not registered' d='Admin.Orderscustomers.Feature'}

- {/if} -
-
-
-
-

{l s='Order information' d='Admin.Orderscustomers.Feature'}

- {if $order->id} -

{l s='Order #%d' sprintf=[$order->id|string_format:"%06d"] d='Admin.Orderscustomers.Feature'}

- {l s='Made on:' d='Admin.Orderscustomers.Feature'} {dateFormat date=$order->date_add} - {else} -

{l s='No order was created from this cart.' d='Admin.Orderscustomers.Feature'}

- {if $customer->id} - - {l s='Create an order from this cart.' d='Admin.Orderscustomers.Feature'} - - {/if} - {/if} -
-
-
-
-

{l s='Cart summary' d='Admin.Orderscustomers.Feature'}

-
- - - - - - - - - - - - - {foreach from=$products item='product'} - - - - - - - - - - {if $product['customizedDatas']} - {foreach $product['customizedDatas'] as $customizationPerAddress} - {foreach $customizationPerAddress as $customization} - - - - - - - - {/foreach} - {/foreach} - {/if} - {/foreach} - - - - - {if $total_discounts != 0} - - - - - {/if} - {if $total_wrapping > 0} - - - - - {/if} - {if $cart->getOrderTotal(true, Cart::ONLY_SHIPPING) > 0} - - - - - {/if} - - - - - -
 {l s='Product' d='Admin.Global'}{l s='Unit price' d='Admin.Global'}{l s='Quantity' d='Admin.Global'}{l s='Stock' d='Admin.Global'}{l s='Total' d='Admin.Global'}
{$product.image} - - {$product.name}{if isset($product.attributes)}
{$product.attributes}{/if}
- {if $product.reference}{l s='Ref:' d='Admin.Orderscustomers.Feature'} {$product.reference}{/if} - {if $product.reference && $product.supplier_reference} / {$product.supplier_reference}{/if} -
-
{displayWtPriceWithCurrency price=$product.product_price currency=$currency}{$product.cart_quantity}{$product.qty_in_stock}{displayWtPriceWithCurrency price=$product.product_total currency=$currency}
- {foreach from=$customization.datas key='type' item='datas'} - {if $type == constant('Product::CUSTOMIZE_FILE')} -
    - {foreach from=$datas key='index' item='data'} -
  • - - -
  • - {/foreach} -
- {elseif $type == constant('Product::CUSTOMIZE_TEXTFIELD')} -
- {foreach from=$datas key='index' item='data'} -
- {if $data.name}{$data.name}{else}{l s='Text #' d='Admin.Orderscustomers.Feature'}{$index}{/if} -
-

{$data.value}

-
-
- {/foreach} -
- {/if} - {/foreach} -
{l s='Total cost of products:' d='Admin.Orderscustomers.Feature'}{displayWtPriceWithCurrency price=$total_products currency=$currency}
{l s='Total value of vouchers:' d='Admin.Orderscustomers.Feature'}{displayWtPriceWithCurrency price=$total_discounts currency=$currency}
{l s='Total cost of gift wrapping:' d='Admin.Orderscustomers.Feature'}{displayWtPriceWithCurrency price=$total_wrapping currency=$currency}
{l s='Total shipping costs:' d='Admin.Orderscustomers.Feature'}{displayWtPriceWithCurrency price=$total_shipping currency=$currency}
{l s='Total' d='Admin.Global'}{displayWtPriceWithCurrency price=$total_price currency=$currency}
-
- {if $discounts} -
 
-
- - - - - - - - - - {foreach from=$discounts item='discount'} - - - - - - {/foreach} - -
{l s='Discounts' d='Admin.Global'}{l s='Discount name'}{l s='Value' d='Admin.Global'}
{$discount.id_discount}{$discount.name}{if (float)$discount.value_real == 0 && (int)$discount.free_shipping == 1}{l s='Free shipping' d='Admin.Shipping.Feature'}{else}- {displayWtPriceWithCurrency price=$discount.value_real currency=$currency}{/if}
-
- {/if} -
 
-
- {l s='For this particular customer group, prices are displayed as:' d='Admin.Orderscustomers.Notification'} {if $tax_calculation_method == $smarty.const.PS_TAX_EXC}{l s='Tax excluded' d='Admin.Global'}{else}{l s='Tax included' d='Admin.Global'}{/if} -
-
-{/block} diff --git a/admin-dev/themes/default/template/controllers/feature_value/helpers/index.php b/admin-dev/themes/default/template/controllers/feature_value/helpers/index.php deleted file mode 100644 index b459cc3ae5750..0000000000000 --- a/admin-dev/themes/default/template/controllers/feature_value/helpers/index.php +++ /dev/null @@ -1,35 +0,0 @@ - - * @copyright Since 2007 PrestaShop SA and Contributors - * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) - */ - -header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); -header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); - -header('Cache-Control: no-store, no-cache, must-revalidate'); -header('Cache-Control: post-check=0, pre-check=0', false); -header('Pragma: no-cache'); - -header('Location: ../../../../../../../'); -exit; diff --git a/admin-dev/themes/default/template/controllers/features/helpers/form/index.php b/admin-dev/themes/default/template/controllers/features/helpers/form/index.php deleted file mode 100644 index 3de54df1f73e7..0000000000000 --- a/admin-dev/themes/default/template/controllers/features/helpers/form/index.php +++ /dev/null @@ -1,35 +0,0 @@ - - * @copyright Since 2007 PrestaShop SA and Contributors - * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) - */ - -header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); -header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); - -header('Cache-Control: no-store, no-cache, must-revalidate'); -header('Cache-Control: post-check=0, pre-check=0', false); -header('Pragma: no-cache'); - -header('Location: ../../../../../../../../'); -exit; diff --git a/admin-dev/themes/default/template/controllers/features/helpers/index.php b/admin-dev/themes/default/template/controllers/features/helpers/index.php deleted file mode 100644 index b459cc3ae5750..0000000000000 --- a/admin-dev/themes/default/template/controllers/features/helpers/index.php +++ /dev/null @@ -1,35 +0,0 @@ - - * @copyright Since 2007 PrestaShop SA and Contributors - * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) - */ - -header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); -header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); - -header('Cache-Control: no-store, no-cache, must-revalidate'); -header('Cache-Control: post-check=0, pre-check=0', false); -header('Pragma: no-cache'); - -header('Location: ../../../../../../../'); -exit; diff --git a/admin-dev/themes/default/template/controllers/features/index.php b/admin-dev/themes/default/template/controllers/features/index.php deleted file mode 100644 index 6c011614e2845..0000000000000 --- a/admin-dev/themes/default/template/controllers/features/index.php +++ /dev/null @@ -1,35 +0,0 @@ - - * @copyright Since 2007 PrestaShop SA and Contributors - * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) - */ - -header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); -header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); - -header('Cache-Control: no-store, no-cache, must-revalidate'); -header('Cache-Control: post-check=0, pre-check=0', false); -header('Pragma: no-cache'); - -header('Location: ../../../../../../'); -exit; diff --git a/admin-dev/themes/default/template/controllers/search/helpers/view/view.tpl b/admin-dev/themes/default/template/controllers/search/helpers/view/view.tpl index 6bca9f03f123a..b78e726089712 100644 --- a/admin-dev/themes/default/template/controllers/search/helpers/view/view.tpl +++ b/admin-dev/themes/default/template/controllers/search/helpers/view/view.tpl @@ -155,7 +155,7 @@ $(function() {
{/foreach} diff --git a/admin-dev/themes/default/template/controllers/statuses/helpers/form/form.tpl b/admin-dev/themes/default/template/controllers/statuses/helpers/form/form.tpl deleted file mode 100644 index 552766a650ff5..0000000000000 --- a/admin-dev/themes/default/template/controllers/statuses/helpers/form/form.tpl +++ /dev/null @@ -1,117 +0,0 @@ -{** - * Copyright since 2007 PrestaShop SA and Contributors - * PrestaShop is an International Registered Trademark & Property of PrestaShop SA - * - * NOTICE OF LICENSE - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.md. - * It is also available through the world-wide-web at this URL: - * https://opensource.org/licenses/OSL-3.0 - * 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 license@prestashop.com 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 https://devdocs.prestashop.com/ for more information. - * - * @author PrestaShop SA and Contributors - * @copyright Since 2007 PrestaShop SA and Contributors - * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) - *} -{extends file="helpers/form/form.tpl"} - -{block name="label"} - {if $input.type == "select_template"} -
- {/if} - {$smarty.block.parent} -{/block} - -{block name="input"} - {if $input.type == "select_template"} -
-
- {foreach $languages as $language} - {assign var='value_text' value=$fields_value[$input.name][$language.id_lang]} -
-
- -
-
- - - -
-
- {/foreach} - {if isset($input.hint)} -
 
-
-
- {if is_array($input.hint)} - {foreach from=$input.hint item=hint} - {$hint}
- {/foreach} - {else} - {$input.hint} - {/if} -
-
- {/if} -
-
- - {else} - {$smarty.block.parent} - {/if} -{/block} - -{block name="field"} - {$smarty.block.parent} - {if $input.type == "select_template"} -
- {/if} -{/block} - -{block name="script"} - $(function() { - $('#send_email_on').on('click', function() { - $('#tpl').slideToggle(); - }); - }); -{/block} diff --git a/admin-dev/themes/default/template/controllers/statuses/helpers/form/index.php b/admin-dev/themes/default/template/controllers/statuses/helpers/form/index.php deleted file mode 100644 index 3de54df1f73e7..0000000000000 --- a/admin-dev/themes/default/template/controllers/statuses/helpers/form/index.php +++ /dev/null @@ -1,35 +0,0 @@ - - * @copyright Since 2007 PrestaShop SA and Contributors - * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) - */ - -header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); -header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); - -header('Cache-Control: no-store, no-cache, must-revalidate'); -header('Cache-Control: post-check=0, pre-check=0', false); -header('Pragma: no-cache'); - -header('Location: ../../../../../../../../'); -exit; diff --git a/admin-dev/themes/default/template/controllers/statuses/helpers/index.php b/admin-dev/themes/default/template/controllers/statuses/helpers/index.php deleted file mode 100644 index b459cc3ae5750..0000000000000 --- a/admin-dev/themes/default/template/controllers/statuses/helpers/index.php +++ /dev/null @@ -1,35 +0,0 @@ - - * @copyright Since 2007 PrestaShop SA and Contributors - * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) - */ - -header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); -header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); - -header('Cache-Control: no-store, no-cache, must-revalidate'); -header('Cache-Control: post-check=0, pre-check=0', false); -header('Pragma: no-cache'); - -header('Location: ../../../../../../../'); -exit; diff --git a/admin-dev/themes/default/template/header.tpl b/admin-dev/themes/default/template/header.tpl index ca246c4a5aacb..05fb1db57b1b1 100644 --- a/admin-dev/themes/default/template/header.tpl +++ b/admin-dev/themes/default/template/header.tpl @@ -238,7 +238,7 @@ {if isset($maintenance_mode) && $maintenance_mode == true} {capture name="title"} -

+

{l s='Your store is in maintenance mode.' d='Admin.Navigation.Notification'}

@@ -391,7 +391,7 @@ {foreach from=$displayBackOfficeEmployeeMenu item=$menuItem} {assign var=menuItemProperties value=$menuItem->getProperties()}

  • - + {if isset($menuItemProperties.icon)}{$menuItemProperties.icon} {/if}{$menuItem->getContent()}
  • diff --git a/admin-dev/themes/new-theme/.webpack/common.js b/admin-dev/themes/new-theme/.webpack/common.js index ac85cc159da6c..080c126d39822 100644 --- a/admin-dev/themes/new-theme/.webpack/common.js +++ b/admin-dev/themes/new-theme/.webpack/common.js @@ -44,6 +44,7 @@ module.exports = { attachment: './js/pages/attachment', attribute: './js/pages/attribute', attribute_group: './js/pages/attribute-group', + attribute_group_form: './js/pages/attribute-group/form', authorization_server: './js/pages/authorization-server', backup: './js/pages/backup', carrier: './js/pages/carrier', @@ -77,6 +78,8 @@ module.exports = { employee_form: './js/pages/employee/form', error: './js/pages/error', feature: './js/pages/feature', + feature_value: './js/pages/feature/feature-value', + feature_value_form: './js/pages/feature/feature-value/form', feature_flag: './js/pages/feature-flag/index', feature_form: './js/pages/feature/form', form_popover_error: './js/components/form/form-popover-error', @@ -422,6 +425,11 @@ module.exports = { templateContent: '{{{preloadLinks}}}', inject: false, }), + new HtmlWebpackPlugin({ + filename: 'preload.html.twig', + templateContent: '{{{preloadLinks}}}', + inject: false, + }), new webpack.DefinePlugin({ __VUE_OPTIONS_API__: true, __VUE_PROD_DEVTOOLS__: false, @@ -433,6 +441,13 @@ module.exports = { // eslint-disable-next-line replaceCallback: ({indexSource, linksAsString}) => indexSource.replace('{{{preloadLinks}}}', linksAsString.replace(/href="/g, 'href="{$admin_dir}')), }), + new FontPreloadPlugin({ + index: 'preload.html.twig', + extensions: ['woff2'], + filter: /preload/, + // eslint-disable-next-line + replaceCallback: ({indexSource, linksAsString}) => indexSource.replace('{{{preloadLinks}}}', linksAsString.replace(/href="/g, 'href="{{ admin_dir }}')), + }), new CssoWebpackPlugin({ forceMediaMerge: true, }), diff --git a/admin-dev/themes/new-theme/js/app/utils/colorpicker.js b/admin-dev/themes/new-theme/js/app/utils/colorpicker.js index 85750f5c008d2..23df24ea7d990 100644 --- a/admin-dev/themes/new-theme/js/app/utils/colorpicker.js +++ b/admin-dev/themes/new-theme/js/app/utils/colorpicker.js @@ -32,6 +32,12 @@ const {$} = window; const init = function initDatePickers() { $('.colorpicker input[type="text"]').each((i, picker) => { $(picker).colorpicker(); + $(picker).on('colorpickerCreate', () => { + $(picker).css('background-color', $(picker).val()); + }); + $(picker).on('colorpickerChange', (event) => { + $(picker).css('background-color', event.color.toString()); + }); }); }; diff --git a/admin-dev/themes/new-theme/js/app/widgets/ps-table/ps-sort.vue b/admin-dev/themes/new-theme/js/app/widgets/ps-table/ps-sort.vue index 5cb0f806c71f5..c05a0355ccca9 100644 --- a/admin-dev/themes/new-theme/js/app/widgets/ps-table/ps-sort.vue +++ b/admin-dev/themes/new-theme/js/app/widgets/ps-table/ps-sort.vue @@ -25,7 +25,7 @@