buildingproduct-library 0.2.79 → 0.2.81

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.
@@ -982,42 +982,38 @@
982
982
  }
983
983
  AccountDropdownComponent.prototype.ngOnInit = function () {
984
984
  return __awaiter(this, void 0, void 0, function () {
985
- var isLoaded;
986
985
  var _this = this;
987
986
  return __generator(this, function (_c) {
988
- switch (_c.label) {
989
- case 0: return [4 /*yield*/, this.fiUserAccountDetailsService.isEnviornmentLoaded()];
990
- case 1:
991
- isLoaded = _c.sent();
992
- this.selecteduserData = JSON.parse(localStorage.getItem('selectedAccout') || '{}');
993
- this.fiUserAccountDetailsService.getUserAccount().subscribe(function (user) {
994
- var _a, _b;
995
- if (user) {
996
- var username = (_a = user.uid) === null || _a === void 0 ? void 0 : _a.toString();
997
- var cartObj = localStorage.getItem('spartacus⚿dimond-spa⚿cart');
998
- var cartId = (_b = JSON.parse(cartObj)) === null || _b === void 0 ? void 0 : _b.active;
999
- if (cartId) {
1000
- _this.service.getAccountDatawithCartId(cartId).subscribe(function (data) {
1001
- if (data) {
1002
- _this.showWaitCursor.next(false);
1003
- _this.accounts = data;
1004
- _this.getAccountsData();
1005
- }
1006
- });
987
+ this.selecteduserData = JSON.parse(localStorage.getItem('selectedAccout') || '{}');
988
+ this.fiUserAccountDetailsService.getUserAccount().subscribe(function (user) {
989
+ var _a, _b;
990
+ if (user) {
991
+ var username = (_a = user.uid) === null || _a === void 0 ? void 0 : _a.toString();
992
+ var cartObj = localStorage.getItem('spartacus⚿dimond-spa⚿cart');
993
+ var cartId = (_b = JSON.parse(cartObj)) === null || _b === void 0 ? void 0 : _b.active;
994
+ if (cartId) {
995
+ _this.service.getAccountDatawithCartId(cartId).subscribe(function (data) {
996
+ if (data) {
997
+ _this.showWaitCursor.next(false);
998
+ _this.accounts = data;
999
+ _this.getAccountsData();
1007
1000
  }
1008
- else {
1009
- _this.service.getAccountData().subscribe(function (data) {
1010
- if (data) {
1011
- _this.showWaitCursor.next(false);
1012
- _this.accounts = data;
1013
- _this.getAccountsData();
1014
- }
1015
- });
1001
+ }, function (error) {
1002
+ window.location.reload();
1003
+ });
1004
+ }
1005
+ else {
1006
+ _this.service.getAccountData().subscribe(function (data) {
1007
+ if (data) {
1008
+ _this.showWaitCursor.next(false);
1009
+ _this.accounts = data;
1010
+ _this.getAccountsData();
1016
1011
  }
1017
- }
1018
- });
1019
- return [2 /*return*/];
1020
- }
1012
+ });
1013
+ }
1014
+ }
1015
+ });
1016
+ return [2 /*return*/];
1021
1017
  });
1022
1018
  });
1023
1019
  };
@@ -1219,31 +1215,26 @@
1219
1215
  }
1220
1216
  FindStoreComponent.prototype.ngOnInit = function () {
1221
1217
  return __awaiter(this, void 0, void 0, function () {
1222
- var isLoaded;
1223
1218
  var _this = this;
1224
1219
  return __generator(this, function (_b) {
1225
- switch (_b.label) {
1226
- case 0: return [4 /*yield*/, this.fiUserAccountDetailsService.isEnviornmentLoaded()];
1227
- case 1:
1228
- isLoaded = _b.sent();
1229
- this.findStoreService.homeBranch.subscribe(function (data) {
1230
- setTimeout(function () {
1231
- var _a;
1232
- if (data) {
1233
- if (localStorage.getItem('branchDetails')) {
1234
- _this.homeBranchData = localStorage.getItem('branchDetails');
1235
- _this.branchName = (_a = JSON.parse(_this.homeBranchData)) === null || _a === void 0 ? void 0 : _a.displayName;
1236
- _this.cd.markForCheck();
1237
- }
1238
- else {
1239
- _this.branchName = data === null || data === void 0 ? void 0 : data.displayName;
1240
- _this.cd.markForCheck();
1241
- }
1242
- }
1243
- }, 100);
1244
- });
1245
- return [2 /*return*/];
1246
- }
1220
+ // const isLoaded = await this.fiUserAccountDetailsService.isEnviornmentLoaded();
1221
+ this.findStoreService.homeBranch.subscribe(function (data) {
1222
+ setTimeout(function () {
1223
+ var _a;
1224
+ if (data) {
1225
+ if (localStorage.getItem('branchDetails')) {
1226
+ _this.homeBranchData = localStorage.getItem('branchDetails');
1227
+ _this.branchName = (_a = JSON.parse(_this.homeBranchData)) === null || _a === void 0 ? void 0 : _a.displayName;
1228
+ _this.cd.markForCheck();
1229
+ }
1230
+ else {
1231
+ _this.branchName = data === null || data === void 0 ? void 0 : data.displayName;
1232
+ _this.cd.markForCheck();
1233
+ }
1234
+ }
1235
+ }, 100);
1236
+ });
1237
+ return [2 /*return*/];
1247
1238
  });
1248
1239
  });
1249
1240
  };
@@ -6122,8 +6113,33 @@
6122
6113
  this.createUpdateToast = false;
6123
6114
  };
6124
6115
  MyTeamComponent.prototype.findOrgUnit = function (data) {
6125
- var _a, _b;
6126
- return (_b = (_a = this.orgUnits) === null || _a === void 0 ? void 0 : _a.find(function (element) { return element.uid == data.uid; })) === null || _b === void 0 ? void 0 : _b.name;
6116
+ var _a;
6117
+ var name = '';
6118
+ (_a = this.orgUnits) === null || _a === void 0 ? void 0 : _a.forEach(function (ele) {
6119
+ var _a;
6120
+ if (ele.uid == data.uid) {
6121
+ name = ele.name;
6122
+ return;
6123
+ }
6124
+ else {
6125
+ (_a = ele === null || ele === void 0 ? void 0 : ele.children) === null || _a === void 0 ? void 0 : _a.forEach(function (child) {
6126
+ var _a;
6127
+ if (child.uid == data.uid) {
6128
+ name = child.name;
6129
+ return child.name;
6130
+ }
6131
+ else {
6132
+ (_a = child === null || child === void 0 ? void 0 : child.children) === null || _a === void 0 ? void 0 : _a.forEach(function (children) {
6133
+ if (children.uid == data.uid) {
6134
+ name = children.name;
6135
+ return;
6136
+ }
6137
+ });
6138
+ }
6139
+ });
6140
+ }
6141
+ });
6142
+ return name;
6127
6143
  };
6128
6144
  MyTeamComponent.prototype.checkOrgUnit = function (event, data) {
6129
6145
  if (event.currentTarget.checked) {