@memberjunction/ng-link-directives 1.5.1 → 1.5.3

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.
@@ -1 +1 @@
1
- {"version":3,"file":"ng-field-link.d.ts","sourceRoot":"","sources":["../../src/lib/ng-field-link.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAE,SAAS,EAAS,MAAM,EAAgB,MAAM,eAAe,CAAC;AAC9F,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,UAAU,EAAgB,WAAW,EAAmC,MAAM,sBAAsB,CAAC;AAC9G,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;;AAE1C,qBAGa,SAAU,SAAQ,QAAS,YAAW,MAAM;IAU3C,OAAO,CAAC,EAAE;IAAc,OAAO,CAAC,QAAQ;IAAa,OAAO,CAAC,KAAK;IAAkB,OAAO,CAAC,MAAM;IAR7F,MAAM,EAAG,UAAU,CAAC;IACjB,SAAS,EAAG,MAAM,CAAC;IACjB,WAAW,EAAE,OAAO,CAAS;IAEnD,OAAO,CAAC,aAAa,CAAc;IACnC,OAAO,CAAC,iBAAiB,CAAyB;IAClD,OAAO,CAAC,eAAe,CAAa;gBAEhB,EAAE,EAAE,UAAU,EAAU,QAAQ,EAAE,SAAS,EAAU,KAAK,EAAE,cAAc,EAAU,MAAM,EAAE,MAAM;IAItH,IAAW,KAAK,IAAI,WAAW,CAM9B;IAED,QAAQ;IA6CR,OAAO,CAAC,KAAK,EAAE,KAAK;yCAnET,SAAS;2CAAT,SAAS;CA6ErB"}
1
+ {"version":3,"file":"ng-field-link.d.ts","sourceRoot":"","sources":["../../src/lib/ng-field-link.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAE,SAAS,EAAS,MAAM,EAAgB,MAAM,eAAe,CAAC;AAC9F,OAAO,EAAE,cAAc,EAAoD,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAC3G,OAAO,EAAE,UAAU,EAAgB,WAAW,EAA6C,MAAM,sBAAsB,CAAC;AACxH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;;AAE1C,qBAGa,SAAU,SAAQ,QAAS,YAAW,MAAM;IAU3C,OAAO,CAAC,EAAE;IAAc,OAAO,CAAC,QAAQ;IAAa,OAAO,CAAC,KAAK;IAAkB,OAAO,CAAC,MAAM;IAR7F,MAAM,EAAG,UAAU,CAAC;IACjB,SAAS,EAAG,MAAM,CAAC;IACjB,WAAW,EAAE,OAAO,CAAS;IAEnD,OAAO,CAAC,aAAa,CAAc;IACnC,OAAO,CAAC,iBAAiB,CAAyB;IAClD,OAAO,CAAC,eAAe,CAAa;gBAEhB,EAAE,EAAE,UAAU,EAAU,QAAQ,EAAE,SAAS,EAAU,KAAK,EAAE,cAAc,EAAU,MAAM,EAAE,MAAM;IAgBtH,IAAW,KAAK,IAAI,WAAW,CAM9B;IAED,QAAQ;IA6CR,OAAO,CAAC,KAAK,EAAE,KAAK;yCA/ET,SAAS;2CAAT,SAAS;CA+FrB"}
@@ -1,5 +1,6 @@
1
1
  import { Directive, Input, HostListener } from '@angular/core';
2
- import { CompositeKey, LogStatus, Metadata } from '@memberjunction/core';
2
+ import { NavigationCancel, NavigationEnd, NavigationError } from '@angular/router';
3
+ import { CompositeKey, LogError, LogStatus, Metadata } from '@memberjunction/core';
3
4
  import { BaseLink } from './ng-base-link';
4
5
  import * as i0 from "@angular/core";
5
6
  import * as i1 from "@angular/router";
@@ -13,6 +14,17 @@ export class FieldLink extends BaseLink {
13
14
  this.replaceText = true; //
14
15
  this._targetEntity = '';
15
16
  this._targetRecordID = 0;
17
+ this.router.events.subscribe(event => {
18
+ if (event instanceof NavigationEnd) {
19
+ console.log('NavigationEnd:', event.url);
20
+ }
21
+ if (event instanceof NavigationError) {
22
+ LogError(`NavigationError: ${event.error}`);
23
+ }
24
+ if (event instanceof NavigationCancel) {
25
+ LogError(`NavigationCancel: ${event.reason}`);
26
+ }
27
+ });
16
28
  }
17
29
  get field() {
18
30
  if (!this.record)
@@ -69,7 +81,13 @@ export class FieldLink extends BaseLink {
69
81
  throw new Error('targetEntityInfo not set');
70
82
  // AT THE MOMENT - we only support foreign keys with a single value
71
83
  const keyVals = `${this._targetEntityInfo.FirstPrimaryKey.Name}|${this._targetRecordID}`;
72
- this.router.navigate(['resource', 'record', keyVals], { queryParams: { Entity: this._targetEntity } });
84
+ const newURL = ['resource', 'record', keyVals];
85
+ this.router.navigate(newURL, { queryParams: { Entity: this._targetEntity } }).then(params => {
86
+ console.log('navigated to:', newURL.join('/'));
87
+ }).catch(err => {
88
+ const newURLString = newURL.join('/');
89
+ LogError(`Error navigating to ${newURLString}: ${err}`);
90
+ });
73
91
  }
74
92
  }
75
93
  FieldLink.ɵfac = function FieldLink_Factory(t) { return new (t || FieldLink)(i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(i0.Renderer2), i0.ɵɵdirectiveInject(i1.ActivatedRoute), i0.ɵɵdirectiveInject(i1.Router)); };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memberjunction/ng-link-directives",
3
- "version": "1.5.1",
3
+ "version": "1.5.3",
4
4
  "description": "MemberJunction: Angular Link Directives for turning an element in an angular app into an email, web, or record link",
5
5
  "main": "./dist/public-api.js",
6
6
  "typings": "./dist/public-api.d.ts",
@@ -20,17 +20,17 @@
20
20
  "author": "",
21
21
  "license": "ISC",
22
22
  "devDependencies": {
23
- "@angular/compiler": "~17.2.2",
24
- "@angular/compiler-cli": "~17.2.2"
23
+ "@angular/compiler": "18.0.2",
24
+ "@angular/compiler-cli": "18.0.2"
25
25
  },
26
26
  "peerDependencies": {
27
- "@angular/common": "~17.2.2",
28
- "@angular/core": "~17.2.2",
29
- "@angular/router": "~17.2.2"
27
+ "@angular/common": "18.0.2",
28
+ "@angular/core": "18.0.2",
29
+ "@angular/router": "18.0.2"
30
30
  },
31
31
  "dependencies": {
32
32
  "tslib": "^2.3.0",
33
- "@memberjunction/core": "~1.5.1"
33
+ "@memberjunction/core": "1.5.3"
34
34
  },
35
35
  "sideEffects": false
36
36
  }