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

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,17 +1,21 @@
1
1
  # @backstage/plugin-catalog-react
2
2
 
3
- ## 0.0.0-nightly-20220323023253
3
+ ## 0.0.0-nightly-20220324023116
4
4
 
5
5
  ### Patch Changes
6
6
 
7
+ - 0ffd88a90e: Prevent permissions with types other than `ResourcePermission<'catalog-entity'>` from being used with the `useEntityPermission` hook.
7
8
  - a496cee4d1: Add support for string refs to the `EntityRefLinks` component
8
9
  - d34900af81: Added a new `NextScaffolderRouter` which will eventually replace the exiting router
9
- - Updated dependencies
10
- - @backstage/catalog-model@0.0.0-nightly-20220323023253
11
- - @backstage/integration@0.0.0-nightly-20220323023253
12
- - @backstage/core-components@0.0.0-nightly-20220323023253
13
- - @backstage/plugin-permission-common@0.0.0-nightly-20220323023253
14
- - @backstage/catalog-client@0.0.0-nightly-20220323023253
10
+ - 4431873583: Update `usePermission` usage.
11
+ - 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
15
19
 
16
20
  ## 1.0.1-next.0
17
21
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-catalog-react",
3
- "version": "0.0.0-nightly-20220323023253",
3
+ "version": "0.0.0-nightly-20220324023116",
4
4
  "main": "../dist/index.esm.js",
5
5
  "types": "../dist/index.alpha.d.ts"
6
6
  }
@@ -17,10 +17,10 @@ import { IconButton } from '@material-ui/core';
17
17
  import { LinkProps } from '@backstage/core-components';
18
18
  import { Observable } from '@backstage/types';
19
19
  import { Overrides } from '@material-ui/core/styles/overrides';
20
- import { Permission } from '@backstage/plugin-permission-common';
21
20
  import { PropsWithChildren } from 'react';
22
21
  import { default as React_2 } from 'react';
23
22
  import { ReactNode } from 'react';
23
+ import { ResourcePermission } from '@backstage/plugin-permission-common';
24
24
  import { RouteRef } from '@backstage/core-plugin-api';
25
25
  import { ScmIntegrationRegistry } from '@backstage/integration';
26
26
  import { StyleRules } from '@material-ui/core/styles/withStyles';
@@ -585,14 +585,14 @@ export declare function useEntityOwnership(): {
585
585
  * A thin wrapper around the
586
586
  * {@link @backstage/plugin-permission-react#usePermission} hook which uses the
587
587
  * current entity in context to make an authorization request for the given
588
- * permission.
588
+ * {@link @backstage/plugin-catalog-common#CatalogEntityPermission}.
589
589
  *
590
590
  * Note: this hook blocks the permission request until the entity has loaded in
591
591
  * context. If you have the entityRef and need concurrent requests, use the
592
592
  * `usePermission` hook directly.
593
593
  * @alpha
594
594
  */
595
- export declare function useEntityPermission(permission: Permission): {
595
+ export declare function useEntityPermission(permission: ResourcePermission<'catalog-entity'>): {
596
596
  loading: boolean;
597
597
  allowed: boolean;
598
598
  error?: Error;
@@ -17,10 +17,10 @@ import { IconButton } from '@material-ui/core';
17
17
  import { LinkProps } from '@backstage/core-components';
18
18
  import { Observable } from '@backstage/types';
19
19
  import { Overrides } from '@material-ui/core/styles/overrides';
20
- import { Permission } from '@backstage/plugin-permission-common';
21
20
  import { PropsWithChildren } from 'react';
22
21
  import { default as React_2 } from 'react';
23
22
  import { ReactNode } from 'react';
23
+ import { ResourcePermission } from '@backstage/plugin-permission-common';
24
24
  import { RouteRef } from '@backstage/core-plugin-api';
25
25
  import { ScmIntegrationRegistry } from '@backstage/integration';
26
26
  import { StyleRules } from '@material-ui/core/styles/withStyles';
package/dist/index.d.ts CHANGED
@@ -17,10 +17,10 @@ import { IconButton } from '@material-ui/core';
17
17
  import { LinkProps } from '@backstage/core-components';
18
18
  import { Observable } from '@backstage/types';
19
19
  import { Overrides } from '@material-ui/core/styles/overrides';
20
- import { Permission } from '@backstage/plugin-permission-common';
21
20
  import { PropsWithChildren } from 'react';
22
21
  import { default as React_2 } from 'react';
23
22
  import { ReactNode } from 'react';
23
+ import { ResourcePermission } from '@backstage/plugin-permission-common';
24
24
  import { RouteRef } from '@backstage/core-plugin-api';
25
25
  import { ScmIntegrationRegistry } from '@backstage/integration';
26
26
  import { StyleRules } from '@material-ui/core/styles/withStyles';
package/dist/index.esm.js CHANGED
@@ -649,7 +649,10 @@ function useEntityPermission(permission) {
649
649
  allowed,
650
650
  loading: loadingPermission,
651
651
  error: permissionError
652
- } = usePermission(permission, entity ? stringifyEntityRef(entity) : void 0);
652
+ } = usePermission({
653
+ permission,
654
+ resourceRef: entity ? stringifyEntityRef(entity) : void 0
655
+ });
653
656
  if (loadingEntity || loadingPermission) {
654
657
  return { loading: true, allowed: false };
655
658
  }