@memberjunction/ng-link-directives 1.4.0 → 1.5.0

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-base-link.d.ts","sourceRoot":"","sources":["../../src/lib/ng-base-link.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,8BAAsB,QAAQ;IAC1B,SAAS,CAAC,UAAU,CAAC,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,GAAE,OAAe;CAStH"}
1
+ {"version":3,"file":"ng-base-link.d.ts","sourceRoot":"","sources":["../../src/lib/ng-base-link.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,8BAAsB,QAAQ;IAC1B,SAAS,CAAC,UAAU,CAAC,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,GAAE,OAAe;CAYtH"}
@@ -2,10 +2,13 @@ export class BaseLink {
2
2
  CreateLink(el, field, renderer, href, newTab = false) {
3
3
  const parent = el.nativeElement.parentNode;
4
4
  const a = renderer.createElement('a');
5
- renderer.setAttribute(a, 'href', href);
5
+ if (href !== null && href !== undefined && href.length > 0)
6
+ renderer.setAttribute(a, 'href', href);
6
7
  if (newTab)
7
8
  renderer.setAttribute(a, 'target', '_blank');
8
9
  renderer.insertBefore(parent, a, el.nativeElement);
10
+ renderer.addClass(a, 'link-text');
11
+ // renderer.setStyle(a, 'font-size', '14px');
9
12
  renderer.appendChild(a, el.nativeElement);
10
13
  }
11
14
  }
@@ -49,7 +49,7 @@ export class FieldLink extends BaseLink {
49
49
  // we didn't have the related field mapping info (above), no related entity name field map provided in the entity field metadata, so do a lookup
50
50
  // requires a server round trip and hitting the DB, so we try to avoid this
51
51
  let compositeKey = new CompositeKey([{
52
- FieldName: this._targetEntityInfo.PrimaryKey.Name, // AT THE MOMENT - we only support foreign keys with a single value
52
+ FieldName: this._targetEntityInfo.FirstPrimaryKey.Name, // AT THE MOMENT - we only support foreign keys with a single value
53
53
  Value: this.field.Value
54
54
  }]);
55
55
  md.GetEntityRecordName(relatedEntity, compositeKey).then(recordName => {
@@ -68,7 +68,7 @@ export class FieldLink extends BaseLink {
68
68
  if (!this._targetEntityInfo)
69
69
  throw new Error('targetEntityInfo not set');
70
70
  // AT THE MOMENT - we only support foreign keys with a single value
71
- const keyVals = `${this._targetEntityInfo.PrimaryKey.Name}|${this._targetRecordID}`;
71
+ const keyVals = `${this._targetEntityInfo.FirstPrimaryKey.Name}|${this._targetRecordID}`;
72
72
  this.router.navigate(['resource', 'record', keyVals], { queryParams: { Entity: this._targetEntity } });
73
73
  }
74
74
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memberjunction/ng-link-directives",
3
- "version": "1.4.0",
3
+ "version": "1.5.0",
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",
@@ -30,7 +30,7 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "tslib": "^2.3.0",
33
- "@memberjunction/core": "~1.4.0"
33
+ "@memberjunction/core": "~1.5.0"
34
34
  },
35
35
  "sideEffects": false
36
36
  }