@infrab4a/connect-angular 3.4.0-beta.7 → 3.4.0-beta.9
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/angular-connect.module.d.ts +1 -1
- package/bundles/infrab4a-connect-angular.umd.js +21 -10
- package/bundles/infrab4a-connect-angular.umd.js.map +1 -1
- package/consts/backend-url.const.d.ts +1 -0
- package/consts/index.d.ts +1 -1
- package/esm2015/angular-connect.module.js +3 -3
- package/esm2015/consts/backend-url.const.js +2 -0
- package/esm2015/consts/index.js +2 -2
- package/esm2015/services/shipping.service.js +21 -10
- package/fesm2015/infrab4a-connect-angular.js +21 -10
- package/fesm2015/infrab4a-connect-angular.js.map +1 -1
- package/package.json +1 -1
- package/consts/api-url.const.d.ts +0 -1
- package/esm2015/consts/api-url.const.js +0 -2
|
@@ -11,7 +11,7 @@ export declare class AngularConnectModule {
|
|
|
11
11
|
firebase: FirebaseOptions;
|
|
12
12
|
elasticSearch: AxiosElasticSearchConfig;
|
|
13
13
|
hasura: HasuraGraphQLOptions;
|
|
14
|
-
|
|
14
|
+
backendUrl: string;
|
|
15
15
|
}, nameOrConfig?: string | FirebaseAppConfig): ModuleWithProviders<AngularFireModule>;
|
|
16
16
|
static ɵfac: i0.ɵɵFactoryDeclaration<AngularConnectModule, never>;
|
|
17
17
|
static ɵmod: i0.ɵɵNgModuleDeclaration<AngularConnectModule, never, [typeof i1.AngularFireModule, typeof i2.AngularFirestoreModule, typeof i3.AngularHasuraGraphQLModule], never>;
|
|
@@ -390,7 +390,7 @@
|
|
|
390
390
|
}] }];
|
|
391
391
|
} });
|
|
392
392
|
|
|
393
|
-
var
|
|
393
|
+
var BACKEND_URL = 'BACKEND_URL';
|
|
394
394
|
|
|
395
395
|
var DEFAULT_SHOP = 'DEFAULT_SHOP';
|
|
396
396
|
|
|
@@ -1239,24 +1239,35 @@
|
|
|
1239
1239
|
var shippingMethods = shippingMethodsResponse.result;
|
|
1240
1240
|
if (!shippingMethods.length)
|
|
1241
1241
|
return [];
|
|
1242
|
+
shippingMethods = shippingMethods.map(function (s) {
|
|
1243
|
+
if (s.ShippingCompanyName == 'Same Day EG')
|
|
1244
|
+
s.ShippingCompanyName = 'Same Day';
|
|
1245
|
+
else
|
|
1246
|
+
return s;
|
|
1247
|
+
});
|
|
1242
1248
|
var datasSameDayNotAvaliable = datas.sameDayNotAvaliable;
|
|
1243
1249
|
if (_this.isHolidays(datasSameDayNotAvaliable)) {
|
|
1244
1250
|
shippingMethods = shippingMethods.filter(function (method) { return method.ShippingCompanyName !== 'Same Day'; });
|
|
1245
1251
|
}
|
|
1246
|
-
if (totalPrice >= 200
|
|
1247
|
-
|
|
1252
|
+
if (totalPrice >= 200) {
|
|
1253
|
+
shippingMethods = shippingMethods.map(function (s) {
|
|
1248
1254
|
if (s.serviceName !== 'Same Day')
|
|
1249
1255
|
return Object.assign(Object.assign({}, s), { totalPrice: 0 });
|
|
1250
1256
|
else
|
|
1251
1257
|
return s;
|
|
1252
1258
|
});
|
|
1253
1259
|
}
|
|
1254
|
-
if (_this.
|
|
1255
|
-
|
|
1256
|
-
if (s.serviceName
|
|
1260
|
+
if (_this.isFreeShippingBySubscription(shop, subscriptionPlan)) {
|
|
1261
|
+
shippingMethods = shippingMethods.map(function (s) {
|
|
1262
|
+
if (s.serviceName == 'Same Day')
|
|
1257
1263
|
return Object.assign(Object.assign({}, s), { totalPrice: s.totalPrice / 2 });
|
|
1258
1264
|
else
|
|
1259
|
-
return s;
|
|
1265
|
+
return Object.assign(Object.assign({}, s), { totalPrice: 0 });
|
|
1266
|
+
});
|
|
1267
|
+
}
|
|
1268
|
+
if (_this.isHalfShippingBySubscription(shop, subscriptionPlan)) {
|
|
1269
|
+
shippingMethods = shippingMethods.map(function (s) {
|
|
1270
|
+
return Object.assign(Object.assign({}, s), { totalPrice: s.totalPrice / 2 });
|
|
1260
1271
|
});
|
|
1261
1272
|
}
|
|
1262
1273
|
return shippingMethods;
|
|
@@ -1295,14 +1306,14 @@
|
|
|
1295
1306
|
};
|
|
1296
1307
|
return ShippingService;
|
|
1297
1308
|
}());
|
|
1298
|
-
ShippingService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: ShippingService, deps: [{ token: i1__namespace$3.HttpClient }, { token:
|
|
1309
|
+
ShippingService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: ShippingService, deps: [{ token: i1__namespace$3.HttpClient }, { token: BACKEND_URL }, { token: HomeShopService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1299
1310
|
ShippingService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: ShippingService });
|
|
1300
1311
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: ShippingService, decorators: [{
|
|
1301
1312
|
type: i0.Injectable
|
|
1302
1313
|
}], ctorParameters: function () {
|
|
1303
1314
|
return [{ type: i1__namespace$3.HttpClient }, { type: undefined, decorators: [{
|
|
1304
1315
|
type: i0.Inject,
|
|
1305
|
-
args: [
|
|
1316
|
+
args: [BACKEND_URL]
|
|
1306
1317
|
}] }, { type: HomeShopService }];
|
|
1307
1318
|
} });
|
|
1308
1319
|
|
|
@@ -1897,7 +1908,7 @@
|
|
|
1897
1908
|
AngularConnectModule.initializeApp = function (defaultShop, options, nameOrConfig) {
|
|
1898
1909
|
return {
|
|
1899
1910
|
ngModule: AngularConnectModule,
|
|
1900
|
-
providers: __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((i1$1.isNil(defaultShop) ? [] : [{ provide: DEFAULT_SHOP, useValue: defaultShop }]))), __read((i1$1.isNil(options === null || options === void 0 ? void 0 : options.firebase) ? [] : [{ provide: fire.FIREBASE_OPTIONS, useValue: options === null || options === void 0 ? void 0 : options.firebase }]))), __read((i1$1.isNil(options === null || options === void 0 ? void 0 : options.firebase) ? [] : [{ provide: fire.FIREBASE_APP_NAME, useValue: nameOrConfig }]))), __read((i1$1.isNil(options === null || options === void 0 ? void 0 : options.elasticSearch) ? [] : [{ provide: ES_CONFIG, useValue: options.elasticSearch }]))), __read((i1$1.isNil(options === null || options === void 0 ? void 0 : options.hasura) ? [] : [{ provide: HASURA_OPTIONS, useValue: options.hasura }]))), __read((i1$1.isNil(options === null || options === void 0 ? void 0 : options.
|
|
1911
|
+
providers: __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((i1$1.isNil(defaultShop) ? [] : [{ provide: DEFAULT_SHOP, useValue: defaultShop }]))), __read((i1$1.isNil(options === null || options === void 0 ? void 0 : options.firebase) ? [] : [{ provide: fire.FIREBASE_OPTIONS, useValue: options === null || options === void 0 ? void 0 : options.firebase }]))), __read((i1$1.isNil(options === null || options === void 0 ? void 0 : options.firebase) ? [] : [{ provide: fire.FIREBASE_APP_NAME, useValue: nameOrConfig }]))), __read((i1$1.isNil(options === null || options === void 0 ? void 0 : options.elasticSearch) ? [] : [{ provide: ES_CONFIG, useValue: options.elasticSearch }]))), __read((i1$1.isNil(options === null || options === void 0 ? void 0 : options.hasura) ? [] : [{ provide: HASURA_OPTIONS, useValue: options.hasura }]))), __read((i1$1.isNil(options === null || options === void 0 ? void 0 : options.backendUrl) ? [] : [{ provide: BACKEND_URL, useValue: options.backendUrl }]))),
|
|
1901
1912
|
};
|
|
1902
1913
|
};
|
|
1903
1914
|
return AngularConnectModule;
|