@memberjunction/ng-explorer-core 0.9.209 → 0.9.211
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/dist/lib/favorites/favorites.component.d.ts.map +1 -1
- package/dist/lib/favorites/favorites.component.js +22 -1
- package/dist/lib/resource-wrappers/record-resource.component.d.ts +1 -0
- package/dist/lib/resource-wrappers/record-resource.component.d.ts.map +1 -1
- package/dist/lib/resource-wrappers/record-resource.component.js +11 -10
- package/package.json +18 -18
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"favorites.component.d.ts","sourceRoot":"","sources":["../../../src/lib/favorites/favorites.component.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;;AAEnE,qBAKa,kBAAkB;IAIjB,OAAO,CAAC,MAAM;IAHnB,SAAS,EAAE,kBAAkB,EAAE,CAAM;IACrC,WAAW,EAAE,MAAM,CAAM;gBAEZ,MAAM,EAAE,MAAM;IAE5B,QAAQ;IA2Bd,iBAAiB,CAAC,GAAG,EAAE,kBAAkB;
|
|
1
|
+
{"version":3,"file":"favorites.component.d.ts","sourceRoot":"","sources":["../../../src/lib/favorites/favorites.component.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;;AAEnE,qBAKa,kBAAkB;IAIjB,OAAO,CAAC,MAAM;IAHnB,SAAS,EAAE,kBAAkB,EAAE,CAAM;IACrC,WAAW,EAAE,MAAM,CAAM;gBAEZ,MAAM,EAAE,MAAM;IAE5B,QAAQ;IA2Bd,iBAAiB,CAAC,GAAG,EAAE,kBAAkB;IAgCzC,uBAAuB,CAAC,GAAG,EAAE,GAAG;yCAjErB,kBAAkB;2CAAlB,kBAAkB;CA2E9B"}
|
|
@@ -82,7 +82,28 @@ export class FavoritesComponent {
|
|
|
82
82
|
this.router.navigate(['resource', 'view', fav.RecordID]);
|
|
83
83
|
}
|
|
84
84
|
else {
|
|
85
|
-
|
|
85
|
+
// need to take the fav.RecordID and handle mapping it
|
|
86
|
+
// Our URL format is /resource/record/{RecordID}?Entity={Entity}
|
|
87
|
+
// but the {RecordID} part is more complicated. Since some entities have multi-valued keys we need to handle that
|
|
88
|
+
// it is done by using the PIPE | character so the RecordID would be something like this ID|123
|
|
89
|
+
// in the situation where we have multiple keys, we would have ID1|123||ID2|456 and so on.
|
|
90
|
+
// Get the entity info first to get the primary keys, then split the fav.RecordID that we have which will have a comma delimited list of values (no field names or pipes)
|
|
91
|
+
// then we can map the values to the field names and create the query string for the route
|
|
92
|
+
const splitRecordID = fav.RecordID.split(',');
|
|
93
|
+
const md = new Metadata();
|
|
94
|
+
const entityInfo = md.Entities.find(e => e.Name === fav.Entity);
|
|
95
|
+
if (entityInfo) {
|
|
96
|
+
let routeSegment = '';
|
|
97
|
+
for (let i = 0; i < entityInfo.PrimaryKeys.length; i++) {
|
|
98
|
+
if (i > 0) {
|
|
99
|
+
routeSegment += '||';
|
|
100
|
+
}
|
|
101
|
+
routeSegment += entityInfo.PrimaryKeys[i].Name + '|' + splitRecordID[i];
|
|
102
|
+
}
|
|
103
|
+
this.router.navigate(['resource', 'record', routeSegment], { queryParams: { Entity: fav.Entity } });
|
|
104
|
+
}
|
|
105
|
+
else
|
|
106
|
+
throw new Error(`Entity ${fav.Entity} not found in metadata`);
|
|
86
107
|
}
|
|
87
108
|
}
|
|
88
109
|
}
|
|
@@ -4,6 +4,7 @@ import * as i0 from "@angular/core";
|
|
|
4
4
|
export declare function LoadRecordResource(): void;
|
|
5
5
|
export declare class EntityRecordResource extends BaseResourceComponent {
|
|
6
6
|
get primaryKeyValues(): PrimaryKeyValue[];
|
|
7
|
+
static GetPrimaryKeyValues(data: ResourceData): PrimaryKeyValue[];
|
|
7
8
|
GetResourceDisplayName(data: ResourceData): Promise<string>;
|
|
8
9
|
static ɵfac: i0.ɵɵFactoryDeclaration<EntityRecordResource, never>;
|
|
9
10
|
static ɵcmp: i0.ɵɵComponentDeclaration<EntityRecordResource, "record-resource", never, {}, {}, never, never, false, never>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record-resource.component.d.ts","sourceRoot":"","sources":["../../../src/lib/resource-wrappers/record-resource.component.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEhF,OAAO,EAAY,eAAe,EAAE,MAAM,sBAAsB,CAAC;;AAGjE,wBAAgB,kBAAkB,SAEjC;AAED,qBAKa,oBAAqB,SAAQ,qBAAqB;IAC3D,IAAW,gBAAgB,IAAI,eAAe,EAAE,
|
|
1
|
+
{"version":3,"file":"record-resource.component.d.ts","sourceRoot":"","sources":["../../../src/lib/resource-wrappers/record-resource.component.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEhF,OAAO,EAAY,eAAe,EAAE,MAAM,sBAAsB,CAAC;;AAGjE,wBAAgB,kBAAkB,SAEjC;AAED,qBAKa,oBAAqB,SAAQ,qBAAqB;IAC3D,IAAW,gBAAgB,IAAI,eAAe,EAAE,CAE/C;WACa,mBAAmB,CAAC,IAAI,EAAE,YAAY,GAAG,eAAe,EAAE;IASlE,sBAAsB,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC;yCAbxD,oBAAoB;2CAApB,oBAAoB;CAwBhC"}
|
|
@@ -13,6 +13,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
13
13
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
|
+
var EntityRecordResource_1;
|
|
16
17
|
import { Component } from '@angular/core';
|
|
17
18
|
import { BaseResourceComponent } from '@memberjunction/ng-shared';
|
|
18
19
|
import { RegisterClass } from '@memberjunction/global';
|
|
@@ -23,13 +24,16 @@ import * as i1 from "../single-record/single-record.component";
|
|
|
23
24
|
export function LoadRecordResource() {
|
|
24
25
|
const test = new EntityRecordResource(); // this looks really dumb. Thing is, in production builds, tree shaking causes the class below to not be included in the bundle. This is a hack to force it to be included.
|
|
25
26
|
}
|
|
26
|
-
let EntityRecordResource = class EntityRecordResource extends BaseResourceComponent {
|
|
27
|
+
let EntityRecordResource = EntityRecordResource_1 = class EntityRecordResource extends BaseResourceComponent {
|
|
27
28
|
get primaryKeyValues() {
|
|
29
|
+
return EntityRecordResource_1.GetPrimaryKeyValues(this.Data);
|
|
30
|
+
}
|
|
31
|
+
static GetPrimaryKeyValues(data) {
|
|
28
32
|
const md = new Metadata();
|
|
29
|
-
const e = md.Entities.find(e => e.Name.trim().toLowerCase() ===
|
|
33
|
+
const e = md.Entities.find(e => e.Name.trim().toLowerCase() === data.Configuration.Entity.trim().toLowerCase());
|
|
30
34
|
if (!e)
|
|
31
|
-
throw new Error(`Entity ${
|
|
32
|
-
const pKeys = SharedService.ParsePrimaryKeys(e,
|
|
35
|
+
throw new Error(`Entity ${data.Configuration.Entity} not found in metadata`);
|
|
36
|
+
const pKeys = SharedService.ParsePrimaryKeys(e, data.ResourceRecordID);
|
|
33
37
|
return pKeys;
|
|
34
38
|
}
|
|
35
39
|
GetResourceDisplayName(data) {
|
|
@@ -38,11 +42,8 @@ let EntityRecordResource = class EntityRecordResource extends BaseResourceCompon
|
|
|
38
42
|
return '';
|
|
39
43
|
else {
|
|
40
44
|
const md = new Metadata();
|
|
41
|
-
const
|
|
42
|
-
const
|
|
43
|
-
if (!e)
|
|
44
|
-
throw new Error(`Entity ${data.Configuration.Entity} not found in metadata`);
|
|
45
|
-
const pKeys = SharedService.ParsePrimaryKeys(e, data.ResourceRecordID);
|
|
45
|
+
const pKeys = EntityRecordResource_1.GetPrimaryKeyValues(data);
|
|
46
|
+
const name = yield md.GetEntityRecordName(data.Configuration.Entity, pKeys);
|
|
46
47
|
const displayId = pKeys.length > 1 ? pKeys.map(p => p.Value).join(', ') : pKeys[0].Value;
|
|
47
48
|
return (name ? name : data.Configuration.Entity) + ` (${displayId})`;
|
|
48
49
|
}
|
|
@@ -57,7 +58,7 @@ EntityRecordResource.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: Entity
|
|
|
57
58
|
} if (rf & 2) {
|
|
58
59
|
i0.ɵɵproperty("primaryKeyValues", ctx.primaryKeyValues)("entityName", ctx.Data.Configuration.Entity);
|
|
59
60
|
} }, dependencies: [i1.SingleRecordComponent], encapsulation: 2 });
|
|
60
|
-
EntityRecordResource = __decorate([
|
|
61
|
+
EntityRecordResource = EntityRecordResource_1 = __decorate([
|
|
61
62
|
RegisterClass(BaseResourceComponent, 'Records')
|
|
62
63
|
], EntityRecordResource);
|
|
63
64
|
export { EntityRecordResource };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberjunction/ng-explorer-core",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.211",
|
|
4
4
|
"description": "MemberJunction Explorer: Core Angular Components",
|
|
5
5
|
"main": "./dist/public-api.js",
|
|
6
6
|
"typings": "./dist/public-api.d.ts",
|
|
@@ -23,7 +23,22 @@
|
|
|
23
23
|
"@angular/common": "~17.2.2",
|
|
24
24
|
"@angular/core": "~17.2.2",
|
|
25
25
|
"@angular/forms": "~17.2.2",
|
|
26
|
-
"@angular/router": "~17.2.2"
|
|
26
|
+
"@angular/router": "~17.2.2"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@memberjunction/global": "^0.9.156",
|
|
30
|
+
"@memberjunction/core": "^0.9.177",
|
|
31
|
+
"@memberjunction/ng-compare-records": "^0.9.184",
|
|
32
|
+
"@memberjunction/ng-file-storage": "^0.9.10",
|
|
33
|
+
"@memberjunction/ng-record-changes": "^0.9.118",
|
|
34
|
+
"@memberjunction/ng-container-directives": "^0.9.141",
|
|
35
|
+
"@memberjunction/ng-user-view-grid": "^0.9.219",
|
|
36
|
+
"@memberjunction/ng-query-grid": "^0.9.66",
|
|
37
|
+
"@memberjunction/ng-shared": "^0.9.36",
|
|
38
|
+
"@memberjunction/ng-ask-skip": "^0.9.107",
|
|
39
|
+
"@memberjunction/ng-auth-services": "^0.9.100",
|
|
40
|
+
"@memberjunction/ng-explorer-settings": "^0.9.14",
|
|
41
|
+
"@memberjunction/ng-base-forms": "^0.9.5",
|
|
27
42
|
"@progress/kendo-angular-grid": "~15.1.0",
|
|
28
43
|
"@progress/kendo-angular-listview": "~15.1.0",
|
|
29
44
|
"@progress/kendo-angular-notification": "~15.1.0",
|
|
@@ -34,22 +49,7 @@
|
|
|
34
49
|
"@progress/kendo-angular-charts": "~15.1.0",
|
|
35
50
|
"@progress/kendo-angular-indicators": "~15.1.0",
|
|
36
51
|
"@progress/kendo-angular-filter": "~15.1.0",
|
|
37
|
-
"@progress/kendo-svg-icons": "~2.1.0"
|
|
38
|
-
},
|
|
39
|
-
"dependencies": {
|
|
40
|
-
"@memberjunction/global": "^0.9.156",
|
|
41
|
-
"@memberjunction/core": "^0.9.177",
|
|
42
|
-
"@memberjunction/ng-compare-records": "^0.9.183",
|
|
43
|
-
"@memberjunction/ng-file-storage": "^0.9.9",
|
|
44
|
-
"@memberjunction/ng-record-changes": "^0.9.117",
|
|
45
|
-
"@memberjunction/ng-container-directives": "^0.9.141",
|
|
46
|
-
"@memberjunction/ng-user-view-grid": "^0.9.217",
|
|
47
|
-
"@memberjunction/ng-query-grid": "^0.9.65",
|
|
48
|
-
"@memberjunction/ng-shared": "^0.9.35",
|
|
49
|
-
"@memberjunction/ng-ask-skip": "^0.9.104",
|
|
50
|
-
"@memberjunction/ng-auth-services": "^0.9.100",
|
|
51
|
-
"@memberjunction/ng-explorer-settings": "^0.9.12",
|
|
52
|
-
"@memberjunction/ng-base-forms": "^0.9.3",
|
|
52
|
+
"@progress/kendo-svg-icons": "~2.1.0",
|
|
53
53
|
"tslib": "^2.3.0"
|
|
54
54
|
},
|
|
55
55
|
"sideEffects": false
|