@salesforcedevs/dw-components 1.24.0 → 1.27.12

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/dw-components",
3
- "version": "1.24.0",
3
+ "version": "1.27.12",
4
4
  "description": "Lightning web components for https://developer.salesforce.com",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -26,9 +26,5 @@
26
26
  "@types/setimmediate": "1.0.4",
27
27
  "setimmediate": "1.0.5"
28
28
  },
29
- "volta": {
30
- "node": "20.19.0",
31
- "yarn": "1.22.19"
32
- },
33
- "gitHead": "e05270a253164e2f1ce49808e4a4f962037890af"
29
+ "gitHead": "2a64d588c773dba9a5d382e3cf008b9935c03fb9"
34
30
  }
@@ -261,17 +261,35 @@ export default class DocsGrid extends LightningElement {
261
261
  this.normalizeProductFilter(name)
262
262
  ) as Filter[];
263
263
 
264
- const filters = [
264
+ this._productFiltersList = this.getSortedFilters([
265
265
  ...externalMicrositesFilters,
266
266
  ...otherDocsFilters,
267
267
  ...apiDocsFilters
268
- ].filter((filter) => filter.value);
268
+ ]);
269
+ }
269
270
 
270
- this._productFiltersList = orderBy(
271
- uniqBy(filters as any, "value"),
271
+ private getSortedFilters(filters: Filter[]): Filter[] {
272
+ const specificFilters = [] as Filter[];
273
+ let allServicesFilter: Filter | undefined;
274
+
275
+ filters.forEach((filter) => {
276
+ if (filter.value === PRODUCT_FILTER_ALL_SERVICES) {
277
+ allServicesFilter = filter;
278
+ } else if (filter.value) {
279
+ // skip empty filters
280
+ specificFilters.push(filter);
281
+ }
282
+ });
283
+
284
+ const orderedSpecificFilters = orderBy(
285
+ uniqBy(specificFilters, "value"),
272
286
  ["value"],
273
287
  ["asc"]
274
288
  );
289
+
290
+ return allServicesFilter
291
+ ? [allServicesFilter, ...orderedSpecificFilters]
292
+ : orderedSpecificFilters;
275
293
  }
276
294
 
277
295
  @api
@@ -432,7 +450,7 @@ export default class DocsGrid extends LightningElement {
432
450
 
433
451
  normalizeProductFilter(val: string): Filter {
434
452
  return {
435
- label: val,
453
+ label: val === "ai" ? "AI" : val,
436
454
  value: val && val.toLowerCase()
437
455
  };
438
456
  }