@backstage/plugin-catalog-react 0.6.13-next.1 → 0.6.15

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,5 +1,73 @@
1
1
  # @backstage/plugin-catalog-react
2
2
 
3
+ ## 0.6.15
4
+
5
+ ### Patch Changes
6
+
7
+ - 1ed305728b: Bump `node-fetch` to version 2.6.7 and `cross-fetch` to version 3.1.5
8
+ - c77c5c7eb6: Added `backstage.role` to `package.json`
9
+ - 538ca90790: Use updated type names from `@backstage/catalog-client`
10
+ - edbc03814a: Replace usage of `serializeEntityRef` with `stringifyEntityRef`
11
+ - 244d24ebc4: Import `Location` from the `@backstage/catalog-client` package.
12
+ - deaf6065db: Adapt to the new `CatalogApi.getLocationByRef`
13
+ - 216725b434: Updated to use new names for `parseLocationRef` and `stringifyLocationRef`
14
+ - e72d371296: Use `TemplateEntityV1beta2` from `@backstage/plugin-scaffolder-common` instead
15
+ of `@backstage/catalog-model`.
16
+ - 98d1aa1ea1: Fix CatalogPage showing all components when owned filter was pre-selected
17
+ - 27eccab216: Replaces use of deprecated catalog-model constants.
18
+ - 7aeb491394: Replace use of deprecated `ENTITY_DEFAULT_NAMESPACE` constant with `DEFAULT_NAMESPACE`.
19
+ - Updated dependencies
20
+ - @backstage/catalog-client@0.7.0
21
+ - @backstage/core-components@0.8.9
22
+ - @backstage/core-plugin-api@0.6.1
23
+ - @backstage/errors@0.2.1
24
+ - @backstage/integration@0.7.3
25
+ - @backstage/plugin-permission-common@0.5.0
26
+ - @backstage/plugin-permission-react@0.3.1
27
+ - @backstage/catalog-model@0.10.0
28
+ - @backstage/types@0.1.2
29
+ - @backstage/version-bridge@0.1.2
30
+
31
+ ## 0.6.14
32
+
33
+ ### Patch Changes
34
+
35
+ - 680e7c7452: Updated `useEntityListProvider` and catalog pickers to respond to external changes to query parameters in the URL, such as two sidebar links that apply different catalog filters.
36
+ - f8633307c4: Added an "inspect" entry in the entity three-dots menu, for lower level catalog
37
+ insights and debugging.
38
+ - 19155e0939: Updated React component type declarations to avoid exporting exotic component types.
39
+ - 7bb1bde7f6: Minor API cleanups
40
+ - Updated dependencies
41
+ - @backstage/catalog-client@0.6.0
42
+ - @backstage/core-components@0.8.8
43
+
44
+ ## 0.6.14-next.0
45
+
46
+ ### Patch Changes
47
+
48
+ - 680e7c7452: Updated `useEntityListProvider` and catalog pickers to respond to external changes to query parameters in the URL, such as two sidebar links that apply different catalog filters.
49
+ - 7bb1bde7f6: Minor API cleanups
50
+ - Updated dependencies
51
+ - @backstage/core-components@0.8.8-next.0
52
+
53
+ ## 0.6.13
54
+
55
+ ### Patch Changes
56
+
57
+ - f7257dff6f: The `<Link />` component now accepts a `noTrack` prop, which prevents the `click` event from being captured by the Analytics API. This can be used if tracking is explicitly not warranted, or in order to use custom link tracking in specific situations.
58
+ - 300f8cdaee: Fix bug: previously the filter would be set to "all" on page load, even if the
59
+ `initiallySelectedFilter` on the `DefaultCatalogPage` was set to something else,
60
+ or a different query parameter was supplied. Now, the prop and query parameters
61
+ control the filter as expected. Additionally, after this change any filters
62
+ which match 0 items will be disabled, and the filter will be reverted to 'all'
63
+ if they're set on page load.
64
+ - 6acc8f7db7: Add caching to the useEntityPermission hook
65
+
66
+ The hook now caches the authorization decision based on the permission + the entity, and returns the cache match value as the default `allowed` value while loading. This helps avoid flicker in UI elements that would be conditionally rendered based on the `allowed` result of this hook.
67
+
68
+ - Updated dependencies
69
+ - @backstage/core-components@0.8.7
70
+
3
71
  ## 0.6.13-next.1
4
72
 
