basesite-shared-grid-lib 21.0.1-beta.9 → 21.0.1-beta.93

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.
@@ -58,7 +58,7 @@ class GridLibraryService {
58
58
  this.baseUrl = 'https://fcems.intel.com/designhub/api';
59
59
  }
60
60
  else {
61
- this.baseUrl = 'https://fcemstest.intel.com/designhub/api';
61
+ this.baseUrl = 'https://fcelspx-test.intel.com/designhub/api';
62
62
  }
63
63
  }
64
64
  getColDef(gridId) {
@@ -2141,6 +2141,13 @@ class GridLibraryComponent {
2141
2141
  this._Tool_Owner = 'Tool Owner';
2142
2142
  this._Area_Coordinator = 'Area Coordinator';
2143
2143
  this._TiPm = 'TI PM';
2144
+ // Columns that are completely removed for specific sites. A restricted column
2145
+ // is stripped from the coldefs entirely, so no saved view can reveal it, it
2146
+ // never appears in the column menu, and it is excluded from exports — the user
2147
+ // cannot activate it in any way. Keyed by siteId (compared as a string).
2148
+ this._restrictedColumnsBySite = {
2149
+ '4': ['funding'],
2150
+ };
2144
2151
  //unsubscribe subject
2145
2152
  this.unsubscribe$ = new Subject();
2146
2153
  //custom pagination properties
@@ -2329,8 +2336,14 @@ class GridLibraryComponent {
2329
2336
  return !column.visible || isDacHidden;
2330
2337
  }
2331
2338
  }
2339
+ _isColumnRestricted(field) {
2340
+ const restricted = this._restrictedColumnsBySite[String(this.siteId)];
2341
+ return !!restricted && restricted.includes(field);
2342
+ }
2332
2343
  _mapColumnDef(columns, userRoles) {
2333
- return columns?.map((res) => {
2344
+ return columns
2345
+ ?.filter((res) => !this._isColumnRestricted(res.field))
2346
+ .map((res) => {
2334
2347
  if (res.isButton === false) {
2335
2348
  if (res.columnType === 'checkbox') {
2336
2349
  return {
@@ -2412,7 +2425,10 @@ class GridLibraryComponent {
2412
2425
  };
2413
2426
  }
2414
2427
  else if (res.columnType === 'fill') {
2415
- const valueLabelMap = this._buildFillValueLabelMap(res);
2428
+ const hasConfiguredValues = (Array.isArray(res.filterValues) && res.filterValues.length > 0) ||
2429
+ (typeof res.fieldValue === 'string' && res.fieldValue.trim() !== '') ||
2430
+ (Array.isArray(res.fieldValue) && res.fieldValue.length > 0);
2431
+ const valueLabelMap = hasConfiguredValues ? this._buildFillValueLabelMap(res) : null;
2416
2432
  return {
2417
2433
  width: 120,
2418
2434
  pinned: res.pinPosition,
@@ -2429,25 +2445,28 @@ class GridLibraryComponent {
2429
2445
  field: res.field,
2430
2446
  },
2431
2447
  filterable: res.filterable,
2432
- filter: 'agSetColumnFilter',
2433
- filterParams: {
2434
- // Provide the raw values from the backend config; OData provider
2435
- // handles case-insensitive matching server-side via tolower().
2436
- values: (params) => this._getFillFilterValues(res, params),
2437
- refreshValuesOnOpen: true,
2438
- // Open with nothing checked so a user picking one option triggers
2439
- // a single backend request instead of "uncheck all + pick one".
2440
- defaultToNothingSelected: true,
2441
- buttons: ['reset'],
2442
- // Pretty label for each checkbox; falls back to the value itself
2443
- valueFormatter: (p) => {
2444
- if (p?.value == null || p.value === '')
2445
- return p?.value;
2446
- return valueLabelMap?.get(String(p.value)) ?? p.value;
2448
+ filter: hasConfiguredValues ? 'agSetColumnFilter' : 'agTextColumnFilter',
2449
+ filterParams: hasConfiguredValues
2450
+ ? {
2451
+ values: (params) => this._getFillFilterValues(res, params),
2452
+ refreshValuesOnOpen: true,
2453
+ defaultToNothingSelected: true,
2454
+ buttons: ['reset'],
2455
+ valueFormatter: (p) => {
2456
+ if (p?.value == null || p.value === '')
2457
+ return p?.value;
2458
+ return valueLabelMap?.get(String(p.value)) ?? p.value;
2459
+ },
2460
+ textFormatter: (v) => v == null ? '' : String(v).trim().toLowerCase(),
2461
+ }
2462
+ : {
2463
+ comparator: (filterLocalDateAtMidnight, cellValue) => {
2464
+ if (cellValue == null)
2465
+ return 0;
2466
+ return 0;
2467
+ },
2468
+ buttons: ['reset'],
2447
2469
  },
2448
- // Case-insensitive search within the dropdown's filter box
2449
- textFormatter: (v) => v == null ? '' : String(v).trim().toLowerCase(),
2450
- },
2451
2470
  };
2452
2471
  }
2453
2472
  else {
@@ -2968,6 +2987,7 @@ class GridLibraryComponent {
2968
2987
  let columnsToBeDisplayedForExcel = [];
2969
2988
  this.exportColumnsList.forEach((column) => {
2970
2989
  if (column.visible == true &&
2990
+ !this._isColumnRestricted(column.field) &&
2971
2991
  column.columnType != 'checkbox' &&
2972
2992
  column.columnType != 'dropdown' &&
2973
2993
  column.columnType != '') {