Merge branch 'master' into xcmetrics-builds-page

Signed-off-by: Niklas Granander <ngranander@spotify.com>
This commit is contained in:
Niklas Granander
2021-07-30 15:50:51 +02:00
213 changed files with 3103 additions and 917 deletions
+18
View File
@@ -1,5 +1,23 @@
# @backstage/plugin-api-docs
## 0.6.4
### Patch Changes
- 9d40fcb1e: - Bumping `material-ui/core` version to at least `4.12.2` as they made some breaking changes in later versions which broke `Pagination` of the `Table`.
- Switching out `material-table` to `@material-table/core` for support for the later versions of `material-ui/core`
- This causes a minor API change to `@backstage/core-components` as the interface for `Table` re-exports the `prop` from the underlying `Table` components.
- `onChangeRowsPerPage` has been renamed to `onRowsPerPageChange`
- `onChangePage` has been renamed to `onPageChange`
- Migration guide is here: https://material-table-core.com/docs/breaking-changes
- bebc09fa8: Add explicit import for `isomorphic-form-data` needed for `swagger-ui-react`
- Updated dependencies
- @backstage/core-components@0.2.0
- @backstage/plugin-catalog@0.6.9
- @backstage/plugin-catalog-react@0.4.0
- @backstage/core-plugin-api@0.1.4
- @backstage/theme@0.2.9
## 0.6.3
### Patch Changes
+11 -11
View File
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-api-docs",
"version": "0.6.3",
"version": "0.6.4",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -31,13 +31,13 @@
"dependencies": {
"@asyncapi/react-component": "^0.23.0",
"@backstage/catalog-model": "^0.9.0",
"@backstage/core-components": "^0.1.6",
"@backstage/core-plugin-api": "^0.1.3",
"@backstage/plugin-catalog": "^0.6.8",
"@backstage/plugin-catalog-react": "^0.3.1",
"@backstage/theme": "^0.2.8",
"@backstage/core-components": "^0.2.0",
"@backstage/core-plugin-api": "^0.1.4",
"@backstage/plugin-catalog": "^0.6.9",
"@backstage/plugin-catalog-react": "^0.4.0",
"@backstage/theme": "^0.2.9",
"@material-icons/font": "^1.0.2",
"@material-ui/core": "^4.11.0",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.45",
"@types/react": "^16.9",
@@ -52,10 +52,10 @@
"swagger-ui-react": "^3.37.2"
},
"devDependencies": {
"@backstage/cli": "^0.7.5",
"@backstage/core-app-api": "^0.1.5",
"@backstage/dev-utils": "^0.2.3",
"@backstage/test-utils": "^0.1.15",
"@backstage/cli": "^0.7.6",
"@backstage/core-app-api": "^0.1.6",
"@backstage/dev-utils": "^0.2.4",
"@backstage/test-utils": "^0.1.16",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^13.1.8",
+10
View File
@@ -1,5 +1,15 @@
# @backstage/plugin-auth-backend
## 0.3.19
### Patch Changes
- 4edca1bd0: Allow to configure SAML auth `acceptedClockSkewMs`
- b68f2c83c: Added the `disableRefresh` option to the `OAuth2` config
- Updated dependencies
- @backstage/test-utils@0.1.16
- @backstage/catalog-client@0.3.18
## 0.3.18
### Patch Changes
+1
View File
@@ -65,6 +65,7 @@ export interface Config {
authorizationUrl: string;
tokenUrl: string;
scope?: string;
disableRefresh?: boolean;
};
};
oidc?: {
+4 -4
View File
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-auth-backend",
"version": "0.3.18",
"version": "0.3.19",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -30,11 +30,11 @@
},
"dependencies": {
"@backstage/backend-common": "^0.8.7",
"@backstage/catalog-client": "^0.3.17",
"@backstage/catalog-client": "^0.3.18",
"@backstage/catalog-model": "^0.9.0",
"@backstage/config": "^0.1.5",
"@backstage/errors": "^0.1.1",
"@backstage/test-utils": "^0.1.15",
"@backstage/test-utils": "^0.1.16",
"@types/express": "^4.17.6",
"@types/passport": "^1.0.3",
"compression": "^1.7.4",
@@ -68,7 +68,7 @@
"yn": "^4.0.0"
},
"devDependencies": {
"@backstage/cli": "^0.7.5",
"@backstage/cli": "^0.7.6",
"@types/body-parser": "^1.19.0",
"@types/cookie-parser": "^1.4.2",
"@types/express-session": "^1.17.2",
@@ -177,6 +177,8 @@ export const createOAuth2Provider = (
const authorizationUrl = envConfig.getString('authorizationUrl');
const tokenUrl = envConfig.getString('tokenUrl');
const scope = envConfig.getOptionalString('scope');
const disableRefresh =
envConfig.getOptionalBoolean('disableRefresh') ?? false;
const provider = new OAuth2AuthProvider({
clientId,
@@ -188,7 +190,7 @@ export const createOAuth2Provider = (
});
return OAuthAdapter.fromConfig(globalConfig, provider, {
disableRefresh: false,
disableRefresh,
providerId,
tokenIssuer,
});
+16
View File
@@ -1,5 +1,21 @@
# @backstage/plugin-badges
## 0.2.6
### Patch Changes
- 9d40fcb1e: - Bumping `material-ui/core` version to at least `4.12.2` as they made some breaking changes in later versions which broke `Pagination` of the `Table`.
- Switching out `material-table` to `@material-table/core` for support for the later versions of `material-ui/core`
- This causes a minor API change to `@backstage/core-components` as the interface for `Table` re-exports the `prop` from the underlying `Table` components.
- `onChangeRowsPerPage` has been renamed to `onRowsPerPageChange`
- `onChangePage` has been renamed to `onPageChange`
- Migration guide is here: https://material-table-core.com/docs/breaking-changes
- Updated dependencies
- @backstage/core-components@0.2.0
- @backstage/plugin-catalog-react@0.4.0
- @backstage/core-plugin-api@0.1.4
- @backstage/theme@0.2.9
## 0.2.5
### Patch Changes
+10 -10
View File
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-badges",
"version": "0.2.5",
"version": "0.2.6",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -21,12 +21,12 @@
},
"dependencies": {
"@backstage/catalog-model": "^0.9.0",
"@backstage/core-components": "^0.1.6",
"@backstage/core-plugin-api": "^0.1.3",
"@backstage/core-components": "^0.2.0",
"@backstage/core-plugin-api": "^0.1.4",
"@backstage/errors": "^0.1.1",
"@backstage/plugin-catalog-react": "^0.3.0",
"@backstage/theme": "^0.2.8",
"@material-ui/core": "^4.11.0",
"@backstage/plugin-catalog-react": "^0.4.0",
"@backstage/theme": "^0.2.9",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.45",
"react": "^16.13.1",
@@ -35,10 +35,10 @@
"react-use": "^17.2.4"
},
"devDependencies": {
"@backstage/cli": "^0.7.5",
"@backstage/core-app-api": "^0.1.5",
"@backstage/dev-utils": "^0.2.3",
"@backstage/test-utils": "^0.1.15",
"@backstage/cli": "^0.7.6",
"@backstage/core-app-api": "^0.1.6",
"@backstage/dev-utils": "^0.2.4",
"@backstage/test-utils": "^0.1.16",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^13.1.8",
+16
View File
@@ -1,5 +1,21 @@
# @backstage/plugin-bitrise
## 0.1.8
### Patch Changes
- 9d40fcb1e: - Bumping `material-ui/core` version to at least `4.12.2` as they made some breaking changes in later versions which broke `Pagination` of the `Table`.
- Switching out `material-table` to `@material-table/core` for support for the later versions of `material-ui/core`
- This causes a minor API change to `@backstage/core-components` as the interface for `Table` re-exports the `prop` from the underlying `Table` components.
- `onChangeRowsPerPage` has been renamed to `onRowsPerPageChange`
- `onChangePage` has been renamed to `onPageChange`
- Migration guide is here: https://material-table-core.com/docs/breaking-changes
- Updated dependencies
- @backstage/core-components@0.2.0
- @backstage/plugin-catalog-react@0.4.0
- @backstage/core-plugin-api@0.1.4
- @backstage/theme@0.2.9
## 0.1.7
### Patch Changes
+10 -10
View File
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-bitrise",
"version": "0.1.7",
"version": "0.1.8",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -21,11 +21,11 @@
},
"dependencies": {
"@backstage/catalog-model": "^0.9.0",
"@backstage/core-components": "^0.1.6",
"@backstage/core-plugin-api": "^0.1.3",
"@backstage/plugin-catalog-react": "^0.3.0",
"@backstage/theme": "^0.2.8",
"@material-ui/core": "^4.11.0",
"@backstage/core-components": "^0.2.0",
"@backstage/core-plugin-api": "^0.1.4",
"@backstage/plugin-catalog-react": "^0.4.0",
"@backstage/theme": "^0.2.9",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.45",
"cross-fetch": "^3.0.6",
@@ -38,10 +38,10 @@
"recharts": "^1.8.5"
},
"devDependencies": {
"@backstage/cli": "^0.7.5",
"@backstage/core-app-api": "^0.1.5",
"@backstage/dev-utils": "^0.2.3",
"@backstage/test-utils": "^0.1.15",
"@backstage/cli": "^0.7.6",
"@backstage/core-app-api": "^0.1.6",
"@backstage/dev-utils": "^0.2.4",
"@backstage/test-utils": "^0.1.16",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^13.1.8",
@@ -219,10 +219,10 @@ export const BitriseBuildsTable = ({
}}
totalCount={builds.value?.paging?.total_item_count || 0}
page={page}
onChangePage={pageIndex => {
onPageChange={pageIndex => {
handleChangePage(pageIndex, builds.value?.paging?.next);
}}
onChangeRowsPerPage={handleChangeRowsPerPage}
onRowsPerPageChange={handleChangeRowsPerPage}
columns={columns}
data={builds.value?.data || []}
onSearchChange={(searchTerm: string) =>
@@ -1,5 +1,13 @@
# @backstage/plugin-catalog-backend-module-ldap
## 0.2.2
### Patch Changes
- 2a2a2749b: chore(deps): bump `@types/ldapjs` from 1.0.10 to 2.2.0
- Updated dependencies
- @backstage/plugin-catalog-backend@0.13.1
## 0.2.1
### Patch Changes
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-catalog-backend-module-ldap",
"version": "0.2.1",
"version": "0.2.2",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -30,15 +30,15 @@
"dependencies": {
"@backstage/catalog-model": "^0.9.0",
"@backstage/config": "^0.1.5",
"@backstage/plugin-catalog-backend": "^0.13.0",
"@backstage/plugin-catalog-backend": "^0.13.1",
"@types/ldapjs": "^2.2.0",
"ldapjs": "^2.2.0",
"lodash": "^4.17.15",
"winston": "^3.2.1"
},
"devDependencies": {
"@backstage/cli": "^0.7.4",
"@backstage/test-utils": "^0.1.13",
"@backstage/cli": "^0.7.6",
"@backstage/test-utils": "^0.1.16",
"@types/lodash": "^4.14.151",
"msw": "^0.29.0"
},
+8
View File
@@ -1,5 +1,13 @@
# @backstage/plugin-catalog-backend
## 0.13.1
### Patch Changes
- 11c370af2: Support filtering entities via property existence. For example you can now query with `/entities?filter=metadata.annotations.blah` to fetch all entities that has the particular property defined.
- Updated dependencies
- @backstage/catalog-client@0.3.18
## 0.13.0
### Minor Changes
+10 -9
View File
@@ -636,6 +636,7 @@ export type EntitiesCatalog = {
export type EntitiesSearchFilter = {
key: string;
matchValueIn?: string[];
matchValueExists?: boolean;
};
// Warning: (ae-missing-release-tag) "entity" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
@@ -1077,16 +1078,16 @@ export class UrlReaderProcessor implements CatalogProcessor {
// src/catalog/types.d.ts:44:8 - (tsdoc-param-tag-with-invalid-name) The @param block should be followed by a valid parameter name: The identifier cannot non-word characters
// src/catalog/types.d.ts:45:8 - (tsdoc-param-tag-with-invalid-name) The @param block should be followed by a valid parameter name: The identifier cannot non-word characters
// src/catalog/types.d.ts:75:5 - (ae-forgotten-export) The symbol "LocationUpdateLogEvent" needs to be exported by the entry point index.d.ts
// src/database/types.d.ts:121:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
// src/database/types.d.ts:127:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
// src/database/types.d.ts:128:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
// src/database/types.d.ts:142:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
// src/database/types.d.ts:143:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
// src/database/types.d.ts:144:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
// src/database/types.d.ts:125:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
// src/database/types.d.ts:131:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
// src/database/types.d.ts:132:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
// src/database/types.d.ts:146:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
// src/database/types.d.ts:159:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
// src/database/types.d.ts:160:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
// src/database/types.d.ts:161:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
// src/database/types.d.ts:147:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
// src/database/types.d.ts:148:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
// src/database/types.d.ts:150:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
// src/database/types.d.ts:163:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
// src/database/types.d.ts:164:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
// src/database/types.d.ts:165:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
// src/ingestion/processors/GithubMultiOrgReaderProcessor.d.ts:23:9 - (ae-forgotten-export) The symbol "GithubMultiOrgConfig" needs to be exported by the entry point index.d.ts
// src/ingestion/processors/types.d.ts:7:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
// src/ingestion/processors/types.d.ts:8:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
+4 -4
View File
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-catalog-backend",
"version": "0.13.0",
"version": "0.13.1",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -30,7 +30,7 @@
},
"dependencies": {
"@backstage/backend-common": "^0.8.6",
"@backstage/catalog-client": "^0.3.16",
"@backstage/catalog-client": "^0.3.18",
"@backstage/catalog-model": "^0.9.0",
"@backstage/config": "^0.1.5",
"@backstage/errors": "^0.1.1",
@@ -62,8 +62,8 @@
},
"devDependencies": {
"@backstage/backend-test-utils": "^0.1.4",
"@backstage/cli": "^0.7.4",
"@backstage/test-utils": "^0.1.14",
"@backstage/cli": "^0.7.6",
"@backstage/test-utils": "^0.1.16",
"@types/core-js": "^2.5.4",
"@types/git-url-parse": "^9.0.0",
"@types/lodash": "^4.14.151",
@@ -491,6 +491,98 @@ describe('CommonDatabase', () => {
]),
);
});
it('can get all specific entities for matching existence filters', async () => {
const entities: Entity[] = [
{
apiVersion: 'A',
kind: 'K1',
metadata: {
name: 'N',
annotations: {
foo: 'bar',
},
},
spec: { c: 'SOME' },
},
{
apiVersion: 'a',
kind: 'k2',
metadata: {
name: 'N',
annotations: {
foo: 'bar',
},
},
spec: { c: 'Some' },
},
{
apiVersion: 'a',
kind: 'k3',
metadata: { name: 'n' },
spec: { c: 'somE' },
},
];
await db.transaction(async tx => {
await db.addEntities(
tx,
entities.map(entity => ({ entity, relations: [] })),
);
});
const existRows = await db.transaction(async tx =>
db.entities(tx, {
filter: {
anyOf: [
{
allOf: [
{ key: 'metadata.annotations.foo', matchValueExists: true },
],
},
],
},
}),
);
expect(existRows.entities.length).toEqual(2);
expect(existRows.entities).toEqual(
expect.arrayContaining([
{
locationId: undefined,
entity: expect.objectContaining({ kind: 'K1' }),
},
{
locationId: undefined,
entity: expect.objectContaining({ kind: 'k2' }),
},
]),
);
const nonExistRows = await db.transaction(async tx =>
db.entities(tx, {
filter: {
anyOf: [
{
allOf: [
{ key: 'metadata.annotations.foo', matchValueExists: false },
],
},
],
},
}),
);
expect(nonExistRows.entities.length).toEqual(1);
expect(nonExistRows.entities).toEqual(
expect.arrayContaining([
{
locationId: undefined,
entity: expect.objectContaining({ kind: 'k3' }),
},
]),
);
});
});
describe('setRelations', () => {
@@ -218,7 +218,11 @@ export class CommonDatabase implements Database {
for (const singleFilter of request?.filter?.anyOf ?? []) {
entitiesQuery = entitiesQuery.orWhere(function singleFilterFn() {
for (const { key, matchValueIn } of singleFilter.allOf) {
for (const {
key,
matchValueIn,
matchValueExists,
} of singleFilter.allOf) {
// NOTE(freben): This used to be a set of OUTER JOIN, which may seem to
// make a lot of sense. However, it had abysmal performance on sqlite
// when datasets grew large, so we're using IN instead.
@@ -226,7 +230,7 @@ export class CommonDatabase implements Database {
.select('entity_id')
.where(function keyFilter() {
this.andWhere({ key: key.toLowerCase() });
if (matchValueIn) {
if (matchValueExists !== false && matchValueIn) {
if (matchValueIn.length === 1) {
this.andWhere({ value: matchValueIn[0].toLowerCase() });
} else if (matchValueIn.length > 1) {
@@ -238,7 +242,12 @@ export class CommonDatabase implements Database {
}
}
});
this.andWhere('id', 'in', matchQuery);
// Explicitly evaluate matchValueExists as a boolean since it may be undefined
this.andWhere(
'id',
matchValueExists === false ? 'not in' : 'in',
matchQuery,
);
}
});
}
@@ -118,6 +118,11 @@ export type EntitiesSearchFilter = {
* case insensitive.
*/
matchValueIn?: string[];
/**
* Match on existence of key.
*/
matchValueExists?: boolean;
};
/**
@@ -78,7 +78,11 @@ export class NextEntitiesCatalog implements EntitiesCatalog {
for (const singleFilter of request?.filter?.anyOf ?? []) {
entitiesQuery = entitiesQuery.orWhere(function singleFilterFn() {
for (const { key, matchValueIn } of singleFilter.allOf) {
for (const {
key,
matchValueIn,
matchValueExists,
} of singleFilter.allOf) {
// NOTE(freben): This used to be a set of OUTER JOIN, which may seem to
// make a lot of sense. However, it had abysmal performance on sqlite
// when datasets grew large, so we're using IN instead.
@@ -86,7 +90,7 @@ export class NextEntitiesCatalog implements EntitiesCatalog {
.select('entity_id')
.where(function keyFilter() {
this.andWhere({ key: key.toLowerCase() });
if (matchValueIn) {
if (matchValueExists !== false && matchValueIn) {
if (matchValueIn.length === 1) {
this.andWhere({ value: matchValueIn[0].toLowerCase() });
} else if (matchValueIn.length > 1) {
@@ -98,7 +102,12 @@ export class NextEntitiesCatalog implements EntitiesCatalog {
}
}
});
this.andWhere('entity_id', 'in', matchQuery);
// Explicitly evaluate matchValueExists as a boolean since it may be undefined
this.andWhere(
'entity_id',
matchValueExists === false ? 'not in' : 'in',
matchQuery,
);
}
});
}
@@ -69,9 +69,11 @@ describe('parseEntityFilterParams', () => {
describe('parseEntityFilterString', () => {
it('works for the happy path', () => {
expect(parseEntityFilterString('')).toBeUndefined();
expect(parseEntityFilterString('a=1,b=2,a=3')).toEqual([
expect(parseEntityFilterString('a=1,b=2,a=3,c,d=')).toEqual([
{ key: 'a', matchValueIn: ['1', '3'] },
{ key: 'b', matchValueIn: ['2'] },
{ key: 'c', matchValueExists: true },
{ key: 'd', matchValueIn: [''] },
]);
});
@@ -83,17 +85,11 @@ describe('parseEntityFilterString', () => {
});
it('rejects malformed strings', () => {
expect(() => parseEntityFilterString('x=2,a=')).toThrow(
"Invalid filter, 'a=' is not a valid statement (expected a string on the form a=b)",
);
expect(() => parseEntityFilterString('x=2,=a')).toThrow(
"Invalid filter, '=a' is not a valid statement (expected a string on the form a=b)",
"Invalid filter, '=a' is not a valid statement (expected a string on the form a=b or a= or a)",
);
expect(() => parseEntityFilterString('x=2,=')).toThrow(
"Invalid filter, '=' is not a valid statement (expected a string on the form a=b)",
);
expect(() => parseEntityFilterString('x=2,a')).toThrow(
"Invalid filter, 'a' is not a valid statement (expected a string on the form a=b)",
"Invalid filter, '=' is not a valid statement (expected a string on the form a=b or a= or a)",
);
});
});
@@ -61,25 +61,26 @@ export function parseEntityFilterString(
for (const statement of statements) {
const equalsIndex = statement.indexOf('=');
if (equalsIndex < 1) {
throw new InputError(
`Invalid filter, '${statement}' is not a valid statement (expected a string on the form a=b)`,
);
}
const key = statement.substr(0, equalsIndex).trim();
const value = statement.substr(equalsIndex + 1).trim();
if (!key || !value) {
const key =
equalsIndex === -1 ? statement : statement.substr(0, equalsIndex).trim();
const value =
equalsIndex === -1 ? undefined : statement.substr(equalsIndex + 1).trim();
if (!key) {
throw new InputError(
`Invalid filter, '${statement}' is not a valid statement (expected a string on the form a=b)`,
`Invalid filter, '${statement}' is not a valid statement (expected a string on the form a=b or a= or a)`,
);
}
const f =
key in filtersByKey
? filtersByKey[key]
: (filtersByKey[key] = { key, matchValueIn: [] });
f.matchValueIn!.push(value);
key in filtersByKey ? filtersByKey[key] : (filtersByKey[key] = { key });
if (value === undefined) {
f.matchValueExists = true;
} else {
f.matchValueIn = f.matchValueIn || [];
f.matchValueIn.push(value);
}
}
return Object.values(filtersByKey);
+18
View File
@@ -1,5 +1,23 @@
# @backstage/plugin-catalog-import
## 0.5.15
### Patch Changes
- 9d40fcb1e: - Bumping `material-ui/core` version to at least `4.12.2` as they made some breaking changes in later versions which broke `Pagination` of the `Table`.
- Switching out `material-table` to `@material-table/core` for support for the later versions of `material-ui/core`
- This causes a minor API change to `@backstage/core-components` as the interface for `Table` re-exports the `prop` from the underlying `Table` components.
- `onChangeRowsPerPage` has been renamed to `onRowsPerPageChange`
- `onChangePage` has been renamed to `onPageChange`
- Migration guide is here: https://material-table-core.com/docs/breaking-changes
- Updated dependencies
- @backstage/core-components@0.2.0
- @backstage/plugin-catalog-react@0.4.0
- @backstage/core-plugin-api@0.1.4
- @backstage/integration-react@0.1.5
- @backstage/theme@0.2.9
- @backstage/catalog-client@0.3.18
## 0.5.14
### Patch Changes
+12 -12
View File
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-catalog-import",
"version": "0.5.14",
"version": "0.5.15",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -30,15 +30,15 @@
"clean": "backstage-cli clean"
},
"dependencies": {
"@backstage/catalog-client": "^0.3.17",
"@backstage/catalog-client": "^0.3.18",
"@backstage/catalog-model": "^0.9.0",
"@backstage/core-components": "^0.1.6",
"@backstage/core-plugin-api": "^0.1.3",
"@backstage/core-components": "^0.2.0",
"@backstage/core-plugin-api": "^0.1.4",
"@backstage/integration": "^0.5.8",
"@backstage/integration-react": "^0.1.4",
"@backstage/plugin-catalog-react": "^0.3.1",
"@backstage/theme": "^0.2.8",
"@material-ui/core": "^4.11.0",
"@backstage/integration-react": "^0.1.5",
"@backstage/plugin-catalog-react": "^0.4.0",
"@backstage/theme": "^0.2.9",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.45",
"@octokit/rest": "^18.5.3",
@@ -54,10 +54,10 @@
"yaml": "^1.10.0"
},
"devDependencies": {
"@backstage/cli": "^0.7.5",
"@backstage/core-app-api": "^0.1.5",
"@backstage/dev-utils": "^0.2.3",
"@backstage/test-utils": "^0.1.15",
"@backstage/cli": "^0.7.6",
"@backstage/core-app-api": "^0.1.6",
"@backstage/dev-utils": "^0.2.4",
"@backstage/test-utils": "^0.1.16",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/react-hooks": "^3.3.0",
+40
View File
@@ -1,5 +1,45 @@
# @backstage/plugin-catalog-react
## 0.4.0
### Minor Changes
- c5cb55803: Introduce the `useEntityOwnership` hook, which implements the full new ownership model.
This also means a breaking change to the interface of `UserListFilter`. It no longer
accepts a user entity as input, but rather a function that checks ownership of an
entity. This function is taken from the above mentioned hook output. So if you are
instantiating the filter yourself, you will change from something like
```ts
const { entity } = useOwnUser();
const filter = new UserListFilter('owned', user, ...);
```
to
```ts
const { isOwnedEntity } = useEntityOwnership();
const filter = new UserListFilter('owned', isOwnedEntity, ...);
```
### Patch Changes
- 19d9995b6: Improve accessibility of core & catalog components by adjusting them with non-breaking changes.
- 11c370af2: Export `CATALOG_FILTER_EXISTS` symbol
- 9d40fcb1e: - Bumping `material-ui/core` version to at least `4.12.2` as they made some breaking changes in later versions which broke `Pagination` of the `Table`.
- Switching out `material-table` to `@material-table/core` for support for the later versions of `material-ui/core`
- This causes a minor API change to `@backstage/core-components` as the interface for `Table` re-exports the `prop` from the underlying `Table` components.
- `onChangeRowsPerPage` has been renamed to `onRowsPerPageChange`
- `onChangePage` has been renamed to `onPageChange`
- Migration guide is here: https://material-table-core.com/docs/breaking-changes
- 043a4238f: Fix `EntityListProvider` to not update url if unmounted
- Updated dependencies
- @backstage/core-components@0.2.0
- @backstage/core-app-api@0.1.6
- @backstage/core-plugin-api@0.1.4
- @backstage/catalog-client@0.3.18
## 0.3.1
### Patch Changes
+14 -3
View File
@@ -7,6 +7,7 @@
import { ApiRef } from '@backstage/core-plugin-api';
import { AsyncState } from 'react-use/lib/useAsync';
import { CATALOG_FILTER_EXISTS } from '@backstage/catalog-client';
import { CatalogApi } from '@backstage/catalog-client';
import { ComponentEntity } from '@backstage/catalog-model';
import { Context } from 'react';
@@ -22,6 +23,8 @@ import { SystemEntity } from '@backstage/catalog-model';
import { TableColumn } from '@backstage/core-components';
import { UserEntity } from '@backstage/catalog-model';
export { CATALOG_FILTER_EXISTS };
export { CatalogApi };
// Warning: (ae-missing-release-tag) "catalogApiRef" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
@@ -721,6 +724,14 @@ export function useEntityListProvider<
EntityFilters extends DefaultEntityFilters = DefaultEntityFilters
>(): EntityListContextProps<EntityFilters>;
// Warning: (ae-missing-release-tag) "useEntityOwnership" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public
export function useEntityOwnership(): {
loading: boolean;
isOwnedEntity: (entity: Entity | EntityName) => boolean;
};
// Warning: (ae-forgotten-export) The symbol "EntityTypeReturn" needs to be exported by the entry point index.d.ts
// Warning: (ae-missing-release-tag) "useEntityTypeFilter" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
@@ -756,18 +767,18 @@ export function useRelatedEntities(
export class UserListFilter implements EntityFilter {
constructor(
value: UserListFilterKind,
user: UserEntity | undefined,
isOwnedEntity: (entity: Entity) => boolean,
isStarredEntity: (entity: Entity) => boolean,
);
// (undocumented)
filterEntity(entity: Entity): boolean;
// (undocumented)
readonly isOwnedEntity: (entity: Entity) => boolean;
// (undocumented)
readonly isStarredEntity: (entity: Entity) => boolean;
// (undocumented)
toQueryValue(): string;
// (undocumented)
readonly user: UserEntity | undefined;
// (undocumented)
readonly value: UserListFilterKind;
}
+11 -9
View File
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-catalog-react",
"version": "0.3.1",
"version": "0.4.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -28,16 +28,17 @@
"clean": "backstage-cli clean"
},
"dependencies": {
"@backstage/catalog-client": "^0.3.17",
"@backstage/catalog-client": "^0.3.18",
"@backstage/catalog-model": "^0.9.0",
"@backstage/core-app-api": "^0.1.5",
"@backstage/core-components": "^0.1.6",
"@backstage/core-plugin-api": "^0.1.3",
"@backstage/core-app-api": "^0.1.6",
"@backstage/core-components": "^0.2.0",
"@backstage/core-plugin-api": "^0.1.4",
"@backstage/integration": "^0.5.8",
"@material-ui/core": "^4.11.0",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.45",
"@types/react": "^16.9",
"jwt-decode": "^3.1.0",
"lodash": "^4.17.15",
"qs": "^6.9.4",
"react": "^16.13.1",
@@ -46,14 +47,15 @@
"react-use": "^17.2.4"
},
"devDependencies": {
"@backstage/cli": "^0.7.5",
"@backstage/dev-utils": "^0.2.3",
"@backstage/test-utils": "^0.1.15",
"@backstage/cli": "^0.7.6",
"@backstage/dev-utils": "^0.2.4",
"@backstage/test-utils": "^0.1.16",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/react-hooks": "^3.3.0",
"@testing-library/user-event": "^13.1.8",
"@types/jest": "^26.0.7",
"@types/jwt-decode": "^3.1.0",
"@types/node": "^14.14.32",
"cross-fetch": "^3.0.6",
"msw": "^0.29.0",
@@ -15,7 +15,7 @@
*/
import React from 'react';
import { fireEvent, render } from '@testing-library/react';
import { fireEvent, render, waitFor } from '@testing-library/react';
import {
Entity,
RELATION_OWNED_BY,
@@ -58,7 +58,8 @@ const mockCatalogApi = {
} as Partial<CatalogApi>;
const mockIdentityApi = {
getUserId: () => '',
getUserId: () => 'testUser',
getIdToken: async () => undefined,
} as Partial<IdentityApi>;
const apis = ApiRegistry.from([
@@ -68,6 +69,9 @@ const apis = ApiRegistry.from([
[storageApiRef, MockStorageApi.create()],
]);
const mockIsOwnedEntity = (entity: Entity) =>
entity.metadata.name === 'component-1';
const mockIsStarredEntity = (entity: Entity) =>
entity.metadata.name === 'component-3';
@@ -75,7 +79,9 @@ jest.mock('../../hooks', () => {
const actual = jest.requireActual('../../hooks');
return {
...actual,
useOwnUser: () => ({ value: mockUser }),
useEntityOwnership: () => ({
isOwnedEntity: mockIsOwnedEntity,
}),
useStarredEntities: () => ({
isStarredEntity: mockIsStarredEntity,
}),
@@ -161,7 +167,7 @@ describe('<UserListPicker />', () => {
).toEqual(['Owned', 'Starred', 'All']);
});
it('includes counts alongside each filter', () => {
it('includes counts alongside each filter', async () => {
const { getAllByRole } = render(
<ApiProvider apis={apis}>
<MockEntityListContextProvider value={{ backendEntities }}>
@@ -172,14 +178,16 @@ describe('<UserListPicker />', () => {
// Material UI renders ListItemSecondaryActions outside the
// menuitem itself, so we pick off the next sibling.
expect(
getAllByRole('menuitem').map(
({ nextSibling }) => nextSibling?.textContent,
),
).toEqual(['2', '1', '4']);
await waitFor(() => {
expect(
getAllByRole('menuitem').map(
({ nextSibling }) => nextSibling?.textContent,
),
).toEqual(['1', '1', '4']);
});
});
it('respects other frontend filters in counts', () => {
it('respects other frontend filters in counts', async () => {
const { getAllByRole } = render(
<ApiProvider apis={apis}>
<MockEntityListContextProvider
@@ -193,11 +201,13 @@ describe('<UserListPicker />', () => {
</ApiProvider>,
);
expect(
getAllByRole('menuitem').map(
({ nextSibling }) => nextSibling?.textContent,
),
).toEqual(['1', '0', '2']);
await waitFor(() => {
expect(
getAllByRole('menuitem').map(
({ nextSibling }) => nextSibling?.textContent,
),
).toEqual(['1', '0', '2']);
});
});
it('respects the query parameter filter value', () => {
@@ -214,7 +224,7 @@ describe('<UserListPicker />', () => {
);
expect(updateFilters).toHaveBeenLastCalledWith({
user: new UserListFilter('owned', mockUser, mockIsStarredEntity),
user: new UserListFilter('owned', mockIsOwnedEntity, mockIsStarredEntity),
});
});
@@ -233,7 +243,11 @@ describe('<UserListPicker />', () => {
fireEvent.click(getByText('Starred'));
expect(updateFilters).toHaveBeenLastCalledWith({
user: new UserListFilter('starred', mockUser, mockIsStarredEntity),
user: new UserListFilter(
'starred',
mockIsOwnedEntity,
mockIsStarredEntity,
),
});
});
});
@@ -14,15 +14,11 @@
* limitations under the License.
*/
import React, { Fragment, useEffect, useMemo, useState } from 'react';
import { compact } from 'lodash';
import { UserListFilterKind } from '../../types';
import { UserListFilter } from '../../filters';
import {
useEntityListProvider,
useOwnUser,
useStarredEntities,
} from '../../hooks';
configApiRef,
IconComponent,
useApi,
} from '@backstage/core-plugin-api';
import {
Card,
List,
@@ -36,12 +32,16 @@ import {
} from '@material-ui/core';
import SettingsIcon from '@material-ui/icons/Settings';
import StarIcon from '@material-ui/icons/Star';
import { reduceEntityFilters } from '../../utils';
import { compact } from 'lodash';
import React, { Fragment, useEffect, useMemo, useState } from 'react';
import { UserListFilter } from '../../filters';
import {
configApiRef,
IconComponent,
useApi,
} from '@backstage/core-plugin-api';
useEntityListProvider,
useStarredEntities,
useEntityOwnership,
} from '../../hooks';
import { UserListFilterKind } from '../../types';
import { reduceEntityFilters } from '../../utils';
const useStyles = makeStyles<Theme>(theme => ({
root: {
@@ -136,20 +136,20 @@ export const UserListPicker = ({
queryParameters,
} = useEntityListProvider();
const { value: user } = useOwnUser();
const { isStarredEntity } = useStarredEntities();
const { isOwnedEntity } = useEntityOwnership();
const [selectedUserFilter, setSelectedUserFilter] = useState(
[queryParameters.user].flat()[0] ?? initialFilter,
);
// Static filters; used for generating counts of potentially unselected kinds
const ownedFilter = useMemo(
() => new UserListFilter('owned', user, isStarredEntity),
[user, isStarredEntity],
() => new UserListFilter('owned', isOwnedEntity, isStarredEntity),
[isOwnedEntity, isStarredEntity],
);
const starredFilter = useMemo(
() => new UserListFilter('starred', user, isStarredEntity),
[user, isStarredEntity],
() => new UserListFilter('starred', isOwnedEntity, isStarredEntity),
[isOwnedEntity, isStarredEntity],
);
useEffect(() => {
@@ -157,12 +157,12 @@ export const UserListPicker = ({
user: selectedUserFilter
? new UserListFilter(
selectedUserFilter as UserListFilterKind,
user,
isOwnedEntity,
isStarredEntity,
)
: undefined,
});
}, [selectedUserFilter, user, isStarredEntity, updateFilters]);
}, [selectedUserFilter, isOwnedEntity, isStarredEntity, updateFilters]);
// To show proper counts for each section, apply all other frontend filters _except_ the user
// filter that's controlled by this picker.
+5 -9
View File
@@ -14,14 +14,10 @@
* limitations under the License.
*/
import {
Entity,
UserEntity,
RELATION_OWNED_BY,
} from '@backstage/catalog-model';
import { EntityFilter, UserListFilterKind } from './types';
import { getEntityRelations, isOwnerOf } from './utils';
import { Entity, RELATION_OWNED_BY } from '@backstage/catalog-model';
import { formatEntityRefTitle } from './components/EntityRefLink';
import { EntityFilter, UserListFilterKind } from './types';
import { getEntityRelations } from './utils';
export class EntityKindFilter implements EntityFilter {
constructor(readonly value: string) {}
@@ -116,14 +112,14 @@ export class EntityLifecycleFilter implements EntityFilter {
export class UserListFilter implements EntityFilter {
constructor(
readonly value: UserListFilterKind,
readonly user: UserEntity | undefined,
readonly isOwnedEntity: (entity: Entity) => boolean,
readonly isStarredEntity: (entity: Entity) => boolean,
) {}
filterEntity(entity: Entity): boolean {
switch (this.value) {
case 'owned':
return this.user !== undefined && isOwnerOf(this.user, entity);
return this.isOwnedEntity(entity);
case 'starred':
return this.isStarredEntity(entity);
default:
+1
View File
@@ -25,3 +25,4 @@ export { useEntityTypeFilter } from './useEntityTypeFilter';
export { useOwnUser } from './useOwnUser';
export { useRelatedEntities } from './useRelatedEntities';
export { useStarredEntities } from './useStarredEntities';
export { useEntityOwnership } from './useEntityOwnership';
@@ -20,7 +20,7 @@ import { MemoryRouter as Router } from 'react-router-dom';
import { act, renderHook } from '@testing-library/react-hooks';
import { MockStorageApi } from '@backstage/test-utils';
import { CatalogApi } from '@backstage/catalog-client';
import { Entity, UserEntity } from '@backstage/catalog-model';
import { Entity } from '@backstage/catalog-model';
import {
EntityListProvider,
useEntityListProvider,
@@ -39,17 +39,6 @@ import {
storageApiRef,
} from '@backstage/core-plugin-api';
const mockUser: UserEntity = {
apiVersion: 'backstage.io/v1beta1',
kind: 'User',
metadata: {
name: 'guest',
},
spec: {
memberOf: [],
},
};
const entities: Entity[] = [
{
apiVersion: '1',
@@ -81,13 +70,12 @@ const mockConfigApi = {
getOptionalString: () => '',
} as Partial<ConfigApi>;
const mockIdentityApi: Partial<IdentityApi> = {
getUserId: () => 'guest@example.com',
getUserId: () => 'guest',
getIdToken: async () => undefined,
};
const mockCatalogApi: Partial<CatalogApi> = {
getEntities: jest
.fn()
.mockImplementation(() => Promise.resolve({ items: entities })),
getEntityByName: () => Promise.resolve(mockUser),
getEntities: jest.fn().mockImplementation(async () => ({ items: entities })),
getEntityByName: async () => undefined,
};
const apis = ApiRegistry.from([
[configApiRef, mockConfigApi],
@@ -117,7 +105,7 @@ const wrapper = ({
);
};
describe('<EntityListProvider/>', () => {
describe('<EntityListProvider />', () => {
beforeEach(() => {
jest.clearAllMocks();
});
@@ -171,18 +159,26 @@ describe('<EntityListProvider/>', () => {
const { result, waitFor } = renderHook(() => useEntityListProvider(), {
wrapper,
});
await waitFor(() => !!result.current.entities.length);
expect(result.current.entities.length).toBe(2);
expect(mockCatalogApi.getEntities).toHaveBeenCalledTimes(1);
await waitFor(() => {
expect(result.current.entities.length).toBe(2);
expect(mockCatalogApi.getEntities).toHaveBeenCalledTimes(1);
});
act(() =>
result.current.updateFilters({
user: new UserListFilter('owned', mockUser, () => true),
user: new UserListFilter(
'owned',
entity => entity.metadata.name === 'component-1',
() => true,
),
}),
);
await waitFor(() => result.current.entities.length !== 2);
expect(mockCatalogApi.getEntities).toHaveBeenCalledTimes(1);
expect(result.current.entities.length).toBe(1);
await waitFor(() => {
expect(result.current.entities.length).toBe(1);
expect(mockCatalogApi.getEntities).toHaveBeenCalledTimes(1);
});
});
it('debounces multiple filter changes', async () => {
@@ -205,7 +201,7 @@ describe('<EntityListProvider/>', () => {
});
it('returns an error on catalogApi failure', async () => {
const { result, waitForNextUpdate, waitForValueToChange } = renderHook(
const { result, waitForValueToChange, waitFor } = renderHook(
() => useEntityListProvider(),
{
wrapper,
@@ -218,7 +214,8 @@ describe('<EntityListProvider/>', () => {
act(() => {
result.current.updateFilters({ kind: new EntityKindFilter('api') });
});
await waitForNextUpdate();
expect(result.current.error).toBeDefined();
await waitFor(() => {
expect(result.current.error).toBeDefined();
});
});
});
@@ -0,0 +1,255 @@
/*
* Copyright 2021 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { CatalogApi } from '@backstage/catalog-client';
import {
ComponentEntity,
RELATION_MEMBER_OF,
RELATION_OWNED_BY,
UserEntity,
} from '@backstage/catalog-model';
import { ApiProvider, ApiRegistry } from '@backstage/core-app-api';
import { IdentityApi, identityApiRef } from '@backstage/core-plugin-api';
import { renderHook } from '@testing-library/react-hooks';
import React from 'react';
import { catalogApiRef } from '../api';
import {
loadCatalogOwnerRefs,
loadIdentityOwnerRefs,
useEntityOwnership,
} from './useEntityOwnership';
describe('useEntityOwnership', () => {
type MockIdentityApi = jest.Mocked<
Pick<IdentityApi, 'getUserId' | 'getIdToken'>
>;
type MockCatalogApi = jest.Mocked<Pick<CatalogApi, 'getEntityByName'>>;
const mockIdentityApi: MockIdentityApi = {
getUserId: jest.fn(),
getIdToken: jest.fn(),
};
const mockCatalogApi: MockCatalogApi = {
getEntityByName: jest.fn(),
};
const identityApi = (mockIdentityApi as unknown) as IdentityApi;
const catalogApi = (mockCatalogApi as unknown) as CatalogApi;
const Wrapper = ({ children }: { children?: React.ReactNode }) => (
<ApiProvider
apis={ApiRegistry.with(identityApiRef, identityApi).with(
catalogApiRef,
catalogApi,
)}
>
{children}
</ApiProvider>
);
const ownedEntity: ComponentEntity = {
apiVersion: 'backstage.io/v1beta1',
kind: 'Component',
metadata: {
name: 'component1',
namespace: 'default',
},
spec: {
/* should not be accessed */
} as any,
relations: [
{
type: RELATION_OWNED_BY,
target: { kind: 'User', namespace: 'default', name: 'user1' },
},
{
type: RELATION_OWNED_BY,
target: { kind: 'Group', namespace: 'default', name: 'group1' },
},
],
};
const user2Entity: UserEntity = {
apiVersion: 'backstage.io/v1beta1',
kind: 'User',
metadata: {
name: 'user2',
namespace: 'default',
},
spec: {
/* should not be accessed */
} as any,
relations: [
{
type: RELATION_MEMBER_OF,
target: { kind: 'Group', namespace: 'default', name: 'group1' },
},
],
};
// these were generated on https://jwt.io, based off of its default example token
// no ent at all
const tokenNoEnt =
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c';
// "ent": []
const tokenEmptyEnt =
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyLCJlbnQiOltdfQ.Khyza2whczkoC4wSCLBhBaBB9-ktIkk7gpXEgQPHhtY';
// "ent": ["user:default/user1"]
const tokenUserEnt =
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyLCJlbnQiOlsidXNlcjpkZWZhdWx0L3VzZXIxIl19.CMCxjwI4rj_TD3uUoBNgFjkZI23LwRTbQnSPBxzncoY';
// "ent": ["user:default/user1", "group:default/group1"]
const tokenUserAndGroupEnt =
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyLCJlbnQiOlsidXNlcjpkZWZhdWx0L3VzZXIxIiwiZ3JvdXA6ZGVmYXVsdC9ncm91cDEiXX0.ZZmZrogbQKx0hnForw63ETkyAhUyeoBE8Hgloi45rdg';
afterEach(() => {
jest.resetAllMocks();
});
describe('loadIdentityOwnerRefs', () => {
it('returns the user id when there is no relevant token info', async () => {
mockIdentityApi.getUserId.mockReturnValueOnce('foo');
mockIdentityApi.getIdToken.mockResolvedValueOnce(undefined);
await expect(loadIdentityOwnerRefs(identityApi)).resolves.toEqual([
'user:default/foo',
]);
mockIdentityApi.getUserId.mockReturnValueOnce('ns/foo');
mockIdentityApi.getIdToken.mockResolvedValueOnce(undefined);
await expect(loadIdentityOwnerRefs(identityApi)).resolves.toEqual([
'user:ns/foo',
]);
mockIdentityApi.getUserId.mockReturnValueOnce('user:ns/foo');
mockIdentityApi.getIdToken.mockResolvedValueOnce(undefined);
await expect(loadIdentityOwnerRefs(identityApi)).resolves.toEqual([
'user:ns/foo',
]);
mockIdentityApi.getUserId.mockReturnValueOnce('foo');
mockIdentityApi.getIdToken.mockResolvedValueOnce(tokenNoEnt);
await expect(loadIdentityOwnerRefs(identityApi)).resolves.toEqual([
'user:default/foo',
]);
mockIdentityApi.getUserId.mockReturnValueOnce('foo');
mockIdentityApi.getIdToken.mockResolvedValueOnce(tokenEmptyEnt);
await expect(loadIdentityOwnerRefs(identityApi)).resolves.toEqual([
'user:default/foo',
]);
});
it('returns both the user id and the token parts', async () => {
mockIdentityApi.getUserId.mockReturnValueOnce('foo');
mockIdentityApi.getIdToken.mockResolvedValueOnce(tokenUserEnt);
await expect(loadIdentityOwnerRefs(identityApi)).resolves.toEqual([
'user:default/foo',
'user:default/user1',
]);
mockIdentityApi.getUserId.mockReturnValueOnce('foo');
mockIdentityApi.getIdToken.mockResolvedValueOnce(tokenUserAndGroupEnt);
await expect(loadIdentityOwnerRefs(identityApi)).resolves.toEqual([
'user:default/foo',
'user:default/user1',
'group:default/group1',
]);
});
it('gracefully ignores broken token', async () => {
mockIdentityApi.getUserId.mockReturnValueOnce('foo');
mockIdentityApi.getIdToken.mockResolvedValueOnce('not a jwt');
await expect(loadIdentityOwnerRefs(identityApi)).resolves.toEqual([
'user:default/foo',
]);
});
});
describe('loadCatalogOwnerRefs', () => {
it('loads the first user from the catalog', async () => {
mockCatalogApi.getEntityByName.mockResolvedValueOnce(user2Entity);
await expect(
loadCatalogOwnerRefs(catalogApi, ['user:default/user2']),
).resolves.toEqual(['group:default/group1']);
expect(mockCatalogApi.getEntityByName).toBeCalledWith({
kind: 'user',
namespace: 'default',
name: 'user2',
});
});
it('gracefully handles missing user', async () => {
mockCatalogApi.getEntityByName.mockResolvedValueOnce(undefined);
await expect(
loadCatalogOwnerRefs(catalogApi, ['user:default/user2']),
).resolves.toEqual([]);
expect(mockCatalogApi.getEntityByName).toBeCalledWith({
kind: 'user',
namespace: 'default',
name: 'user2',
});
});
});
describe('useEntityOwnership', () => {
it('matches ownership via token claims', async () => {
mockIdentityApi.getUserId.mockReturnValue('foo');
mockIdentityApi.getIdToken.mockResolvedValue(tokenUserAndGroupEnt);
mockCatalogApi.getEntityByName.mockResolvedValue(undefined);
const { result, waitForValueToChange } = renderHook(
() => useEntityOwnership(),
{
wrapper: Wrapper,
},
);
expect(result.current.loading).toBe(true);
expect(result.current.isOwnedEntity(ownedEntity)).toBe(false);
await waitForValueToChange(() => result.current.loading);
expect(result.current.loading).toBe(false);
expect(result.current.isOwnedEntity(ownedEntity)).toBe(true);
});
it('matches ownership via catalog user entity', async () => {
mockIdentityApi.getUserId.mockReturnValue('user2');
mockIdentityApi.getIdToken.mockResolvedValue(undefined);
mockCatalogApi.getEntityByName.mockResolvedValue(user2Entity);
const { result, waitForValueToChange } = renderHook(
() => useEntityOwnership(),
{
wrapper: Wrapper,
},
);
expect(result.current.loading).toBe(true);
expect(result.current.isOwnedEntity(ownedEntity)).toBe(false);
await waitForValueToChange(() => result.current.loading);
expect(result.current.loading).toBe(false);
expect(result.current.isOwnedEntity(ownedEntity)).toBe(true);
expect(mockCatalogApi.getEntityByName).toBeCalledWith({
kind: 'user',
namespace: 'default',
name: 'user2',
});
});
});
});
@@ -0,0 +1,148 @@
/*
* Copyright 2021 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { CatalogApi } from '@backstage/catalog-client';
import {
Entity,
EntityName,
parseEntityRef,
RELATION_MEMBER_OF,
RELATION_OWNED_BY,
stringifyEntityRef,
} from '@backstage/catalog-model';
import {
IdentityApi,
identityApiRef,
useApi,
} from '@backstage/core-plugin-api';
import jwtDecoder from 'jwt-decode';
import { useMemo } from 'react';
import { useAsync } from 'react-use';
import { catalogApiRef } from '../api';
import { getEntityRelations } from '../utils/getEntityRelations';
// Takes a user ID from the identity, which can be on basically any form, and
// returns an entity ref. E.g. if the input is "foo", it returns
// "user:default/foo" to make sure it's a full ref.
function extendUserId(id: string): string {
try {
const ref = parseEntityRef(id, {
defaultKind: 'User',
defaultNamespace: 'default',
});
return stringifyEntityRef(ref);
} catch {
return id;
}
}
// Takes the relevant parts of the Backstage identity, and translates them into
// a list of entity refs on string form that represent the user's ownership
// connections.
export async function loadIdentityOwnerRefs(
identityApi: IdentityApi,
): Promise<string[]> {
const id = identityApi.getUserId();
const token = await identityApi.getIdToken();
const result: string[] = [];
if (id) {
result.push(extendUserId(id));
}
if (token) {
try {
const decoded = jwtDecoder(token) as any;
if (decoded?.ent) {
[decoded.ent]
.flat()
.filter(x => typeof x === 'string')
.map(x => x.toLocaleLowerCase('en-US'))
.forEach(x => result.push(x));
}
} catch {
// ignore
}
}
return result;
}
// Takes the relevant parts of the User entity corresponding to the Backstage
// identity, and translates them into a list of entity refs on string form that
// represent the user's ownership connections.
export async function loadCatalogOwnerRefs(
catalogApi: CatalogApi,
identityOwnerRefs: string[],
): Promise<string[]> {
const result = new Array<string>();
const primaryUserRef = identityOwnerRefs.find(ref => ref.startsWith('user:'));
if (primaryUserRef) {
const entity = await catalogApi.getEntityByName(
parseEntityRef(primaryUserRef),
);
if (entity) {
const memberOf = getEntityRelations(entity, RELATION_MEMBER_OF, {
kind: 'Group',
});
for (const group of memberOf) {
result.push(stringifyEntityRef(group));
}
}
}
return result;
}
/**
* Returns a function that checks whether the currently signed-in user is an
* owner of a given entity. When the hook is initially mounted, the loading
* flag will be true and the results returned from the function will always be
* false.
*/
export function useEntityOwnership(): {
loading: boolean;
isOwnedEntity: (entity: Entity | EntityName) => boolean;
} {
const identityApi = useApi(identityApiRef);
const catalogApi = useApi(catalogApiRef);
// Trigger load only on mount
const { loading, value: refs } = useAsync(async () => {
const identityRefs = await loadIdentityOwnerRefs(identityApi);
const catalogRefs = await loadCatalogOwnerRefs(catalogApi, identityRefs);
return new Set([...identityRefs, ...catalogRefs]);
}, []);
const isOwnedEntity = useMemo(() => {
const myOwnerRefs = new Set(refs ?? []);
return (entity: Entity | EntityName) => {
const entityOwnerRefs = ('metadata' in entity
? getEntityRelations(entity, RELATION_OWNED_BY)
: [entity]
).map(stringifyEntityRef);
for (const ref of entityOwnerRefs) {
if (myOwnerRefs.has(ref)) {
return true;
}
}
return false;
};
}, [refs]);
return useMemo(() => ({ loading, isOwnedEntity }), [loading, isOwnedEntity]);
}
+1
View File
@@ -14,6 +14,7 @@
* limitations under the License.
*/
export type { CatalogApi } from '@backstage/catalog-client';
export { CATALOG_FILTER_EXISTS } from '@backstage/catalog-client';
export { catalogApiRef } from './api';
export * from './components';
export * from './hooks';
+11 -14
View File
@@ -16,10 +16,10 @@
import {
Entity,
EntityName,
getEntityName,
RELATION_MEMBER_OF,
RELATION_OWNED_BY,
stringifyEntityRef,
} from '@backstage/catalog-model';
import { getEntityRelations } from './getEntityRelations';
@@ -27,22 +27,19 @@ import { getEntityRelations } from './getEntityRelations';
* Get the related entity references.
*/
export function isOwnerOf(owner: Entity, owned: Entity) {
const possibleOwners: EntityName[] = [
...getEntityRelations(owner, RELATION_MEMBER_OF, { kind: 'group' }),
...(owner ? [getEntityName(owner)] : []),
];
const possibleOwners = new Set(
[
...getEntityRelations(owner, RELATION_MEMBER_OF, { kind: 'group' }),
...(owner ? [getEntityName(owner)] : []),
].map(stringifyEntityRef),
);
const owners = getEntityRelations(owned, RELATION_OWNED_BY);
const owners = getEntityRelations(owned, RELATION_OWNED_BY).map(
stringifyEntityRef,
);
for (const ownerItem of owners) {
if (
possibleOwners.find(
o =>
ownerItem.kind.toLowerCase() === o.kind.toLowerCase() &&
ownerItem.namespace.toLowerCase() === o.namespace.toLowerCase() &&
ownerItem.name.toLowerCase() === o.name.toLowerCase(),
) !== undefined
) {
if (possibleOwners.has(ownerItem)) {
return true;
}
}
+44
View File
@@ -1,5 +1,49 @@
# @backstage/plugin-catalog
## 0.6.9
### Patch Changes
- 19d9995b6: Improve accessibility of core & catalog components by adjusting them with non-breaking changes.
- 9d40fcb1e: - Bumping `material-ui/core` version to at least `4.12.2` as they made some breaking changes in later versions which broke `Pagination` of the `Table`.
- Switching out `material-table` to `@material-table/core` for support for the later versions of `material-ui/core`
- This causes a minor API change to `@backstage/core-components` as the interface for `Table` re-exports the `prop` from the underlying `Table` components.
- `onChangeRowsPerPage` has been renamed to `onRowsPerPageChange`
- `onChangePage` has been renamed to `onPageChange`
- Migration guide is here: https://material-table-core.com/docs/breaking-changes
- 224e54484: Added an `EntityProcessingErrorsPanel` component to show any errors that occurred when refreshing an entity from its source location.
If upgrading, this should be added to your `EntityPage` in your Backstage application:
```diff
// packages/app/src/components/catalog/EntityPage.tsx
const overviewContent = (
...
<EntityOrphanWarning />
</Grid>
</EntitySwitch.Case>
</EntitySwitch>
+ <EntitySwitch>
+ <EntitySwitch.Case if={hasCatalogProcessingErrors}>
+ <Grid item xs={12}>
+ <EntityProcessingErrorsPanel />
+ </Grid>
+ </EntitySwitch.Case>
+ </EntitySwitch>
```
Additionally, `WarningPanel` now changes color based on the provided severity.
- Updated dependencies
- @backstage/core-components@0.2.0
- @backstage/plugin-catalog-react@0.4.0
- @backstage/core-plugin-api@0.1.4
- @backstage/integration-react@0.1.5
- @backstage/theme@0.2.9
- @backstage/catalog-client@0.3.18
## 0.6.8
### Patch Changes
+10
View File
@@ -327,6 +327,11 @@ export const EntityPageLayout: {
}) => null;
};
// Warning: (ae-missing-release-tag) "EntityProcessingErrorsPanel" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public
export const EntityProcessingErrorsPanel: () => JSX.Element;
// Warning: (ae-missing-release-tag) "EntitySwitch" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
@@ -358,6 +363,11 @@ export const FilteredEntityLayout: ({
children,
}: PropsWithChildren<{}>) => JSX.Element;
// Warning: (ae-missing-release-tag) "hasCatalogProcessingErrors" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export const hasCatalogProcessingErrors: (entity: Entity) => boolean;
// Warning: (ae-missing-release-tag) "isComponentType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
+12 -12
View File
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-catalog",
"version": "0.6.8",
"version": "0.6.9",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -30,16 +30,16 @@
"clean": "backstage-cli clean"
},
"dependencies": {
"@backstage/catalog-client": "^0.3.17",
"@backstage/catalog-client": "^0.3.18",
"@backstage/catalog-model": "^0.9.0",
"@backstage/core-components": "^0.1.6",
"@backstage/core-plugin-api": "^0.1.3",
"@backstage/core-components": "^0.2.0",
"@backstage/core-plugin-api": "^0.1.4",
"@backstage/errors": "^0.1.1",
"@backstage/integration": "^0.5.8",
"@backstage/integration-react": "^0.1.4",
"@backstage/plugin-catalog-react": "^0.3.1",
"@backstage/theme": "^0.2.8",
"@material-ui/core": "^4.11.0",
"@backstage/integration-react": "^0.1.5",
"@backstage/plugin-catalog-react": "^0.4.0",
"@backstage/theme": "^0.2.9",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.45",
"@types/react": "^16.9",
@@ -54,10 +54,10 @@
"react-use": "^17.2.4"
},
"devDependencies": {
"@backstage/cli": "^0.7.5",
"@backstage/core-app-api": "^0.1.5",
"@backstage/dev-utils": "^0.2.3",
"@backstage/test-utils": "^0.1.15",
"@backstage/cli": "^0.7.6",
"@backstage/core-app-api": "^0.1.6",
"@backstage/dev-utils": "^0.2.4",
"@backstage/test-utils": "^0.1.16",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/react-hooks": "^3.3.0",
@@ -55,7 +55,7 @@ describe('CatalogPage', () => {
name: 'Entity1',
},
spec: {
owner: 'tools@example.com',
owner: 'tools',
type: 'service',
},
relations: [
@@ -72,7 +72,7 @@ describe('CatalogPage', () => {
name: 'Entity2',
},
spec: {
owner: 'not-tools@example.com',
owner: 'not-tools',
type: 'service',
},
relations: [
@@ -108,7 +108,8 @@ describe('CatalogPage', () => {
displayName: 'Display Name',
};
const identityApi: Partial<IdentityApi> = {
getUserId: () => 'tools@example.com',
getUserId: () => 'tools',
getIdToken: async () => undefined,
getProfile: () => testProfile,
};
@@ -73,7 +73,11 @@ describe('CatalogTable component', () => {
value={{
entities,
filters: {
user: new UserListFilter('owned', undefined, () => false),
user: new UserListFilter(
'owned',
() => false,
() => false,
),
},
}}
>
@@ -0,0 +1,103 @@
/*
* Copyright 2020 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { EntityProvider } from '@backstage/plugin-catalog-react';
import { renderInTestApp } from '@backstage/test-utils';
import React from 'react';
import { EntityProcessingErrorsPanel } from './EntityProcessingErrorsPanel';
import { Entity } from '@backstage/catalog-model';
describe('<EntityProcessErrors />', () => {
it('renders EntityProcessErrors if the entity has errors', async () => {
const entity: Entity = {
apiVersion: 'v1',
kind: 'Component',
metadata: {
name: 'software',
description: 'This is the description',
},
spec: {
owner: 'guest',
type: 'service',
lifecycle: 'production',
},
status: {
items: [
{
type: 'backstage.io/catalog-processing',
level: 'error',
message:
'InputError: Policy check failed; caused by Error: Malformed envelope, /metadata/labels should be object',
error: {
name: 'InputError',
message:
'Policy check failed; caused by Error: Malformed envelope, /metadata/labels should be object',
cause: {
name: 'Error',
message:
'Malformed envelope, /metadata/labels should be object',
},
},
},
{
type: 'foo',
level: 'error',
message: 'InputError: This should not be rendered',
error: {
name: 'InputError',
message: 'Foo',
cause: {
name: 'Error',
message:
'Malformed envelope, /metadata/labels should be object',
},
},
},
{
type: 'backstage.io/catalog-processing',
level: 'error',
message: 'InputError: Foo',
error: {
name: 'InputError',
message: 'Foo',
cause: {
name: 'Error',
message:
'Malformed envelope, /metadata/labels should be object',
},
},
},
],
},
};
const { getByText, queryByText } = await renderInTestApp(
<EntityProvider entity={entity}>
<EntityProcessingErrorsPanel />
</EntityProvider>,
);
expect(
getByText(
'Error: Policy check failed; caused by Error: Malformed envelope, /metadata/labels should be object',
),
).toBeInTheDocument();
expect(getByText('Error: Foo')).toBeInTheDocument();
expect(queryByText('Error: This should not be rendered')).toBeNull();
});
});
@@ -0,0 +1,51 @@
/*
* Copyright 2021 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Entity, UNSTABLE_EntityStatusItem } from '@backstage/catalog-model';
import { useEntity } from '@backstage/plugin-catalog-react';
import { Box } from '@material-ui/core';
import React from 'react';
import { ResponseErrorPanel } from '@backstage/core-components';
import { ENTITY_STATUS_CATALOG_PROCESSING_TYPE } from '@backstage/catalog-client';
const errorfilter = (i: UNSTABLE_EntityStatusItem) =>
i.error &&
i.level === 'error' &&
i.type === ENTITY_STATUS_CATALOG_PROCESSING_TYPE;
export const hasCatalogProcessingErrors = (entity: Entity) =>
entity?.status?.items?.filter(errorfilter).length! > 0;
/**
* Displays a list of errors if the entity is invalid.
*/
export const EntityProcessingErrorsPanel = () => {
const { entity } = useEntity();
const catalogProcessingErrors =
(entity?.status?.items?.filter(
errorfilter,
) as Required<UNSTABLE_EntityStatusItem>[]) || [];
return (
<>
{catalogProcessingErrors.map(({ error }, index) => (
<Box key={index} mb={1}>
<ResponseErrorPanel error={error} />
</Box>
))}
</>
);
};
@@ -0,0 +1,20 @@
/*
* Copyright 2021 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export {
EntityProcessingErrorsPanel,
hasCatalogProcessingErrors,
} from './EntityProcessingErrorsPanel';
+1
View File
@@ -23,6 +23,7 @@ export * from './components/CatalogTable/columns';
export * from './components/CreateComponentButton';
export * from './components/EntityLayout';
export * from './components/EntityOrphanWarning';
export * from './components/EntityProcessingErrorsPanel';
export * from './components/EntityPageLayout';
export * from './components/EntitySwitch';
export * from './components/FilteredEntityLayout';
+16
View File
@@ -1,5 +1,21 @@
# @backstage/plugin-circleci
## 0.2.20
### Patch Changes
- 9d40fcb1e: - Bumping `material-ui/core` version to at least `4.12.2` as they made some breaking changes in later versions which broke `Pagination` of the `Table`.
- Switching out `material-table` to `@material-table/core` for support for the later versions of `material-ui/core`
- This causes a minor API change to `@backstage/core-components` as the interface for `Table` re-exports the `prop` from the underlying `Table` components.
- `onChangeRowsPerPage` has been renamed to `onRowsPerPageChange`
- `onChangePage` has been renamed to `onPageChange`
- Migration guide is here: https://material-table-core.com/docs/breaking-changes
- Updated dependencies
- @backstage/core-components@0.2.0
- @backstage/plugin-catalog-react@0.4.0
- @backstage/core-plugin-api@0.1.4
- @backstage/theme@0.2.9
## 0.2.19
### Patch Changes
+10 -10
View File
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-circleci",
"version": "0.2.19",
"version": "0.2.20",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -32,11 +32,11 @@
},
"dependencies": {
"@backstage/catalog-model": "^0.9.0",
"@backstage/core-components": "^0.1.6",
"@backstage/core-plugin-api": "^0.1.3",
"@backstage/plugin-catalog-react": "^0.3.0",
"@backstage/theme": "^0.2.8",
"@material-ui/core": "^4.11.0",
"@backstage/core-components": "^0.2.0",
"@backstage/core-plugin-api": "^0.1.4",
"@backstage/plugin-catalog-react": "^0.4.0",
"@backstage/theme": "^0.2.9",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.45",
"circleci-api": "^4.0.0",
@@ -50,10 +50,10 @@
"react-use": "^17.2.4"
},
"devDependencies": {
"@backstage/cli": "^0.7.5",
"@backstage/core-app-api": "^0.1.5",
"@backstage/dev-utils": "^0.2.3",
"@backstage/test-utils": "^0.1.15",
"@backstage/cli": "^0.7.6",
"@backstage/core-app-api": "^0.1.6",
"@backstage/dev-utils": "^0.2.4",
"@backstage/test-utils": "^0.1.16",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^13.1.8",
@@ -260,8 +260,8 @@ export const CITable = ({
},
]}
data={builds}
onChangePage={onChangePage}
onChangeRowsPerPage={onChangePageSize}
onPageChange={onChangePage}
onRowsPerPageChange={onChangePageSize}
title={
<Box display="flex" alignItems="center">
<GitHubIcon />
+16
View File
@@ -1,5 +1,21 @@
# @backstage/plugin-cloudbuild
## 0.2.20
### Patch Changes
- 9d40fcb1e: - Bumping `material-ui/core` version to at least `4.12.2` as they made some breaking changes in later versions which broke `Pagination` of the `Table`.
- Switching out `material-table` to `@material-table/core` for support for the later versions of `material-ui/core`
- This causes a minor API change to `@backstage/core-components` as the interface for `Table` re-exports the `prop` from the underlying `Table` components.
- `onChangeRowsPerPage` has been renamed to `onRowsPerPageChange`
- `onChangePage` has been renamed to `onPageChange`
- Migration guide is here: https://material-table-core.com/docs/breaking-changes
- Updated dependencies
- @backstage/core-components@0.2.0
- @backstage/plugin-catalog-react@0.4.0
- @backstage/core-plugin-api@0.1.4
- @backstage/theme@0.2.9
## 0.2.19
### Patch Changes
+10 -10
View File
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-cloudbuild",
"version": "0.2.19",
"version": "0.2.20",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -31,11 +31,11 @@
},
"dependencies": {
"@backstage/catalog-model": "^0.9.0",
"@backstage/core-components": "^0.1.6",
"@backstage/core-plugin-api": "^0.1.3",
"@backstage/plugin-catalog-react": "^0.3.0",
"@backstage/theme": "^0.2.8",
"@material-ui/core": "^4.11.0",
"@backstage/core-components": "^0.2.0",
"@backstage/core-plugin-api": "^0.1.4",
"@backstage/plugin-catalog-react": "^0.4.0",
"@backstage/theme": "^0.2.9",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.45",
"moment": "^2.27.0",
@@ -48,10 +48,10 @@
"react-use": "^17.2.4"
},
"devDependencies": {
"@backstage/cli": "^0.7.5",
"@backstage/core-app-api": "^0.1.5",
"@backstage/dev-utils": "^0.2.3",
"@backstage/test-utils": "^0.1.15",
"@backstage/cli": "^0.7.6",
"@backstage/core-app-api": "^0.1.6",
"@backstage/dev-utils": "^0.2.4",
"@backstage/test-utils": "^0.1.16",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^13.1.8",
@@ -138,8 +138,8 @@ export const WorkflowRunsTableView = ({
},
]}
data={runs ?? []}
onChangePage={onChangePage}
onChangeRowsPerPage={onChangePageSize}
onPageChange={onChangePage}
onRowsPerPageChange={onChangePageSize}
style={{ width: '100%' }}
title={
<Box display="flex" alignItems="center">
+16
View File
@@ -1,5 +1,21 @@
# @backstage/plugin-code-coverage
## 0.1.8
### Patch Changes
- 9d40fcb1e: - Bumping `material-ui/core` version to at least `4.12.2` as they made some breaking changes in later versions which broke `Pagination` of the `Table`.
- Switching out `material-table` to `@material-table/core` for support for the later versions of `material-ui/core`
- This causes a minor API change to `@backstage/core-components` as the interface for `Table` re-exports the `prop` from the underlying `Table` components.
- `onChangeRowsPerPage` has been renamed to `onRowsPerPageChange`
- `onChangePage` has been renamed to `onPageChange`
- Migration guide is here: https://material-table-core.com/docs/breaking-changes
- Updated dependencies
- @backstage/core-components@0.2.0
- @backstage/plugin-catalog-react@0.4.0
- @backstage/core-plugin-api@0.1.4
- @backstage/theme@0.2.9
## 0.1.7
### Patch Changes
+10 -10
View File
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-code-coverage",
"version": "0.1.7",
"version": "0.1.8",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -22,12 +22,12 @@
"dependencies": {
"@backstage/catalog-model": "^0.9.0",
"@backstage/config": "^0.1.4",
"@backstage/core-components": "^0.1.6",
"@backstage/core-plugin-api": "^0.1.3",
"@backstage/core-components": "^0.2.0",
"@backstage/core-plugin-api": "^0.1.4",
"@backstage/errors": "^0.1.1",
"@backstage/plugin-catalog-react": "^0.3.0",
"@backstage/theme": "^0.2.8",
"@material-ui/core": "^4.11.0",
"@backstage/plugin-catalog-react": "^0.4.0",
"@backstage/theme": "^0.2.9",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.45",
"@material-ui/styles": "^4.11.0",
@@ -40,10 +40,10 @@
"recharts": "^1.8.5"
},
"devDependencies": {
"@backstage/cli": "^0.7.5",
"@backstage/core-app-api": "^0.1.5",
"@backstage/dev-utils": "^0.2.3",
"@backstage/test-utils": "^0.1.15",
"@backstage/cli": "^0.7.6",
"@backstage/core-app-api": "^0.1.6",
"@backstage/dev-utils": "^0.2.4",
"@backstage/test-utils": "^0.1.16",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^13.1.8",
+15
View File
@@ -1,5 +1,20 @@
# @backstage/plugin-config-schema
## 0.1.4
### Patch Changes
- 9d40fcb1e: - Bumping `material-ui/core` version to at least `4.12.2` as they made some breaking changes in later versions which broke `Pagination` of the `Table`.
- Switching out `material-table` to `@material-table/core` for support for the later versions of `material-ui/core`
- This causes a minor API change to `@backstage/core-components` as the interface for `Table` re-exports the `prop` from the underlying `Table` components.
- `onChangeRowsPerPage` has been renamed to `onRowsPerPageChange`
- `onChangePage` has been renamed to `onPageChange`
- Migration guide is here: https://material-table-core.com/docs/breaking-changes
- Updated dependencies
- @backstage/core-components@0.2.0
- @backstage/core-plugin-api@0.1.4
- @backstage/theme@0.2.9
## 0.1.3
### Patch Changes
+9 -9
View File
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-config-schema",
"version": "0.1.3",
"version": "0.1.4",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -21,11 +21,11 @@
},
"dependencies": {
"@backstage/config": "^0.1.4",
"@backstage/core-components": "^0.1.6",
"@backstage/core-plugin-api": "^0.1.3",
"@backstage/core-components": "^0.2.0",
"@backstage/core-plugin-api": "^0.1.4",
"@backstage/errors": "^0.1.1",
"@backstage/theme": "^0.2.8",
"@material-ui/core": "^4.11.0",
"@backstage/theme": "^0.2.9",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.45",
"jsonschema": "^1.2.6",
@@ -35,10 +35,10 @@
"zen-observable": "^0.8.15"
},
"devDependencies": {
"@backstage/cli": "^0.7.5",
"@backstage/core-app-api": "^0.1.5",
"@backstage/dev-utils": "^0.2.3",
"@backstage/test-utils": "^0.1.15",
"@backstage/cli": "^0.7.6",
"@backstage/core-app-api": "^0.1.6",
"@backstage/dev-utils": "^0.2.4",
"@backstage/test-utils": "^0.1.16",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^13.1.8",
+15
View File
@@ -1,5 +1,20 @@
# @backstage/plugin-cost-insights
## 0.11.2
### Patch Changes
- 9d40fcb1e: - Bumping `material-ui/core` version to at least `4.12.2` as they made some breaking changes in later versions which broke `Pagination` of the `Table`.
- Switching out `material-table` to `@material-table/core` for support for the later versions of `material-ui/core`
- This causes a minor API change to `@backstage/core-components` as the interface for `Table` re-exports the `prop` from the underlying `Table` components.
- `onChangeRowsPerPage` has been renamed to `onRowsPerPageChange`
- `onChangePage` has been renamed to `onPageChange`
- Migration guide is here: https://material-table-core.com/docs/breaking-changes
- Updated dependencies
- @backstage/core-components@0.2.0
- @backstage/core-plugin-api@0.1.4
- @backstage/theme@0.2.9
## 0.11.1
### Patch Changes
+9 -9
View File
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-cost-insights",
"version": "0.11.1",
"version": "0.11.2",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -31,10 +31,10 @@
},
"dependencies": {
"@backstage/config": "^0.1.5",
"@backstage/core-components": "^0.1.6",
"@backstage/core-plugin-api": "^0.1.3",
"@backstage/theme": "^0.2.8",
"@material-ui/core": "^4.11.0",
"@backstage/core-components": "^0.2.0",
"@backstage/core-plugin-api": "^0.1.4",
"@backstage/theme": "^0.2.9",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.45",
"@material-ui/styles": "^4.9.6",
@@ -54,10 +54,10 @@
"yup": "^0.29.3"
},
"devDependencies": {
"@backstage/cli": "^0.7.5",
"@backstage/core-app-api": "^0.1.5",
"@backstage/dev-utils": "^0.2.3",
"@backstage/test-utils": "^0.1.15",
"@backstage/cli": "^0.7.6",
"@backstage/core-app-api": "^0.1.6",
"@backstage/dev-utils": "^0.2.4",
"@backstage/test-utils": "^0.1.16",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^13.1.8",
@@ -15,7 +15,10 @@
*/
import React, { PropsWithChildren } from 'react';
import { createMuiTheme, ThemeProvider } from '@material-ui/core';
import {
createTheme as createMuiTheme,
ThemeProvider,
} from '@material-ui/core';
import { BackstageTheme } from '@backstage/theme';
import {
costInsightsDarkTheme,
+16
View File
@@ -1,5 +1,21 @@
# @backstage/plugin-explore
## 0.3.11
### Patch Changes
- 9d40fcb1e: - Bumping `material-ui/core` version to at least `4.12.2` as they made some breaking changes in later versions which broke `Pagination` of the `Table`.
- Switching out `material-table` to `@material-table/core` for support for the later versions of `material-ui/core`
- This causes a minor API change to `@backstage/core-components` as the interface for `Table` re-exports the `prop` from the underlying `Table` components.
- `onChangeRowsPerPage` has been renamed to `onRowsPerPageChange`
- `onChangePage` has been renamed to `onPageChange`
- Migration guide is here: https://material-table-core.com/docs/breaking-changes
- Updated dependencies
- @backstage/core-components@0.2.0
- @backstage/plugin-catalog-react@0.4.0
- @backstage/core-plugin-api@0.1.4
- @backstage/theme@0.2.9
## 0.3.10
### Patch Changes
+10 -10
View File
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-explore",
"version": "0.3.10",
"version": "0.3.11",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -31,12 +31,12 @@
},
"dependencies": {
"@backstage/catalog-model": "^0.9.0",
"@backstage/core-components": "^0.1.6",
"@backstage/core-plugin-api": "^0.1.3",
"@backstage/plugin-catalog-react": "^0.3.0",
"@backstage/core-components": "^0.2.0",
"@backstage/core-plugin-api": "^0.1.4",
"@backstage/plugin-catalog-react": "^0.4.0",
"@backstage/plugin-explore-react": "^0.0.6",
"@backstage/theme": "^0.2.8",
"@material-ui/core": "^4.11.0",
"@backstage/theme": "^0.2.9",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.45",
"@types/react": "^16.9",
@@ -48,10 +48,10 @@
"react-use": "^17.2.4"
},
"devDependencies": {
"@backstage/cli": "^0.7.5",
"@backstage/core-app-api": "^0.1.5",
"@backstage/dev-utils": "^0.2.3",
"@backstage/test-utils": "^0.1.15",
"@backstage/cli": "^0.7.6",
"@backstage/core-app-api": "^0.1.6",
"@backstage/dev-utils": "^0.2.4",
"@backstage/test-utils": "^0.1.16",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^13.1.8",
@@ -100,7 +100,7 @@ describe('<GroupsExplorerContent />', () => {
const catalogError = new Error('Network timeout');
catalogApi.getEntities.mockRejectedValueOnce(catalogError);
const { getByText } = await renderInTestApp(
const { getAllByText } = await renderInTestApp(
<Wrapper>
<GroupsExplorerContent />
</Wrapper>,
@@ -108,7 +108,7 @@ describe('<GroupsExplorerContent />', () => {
);
await waitFor(() =>
expect(getByText(/Warning: Network timeout/)).toBeInTheDocument(),
expect(getAllByText(/Error: Network timeout/).length).not.toBe(0),
);
});
});
+16
View File
@@ -1,5 +1,21 @@
# @backstage/plugin-fossa
## 0.2.12
### Patch Changes
- 9d40fcb1e: - Bumping `material-ui/core` version to at least `4.12.2` as they made some breaking changes in later versions which broke `Pagination` of the `Table`.
- Switching out `material-table` to `@material-table/core` for support for the later versions of `material-ui/core`
- This causes a minor API change to `@backstage/core-components` as the interface for `Table` re-exports the `prop` from the underlying `Table` components.
- `onChangeRowsPerPage` has been renamed to `onRowsPerPageChange`
- `onChangePage` has been renamed to `onPageChange`
- Migration guide is here: https://material-table-core.com/docs/breaking-changes
- Updated dependencies
- @backstage/core-components@0.2.0
- @backstage/plugin-catalog-react@0.4.0
- @backstage/core-plugin-api@0.1.4
- @backstage/theme@0.2.9
## 0.2.11
### Patch Changes
+10 -10
View File
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-fossa",
"version": "0.2.11",
"version": "0.2.12",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -32,12 +32,12 @@
},
"dependencies": {
"@backstage/catalog-model": "^0.9.0",
"@backstage/core-components": "^0.1.6",
"@backstage/core-plugin-api": "^0.1.3",
"@backstage/core-components": "^0.2.0",
"@backstage/core-plugin-api": "^0.1.4",
"@backstage/errors": "^0.1.1",
"@backstage/plugin-catalog-react": "^0.3.0",
"@backstage/theme": "^0.2.8",
"@material-ui/core": "^4.11.0",
"@backstage/plugin-catalog-react": "^0.4.0",
"@backstage/theme": "^0.2.9",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.45",
"cross-fetch": "^3.0.6",
@@ -48,10 +48,10 @@
"react-use": "^17.2.4"
},
"devDependencies": {
"@backstage/cli": "^0.7.5",
"@backstage/core-app-api": "^0.1.5",
"@backstage/dev-utils": "^0.2.3",
"@backstage/test-utils": "^0.1.15",
"@backstage/cli": "^0.7.6",
"@backstage/core-app-api": "^0.1.6",
"@backstage/dev-utils": "^0.2.4",
"@backstage/test-utils": "^0.1.16",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^13.1.8",
@@ -74,7 +74,7 @@ describe('<FossaCard />', () => {
fossaApi.getFindingSummary.mockRejectedValue(new Error('My Error'));
const { getByText } = await renderInTestApp(
const { getAllByText } = await renderInTestApp(
<Wrapper>
<EntityProvider entity={entity}>
<FossaCard />
@@ -82,7 +82,7 @@ describe('<FossaCard />', () => {
</Wrapper>,
);
expect(getByText(/Warning: My Error/i)).toBeInTheDocument();
expect(getAllByText(/Error: My Error/i).length).not.toBe(0);
});
it('shows empty', async () => {
+15
View File
@@ -1,5 +1,20 @@
# @backstage/plugin-gcp-projects
## 0.3.1
### Patch Changes
- 9d40fcb1e: - Bumping `material-ui/core` version to at least `4.12.2` as they made some breaking changes in later versions which broke `Pagination` of the `Table`.
- Switching out `material-table` to `@material-table/core` for support for the later versions of `material-ui/core`
- This causes a minor API change to `@backstage/core-components` as the interface for `Table` re-exports the `prop` from the underlying `Table` components.
- `onChangeRowsPerPage` has been renamed to `onRowsPerPageChange`
- `onChangePage` has been renamed to `onPageChange`
- Migration guide is here: https://material-table-core.com/docs/breaking-changes
- Updated dependencies
- @backstage/core-components@0.2.0
- @backstage/core-plugin-api@0.1.4
- @backstage/theme@0.2.9
## 0.3.0
### Minor Changes
+9 -9
View File
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-gcp-projects",
"version": "0.3.0",
"version": "0.3.1",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -30,10 +30,10 @@
"clean": "backstage-cli clean"
},
"dependencies": {
"@backstage/core-components": "^0.1.6",
"@backstage/core-plugin-api": "^0.1.3",
"@backstage/theme": "^0.2.8",
"@material-ui/core": "^4.11.0",
"@backstage/core-components": "^0.2.0",
"@backstage/core-plugin-api": "^0.1.4",
"@backstage/theme": "^0.2.9",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.45",
"react": "^16.13.1",
@@ -42,10 +42,10 @@
"react-use": "^17.2.4"
},
"devDependencies": {
"@backstage/cli": "^0.7.5",
"@backstage/core-app-api": "^0.1.5",
"@backstage/dev-utils": "^0.2.3",
"@backstage/test-utils": "^0.1.15",
"@backstage/cli": "^0.7.6",
"@backstage/core-app-api": "^0.1.6",
"@backstage/dev-utils": "^0.2.4",
"@backstage/test-utils": "^0.1.16",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^13.1.8",
+15
View File
@@ -1,5 +1,20 @@
# @backstage/plugin-git-release-manager
## 0.2.1
### Patch Changes
- 9d40fcb1e: - Bumping `material-ui/core` version to at least `4.12.2` as they made some breaking changes in later versions which broke `Pagination` of the `Table`.
- Switching out `material-table` to `@material-table/core` for support for the later versions of `material-ui/core`
- This causes a minor API change to `@backstage/core-components` as the interface for `Table` re-exports the `prop` from the underlying `Table` components.
- `onChangeRowsPerPage` has been renamed to `onRowsPerPageChange`
- `onChangePage` has been renamed to `onPageChange`
- Migration guide is here: https://material-table-core.com/docs/breaking-changes
- Updated dependencies
- @backstage/core-components@0.2.0
- @backstage/core-plugin-api@0.1.4
- @backstage/theme@0.2.9
## 0.2.0
### Minor Changes
+9 -9
View File
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-git-release-manager",
"version": "0.2.0",
"version": "0.2.1",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -20,11 +20,11 @@
"clean": "backstage-cli clean"
},
"dependencies": {
"@backstage/core-components": "^0.1.6",
"@backstage/core-plugin-api": "^0.1.3",
"@backstage/core-components": "^0.2.0",
"@backstage/core-plugin-api": "^0.1.4",
"@backstage/integration": "^0.5.6",
"@backstage/theme": "^0.2.8",
"@material-ui/core": "^4.11.0",
"@backstage/theme": "^0.2.9",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.45",
"@octokit/rest": "^18.5.3",
@@ -38,10 +38,10 @@
"recharts": "^1.8.5"
},
"devDependencies": {
"@backstage/cli": "^0.7.5",
"@backstage/core-app-api": "^0.1.5",
"@backstage/dev-utils": "^0.2.3",
"@backstage/test-utils": "^0.1.15",
"@backstage/cli": "^0.7.6",
"@backstage/core-app-api": "^0.1.6",
"@backstage/dev-utils": "^0.2.4",
"@backstage/test-utils": "^0.1.16",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react-hooks": "^3.4.2",
"@testing-library/react": "^11.2.5",
+16
View File
@@ -1,5 +1,21 @@
# @backstage/plugin-github-actions
## 0.4.14
### Patch Changes
- 9d40fcb1e: - Bumping `material-ui/core` version to at least `4.12.2` as they made some breaking changes in later versions which broke `Pagination` of the `Table`.
- Switching out `material-table` to `@material-table/core` for support for the later versions of `material-ui/core`
- This causes a minor API change to `@backstage/core-components` as the interface for `Table` re-exports the `prop` from the underlying `Table` components.
- `onChangeRowsPerPage` has been renamed to `onRowsPerPageChange`
- `onChangePage` has been renamed to `onPageChange`
- Migration guide is here: https://material-table-core.com/docs/breaking-changes
- Updated dependencies
- @backstage/core-components@0.2.0
- @backstage/plugin-catalog-react@0.4.0
- @backstage/core-plugin-api@0.1.4
- @backstage/theme@0.2.9
## 0.4.13
### Patch Changes
+10 -10
View File
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-github-actions",
"version": "0.4.13",
"version": "0.4.14",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -33,12 +33,12 @@
},
"dependencies": {
"@backstage/catalog-model": "^0.9.0",
"@backstage/core-components": "^0.1.6",
"@backstage/core-plugin-api": "^0.1.3",
"@backstage/core-components": "^0.2.0",
"@backstage/core-plugin-api": "^0.1.4",
"@backstage/integration": "^0.5.8",
"@backstage/plugin-catalog-react": "^0.3.0",
"@backstage/theme": "^0.2.8",
"@material-ui/core": "^4.11.0",
"@backstage/plugin-catalog-react": "^0.4.0",
"@backstage/theme": "^0.2.9",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.45",
"@octokit/rest": "^18.5.3",
@@ -51,10 +51,10 @@
"react-use": "^17.2.4"
},
"devDependencies": {
"@backstage/cli": "^0.7.5",
"@backstage/core-app-api": "^0.1.5",
"@backstage/dev-utils": "^0.2.3",
"@backstage/test-utils": "^0.1.15",
"@backstage/cli": "^0.7.6",
"@backstage/core-app-api": "^0.1.6",
"@backstage/dev-utils": "^0.2.4",
"@backstage/test-utils": "^0.1.16",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^13.1.8",
@@ -130,8 +130,8 @@ export const WorkflowRunsTableView = ({
},
]}
data={runs ?? []}
onChangePage={onChangePage}
onChangeRowsPerPage={onChangePageSize}
onPageChange={onChangePage}
onRowsPerPageChange={onChangePageSize}
style={{ width: '100%' }}
title={
<Box display="flex" alignItems="center">
+17
View File
@@ -1,5 +1,22 @@
# @backstage/plugin-github-deployments
## 0.1.12
### Patch Changes
- 9d40fcb1e: - Bumping `material-ui/core` version to at least `4.12.2` as they made some breaking changes in later versions which broke `Pagination` of the `Table`.
- Switching out `material-table` to `@material-table/core` for support for the later versions of `material-ui/core`
- This causes a minor API change to `@backstage/core-components` as the interface for `Table` re-exports the `prop` from the underlying `Table` components.
- `onChangeRowsPerPage` has been renamed to `onRowsPerPageChange`
- `onChangePage` has been renamed to `onPageChange`
- Migration guide is here: https://material-table-core.com/docs/breaking-changes
- Updated dependencies
- @backstage/core-components@0.2.0
- @backstage/plugin-catalog-react@0.4.0
- @backstage/core-plugin-api@0.1.4
- @backstage/integration-react@0.1.5
- @backstage/theme@0.2.9
## 0.1.11
### Patch Changes
+11 -11
View File
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-github-deployments",
"version": "0.1.11",
"version": "0.1.12",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -21,14 +21,14 @@
},
"dependencies": {
"@backstage/catalog-model": "^0.9.0",
"@backstage/core-components": "^0.1.6",
"@backstage/core-plugin-api": "^0.1.3",
"@backstage/core-components": "^0.2.0",
"@backstage/core-plugin-api": "^0.1.4",
"@backstage/errors": "^0.1.1",
"@backstage/integration": "^0.5.8",
"@backstage/integration-react": "^0.1.4",
"@backstage/plugin-catalog-react": "^0.3.0",
"@backstage/theme": "^0.2.8",
"@material-ui/core": "^4.11.0",
"@backstage/integration-react": "^0.1.5",
"@backstage/plugin-catalog-react": "^0.4.0",
"@backstage/theme": "^0.2.9",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.45",
"@octokit/graphql": "^4.5.8",
@@ -38,10 +38,10 @@
"react-use": "^17.2.4"
},
"devDependencies": {
"@backstage/cli": "^0.7.5",
"@backstage/core-app-api": "^0.1.5",
"@backstage/dev-utils": "^0.2.3",
"@backstage/test-utils": "^0.1.15",
"@backstage/cli": "^0.7.6",
"@backstage/core-app-api": "^0.1.6",
"@backstage/dev-utils": "^0.2.4",
"@backstage/test-utils": "^0.1.16",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^13.1.8",
@@ -311,7 +311,7 @@ describe('github-deployments', () => {
expect(
await rendered.findByText(
'Warning: No apiBaseUrl available for host my-github-3.com, please check your integrations config',
'Error: No apiBaseUrl available for host my-github-3.com, please check your integrations config',
),
).toBeInTheDocument();
});
@@ -336,7 +336,7 @@ describe('github-deployments', () => {
expect(
await rendered.findByText(
'Warning: No matching GitHub integration configuration for host my-github-unknown.com, please check your integrations config',
'Error: No matching GitHub integration configuration for host my-github-unknown.com, please check your integrations config',
),
).toBeInTheDocument();
});
+15
View File
@@ -1,5 +1,20 @@
# @backstage/plugin-gitops-profiles
## 0.3.1
### Patch Changes
- 9d40fcb1e: - Bumping `material-ui/core` version to at least `4.12.2` as they made some breaking changes in later versions which broke `Pagination` of the `Table`.
- Switching out `material-table` to `@material-table/core` for support for the later versions of `material-ui/core`
- This causes a minor API change to `@backstage/core-components` as the interface for `Table` re-exports the `prop` from the underlying `Table` components.
- `onChangeRowsPerPage` has been renamed to `onRowsPerPageChange`
- `onChangePage` has been renamed to `onPageChange`
- Migration guide is here: https://material-table-core.com/docs/breaking-changes
- Updated dependencies
- @backstage/core-components@0.2.0
- @backstage/core-plugin-api@0.1.4
- @backstage/theme@0.2.9
## 0.3.0
### Minor Changes
+9 -9
View File
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-gitops-profiles",
"version": "0.3.0",
"version": "0.3.1",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -31,10 +31,10 @@
"clean": "backstage-cli clean"
},
"dependencies": {
"@backstage/core-components": "^0.1.6",
"@backstage/core-plugin-api": "^0.1.3",
"@backstage/theme": "^0.2.8",
"@material-ui/core": "^4.11.0",
"@backstage/core-components": "^0.2.0",
"@backstage/core-plugin-api": "^0.1.4",
"@backstage/theme": "^0.2.9",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.45",
"react": "^16.13.1",
@@ -43,10 +43,10 @@
"react-use": "^17.2.4"
},
"devDependencies": {
"@backstage/cli": "^0.7.5",
"@backstage/core-app-api": "^0.1.5",
"@backstage/dev-utils": "^0.2.3",
"@backstage/test-utils": "^0.1.15",
"@backstage/cli": "^0.7.6",
"@backstage/core-app-api": "^0.1.6",
"@backstage/dev-utils": "^0.2.4",
"@backstage/test-utils": "^0.1.16",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^13.1.8",
+15
View File
@@ -1,5 +1,20 @@
# @backstage/plugin-graphiql
## 0.2.13
### Patch Changes
- 9d40fcb1e: - Bumping `material-ui/core` version to at least `4.12.2` as they made some breaking changes in later versions which broke `Pagination` of the `Table`.
- Switching out `material-table` to `@material-table/core` for support for the later versions of `material-ui/core`
- This causes a minor API change to `@backstage/core-components` as the interface for `Table` re-exports the `prop` from the underlying `Table` components.
- `onChangeRowsPerPage` has been renamed to `onRowsPerPageChange`
- `onChangePage` has been renamed to `onPageChange`
- Migration guide is here: https://material-table-core.com/docs/breaking-changes
- Updated dependencies
- @backstage/core-components@0.2.0
- @backstage/core-plugin-api@0.1.4
- @backstage/theme@0.2.9
## 0.2.12
### Patch Changes
+9 -9
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-graphiql",
"description": "Backstage plugin for browsing GraphQL APIs",
"version": "0.2.12",
"version": "0.2.13",
"private": false,
"publishConfig": {
"access": "public",
@@ -31,10 +31,10 @@
"clean": "backstage-cli clean"
},
"dependencies": {
"@backstage/core-components": "^0.1.6",
"@backstage/core-plugin-api": "^0.1.3",
"@backstage/theme": "^0.2.8",
"@material-ui/core": "^4.11.0",
"@backstage/core-components": "^0.2.0",
"@backstage/core-plugin-api": "^0.1.4",
"@backstage/theme": "^0.2.9",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.45",
"graphiql": "^1.0.0-alpha.10",
@@ -44,10 +44,10 @@
"react-use": "^17.2.4"
},
"devDependencies": {
"@backstage/cli": "^0.7.5",
"@backstage/core-app-api": "^0.1.5",
"@backstage/dev-utils": "^0.2.3",
"@backstage/test-utils": "^0.1.15",
"@backstage/cli": "^0.7.6",
"@backstage/core-app-api": "^0.1.6",
"@backstage/dev-utils": "^0.2.4",
"@backstage/test-utils": "^0.1.16",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^13.1.8",
+16
View File
@@ -1,5 +1,21 @@
# @backstage/plugin-ilert
## 0.1.7
### Patch Changes
- 9d40fcb1e: - Bumping `material-ui/core` version to at least `4.12.2` as they made some breaking changes in later versions which broke `Pagination` of the `Table`.
- Switching out `material-table` to `@material-table/core` for support for the later versions of `material-ui/core`
- This causes a minor API change to `@backstage/core-components` as the interface for `Table` re-exports the `prop` from the underlying `Table` components.
- `onChangeRowsPerPage` has been renamed to `onRowsPerPageChange`
- `onChangePage` has been renamed to `onPageChange`
- Migration guide is here: https://material-table-core.com/docs/breaking-changes
- Updated dependencies
- @backstage/core-components@0.2.0
- @backstage/plugin-catalog-react@0.4.0
- @backstage/core-plugin-api@0.1.4
- @backstage/theme@0.2.9
## 0.1.6
### Patch Changes
+10 -10
View File
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-ilert",
"version": "0.1.6",
"version": "0.1.7",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -21,13 +21,13 @@
},
"dependencies": {
"@backstage/catalog-model": "^0.9.0",
"@backstage/core-components": "^0.1.6",
"@backstage/core-plugin-api": "^0.1.3",
"@backstage/core-components": "^0.2.0",
"@backstage/core-plugin-api": "^0.1.4",
"@backstage/errors": "^0.1.1",
"@backstage/plugin-catalog-react": "^0.3.0",
"@backstage/theme": "^0.2.8",
"@backstage/plugin-catalog-react": "^0.4.0",
"@backstage/theme": "^0.2.9",
"@date-io/luxon": "2.x",
"@material-ui/core": "^4.11.0",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.45",
"@material-ui/pickers": "^3.3.10",
@@ -38,10 +38,10 @@
"react-use": "^17.2.4"
},
"devDependencies": {
"@backstage/cli": "^0.7.5",
"@backstage/core-app-api": "^0.1.5",
"@backstage/dev-utils": "^0.2.3",
"@backstage/test-utils": "^0.1.15",
"@backstage/cli": "^0.7.6",
"@backstage/core-app-api": "^0.1.6",
"@backstage/dev-utils": "^0.2.4",
"@backstage/test-utils": "^0.1.16",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^13.1.8",
@@ -253,8 +253,8 @@ export const IncidentsTable = ({
}
page={tableState.page}
totalCount={incidentsCount}
onChangePage={onChangePage}
onChangeRowsPerPage={onChangeRowsPerPage}
onPageChange={onChangePage}
onRowsPerPageChange={onChangeRowsPerPage}
// localization={{ header: { actions: undefined } }}
columns={columns}
data={incidents}
@@ -165,8 +165,8 @@ export const UptimeMonitorsTable = ({
</Typography>
}
page={tableState.page}
onChangePage={onChangePage}
onChangeRowsPerPage={onChangeRowsPerPage}
onPageChange={onChangePage}
onRowsPerPageChange={onChangeRowsPerPage}
localization={{ header: { actions: undefined } }}
isLoading={isLoading}
columns={columns}
+16
View File
@@ -1,5 +1,21 @@
# @backstage/plugin-jenkins
## 0.5.1
### Patch Changes
- 9d40fcb1e: - Bumping `material-ui/core` version to at least `4.12.2` as they made some breaking changes in later versions which broke `Pagination` of the `Table`.
- Switching out `material-table` to `@material-table/core` for support for the later versions of `material-ui/core`
- This causes a minor API change to `@backstage/core-components` as the interface for `Table` re-exports the `prop` from the underlying `Table` components.
- `onChangeRowsPerPage` has been renamed to `onRowsPerPageChange`
- `onChangePage` has been renamed to `onPageChange`
- Migration guide is here: https://material-table-core.com/docs/breaking-changes
- Updated dependencies
- @backstage/core-components@0.2.0
- @backstage/plugin-catalog-react@0.4.0
- @backstage/core-plugin-api@0.1.4
- @backstage/theme@0.2.9
## 0.5.0
### Minor Changes
+10 -10
View File
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-jenkins",
"version": "0.5.0",
"version": "0.5.1",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -32,11 +32,11 @@
},
"dependencies": {
"@backstage/catalog-model": "^0.9.0",
"@backstage/core-components": "^0.1.6",
"@backstage/core-plugin-api": "^0.1.3",
"@backstage/plugin-catalog-react": "^0.3.0",
"@backstage/theme": "^0.2.8",
"@material-ui/core": "^4.11.0",
"@backstage/core-components": "^0.2.0",
"@backstage/core-plugin-api": "^0.1.4",
"@backstage/plugin-catalog-react": "^0.4.0",
"@backstage/theme": "^0.2.9",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.45",
"luxon": "^1.25.0",
@@ -47,10 +47,10 @@
"react-use": "^17.2.4"
},
"devDependencies": {
"@backstage/cli": "^0.7.5",
"@backstage/core-app-api": "^0.1.5",
"@backstage/dev-utils": "^0.2.3",
"@backstage/test-utils": "^0.1.15",
"@backstage/cli": "^0.7.6",
"@backstage/core-app-api": "^0.1.6",
"@backstage/dev-utils": "^0.2.4",
"@backstage/test-utils": "^0.1.16",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^13.1.8",
@@ -208,8 +208,8 @@ export const CITableView = ({
},
]}
data={projects ?? []}
onChangePage={onChangePage}
onChangeRowsPerPage={onChangePageSize}
onPageChange={onChangePage}
onRowsPerPageChange={onChangePageSize}
title={
<Box display="flex" alignItems="center">
<img src={JenkinsLogo} alt="Jenkins logo" height="50px" />
+16
View File
@@ -1,5 +1,21 @@
# @backstage/plugin-kafka
## 0.2.12
### Patch Changes
- 9d40fcb1e: - Bumping `material-ui/core` version to at least `4.12.2` as they made some breaking changes in later versions which broke `Pagination` of the `Table`.
- Switching out `material-table` to `@material-table/core` for support for the later versions of `material-ui/core`
- This causes a minor API change to `@backstage/core-components` as the interface for `Table` re-exports the `prop` from the underlying `Table` components.
- `onChangeRowsPerPage` has been renamed to `onRowsPerPageChange`
- `onChangePage` has been renamed to `onPageChange`
- Migration guide is here: https://material-table-core.com/docs/breaking-changes
- Updated dependencies
- @backstage/core-components@0.2.0
- @backstage/plugin-catalog-react@0.4.0
- @backstage/core-plugin-api@0.1.4
- @backstage/theme@0.2.9
## 0.2.11
### Patch Changes
+10 -10
View File
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-kafka",
"version": "0.2.11",
"version": "0.2.12",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -21,11 +21,11 @@
},
"dependencies": {
"@backstage/catalog-model": "^0.9.0",
"@backstage/core-components": "^0.1.6",
"@backstage/core-plugin-api": "^0.1.3",
"@backstage/plugin-catalog-react": "^0.3.0",
"@backstage/theme": "^0.2.8",
"@material-ui/core": "^4.11.0",
"@backstage/core-components": "^0.2.0",
"@backstage/core-plugin-api": "^0.1.4",
"@backstage/plugin-catalog-react": "^0.4.0",
"@backstage/theme": "^0.2.9",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.45",
"react": "^16.13.1",
@@ -34,10 +34,10 @@
"react-use": "^17.2.4"
},
"devDependencies": {
"@backstage/cli": "^0.7.5",
"@backstage/core-app-api": "^0.1.5",
"@backstage/dev-utils": "^0.2.3",
"@backstage/test-utils": "^0.1.15",
"@backstage/cli": "^0.7.6",
"@backstage/core-app-api": "^0.1.6",
"@backstage/dev-utils": "^0.2.4",
"@backstage/test-utils": "^0.1.16",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/react-hooks": "^3.4.2",
+8
View File
@@ -1,5 +1,13 @@
# @backstage/plugin-kubernetes-backend
## 0.3.12
### Patch Changes
- 7f24f4088: chore(deps): bump `@kubernetes/client-node` from 0.14.3 to 0.15.0
- Updated dependencies
- @backstage/plugin-kubernetes-common@0.1.3
## 0.3.11
### Patch Changes
+5
View File
@@ -51,6 +51,11 @@ export interface CustomResource {
plural: string;
}
// Warning: (ae-missing-release-tag) "DEFAULT_OBJECTS" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export const DEFAULT_OBJECTS: KubernetesObjectTypes[];
// Warning: (ae-missing-release-tag) "FetchResponseWrapper" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-kubernetes-backend",
"version": "0.3.11",
"version": "0.3.12",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -34,7 +34,7 @@
"@backstage/backend-common": "^0.8.7",
"@backstage/catalog-model": "^0.9.0",
"@backstage/config": "^0.1.5",
"@backstage/plugin-kubernetes-common": "^0.1.2",
"@backstage/plugin-kubernetes-common": "^0.1.3",
"@google-cloud/container": "^2.2.0",
"@kubernetes/client-node": "^0.15.0",
"@types/express": "^4.17.6",
@@ -53,7 +53,7 @@
"yn": "^4.0.0"
},
"devDependencies": {
"@backstage/cli": "^0.7.5",
"@backstage/cli": "^0.7.6",
"@types/aws4": "^1.5.1",
"supertest": "^6.1.3",
"aws-sdk-mock": "^5.2.1",
+9
View File
@@ -16,6 +16,15 @@
export interface Config {
kubernetes?: {
objectTypes?: Array<
| 'pods'
| 'services'
| 'configmaps'
| 'deployments'
| 'replicasets'
| 'horizontalpodautoscalers'
| 'ingresses'
>;
serviceLocatorMethod: {
type: 'multiTenant';
};
+2
View File
@@ -16,3 +16,5 @@
export * from './service/router';
export * from './types/types';
export { DEFAULT_OBJECTS } from './service/KubernetesFanOutHandler';
@@ -129,16 +129,16 @@ describe('handleGetKubernetesObjectsForService', () => {
mockFetch(fetchObjectsForService);
const sut = new KubernetesFanOutHandler(
getVoidLogger(),
{
const sut = new KubernetesFanOutHandler({
logger: getVoidLogger(),
fetcher: {
fetchObjectsForService,
},
{
serviceLocator: {
getClustersByServiceId,
},
[],
);
customResources: [],
});
const result = await sut.getKubernetesObjectsByEntity({
entity: {
@@ -221,16 +221,16 @@ describe('handleGetKubernetesObjectsForService', () => {
mockFetch(fetchObjectsForService);
const sut = new KubernetesFanOutHandler(
getVoidLogger(),
{
const sut = new KubernetesFanOutHandler({
logger: getVoidLogger(),
fetcher: {
fetchObjectsForService,
},
{
serviceLocator: {
getClustersByServiceId,
},
[],
);
customResources: [],
});
const result = await sut.getKubernetesObjectsByEntity({
auth: {
@@ -357,16 +357,16 @@ describe('handleGetKubernetesObjectsForService', () => {
mockFetch(fetchObjectsForService);
const sut = new KubernetesFanOutHandler(
getVoidLogger(),
{
const sut = new KubernetesFanOutHandler({
logger: getVoidLogger(),
fetcher: {
fetchObjectsForService,
},
{
serviceLocator: {
getClustersByServiceId,
},
[],
);
customResources: [],
});
const result = await sut.getKubernetesObjectsByEntity({
auth: {
@@ -497,16 +497,16 @@ describe('handleGetKubernetesObjectsForService', () => {
mockFetch(fetchObjectsForService);
const sut = new KubernetesFanOutHandler(
getVoidLogger(),
{
const sut = new KubernetesFanOutHandler({
logger: getVoidLogger(),
fetcher: {
fetchObjectsForService,
},
{
serviceLocator: {
getClustersByServiceId,
},
[],
);
customResources: [],
});
const result = await sut.getKubernetesObjectsByEntity({
auth: {
@@ -26,7 +26,7 @@ import { KubernetesRequestBody } from '@backstage/plugin-kubernetes-common';
import { KubernetesAuthTranslator } from '../kubernetes-auth-translator/types';
import { KubernetesAuthTranslatorGenerator } from '../kubernetes-auth-translator/KubernetesAuthTranslatorGenerator';
const DEFAULT_OBJECTS = new Set<KubernetesObjectTypes>([
export const DEFAULT_OBJECTS: KubernetesObjectTypes[] = [
'pods',
'services',
'configmaps',
@@ -34,30 +34,38 @@ const DEFAULT_OBJECTS = new Set<KubernetesObjectTypes>([
'replicasets',
'horizontalpodautoscalers',
'ingresses',
]);
];
export interface KubernetesFanOutHandlerOptions {
logger: Logger;
fetcher: KubernetesFetcher;
serviceLocator: KubernetesServiceLocator;
customResources: CustomResource[];
objectTypesToFetch?: KubernetesObjectTypes[];
}
export class KubernetesFanOutHandler {
private readonly logger: Logger;
private readonly fetcher: KubernetesFetcher;
private readonly serviceLocator: KubernetesServiceLocator;
private readonly customResources: CustomResource[];
private readonly objectTypesToFetch: KubernetesObjectTypes[];
constructor(
logger: Logger,
fetcher: KubernetesFetcher,
serviceLocator: KubernetesServiceLocator,
customResources: CustomResource[],
) {
constructor({
logger,
fetcher,
serviceLocator,
customResources,
objectTypesToFetch = DEFAULT_OBJECTS,
}: KubernetesFanOutHandlerOptions) {
this.logger = logger;
this.fetcher = fetcher;
this.serviceLocator = serviceLocator;
this.customResources = customResources;
this.objectTypesToFetch = objectTypesToFetch;
}
async getKubernetesObjectsByEntity(
requestBody: KubernetesRequestBody,
objectTypesToFetch: Set<KubernetesObjectTypes> = DEFAULT_OBJECTS,
) {
async getKubernetesObjectsByEntity(requestBody: KubernetesRequestBody) {
const entityName =
requestBody.entity?.metadata?.annotations?.[
'backstage.io/kubernetes-id'
@@ -98,7 +106,7 @@ export class KubernetesFanOutHandler {
.fetchObjectsForService({
serviceId: entityName,
clusterDetails: clusterDetailsItem,
objectTypesToFetch,
objectTypesToFetch: new Set(this.objectTypesToFetch),
labelSelector,
customResources: this.customResources,
})
@@ -23,6 +23,7 @@ import { MultiTenantServiceLocator } from '../service-locator/MultiTenantService
import {
ClusterDetails,
KubernetesClustersSupplier,
KubernetesObjectTypes,
KubernetesServiceLocator,
ServiceLocatorMethod,
CustomResource,
@@ -133,13 +134,17 @@ export async function createRouter(
);
const serviceLocator = getServiceLocator(options.config, clusterDetails);
const objectTypesToFetch = options.config.getOptionalStringArray(
'kubernetes.objectTypes',
) as KubernetesObjectTypes[];
const kubernetesFanOutHandler = new KubernetesFanOutHandler(
const kubernetesFanOutHandler = new KubernetesFanOutHandler({
logger,
fetcher,
serviceLocator,
customResources,
);
objectTypesToFetch,
});
return makeRouter(logger, kubernetesFanOutHandler, clusterDetails);
}
+6
View File
@@ -1,5 +1,11 @@
# @backstage/plugin-kubernetes-common
## 0.1.3
### Patch Changes
- 7f24f4088: chore(deps): bump `@kubernetes/client-node` from 0.14.3 to 0.15.0
## 0.1.2
### Patch Changes
+2 -2
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-kubernetes-common",
"description": "Common functionalities for kubernetes, to be shared between kubernetes and kubernetes-backend plugin",
"version": "0.1.2",
"version": "0.1.3",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -39,7 +39,7 @@
"@kubernetes/client-node": "^0.15.0"
},
"devDependencies": {
"@backstage/cli": "^0.7.0"
"@backstage/cli": "^0.7.6"
},
"jest": {
"roots": [
+18
View File
@@ -1,5 +1,23 @@
# @backstage/plugin-kubernetes
## 0.4.9
### Patch Changes
- 9d40fcb1e: - Bumping `material-ui/core` version to at least `4.12.2` as they made some breaking changes in later versions which broke `Pagination` of the `Table`.
- Switching out `material-table` to `@material-table/core` for support for the later versions of `material-ui/core`
- This causes a minor API change to `@backstage/core-components` as the interface for `Table` re-exports the `prop` from the underlying `Table` components.
- `onChangeRowsPerPage` has been renamed to `onRowsPerPageChange`
- `onChangePage` has been renamed to `onPageChange`
- Migration guide is here: https://material-table-core.com/docs/breaking-changes
- 7f24f4088: chore(deps): bump `@kubernetes/client-node` from 0.14.3 to 0.15.0
- Updated dependencies
- @backstage/core-components@0.2.0
- @backstage/plugin-catalog-react@0.4.0
- @backstage/core-plugin-api@0.1.4
- @backstage/theme@0.2.9
- @backstage/plugin-kubernetes-common@0.1.3
## 0.4.8
### Patch Changes
+11 -11
View File
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-kubernetes",
"version": "0.4.8",
"version": "0.4.9",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -32,13 +32,13 @@
"dependencies": {
"@backstage/catalog-model": "^0.9.0",
"@backstage/config": "^0.1.5",
"@backstage/core-components": "^0.1.6",
"@backstage/core-plugin-api": "^0.1.3",
"@backstage/plugin-catalog-react": "^0.3.0",
"@backstage/plugin-kubernetes-common": "^0.1.2",
"@backstage/theme": "^0.2.8",
"@backstage/core-components": "^0.2.0",
"@backstage/core-plugin-api": "^0.1.4",
"@backstage/plugin-catalog-react": "^0.4.0",
"@backstage/plugin-kubernetes-common": "^0.1.3",
"@backstage/theme": "^0.2.9",
"@kubernetes/client-node": "^0.15.0",
"@material-ui/core": "^4.11.0",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.45",
"js-yaml": "^4.0.0",
@@ -50,10 +50,10 @@
"react-use": "^17.2.4"
},
"devDependencies": {
"@backstage/cli": "^0.7.5",
"@backstage/core-app-api": "^0.1.5",
"@backstage/dev-utils": "^0.2.3",
"@backstage/test-utils": "^0.1.15",
"@backstage/cli": "^0.7.6",
"@backstage/core-app-api": "^0.1.6",
"@backstage/dev-utils": "^0.2.4",
"@backstage/test-utils": "^0.1.16",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/react-hooks": "^3.4.2",
+16
View File
@@ -1,5 +1,21 @@
# @backstage/plugin-lighthouse
## 0.2.21
### Patch Changes
- 9d40fcb1e: - Bumping `material-ui/core` version to at least `4.12.2` as they made some breaking changes in later versions which broke `Pagination` of the `Table`.
- Switching out `material-table` to `@material-table/core` for support for the later versions of `material-ui/core`
- This causes a minor API change to `@backstage/core-components` as the interface for `Table` re-exports the `prop` from the underlying `Table` components.
- `onChangeRowsPerPage` has been renamed to `onRowsPerPageChange`
- `onChangePage` has been renamed to `onPageChange`
- Migration guide is here: https://material-table-core.com/docs/breaking-changes
- Updated dependencies
- @backstage/core-components@0.2.0
- @backstage/plugin-catalog-react@0.4.0
- @backstage/core-plugin-api@0.1.4
- @backstage/theme@0.2.9
## 0.2.20
### Patch Changes

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