@backstage/plugin-catalog-react 1.1.0-next.1 → 1.1.1-next.0

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,55 @@
1
1
  # @backstage/plugin-catalog-react
2
2
 
3
+ ## 1.1.1-next.0
4
+
5
+ ### Patch Changes
6
+
7
+ - 1f70704580: Accessibility updates:
8
+
9
+ - Wrapped the `EntityLifecyclePicker`, `EntityOwnerPicker`, `EntityTagPicker`, in `label` elements
10
+ - Changed group name `Typography` component to `span` (from default `h6`), added `aria-label` to the `List` component, and `role` of `menuitem` to the container of the `MenuItem` component
11
+
12
+ - Updated dependencies
13
+ - @backstage/core-components@0.9.5-next.0
14
+ - @backstage/integration@1.2.1-next.0
15
+
16
+ ## 1.1.0
17
+
18
+ ### Minor Changes
19
+
20
+ - 4274844a8c: Use InfoCardVariants on custom cards variant attribute
21
+
22
+ ### Patch Changes
23
+
24
+ - 0418447669: Added menu parent role for menu items accessibility
25
+ - b7514d19ff: Update the rendering of links in the entity inspector so that values starting with `https?://` are rendered as links as well.
26
+ - b880c0e092: Fix `EntityTypeFilter` so generating available types is case insensitive
27
+ - 57f41fb8d6: Make Menu item on filters accessible through keyboard
28
+ - Updated dependencies
29
+ - @backstage/core-components@0.9.4
30
+ - @backstage/integration@1.2.0
31
+ - @backstage/core-plugin-api@1.0.2
32
+ - @backstage/catalog-client@1.0.2
33
+ - @backstage/catalog-model@1.0.2
34
+ - @backstage/plugin-catalog-common@1.0.2
35
+ - @backstage/plugin-permission-common@0.6.1
36
+ - @backstage/plugin-permission-react@0.4.1
37
+
38
+ ## 1.1.0-next.2
39
+
40
+ ### Patch Changes
41
+
42
+ - 57f41fb8d6: Make Menu item on filters accessible through keyboard
43
+ - Updated dependencies
44
+ - @backstage/core-components@0.9.4-next.1
45
+ - @backstage/catalog-model@1.0.2-next.0
46
+ - @backstage/core-plugin-api@1.0.2-next.1
47
+ - @backstage/integration@1.2.0-next.1
48
+ - @backstage/plugin-permission-common@0.6.1-next.0
49
+ - @backstage/plugin-permission-react@0.4.1-next.1
50
+ - @backstage/catalog-client@1.0.2-next.0
51
+ - @backstage/plugin-catalog-common@1.0.2-next.0
52
+
3
53
  ## 1.1.0-next.1
4
54
 
5
55
  ### Patch Changes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-catalog-react",
3
- "version": "1.1.0-next.1",
3
+ "version": "1.1.1-next.0",
4
4
  "main": "../dist/index.esm.js",
5
5
  "types": "../dist/index.alpha.d.ts"
6
6
  }
package/dist/index.esm.js CHANGED
@@ -512,7 +512,9 @@ function useEntityTypeFilter() {
512
512
  if (loading || !kind || oldFacets === facets || !facets) {
513
513
  return;
514
514
  }
515
- const newTypes = sortBy(facets, (f) => -f.count).map((f) => f.value);
515
+ const newTypes = [
516
+ ...new Set(sortBy(facets, (f) => -f.count).map((f) => f.value.toLocaleLowerCase("en-US")))
517
+ ];
516
518
  setAvailableTypes(newTypes);
517
519
  const stillValidTypes = selectedTypes.filter((value) => newTypes.includes(value));
518
520
  if (!isEqual$1(selectedTypes, stillValidTypes)) {
@@ -726,9 +728,9 @@ const EntityLifecyclePicker = () => {
726
728
  pb: 1,
727
729
  pt: 1
728
730
  }, /* @__PURE__ */ React.createElement(Typography, {
729
- variant: "button"
730
- }, "Lifecycle"), /* @__PURE__ */ React.createElement(Autocomplete, {
731
- "aria-label": "Lifecycle",
731
+ variant: "button",
732
+ component: "label"
733
+ }, "Lifecycle", /* @__PURE__ */ React.createElement(Autocomplete, {
732
734
  multiple: true,
733
735
  options: availableLifecycles,
734
736
  value: selectedLifecycles,
@@ -750,7 +752,7 @@ const EntityLifecyclePicker = () => {
750
752
  className: classes.input,
751
753
  variant: "outlined"
752
754
  })
753
- }));
755
+ })));
754
756
  };
755
757
 
756
758
  const useStyles$a = makeStyles({
@@ -794,10 +796,10 @@ const EntityOwnerPicker = () => {
794
796
  pb: 1,
795
797
  pt: 1
796
798
  }, /* @__PURE__ */ React.createElement(Typography, {
797
- variant: "button"
798
- }, "Owner"), /* @__PURE__ */ React.createElement(Autocomplete, {
799
+ variant: "button",
800
+ component: "label"
801
+ }, "Owner", /* @__PURE__ */ React.createElement(Autocomplete, {
799
802
  multiple: true,
800
- "aria-label": "Owner",
801
803
  options: availableOwners,
802
804
  value: selectedOwners,
803
805
  onChange: (_, value) => setSelectedOwners(value),
@@ -818,7 +820,7 @@ const EntityOwnerPicker = () => {
818
820
  className: classes.input,
819
821
  variant: "outlined"
820
822
  })
821
- }));
823
+ })));
822
824
  };
