@backstage/plugin-catalog-react 0.0.0-nightly-20220824025846 → 0.0.0-nightly-20220827025548

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,18 +1,19 @@
1
1
  # @backstage/plugin-catalog-react
2
2
 
3
- ## 0.0.0-nightly-20220824025846
3
+ ## 0.0.0-nightly-20220827025548
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-20220824025846
10
- - @backstage/core-components@0.0.0-nightly-20220824025846
11
- - @backstage/catalog-client@0.0.0-nightly-20220824025846
12
- - @backstage/integration@0.0.0-nightly-20220824025846
13
- - @backstage/plugin-permission-common@0.0.0-nightly-20220824025846
14
- - @backstage/plugin-catalog-common@0.0.0-nightly-20220824025846
15
- - @backstage/plugin-permission-react@0.0.0-nightly-20220824025846
10
+ - @backstage/core-plugin-api@0.0.0-nightly-20220827025548
11
+ - @backstage/core-components@0.0.0-nightly-20220827025548
12
+ - @backstage/catalog-client@0.0.0-nightly-20220827025548
13
+ - @backstage/integration@0.0.0-nightly-20220827025548
14
+ - @backstage/plugin-permission-common@0.0.0-nightly-20220827025548
15
+ - @backstage/plugin-catalog-common@0.0.0-nightly-20220827025548
16
+ - @backstage/plugin-permission-react@0.0.0-nightly-20220827025548
16
17
 
17
18
  ## 1.1.4-next.0
18
19
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-catalog-react",
3
- "version": "0.0.0-nightly-20220824025846",
3
+ "version": "0.0.0-nightly-20220827025548",
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 {