basesite-shared-grid-lib 21.0.1-beta.8 → 21.0.1-beta.91

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) {
@@ -2412,7 +2412,10 @@ class GridLibraryComponent {
2412
2412
  };
2413
2413
  }
2414
2414
  else if (res.columnType === 'fill') {
2415
- const valueLabelMap = this._buildFillValueLabelMap(res);
2415
+ const hasConfiguredValues = (Array.isArray(res.filterValues) && res.filterValues.length > 0) ||
2416
+ (typeof res.fieldValue === 'string' && res.fieldValue.trim() !== '') ||
2417
+ (Array.isArray(res.fieldValue) && res.fieldValue.length > 0);
2418
+ const valueLabelMap = hasConfiguredValues ? this._buildFillValueLabelMap(res) : null;
2416
2419
  return {
2417
2420
  width: 120,
2418
2421
  pinned: res.pinPosition,
@@ -2429,28 +2432,28 @@ class GridLibraryComponent {
2429
2432
  field: res.field,
2430
2433
  },
2431
2434
  filterable: res.filterable,
2432
- filter: 'agSetColumnFilter',
2433
- filterParams: {
2434
- // Provide the raw values from the backend config exactly as
2435
- // stored. The OData provider emits `(col eq 'Value')` for set
2436
- // filters — no tolower() — and SQL Server's default collation
2437
- // is case-insensitive, so casing on the wire just needs to
2438
- // match what's in the column, not be normalized.
2439
- values: (params) => this._getFillFilterValues(res, params),
2440
- refreshValuesOnOpen: true,
2441
- // Open with nothing checked so a user picking one option triggers
2442
- // a single backend request instead of "uncheck all + pick one".
2443
- defaultToNothingSelected: true,
2444
- buttons: ['reset'],
2445
- // Pretty label for each checkbox; falls back to the value itself
2446
- valueFormatter: (p) => {
2447
- if (p?.value == null || p.value === '')
2448
- return p?.value;
2449
- return valueLabelMap?.get(String(p.value)) ?? p.value;
2435
+ filter: hasConfiguredValues ? 'agSetColumnFilter' : 'agTextColumnFilter',
2436
+ filterParams: hasConfiguredValues
2437
+ ? {
2438
+ values: (params) => this._getFillFilterValues(res, params),
2439
+ refreshValuesOnOpen: true,
2440
+ defaultToNothingSelected: true,
2441
+ buttons: ['reset'],
2442
+ valueFormatter: (p) => {
2443
+ if (p?.value == null || p.value === '')
2444
+ return p?.value;
2445
+ return valueLabelMap?.get(String(p.value)) ?? p.value;
2446
+ },
2447
+ textFormatter: (v) => v == null ? '' : String(v).trim().toLowerCase(),
2448
+ }
2449
+ : {
2450
+ comparator: (filterLocalDateAtMidnight, cellValue) => {
2451
+ if (cellValue == null)
2452
+ return 0;
2453
+ return 0;
2454
+ },
2455
+ buttons: ['reset'],
2450
2456
  },
2451
- // Case-insensitive search within the dropdown's filter box
2452
- textFormatter: (v) => v == null ? '' : String(v).trim().toLowerCase(),
2453
- },
2454
2457
  };
2455
2458
  }
2456
2459
  else {
@@ -2551,35 +2554,6 @@ class GridLibraryComponent {
2551
2554
  }
2552
2555
  });
2553
2556
  }
2554
- /**
2555
- * Derive the $select field list for OData requests from the configured
2556
- * column definitions. Includes every data-backed field but skips action
2557
- * columns (buttons, action dropdowns) whose `field` isn't a real entity
2558
- * property. Deduped so a field declared twice — e.g. for both display and
2559
- * tooltip — only appears once in the select clause.
2560
- */
2561
- _getServerSelectFields() {
2562
- const source = (this.initialColumnDef && this.initialColumnDef.length > 0)
2563
- ? this.initialColumnDef
2564
- : (this.columnDefs || []);
2565
- const fields = new Set();
2566
- for (const res of source) {
2567
- if (!res)
2568
- continue;
2569
- // Skip action buttons — their `field` is usually a label slot, not a
2570
- // backing entity property, and OData will 400 on unknown properties.
2571
- if (res.isButton === true)
2572
- continue;
2573
- // Skip action dropdowns (e.g. "Create/View DAC") for the same reason.
2574
- if (res.columnType === 'dropdown')
2575
- continue;
2576
- const field = res.field;
2577
- if (typeof field === 'string' && field.length > 0) {
2578
- fields.add(field);
2579
- }
2580
- }
2581
- return Array.from(fields);
2582
- }
2583
2557
  _getFillFilterValues(res, params) {
2584
2558
  const configured = res?.filterValues;
2585
2559
  if (Array.isArray(configured) && configured.length > 0) {
@@ -2788,18 +2762,6 @@ class GridLibraryComponent {
2788
2762
  let hasRetried = false;
2789
2763
  this.odataProvider = new OdataServerSideProvider({
2790
2764
  isCaseSensitiveStringFilter: false,
2791
- // Always send $select listing every data-backed field from columnDefs.
2792
- // Without this, OData/EF projects the entire entity, which inflates
2793
- // both the SQL projection and the JSON payload (and the AutoMapper
2794
- // mapping cost). With it, the API returns only the columns the grid
2795
- // actually renders. The OData provider already deletes options.select
2796
- // for $apply/groupby requests, so aggregation queries aren't affected.
2797
- beforeRequest: (options) => {
2798
- const selectFields = this._getServerSelectFields();
2799
- if (selectFields.length > 0) {
2800
- options.select = selectFields;
2801
- }
2802
- },
2803
2765
  callApi: (options) => {
2804
2766
  const url = this.setExternalFilters(options);
2805
2767
  console.log('Server-side API call:', url);