@memberjunction/ng-user-view-grid 0.9.99 → 0.9.101

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,7 +1,7 @@
1
1
  import { ElementRef, EventEmitter, OnInit, AfterViewInit } from '@angular/core';
2
2
  import { FormBuilder, FormGroup } from '@angular/forms';
3
3
  import { Router } from '@angular/router';
4
- import { BaseEntity, RunViewParams, EntityFieldInfo, EntityInfo } from '@memberjunction/core';
4
+ import { BaseEntity, RunViewParams, EntityFieldInfo, EntityInfo, PrimaryKeyValue } from '@memberjunction/core';
5
5
  import { ViewColumnInfo, UserViewEntityExtended } from '@memberjunction/core-entities';
6
6
  import { CellClickEvent, GridDataResult, PageChangeEvent, GridComponent, CellCloseEvent, ColumnReorderEvent, ColumnResizeArgs, SelectionEvent, SelectableSettings } from "@progress/kendo-angular-grid";
7
7
  import { ExcelExportComponent } from '@progress/kendo-angular-excel-export';
@@ -10,7 +10,7 @@ import * as i0 from "@angular/core";
10
10
  export type GridRowClickedEvent = {
11
11
  entityId: number;
12
12
  entityName: string;
13
- primaryKeyValue: any;
13
+ primaryKeyValues: PrimaryKeyValue[];
14
14
  };
15
15
  export type GridRowEditedEvent = {
16
16
  record: BaseEntity;
@@ -82,6 +82,7 @@ export declare class UserViewGridComponent implements OnInit, AfterViewInit {
82
82
  columnResize(args: ColumnResizeArgs[]): Promise<void>;
83
83
  sortChanged(sort: any): Promise<void>;
84
84
  cellClickHandler(args: CellClickEvent): Promise<void>;
85
+ GeneratePrimaryKeyValueString(pkVals: PrimaryKeyValue[]): string;
85
86
  createFormGroup(dataItem: any): FormGroup;
86
87
  getEditor(ef: EntityFieldInfo): "boolean" | "text" | "numeric" | "date";
87
88
  cellCloseHandler(args: CellCloseEvent): Promise<void>;
@@ -515,11 +515,14 @@ export class UserViewGridComponent {
515
515
  if (this.compareMode || this.mergeMode)
516
516
  return;
517
517
  if (this._entityInfo) {
518
- const pkeyVal = this.viewData[args.rowIndex][this._entityInfo.PrimaryKey.Name];
518
+ const pkeyVals = [];
519
+ this._entityInfo.PrimaryKeys.forEach((pkey) => {
520
+ pkeyVals.push({ FieldName: pkey.Name, Value: this.viewData[args.rowIndex][pkey.Name] });
521
+ });
519
522
  this.rowClicked.emit({
520
523
  entityId: this._entityInfo.ID,
521
524
  entityName: this._entityInfo.Name,
522
- primaryKeyValue: pkeyVal
525
+ primaryKeyValues: pkeyVals
523
526
  });
524
527
  if (this._entityInfo.AllowUpdateAPI &&
525
528
  this.EditMode !== "None") {
@@ -531,11 +534,15 @@ export class UserViewGridComponent {
531
534
  }
532
535
  if (!this.InEditMode && this.AutoNavigate) {
533
536
  // tell app router to go to this record
534
- this.router.navigate(['resource', 'record', pkeyVal], { queryParams: { Entity: this._entityInfo.Name } });
537
+ const pkVals = this.GeneratePrimaryKeyValueString(pkeyVals);
538
+ this.router.navigate(['resource', 'record', pkVals], { queryParams: { Entity: this._entityInfo.Name } });
535
539
  }
536
540
  }
537
541
  });
538
542
  }
543
+ GeneratePrimaryKeyValueString(pkVals) {
544
+ return pkVals.length > 1 ? pkVals.map(pk => pk.FieldName + '|' + pk.Value).join('||') : pkVals[0].Value;
545
+ }
539
546
  createFormGroup(dataItem) {
540
547
  const groupFields = {};
541
548
  this.viewColumns.forEach((vc) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memberjunction/ng-user-view-grid",
3
- "version": "0.9.99",
3
+ "version": "0.9.101",
4
4
  "description": "MemberJunction: Angular Grid to display dynamic and saved user views for any entity in MemberJunction.",
5
5
  "main": "./dist/public-api.js",
6
6
  "typings": "./dist/public-api.d.ts",
@@ -26,11 +26,11 @@
26
26
  "@progress/kendo-angular-grid": "^12.1.0"
27
27
  },
28
28
  "dependencies": {
29
- "@memberjunction/core-entities": "^0.9.88",
29
+ "@memberjunction/core-entities": "^0.9.89",
30
30
  "@memberjunction/global": "^0.9.107",
31
- "@memberjunction/core": "^0.9.114",
32
- "@memberjunction/ng-compare-records": "^0.9.118",
33
- "@memberjunction/ng-container-directives": "^0.9.91",
31
+ "@memberjunction/core": "^0.9.115",
32
+ "@memberjunction/ng-compare-records": "^0.9.119",
33
+ "@memberjunction/ng-container-directives": "^0.9.92",
34
34
  "tslib": "^2.3.0"
35
35
  },
36
36
  "sideEffects": false