basesite-shared-grid-lib 15.10.312 → 15.10.313

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.
@@ -1014,6 +1014,16 @@ class DropdownRenderer {
1014
1014
  this.params.onClick(params);
1015
1015
  }
1016
1016
  }
1017
+ getUrl(index) {
1018
+ const toolId = this.params?.node?.data?.toolId;
1019
+ const urls = [
1020
+ `/home/tool/details/${toolId}/tracker`,
1021
+ `/home/details/${toolId}`,
1022
+ `/home/lss/details/${toolId}`,
1023
+ `/home/tool/details/${toolId}/dac`
1024
+ ];
1025
+ return urls[index] || '#';
1026
+ }
1017
1027
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DropdownRenderer, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1018
1028
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: DropdownRenderer, isStandalone: false, selector: "lib-dropdown-renderer", ngImport: i0, template: `
1019
1029
  <div class="dropdown">
@@ -1021,13 +1031,21 @@ class DropdownRenderer {
1021
1031
  <i class="fa fa-ellipsis-v"></i>
1022
1032
  </button>
1023
1033
  <div class="dropdown-menu">
1024
- <span *ngFor='let data of dropDownData; let i = index'
1034
+ <ng-container *ngFor="let data of dropDownData; let i = index">
1035
+ <a *ngIf="i !== 4"
1036
+ class="dropdown-item"
1037
+ [href]="getUrl(i)"
1038
+ (click)="onClick($event, i)"
1039
+ [innerHTML]="data"
1040
+ target="_self"></a>
1041
+ <span *ngIf="i == 4"
1025
1042
  class="dropdown-item"
1026
1043
  (click)="onClick($event, i)"
1027
1044
  [innerHTML]="data"></span>
1045
+ </ng-container>
1028
1046
  </div>
1029
1047
  </div>
1030
- `, isInline: true, dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] }); }
1048
+ `, isInline: true, dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
1031
1049
  }
1032
1050
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DropdownRenderer, decorators: [{
1033
1051
  type: Component,
@@ -1039,10 +1057,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
1039
1057
  <i class="fa fa-ellipsis-v"></i>
1040
1058
  </button>
1041
1059
  <div class="dropdown-menu">
1042
- <span *ngFor='let data of dropDownData; let i = index'
1060
+ <ng-container *ngFor="let data of dropDownData; let i = index">
1061
+ <a *ngIf="i !== 4"
1062
+ class="dropdown-item"
1063
+ [href]="getUrl(i)"
1064
+ (click)="onClick($event, i)"
1065
+ [innerHTML]="data"
1066
+ target="_self"></a>
1067
+ <span *ngIf="i == 4"
1043
1068
  class="dropdown-item"
1044
1069
  (click)="onClick($event, i)"
1045
1070
  [innerHTML]="data"></span>
1071
+ </ng-container>
1046
1072
  </div>
1047
1073
  </div>
1048
1074
  `,
@@ -2346,16 +2372,24 @@ class GridLibraryComponent {
2346
2372
  };
2347
2373
  if (res.field === 'entityCodeLife') {
2348
2374
  colDef.cellRenderer = (params) => {
2349
- const span = document.createElement('span');
2350
- span.textContent = params.value;
2351
- span.style.cursor = 'pointer';
2352
- span.addEventListener('click', () => {
2353
- const toolId = params.data?.toolId;
2375
+ const toolId = params.data?.toolId;
2376
+ const url = toolId ? `/home/tool/details/${toolId}/tracker` : '#';
2377
+ // Creating an a tag so we get the browser right-click context menu
2378
+ const a = document.createElement('a');
2379
+ a.textContent = params.value;
2380
+ a.href = url;
2381
+ a.target = '_self';
2382
+ a.style.cursor = 'pointer';
2383
+ a.addEventListener('click', (event) => {
2354
2384
  if (toolId) {
2355
- this.router.navigate(['/home/tool/details', toolId, 'tracker']);
2385
+ // Only intercept if not ctrl/cmd/right click
2386
+ if (!(event.ctrlKey || event.metaKey || event.button === 2)) {
2387
+ event.preventDefault();
2388
+ this.router.navigate([url]);
2389
+ }
2356
2390
  }
2357
2391
  });
2358
- return span;
2392
+ return a;
2359
2393
  };
2360
2394
  }
2361
2395
  return colDef;