From 3bd2e304cd3b579e35aa5b4dadfdfe4465aafaf5 Mon Sep 17 00:00:00 2001 From: Thomas Peterson Date: Mon, 19 May 2025 15:57:51 +0200 Subject: [PATCH] fixes --- .../docker-compose.local.ci.yml | 3 -- .../docker-compose.local.dev.yml | 45 +++++++++++++++++++ .../docker-compose/docker-compose.local.yml | 36 +-------------- .docker/images/nginx/conf.d/default.conf | 6 +-- .gitignore | 1 + .make/04-docker.mk | 4 +- Makefile | 1 - .../PSC/Component/ApiBundle/Model/Shop.php | 11 ++--- .../Model/Order/Position/Price.php | 7 ++- .../Normalizer/SpecialProductDenormalizer.php | 2 +- .../scripts/100_basket_index.phtml | 4 +- .../scripts/101_basket_index.phtml | 4 +- .../scripts/106_basket_index.phtml | 4 +- 13 files changed, 70 insertions(+), 58 deletions(-) diff --git a/.docker/docker-compose/docker-compose.local.ci.yml b/.docker/docker-compose/docker-compose.local.ci.yml index f4350e3aa..7a7004b47 100644 --- a/.docker/docker-compose/docker-compose.local.ci.yml +++ b/.docker/docker-compose/docker-compose.local.ci.yml @@ -6,9 +6,6 @@ services: - ${APPLICATION_CODE_PATH_HOST?}:${APPLICATION_CODE_PATH_CONTAINER?} environment: - APP_ENV=test - php-cron: - environment: - - APP_ENV=test php-fpm: environment: - APP_ENV=test diff --git a/.docker/docker-compose/docker-compose.local.dev.yml b/.docker/docker-compose/docker-compose.local.dev.yml index 638d92567..ec07d2215 100644 --- a/.docker/docker-compose/docker-compose.local.dev.yml +++ b/.docker/docker-compose/docker-compose.local.dev.yml @@ -14,10 +14,55 @@ services: web: environment: - APP_ENV=dev + ports: + - "${NGINX_HOST_HTTP_PORT:-80}:80" + - "${NGINX_HOST_HTTPS_PORT:-443}:443" volumes: - ${APP_CODE_PATH_HOST?}:${APP_CODE_PATH_CONTAINER?} php-fpm: environment: - APP_ENV=dev + ports: + - "${APPLICATION_SSH_HOST_PORT:-2222}:22" + - "${APPLICATION_PANTHER_HOST_PORT:-9001}:9001" volumes: - ${APP_CODE_PATH_HOST?}:${APP_CODE_PATH_CONTAINER?} + + php-cron: + environment: + - PHP_IDE_CONFIG=${PHP_IDE_CONFIG?} + networks: + - network + cap_add: + - "SYS_PTRACE" + security_opt: + - "seccomp=unconfined" + extra_hosts: + - host.docker.internal:host-gateway + + chrome: + ports: + - "7900:7900" + - "4444:4444" + + smtp4dev: + ports: + # Change the number before : to the port the web interface should be accessible on + - '5000:80' + # Change the number before : to the port the SMTP server should be accessible on + - '25:25' + # Change the number before : to the port the IMAP server should be accessible on + - '143:143' + + webhook: + ports: + # Change the number before : to the port the IMAP server should be accessible on + - '5002:8080' + + mongodb: + ports: + - "127.0.0.1:27017:27017" + + mysql: + ports: + - "127.0.0.1:3306:3306" diff --git a/.docker/docker-compose/docker-compose.local.yml b/.docker/docker-compose/docker-compose.local.yml index 71731b5e5..e2d75622d 100644 --- a/.docker/docker-compose/docker-compose.local.yml +++ b/.docker/docker-compose/docker-compose.local.yml @@ -26,22 +26,7 @@ services: - network extra_hosts: - host.docker.internal:host-gateway - php-cron: - environment: - - PHP_IDE_CONFIG=${PHP_IDE_CONFIG?} - networks: - - network - cap_add: - - "SYS_PTRACE" - security_opt: - - "seccomp=unconfined" - extra_hosts: - - host.docker.internal:host-gateway - web: - ports: - - "${NGINX_HOST_HTTP_PORT:-80}:80" - - "${NGINX_HOST_HTTPS_PORT:-443}:443" networks: network: aliases: @@ -50,21 +35,11 @@ services: - php-fpm chrome: image: selenium/standalone-chromium:latest - ports: - - "7900:7900" - - "4444:4444" networks: - network smtp4dev: image: registry.thomas-peterson.de/smtp4dev:manifest-amd64 restart: always - ports: - # Change the number before : to the port the web interface should be accessible on - - '5000:80' - # Change the number before : to the port the SMTP server should be accessible on - - '25:25' - # Change the number before : to the port the IMAP server should be accessible on - - '143:143' environment: - ServerOptions__Urls=http://*:80 - ServerOptions__HostName=smtp4dev @@ -75,9 +50,6 @@ services: restart: always environment: - AUTO_CREATE_SESSIONS=true - ports: - # Change the number before : to the port the IMAP server should be accessible on - - '5002:8080' networks: - network application: @@ -100,9 +72,6 @@ services: - "SYS_PTRACE" security_opt: - "seccomp=unconfined" - ports: - - "${APPLICATION_SSH_HOST_PORT:-2222}:22" - - "${APPLICATION_PANTHER_HOST_PORT:-9001}:9001" tty: true networks: - network @@ -118,8 +87,6 @@ services: # - mongodb:/data/db networks: - network - ports: - - "127.0.0.1:27017:27017" mysql: image: mariadb:${MYSQL_VERSION?} environment: @@ -134,5 +101,4 @@ services: command: --sql_mode="ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" --character-set-server=utf8 --collation-server=utf8_slovenian_ci --innodb-flush-log-at-trx-commit=0 networks: - network - ports: - - "127.0.0.1:3306:3306" + diff --git a/.docker/images/nginx/conf.d/default.conf b/.docker/images/nginx/conf.d/default.conf index 914a4c63a..18217f15f 100644 --- a/.docker/images/nginx/conf.d/default.conf +++ b/.docker/images/nginx/conf.d/default.conf @@ -64,9 +64,9 @@ server { try_files $uri @sfFront; } - # location /w2p/ { - # proxy_pass http://tp:8080/w2p/; - # proxy_temp_path /tmp/proxy; + #location /w2p/ { + # proxy_pass http://tp:8080/w2p/; + # proxy_temp_path /tmp/proxy; #} location @sfFront { # Symfony diff --git a/.gitignore b/.gitignore index f25c61cb4..4ca25686f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ !.env.example .make/.env +.make/.env.test .docker/.env .idea /phpstorm.yml diff --git a/.make/04-docker.mk b/.make/04-docker.mk index 3874d5428..5ed8c415c 100644 --- a/.make/04-docker.mk +++ b/.make/04-docker.mk @@ -17,6 +17,7 @@ export DOCKER_BUILDKIT DOCKER_DIR:=./.docker DOCKER_ENV_FILE:=$(DOCKER_DIR)/.env +DOCKER_ENV_TEST_FILE:=$(DOCKER_DIR)/.env.test DOCKER_COMPOSE_DIR:=$(DOCKER_DIR)/docker-compose DOCKER_COMPOSE_FILE_LOCAL_CI_PROD:=$(DOCKER_COMPOSE_DIR)/docker-compose.local.ci.prod.yml DOCKER_COMPOSE_FILE_LOCAL_CI:=$(DOCKER_COMPOSE_DIR)/docker-compose.local.ci.yml @@ -32,6 +33,7 @@ ifeq ($(ENV),prod) DOCKER_COMPOSE_FILES:=-f $(DOCKER_COMPOSE_FILE_LOCAL_CI_PROD) -f $(DOCKER_COMPOSE_FILE_LOCAL_PROD) else ifeq ($(ENV),ci) DOCKER_COMPOSE_FILES:=-f $(DOCKER_COMPOSE_FILE_LOCAL_CI_PROD) -f $(DOCKER_COMPOSE_FILE_LOCAL_CI) -f $(DOCKER_COMPOSE_FILE_LOCAL_PROD) -f $(DOCKER_COMPOSE_FILE_LOCAL) + DOCKER_ENV_FILE:=$(DOCKER_ENV_TEST_FILE) else ifeq ($(ENV),local) DOCKER_COMPOSE_FILES:=-f $(DOCKER_COMPOSE_FILE_LOCAL_PROD) -f $(DOCKER_COMPOSE_FILE_LOCAL) -f $(DOCKER_COMPOSE_FILE_LOCAL_DEV) endif @@ -89,7 +91,7 @@ docker-compose-init: ## Initialize the .env file for docker compose .PHONY: docker-compose-init-test docker-compose-init-test: ## Initialize the .env file for docker compose - @cp $(DOCKER_ENV_FILE).test.example $(DOCKER_ENV_FILE) + @cp $(DOCKER_ENV_FILE).test.example $(DOCKER_ENV_TEST_FILE) .PHONY: docker-compose-clean docker-compose-clean: ## Remove the .env file for docker compose diff --git a/Makefile b/Makefile index 17bb2da1c..63b6e087f 100644 --- a/Makefile +++ b/Makefile @@ -46,7 +46,6 @@ include .make/variables.env -include .make/local.env # include the current environment settings -include .make/.env - # set default values for ENV and TAG to suppress "warning: undefined variable" when .make/.env does not exist yet ENV?= TAG?= diff --git a/src/new/src/PSC/Component/ApiBundle/Model/Shop.php b/src/new/src/PSC/Component/ApiBundle/Model/Shop.php index a7c0feb60..88b305eda 100755 --- a/src/new/src/PSC/Component/ApiBundle/Model/Shop.php +++ b/src/new/src/PSC/Component/ApiBundle/Model/Shop.php @@ -138,17 +138,14 @@ class Shop /** * @return bool */ - public function isDeleted(): bool + public function isDisabled(): bool { - return $this->deleted; + return $this->disabled; } - /** - * @param bool $deleted - */ - public function setDeleted(bool $deleted): void + public function setDisabled(bool $disabled): void { - $this->deleted = $deleted; + $this->disabled = $disabled; } /** diff --git a/src/new/src/PSC/Shop/OrderBundle/Model/Order/Position/Price.php b/src/new/src/PSC/Shop/OrderBundle/Model/Order/Position/Price.php index 3115dcf1a..d217c3c66 100755 --- a/src/new/src/PSC/Shop/OrderBundle/Model/Order/Position/Price.php +++ b/src/new/src/PSC/Shop/OrderBundle/Model/Order/Position/Price.php @@ -32,6 +32,11 @@ class Price #[OA\Property(type: 'integer')] private int $count = 1; + public function __construct() + { + $this->tax = new Tax(); + } + public function getNet(): int { return $this->net; @@ -113,4 +118,4 @@ class Price } -} \ No newline at end of file +} diff --git a/src/new/src/PSC/Shop/OrderBundle/Normalizer/SpecialProductDenormalizer.php b/src/new/src/PSC/Shop/OrderBundle/Normalizer/SpecialProductDenormalizer.php index e985285a7..79850a1ae 100755 --- a/src/new/src/PSC/Shop/OrderBundle/Normalizer/SpecialProductDenormalizer.php +++ b/src/new/src/PSC/Shop/OrderBundle/Normalizer/SpecialProductDenormalizer.php @@ -38,4 +38,4 @@ class SpecialProductDenormalizer implements DenormalizerInterface, DenormalizerA return $type == IProductTypeObject::class; } -} \ No newline at end of file +} diff --git a/src/old/application/design/vorlagen/bootstrap4_api/articletemplates/scripts/100_basket_index.phtml b/src/old/application/design/vorlagen/bootstrap4_api/articletemplates/scripts/100_basket_index.phtml index ce52a1cde..21420d8a6 100755 --- a/src/old/application/design/vorlagen/bootstrap4_api/articletemplates/scripts/100_basket_index.phtml +++ b/src/old/application/design/vorlagen/bootstrap4_api/articletemplates/scripts/100_basket_index.phtml @@ -51,13 +51,13 @@ $articleObj = new market_article(); - shop->basketposfield1 != ""): ?>shop->basketposfield1 ?> + shop->basketposfield1 != "" && !$this->finish): ?>shop->basketposfield1 ?>
- shop->basketposfield2 != ""): ?>shop->basketposfield2 ?> + shop->basketposfield2 != "" && !$this->finish): ?>shop->basketposfield2 ?>
diff --git a/src/old/application/design/vorlagen/bootstrap4_api/articletemplates/scripts/101_basket_index.phtml b/src/old/application/design/vorlagen/bootstrap4_api/articletemplates/scripts/101_basket_index.phtml index 863fa80da..d44248350 100755 --- a/src/old/application/design/vorlagen/bootstrap4_api/articletemplates/scripts/101_basket_index.phtml +++ b/src/old/application/design/vorlagen/bootstrap4_api/articletemplates/scripts/101_basket_index.phtml @@ -52,13 +52,13 @@ $articleObj = new market_article(); - shop->basketposfield1 != ""): ?>shop->basketposfield1 ?> + shop->basketposfield1 != "" && !$this->finish): ?>shop->basketposfield1 ?>
- shop->basketposfield2 != ""): ?>shop->basketposfield2 ?> + shop->basketposfield2 != "" && !$this->finish): ?>shop->basketposfield2 ?>
diff --git a/src/old/application/design/vorlagen/bootstrap4_api/articletemplates/scripts/106_basket_index.phtml b/src/old/application/design/vorlagen/bootstrap4_api/articletemplates/scripts/106_basket_index.phtml index c6691520b..d620ea1be 100755 --- a/src/old/application/design/vorlagen/bootstrap4_api/articletemplates/scripts/106_basket_index.phtml +++ b/src/old/application/design/vorlagen/bootstrap4_api/articletemplates/scripts/106_basket_index.phtml @@ -51,13 +51,13 @@ $articleObj = new market_article(); - shop->basketposfield1 != ""): ?>shop->basketposfield1 ?> + shop->basketposfield1 != "" && !$this->finish): ?>shop->basketposfield1 ?>
- shop->basketposfield2 != ""): ?>shop->basketposfield2 ?> + shop->basketposfield2 != "" && !$this->finish): ?>shop->basketposfield2 ?>