Merge remote-tracking branch 'upstream/master' into airbrake-api

# Conflicts:
#	plugins/airbrake/package.json
This commit is contained in:
Karan Shah
2022-02-01 16:00:56 +00:00
224 changed files with 1715 additions and 539 deletions
@@ -0,0 +1,6 @@
---
'@backstage/core-components': patch
'@backstage/plugin-catalog-react': patch
---
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.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-catalog-common': patch
---
Adds new `catalogEntityCreatePermission` which can be imported and used when authoring a permission policy to restrict/grant a user's access to the catalog import plugin. (And the "Register Existing Component" button which navigates there).
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-scaffolder': patch
---
Permission the Register Existing Component button
+10
View File
@@ -0,0 +1,10 @@
---
'@backstage/plugin-catalog-react': patch
---
Fix bug: previously the filter would be set to "all" on page load, even if the
`initiallySelectedFilter` on the `DefaultCatalogPage` was set to something else,
or a different query parameter was supplied. Now, the prop and query parameters
control the filter as expected. Additionally, after this change any filters
which match 0 items will be disabled, and the filter will be reverted to 'all'
if they're set on page load.
+1 -3
View File
@@ -1,5 +1,3 @@
{
"currentReleaseVersion": {
"@backstage/create-app": "0.4.16"
}
"currentReleaseVersion": {}
}
+24 -1
View File
@@ -123,5 +123,28 @@
"@backstage/plugin-user-settings": "0.3.17",
"@backstage/plugin-xcmetrics": "0.2.16"
},
"changesets": []
"changesets": [
"analytics-station-eleven",
"bright-buttons-rescue",
"dependabot-2f11dff",
"dependabot-9ec400d",
"dependabot-f969614",
"early-cooks-brake",
"flat-cars-begin",
"gold-queens-clap",
"grumpy-teachers-remain",
"nasty-pets-glow",
"neat-mangos-study",
"purple-steaks-design",
"quick-jars-wait",
"sharp-dragons-divide",
"sour-chairs-double",
"tall-rats-lie",
"tame-ads-exercise",
"techdocs-lets-call-the-whole-thing-off",
"thirty-houses-juggle",
"tiny-buses-compete",
"witty-lamps-laugh",
"witty-lizards-nail"
]
}
+25
View File
@@ -0,0 +1,25 @@
---
'@backstage/create-app': patch
---
Permission the `catalog-import` route
The following changes are **required** if you intend to add permissions to your existing app.
Use the `PermissionedRoute` for `CatalogImportPage` instead of the normal `Route`:
```diff
// packages/app/src/App.tsx
...
+ import { PermissionedRoute } from '@backstage/plugin-permission-react';
+ import { catalogEntityCreatePermission } from '@backstage/plugin-catalog-common';
...
- <Route path="/catalog-import" element={<CatalogImportPage />} />
+ <PermissionedRoute
+ path="/catalog-import"
+ permission={catalogEntityCreatePermission}
+ element={<CatalogImportPage />}
+ />
```
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-techdocs': patch
---
Fixed a bug where links to files within a TechDocs site that use the `download` attribute would result in a 404 in cases where the TechDocs backend and Backstage frontend application are on the same host.
+1 -1
View File
@@ -49,7 +49,7 @@
"**/@roadiehq/**/@backstage/plugin-catalog": "*",
"**/@roadiehq/**/@backstage/catalog-model": "*"
},
"version": "0.65.0",
"version": "0.66.0-next.0",
"dependencies": {
"@manypkg/get-packages": "^1.1.3",
"@microsoft/api-documenter": "^7.15.0",
+7
View File
@@ -1,5 +1,12 @@
# @backstage/app-defaults
## 0.1.6-next.0
### Patch Changes
- Updated dependencies
- @backstage/core-components@0.8.7-next.0
## 0.1.5
### Patch Changes
+3 -3
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/app-defaults",
"description": "Provides the default wiring of a Backstage App",
"version": "0.1.5",
"version": "0.1.6-next.0",
"private": false,
"publishConfig": {
"access": "public",
@@ -29,7 +29,7 @@
"clean": "backstage-cli clean"
},
"dependencies": {
"@backstage/core-components": "^0.8.6",
"@backstage/core-components": "^0.8.7-next.0",
"@backstage/core-app-api": "^0.5.1",
"@backstage/core-plugin-api": "^0.6.0",
"@backstage/plugin-permission-react": "^0.3.0",
@@ -42,7 +42,7 @@
"react": "^16.13.1 || ^17.0.0"
},
"devDependencies": {
"@backstage/cli": "^0.13.0",
"@backstage/cli": "^0.13.1-next.0",
"@backstage/test-utils": "^0.2.3",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
+47
View File
@@ -1,5 +1,52 @@
# example-app
## 0.2.63-next.0
### Patch Changes
- Updated dependencies
- @backstage/core-components@0.8.7-next.0
- @backstage/plugin-org@0.4.1-next.0
- @backstage/plugin-pagerduty@0.3.24-next.0
- @backstage/plugin-catalog-import@0.8.0-next.0
- @backstage/plugin-techdocs@0.13.2-next.0
- @backstage/plugin-scaffolder@0.12.1-next.0
- @backstage/cli@0.13.1-next.0
- @backstage/app-defaults@0.1.6-next.0
- @backstage/integration-react@0.1.20-next.0
- @backstage/plugin-airbrake@0.1.2-next.0
- @backstage/plugin-apache-airflow@0.1.5-next.0
- @backstage/plugin-api-docs@0.7.1-next.0
- @backstage/plugin-azure-devops@0.1.13-next.0
- @backstage/plugin-badges@0.2.21-next.0
- @backstage/plugin-catalog@0.7.11-next.0
- @backstage/plugin-catalog-graph@0.2.9-next.0
- @backstage/plugin-catalog-react@0.6.13-next.0
- @backstage/plugin-circleci@0.2.36-next.0
- @backstage/plugin-cloudbuild@0.2.34-next.0
- @backstage/plugin-code-coverage@0.1.24-next.0
- @backstage/plugin-cost-insights@0.11.19-next.0
- @backstage/plugin-explore@0.3.28-next.0
- @backstage/plugin-gcp-projects@0.3.16-next.0
- @backstage/plugin-github-actions@0.4.34-next.0
- @backstage/plugin-gocd@0.1.3-next.0
- @backstage/plugin-graphiql@0.2.29-next.0
- @backstage/plugin-home@0.4.13-next.0
- @backstage/plugin-jenkins@0.5.19-next.0
- @backstage/plugin-kafka@0.2.27-next.0
- @backstage/plugin-kubernetes@0.5.6-next.0
- @backstage/plugin-lighthouse@0.2.36-next.0
- @backstage/plugin-newrelic@0.3.15-next.0
- @backstage/plugin-newrelic-dashboard@0.1.5-next.0
- @backstage/plugin-rollbar@0.3.25-next.0
- @backstage/plugin-search@0.6.1-next.0
- @backstage/plugin-sentry@0.3.35-next.0
- @backstage/plugin-shortcuts@0.1.21-next.0
- @backstage/plugin-tech-insights@0.1.7-next.0
- @backstage/plugin-tech-radar@0.5.4-next.0
- @backstage/plugin-todo@0.1.21-next.0
- @backstage/plugin-user-settings@0.3.18-next.0
## 0.2.62
### Patch Changes
+44 -42
View File
@@ -1,54 +1,56 @@
{
"name": "example-app",
"version": "0.2.62",
"version": "0.2.63-next.0",
"private": true,
"bundled": true,
"dependencies": {
"@backstage/app-defaults": "^0.1.5",
"@backstage/app-defaults": "^0.1.6-next.0",
"@backstage/catalog-model": "^0.9.10",
"@backstage/cli": "^0.13.0",
"@backstage/cli": "^0.13.1-next.0",
"@backstage/core-app-api": "^0.5.1",
"@backstage/core-components": "^0.8.6",
"@backstage/core-components": "^0.8.7-next.0",
"@backstage/core-plugin-api": "^0.6.0",
"@backstage/integration-react": "^0.1.19",
"@backstage/plugin-airbrake": "^0.1.1",
"@backstage/plugin-api-docs": "^0.7.0",
"@backstage/plugin-azure-devops": "^0.1.12",
"@backstage/plugin-apache-airflow": "^0.1.4",
"@backstage/plugin-badges": "^0.2.20",
"@backstage/plugin-catalog": "^0.7.10",
"@backstage/plugin-catalog-graph": "^0.2.8",
"@backstage/plugin-catalog-import": "^0.7.10",
"@backstage/plugin-catalog-react": "^0.6.12",
"@backstage/plugin-circleci": "^0.2.35",
"@backstage/plugin-cloudbuild": "^0.2.33",
"@backstage/plugin-code-coverage": "^0.1.23",
"@backstage/plugin-cost-insights": "^0.11.18",
"@backstage/plugin-explore": "^0.3.27",
"@backstage/plugin-gcp-projects": "^0.3.15",
"@backstage/plugin-github-actions": "^0.4.33",
"@backstage/plugin-gocd": "^0.1.2",
"@backstage/plugin-graphiql": "^0.2.28",
"@backstage/plugin-home": "^0.4.12",
"@backstage/plugin-jenkins": "^0.5.18",
"@backstage/plugin-kafka": "^0.2.26",
"@backstage/plugin-kubernetes": "^0.5.5",
"@backstage/plugin-lighthouse": "^0.2.35",
"@backstage/plugin-newrelic": "^0.3.14",
"@backstage/plugin-newrelic-dashboard": "^0.1.4",
"@backstage/plugin-org": "^0.4.0",
"@backstage/plugin-pagerduty": "0.3.23",
"@backstage/plugin-rollbar": "^0.3.24",
"@backstage/plugin-scaffolder": "^0.12.0",
"@backstage/plugin-search": "^0.6.0",
"@backstage/plugin-sentry": "^0.3.34",
"@backstage/plugin-shortcuts": "^0.1.20",
"@backstage/plugin-tech-radar": "^0.5.3",
"@backstage/plugin-techdocs": "^0.13.1",
"@backstage/plugin-todo": "^0.1.20",
"@backstage/plugin-user-settings": "^0.3.17",
"@backstage/integration-react": "^0.1.20-next.0",
"@backstage/plugin-airbrake": "^0.1.2-next.0",
"@backstage/plugin-api-docs": "^0.7.1-next.0",
"@backstage/plugin-azure-devops": "^0.1.13-next.0",
"@backstage/plugin-apache-airflow": "^0.1.5-next.0",
"@backstage/plugin-badges": "^0.2.21-next.0",
"@backstage/plugin-catalog": "^0.7.11-next.0",
"@backstage/plugin-catalog-common": "^0.1.1",
"@backstage/plugin-catalog-graph": "^0.2.9-next.0",
"@backstage/plugin-catalog-import": "^0.8.0-next.0",
"@backstage/plugin-catalog-react": "^0.6.13-next.0",
"@backstage/plugin-circleci": "^0.2.36-next.0",
"@backstage/plugin-cloudbuild": "^0.2.34-next.0",
"@backstage/plugin-code-coverage": "^0.1.24-next.0",
"@backstage/plugin-cost-insights": "^0.11.19-next.0",
"@backstage/plugin-explore": "^0.3.28-next.0",
"@backstage/plugin-gcp-projects": "^0.3.16-next.0",
"@backstage/plugin-github-actions": "^0.4.34-next.0",
"@backstage/plugin-gocd": "^0.1.3-next.0",
"@backstage/plugin-graphiql": "^0.2.29-next.0",
"@backstage/plugin-home": "^0.4.13-next.0",
"@backstage/plugin-jenkins": "^0.5.19-next.0",
"@backstage/plugin-kafka": "^0.2.27-next.0",
"@backstage/plugin-kubernetes": "^0.5.6-next.0",
"@backstage/plugin-lighthouse": "^0.2.36-next.0",
"@backstage/plugin-newrelic": "^0.3.15-next.0",
"@backstage/plugin-newrelic-dashboard": "^0.1.5-next.0",
"@backstage/plugin-org": "^0.4.1-next.0",
"@backstage/plugin-pagerduty": "0.3.24-next.0",
"@backstage/plugin-permission-react": "^0.3.0",
"@backstage/plugin-rollbar": "^0.3.25-next.0",
"@backstage/plugin-scaffolder": "^0.12.1-next.0",
"@backstage/plugin-search": "^0.6.1-next.0",
"@backstage/plugin-sentry": "^0.3.35-next.0",
"@backstage/plugin-shortcuts": "^0.1.21-next.0",
"@backstage/plugin-tech-radar": "^0.5.4-next.0",
"@backstage/plugin-techdocs": "^0.13.2-next.0",
"@backstage/plugin-todo": "^0.1.21-next.0",
"@backstage/plugin-user-settings": "^0.3.18-next.0",
"@backstage/search-common": "^0.2.2",
"@backstage/plugin-tech-insights": "^0.1.6",
"@backstage/plugin-tech-insights": "^0.1.7-next.0",
"@backstage/theme": "^0.2.14",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
+7 -1
View File
@@ -86,6 +86,8 @@ import * as plugins from './plugins';
import { techDocsPage } from './components/techdocs/TechDocsPage';
import { ApacheAirflowPage } from '@backstage/plugin-apache-airflow';
import { PermissionedRoute } from '@backstage/plugin-permission-react';
import { catalogEntityCreatePermission } from '@backstage/plugin-catalog-common';
const app = createApp({
apis,
@@ -140,7 +142,11 @@ const routes = (
>
{entityPage}
</Route>
<Route path="/catalog-import" element={<CatalogImportPage />} />
<PermissionedRoute
path="/catalog-import"
permission={catalogEntityCreatePermission}
element={<CatalogImportPage />}
/>
<Route
path="/catalog-graph"
element={
+1 -1
View File
@@ -81,7 +81,7 @@
}
},
"devDependencies": {
"@backstage/cli": "^0.13.0",
"@backstage/cli": "^0.13.1-next.0",
"@backstage/test-utils": "^0.2.3",
"@types/archiver": "^5.1.0",
"@types/compression": "^1.7.0",
+2 -2
View File
@@ -43,8 +43,8 @@
"zod": "^3.9.5"
},
"devDependencies": {
"@backstage/backend-test-utils": "^0.1.15",
"@backstage/cli": "^0.13.0",
"@backstage/backend-test-utils": "^0.1.16-next.0",
"@backstage/cli": "^0.13.1-next.0",
"jest": "^26.0.1",
"wait-for-expect": "^3.0.2"
},
+7
View File
@@ -1,5 +1,12 @@
# @backstage/backend-test-utils
## 0.1.16-next.0
### Patch Changes
- Updated dependencies
- @backstage/cli@0.13.1-next.0
## 0.1.15
### Patch Changes
+3 -3
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/backend-test-utils",
"description": "Test helpers library for Backstage backends",
"version": "0.1.15",
"version": "0.1.16-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"private": false,
@@ -31,7 +31,7 @@
},
"dependencies": {
"@backstage/backend-common": "^0.10.5",
"@backstage/cli": "^0.13.0",
"@backstage/cli": "^0.13.1-next.0",
"@backstage/config": "^0.1.13",
"knex": "^0.95.1",
"mysql2": "^2.2.5",
@@ -41,7 +41,7 @@
"uuid": "^8.0.0"
},
"devDependencies": {
"@backstage/cli": "^0.13.0",
"@backstage/cli": "^0.13.1-next.0",
"jest": "^26.0.1"
},
"files": [
+16
View File
@@ -1,5 +1,21 @@
# example-backend
## 0.2.63-next.0
### Patch Changes
- Updated dependencies
- @backstage/plugin-auth-backend@0.9.0-next.0
- @backstage/plugin-rollbar-backend@0.1.20-next.0
- @backstage/plugin-catalog-backend@0.21.2-next.0
- @backstage/plugin-scaffolder-backend@0.15.23-next.0
- @backstage/plugin-proxy-backend@0.2.17-next.0
- @backstage/plugin-permission-backend@0.4.2-next.0
- @backstage/plugin-permission-node@0.4.2-next.0
- @backstage/plugin-search-backend@0.4.1-next.0
- example-app@0.2.63-next.0
- @backstage/plugin-scaffolder-backend-module-rails@0.2.5-next.0
## 0.2.62
### Patch Changes
+11 -11
View File
@@ -1,6 +1,6 @@
{
"name": "example-backend",
"version": "0.2.62",
"version": "0.2.63-next.0",
"main": "dist/index.cjs.js",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -31,23 +31,23 @@
"@backstage/config": "^0.1.13",
"@backstage/integration": "^0.7.2",
"@backstage/plugin-app-backend": "^0.3.22",
"@backstage/plugin-auth-backend": "^0.8.0",
"@backstage/plugin-auth-backend": "^0.9.0-next.0",
"@backstage/plugin-azure-devops-backend": "^0.3.1",
"@backstage/plugin-badges-backend": "^0.1.16",
"@backstage/plugin-catalog-backend": "^0.21.1",
"@backstage/plugin-catalog-backend": "^0.21.2-next.0",
"@backstage/plugin-code-coverage-backend": "^0.1.20",
"@backstage/plugin-graphql-backend": "^0.1.12",
"@backstage/plugin-jenkins-backend": "^0.1.11",
"@backstage/plugin-kubernetes-backend": "^0.4.5",
"@backstage/plugin-kafka-backend": "^0.2.15",
"@backstage/plugin-permission-backend": "^0.4.1",
"@backstage/plugin-permission-backend": "^0.4.2-next.0",
"@backstage/plugin-permission-common": "^0.4.0",
"@backstage/plugin-permission-node": "^0.4.1",
"@backstage/plugin-proxy-backend": "^0.2.16",
"@backstage/plugin-rollbar-backend": "^0.1.19",
"@backstage/plugin-scaffolder-backend": "^0.15.22",
"@backstage/plugin-scaffolder-backend-module-rails": "^0.2.4",
"@backstage/plugin-search-backend": "^0.4.0",
"@backstage/plugin-permission-node": "^0.4.2-next.0",
"@backstage/plugin-proxy-backend": "^0.2.17-next.0",
"@backstage/plugin-rollbar-backend": "^0.1.20-next.0",
"@backstage/plugin-scaffolder-backend": "^0.15.23-next.0",
"@backstage/plugin-scaffolder-backend-module-rails": "^0.2.5-next.0",
"@backstage/plugin-search-backend": "^0.4.1-next.0",
"@backstage/plugin-search-backend-node": "^0.4.5",
"@backstage/plugin-search-backend-module-elasticsearch": "^0.0.8",
"@backstage/plugin-search-backend-module-pg": "^0.2.4",
@@ -72,7 +72,7 @@
"winston": "^3.2.1"
},
"devDependencies": {
"@backstage/cli": "^0.13.0",
"@backstage/cli": "^0.13.1-next.0",
"@types/dockerode": "^3.3.0",
"@types/express": "^4.17.6",
"@types/express-serve-static-core": "^4.17.5"
+1 -1
View File
@@ -35,7 +35,7 @@
"cross-fetch": "^3.0.6"
},
"devDependencies": {
"@backstage/cli": "^0.13.0",
"@backstage/cli": "^0.13.1-next.0",
"@types/jest": "^26.0.7",
"msw": "^0.35.0"
},
+1 -1
View File
@@ -43,7 +43,7 @@
"yup": "^0.32.9"
},
"devDependencies": {
"@backstage/cli": "^0.13.0",
"@backstage/cli": "^0.13.1-next.0",
"@types/jest": "^26.0.7",
"@types/lodash": "^4.14.151",
"yaml": "^1.9.2"
+6
View File
@@ -1,5 +1,11 @@
# @backstage/cli
## 0.13.1-next.0
### Patch Changes
- 80f510caee: Log warning if unable to parse yarn.lock
## 0.13.0
### Minor Changes
+3 -3
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/cli",
"description": "CLI for developing Backstage plugins and apps",
"version": "0.13.0",
"version": "0.13.1-next.0",
"private": false,
"publishConfig": {
"access": "public"
@@ -117,10 +117,10 @@
"devDependencies": {
"@backstage/backend-common": "^0.10.5",
"@backstage/config": "^0.1.13",
"@backstage/core-components": "^0.8.6",
"@backstage/core-components": "^0.8.7-next.0",
"@backstage/core-plugin-api": "^0.6.0",
"@backstage/core-app-api": "^0.5.1",
"@backstage/dev-utils": "^0.2.19",
"@backstage/dev-utils": "^0.2.20-next.0",
"@backstage/test-utils": "^0.2.3",
"@backstage/theme": "^0.2.14",
"@types/diff": "^5.0.0",
+7
View File
@@ -1,5 +1,12 @@
# @backstage/codemods
## 0.1.32-next.0
### Patch Changes
- Updated dependencies
- @backstage/core-components@0.8.7-next.0
## 0.1.31
### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/codemods",
"description": "A collection of codemods for Backstage projects",
"version": "0.1.31",
"version": "0.1.32-next.0",
"private": false,
"publishConfig": {
"access": "public",
+1 -1
View File
@@ -45,7 +45,7 @@
"react": "^16.13.1 || ^17.0.0"
},
"devDependencies": {
"@backstage/cli": "^0.13.0",
"@backstage/cli": "^0.13.1-next.0",
"@backstage/test-utils": "^0.2.3",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
+8
View File
@@ -1,5 +1,13 @@
# @backstage/core-components
## 0.8.7-next.0
### Patch Changes
- 4c773ed25c: Change subtitle of Header style to use palette.bursts.fontColor
- f465b63b7f: Fix an issue where changes related to the `MobileSidebar` prevented scrolling pages. Additionally improve the menu of the `MobileSidebar` to not overlay the `BottomNavigation`.
- a681cb9c2f: Make linkTarget configurable for MarkdownContent component
## 0.8.6
### Patch Changes
+1
View File
@@ -599,6 +599,7 @@ export function Link(props: LinkProps): JSX.Element;
export type LinkProps = LinkProps_2 &
LinkProps_3 & {
component?: ElementType<any>;
noTrack?: boolean;
};
// Warning: (ae-missing-release-tag) "LoginRequestListItemClassKey" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
+2 -2
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/core-components",
"description": "Core components used by Backstage plugins and apps",
"version": "0.8.6",
"version": "0.8.7-next.0",
"private": false,
"publishConfig": {
"access": "public",
@@ -74,7 +74,7 @@
},
"devDependencies": {
"@backstage/core-app-api": "^0.5.1",
"@backstage/cli": "^0.13.0",
"@backstage/cli": "^0.13.1-next.0",
"@backstage/test-utils": "^0.2.3",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
@@ -76,6 +76,33 @@ describe('<Link />', () => {
});
});
it('does not capture click when noTrack is set', async () => {
const linkText = 'Navigate!';
const analyticsApi = new MockAnalyticsApi();
const customOnClick = jest.fn();
const { getByText } = render(
wrapInTestApp(
<TestApiProvider apis={[[analyticsApiRef, analyticsApi]]}>
<Link to="/test" onClick={customOnClick} noTrack>
{linkText}
</Link>
</TestApiProvider>,
),
);
fireEvent.click(getByText(linkText));
// Analytics event should have been fired.
await waitFor(() => {
// Custom onClick handler should have been fired.
expect(customOnClick).toHaveBeenCalled();
// But there should be no analytics event.
expect(analyticsApi.getEvents()).toHaveLength(0);
});
});
describe('isExternalUri', () => {
it.each([
[true, 'http://'],
@@ -29,6 +29,7 @@ export const isExternalUri = (uri: string) => /^([a-z+.-]+):/.test(uri);
export type LinkProps = MaterialLinkProps &
RouterLinkProps & {
component?: ElementType<any>;
noTrack?: boolean;
};
declare function LinkType(props: LinkProps): JSX.Element;
@@ -62,7 +63,7 @@ const getNodeText = (node: React.ReactNode): string => {
* - Captures Link clicks as analytics events.
*/
const ActualLink = React.forwardRef<any, LinkProps>(
({ onClick, ...props }, ref) => {
({ onClick, noTrack, ...props }, ref) => {
const analytics = useAnalytics();
const to = String(props.to);
const linkText = getNodeText(props.children) || to;
@@ -71,7 +72,9 @@ const ActualLink = React.forwardRef<any, LinkProps>(
const handleClick = (event: React.MouseEvent<any, MouseEvent>) => {
onClick?.(event);
analytics.captureEvent('click', linkText, { attributes: { to } });
if (!noTrack) {
analytics.captureEvent('click', linkText, { attributes: { to } });
}
};
return external ? (
+1 -1
View File
@@ -43,7 +43,7 @@
"react": "^16.13.1 || ^17.0.0"
},
"devDependencies": {
"@backstage/cli": "^0.13.0",
"@backstage/cli": "^0.13.1-next.0",
"@backstage/core-app-api": "^0.5.1",
"@backstage/test-utils": "^0.2.3",
"@testing-library/jest-dom": "^5.10.1",
+53
View File
@@ -1,5 +1,58 @@
# @backstage/create-app
## 0.4.18-next.0
### Patch Changes
- f27f5197e2: Apply the fix from `0.4.16`, which is part of the `v0.65.1` release of Backstage.
- 2687029a67: Update backend-to-backend auth link in configuration file comment
- 24ef62048c: Adds missing `/catalog-graph` route to `<CatalogGraphPage/>`.
To fix this problem for a recently created app please update your `app/src/App.tsx`
```diff
+ import { CatalogGraphPage } from '@backstage/plugin-catalog-graph';
... omitted ...
</Route>
<Route path="/settings" element={<UserSettingsPage />} />
+ <Route path="/catalog-graph" element={<CatalogGraphPage />} />
</FlatRoutes>
```
- cef64b1561: Added `tokenManager` as a required property for the auth-backend `createRouter` function. This dependency is used to issue server tokens that are used by the `CatalogIdentityClient` when looking up users and their group membership during authentication.
These changes are **required** to `packages/backend/src/plugins/auth.ts`:
```diff
export default async function createPlugin({
logger,
database,
config,
discovery,
+ tokenManager,
}: PluginEnvironment): Promise<Router> {
return await createRouter({
logger,
config,
database,
discovery,
+ tokenManager,
});
}
```
- e39d88bd84: Switched the `app` dependency in the backend to use a file target rather than version.
To apply this change to an existing app, make the following change to `packages/backend/package.json`:
```diff
"dependencies": {
- "app": "0.0.0",
+ "app": "file:../app",
```
## 0.4.16
### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/create-app",
"description": "A CLI that helps you create your own Backstage app",
"version": "0.4.15",
"version": "0.4.18-next.0",
"private": false,
"publishConfig": {
"access": "public"
+4
View File
@@ -49,6 +49,7 @@ import { version as pluginApiDocs } from '../../../../plugins/api-docs/package.j
import { version as pluginAppBackend } from '../../../../plugins/app-backend/package.json';
import { version as pluginAuthBackend } from '../../../../plugins/auth-backend/package.json';
import { version as pluginCatalog } from '../../../../plugins/catalog/package.json';
import { version as pluginCatalogCommon } from '../../../../plugins/catalog-common/package.json';
import { version as pluginCatalogReact } from '../../../../plugins/catalog-react/package.json';
import { version as pluginCatalogBackend } from '../../../../plugins/catalog-backend/package.json';
import { version as pluginCatalogGraph } from '../../../../plugins/catalog-graph/package.json';
@@ -59,6 +60,7 @@ import { version as pluginGithubActions } from '../../../../plugins/github-actio
import { version as pluginLighthouse } from '../../../../plugins/lighthouse/package.json';
import { version as pluginOrg } from '../../../../plugins/org/package.json';
import { version as pluginPermissionCommon } from '../../../../plugins/permission-common/package.json';
import { version as pluginPermissionReact } from '../../../../plugins/permission-react/package.json';
import { version as pluginPermissionNode } from '../../../../plugins/permission-node/package.json';
import { version as pluginProxyBackend } from '../../../../plugins/proxy-backend/package.json';
import { version as pluginRollbarBackend } from '../../../../plugins/rollbar-backend/package.json';
@@ -89,6 +91,7 @@ export const packageVersions = {
'@backstage/plugin-app-backend': pluginAppBackend,
'@backstage/plugin-auth-backend': pluginAuthBackend,
'@backstage/plugin-catalog': pluginCatalog,
'@backstage/plugin-catalog-common': pluginCatalogCommon,
'@backstage/plugin-catalog-react': pluginCatalogReact,
'@backstage/plugin-catalog-backend': pluginCatalogBackend,
'@backstage/plugin-catalog-graph': pluginCatalogGraph,
@@ -100,6 +103,7 @@ export const packageVersions = {
'@backstage/plugin-org': pluginOrg,
'@backstage/plugin-permission-common': pluginPermissionCommon,
'@backstage/plugin-permission-node': pluginPermissionNode,
'@backstage/plugin-permission-react': pluginPermissionReact,
'@backstage/plugin-proxy-backend': pluginProxyBackend,
'@backstage/plugin-rollbar-backend': pluginRollbarBackend,
'@backstage/plugin-scaffolder': pluginScaffolder,
@@ -13,11 +13,13 @@
"@backstage/integration-react": "^{{version '@backstage/integration-react'}}",
"@backstage/plugin-api-docs": "^{{version '@backstage/plugin-api-docs'}}",
"@backstage/plugin-catalog": "^{{version '@backstage/plugin-catalog'}}",
"@backstage/plugin-catalog-common": "^{{version '@backstage/plugin-catalog-common'}}",
"@backstage/plugin-catalog-graph": "^{{version '@backstage/plugin-catalog-graph'}}",
"@backstage/plugin-catalog-import": "^{{version '@backstage/plugin-catalog-import'}}",
"@backstage/plugin-catalog-react": "^{{version '@backstage/plugin-catalog-react'}}",
"@backstage/plugin-github-actions": "^{{version '@backstage/plugin-github-actions'}}",
"@backstage/plugin-org": "^{{version '@backstage/plugin-org'}}",
"@backstage/plugin-permission-react": "^{{version '@backstage/plugin-permission-react'}}",
"@backstage/plugin-scaffolder": "^{{version '@backstage/plugin-scaffolder'}}",
"@backstage/plugin-search": "^{{version '@backstage/plugin-search'}}",
"@backstage/plugin-tech-radar": "^{{version '@backstage/plugin-tech-radar'}}",
@@ -30,6 +30,8 @@ import { AlertDisplay, OAuthRequestDialog } from '@backstage/core-components';
import { createApp } from '@backstage/app-defaults';
import { FlatRoutes } from '@backstage/core-app-api';
import { CatalogGraphPage } from '@backstage/plugin-catalog-graph';
import { PermissionedRoute } from '@backstage/plugin-permission-react';
import { catalogEntityCreatePermission } from '@backstage/plugin-catalog-common';
const app = createApp({
apis,
@@ -76,7 +78,11 @@ const routes = (
path="/tech-radar"
element={<TechRadarPage width={1500} height={800} />}
/>
<Route path="/catalog-import" element={<CatalogImportPage />} />
<PermissionedRoute
path="/catalog-import"
permission={catalogEntityCreatePermission}
element={<CatalogImportPage />}
/>
<Route path="/search" element={<SearchPage />}>
{searchPage}
</Route>
+10
View File
@@ -1,5 +1,15 @@
# @backstage/dev-utils
## 0.2.20-next.0
### Patch Changes
- Updated dependencies
- @backstage/core-components@0.8.7-next.0
- @backstage/app-defaults@0.1.6-next.0
- @backstage/integration-react@0.1.20-next.0
- @backstage/plugin-catalog-react@0.6.13-next.0
## 0.2.19
### Patch Changes
+6 -6
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/dev-utils",
"description": "Utilities for developing Backstage plugins.",
"version": "0.2.19",
"version": "0.2.20-next.0",
"private": false,
"publishConfig": {
"access": "public",
@@ -29,13 +29,13 @@
"clean": "backstage-cli clean"
},
"dependencies": {
"@backstage/app-defaults": "^0.1.5",
"@backstage/app-defaults": "^0.1.6-next.0",
"@backstage/core-app-api": "^0.5.1",
"@backstage/core-components": "^0.8.6",
"@backstage/core-components": "^0.8.7-next.0",
"@backstage/core-plugin-api": "^0.6.0",
"@backstage/catalog-model": "^0.9.10",
"@backstage/integration-react": "^0.1.19",
"@backstage/plugin-catalog-react": "^0.6.12",
"@backstage/integration-react": "^0.1.20-next.0",
"@backstage/plugin-catalog-react": "^0.6.13-next.0",
"@backstage/test-utils": "^0.2.3",
"@backstage/theme": "^0.2.14",
"@material-ui/core": "^4.12.2",
@@ -55,7 +55,7 @@
"react-dom": "^16.13.1 || ^17.0.0"
},
"devDependencies": {
"@backstage/cli": "^0.13.0",
"@backstage/cli": "^0.13.1-next.0",
"@types/jest": "^26.0.7",
"@types/node": "^14.14.32"
},
@@ -1,5 +1,17 @@
# embedded-techdocs-app
## 0.2.62-next.0
### Patch Changes
- Updated dependencies
- @backstage/core-components@0.8.7-next.0
- @backstage/plugin-techdocs@0.13.2-next.0
- @backstage/cli@0.13.1-next.0
- @backstage/app-defaults@0.1.6-next.0
- @backstage/integration-react@0.1.20-next.0
- @backstage/plugin-catalog@0.7.11-next.0
## 0.2.61
### Patch Changes
+8 -8
View File
@@ -1,19 +1,19 @@
{
"name": "embedded-techdocs-app",
"version": "0.2.61",
"version": "0.2.62-next.0",
"private": true,
"bundled": true,
"dependencies": {
"@backstage/app-defaults": "^0.1.5",
"@backstage/app-defaults": "^0.1.6-next.0",
"@backstage/catalog-model": "^0.9.10",
"@backstage/cli": "^0.13.0",
"@backstage/cli": "^0.13.1-next.0",
"@backstage/config": "^0.1.13",
"@backstage/core-app-api": "^0.5.1",
"@backstage/core-components": "^0.8.6",
"@backstage/core-components": "^0.8.7-next.0",
"@backstage/core-plugin-api": "^0.6.0",
"@backstage/integration-react": "^0.1.19",
"@backstage/plugin-catalog": "^0.7.10",
"@backstage/plugin-techdocs": "^0.13.1",
"@backstage/integration-react": "^0.1.20-next.0",
"@backstage/plugin-catalog": "^0.7.11-next.0",
"@backstage/plugin-techdocs": "^0.13.2-next.0",
"@backstage/test-utils": "^0.2.3",
"@backstage/theme": "^0.2.14",
"@material-ui/core": "^4.11.0",
@@ -26,7 +26,7 @@
"react-use": "^17.2.4"
},
"devDependencies": {
"@backstage/cli": "^0.13.0",
"@backstage/cli": "^0.13.1-next.0",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^13.1.8",
+1 -1
View File
@@ -35,7 +35,7 @@
"serialize-error": "^8.0.1"
},
"devDependencies": {
"@backstage/cli": "^0.13.0",
"@backstage/cli": "^0.13.1-next.0",
"@types/jest": "^26.0.7"
},
"files": [
+7
View File
@@ -1,5 +1,12 @@
# @backstage/integration-react
## 0.1.20-next.0
### Patch Changes
- Updated dependencies
- @backstage/core-components@0.8.7-next.0
## 0.1.19
### Patch Changes
+4 -4
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/integration-react",
"description": "Frontend package for managing integrations towards external systems",
"version": "0.1.19",
"version": "0.1.20-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -22,7 +22,7 @@
},
"dependencies": {
"@backstage/config": "^0.1.13",
"@backstage/core-components": "^0.8.6",
"@backstage/core-components": "^0.8.7-next.0",
"@backstage/core-plugin-api": "^0.6.0",
"@backstage/integration": "^0.7.2",
"@backstage/theme": "^0.2.14",
@@ -35,8 +35,8 @@
"react": "^16.13.1 || ^17.0.0"
},
"devDependencies": {
"@backstage/cli": "^0.13.0",
"@backstage/dev-utils": "^0.2.19",
"@backstage/cli": "^0.13.1-next.0",
"@backstage/dev-utils": "^0.2.20-next.0",
"@backstage/test-utils": "^0.2.3",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
+1 -1
View File
@@ -39,7 +39,7 @@
"lodash": "^4.17.21"
},
"devDependencies": {
"@backstage/cli": "^0.13.0",
"@backstage/cli": "^0.13.1-next.0",
"@backstage/config-loader": "^0.9.3",
"@backstage/test-utils": "^0.2.3",
"@types/jest": "^26.0.7",
+1 -1
View File
@@ -40,7 +40,7 @@
"@backstage/plugin-permission-common": "^0.4.0-next.0"
},
"devDependencies": {
"@backstage/cli": "^0.13.0"
"@backstage/cli": "^0.13.1-next.0"
},
"jest": {
"roots": [
+6
View File
@@ -1,5 +1,11 @@
# @techdocs/cli
## 0.8.12-next.0
### Patch Changes
- 14472509a3: Use a local file dependency for embedded-techdocs-app, to ensure that it's always pulled out of the workspace
## 0.8.11
### Patch Changes
+2 -2
View File
@@ -1,7 +1,7 @@
{
"name": "@techdocs/cli",
"description": "Utility CLI for managing TechDocs sites in Backstage.",
"version": "0.8.11",
"version": "0.8.12-next.0",
"private": false,
"publishConfig": {
"access": "public"
@@ -32,7 +32,7 @@
"techdocs-cli": "bin/techdocs-cli"
},
"devDependencies": {
"@backstage/cli": "^0.13.0",
"@backstage/cli": "^0.13.1-next.0",
"@types/commander": "^2.12.2",
"@types/fs-extra": "^9.0.6",
"@types/http-proxy": "^1.17.4",
+1 -1
View File
@@ -60,7 +60,7 @@
"winston": "^3.2.1"
},
"devDependencies": {
"@backstage/cli": "^0.13.0",
"@backstage/cli": "^0.13.1-next.0",
"@types/fs-extra": "^9.0.5",
"@types/js-yaml": "^4.0.0",
"@types/mime-types": "^2.1.0",
+1 -1
View File
@@ -51,7 +51,7 @@
"react": "^16.13.1 || ^17.0.0"
},
"devDependencies": {
"@backstage/cli": "^0.13.0",
"@backstage/cli": "^0.13.1-next.0",
"@types/jest": "^26.0.7",
"@types/node": "^14.14.32",
"msw": "^0.35.0"
+1 -1
View File
@@ -31,7 +31,7 @@
"@material-ui/core": "^4.12.2"
},
"devDependencies": {
"@backstage/cli": "^0.13.0"
"@backstage/cli": "^0.13.1-next.0"
},
"files": [
"dist"
+1 -1
View File
@@ -31,7 +31,7 @@
},
"dependencies": {},
"devDependencies": {
"@backstage/cli": "^0.13.0",
"@backstage/cli": "^0.13.1-next.0",
"@types/zen-observable": "^0.8.0",
"zen-observable": "^0.8.15"
},
+1 -1
View File
@@ -33,7 +33,7 @@
"react": "^16.13.1 || ^17.0.0"
},
"devDependencies": {
"@backstage/cli": "^0.13.0",
"@backstage/cli": "^0.13.1-next.0",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/react-hooks": "^7.0.2"
+7
View File
@@ -1,5 +1,12 @@
# @backstage/plugin-airbrake
## 0.1.2-next.0
### Patch Changes
- Updated dependencies
- @backstage/core-components@0.8.7-next.0
## 0.1.1
### Patch Changes
+5 -5
View File
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-airbrake",
"version": "0.1.1",
"version": "0.1.2-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -21,7 +21,7 @@
},
"dependencies": {
"@backstage/catalog-model": "^0.9.10",
"@backstage/core-components": "^0.8.6",
"@backstage/core-components": "^0.8.7-next.0",
"@backstage/core-plugin-api": "^0.6.0",
"@backstage/plugin-catalog-react": "^0.6.12",
"@backstage/theme": "^0.2.14",
@@ -36,10 +36,10 @@
},
"devDependencies": {
"@types/object-hash": "^2.2.1",
"@backstage/app-defaults": "^0.1.5",
"@backstage/cli": "^0.13.0",
"@backstage/app-defaults": "^0.1.6-next.0",
"@backstage/cli": "^0.13.1-next.0",
"@backstage/core-app-api": "^0.5.1",
"@backstage/dev-utils": "^0.2.19",
"@backstage/dev-utils": "^0.2.20-next.0",
"@backstage/test-utils": "^0.2.3",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
+8
View File
@@ -1,5 +1,13 @@
# @backstage/plugin-allure
## 0.1.13-next.0
### Patch Changes
- Updated dependencies
- @backstage/core-components@0.8.7-next.0
- @backstage/plugin-catalog-react@0.6.13-next.0
## 0.1.12
### Patch Changes
+5 -5
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-allure",
"description": "A Backstage plugin that integrates with Allure",
"version": "0.1.12",
"version": "0.1.13-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -23,9 +23,9 @@
},
"dependencies": {
"@backstage/catalog-model": "^0.9.10",
"@backstage/core-components": "^0.8.6",
"@backstage/core-components": "^0.8.7-next.0",
"@backstage/core-plugin-api": "^0.6.0",
"@backstage/plugin-catalog-react": "^0.6.12",
"@backstage/plugin-catalog-react": "^0.6.13-next.0",
"@backstage/theme": "^0.2.14",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
@@ -37,9 +37,9 @@
"react": "^16.13.1 || ^17.0.0"
},
"devDependencies": {
"@backstage/cli": "^0.13.0",
"@backstage/cli": "^0.13.1-next.0",
"@backstage/core-app-api": "^0.5.1",
"@backstage/dev-utils": "^0.2.19",
"@backstage/dev-utils": "^0.2.20-next.0",
"@backstage/test-utils": "^0.2.3",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
+9
View File
@@ -1,5 +1,14 @@
# @backstage/plugin-analytics-module-ga
## 0.1.8-next.0
### Patch Changes
- b40a0ccc4d: Added the ability to capture and set user IDs from Backstage's `identityApi`. For full instructions on how to
set this up, see [the User ID section of its README](https://github.com/backstage/backstage/tree/master/plugins/analytics-module-ga#user-ids)
- Updated dependencies
- @backstage/core-components@0.8.7-next.0
## 0.1.7
### Patch Changes
+4 -4
View File
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-analytics-module-ga",
"version": "0.1.7",
"version": "0.1.8-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -22,7 +22,7 @@
},
"dependencies": {
"@backstage/config": "^0.1.13",
"@backstage/core-components": "^0.8.6",
"@backstage/core-components": "^0.8.7-next.0",
"@backstage/core-plugin-api": "^0.6.0",
"@backstage/theme": "^0.2.14",
"@material-ui/core": "^4.12.2",
@@ -35,9 +35,9 @@
"react": "^16.13.1 || ^17.0.0"
},
"devDependencies": {
"@backstage/cli": "^0.13.0",
"@backstage/cli": "^0.13.1-next.0",
"@backstage/core-app-api": "^0.5.1",
"@backstage/dev-utils": "^0.2.19",
"@backstage/dev-utils": "^0.2.20-next.0",
"@backstage/test-utils": "^0.2.3",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
+7
View File
@@ -1,5 +1,12 @@
# @backstage/plugin-apache-airflow
## 0.1.5-next.0
### Patch Changes
- Updated dependencies
- @backstage/core-components@0.8.7-next.0
## 0.1.4
### Patch Changes
+4 -4
View File
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-apache-airflow",
"version": "0.1.4",
"version": "0.1.5-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -20,7 +20,7 @@
"clean": "backstage-cli clean"
},
"dependencies": {
"@backstage/core-components": "^0.8.6",
"@backstage/core-components": "^0.8.7-next.0",
"@backstage/core-plugin-api": "^0.6.0",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
@@ -33,9 +33,9 @@
"react": "^16.13.1 || ^17.0.0"
},
"devDependencies": {
"@backstage/cli": "^0.13.0",
"@backstage/cli": "^0.13.1-next.0",
"@backstage/core-app-api": "^0.5.1",
"@backstage/dev-utils": "^0.2.19",
"@backstage/dev-utils": "^0.2.20-next.0",
"@backstage/test-utils": "^0.2.3",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
+9
View File
@@ -1,5 +1,14 @@
# @backstage/plugin-api-docs
## 0.7.1-next.0
### Patch Changes
- Updated dependencies
- @backstage/core-components@0.8.7-next.0
- @backstage/plugin-catalog@0.7.11-next.0
- @backstage/plugin-catalog-react@0.6.13-next.0
## 0.7.0
### Minor Changes
+6 -6
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-api-docs",
"description": "A Backstage plugin that helps represent API entities in the frontend",
"version": "0.7.0",
"version": "0.7.1-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -32,10 +32,10 @@
"dependencies": {
"@asyncapi/react-component": "1.0.0-next.32",
"@backstage/catalog-model": "^0.9.10",
"@backstage/core-components": "^0.8.6",
"@backstage/core-components": "^0.8.7-next.0",
"@backstage/core-plugin-api": "^0.6.0",
"@backstage/plugin-catalog": "^0.7.10",
"@backstage/plugin-catalog-react": "^0.6.12",
"@backstage/plugin-catalog": "^0.7.11-next.0",
"@backstage/plugin-catalog-react": "^0.6.13-next.0",
"@backstage/theme": "^0.2.14",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
@@ -53,9 +53,9 @@
"react": "^16.13.1 || ^17.0.0"
},
"devDependencies": {
"@backstage/cli": "^0.13.0",
"@backstage/cli": "^0.13.1-next.0",
"@backstage/core-app-api": "^0.5.1",
"@backstage/dev-utils": "^0.2.19",
"@backstage/dev-utils": "^0.2.20-next.0",
"@backstage/test-utils": "^0.2.3",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
+2 -2
View File
@@ -47,8 +47,8 @@
"yn": "^4.0.0"
},
"devDependencies": {
"@backstage/backend-test-utils": "^0.1.15",
"@backstage/cli": "^0.13.0",
"@backstage/backend-test-utils": "^0.1.16-next.0",
"@backstage/cli": "^0.13.1-next.0",
"@backstage/types": "^0.1.1",
"@types/supertest": "^2.0.8",
"mock-fs": "^5.1.0",
+32
View File
@@ -1,5 +1,37 @@
# @backstage/plugin-auth-backend
## 0.9.0-next.0
### Minor Changes
- cef64b1561: **BREAKING** Added `tokenManager` as a required property for the auth-backend `createRouter` function. This dependency is used to issue server tokens that are used by the `CatalogIdentityClient` when looking up users and their group membership during authentication.
These changes are **required** to `packages/backend/src/plugins/auth.ts`:
```diff
export default async function createPlugin({
logger,
database,
config,
discovery,
+ tokenManager,
}: PluginEnvironment): Promise<Router> {
return await createRouter({
logger,
config,
database,
discovery,
+ tokenManager,
});
}
```
**BREAKING** The `CatalogIdentityClient` constructor now expects a `TokenManager` instead of a `TokenIssuer`. The `TokenManager` interface is used to generate a server token when [resolving a user's identity and membership through the catalog](https://backstage.io/docs/auth/identity-resolver). Using server tokens for these requests allows the auth-backend to bypass authorization checks when permissions are enabled for Backstage. This change will break apps that rely on the user tokens that were previously used by the client. Refer to the ["Backend-to-backend Authentication" tutorial](https://backstage.io/docs/tutorials/backend-to-backend-auth) for more information on server token usage.
### Patch Changes
- 28a5f9d0b1: chore(deps): bump `passport` from 0.4.1 to 0.5.2
## 0.8.0
### Minor Changes
+2 -2
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-auth-backend",
"description": "A Backstage backend plugin that handles authentication",
"version": "0.8.0",
"version": "0.9.0-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -73,7 +73,7 @@
"yn": "^4.0.0"
},
"devDependencies": {
"@backstage/cli": "^0.13.0",
"@backstage/cli": "^0.13.1-next.0",
"@backstage/test-utils": "^0.2.3",
"@types/body-parser": "^1.19.0",
"@types/cookie-parser": "^1.4.2",
+1 -1
View File
@@ -32,7 +32,7 @@
"yn": "^4.0.0"
},
"devDependencies": {
"@backstage/cli": "^0.13.0",
"@backstage/cli": "^0.13.1-next.0",
"@types/supertest": "^2.0.8",
"supertest": "^6.1.6",
"msw": "^0.35.0"
+1 -1
View File
@@ -29,7 +29,7 @@
"clean": "backstage-cli clean"
},
"devDependencies": {
"@backstage/cli": "^0.13.0"
"@backstage/cli": "^0.13.1-next.0"
},
"files": [
"dist"
+8
View File
@@ -1,5 +1,13 @@
# @backstage/plugin-azure-devops
## 0.1.13-next.0
### Patch Changes
- Updated dependencies
- @backstage/core-components@0.8.7-next.0
- @backstage/plugin-catalog-react@0.6.13-next.0
## 0.1.12
### Patch Changes
+5 -5
View File
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-azure-devops",
"version": "0.1.12",
"version": "0.1.13-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -28,11 +28,11 @@
},
"dependencies": {
"@backstage/catalog-model": "^0.9.10",
"@backstage/core-components": "^0.8.6",
"@backstage/core-components": "^0.8.7-next.0",
"@backstage/core-plugin-api": "^0.6.0",
"@backstage/errors": "^0.2.0",
"@backstage/plugin-azure-devops-common": "^0.2.0",
"@backstage/plugin-catalog-react": "^0.6.12",
"@backstage/plugin-catalog-react": "^0.6.13-next.0",
"@backstage/theme": "^0.2.14",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
@@ -46,9 +46,9 @@
"react": "^16.13.1 || ^17.0.0"
},
"devDependencies": {
"@backstage/cli": "^0.13.0",
"@backstage/cli": "^0.13.1-next.0",
"@backstage/core-app-api": "^0.5.1",
"@backstage/dev-utils": "^0.2.19",
"@backstage/dev-utils": "^0.2.20-next.0",
"@backstage/test-utils": "^0.2.3",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
+1 -1
View File
@@ -45,7 +45,7 @@
"yn": "^4.0.0"
},
"devDependencies": {
"@backstage/cli": "^0.13.0",
"@backstage/cli": "^0.13.1-next.0",
"@types/supertest": "^2.0.8",
"supertest": "^6.1.3"
},
+8
View File
@@ -1,5 +1,13 @@
# @backstage/plugin-badges
## 0.2.21-next.0
### Patch Changes
- Updated dependencies
- @backstage/core-components@0.8.7-next.0
- @backstage/plugin-catalog-react@0.6.13-next.0
## 0.2.20
### Patch Changes
+5 -5
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-badges",
"description": "A Backstage plugin that generates README badges for your entities",
"version": "0.2.20",
"version": "0.2.21-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -28,10 +28,10 @@
},
"dependencies": {
"@backstage/catalog-model": "^0.9.10",
"@backstage/core-components": "^0.8.6",
"@backstage/core-components": "^0.8.7-next.0",
"@backstage/core-plugin-api": "^0.6.0",
"@backstage/errors": "^0.2.0",
"@backstage/plugin-catalog-react": "^0.6.12",
"@backstage/plugin-catalog-react": "^0.6.13-next.0",
"@backstage/theme": "^0.2.14",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
@@ -43,9 +43,9 @@
"react": "^16.13.1 || ^17.0.0"
},
"devDependencies": {
"@backstage/cli": "^0.13.0",
"@backstage/cli": "^0.13.1-next.0",
"@backstage/core-app-api": "^0.5.1",
"@backstage/dev-utils": "^0.2.19",
"@backstage/dev-utils": "^0.2.20-next.0",
"@backstage/test-utils": "^0.2.3",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
+7
View File
@@ -1,5 +1,12 @@
# @backstage/plugin-bazaar-backend
## 0.1.8-next.0
### Patch Changes
- Updated dependencies
- @backstage/backend-test-utils@0.1.16-next.0
## 0.1.7
### Patch Changes
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-bazaar-backend",
"version": "0.1.7",
"version": "0.1.8-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -21,7 +21,7 @@
},
"dependencies": {
"@backstage/backend-common": "^0.10.5",
"@backstage/backend-test-utils": "^0.1.15",
"@backstage/backend-test-utils": "^0.1.16-next.0",
"@backstage/config": "^0.1.13",
"@types/express": "^4.17.6",
"express": "^4.17.1",
@@ -31,7 +31,7 @@
"yn": "^4.0.0"
},
"devDependencies": {
"@backstage/cli": "^0.13.0"
"@backstage/cli": "^0.13.1-next.0"
},
"files": [
"dist",
+10
View File
@@ -1,5 +1,15 @@
# @backstage/plugin-bazaar
## 0.1.12-next.0
### Patch Changes
- Updated dependencies
- @backstage/core-components@0.8.7-next.0
- @backstage/cli@0.13.1-next.0
- @backstage/plugin-catalog@0.7.11-next.0
- @backstage/plugin-catalog-react@0.6.13-next.0
## 0.1.11
### Patch Changes
+7 -7
View File
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-bazaar",
"version": "0.1.11",
"version": "0.1.12-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -23,11 +23,11 @@
"dependencies": {
"@backstage/catalog-client": "^0.5.5",
"@backstage/catalog-model": "^0.9.10",
"@backstage/cli": "^0.13.0",
"@backstage/core-components": "^0.8.6",
"@backstage/cli": "^0.13.1-next.0",
"@backstage/core-components": "^0.8.7-next.0",
"@backstage/core-plugin-api": "^0.6.0",
"@backstage/plugin-catalog": "^0.7.10",
"@backstage/plugin-catalog-react": "^0.6.12",
"@backstage/plugin-catalog": "^0.7.11-next.0",
"@backstage/plugin-catalog-react": "^0.6.13-next.0",
"@date-io/luxon": "2.x",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
@@ -44,8 +44,8 @@
"react": "^16.13.1 || ^17.0.0"
},
"devDependencies": {
"@backstage/cli": "^0.13.0",
"@backstage/dev-utils": "^0.2.19",
"@backstage/cli": "^0.13.1-next.0",
"@backstage/dev-utils": "^0.2.20-next.0",
"@testing-library/jest-dom": "^5.10.1",
"cross-fetch": "^3.0.6"
},
+8
View File
@@ -1,5 +1,13 @@
# @backstage/plugin-bitrise
## 0.1.24-next.0
### Patch Changes
- Updated dependencies
- @backstage/core-components@0.8.7-next.0
- @backstage/plugin-catalog-react@0.6.13-next.0
## 0.1.23
### Patch Changes
+5 -5
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-bitrise",
"description": "A Backstage plugin that integrates towards Bitrise",
"version": "0.1.23",
"version": "0.1.24-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -22,9 +22,9 @@
},
"dependencies": {
"@backstage/catalog-model": "^0.9.10",
"@backstage/core-components": "^0.8.6",
"@backstage/core-components": "^0.8.7-next.0",
"@backstage/core-plugin-api": "^0.6.0",
"@backstage/plugin-catalog-react": "^0.6.12",
"@backstage/plugin-catalog-react": "^0.6.13-next.0",
"@backstage/theme": "^0.2.14",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
@@ -40,9 +40,9 @@
"react": "^16.13.1 || ^17.0.0"
},
"devDependencies": {
"@backstage/cli": "^0.13.0",
"@backstage/cli": "^0.13.1-next.0",
"@backstage/core-app-api": "^0.5.1",
"@backstage/dev-utils": "^0.2.19",
"@backstage/dev-utils": "^0.2.20-next.0",
"@backstage/test-utils": "^0.2.3",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
@@ -1,5 +1,12 @@
# @backstage/plugin-catalog-backend-module-ldap
## 0.3.11-next.0
### Patch Changes
- Updated dependencies
- @backstage/plugin-catalog-backend@0.21.2-next.0
## 0.3.10
### Patch Changes
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-catalog-backend-module-ldap",
"description": "A Backstage catalog backend modules that helps integrate towards LDAP",
"version": "0.3.10",
"version": "0.3.11-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -32,7 +32,7 @@
"@backstage/catalog-model": "^0.9.10",
"@backstage/config": "^0.1.13",
"@backstage/errors": "^0.2.0",
"@backstage/plugin-catalog-backend": "^0.21.1",
"@backstage/plugin-catalog-backend": "^0.21.2-next.0",
"@backstage/types": "^0.1.1",
"@types/ldapjs": "^2.2.0",
"ldapjs": "^2.2.0",
@@ -40,7 +40,7 @@
"winston": "^3.2.1"
},
"devDependencies": {
"@backstage/cli": "^0.13.0",
"@backstage/cli": "^0.13.1-next.0",
"@types/lodash": "^4.14.151"
},
"files": [
@@ -1,5 +1,12 @@
# @backstage/plugin-catalog-backend-module-msgraph
## 0.2.14-next.0
### Patch Changes
- Updated dependencies
- @backstage/plugin-catalog-backend@0.21.2-next.0
## 0.2.13
### Patch Changes
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-catalog-backend-module-msgraph",
"description": "A Backstage catalog backend modules that helps integrate towards Microsoft Graph",
"version": "0.2.13",
"version": "0.2.14-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -32,7 +32,7 @@
"@azure/msal-node": "^1.1.0",
"@backstage/catalog-model": "^0.9.10",
"@backstage/config": "^0.1.13",
"@backstage/plugin-catalog-backend": "^0.21.1",
"@backstage/plugin-catalog-backend": "^0.21.2-next.0",
"@microsoft/microsoft-graph-types": "^2.6.0",
"@types/node-fetch": "^2.5.12",
"lodash": "^4.17.21",
@@ -43,7 +43,7 @@
},
"devDependencies": {
"@backstage/backend-common": "^0.10.5",
"@backstage/cli": "^0.13.0",
"@backstage/cli": "^0.13.1-next.0",
"@backstage/test-utils": "^0.2.3",
"@types/lodash": "^4.14.151",
"msw": "^0.35.0"
+9
View File
@@ -1,5 +1,14 @@
# @backstage/plugin-catalog-backend
## 0.21.2-next.0
### Patch Changes
- fac5f112b4: chore(deps): bump `prom-client` from 13.2.0 to 14.0.1
- 5bbffa60be: Pass authorization token to location service inside location api routes
- Updated dependencies
- @backstage/plugin-permission-node@0.4.2-next.0
## 0.21.1
### Patch Changes
+4 -4
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-catalog-backend",
"description": "The Backstage backend plugin that provides the Backstage catalog",
"version": "0.21.1",
"version": "0.21.2-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -38,7 +38,7 @@
"@backstage/integration": "^0.7.2",
"@backstage/plugin-catalog-common": "^0.1.1",
"@backstage/plugin-permission-common": "^0.4.0",
"@backstage/plugin-permission-node": "^0.4.1",
"@backstage/plugin-permission-node": "^0.4.2-next.0",
"@backstage/search-common": "^0.2.2",
"@backstage/types": "^0.1.1",
"@octokit/graphql": "^4.5.8",
@@ -65,8 +65,8 @@
"yup": "^0.32.9"
},
"devDependencies": {
"@backstage/backend-test-utils": "^0.1.15",
"@backstage/cli": "^0.13.0",
"@backstage/backend-test-utils": "^0.1.16-next.0",
"@backstage/cli": "^0.13.1-next.0",
"@backstage/plugin-permission-common": "^0.4.0",
"@backstage/test-utils": "^0.2.3",
"@types/core-js": "^2.5.4",
+3
View File
@@ -5,6 +5,9 @@
```ts
import { Permission } from '@backstage/plugin-permission-common';
// @public
export const catalogEntityCreatePermission: Permission;
// @public
export const catalogEntityDeletePermission: Permission;
+1 -1
View File
@@ -33,7 +33,7 @@
"@backstage/plugin-permission-common": "^0.4.0"
},
"devDependencies": {
"@backstage/cli": "^0.13.0"
"@backstage/cli": "^0.13.1-next.0"
},
"files": [
"dist"
+1
View File
@@ -24,6 +24,7 @@
export {
RESOURCE_TYPE_CATALOG_ENTITY,
catalogEntityReadPermission,
catalogEntityCreatePermission,
catalogEntityDeletePermission,
catalogEntityRefreshPermission,
catalogLocationReadPermission,
+14
View File
@@ -38,6 +38,20 @@ export const catalogEntityReadPermission: Permission = {
resourceType: RESOURCE_TYPE_CATALOG_ENTITY,
};
/**
* This permission is used to authorize actions that involve creating a new
* catalog entity. This includes registering an existing component into the
* catalog.
* @public
*/
export const catalogEntityCreatePermission: Permission = {
name: 'catalog.entity.create',
attributes: {
action: 'create',
},
resourceType: RESOURCE_TYPE_CATALOG_ENTITY,
};
/**
* This permission is used to designate actions that involve removing one or
* more entities from the catalog.
+8
View File
@@ -1,5 +1,13 @@
# @backstage/plugin-catalog-graph
## 0.2.9-next.0
### Patch Changes
- Updated dependencies
- @backstage/core-components@0.8.7-next.0
- @backstage/plugin-catalog-react@0.6.13-next.0
## 0.2.8
### Patch Changes
+5 -5
View File
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-catalog-graph",
"version": "0.2.8",
"version": "0.2.9-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -23,9 +23,9 @@
"dependencies": {
"@backstage/catalog-client": "^0.5.5",
"@backstage/catalog-model": "^0.9.10",
"@backstage/core-components": "^0.8.6",
"@backstage/core-components": "^0.8.7-next.0",
"@backstage/core-plugin-api": "^0.6.0",
"@backstage/plugin-catalog-react": "^0.6.12",
"@backstage/plugin-catalog-react": "^0.6.13-next.0",
"@backstage/theme": "^0.2.14",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
@@ -42,9 +42,9 @@
"react": "^16.13.1 || ^17.0.0"
},
"devDependencies": {
"@backstage/cli": "^0.13.0",
"@backstage/cli": "^0.13.1-next.0",
"@backstage/core-app-api": "^0.5.1",
"@backstage/dev-utils": "^0.2.19",
"@backstage/dev-utils": "^0.2.20-next.0",
"@backstage/test-utils": "^0.2.3",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
+1 -1
View File
@@ -43,7 +43,7 @@
"winston": "^3.2.1"
},
"devDependencies": {
"@backstage/cli": "^0.13.0",
"@backstage/cli": "^0.13.1-next.0",
"@backstage/test-utils": "^0.2.3",
"@graphql-codegen/cli": "^2.3.1",
"@graphql-codegen/typescript": "^2.4.2",
+42
View File
@@ -1,5 +1,47 @@
# @backstage/plugin-catalog-import
## 0.8.0-next.0
### Minor Changes
- 2e8764b95f: Make filename, branch name and examples URLs used in catalog import customizable.
Catalog backend ingestion loop can be already configured to fetch targets with custom catalog filename (other than `catalog-info.yaml`). It's now possible to customize said filename and branch name used in pull requests created by catalog import flow too. This allows organizations to further customize Backstage experience and to better reflect their branding.
Filename (default: `catalog-info.yaml`) and branch name (default: `backstage-integration`) used in pull requests can be configured in `app-config.yaml` as follows:
```yaml
// app-config.yaml
catalog:
import:
entityFilename: anvil.yaml
pullRequestBranchName: anvil-integration
```
Following React components have also been updated to accept optional props for providing example entity and repository paths:
```tsx
<StepInitAnalyzeUrl
...
exampleLocationUrl="https://github.com/acme-corp/our-awesome-api/blob/main/anvil.yaml"
/>
```
```tsx
<ImportInfoCard
exampleLocationUrl="https://github.com/acme-corp/our-awesome-api/blob/main/anvil.yaml"
exampleRepositoryUrl="https://github.com/acme-corp/our-awesome-api"
/>
```
### Patch Changes
- Updated dependencies
- @backstage/core-components@0.8.7-next.0
- @backstage/integration-react@0.1.20-next.0
- @backstage/plugin-catalog-react@0.6.13-next.0
## 0.7.10
### Patch Changes
+6 -6
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-catalog-import",
"description": "A Backstage plugin the helps you import entities into your catalog",
"version": "0.7.10",
"version": "0.8.0-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -33,13 +33,13 @@
"dependencies": {
"@backstage/catalog-client": "^0.5.5",
"@backstage/catalog-model": "^0.9.10",
"@backstage/core-components": "^0.8.6",
"@backstage/core-components": "^0.8.7-next.0",
"@backstage/config": "^0.1.13",
"@backstage/core-plugin-api": "^0.6.0",
"@backstage/errors": "^0.2.0",
"@backstage/integration": "^0.7.2",
"@backstage/integration-react": "^0.1.19",
"@backstage/plugin-catalog-react": "^0.6.12",
"@backstage/integration-react": "^0.1.20-next.0",
"@backstage/plugin-catalog-react": "^0.6.13-next.0",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.57",
@@ -57,9 +57,9 @@
"react": "^16.13.1 || ^17.0.0"
},
"devDependencies": {
"@backstage/cli": "^0.13.0",
"@backstage/cli": "^0.13.1-next.0",
"@backstage/core-app-api": "^0.5.1",
"@backstage/dev-utils": "^0.2.19",
"@backstage/dev-utils": "^0.2.20-next.0",
"@backstage/test-utils": "^0.2.3",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
+7
View File
@@ -1,5 +1,12 @@
# @backstage/plugin-catalog-react
## 0.6.13-next.0
### Patch Changes
- Updated dependencies
- @backstage/core-components@0.8.7-next.0
## 0.6.12
### Patch Changes
+1
View File
@@ -573,6 +573,7 @@ export const EntityRefLink: React_2.ForwardRefExoticComponent<
| 'gutterBottom'
| 'paragraph'
| 'variantMapping'
| 'noTrack'
| 'TypographyClasses'
| 'entityRef'
| 'defaultKind'
+3 -3
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-catalog-react",
"description": "A frontend library that helps other Backstage plugins interact with the catalog",
"version": "0.6.12",
"version": "0.6.13-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -31,7 +31,7 @@
"dependencies": {
"@backstage/catalog-client": "^0.5.5",
"@backstage/catalog-model": "^0.9.10",
"@backstage/core-components": "^0.8.6",
"@backstage/core-components": "^0.8.7-next.0",
"@backstage/core-plugin-api": "^0.6.0",
"@backstage/errors": "^0.2.0",
"@backstage/integration": "^0.7.2",
@@ -54,7 +54,7 @@
"react": "^16.13.1 || ^17.0.0"
},
"devDependencies": {
"@backstage/cli": "^0.13.0",
"@backstage/cli": "^0.13.1-next.0",
"@backstage/core-app-api": "^0.5.1",
"@backstage/plugin-catalog-common": "^0.1.1",
"@backstage/test-utils": "^0.2.3",
@@ -69,11 +69,13 @@ const apis = TestApiRegistry.from(
[storageApiRef, MockStorageApi.create()],
);
const mockIsOwnedEntity = (entity: Entity) =>
entity.metadata.name === 'component-1';
const mockIsOwnedEntity = jest.fn(
(entity: Entity) => entity.metadata.name === 'component-1',
);
const mockIsStarredEntity = (entity: Entity) =>
entity.metadata.name === 'component-3';
const mockIsStarredEntity = jest.fn(
(entity: Entity) => entity.metadata.name === 'component-3',
);
jest.mock('../../hooks', () => {
const actual = jest.requireActual('../../hooks');
@@ -250,4 +252,86 @@ describe('<UserListPicker />', () => {
),
});
});
describe.each`
type | filterFn
${'owned'} | ${mockIsOwnedEntity}
${'starred'} | ${mockIsStarredEntity}
`('filter resetting for $type entities', ({ type, filterFn }) => {
let updateFilters: jest.Mock;
const picker = ({ loading }: { loading: boolean }) => (
<ApiProvider apis={apis}>
<MockEntityListContextProvider
value={{ backendEntities, updateFilters, loading }}
>
<UserListPicker initialFilter={type} />
</MockEntityListContextProvider>
</ApiProvider>
);
beforeEach(() => {
updateFilters = jest.fn();
});
describe(`when there are no ${type} entities match the filter`, () => {
beforeEach(() => {
filterFn.mockReturnValue(false);
});
it('does not reset the filter while entities are loading', () => {
render(picker({ loading: true }));
expect(updateFilters).not.toHaveBeenCalledWith({
user: new UserListFilter(
'all',
mockIsOwnedEntity,
mockIsStarredEntity,
),
});
});
it('resets the filter to "all" when entities are loaded', () => {
render(picker({ loading: false }));
expect(updateFilters).toHaveBeenLastCalledWith({
user: new UserListFilter(
'all',
mockIsOwnedEntity,
mockIsStarredEntity,
),
});
});
});
describe(`when there are some ${type} entities present`, () => {
beforeEach(() => {
filterFn.mockReturnValue(true);
});
it('does not reset the filter while entities are loading', () => {
render(picker({ loading: true }));
expect(updateFilters).not.toHaveBeenCalledWith({
user: new UserListFilter(
'all',
mockIsOwnedEntity,
mockIsStarredEntity,
),
});
});
it('does not reset the filter when entities are loaded', () => {
render(picker({ loading: false }));
expect(updateFilters).toHaveBeenLastCalledWith({
user: new UserListFilter(
type,
mockIsOwnedEntity,
mockIsStarredEntity,
),
});
});
});
});
});
@@ -130,7 +130,7 @@ export const UserListPicker = ({
const classes = useStyles();
const configApi = useApi(configApiRef);
const orgName = configApi.getOptionalString('organization.name') ?? 'Company';
const { filters, updateFilters, backendEntities, queryParameters } =
const { filters, updateFilters, backendEntities, queryParameters, loading } =
useEntityListProvider();
// Remove group items that aren't in availableFilters and exclude
@@ -161,19 +161,46 @@ export const UserListPicker = ({
[isOwnedEntity, isStarredEntity],
);
const [selectedUserFilter, setSelectedUserFilter] = useState(
[queryParameters.user].flat()[0] ?? initialFilter,
);
// To show proper counts for each section, apply all other frontend filters _except_ the user
// filter that's controlled by this picker.
const [entitiesWithoutUserFilter, setEntitiesWithoutUserFilter] =
useState(backendEntities);
const totalOwnedUserEntities = entitiesWithoutUserFilter.filter(entity =>
ownedFilter.filterEntity(entity),
).length;
const [selectedUserFilter, setSelectedUserFilter] = useState(
totalOwnedUserEntities > 0
? [queryParameters.user].flat()[0] ?? initialFilter
: 'all',
const entitiesWithoutUserFilter = useMemo(
() =>
backendEntities.filter(
reduceEntityFilters(
compact(Object.values({ ...filters, user: undefined })),
),
),
[filters, backendEntities],
);
const filterCounts = useMemo<Record<string, number>>(
() => ({
all: entitiesWithoutUserFilter.length,
starred: entitiesWithoutUserFilter.filter(entity =>
starredFilter.filterEntity(entity),
).length,
owned: entitiesWithoutUserFilter.filter(entity =>
ownedFilter.filterEntity(entity),
).length,
}),
[entitiesWithoutUserFilter, starredFilter, ownedFilter],
);
useEffect(() => {
if (
!loading &&
!!selectedUserFilter &&
selectedUserFilter !== 'all' &&
filterCounts[selectedUserFilter] === 0
) {
setSelectedUserFilter('all');
}
}, [loading, filterCounts, selectedUserFilter, setSelectedUserFilter]);
useEffect(() => {
updateFilters({
user: selectedUserFilter
@@ -186,26 +213,6 @@ export const UserListPicker = ({
});
}, [selectedUserFilter, isOwnedEntity, isStarredEntity, updateFilters]);
useEffect(() => {
const filterFn = reduceEntityFilters(
compact(Object.values({ ...filters, user: undefined })),
);
setEntitiesWithoutUserFilter(backendEntities.filter(filterFn));
}, [filters, backendEntities]);
function getFilterCount(id: UserListFilterKind) {
switch (id) {
case 'owned':
return totalOwnedUserEntities;
case 'starred':
return entitiesWithoutUserFilter.filter(entity =>
starredFilter.filterEntity(entity),
).length;
default:
return entitiesWithoutUserFilter.length;
}
}
return (
<Card className={classes.root}>
{filterGroups.map(group => (
@@ -223,6 +230,8 @@ export const UserListPicker = ({
onClick={() => setSelectedUserFilter(item.id)}
selected={item.id === filters.user?.value}
className={classes.menuItem}
disabled={filterCounts[item.id] === 0}
data-testid={`user-picker-${item.id}`}
>
{item.icon && (
<ListItemIcon className={classes.listIcon}>
@@ -230,15 +239,10 @@ export const UserListPicker = ({
</ListItemIcon>
)}
<ListItemText>
<Typography
variant="body1"
data-testid={`user-picker-${item.id}`}
>
{item.label}
</Typography>
<Typography variant="body1">{item.label}</Typography>
</ListItemText>
<ListItemSecondaryAction>
{getFilterCount(item.id) ?? '-'}
{filterCounts[item.id] ?? '-'}
</ListItemSecondaryAction>
</MenuItem>
))}

Some files were not shown because too many files have changed in this diff Show More