Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
# Conflicts:
#	Test/Unit/Block/Adminhtml/Config/Support/TabTest.php
#	etc/config.xml
  • Loading branch information
TIG-Lucas-Hoeffnagel committed Nov 4, 2021
2 parents 520b37e + f229d0c commit 19227e3
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 31 deletions.
4 changes: 2 additions & 2 deletions Test/Unit/Block/Adminhtml/Config/Support/TabTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function testGetSupportedMagentoVersions()
'moduleConfiguration' => $this->getConfigurationMock()
]);

$this->assertSame('2.3.7-p1, 2.4.3', $instance->getSupportedMagentoVersions());
$this->assertSame('2.3.7, 2.4.3', $instance->getSupportedMagentoVersions());
}

/**+
Expand All @@ -62,7 +62,7 @@ private function getConfigurationMock()
$mock = $this->getFakeMock(ModuleConfiguration::class)->getMock();
$mockExpects = $mock->expects($this->once());
$mockExpects->method('getSupportedMagentoVersions');
$mockExpects->willReturn('2.3.7-p1, 2.4.3');
$mockExpects->willReturn('2.3.7, 2.4.3');

return $mock;
}
Expand Down
2 changes: 1 addition & 1 deletion etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
<default>
<tig_postcode>
<supported_magento_version>2.3.7-p1, 2.4.3</supported_magento_version>
<supported_magento_version>2.3.7, 2.4.3</supported_magento_version>
<stability/>
<configuration>
<modus>0</modus>
Expand Down
6 changes: 3 additions & 3 deletions view/frontend/web/js/view/billing-address-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ define([
return function (Component) {
return Component.extend({
tigHouseNumber: function () {
if (quote.billingAddress().customAttributes.length > 0) {
var customAttributes = quote.billingAddress().customAttributes;

if (customAttributes && customAttributes.length > 0) {
var houseNumber = "";
var houseNumberAddition = "";

var customAttributes = quote.billingAddress().customAttributes;

// check if custom attribute exists and is not empty
customAttributes.forEach(function (attribute) {
if (attribute.attribute_code === "tig_housenumber" && attribute.value !== "") {
Expand Down
39 changes: 18 additions & 21 deletions view/frontend/web/js/view/form/fields.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,33 +97,30 @@ define([
if (typeof options.data === "string") {
var data = $.parseJSON(options.data);

// Handle Magento inconsistencies
var customAttributes = 'custom_attributes';
if (data != null) {
// Handle Magento inconsistencies
var customAttributes = 'custom_attributes';

if (!_.isUndefined(data.address) && !_.isUndefined(data.address[customAttributes])) {
data.address = this.addToAddress(data.address, customAttributes);
}
if (!_.isUndefined(data.address) && !_.isUndefined(data.address[customAttributes])) {
data.address = this.addToAddress(data.address, customAttributes);
}

customAttributes = 'customAttributes';
customAttributes = 'customAttributes';

if (!_.isUndefined(data.addressInformation) && data.addressInformation &&
!_.isUndefined(data.addressInformation.shipping_address) &&
!_.isUndefined(data.addressInformation.shipping_address[customAttributes])) {
data.addressInformation.shipping_address = this.addToAddress(data.addressInformation.shipping_address, customAttributes);
}
if (!_.isUndefined(data.addressInformation) && data.addressInformation && !_.isUndefined(data.addressInformation.shipping_address) && !_.isUndefined(data.addressInformation.shipping_address[customAttributes])) {
data.addressInformation.shipping_address = this.addToAddress(data.addressInformation.shipping_address, customAttributes);
}

if (!_.isUndefined(data.addressInformation) && data.addressInformation &&
!_.isUndefined(data.addressInformation.billing_address) &&
!_.isUndefined(data.addressInformation.billing_address[customAttributes])) {
data.addressInformation.billing_address = this.addToAddress(data.addressInformation.billing_address, customAttributes);
}
if (!_.isUndefined(data.addressInformation) && data.addressInformation && !_.isUndefined(data.addressInformation.billing_address) && !_.isUndefined(data.addressInformation.billing_address[customAttributes])) {
data.addressInformation.billing_address = this.addToAddress(data.addressInformation.billing_address, customAttributes);
}

if (!_.isUndefined(data.billingAddress) && data.billingAddress &&
!_.isUndefined(data.billingAddress[customAttributes])) {
data.billingAddress = this.addToAddress(data.billingAddress, customAttributes);
}
if (!_.isUndefined(data.billingAddress) && data.billingAddress && !_.isUndefined(data.billingAddress[customAttributes])) {
data.billingAddress = this.addToAddress(data.billingAddress, customAttributes);
}

return JSON.stringify(data);
return JSON.stringify(data);
}
}
},

Expand Down
2 changes: 1 addition & 1 deletion view/frontend/web/template/billing-address/details.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<div if="isAddressDetailsVisible() && currentBillingAddress()" class="billing-address-details">
<text args="currentBillingAddress().prefix"/> <text args="currentBillingAddress().firstname"/> <text args="currentBillingAddress().middlename"/>
<text args="currentBillingAddress().lastname"/> <text args="currentBillingAddress().suffix"/><br/>
<text args="currentBillingAddress().street.join(', ')"/>
<text args="currentBillingAddress().street.join(', ')" if="currentBillingAddress().street"/>
<text args="tigHouseNumber()"/><br/>
<text args="currentBillingAddress().city "/>, <span text="currentBillingAddress().region"></span> <text args="currentBillingAddress().postcode"/><br/>
<text args="getCountryName(currentBillingAddress().countryId)"/><br/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<div class="shipping-address-item" data-bind="css: isSelected() ? 'selected-item' : 'not-selected-item'">
<text args="address().prefix"/> <text args="address().firstname"/> <text args="address().middlename"/>
<text args="address().lastname"/> <text args="address().suffix"/><br/>
<text args="address().street.join(', ')"/>
<text args="address().street.join(', ')" if="address().street"/>
<each args="data: address().customAttributes, as: 'element'">
<div class="tig-billing-housenumber" if="element['attribute_code'] == 'tig_housenumber' || element['attribute_code'] == 'tig_housenumber_addition'">
<text args="element.value"/>
Expand All @@ -24,7 +24,7 @@
</div>
</each>

<button visible="!address().isEditable()"
<button visible="address().isEditable()"
type="button"
class="action edit-address-link"
data-bind="click: editAddress, visible: address().isEditable()">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<if args="visible()">
<text args="address().prefix"/> <text args="address().firstname"/> <text args="address().middlename"/>
<text args="address().lastname"/> <text args="address().suffix"/><br/>
<text args="address().street.join(', ')"/>
<text args="address().street.join(', ')" if="address().street"/>
<each args="data: address().customAttributes, as: 'element'">
<if args="element['attribute_code'] == 'tig_housenumber' || element['attribute_code'] == 'tig_housenumber_addition'">
<text args="element.value"/>
Expand Down

0 comments on commit 19227e3

Please sign in to comment.