@backstage/plugin-catalog-react 0.0.0-nightly-20240122021809 → 0.0.0-nightly-20240124021659

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,13 +1,34 @@
1
1
  # @backstage/plugin-catalog-react
2
2
 
3
- ## 0.0.0-nightly-20240122021809
3
+ ## 0.0.0-nightly-20240124021659
4
4
 
5
5
  ### Patch Changes
6
6
 
7
+ - 916da47: Change default icon for unknown entities to nothing instead of the help icon.
7
8
  - 71c6d7a: Overflowing labels in OwnerPicker (Catalog) are now truncated. Hovering over them shows the full label
8
9
  - Updated dependencies
9
- - @backstage/frontend-plugin-api@0.0.0-nightly-20240122021809
10
- - @backstage/catalog-client@0.0.0-nightly-20240122021809
10
+ - @backstage/frontend-plugin-api@0.0.0-nightly-20240124021659
11
+ - @backstage/catalog-client@0.0.0-nightly-20240124021659
12
+ - @backstage/core-components@0.13.10
13
+ - @backstage/catalog-model@1.4.3
14
+ - @backstage/core-plugin-api@1.8.2
15
+ - @backstage/errors@1.2.3
16
+ - @backstage/integration-react@1.1.23
17
+ - @backstage/types@1.1.1
18
+ - @backstage/version-bridge@1.0.7
19
+ - @backstage/plugin-catalog-common@1.0.20
20
+ - @backstage/plugin-permission-common@0.7.12
21
+ - @backstage/plugin-permission-react@0.4.19
22
+
23
+ ## 1.9.4-next.0
24
+
25
+ ### Patch Changes
26
+
27
+ - 916da47: Change default icon for unknown entities to nothing instead of the help icon.
28
+ - 71c6d7a: Overflowing labels in OwnerPicker (Catalog) are now truncated. Hovering over them shows the full label
29
+ - Updated dependencies
30
+ - @backstage/frontend-plugin-api@0.5.1-next.0
31
+ - @backstage/catalog-client@1.6.0-next.0
11
32
  - @backstage/core-components@0.13.10
12
33
  - @backstage/catalog-model@1.4.3
13
34
  - @backstage/core-plugin-api@1.8.2
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-catalog-react",
3
- "version": "0.0.0-nightly-20240122021809",
3
+ "version": "0.0.0-nightly-20240124021659",
4
4
  "main": "../dist/alpha.esm.js",
5
5
  "module": "../dist/alpha.esm.js",
6
6
  "types": "../dist/alpha.d.ts"
package/dist/index.esm.js CHANGED
@@ -37,7 +37,7 @@ import Clear from '@material-ui/icons/Clear';
37
37
  import Search from '@material-ui/icons/Search';
38
38
  import Star from '@material-ui/icons/Star';
39
39
  import StarBorder from '@material-ui/icons/StarBorder';
40
- import WorkIcon from '@material-ui/icons/Work';
40
+ import SvgIcon from '@material-ui/core/SvgIcon';
41
41
  import HelpOutlineIcon from '@material-ui/icons/HelpOutline';
42
42
  import groupBy from 'lodash/groupBy';
43
43
  import DialogContentText$1 from '@material-ui/core/DialogContentText';
@@ -2033,7 +2033,7 @@ const FavoriteEntity = (props) => {
2033
2033
  );
2034
2034
  };
2035
2035
 
