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

ECO-2309 FE module integration into suite #24

Conversation

sergeirybalko
Copy link
Contributor

@sergeirybalko sergeirybalko commented Dec 18, 2018

protected payConfig: IAmazonConfig;

protected readyCallback(): void {
this.loginScopeOptions = <string>this.loginScopeOptionsAttribute;

Choose a reason for hiding this comment

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

Suggest to rename method loginScopeOptionsAttribute into loginScopeOptions and remove this property.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed


protected readyCallback(): void {
this.loginScopeOptions = <string>this.loginScopeOptionsAttribute;
this.loginPopupOptions = <string>this.loginPopupOptionsAttribute;

Choose a reason for hiding this comment

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

The same here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

}

protected amazonLoginReady(): void {
(<any>window).onAmazonLoginReady = () => {

Choose a reason for hiding this comment

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

Suggest to add window declaration to avoid specifying of any type each time.
declare var window: any;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

}

protected amazonPaymentsReady(loginScopeOptions: string, loginPopupOptions: string, redirectUrl: string): void {
let addressConsentToken;

Choose a reason for hiding this comment

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

Why the name is addressConsentToken? How it is related to address? Maybe accessToken will be better?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

this.loginScopeOptions = <string>this.loginScopeOptionsAttribute;
this.loginPopupOptions = <string>this.loginPopupOptionsAttribute;
this.payConfig = <IAmazonConfig> {
clientId: this.clientIdAttribute,

Choose a reason for hiding this comment

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

Suggest to remove Attribute. Please do it everywhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

(<any>window).errorHandler(new Error('referenceId missing'));
return;
}
(<any>window).location = redirectUrl + '?'

Choose a reason for hiding this comment

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

I think template sting will be useful here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

clientId: required,
sellerId: required,
logout: required,
redirectUrl: '',

Choose a reason for hiding this comment

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

Are you sure it's not required? I cann't see any validation in TS implementation for it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@@ -0,0 +1,36 @@
{% extends model('component') %}

Choose a reason for hiding this comment

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

I think this is molecule, not atom.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

} %}

{% block body %}
<div id="{{ config.jsName }}__item" align="center"></div>

Choose a reason for hiding this comment

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

Please use class for alignment.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

class="radio"
name="amazonpayShipmentMethod"
value="{{ shipmentMethod.idShipmentMethod }}"
{% if data.selectedShipmentMethodId == shipmentMethod.idShipmentMethod %} checked="checked"{% endif %}

Choose a reason for hiding this comment

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

checked attribute doesn't need a value.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

name="amazonpayShipmentMethod"
value="{{ shipmentMethod.idShipmentMethod }}"
{% if data.selectedShipmentMethodId == shipmentMethod.idShipmentMethod %} checked="checked"{% endif %}
{% if data.isAmazonPaymentInvalid %} disabled="disabled"{% endif %}

Choose a reason for hiding this comment

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

The same for disabled.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

this.orderReferenceAjaxProvider = <AjaxProvider>this.querySelector(`.${this.jsName}__order-reference-ajax-provider`);
this.shipmentUpdateAjaxProvider = <AjaxProvider>this.querySelector(`.${this.jsName}__shipment-update-ajax-provider`);
this.payConfig = <IAmazonConfig> {
sellerId: this.sellerIdAttribute,

Choose a reason for hiding this comment

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

Please remove Attribute word for all getters.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed all Attribute world for all getters and from cart-pay-button.ts also

const referenceId = orderReference.getAmazonOrderReferenceId();
const formData = new FormData();
formData.append('reference_id', referenceId);
_this.orderReference(formData);

Choose a reason for hiding this comment

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

Is undefined value handles correctly?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I do not know, because I did not watch specification Amazon Pay. I think this moment need conversation with @profuel

{% endif %}
)
</strong>
<span class="float-right">

Choose a reason for hiding this comment

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

Suggest to move span inside if condition.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

{% if data.quoteTransfer.shipment and data.quoteTransfer.shipment.method %}
<li>
{{ 'checkout.step.summary.shipping' | trans }}
<strong>

Choose a reason for hiding this comment

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

Suggest to move strong inside if condition.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

</ul>
{% endif %}

{% if data.cartItems is defined %}

Choose a reason for hiding this comment

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

It's always defined, change condition to is not empty.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

locale: this.localeAttribute,
orderReferenceId: (this.orderReferenceIdAttribute === "") ? undefined : this.orderReferenceIdAttribute,
displayMode: (this.displayModeAttribute === "") ? undefined : this.displayModeAttribute
sellerId: this.sellerId,

Choose a reason for hiding this comment

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

It looks like you have 5 spaces indention here.

@profuel profuel merged commit 5fd342a into feature/eco-2286-amazon-pay-integration Jan 10, 2019
@profuel profuel deleted the feature/eco-2290/eco-2309-fe-module-integration branch January 10, 2019 08:30
@profuel profuel restored the feature/eco-2290/eco-2309-fe-module-integration branch January 10, 2019 09:07
@profuel profuel deleted the feature/eco-2290/eco-2309-fe-module-integration branch January 10, 2019 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants