ng-miam 8.6.0 → 8.6.1

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.
@@ -3326,6 +3326,7 @@
3326
3326
  var _a;
3327
3327
  this.previousTitle = this.titleService.getTitle();
3328
3328
  this.previousRobotsTagContent = (_a = this.metaService.getTag('name=robots')) === null || _a === void 0 ? void 0 : _a.content;
3329
+ this.previousCanonicalLinkHref = window.document.querySelector('link[rel="canonical"]').getAttribute('href');
3329
3330
  this.recipe = recipe;
3330
3331
  this.subscription.push(this.supplierIsRecipeProvider().subscribe(function (result) {
3331
3332
  if (!result) {
@@ -3333,12 +3334,19 @@
3333
3334
  }
3334
3335
  else {
3335
3336
  _this.metaService.updateTag({ name: 'robots', content: 'index, follow' }, 'name="robots"');
3337
+ _this.setCanonicalUrlTag();
3336
3338
  _this.addSEOScript();
3337
3339
  }
3338
3340
  _this.addSEOTags();
3339
3341
  _this.repositionMetaTags();
3340
3342
  }));
3341
3343
  };
3344
+ SeoService.prototype.setCanonicalUrlTag = function () {
3345
+ var canonicalTag = window.document.querySelector('link[rel="canonical"]');
3346
+ if (canonicalTag) {
3347
+ canonicalTag.setAttribute('href', window.location.href);
3348
+ }
3349
+ };
3342
3350
  SeoService.prototype.repositionMetaTags = function () {
3343
3351
  var metaTags = document.head.querySelectorAll('meta');
3344
3352
  var head = document.getElementsByTagName('head')[0];
@@ -3358,6 +3366,16 @@
3358
3366
  else {
3359
3367
  this.metaService.removeTag('name="robots"');
3360
3368
  }
3369
+ this.rollbackCanonicalLink();
3370
+ };
3371
+ SeoService.prototype.rollbackCanonicalLink = function () {
3372
+ var canonicalLink = window.document.querySelector('link[rel="canonical"]');
3373
+ if (canonicalLink && this.previousCanonicalLinkHref) {
3374
+ canonicalLink.setAttribute('href', this.previousCanonicalLinkHref);
3375
+ }
3376
+ else {
3377
+ canonicalLink.remove();
3378
+ }
3361
3379
  };
3362
3380
  SeoService.prototype.addSEOTags = function () {
3363
3381
  this.titleService.setTitle(this.recipe.attributes.title + ' | ' + this.supplier.attributes.name);
@@ -8699,7 +8717,7 @@
8699
8717
  MiamInterceptor.prototype.setMiamHeaders = function (request) {
8700
8718
  var headersToAdd = {
8701
8719
  'miam-origin': this.context.origin.value,
8702
- 'miam-front-version': '8.6.0',
8720
+ 'miam-front-version': '8.6.1',
8703
8721
  'miam-front-type': 'web',
8704
8722
  'miam-api-version': '4.7.0'
8705
8723
  };