2036
- const DEFAULT_ICON = WorkIcon;
2036
+ const DEFAULT_ICON = SvgIcon;
2037
2037
  function getKind(kind, entityRef) {
2038
2038
  if (kind) {
2039
2039
  return kind.toLocaleLowerCase("en-US");
@@ -2121,6 +2121,7 @@ function CustomNode({ node }) {
2121
2121
  const entityRoute = useRouteRef(entityRouteRef);
2122
2122
  const [width, setWidth] = useState(0);
2123
2123
  const [height, setHeight] = useState(0);
2124
+ const app = useApp();
2124
2125
  const idRef = useRef(null);
2125
2126
  useLayoutEffect(() => {
2126
2127
  if (idRef.current) {
@@ -2133,9 +2134,12 @@ function CustomNode({ node }) {
2133
2134
  }
2134
2135
  }
2135
2136
  }, [width, height]);
2137
+ const hasKindIcon = app.getSystemIcon(
2138
+ `kind:${node.kind.toLocaleLowerCase("en-US")}`
2139
+ );
2136
2140
  const padding = 10;
2137
2141
  const iconSize = height;
2138
- const paddedIconWidth = iconSize + padding;
2142
+ const paddedIconWidth = hasKindIcon ? iconSize + padding : 0;
2139
2143
  const paddedWidth = paddedIconWidth + width + padding * 2;
2140
2144
  const paddedHeight = height + padding * 2;
2141
2145
  const displayTitle = node.metadata.title || (node.kind && node.metadata.name && node.metadata.namespace ? humanizeEntityRef({
@@ -2163,7 +2167,7 @@ function CustomNode({ node }) {
2163
2167
  height: paddedHeight,
2164
2168
  rx: 10
2165
2169
  }
2166
- ), /* @__PURE__ */ React.createElement(
2170
+ ), hasKindIcon && /* @__PURE__ */ React.createElement(
2167
2171
  EntityKindIcon,
2168
2172
  {
2169
2173
  kind: node.kind,
@@ -2305,7 +2309,7 @@ function useColocated(entity) {
2305
2309
  };
2306
2310
  }
2307
2311
  function EntityList(props) {
2308
- return /* @__PURE__ */ React.createElement(List, { dense: true }, props.header && /* @__PURE__ */ React.createElement(KeyValueListItem, { key: "header", entry: props.header }), props.entities.map((entity) => /* @__PURE__ */ React.createElement(ListItem, { key: stringifyEntityRef(entity) }, /* @__PURE__ */ React.createElement(ListItemIcon, null, /* @__PURE__ */ React.createElement(EntityKindIcon, { kind: entity.kind })), /* @__PURE__ */ React.createElement(ListItemText, { primary: /* @__PURE__ */ React.createElement(EntityRefLink, { entityRef: entity }) }))));
2312
+ return /* @__PURE__ */ React.createElement(List, { dense: true }, props.header && /* @__PURE__ */ React.createElement(KeyValueListItem, { key: "header", entry: props.header }), props.entities.map((entity) => /* @__PURE__ */ React.createElement(ListItem, { key: stringifyEntityRef(entity) }, /* @__PURE__ */ React.createElement(ListItemText, { primary: /* @__PURE__ */ React.createElement(EntityRefLink, { entityRef: entity }) }))));
2309
2313
  }
2310
2314
  function Contents$1(props) {
2311
2315
  const { entity } = props;
@@ -2413,7 +2417,7 @@ function OverviewPage(props) {
2413
2417
  helpLink: "https://backstage.io/docs/features/software-catalog/well-known-relations"
2414
2418
  },
2415
2419
  Object.entries(groupedRelations).map(
2416
- ([type, groupRelations], index) => /* @__PURE__ */ React.createElement("div", { key: index }, /* @__PURE__ */ React.createElement(List, { dense: true, subheader: /* @__PURE__ */ React.createElement(ListSubheader, null, type) }, groupRelations.map((group) => /* @__PURE__ */ React.createElement(ListItem, { key: group.targetRef }, /* @__PURE__ */ React.createElement(ListItemIcon, null, /* @__PURE__ */ React.createElement(EntityKindIcon, { entityRef: group.targetRef })), /* @__PURE__ */ React.createElement(
2420
+ ([type, groupRelations], index) => /* @__PURE__ */ React.createElement("div", { key: index }, /* @__PURE__ */ React.createElement(List, { dense: true, subheader: /* @__PURE__ */ React.createElement(ListSubheader, null, type) }, groupRelations.map((group) => /* @__PURE__ */ React.createElement(ListItem, { key: group.targetRef }, /* @__PURE__ */ React.createElement(
2417
2421
  ListItemText,
2418
2422
  {
2419
2423
  primary: /* @__PURE__ */ React.createElement(EntityRefLink, { entityRef: group.targetRef })