@backstage/plugin-catalog-react 0.0.0-nightly-20220324023116 → 0.0.0-nightly-20220325022909

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,21 +1,25 @@
1
1
  # @backstage/plugin-catalog-react
2
2
 
3
- ## 0.0.0-nightly-20220324023116
3
+ ## 0.0.0-nightly-20220325022909
4
4
 
5
5
  ### Patch Changes
6
6
 
7
7
  - 0ffd88a90e: Prevent permissions with types other than `ResourcePermission<'catalog-entity'>` from being used with the `useEntityPermission` hook.
8
+ - 4af82967f4: Decouple tags picker from backend entities
9
+
10
+ `EntityTagPicker` fetches all the tags independently and it doesn't require all the entities to be available client side.
11
+
8
12
  - a496cee4d1: Add support for string refs to the `EntityRefLinks` component
9
13
  - d34900af81: Added a new `NextScaffolderRouter` which will eventually replace the exiting router
10
14
  - 4431873583: Update `usePermission` usage.
11
15
  - Updated dependencies
12
- - @backstage/plugin-permission-react@0.0.0-nightly-20220324023116
13
- - @backstage/catalog-model@0.0.0-nightly-20220324023116
14
- - @backstage/plugin-catalog-common@0.0.0-nightly-20220324023116
15
- - @backstage/integration@0.0.0-nightly-20220324023116
16
- - @backstage/core-components@0.0.0-nightly-20220324023116
17
- - @backstage/plugin-permission-common@0.0.0-nightly-20220324023116
18
- - @backstage/catalog-client@0.0.0-nightly-20220324023116
16
+ - @backstage/plugin-permission-react@0.0.0-nightly-20220325022909
17
+ - @backstage/catalog-model@0.0.0-nightly-20220325022909
18
+ - @backstage/plugin-catalog-common@0.0.0-nightly-20220325022909
19
+ - @backstage/integration@0.0.0-nightly-20220325022909
20
+ - @backstage/core-components@0.0.0-nightly-20220325022909
21
+ - @backstage/plugin-permission-common@0.0.0-nightly-20220325022909
22
+ - @backstage/catalog-client@0.0.0-nightly-20220325022909
19
23
 
20
24
  ## 1.0.1-next.0
21
25
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-catalog-react",
3
- "version": "0.0.0-nightly-20220324023116",
3
+ "version": "0.0.0-nightly-20220325022909",
4
4
  "main": "../dist/index.esm.js",
5
5
  "types": "../dist/index.alpha.d.ts"
6
6
  }
package/dist/index.esm.js CHANGED
@@ -1032,7 +1032,17 @@ const checkedIcon = /* @__PURE__ */ React.createElement(CheckBoxIcon, {
1032
1032
  const EntityTagPicker = () => {
1033
1033
  var _a, _b;
1034
1034
  const classes = useStyles$7();
1035
- const { updateFilters, backendEntities, filters, queryParameters } = useEntityList();
1035
+ const { updateFilters, filters, queryParameters } = useEntityList();
1036
+ const catalogApi = useApi(catalogApiRef);
1037
+ const { value: availableTags } = useAsync(async () => {
1038
+ var _a2;
1039
+ const facet = "metadata.tags";
1040
+ const { facets } = await catalogApi.getEntityFacets({
1041
+ facets: [facet],
1042
+ filter: (_a2 = filters.kind) == null ? void 0 : _a2.getCatalogFilters()
1043
+ });
1044
+ return facets[facet].map(({ value }) => value);
1045
+ }, [filters.kind]);
1036
1046
  const queryParamTags = useMemo(() => [queryParameters.tags].flat().filter(Boolean), [queryParameters]);
1037
1047
  const [selectedTags, setSelectedTags] = useState(queryParamTags.length ? queryParamTags : (_b = (_a = filters.tags) == null ? void 0 : _a.values) != null ? _b : []);
1038
1048
  useEffect(() => {
@@ -1045,10 +1055,7 @@ const EntityTagPicker = () => {
1045
1055
  tags: selectedTags.length ? new EntityTagFilter(selectedTags) : void 0
1046
1056
  });
1047
1057
  }, [selectedTags, updateFilters]);
1048
- const availableTags = useMemo(() => [
1049
- ...new Set(backendEntities.flatMap((e) => e.metadata.tags).filter(Boolean))
1050
- ].sort(), [backendEntities]);
1051
- if (!availableTags.length)
1058
+ if (!(availableTags == null ? void 0 : availableTags.length))
1052
1059
  return null;
1053
1060
  return /* @__PURE__ */ React.createElement(Box, {
1054
1061
  pb: 1,