@ikas/storefront 4.0.0-alpha.33 → 4.0.0-alpha.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +11 -11
- package/src/components/checkout/model.ts +5 -0
- package/src/components/checkout/steps/step-payment/index.tsx +6 -1
- package/src/components/checkout/steps/step-payment/style.module.scss +5 -0
- package/src/components/page-editor/model.ts +1 -4
- package/src/models/data/checkout/index.ts +4 -0
- package/src/models/data/order/index.ts +2 -0
- package/src/models/data/state/index.ts +6 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ikas/storefront",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.34",
|
|
4
4
|
"description": "Storefront functionality for ikas storefront themes.",
|
|
5
5
|
"author": "Umut Ozan Yıldırım",
|
|
6
6
|
"license": "ISC",
|
|
@@ -24,11 +24,11 @@
|
|
|
24
24
|
"libphonenumber-js": "^1.10.6"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@ikas/storefront-api": "^4.0.0-alpha.
|
|
28
|
-
"@ikas/storefront-config": "^4.0.0-alpha.
|
|
29
|
-
"@ikas/storefront-model-functions": "^4.0.0-alpha.
|
|
30
|
-
"@ikas/storefront-models": "^4.0.0-alpha.
|
|
31
|
-
"@ikas/storefront-providers": "^4.0.0-alpha.
|
|
27
|
+
"@ikas/storefront-api": "^4.0.0-alpha.34",
|
|
28
|
+
"@ikas/storefront-config": "^4.0.0-alpha.34",
|
|
29
|
+
"@ikas/storefront-model-functions": "^4.0.0-alpha.34",
|
|
30
|
+
"@ikas/storefront-models": "^4.0.0-alpha.34",
|
|
31
|
+
"@ikas/storefront-providers": "^4.0.0-alpha.34",
|
|
32
32
|
"@rollup/plugin-commonjs": "^22.0.0",
|
|
33
33
|
"@rollup/plugin-json": "^4.1.0",
|
|
34
34
|
"@rollup/plugin-node-resolve": "^13.3.0",
|
|
@@ -52,11 +52,11 @@
|
|
|
52
52
|
"html-react-parser": "^1.4.0"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
|
-
"@ikas/storefront-api": "^4.0.0-alpha.
|
|
56
|
-
"@ikas/storefront-config": "^4.0.0-alpha.
|
|
57
|
-
"@ikas/storefront-model-functions": "^4.0.0-alpha.
|
|
58
|
-
"@ikas/storefront-models": "^4.0.0-alpha.
|
|
59
|
-
"@ikas/storefront-providers": "^4.0.0-alpha.
|
|
55
|
+
"@ikas/storefront-api": "^4.0.0-alpha.34",
|
|
56
|
+
"@ikas/storefront-config": "^4.0.0-alpha.34",
|
|
57
|
+
"@ikas/storefront-model-functions": "^4.0.0-alpha.34",
|
|
58
|
+
"@ikas/storefront-models": "^4.0.0-alpha.34",
|
|
59
|
+
"@ikas/storefront-providers": "^4.0.0-alpha.34",
|
|
60
60
|
"mobx": "^6.1.3",
|
|
61
61
|
"mobx-react-lite": "^3.1.5",
|
|
62
62
|
"next": "12.2.0",
|
|
@@ -762,6 +762,8 @@ export default class CheckoutViewModel {
|
|
|
762
762
|
const newCart = await this.saveCart();
|
|
763
763
|
|
|
764
764
|
if (newCart) this.checkout = new IkasCheckout(newCart);
|
|
765
|
+
if (this.checkout.shippingAddress)
|
|
766
|
+
this.checkout.shippingAddress.checkoutSettings = this.checkoutSettings;
|
|
765
767
|
this.isChangingShippingMethod = false;
|
|
766
768
|
};
|
|
767
769
|
|
|
@@ -986,6 +988,9 @@ export default class CheckoutViewModel {
|
|
|
986
988
|
customer.addresses.push(newAddress);
|
|
987
989
|
|
|
988
990
|
await this.store.customerStore.saveCustomer(customer);
|
|
991
|
+
this.store.customerStore.customer.addresses?.forEach(
|
|
992
|
+
(address) => (address.checkoutSettings = this.checkoutSettings)
|
|
993
|
+
);
|
|
989
994
|
|
|
990
995
|
if (type === "shipping") {
|
|
991
996
|
this.checkout.shippingAddress!.id = newAddress.id;
|
|
@@ -48,7 +48,12 @@ export const CheckoutStepPayment: React.FC<Props> = observer(({ vm }) => {
|
|
|
48
48
|
const policyLabel = policyInputData.map((p) =>
|
|
49
49
|
p.isVariable ? (
|
|
50
50
|
<span
|
|
51
|
-
className={
|
|
51
|
+
className={[
|
|
52
|
+
styles.TermsLabelSpan,
|
|
53
|
+
vm.isErrorsVisible && !vm.isTermsAndConditionsChecked
|
|
54
|
+
? styles.Error
|
|
55
|
+
: "",
|
|
56
|
+
].join(" ")}
|
|
52
57
|
onClick={
|
|
53
58
|
p.value === "{{ ackPrivacyPolicy }}"
|
|
54
59
|
? onShowPrivacyPolicyClick
|
|
@@ -627,10 +627,7 @@ export default class IkasPageEditorViewModel {
|
|
|
627
627
|
prop
|
|
628
628
|
);
|
|
629
629
|
|
|
630
|
-
if (
|
|
631
|
-
propValue &&
|
|
632
|
-
(propValue.linkType || JSON.stringify(propValue)?.includes("linkType"))
|
|
633
|
-
)
|
|
630
|
+
if (propValue && JSON.stringify(propValue).includes("href"))
|
|
634
631
|
await this.pageDataProvider.setLinkSlugs();
|
|
635
632
|
|
|
636
633
|
pageComponentPropValues.propValues[propName] =
|
|
@@ -20,6 +20,10 @@ export class IkasCheckout extends IkasCart implements ICheckout {
|
|
|
20
20
|
constructor(data: Partial<IkasCheckoutConstructorData>) {
|
|
21
21
|
super(data);
|
|
22
22
|
|
|
23
|
+
this.appliedCouponCode = data.couponCode;
|
|
24
|
+
this.selectedPaymentGateway = data.selectedPaymentGateway;
|
|
25
|
+
this.masterPassPaymentGateway = data.masterPassPaymentGateway;
|
|
26
|
+
|
|
23
27
|
makeObservable(this, {
|
|
24
28
|
appliedCouponCode: observable,
|
|
25
29
|
selectedPaymentGateway: observable,
|
|
@@ -94,6 +94,8 @@ export class IkasOrder extends IkasBaseModel implements IOrder {
|
|
|
94
94
|
this.shippingAddress = data.shippingAddress
|
|
95
95
|
? new IkasOrderAddress(data.shippingAddress)
|
|
96
96
|
: null;
|
|
97
|
+
this.shippingLines =
|
|
98
|
+
data.shippingLines?.map((sl) => new IkasOrderShippingLine(sl)) || null;
|
|
97
99
|
this.shippingMethod =
|
|
98
100
|
data.shippingMethod || IkasOrderShippingMethod.SHIPMENT;
|
|
99
101
|
this.status = data.status || IkasOrderStatus.CREATED;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IkasBaseModel } from "../base";
|
|
2
2
|
import { IkasState as IState } from "@ikas/storefront-models";
|
|
3
|
-
import {
|
|
3
|
+
import { makeObservable, observable } from "mobx";
|
|
4
4
|
|
|
5
5
|
export class IkasState extends IkasBaseModel implements IState {
|
|
6
6
|
countryId: string;
|
|
@@ -13,6 +13,10 @@ export class IkasState extends IkasBaseModel implements IState {
|
|
|
13
13
|
this.name = data.name;
|
|
14
14
|
this.stateCode = data.stateCode;
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
makeObservable(this, {
|
|
17
|
+
countryId: observable,
|
|
18
|
+
name: observable,
|
|
19
|
+
stateCode: observable,
|
|
20
|
+
});
|
|
17
21
|
}
|
|
18
22
|
}
|