Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #7988 Typo changed also added comments for each index, getters and setters. #9484

Closed
wants to merge 6 commits into from
57 changes: 49 additions & 8 deletions app/code/Magento/Checkout/view/frontend/web/js/checkout-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,24 @@ define([

if ($.isEmptyObject(getData())) {
checkoutData = {
'selectedShippingAddress': null,
'shippingAddressFromData': null,
'newCustomerShippingAddress': null,
'selectedShippingRate': null,
'selectedPaymentMethod': null,
'selectedBillingAddress': null,
'billingAddressFormData': null,
'newCustomerBillingAddress': null
'selectedShippingAddress': null, // Selected shipping address pullled from local storage (Persistence)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. remove space between // and Selected (fix all cases)
  2. replace local storage (Persistence) and local storage --> persistence storage

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in my new commit

'shippingAddressFromData': null, // Shipping address pullled from local storage (Persistence)
'newCustomerShippingAddress': null, // Shipping address pullled from local storage for new customer (Persistence)
'selectedShippingRate': null, // Shipping rate pulled from local storage (Persistence)
'selectedPaymentMethod': null, // Payment method pulled from local storage (Persistence)
'selectedBillingAddress': null, // Selected billing address pullled from local storage (Persistence)
'billingAddressFromData': null, // Billing address pullled from local storage (Persistence)
'newCustomerBillingAddress': null, // Billing address pullled from local storage for new customer (Persistence)
'validatedEmailValue': null, // Validated email address from local storage (Persistence)
'inputFieldEmailValue' : null // Email input field value from local storage (Persistence)
};
saveData(checkoutData);
}

return {
/**
* Setting the selected shipping address pulled from local storage
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add . at the end of the comment. (all cases)

*
* @param {Object} data
*/
setSelectedShippingAddress: function (data) {
Expand All @@ -57,13 +61,17 @@ define([
},

/**
* Pulling the selected shipping address from local storage
*
* @return {*}
*/
getSelectedShippingAddress: function () {
return getData().selectedShippingAddress;
},

/**
* Setting the shipping address pulled from local storage
*
* @param {Object} data
*/
setShippingAddressFromData: function (data) {
Expand All @@ -74,13 +82,17 @@ define([
},

/**
* Pulling the shipping address from local storage
*
* @return {*}
*/
getShippingAddressFromData: function () {
return getData().shippingAddressFromData;
},

/**
* Setting the shipping address pulled from local storage for new customer
*
* @param {Object} data
*/
setNewCustomerShippingAddress: function (data) {
Expand All @@ -91,13 +103,17 @@ define([
},

/**
* Pulling the shipping address from local storage for new customer
*
* @return {*}
*/
getNewCustomerShippingAddress: function () {
return getData().newCustomerShippingAddress;
},

/**
* Setting the selected shipping rate pulled from local storage
*
* @param {Object} data
*/
setSelectedShippingRate: function (data) {
Expand All @@ -108,13 +124,17 @@ define([
},

/**
* Pulling the selected shipping rate from local storge
*
* @return {*}
*/
getSelectedShippingRate: function () {
return getData().selectedShippingRate;
},

/**
* Setting the selected payment method pulled from local storage
*
* @param {Object} data
*/
setSelectedPaymentMethod: function (data) {
Expand All @@ -125,13 +145,17 @@ define([
},

/**
* Pulling the payment method from local storage
*
* @return {*}
*/
getSelectedPaymentMethod: function () {
return getData().selectedPaymentMethod;
},

/**
* Setting the selected billing address pulled from local storage
*
* @param {Object} data
*/
setSelectedBillingAddress: function (data) {
Expand All @@ -142,13 +166,17 @@ define([
},

/**
* Pulling the selected billing address from local storage
*
* @return {*}
*/
getSelectedBillingAddress: function () {
return getData().selectedBillingAddress;
},

/**
* Setting the billing address pulled from local storage
*
* @param {Object} data
*/
setBillingAddressFromData: function (data) {
Expand All @@ -159,13 +187,16 @@ define([
},

/**
* Pulling the billing address from local storage
* @return {*}
*/
getBillingAddressFromData: function () {
return getData().billingAddressFromData;
},

/**
* Setting the billing address pulled from local storage for new customer
*
* @param {Object} data
*/
setNewCustomerBillingAddress: function (data) {
Expand All @@ -176,13 +207,17 @@ define([
},

/**
* Pulling the billing address from local storage for new customer
*
* @return {*}
*/
getNewCustomerBillingAddress: function () {
return getData().newCustomerBillingAddress;
},

/**
* Pulling the email address from local storage
*
* @return {*}
*/
getValidatedEmailValue: function () {
Expand All @@ -192,6 +227,8 @@ define([
},

/**
* Setting the email address pulled from local storage
*
* @param {String} email
*/
setValidatedEmailValue: function (email) {
Expand All @@ -202,6 +239,8 @@ define([
},

/**
* Pulling the email input field value from local storage
*
* @return {*}
*/
getInputFieldEmailValue: function () {
Expand All @@ -211,6 +250,8 @@ define([
},

/**
* Setting the email input field value pulled from local storage
*
* @param {String} email
*/
setInputFieldEmailValue: function (email) {
Expand Down