823
825
 
824
826
  const useStyles$9 = makeStyles((_theme) => ({
@@ -1078,10 +1080,10 @@ const EntityTagPicker = () => {
1078
1080
  pb: 1,
1079
1081
  pt: 1
1080
1082
  }, /* @__PURE__ */ React.createElement(Typography, {
1081
- variant: "button"
1082
- }, "Tags"), /* @__PURE__ */ React.createElement(Autocomplete, {
1083
+ variant: "button",
1084
+ component: "label"
1085
+ }, "Tags", /* @__PURE__ */ React.createElement(Autocomplete, {
1083
1086
  multiple: true,
1084
- "aria-label": "Tags",
1085
1087
  options: availableTags,
1086
1088
  value: selectedTags,
1087
1089
  onChange: (_, value) => setSelectedTags(value),
@@ -1102,7 +1104,7 @@ const EntityTagPicker = () => {
1102
1104
  className: classes.input,
1103
1105
  variant: "outlined"
1104
1106
  })
1105
- }));
1107
+ })));
1106
1108
  };
1107
1109
 
1108
1110
  const EntityTypePicker = (props) => {
@@ -1369,13 +1371,23 @@ function Container(props) {
1369
1371
  to: props.helpLink
1370
1372
  })), props.children)));
1371
1373
  }
1374
+ function findLink(value) {
1375
+ if (value.match(/^url:https?:\/\//)) {
1376
+ return value.slice("url:".length);
1377
+ }
1378
+ if (value.match(/^https?:\/\//)) {
1379
+ return value;
1380
+ }
1381
+ return void 0;
1382
+ }
1372
1383
  function KeyValueListItem(props) {
1373
1384
  const [key, value] = props.entry;
1385
+ const link = findLink(value);
1374
1386
  return /* @__PURE__ */ React.createElement(ListItem, null, props.indent && /* @__PURE__ */ React.createElement(ListItemIcon, null), /* @__PURE__ */ React.createElement(ListItemText, {
1375
1387
  primary: key,
1376
- secondary: !value.match(/^url:https?:\/\//) ? value : /* @__PURE__ */ React.createElement(React.Fragment, null, value.substring(0, 4), /* @__PURE__ */ React.createElement(Link, {
1377
- to: value.substring(4)
1378
- }, value.substring(4)))
1388
+ secondary: link ? /* @__PURE__ */ React.createElement(Link, {
1389
+ to: link
1390
+ }, value) : value
1379
1391
  }));
1380
1392
  }
1381
1393
  function HelpIcon(props) {
@@ -2020,16 +2032,19 @@ const UserListPicker = (props) => {
2020
2032
  key: group.name
2021
2033
  }, /* @__PURE__ */ React.createElement(Typography, {
2022
2034
  variant: "subtitle2",
2035
+ component: "span",
2023
2036
  className: classes.title
2024
2037
  }, group.name), /* @__PURE__ */ React.createElement(Card, {
2025
2038
  className: classes.groupWrapper
2026
2039
  }, /* @__PURE__ */ React.createElement(List, {
2027
2040
  disablePadding: true,
2028
2041
  dense: true,
2029
- role: "menu"
2042
+ role: "menu",
2043
+ "aria-label": group.name
2030
2044
  }, group.items.map((item) => {
2031
2045
  var _a2, _b;
2032
2046
  return /* @__PURE__ */ React.createElement(MenuItem, {
2047
+ role: "none presentation",
2033
2048
  key: item.id,
2034
2049
  button: true,
2035
2050
  divider: true,
@@ -2037,14 +2052,16 @@ const UserListPicker = (props) => {
2037
2052
  selected: item.id === ((_a2 = filters.user) == null ? void 0 : _a2.value),
2038
2053
  className: classes.menuItem,
2039
2054
  disabled: filterCounts[item.id] === 0,
2040
- "data-testid": `user-picker-${item.id}`
2055
+ "data-testid": `user-picker-${item.id}`,
2056
+ tabIndex: 0,
2057
+ ContainerProps: { role: "menuitem" }
2041
2058
  }, item.icon && /* @__PURE__ */ React.createElement(ListItemIcon, {
2042
2059
  className: classes.listIcon
2043
2060
  }, /* @__PURE__ */ React.createElement(item.icon, {
2044
2061
  fontSize: "small"
2045
2062
  })), /* @__PURE__ */ React.createElement(ListItemText$1, null, /* @__PURE__ */ React.createElement(Typography, {
2046
2063
  variant: "body1"
2047
- }, item.label)), /* @__PURE__ */ React.createElement(ListItemSecondaryAction, null, (_b = filterCounts[item.id]) != null ? _b : "-"));
2064
+ }, item.label, " ")), /* @__PURE__ */ React.createElement(ListItemSecondaryAction, null, (_b = filterCounts[item.id]) != null ? _b : "-"));
2048
2065
  }))))));
2049
2066
  };
2050
2067