diff --git a/CHANGELOG.md b/CHANGELOG.md index 1abb7720..2b4b43ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). -## Unreleased +## [3.3.1](https://github.com/packlink-dev/ecommerce_module_core/compare/v3.3.0...v3.3.1) - 2021-08-23 +**BREAKING CHANGES** +### Changed +- Updated order service to set shipment custom reference when creating a draft. +- Added additional statuses to shipment status mapper. +- Updated codebase to adhere to the Shopware coding standards. Integrations need to update all classes that extend from the Core `Singleton` class and implement create method that will return an instance of itself. ## [3.3.0](https://github.com/packlink-dev/ecommerce_module_core/compare/v3.2.2...v3.3.0) - 2021-07-06 **BREAKING CHANGES** diff --git a/src/BusinessLogic/Brand/DTO/BrandConfiguration.php b/src/BusinessLogic/Brand/DTO/BrandConfiguration.php index 4098f862..9f2d5a0d 100644 --- a/src/BusinessLogic/Brand/DTO/BrandConfiguration.php +++ b/src/BusinessLogic/Brand/DTO/BrandConfiguration.php @@ -71,7 +71,7 @@ public function toArray() */ public static function fromArray(array $data) { - $result = new static(); + $result = new self(); $result->platformCode = $data['platform_code']; $result->shippingServiceSource = $data['shipping_service_source']; diff --git a/src/BusinessLogic/Controllers/DTO/DashboardStatus.php b/src/BusinessLogic/Controllers/DTO/DashboardStatus.php index fcbbc3ce..7655d12e 100644 --- a/src/BusinessLogic/Controllers/DTO/DashboardStatus.php +++ b/src/BusinessLogic/Controllers/DTO/DashboardStatus.php @@ -54,4 +54,18 @@ class DashboardStatus extends FrontDto 'isWarehouseSet', 'isOrderStatusMappingsSet', ); + + /** + * Creates instance of this class. + * + * @param array $data + * + * @return static + * + * @noinspection PhpDocSignatureInspection + */ + public static function create(array $data) + { + return new self(); + } } diff --git a/src/BusinessLogic/Controllers/DTO/ModuleState.php b/src/BusinessLogic/Controllers/DTO/ModuleState.php index 32c3f0c6..d7158978 100644 --- a/src/BusinessLogic/Controllers/DTO/ModuleState.php +++ b/src/BusinessLogic/Controllers/DTO/ModuleState.php @@ -44,4 +44,18 @@ class ModuleState extends FrontDto protected static $fields = array( 'state', ); + + /** + * Creates instance of this class. + * + * @param array $data + * + * @return static + * + * @noinspection PhpDocSignatureInspection + */ + public static function create(array $data) + { + return new self(); + } } diff --git a/src/BusinessLogic/Controllers/DTO/OnboardingState.php b/src/BusinessLogic/Controllers/DTO/OnboardingState.php index c298865e..e1670773 100644 --- a/src/BusinessLogic/Controllers/DTO/OnboardingState.php +++ b/src/BusinessLogic/Controllers/DTO/OnboardingState.php @@ -33,4 +33,18 @@ class OnboardingState extends FrontDto protected static $fields = array( 'state', ); + + /** + * Creates instance of this class. + * + * @param array $data + * + * @return static + * + * @noinspection PhpDocSignatureInspection + */ + public static function create(array $data) + { + return new self(); + } } diff --git a/src/BusinessLogic/Controllers/DTO/RegistrationResponse.php b/src/BusinessLogic/Controllers/DTO/RegistrationResponse.php index d549f9a8..25bd8f69 100644 --- a/src/BusinessLogic/Controllers/DTO/RegistrationResponse.php +++ b/src/BusinessLogic/Controllers/DTO/RegistrationResponse.php @@ -54,4 +54,18 @@ class RegistrationResponse extends FrontDto 'termsAndConditionsUrl', 'privacyPolicyUrl', ); + + /** + * Creates instance of this class. + * + * @param array $data + * + * @return static + * + * @noinspection PhpDocSignatureInspection + */ + public static function create(array $data) + { + return new self(); + } } diff --git a/src/BusinessLogic/Controllers/DTO/ShippingMethodConfiguration.php b/src/BusinessLogic/Controllers/DTO/ShippingMethodConfiguration.php index 72760e38..c95e4e3c 100644 --- a/src/BusinessLogic/Controllers/DTO/ShippingMethodConfiguration.php +++ b/src/BusinessLogic/Controllers/DTO/ShippingMethodConfiguration.php @@ -121,7 +121,7 @@ public function toArray() */ public static function fromArray(array $raw) { - $result = new static(); + $result = new self(); $result->id = $raw['id']; $result->activated = (bool)static::getDataValue($raw, 'activated', false); diff --git a/src/BusinessLogic/Country/Country.php b/src/BusinessLogic/Country/Country.php index bc665244..4676c156 100644 --- a/src/BusinessLogic/Country/Country.php +++ b/src/BusinessLogic/Country/Country.php @@ -60,6 +60,20 @@ class Country extends FrontDto 'postal_code', ); + /** + * Creates instance of this class. + * + * @param array $data + * + * @return static + * + * @noinspection PhpDocSignatureInspection + */ + public static function create(array $data) + { + return new self(); + } + /** * Transforms raw array data to its DTO. * diff --git a/src/BusinessLogic/Country/CountryService.php b/src/BusinessLogic/Country/CountryService.php index c921c044..e7a22bb1 100644 --- a/src/BusinessLogic/Country/CountryService.php +++ b/src/BusinessLogic/Country/CountryService.php @@ -34,6 +34,18 @@ class CountryService extends BaseService */ protected $brandConfigurationService; + /** + * Creates instance of this class. + * + * @return static + * + * @noinspection PhpDocSignatureInspection + */ + public static function create() + { + return new self(); + } + /** * Returns a list of supported country DTOs. * diff --git a/src/BusinessLogic/Country/WarehouseCountryService.php b/src/BusinessLogic/Country/WarehouseCountryService.php index e71f25ec..cdb12889 100644 --- a/src/BusinessLogic/Country/WarehouseCountryService.php +++ b/src/BusinessLogic/Country/WarehouseCountryService.php @@ -23,6 +23,18 @@ class WarehouseCountryService extends CountryService */ protected static $instance; + /** + * Creates instance of this class. + * + * @return static + * + * @noinspection PhpDocSignatureInspection + */ + public static function create() + { + return new self(); + } + /** * Returns a list of supported country DTOs. * diff --git a/src/BusinessLogic/DTO/BaseDto.php b/src/BusinessLogic/DTO/BaseDto.php index 857fb5cc..14510487 100644 --- a/src/BusinessLogic/DTO/BaseDto.php +++ b/src/BusinessLogic/DTO/BaseDto.php @@ -29,9 +29,7 @@ abstract public function toArray(); */ public static function fromArray(array $raw) { - throw new \BadMethodCallException( - 'Method "fromArray" not implemented! Given array: ' . print_r($raw, true) - ); + return null; } /** diff --git a/src/BusinessLogic/DTO/FrontDto.php b/src/BusinessLogic/DTO/FrontDto.php index 785fea97..df052ceb 100644 --- a/src/BusinessLogic/DTO/FrontDto.php +++ b/src/BusinessLogic/DTO/FrontDto.php @@ -30,6 +30,20 @@ abstract class FrontDto extends DataTransferObject */ protected static $requiredFields = array(); + /** + * Creates instance of this class. + * + * @param array $data + * + * @return static + * + * @noinspection PhpDocSignatureInspection + */ + public static function create(array $data) + { + return null; + } + /** * Transforms raw array data to its DTO. * @@ -43,7 +57,7 @@ public static function fromArray(array $raw) { static::validate($raw); - $result = new static(); + $result = static::create($raw); foreach ($raw as $field => $value) { if (property_exists(static::CLASS_NAME, $field)) { $result->$field = $value; diff --git a/src/BusinessLogic/DTO/ValidationError.php b/src/BusinessLogic/DTO/ValidationError.php index f90c18d7..edc287bd 100644 --- a/src/BusinessLogic/DTO/ValidationError.php +++ b/src/BusinessLogic/DTO/ValidationError.php @@ -47,4 +47,18 @@ class ValidationError extends FrontDto * @var array */ protected static $fields = array('code', 'field', 'message'); + + /** + * Creates instance of this class. + * + * @param array $data + * + * @return static + * + * @noinspection PhpDocSignatureInspection + */ + public static function create(array $data) + { + return new self(); + } } diff --git a/src/BusinessLogic/Http/DTO/Package.php b/src/BusinessLogic/Http/DTO/Package.php index 6f06bebd..2d49ee4c 100644 --- a/src/BusinessLogic/Http/DTO/Package.php +++ b/src/BusinessLogic/Http/DTO/Package.php @@ -59,7 +59,7 @@ public function __construct($weight = 0.0, $width = 0.0, $height = 0.0, $length */ public static function defaultPackage() { - return new static(1, 10, 10, 10); + return new self(1, 10, 10, 10); } /** @@ -71,7 +71,7 @@ public static function defaultPackage() */ public static function fromArray(array $raw) { - $instance = new static(); + $instance = new self(); $instance->weight = static::getDataValue($raw, 'weight', 0.0); $instance->length = static::getDataValue($raw, 'length', 0.0); $instance->height = static::getDataValue($raw, 'height', 0.0); diff --git a/src/BusinessLogic/Http/DTO/ParcelInfo.php b/src/BusinessLogic/Http/DTO/ParcelInfo.php index 19e2ec15..856fb792 100644 --- a/src/BusinessLogic/Http/DTO/ParcelInfo.php +++ b/src/BusinessLogic/Http/DTO/ParcelInfo.php @@ -98,6 +98,20 @@ public static function defaultParcel() ); } + /** + * Creates instance of this class. + * + * @param array $data + * + * @return static + * + * @noinspection PhpDocSignatureInspection + */ + public static function create(array $data) + { + return new self(); + } + /** * Generates validation errors for the payload. * diff --git a/src/BusinessLogic/Http/DTO/PostalCode.php b/src/BusinessLogic/Http/DTO/PostalCode.php index 2a4bb9ff..968255bb 100644 --- a/src/BusinessLogic/Http/DTO/PostalCode.php +++ b/src/BusinessLogic/Http/DTO/PostalCode.php @@ -51,7 +51,7 @@ class PostalCode extends DataTransferObject */ public static function fromArray(array $raw) { - $instance = new static(); + $instance = new self(); $instance->zipcode = !empty($raw['zipcode']) ? $raw['zipcode'] : ''; $instance->city = !empty($raw['city']['name']) ? $raw['city']['name'] : ''; diff --git a/src/BusinessLogic/Http/DTO/PostalZone.php b/src/BusinessLogic/Http/DTO/PostalZone.php index 6923ba9b..e72dcc40 100644 --- a/src/BusinessLogic/Http/DTO/PostalZone.php +++ b/src/BusinessLogic/Http/DTO/PostalZone.php @@ -51,7 +51,7 @@ class PostalZone extends DataTransferObject */ public static function fromArray(array $raw) { - $instance = new static(); + $instance = new self(); $instance->id = static::getDataValue($raw, 'id'); $instance->name = static::getDataValue($raw, 'name'); diff --git a/src/BusinessLogic/Http/DTO/Shipment.php b/src/BusinessLogic/Http/DTO/Shipment.php index 25572c44..6db420d7 100644 --- a/src/BusinessLogic/Http/DTO/Shipment.php +++ b/src/BusinessLogic/Http/DTO/Shipment.php @@ -118,7 +118,7 @@ public function toArray() */ public static function fromArray(array $raw) { - $shipment = new static(); + $shipment = new self(); $date = static::getDataValue($raw, 'order_date'); if ($date) { $shipment->orderDate = \DateTime::createFromFormat('Y-m-d', $date); diff --git a/src/BusinessLogic/Http/DTO/ShipmentLabel.php b/src/BusinessLogic/Http/DTO/ShipmentLabel.php index 28e28969..b3f432b6 100644 --- a/src/BusinessLogic/Http/DTO/ShipmentLabel.php +++ b/src/BusinessLogic/Http/DTO/ShipmentLabel.php @@ -58,7 +58,7 @@ public function __construct($link, $printed = false, $createTimestamp = 0) */ public static function fromArray(array $batchRaw) { - return new static( + return new self( static::getDataValue($batchRaw, 'link'), static::getDataValue($batchRaw, 'printed', false), static::getDataValue($batchRaw, 'createTime', 0) diff --git a/src/BusinessLogic/Http/DTO/ShippingService.php b/src/BusinessLogic/Http/DTO/ShippingService.php index 5a9bafd7..c909a97b 100644 --- a/src/BusinessLogic/Http/DTO/ShippingService.php +++ b/src/BusinessLogic/Http/DTO/ShippingService.php @@ -89,7 +89,7 @@ public function toArray() */ public static function fromArray(array $raw) { - $instance = new static(); + $instance = new self(); $instance->id = (int)self::getDataValue($raw, 'service_id'); $instance->enabled = (bool)self::getDataValue($raw, 'enabled'); diff --git a/src/BusinessLogic/Http/DTO/ShippingServiceDetails.php b/src/BusinessLogic/Http/DTO/ShippingServiceDetails.php index 291d61c6..8d771e83 100644 --- a/src/BusinessLogic/Http/DTO/ShippingServiceDetails.php +++ b/src/BusinessLogic/Http/DTO/ShippingServiceDetails.php @@ -175,7 +175,7 @@ public function toArray() */ public static function fromArray(array $raw) { - $instance = new static(); + $instance = new self(); $instance->id = self::getDataValue($raw, 'id'); $instance->carrierName = self::getDataValue($raw, 'carrier_name'); diff --git a/src/BusinessLogic/Http/DTO/ShippingServiceSearch.php b/src/BusinessLogic/Http/DTO/ShippingServiceSearch.php index a3fd16f4..37a065b3 100644 --- a/src/BusinessLogic/Http/DTO/ShippingServiceSearch.php +++ b/src/BusinessLogic/Http/DTO/ShippingServiceSearch.php @@ -119,7 +119,7 @@ public function toArray() */ public static function fromArray(array $raw) { - $instance = new static(); + $instance = new self(); $instance->serviceId = self::getDataValue($raw, 'service_id', null); $instance->fromCountry = self::getDataValue($raw, 'from[country]'); diff --git a/src/BusinessLogic/Http/DTO/SystemInfo.php b/src/BusinessLogic/Http/DTO/SystemInfo.php index caf49d3a..0504ea9b 100644 --- a/src/BusinessLogic/Http/DTO/SystemInfo.php +++ b/src/BusinessLogic/Http/DTO/SystemInfo.php @@ -45,7 +45,7 @@ class SystemInfo extends DataTransferObject */ public static function fromArray(array $raw) { - $instance = new static(); + $instance = new self(); $instance->systemId = !empty($raw['system_id']) ? $raw['system_id'] : null; $instance->systemName = !empty($raw['system_name']) ? $raw['system_name'] : ''; diff --git a/src/BusinessLogic/Http/DTO/Tracking.php b/src/BusinessLogic/Http/DTO/Tracking.php index 10d7897d..3d2bf4f4 100644 --- a/src/BusinessLogic/Http/DTO/Tracking.php +++ b/src/BusinessLogic/Http/DTO/Tracking.php @@ -53,7 +53,7 @@ public function toArray() */ public static function fromArray(array $raw) { - $tracking = new static(); + $tracking = new self(); $tracking->timestamp = static::getDataValue($raw, 'timestamp'); $tracking->description = static::getDataValue($raw, 'description'); $tracking->city = static::getDataValue($raw, 'city'); diff --git a/src/BusinessLogic/Http/DTO/User.php b/src/BusinessLogic/Http/DTO/User.php index 0eb8e796..a2a6ce7f 100644 --- a/src/BusinessLogic/Http/DTO/User.php +++ b/src/BusinessLogic/Http/DTO/User.php @@ -60,7 +60,7 @@ public function toArray() */ public static function fromArray(array $raw) { - $user = new static(); + $user = new self(); $user->firstName = static::getDataValue($raw, 'name'); $user->lastName = static::getDataValue($raw, 'surname'); diff --git a/src/BusinessLogic/Location/LocationService.php b/src/BusinessLogic/Location/LocationService.php index 3609011d..a23e53f5 100644 --- a/src/BusinessLogic/Location/LocationService.php +++ b/src/BusinessLogic/Location/LocationService.php @@ -63,6 +63,18 @@ protected function __construct() $this->configuration = ServiceRegister::getService(Configuration::CLASS_NAME); } + /** + * Creates instance of this class. + * + * @return static + * + * @noinspection PhpDocSignatureInspection + */ + public static function create() + { + return new self(); + } + /** * Returns array of locations for this shipping method. * diff --git a/src/BusinessLogic/Order/Objects/TrackingHistory.php b/src/BusinessLogic/Order/Objects/TrackingHistory.php index 9121b966..7c398c23 100644 --- a/src/BusinessLogic/Order/Objects/TrackingHistory.php +++ b/src/BusinessLogic/Order/Objects/TrackingHistory.php @@ -37,7 +37,7 @@ class TrackingHistory */ public static function fromArray(array $raw) { - $result = new static(); + $result = new self(); $result->setCity($raw['city']); $result->setDescription($raw['description']); $result->setTimestamp($raw['timestamp']); diff --git a/src/BusinessLogic/Order/OrderService.php b/src/BusinessLogic/Order/OrderService.php index 2dd954ef..a52b9407 100644 --- a/src/BusinessLogic/Order/OrderService.php +++ b/src/BusinessLogic/Order/OrderService.php @@ -67,6 +67,18 @@ protected function __construct() $this->configuration = ServiceRegister::getService(Configuration::CLASS_NAME); } + /** + * Creates instance of this class. + * + * @return static + * + * @noinspection PhpDocSignatureInspection + */ + public static function create() + { + return new self(); + } + /** * Prepares shipment draft object for order with provided unique identifier. * @@ -235,6 +247,7 @@ public function isReadyToFetchShipmentLabels($status) array( ShipmentStatus::STATUS_READY, ShipmentStatus::STATUS_IN_TRANSIT, + ShipmentStatus::OUT_FOR_DELIVERY, ShipmentStatus::STATUS_DELIVERED, ), true @@ -254,6 +267,7 @@ public function isTrackingInfoUpdatable($status) ShipmentStatus::STATUS_ACCEPTED, ShipmentStatus::STATUS_READY, ShipmentStatus::STATUS_IN_TRANSIT, + ShipmentStatus::OUT_FOR_DELIVERY, ); return in_array(ShipmentStatus::getStatus($status), $allowedUpdateStatuses, true); @@ -275,6 +289,7 @@ private function convertOrderToDraftDto(Order $order) $draft->contentValue = $order->getTotalPrice(); $draft->priority = $order->isHighPriority(); $draft->source = $this->configuration->getDraftSource(); + $draft->shipmentCustomReference = $order->getId(); $this->addPackages($order, $draft); $methodId = $order->getShippingMethodId(); diff --git a/src/BusinessLogic/OrderShipmentDetails/Models/OrderShipmentDetails.php b/src/BusinessLogic/OrderShipmentDetails/Models/OrderShipmentDetails.php index 1b5fd498..c16a73a3 100644 --- a/src/BusinessLogic/OrderShipmentDetails/Models/OrderShipmentDetails.php +++ b/src/BusinessLogic/OrderShipmentDetails/Models/OrderShipmentDetails.php @@ -113,6 +113,20 @@ class OrderShipmentDetails extends Entity */ private $deleted = false; + /** + * Creates instance of this class. + * + * @param array $data + * + * @return static + * + * @noinspection PhpDocSignatureInspection + */ + public static function create(array $data) + { + return new self(); + } + /** * Returns entity configuration object. * diff --git a/src/BusinessLogic/OrderShipmentDetails/OrderShipmentDetailsService.php b/src/BusinessLogic/OrderShipmentDetails/OrderShipmentDetailsService.php index c300cf1b..26bae334 100644 --- a/src/BusinessLogic/OrderShipmentDetails/OrderShipmentDetailsService.php +++ b/src/BusinessLogic/OrderShipmentDetails/OrderShipmentDetailsService.php @@ -45,6 +45,18 @@ public function __construct() $this->repository = new OrderShipmentDetailsRepository(); } + /** + * Creates instance of this class. + * + * @return static + * + * @noinspection PhpDocSignatureInspection + */ + public static function create() + { + return new self(); + } + /** * Retrieves order shipment details. * diff --git a/src/BusinessLogic/Registration/RegistrationLegalPolicy.php b/src/BusinessLogic/Registration/RegistrationLegalPolicy.php index f0d72041..89722407 100644 --- a/src/BusinessLogic/Registration/RegistrationLegalPolicy.php +++ b/src/BusinessLogic/Registration/RegistrationLegalPolicy.php @@ -68,6 +68,20 @@ class RegistrationLegalPolicy extends FrontDto 'marketing_calls', ); + /** + * Creates instance of this class. + * + * @param array $data + * + * @return static + * + * @noinspection PhpDocSignatureInspection + */ + public static function create(array $data) + { + return new self(); + } + /** * Transforms raw array data to its DTO. * diff --git a/src/BusinessLogic/Registration/RegistrationRequest.php b/src/BusinessLogic/Registration/RegistrationRequest.php index 9805e1cd..2ab2de5d 100644 --- a/src/BusinessLogic/Registration/RegistrationRequest.php +++ b/src/BusinessLogic/Registration/RegistrationRequest.php @@ -164,6 +164,20 @@ class RegistrationRequest extends FrontDto 'UN', ); + /** + * Creates instance of this class. + * + * @param array $data + * + * @return static + * + * @noinspection PhpDocSignatureInspection + */ + public static function create(array $data) + { + return new self(); + } + /** * Transforms raw array data to its DTO. * diff --git a/src/BusinessLogic/Registration/RegistrationService.php b/src/BusinessLogic/Registration/RegistrationService.php index e999dc06..cca59843 100644 --- a/src/BusinessLogic/Registration/RegistrationService.php +++ b/src/BusinessLogic/Registration/RegistrationService.php @@ -26,6 +26,18 @@ class RegistrationService extends BaseService */ protected static $instance; + /** + * Creates instance of this class. + * + * @return static + * + * @noinspection PhpDocSignatureInspection + */ + public static function create() + { + return new self(); + } + /** * Registers a new user on Packlink PRO. * diff --git a/src/BusinessLogic/Resources/LocationPicker/css/locationPicker.css b/src/BusinessLogic/Resources/LocationPicker/css/locationPicker.css index b8eb0f1e..4fe73f3a 100644 --- a/src/BusinessLogic/Resources/LocationPicker/css/locationPicker.css +++ b/src/BusinessLogic/Resources/LocationPicker/css/locationPicker.css @@ -136,7 +136,9 @@ top: 16px; left: 15px; text-transform: uppercase; - font: bold 16px Roboto, Arial, sans-serif; + font-weight: bold; + font-size: 16px; + font-family: Roboto, Arial, sans-serif; color: #9b9b9b; pointer-events: none; white-space: nowrap; @@ -152,7 +154,9 @@ top: 12px; left: 15px; text-transform: uppercase; - font: bold 12px Roboto, Arial, sans-serif; + font-weight: bold; + font-size: 12px; + font-family: Roboto, Arial, sans-serif; color: #5d5d5d; pointer-events: none; transition: all .25s ease-in; @@ -184,6 +188,7 @@ white-space: nowrap; overflow: hidden; text-overflow: ellipsis; + pointer-events: none; } .lp-location-wrapper > *:not(.street) { @@ -199,10 +204,6 @@ width: 100%; } -.lp-location-wrapper > * { - pointer-events: none; -} - .lp-location-wrapper .excluded { pointer-events: all !important; } diff --git a/src/BusinessLogic/Resources/countries/de.json b/src/BusinessLogic/Resources/countries/de.json index 0a06c9b7..c98a92de 100644 --- a/src/BusinessLogic/Resources/countries/de.json +++ b/src/BusinessLogic/Resources/countries/de.json @@ -239,7 +239,8 @@ "selectCountriesHeader": "Länder, die von Ihrem
Versanddienst unterstützt werden", "selectCountriesSubheader": "Wählen Sie die Verfügbarkeit von mindestens einem Land aus und fügen Sie
beliebig viele hinzu", "discardChangesQuestion": "Es gibt nicht gespeicherte Änderungen.
Sind Sie sicher, dass Sie zurückgehen und sie verwerfen möchten?", - "atLeastOneCountry": "" + "atLeastOneCountry": "", + "misconfiguration": "Um Währungsänderungen zu speichern, müssen Sie einen Festpreiswert einstellen, indem Sie auf Versandservice \"Bearbeiten\" klicken." }, "orderListAndDetails": { "printed": "Ausgedruckt", diff --git a/src/BusinessLogic/Resources/countries/en.json b/src/BusinessLogic/Resources/countries/en.json index b5782c7b..1b64bb7c 100644 --- a/src/BusinessLogic/Resources/countries/en.json +++ b/src/BusinessLogic/Resources/countries/en.json @@ -157,7 +157,9 @@ "readyForShipping": "Ready for shipping", "inTransit": "In transit", "delivered": "Delivered", - "cancelled": "Canceled" + "cancelled": "Canceled", + "incident": "Incident", + "outForDelivery": "Out for delivery" }, "shippingServices": { "myServices": "My shipping services", @@ -240,7 +242,7 @@ "selectCountriesSubheader": "Select availability of at least one country and add
as many required", "discardChangesQuestion": "There are unsaved changes.
Are you sure you want to go back and discard them?", "atLeastOneCountry": "At least one country must be selected.", - "misconfiguration": "Service misconfiguration that can cause wrong service price is detected. Please check service configuration." + "misconfiguration": "Due to store currency change, you must set a Fixed Price value by clicking \"edit\" on the shipping service." }, "orderListAndDetails": { "printed": "Printed", diff --git a/src/BusinessLogic/Resources/countries/es.json b/src/BusinessLogic/Resources/countries/es.json index c79bf571..a7e3df64 100644 --- a/src/BusinessLogic/Resources/countries/es.json +++ b/src/BusinessLogic/Resources/countries/es.json @@ -239,7 +239,8 @@ "selectCountriesHeader": "Países permitidos para tu servicio
de envío", "selectCountriesSubheader": "Selecciona la disponibilidad de al menos un país y
añade tantos como necesites", "discardChangesQuestion": "Algunos cambios no se han guardado.
¿Estás seguro de que quieres volver e ignorar los cambios?", - "atLeastOneCountry": "" + "atLeastOneCountry": "", + "misconfiguration": "Debido al cambio de moneda de la tienda, debe establecer un valor de precio fijo haciendo clic en editar en el servicio de envío." }, "orderListAndDetails": { "printed": "Impreso", diff --git a/src/BusinessLogic/Resources/countries/fr.json b/src/BusinessLogic/Resources/countries/fr.json index a9584db6..c48abd1e 100644 --- a/src/BusinessLogic/Resources/countries/fr.json +++ b/src/BusinessLogic/Resources/countries/fr.json @@ -239,7 +239,8 @@ "selectCountriesHeader": "Pays pris en charge par votre
service d’expédition", "selectCountriesSubheader": "Sélectionnez la disponibilité d’au moins un pays et ajoutez-en
autant que nécessaire", "discardChangesQuestion": "Certaines modifications n’ont pas été enregistrées.
Êtes-vous sûr de vouloir revenir en arrière et de les ignorer ?", - "atLeastOneCountry": "" + "atLeastOneCountry": "", + "misconfiguration": "En raison du changement de devise en magasin, vous devez établir une valeur monétaire fixe en cliquant sur « Modifier » dans le service d’expédition." }, "orderListAndDetails": { "printed": "Imprimé", diff --git a/src/BusinessLogic/Resources/countries/it.json b/src/BusinessLogic/Resources/countries/it.json index 2f8c05e9..930f7104 100644 --- a/src/BusinessLogic/Resources/countries/it.json +++ b/src/BusinessLogic/Resources/countries/it.json @@ -239,7 +239,8 @@ "selectCountriesHeader": "Paesi supportati per il tuo
servizio di spedizione", "selectCountriesSubheader": "Seleziona la disponibilità di almeno un paese e aggiungi
tutti quelli richiesti", "discardChangesQuestion": "Alcune modifiche non sono state salvate.
Sei sicuro di voler tornare indietro e annullarle?", - "atLeastOneCountry": "" + "atLeastOneCountry": "", + "misconfiguration": "A causa del cambio di valuta del negozio, devi impostare un valore di prezzo fisso cliccando “Modifica” sul servizio di spedizione." }, "orderListAndDetails": { "printed": "Stampato", diff --git a/src/BusinessLogic/Resources/css/app.css b/src/BusinessLogic/Resources/css/app.css index ff5ac497..639b736e 100644 --- a/src/BusinessLogic/Resources/css/app.css +++ b/src/BusinessLogic/Resources/css/app.css @@ -402,7 +402,7 @@ min-width: 24px; margin: 0; } -#pl-page .pl-icon-button i { +#pl-page .pl-icon-button span { font-size: 20px; width: auto; color: #2095f2; @@ -413,7 +413,7 @@ #pl-page .pl-icon-button:hover { cursor: pointer; } -#pl-page .pl-icon-button:hover i { +#pl-page .pl-icon-button:hover span { color: #fff; } #pl-page section { @@ -449,9 +449,12 @@ } #pl-page .pl-button-group { flex-direction: row; + padding-right: 10px; } #pl-page .pl-button-group button { border-radius: 0; + height: 56px; + min-width: 110px; } #pl-page .pl-button-group button:first-child { border-radius: 4px 0 0 4px; @@ -511,7 +514,7 @@ #pl-page .pl-form-group select { -moz-padding-start: 11px; } -#pl-page .pl-form-group i { +#pl-page .pl-form-group span { position: absolute; right: 10px; top: 28px; @@ -520,7 +523,7 @@ width: 24px; height: 24px; } -#pl-page .pl-form-group select + i { +#pl-page .pl-form-group select + span { cursor: default; pointer-events: none; } @@ -569,7 +572,7 @@ color: #fff; content: '\2713'; margin: 0; - font: bold 20px/24px pl-proxima-nova; + font: bold 20px/24px pl-proxima-nova, sans-serif; width: 20px; min-width: 20px; height: 20px; @@ -602,7 +605,7 @@ #pl-page .pl-alert .pl-alert-text { color: inherit; } -#pl-page .pl-alert i { +#pl-page .pl-alert span { color: inherit; margin-left: 20px; } @@ -698,7 +701,7 @@ cursor: pointer; z-index: 1; } -#pl-page .pl-modal-mask .pl-modal .pl-modal-close-button i { +#pl-page .pl-modal-mask .pl-modal .pl-modal-close-button span { color: #2095f2; font-weight: bold; } @@ -742,7 +745,7 @@ #pl-page .pl-error input, #pl-page .pl-error select { border: 1px solid #e63f3f !important; } -#pl-page .pl-error label, #pl-page .pl-error i { +#pl-page .pl-error label, #pl-page .pl-error span { color: #e63f3f; } #pl-page .pl-error .pl-error-message { @@ -853,13 +856,6 @@ #pl-page .pl-shipping-services-list-item .pl-service-buttons .pl-button:not(.pl-hidden) + .pl-button { margin-left: 10px; } -#pl-page .pl-button-group { - padding-right: 10px; -} -#pl-page .pl-button-group button { - height: 56px; - min-width: 110px; -} #pl-page pre { white-space: normal; } @@ -912,10 +908,8 @@ padding: 10px; } } -@media (min-width: 769px) and (max-width: 1280px) { -} #pl-page .material-icons { - font-family: 'Material Icons Outlined'; + font-family: 'Material Icons Outlined', sans-serif; font-weight: normal; font-style: normal; font-size: 24px; @@ -944,7 +938,7 @@ align-items: center; padding-bottom: 20px; } -#pl-page .pl-onboarding-overview-list .pl-list-item i { +#pl-page .pl-onboarding-overview-list .pl-list-item span { margin-right: 10px; } #pl-page .pl-onboarding-overview-list .pl-list-item + .pl-list-item { @@ -1029,7 +1023,7 @@ margin-right: -20px; font-weight: bold; } -#pl-page .pl-configuration-menu i { +#pl-page .pl-configuration-menu span { margin-left: 10px; } #pl-page .pl-configuration-page { @@ -1279,5 +1273,3 @@ display: flex; } } -@media (min-width: 769px) and (max-width: 1280px) { -} diff --git a/src/BusinessLogic/Resources/js/DefaultWarehouseController.js b/src/BusinessLogic/Resources/js/DefaultWarehouseController.js index 18b33c4a..56fb6603 100644 --- a/src/BusinessLogic/Resources/js/DefaultWarehouseController.js +++ b/src/BusinessLogic/Resources/js/DefaultWarehouseController.js @@ -174,7 +174,7 @@ if (!window.Packlink) { } }, true); - postalCodeInput.parentElement.querySelector('i').addEventListener('click', (event) => { + postalCodeInput.parentElement.querySelector('span').addEventListener('click', (event) => { event.stopPropagation(); postalCodeInput.focus(); }); diff --git a/src/BusinessLogic/Resources/js/EditServiceController.js b/src/BusinessLogic/Resources/js/EditServiceController.js index c3c4338f..b1861e91 100644 --- a/src/BusinessLogic/Resources/js/EditServiceController.js +++ b/src/BusinessLogic/Resources/js/EditServiceController.js @@ -322,16 +322,20 @@ if (!window.Packlink) { } for (let systemId in pricePolicyControllers) { - let fieldName = pricePolicyControllers[systemId].getExcludedFieldForValidation(); - if (fieldName !== null) { - excludedElementNames.push(fieldName); + if (pricePolicyControllers.hasOwnProperty(systemId)) { + let fieldName = pricePolicyControllers[systemId].getExcludedFieldForValidation(); + if (fieldName !== null) { + excludedElementNames.push(fieldName); + } } } if (validationService.validateForm(form, excludedElementNames) && validateMiconfiguredPolicies()) { let pricingPolicies = []; for (let systemId in pricePolicyControllers) { - pricingPolicies = pricingPolicies.concat(pricePolicyControllers[systemId].getSystemPricingPolicies()); + if (pricePolicyControllers.hasOwnProperty(systemId)) { + pricingPolicies = pricingPolicies.concat(pricePolicyControllers[systemId].getSystemPricingPolicies()); + } } serviceModel.activated = true; diff --git a/src/BusinessLogic/Resources/js/OnboardingOverviewController.js b/src/BusinessLogic/Resources/js/OnboardingOverviewController.js index c66afbe7..cd1376a0 100644 --- a/src/BusinessLogic/Resources/js/OnboardingOverviewController.js +++ b/src/BusinessLogic/Resources/js/OnboardingOverviewController.js @@ -60,7 +60,7 @@ if (!window.Packlink) { } const populateSegment = (segment, data, editState, infoProvider) => { - const icon = segment.querySelector('i'); + const icon = segment.querySelector('span'); const button = segment.querySelector('button'); const details = segment.querySelector('.pl-item-details'); diff --git a/src/BusinessLogic/Resources/js/OrderStatusMappingController.js b/src/BusinessLogic/Resources/js/OrderStatusMappingController.js index def57b8b..eca79902 100644 --- a/src/BusinessLogic/Resources/js/OrderStatusMappingController.js +++ b/src/BusinessLogic/Resources/js/OrderStatusMappingController.js @@ -88,7 +88,9 @@ if (!window.Packlink) { mappings = response.mappings; for (const status in statuses) { - mappingsDiv.appendChild(injectStatus(status, statuses[status], mappings[status], response.orderStatuses)); + if (statuses.hasOwnProperty(status)) { + mappingsDiv.appendChild(injectStatus(status, statuses[status], mappings[status], response.orderStatuses)); + } } btn.addEventListener('click', saveOrderStatusMappings, true); diff --git a/src/BusinessLogic/Resources/scss/app.scss b/src/BusinessLogic/Resources/scss/app.scss index b780e9f9..3c76ea32 100644 --- a/src/BusinessLogic/Resources/scss/app.scss +++ b/src/BusinessLogic/Resources/scss/app.scss @@ -23,7 +23,7 @@ align-items: center; padding-bottom: 20px; - i { + span { margin-right: 10px; } @@ -128,7 +128,7 @@ margin-right: -20px; font-weight: bold; - i { + span { margin-left: 10px; } } @@ -464,10 +464,4 @@ } } } -} - -// tablet rules -@media (min-width: 769px) and (max-width: 1280px) { - #pl-page { - } } \ No newline at end of file diff --git a/src/BusinessLogic/Resources/scss/icons.scss b/src/BusinessLogic/Resources/scss/icons.scss index 25e42f64..59c266b8 100644 --- a/src/BusinessLogic/Resources/scss/icons.scss +++ b/src/BusinessLogic/Resources/scss/icons.scss @@ -2,7 +2,7 @@ //noinspection CssNoGenericFontName #pl-page .material-icons { - font-family: 'Material Icons Outlined'; + font-family: 'Material Icons Outlined', sans-serif; font-weight: normal; font-style: normal; font-size: 24px; diff --git a/src/BusinessLogic/Resources/scss/ui-controls.scss b/src/BusinessLogic/Resources/scss/ui-controls.scss index 7038927e..ceed7dc3 100644 --- a/src/BusinessLogic/Resources/scss/ui-controls.scss +++ b/src/BusinessLogic/Resources/scss/ui-controls.scss @@ -113,7 +113,7 @@ min-width: $icon-button-size; margin: 0; - i { + span { font-size: 20px; width: auto; color: $color-blue; @@ -126,7 +126,7 @@ &:hover { cursor: pointer; - i { + span { color: $color-white; } } @@ -173,9 +173,12 @@ .pl-button-group { flex-direction: row; + padding-right: 10px; button { border-radius: 0; + height: $input-height; + min-width: 110px; &:first-child { border-radius: 4px 0 0 4px; @@ -247,7 +250,7 @@ -moz-padding-start: 11px; } - i { + span { position: absolute; right: 10px; top: $input-height/2; @@ -257,7 +260,7 @@ height: $icon-button-size; } - select + i { + select + span { cursor: default; pointer-events: none; } @@ -313,7 +316,7 @@ color: $color-white; content: '\2713'; margin: 0; - font: bold 20px/24px pl-proxima-nova; + font: bold 20px/24px pl-proxima-nova, sans-serif; width: $checkbox-size; min-width: $checkbox-size; height: $checkbox-size; @@ -353,7 +356,7 @@ color: inherit; } - i { + span { color: inherit; margin-left: 20px; } @@ -466,7 +469,7 @@ cursor: pointer; z-index: 1; - i { + span { color: $color-blue; font-weight: bold; } @@ -523,7 +526,7 @@ border: 1px solid $color-red !important; } - label, i { + label, span { color: $color-red; } @@ -661,15 +664,6 @@ } } - .pl-button-group { - padding-right: 10px; - - button { - height: $input-height; - min-width: 110px; - } - } - pre { white-space: normal; } @@ -751,9 +745,3 @@ } } } - -// tablet rules -@media (min-width: 769px) and (max-width: 1280px) { - #pl-page { - } -} diff --git a/src/BusinessLogic/Resources/templates/configuration.html b/src/BusinessLogic/Resources/templates/configuration.html index 00657bb3..a7c9ac2f 100644 --- a/src/BusinessLogic/Resources/templates/configuration.html +++ b/src/BusinessLogic/Resources/templates/configuration.html @@ -2,17 +2,17 @@

{$configuration.menu}

- fact_check + fact_check
{$configuration.orderStatus}
- chevron_right + chevron_right
@@ -21,7 +21,7 @@

{$configuration.menu}

{$configuration.warehouse}
- chevron_right + chevron_right
{$configuration.menu}
{$configuration.parcel}
- chevron_right + chevron_right
diff --git a/src/BusinessLogic/Resources/templates/countries-selection-modal.html b/src/BusinessLogic/Resources/templates/countries-selection-modal.html index a7c267e4..b6f41e8f 100644 --- a/src/BusinessLogic/Resources/templates/countries-selection-modal.html +++ b/src/BusinessLogic/Resources/templates/countries-selection-modal.html @@ -5,7 +5,7 @@
{$shippingServices.atLeastOneCountry} - close + close
diff --git a/src/BusinessLogic/Resources/templates/default-parcel.html b/src/BusinessLogic/Resources/templates/default-parcel.html index f4ff6852..dea72c21 100644 --- a/src/BusinessLogic/Resources/templates/default-parcel.html +++ b/src/BusinessLogic/Resources/templates/default-parcel.html @@ -1,7 +1,7 @@

diff --git a/src/BusinessLogic/Resources/templates/default-warehouse.html b/src/BusinessLogic/Resources/templates/default-warehouse.html index 4899c44d..8b2ceee1 100644 --- a/src/BusinessLogic/Resources/templates/default-warehouse.html +++ b/src/BusinessLogic/Resources/templates/default-warehouse.html @@ -1,7 +1,7 @@

@@ -37,7 +37,7 @@

- expand_more + expand_more
@@ -46,7 +46,7 @@

data-required="true" autocomplete="no"/> - search + search

{$shippingServices.configureService}

@@ -34,7 +34,7 @@

{$shippingServices.configureService}

- expand_more + expand_more @@ -72,8 +72,8 @@

{$shippingServices.configureService}

{$shippingServices.configurePricePolicy}
- toggle_on - toggle_off + toggle_on + toggle_off
@@ -100,7 +100,7 @@

{$shippingServices.configureService}

- expand_more + expand_more diff --git a/src/BusinessLogic/Resources/templates/onboarding-overview.html b/src/BusinessLogic/Resources/templates/onboarding-overview.html index 01c226fe..bc845339 100644 --- a/src/BusinessLogic/Resources/templates/onboarding-overview.html +++ b/src/BusinessLogic/Resources/templates/onboarding-overview.html @@ -7,7 +7,7 @@

- check + check
{$onboardingOverview.parcelDetails}
@@ -19,7 +19,7 @@

- check + check
{$onboardingOverview.senderAddress}
diff --git a/src/BusinessLogic/Resources/templates/order-status-mapping.html b/src/BusinessLogic/Resources/templates/order-status-mapping.html index 4f46b3e5..850e0b79 100644 --- a/src/BusinessLogic/Resources/templates/order-status-mapping.html +++ b/src/BusinessLogic/Resources/templates/order-status-mapping.html @@ -1,7 +1,7 @@

{$orderStatusMapping.title}

@@ -32,11 +32,11 @@

{$orderStatusMapping.title}

- chevron_right + chevron_right
- expand_more + expand_more
\ No newline at end of file diff --git a/src/BusinessLogic/Resources/templates/pick-shipping-services.html b/src/BusinessLogic/Resources/templates/pick-shipping-services.html index 98b4ecbc..b762e1e3 100644 --- a/src/BusinessLogic/Resources/templates/pick-shipping-services.html +++ b/src/BusinessLogic/Resources/templates/pick-shipping-services.html @@ -1,12 +1,12 @@

{$shippingServices.pickShippingService}

diff --git a/src/BusinessLogic/Resources/templates/pricing-policy-modal.html b/src/BusinessLogic/Resources/templates/pricing-policy-modal.html index afb17037..15fb44b7 100644 --- a/src/BusinessLogic/Resources/templates/pricing-policy-modal.html +++ b/src/BusinessLogic/Resources/templates/pricing-policy-modal.html @@ -11,7 +11,7 @@ - expand_more + expand_more @@ -57,7 +57,7 @@ - expand_more + expand_more diff --git a/src/BusinessLogic/Resources/templates/register-modal.html b/src/BusinessLogic/Resources/templates/register-modal.html index e0cdf2ac..0d0ba103 100644 --- a/src/BusinessLogic/Resources/templates/register-modal.html +++ b/src/BusinessLogic/Resources/templates/register-modal.html @@ -1,7 +1,7 @@
- search + search