-
Notifications
You must be signed in to change notification settings - Fork 2
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
ECO-2309 FE module integration into suite #24
Conversation
protected payConfig: IAmazonConfig; | ||
|
||
protected readyCallback(): void { | ||
this.loginScopeOptions = <string>this.loginScopeOptionsAttribute; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same here.
There was a problem hiding this comment.
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 = () => { |
There was a problem hiding this comment.
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;
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 + '?' |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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: '', |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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') %} |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 %} |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same for disabled
.
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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"> |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 %} |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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.
…co-2290/eco-2309-fe-module-integration
TICKET: https://spryker.atlassian.net/browse/ECO-2309