@backstage/plugin-catalog-react 0.0.0-nightly-20220823025832 → 0.0.0-nightly-20220826030106

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/CHANGELOG.md CHANGED
@@ -1,16 +1,33 @@
1
1
  # @backstage/plugin-catalog-react
2
2
 
3
- ## 0.0.0-nightly-20220823025832
3
+ ## 0.0.0-nightly-20220826030106
4
4
 
5
5
  ### Patch Changes
6
6
 
7
+ - a6d551fad9: Properly handle free-text entity filtering in the case of empty tag arrays
7
8
  - ef9ab322de: Minor API signatures cleanup
8
9
  - Updated dependencies
9
- - @backstage/core-plugin-api@0.0.0-nightly-20220823025832
10
- - @backstage/core-components@0.0.0-nightly-20220823025832
11
- - @backstage/catalog-client@0.0.0-nightly-20220823025832
12
- - @backstage/integration@0.0.0-nightly-20220823025832
13
- - @backstage/plugin-permission-common@0.0.0-nightly-20220823025832
10
+ - @backstage/core-plugin-api@0.0.0-nightly-20220826030106
11
+ - @backstage/core-components@0.0.0-nightly-20220826030106
12
+ - @backstage/catalog-client@0.0.0-nightly-20220826030106
13
+ - @backstage/integration@0.0.0-nightly-20220826030106
14
+ - @backstage/plugin-permission-common@0.0.0-nightly-20220826030106
15
+ - @backstage/plugin-catalog-common@0.0.0-nightly-20220826030106
16
+ - @backstage/plugin-permission-react@0.0.0-nightly-20220826030106
17
+
18
+ ## 1.1.4-next.0
19
+
20
+ ### Patch Changes
21
+
22
+ - ef9ab322de: Minor API signatures cleanup
23
+ - Updated dependencies
24
+ - @backstage/core-plugin-api@1.0.6-next.0
25
+ - @backstage/core-components@0.11.1-next.0
26
+ - @backstage/catalog-client@1.0.5-next.0
27
+ - @backstage/integration@1.3.1-next.0
28
+ - @backstage/plugin-permission-common@0.6.4-next.0
29
+ - @backstage/plugin-permission-react@0.4.5-next.0
30
+ - @backstage/plugin-catalog-common@1.0.6-next.0
14
31
 
15
32
  ## 1.1.3
16
33
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-catalog-react",
3
- "version": "0.0.0-nightly-20220823025832",
3
+ "version": "0.0.0-nightly-20220826030106",
4
4
  "main": "../dist/index.esm.js",
5
5
  "types": "../dist/index.alpha.d.ts"
6
6
  }
@@ -441,6 +441,7 @@ export declare class EntityTextFilter implements EntityFilter {
441
441
  readonly value: string;
442
442
  constructor(value: string);
443
443
  filterEntity(entity: Entity): boolean;
444
+ private toUpperArray;
444
445
  }
445
446
 
446
447
  /**
@@ -441,6 +441,7 @@ export declare class EntityTextFilter implements EntityFilter {
441
441
  readonly value: string;
442
442
  constructor(value: string);
443
443
  filterEntity(entity: Entity): boolean;
444
+ private toUpperArray;
444
445
  }
445
446
 
446
447
  /**
package/dist/index.d.ts CHANGED
@@ -441,6 +441,7 @@ export declare class EntityTextFilter implements EntityFilter {
441
441
  readonly value: string;
442
442
  constructor(value: string);
443
443
  filterEntity(entity: Entity): boolean;
444
+ private toUpperArray;
444
445
  }
445
446
 
446
447
  /**
package/dist/index.esm.js CHANGED
@@ -474,9 +474,21 @@ class EntityTextFilter {
474
474
  this.value = value;
475
475
  }
476
476
  filterEntity(entity) {
477
- var _a;
478
- const upperCaseValue = this.value.toLocaleUpperCase("en-US");
479
- return entity.metadata.name.toLocaleUpperCase("en-US").includes(upperCaseValue) || `${entity.metadata.title}`.toLocaleUpperCase("en-US").includes(upperCaseValue) || ((_a = entity.metadata.tags) == null ? void 0 : _a.join("").toLocaleUpperCase("en-US").indexOf(upperCaseValue)) !== -1;
477
+ const words = this.toUpperArray(this.value.split(/\s/));
478
+ const exactMatch = this.toUpperArray([entity.metadata.tags]);
479
+ const partialMatch = this.toUpperArray([
480
+ entity.metadata.name,
481
+ entity.metadata.title
482
+ ]);
483
+ for (const word of words) {
484
+ if (exactMatch.every((m) => m !== word) && partialMatch.every((m) => !m.includes(word))) {
485
+ return false;
486
+ }
487
+ }
488
+ return true;
489
+ }
490
+ toUpperArray(value) {
491
+ return value.flat().filter((m) => Boolean(m)).map((m) => m.toLocaleUpperCase("en-US"));
480
492
  }
481
493
  }
482
494
  class EntityOwnerFilter {