5
73
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { CatalogApi, CatalogListResponse } from '@backstage/catalog-client';
2
+ import { CatalogApi, GetEntitiesResponse } from '@backstage/catalog-client';
3
3
  export { CATALOG_FILTER_EXISTS, CatalogApi } from '@backstage/catalog-client';
4
4
  import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
5
5
  import { ApiRef, StorageApi, IdentityApi } from '@backstage/core-plugin-api';
@@ -60,32 +60,60 @@ declare class DefaultStarredEntitiesApi implements StarredEntitiesApi {
60
60
  private notifyChanges;
61
61
  }
62
62
 
63
- declare type EntityKindFilterProps = {
63
+ /**
64
+ * Props for {@link EntityKindPicker}.
65
+ *
66
+ * @public
67
+ */
68
+ interface EntityKindPickerProps {
64
69
  initialFilter?: string;
65
70
  hidden: boolean;
66
- };
67
- declare const EntityKindPicker: ({ initialFilter, hidden, }: EntityKindFilterProps) => JSX.Element | null;
71
+ }
72
+ /** @public */
73
+ declare const EntityKindPicker: (props: EntityKindPickerProps) => JSX.Element | null;
68
74
 
69
75
  /** @public */
70
76
  declare type CatalogReactEntityLifecyclePickerClassKey = 'input';
77
+ /** @public */
71
78
  declare const EntityLifecyclePicker: () => JSX.Element | null;
72
79
 
73
80
  /** @public */
74
81
  declare type CatalogReactEntityOwnerPickerClassKey = 'input';
82
+ /** @public */
75
83
  declare const EntityOwnerPicker: () => JSX.Element | null;
76
84
 
85
+ /**
86
+ * Props for {@link EntityRefLink}.
87
+ *
88
+ * @public
89
+ */
77
90
  declare type EntityRefLinkProps = {
78
91
  entityRef: Entity | EntityName;
79
92
  defaultKind?: string;
80
93
  title?: string;
81
94
  children?: React.ReactNode;
82
95
  } & Omit<LinkProps, 'to'>;
83
- declare const EntityRefLink: React.ForwardRefExoticComponent<Pick<EntityRefLinkProps, "replace" | "type" | "key" | "id" | "media" | "state" | "color" | "display" | "translate" | "hidden" | "dir" | "slot" | "style" | "title" | "target" | "accessKey" | "draggable" | "lang" | "className" | "prefix" | "children" | "contentEditable" | "inputMode" | "tabIndex" | "underline" | "download" | "href" | "hrefLang" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "contextMenu" | "placeholder" | "spellCheck" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "rel" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "ping" | "referrerPolicy" | "align" | "variant" | "component" | "classes" | "innerRef" | "noWrap" | "gutterBottom" | "paragraph" | "variantMapping" | "noTrack" | "TypographyClasses" | "entityRef" | "defaultKind"> & React.RefAttributes<any>>;
96
+ /**
97
+ * Shows a clickable link to an entity.
98
+ *
99
+ * @public
100
+ */
101
+ declare const EntityRefLink: (props: EntityRefLinkProps) => JSX.Element;
84
102
 
103
+ /**
104
+ * Props for {@link EntityRefLink}.
105
+ *
106
+ * @public
107
+ */
85
108
  declare type EntityRefLinksProps = {
86
109
  entityRefs: (Entity | EntityName)[];
87
110
  defaultKind?: string;
88
111
  } & Omit<LinkProps, 'to'>;
112
+ /**
113
+ * Shows a list of clickable links to entities.
114
+ *
115
+ * @public
116
+ */
89
117
  declare const EntityRefLinks: ({ entityRefs, defaultKind, ...linkProps }: EntityRefLinksProps) => JSX.Element;
90
118
 
91
119
  declare function formatEntityRefTitle(entityRef: Entity | EntityName, opts?: {
@@ -94,11 +122,14 @@ declare function formatEntityRefTitle(entityRef: Entity | EntityName, opts?: {
94
122
 
95
123
  /** @public */
96
124
  declare type CatalogReactEntitySearchBarClassKey = 'searchToolbar' | 'input';
125
+ /** @public */
97
126
  declare const EntitySearchBar: () => JSX.Element;
98
127
 
99
- declare function createEntityRefColumn<T extends Entity>({ defaultKind, }: {
128
+ /** @public */
129
+ declare function createEntityRefColumn<T extends Entity>(options: {
100
130
  defaultKind?: string;
101
131
  }): TableColumn<T>;
132
+ /** @public */
102
133
  declare function createEntityRelationColumn<T extends Entity>({ title, relation, defaultKind, filter: entityFilter, }: {
103
134
  title: string;
104
135
  relation: string;
@@ -107,11 +138,17 @@ declare function createEntityRelationColumn<T extends Entity>({ title, relation,
107
138
  kind: string;
108
139
  };
109
140
  }): TableColumn<T>;
141
+ /** @public */
110
142
  declare function createOwnerColumn<T extends Entity>(): TableColumn<T>;
143
+ /** @public */
111
144
  declare function createDomainColumn<T extends Entity>(): TableColumn<T>;
145
+ /** @public */
112
146
  declare function createSystemColumn<T extends Entity>(): TableColumn<T>;
147
+ /** @public */
113
148
  declare function createMetadataDescriptionColumn<T extends Entity>(): TableColumn<T>;
149
+ /** @public */
114
150
  declare function createSpecLifecycleColumn<T extends Entity>(): TableColumn<T>;
151
+ /** @public */
115
152
  declare function createSpecTypeColumn<T extends Entity>(): TableColumn<T>;
116
153
 
117
154
  declare const columnFactories_createEntityRefColumn: typeof createEntityRefColumn;
@@ -135,14 +172,25 @@ declare namespace columnFactories {
135
172
  };
136
173
  }
137
174
 
138
- declare type Props$2<T extends Entity> = {
175
+ /**
176
+ * Props for {@link EntityTable}.
177
+ *
178
+ * @public
179
+ */
180
+ interface EntityTableProps<T extends Entity> {
139
181
  title: string;
140
182
  variant?: 'gridItem';
141
183
  entities: T[];
142
184
  emptyContent?: ReactNode;
143
185
  columns: TableColumn<T>[];
144
- };
145
- declare function EntityTable<T extends Entity>({ entities, title, emptyContent, variant, columns, }: Props$2<T>): JSX.Element;
186
+ }
187
+ /**
188
+ * A general entity table component, that can be used for composing more
189
+ * specific entity tables.
190
+ *
191
+ * @public
192
+ */
193
+ declare function EntityTable<T extends Entity>(props: EntityTableProps<T>): JSX.Element;
146
194
  declare namespace EntityTable {
147
195
  var columns: typeof columnFactories;
148
196
  var systemEntityColumns: TableColumn<_backstage_catalog_model.SystemEntity>[];
@@ -151,13 +199,20 @@ declare namespace EntityTable {
151
199
 
152
200
  /** @public */
153
201
  declare type CatalogReactEntityTagPickerClassKey = 'input';
202
+ /** @public */
154
203
  declare const EntityTagPicker: () => JSX.Element | null;
155
204
 
156
- declare type EntityTypeFilterProps = {
205
+ /**
206
+ * Props for {@link EntityTypePicker}.
207
+ *
208
+ * @public
209
+ */
210
+ interface EntityTypePickerProps {
157
211
  initialFilter?: string;
158
212
  hidden?: boolean;
159
- };
160
- declare const EntityTypePicker: (props: EntityTypeFilterProps) => JSX.Element | null;
213
+ }
214
+ /** @public */
215
+ declare const EntityTypePicker: (props: EntityTypePickerProps) => JSX.Element | null;
161
216
 
162
217
  declare type Props$1 = ComponentProps<typeof IconButton> & {
163
218
  entity: Entity;
@@ -170,6 +225,17 @@ declare const favoriteEntityIcon: (isStarred: boolean) => JSX.Element;
170
225
  */
171
226
  declare const FavoriteEntity: (props: Props$1) => JSX.Element;
172
227
 
228
+ /**
229
+ * A dialog that lets users inspect the low level details of their entities.
230
+ *
231
+ * @public
232
+ */
233
+ declare function InspectEntityDialog(props: {
234
+ open: boolean;
235
+ entity: Entity;
236
+ onClose: () => void;
237
+ }): JSX.Element | null;
238
+
173
239
  declare type Props = {
174
240
  open: boolean;
175
241
  onConfirm: () => any;
@@ -450,11 +516,10 @@ declare function useEntityOwnership(): {
450
516
  * @public
451
517
  *
452
518
  * @param allowedKinds - Array of allowed kinds to filter the entities
453
- * @returns CatalogListResponse<Entity>
454
519
  */
455
520
  declare function useOwnedEntities(allowedKinds?: string[]): {
456
521
  loading: boolean;
457
- ownedEntities: CatalogListResponse<Entity> | undefined;
522
+ ownedEntities: GetEntitiesResponse | undefined;
458
523
  };
459
524
 
460
525
  /**
@@ -551,4 +616,4 @@ declare type BackstageOverrides = Overrides & {
551
616
  [Name in keyof CatalogReactComponentsNameToClassKey]?: Partial<StyleRules<CatalogReactComponentsNameToClassKey[Name]>>;
552
617
  };
553
618
 
554
- export { AsyncEntityProvider, AsyncEntityProviderProps, BackstageOverrides, CatalogReactComponentsNameToClassKey, CatalogReactEntityLifecyclePickerClassKey, CatalogReactEntityOwnerPickerClassKey, CatalogReactEntitySearchBarClassKey, CatalogReactEntityTagPickerClassKey, CatalogReactUserListPickerClassKey, DefaultEntityFilters, DefaultStarredEntitiesApi, EntityContext, EntityFilter, EntityKindFilter, EntityKindPicker, EntityLifecycleFilter, EntityLifecyclePicker, EntityListContext, EntityListProvider, EntityOwnerFilter, EntityOwnerPicker, EntityProvider, EntityProviderProps, EntityRefLink, EntityRefLinks, EntitySearchBar, EntitySourceLocation, EntityTable, EntityTagFilter, EntityTagPicker, EntityTextFilter, EntityTypeFilter, EntityTypeFilterProps, EntityTypePicker, FavoriteEntity, MockEntityListContextProvider, StarredEntitiesApi, UnregisterEntityDialog, UserListFilter, UserListFilterKind, UserListPicker, catalogApiRef, catalogRouteRef, entityRoute, entityRouteParams, entityRouteRef, favoriteEntityIcon, favoriteEntityTooltip, formatEntityRefTitle, getEntityMetadataEditUrl, getEntityMetadataViewUrl, getEntityRelations, getEntitySourceLocation, isOwnerOf, loadCatalogOwnerRefs, loadIdentityOwnerRefs, reduceCatalogFilters, reduceEntityFilters, rootRoute, starredEntitiesApiRef, useEntity, useEntityCompoundName, useEntityFromUrl, useEntityKinds, useEntityListProvider, useEntityOwnership, useEntityPermission, useEntityTypeFilter, useOwnUser, useOwnedEntities, useRelatedEntities, useStarredEntities, useStarredEntity };
619
+ export { AsyncEntityProvider, AsyncEntityProviderProps, BackstageOverrides, CatalogReactComponentsNameToClassKey, CatalogReactEntityLifecyclePickerClassKey, CatalogReactEntityOwnerPickerClassKey, CatalogReactEntitySearchBarClassKey, CatalogReactEntityTagPickerClassKey, CatalogReactUserListPickerClassKey, DefaultEntityFilters, DefaultStarredEntitiesApi, EntityContext, EntityFilter, EntityKindFilter, EntityKindPicker, EntityKindPickerProps, EntityLifecycleFilter, EntityLifecyclePicker, EntityListContext, EntityListProvider, EntityOwnerFilter, EntityOwnerPicker, EntityProvider, EntityProviderProps, EntityRefLink, EntityRefLinkProps, EntityRefLinks, EntityRefLinksProps, EntitySearchBar, EntitySourceLocation, EntityTable, EntityTableProps, EntityTagFilter, EntityTagPicker, EntityTextFilter, EntityTypeFilter, EntityTypePicker, EntityTypePickerProps, FavoriteEntity, InspectEntityDialog, MockEntityListContextProvider, StarredEntitiesApi, UnregisterEntityDialog, UserListFilter, UserListFilterKind, UserListPicker, catalogApiRef, catalogRouteRef, entityRoute, entityRouteParams, entityRouteRef, favoriteEntityIcon, favoriteEntityTooltip, formatEntityRefTitle, getEntityMetadataEditUrl, getEntityMetadataViewUrl, getEntityRelations, getEntitySourceLocation, isOwnerOf, loadCatalogOwnerRefs, loadIdentityOwnerRefs, reduceCatalogFilters, reduceEntityFilters, rootRoute, starredEntitiesApiRef, useEntity, useEntityCompoundName, useEntityFromUrl, useEntityKinds, useEntityListProvider, useEntityOwnership, useEntityPermission, useEntityTypeFilter, useOwnUser, useOwnedEntities, useRelatedEntities, useStarredEntities, useStarredEntity };