@red-hat-developer-hub/backstage-plugin-global-header 1.16.0 → 1.17.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,21 @@
|
|
|
1
1
|
# @red-hat-developer-hub/backstage-plugin-global-header
|
|
2
2
|
|
|
3
|
+
## 1.17.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- d59f08b: Backstage version bump to v1.42.5
|
|
8
|
+
|
|
9
|
+
## 1.16.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 60a37b4: Fixes the global header starred items icon color and visibility:
|
|
14
|
+
|
|
15
|
+
- Changed star icon color to use theme.rhdh.general.starredItemsColor for better visibility and customization
|
|
16
|
+
- Star icon now only appears on hover instead of being always visible
|
|
17
|
+
- Maintains consistent styling with table view starred items across the application
|
|
18
|
+
|
|
3
19
|
## 1.16.0
|
|
4
20
|
|
|
5
21
|
### Minor Changes
|
|
@@ -28,6 +28,7 @@ const StarredItem = ({
|
|
|
28
28
|
const { name, kind, namespace } = parseEntityRef(entityRef);
|
|
29
29
|
const theme = useTheme();
|
|
30
30
|
const { t } = useTranslation();
|
|
31
|
+
const rhdhPalette = theme.palette.rhdh;
|
|
31
32
|
return /* @__PURE__ */ jsxs(
|
|
32
33
|
MenuItem,
|
|
33
34
|
{
|
|
@@ -36,6 +37,11 @@ const StarredItem = ({
|
|
|
36
37
|
onClick: handleClose,
|
|
37
38
|
disableRipple: true,
|
|
38
39
|
disableTouchRipple: true,
|
|
40
|
+
sx: {
|
|
41
|
+
"&:hover .star-icon, &:focus-visible .star-icon": {
|
|
42
|
+
visibility: "visible"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
39
45
|
children: [
|
|
40
46
|
Icon && /* @__PURE__ */ jsx(ListItemIcon, { sx: { minWidth: 36 }, children: /* @__PURE__ */ jsx(Icon, {}) }),
|
|
41
47
|
/* @__PURE__ */ jsx(
|
|
@@ -49,12 +55,17 @@ const StarredItem = ({
|
|
|
49
55
|
/* @__PURE__ */ jsx(Tooltip, { title: t("starred.removeTooltip"), children: /* @__PURE__ */ jsx(
|
|
50
56
|
IconButton,
|
|
51
57
|
{
|
|
58
|
+
className: "star-icon",
|
|
52
59
|
onClick: (e) => {
|
|
53
60
|
e.preventDefault();
|
|
54
61
|
e.stopPropagation();
|
|
55
62
|
toggleStarredEntity(entityRef);
|
|
56
63
|
},
|
|
57
|
-
|
|
64
|
+
sx: {
|
|
65
|
+
visibility: "hidden",
|
|
66
|
+
color: rhdhPalette?.general?.starredItemsColor ?? "#F3BA37"
|
|
67
|
+
},
|
|
68
|
+
children: /* @__PURE__ */ jsx(Star, {})
|
|
58
69
|
}
|
|
59
70
|
) })
|
|
60
71
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StarredDropdown.esm.js","sources":["../../../src/components/HeaderDropdownComponent/StarredDropdown.tsx"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { FC } from 'react';\nimport {\n useEntityPresentation,\n useStarredEntities,\n} from '@backstage/plugin-catalog-react';\nimport { Link } from '@backstage/core-components';\nimport {\n CompoundEntityRef,\n Entity,\n parseEntityRef,\n} from '@backstage/catalog-model';\nimport StarBorderIcon from '@mui/icons-material/StarBorder';\nimport Star from '@mui/icons-material/Star';\nimport AutoAwesomeIcon from '@mui/icons-material/AutoAwesome';\nimport ListItemIcon from '@mui/material/ListItemIcon';\nimport ListItemText from '@mui/material/ListItemText';\n\nimport { useTheme } from '@mui/material/styles';\nimport MenuItem from '@mui/material/MenuItem';\nimport Typography from '@mui/material/Typography';\nimport IconButton from '@mui/material/IconButton';\nimport Tooltip from '@mui/material/Tooltip';\n\nimport { useDropdownManager } from '../../hooks';\nimport { HeaderDropdownComponent } from './HeaderDropdownComponent';\nimport { DropdownEmptyState } from './DropdownEmptyState';\nimport { useTranslation } from '../../hooks/useTranslation';\n\n/**\n * @public\n * Props for each starred entitify item\n */\ninterface SectionComponentProps {\n entityRef: string | CompoundEntityRef | Entity;\n toggleStarredEntity: (\n entityOrRef: Entity | CompoundEntityRef | string,\n ) => void;\n handleClose: () => void;\n}\n\nconst StarredItem: FC<SectionComponentProps> = ({\n entityRef,\n toggleStarredEntity,\n handleClose,\n}) => {\n const { Icon, primaryTitle, secondaryTitle } =\n useEntityPresentation(entityRef);\n const { name, kind, namespace } = parseEntityRef(entityRef as string);\n const theme = useTheme();\n const { t } = useTranslation();\n\n return (\n <MenuItem\n component={Link}\n to={`/catalog/${namespace || 'default'}/${kind}/${name}`}\n onClick={handleClose}\n disableRipple\n disableTouchRipple\n >\n {Icon && (\n <ListItemIcon sx={{ minWidth: 36 }}>\n <Icon />\n </ListItemIcon>\n )}\n <ListItemText\n primary={\n <Typography sx={{ color: theme.palette.text.primary }}>\n {primaryTitle || secondaryTitle}\n </Typography>\n }\n secondary={kind.toLocaleUpperCase()}\n // inset={!Icon}\n sx={{ ml: 1, mr: 1 }}\n />\n <Tooltip title={t('starred.removeTooltip')}>\n <IconButton\n onClick={e => {\n e.preventDefault();\n e.stopPropagation();\n toggleStarredEntity(entityRef);\n }}\n >\n <Star
|
|
1
|
+
{"version":3,"file":"StarredDropdown.esm.js","sources":["../../../src/components/HeaderDropdownComponent/StarredDropdown.tsx"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { FC } from 'react';\nimport {\n useEntityPresentation,\n useStarredEntities,\n} from '@backstage/plugin-catalog-react';\nimport { Link } from '@backstage/core-components';\nimport {\n CompoundEntityRef,\n Entity,\n parseEntityRef,\n} from '@backstage/catalog-model';\nimport StarBorderIcon from '@mui/icons-material/StarBorder';\nimport Star from '@mui/icons-material/Star';\nimport AutoAwesomeIcon from '@mui/icons-material/AutoAwesome';\nimport ListItemIcon from '@mui/material/ListItemIcon';\nimport ListItemText from '@mui/material/ListItemText';\n\nimport { useTheme } from '@mui/material/styles';\nimport MenuItem from '@mui/material/MenuItem';\nimport Typography from '@mui/material/Typography';\nimport IconButton from '@mui/material/IconButton';\nimport Tooltip from '@mui/material/Tooltip';\n\nimport { useDropdownManager } from '../../hooks';\nimport { HeaderDropdownComponent } from './HeaderDropdownComponent';\nimport { DropdownEmptyState } from './DropdownEmptyState';\nimport { useTranslation } from '../../hooks/useTranslation';\n\n/**\n * @public\n * Props for each starred entitify item\n */\ninterface SectionComponentProps {\n entityRef: string | CompoundEntityRef | Entity;\n toggleStarredEntity: (\n entityOrRef: Entity | CompoundEntityRef | string,\n ) => void;\n handleClose: () => void;\n}\n\nconst StarredItem: FC<SectionComponentProps> = ({\n entityRef,\n toggleStarredEntity,\n handleClose,\n}) => {\n const { Icon, primaryTitle, secondaryTitle } =\n useEntityPresentation(entityRef);\n const { name, kind, namespace } = parseEntityRef(entityRef as string);\n const theme = useTheme();\n const { t } = useTranslation();\n const rhdhPalette = (theme.palette as any).rhdh;\n\n return (\n <MenuItem\n component={Link}\n to={`/catalog/${namespace || 'default'}/${kind}/${name}`}\n onClick={handleClose}\n disableRipple\n disableTouchRipple\n sx={{\n '&:hover .star-icon, &:focus-visible .star-icon': {\n visibility: 'visible',\n },\n }}\n >\n {Icon && (\n <ListItemIcon sx={{ minWidth: 36 }}>\n <Icon />\n </ListItemIcon>\n )}\n <ListItemText\n primary={\n <Typography sx={{ color: theme.palette.text.primary }}>\n {primaryTitle || secondaryTitle}\n </Typography>\n }\n secondary={kind.toLocaleUpperCase()}\n // inset={!Icon}\n sx={{ ml: 1, mr: 1 }}\n />\n <Tooltip title={t('starred.removeTooltip')}>\n <IconButton\n className=\"star-icon\"\n onClick={e => {\n e.preventDefault();\n e.stopPropagation();\n toggleStarredEntity(entityRef);\n }}\n sx={{\n visibility: 'hidden',\n color: rhdhPalette?.general?.starredItemsColor ?? '#F3BA37',\n }}\n >\n <Star />\n </IconButton>\n </Tooltip>\n </MenuItem>\n );\n};\n\nexport const StarredDropdown = () => {\n const { anchorEl, handleOpen, handleClose } = useDropdownManager();\n const { starredEntities, toggleStarredEntity } = useStarredEntities();\n const { t } = useTranslation();\n\n const entitiesArray = Array.from(starredEntities);\n\n return (\n <HeaderDropdownComponent\n buttonContent={<StarBorderIcon />}\n onOpen={handleOpen}\n onClose={handleClose}\n anchorEl={anchorEl}\n tooltip={t('starred.title')}\n isIconButton\n >\n {entitiesArray.length > 0 ? (\n <>\n <ListItemText\n primary={t('starred.title')}\n sx={{ pl: 2, mt: 1, fontWeight: 'bold', color: 'text.secondary' }}\n />\n {entitiesArray.map(enitityRef => (\n <StarredItem\n key={enitityRef}\n entityRef={enitityRef}\n toggleStarredEntity={toggleStarredEntity}\n handleClose={handleClose}\n />\n ))}\n </>\n ) : (\n <DropdownEmptyState\n title={t('starred.noItemsTitle')}\n subTitle={t('starred.noItemsSubtitle')}\n icon={<AutoAwesomeIcon sx={{ fontSize: 64 }} color=\"disabled\" />}\n />\n )}\n </HeaderDropdownComponent>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAwDA,MAAM,cAAyC,CAAC;AAAA,EAC9C,SAAA;AAAA,EACA,mBAAA;AAAA,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AAAA,UAAC,YAAA;AAAA,UAAA;AAAA,YACC,OAAA,EAAS,EAAE,eAAe,CAAA;AAAA,YAC1B,EAAA,EAAI,EAAE,EAAI,EAAA,CAAA,EAAG,IAAI,CAAG,EAAA,UAAA,EAAY,MAAQ,EAAA,KAAA,EAAO,gBAAiB;AAAA;AAAA,SAClE;AAAA,QACC,aAAA,CAAc,IAAI,CACjB,UAAA,qBAAA,GAAA;AAAA,UAAC,WAAA;AAAA,UAAA;AAAA,YAEC,SAAW,EAAA,UAAA;AAAA,YACX,mBAAA;AAAA,YACA;AAAA,WAAA;AAAA,UAHK;AAAA,SAKR;AAAA,OAAA,EACH,CAEA,mBAAA,GAAA;AAAA,QAAC,kBAAA;AAAA,QAAA;AAAA,UACC,KAAA,EAAO,EAAE,sBAAsB,CAAA;AAAA,UAC/B,QAAA,EAAU,EAAE,yBAAyB,CAAA;AAAA,UACrC,IAAA,sBAAO,eAAgB,EAAA,EAAA,EAAA,EAAI,EAAE,QAAU,EAAA,EAAA,EAAM,EAAA,KAAA,EAAM,UAAW,EAAA;AAAA;AAAA;AAChE;AAAA,GAEJ;AAEJ;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@red-hat-developer-hub/backstage-plugin-global-header",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.17.0",
|
|
4
4
|
"main": "dist/index.esm.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -34,21 +34,21 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@backstage/catalog-model": "^1.7.5",
|
|
37
|
-
"@backstage/core-components": "^0.17.
|
|
37
|
+
"@backstage/core-components": "^0.17.5",
|
|
38
38
|
"@backstage/core-plugin-api": "^1.10.9",
|
|
39
|
-
"@backstage/plugin-catalog-react": "^1.
|
|
40
|
-
"@backstage/plugin-notifications": "^0.5.
|
|
41
|
-
"@backstage/plugin-notifications-common": "^0.0
|
|
42
|
-
"@backstage/plugin-search": "^1.4.
|
|
43
|
-
"@backstage/plugin-search-backend": "^2.0.
|
|
44
|
-
"@backstage/plugin-search-backend-module-catalog": "^0.3.
|
|
45
|
-
"@backstage/plugin-search-backend-module-pg": "^0.5.
|
|
46
|
-
"@backstage/plugin-search-backend-module-techdocs": "^0.4.
|
|
39
|
+
"@backstage/plugin-catalog-react": "^1.20.1",
|
|
40
|
+
"@backstage/plugin-notifications": "^0.5.8",
|
|
41
|
+
"@backstage/plugin-notifications-common": "^0.1.0",
|
|
42
|
+
"@backstage/plugin-search": "^1.4.29",
|
|
43
|
+
"@backstage/plugin-search-backend": "^2.0.5",
|
|
44
|
+
"@backstage/plugin-search-backend-module-catalog": "^0.3.7",
|
|
45
|
+
"@backstage/plugin-search-backend-module-pg": "^0.5.47",
|
|
46
|
+
"@backstage/plugin-search-backend-module-techdocs": "^0.4.5",
|
|
47
47
|
"@backstage/plugin-search-common": "^1.2.19",
|
|
48
|
-
"@backstage/plugin-search-react": "^1.9.
|
|
48
|
+
"@backstage/plugin-search-react": "^1.9.3",
|
|
49
49
|
"@backstage/plugin-signals-react": "^0.0.15",
|
|
50
|
-
"@backstage/plugin-user-settings": "^0.8.
|
|
51
|
-
"@backstage/theme": "^0.6.
|
|
50
|
+
"@backstage/plugin-user-settings": "^0.8.25",
|
|
51
|
+
"@backstage/theme": "^0.6.8",
|
|
52
52
|
"@mui/icons-material": "5.18.0",
|
|
53
53
|
"@mui/material": "5.18.0",
|
|
54
54
|
"@mui/styled-engine": "5.18.0",
|
|
@@ -60,13 +60,13 @@
|
|
|
60
60
|
"react-router-dom": "^6.0.0"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
|
-
"@backstage/cli": "^0.
|
|
63
|
+
"@backstage/cli": "^0.34.1",
|
|
64
64
|
"@backstage/config": "^1.3.3",
|
|
65
65
|
"@backstage/core-app-api": "^1.18.0",
|
|
66
|
-
"@backstage/dev-utils": "^1.1.
|
|
67
|
-
"@backstage/frontend-test-utils": "^0.3.
|
|
66
|
+
"@backstage/dev-utils": "^1.1.13",
|
|
67
|
+
"@backstage/frontend-test-utils": "^0.3.5",
|
|
68
68
|
"@backstage/plugin-search-common": "^1.2.19",
|
|
69
|
-
"@backstage/test-utils": "^1.7.
|
|
69
|
+
"@backstage/test-utils": "^1.7.11",
|
|
70
70
|
"@openshift/dynamic-plugin-sdk": "^5.0.1",
|
|
71
71
|
"@red-hat-developer-hub/backstage-plugin-theme": "^0.9.1",
|
|
72
72
|
"@testing-library/jest-dom": "^6.0.0",
|