From f9c209cabb8cabf1dbedc722cd5ff4ff4b99181c Mon Sep 17 00:00:00 2001 From: Wesley Date: Sun, 11 Sep 2022 14:50:00 +0200 Subject: [PATCH] yarn lint applied. Signed-off-by: Wesley --- plugins/azure-functions-backend/schema.d.ts | 16 ++++++++++++++++ .../src/api/AzureWebManagementApi.ts | 2 +- plugins/azure-functions-backend/src/api/types.ts | 16 ++++++++++++++++ .../src/service/router.ts | 2 +- plugins/azure-functions/dev/index.tsx | 16 ++++++++++++++++ plugins/azure-functions/package.json | 2 ++ plugins/azure-functions/src/api/types.ts | 16 ++++++++++++++++ .../AzureFunctionsOverview.tsx | 6 +++--- plugins/azure-functions/src/index.ts | 16 ++++++++++++++++ plugins/azure-functions/src/mocks/mocks.ts | 16 ++++++++++++++++ plugins/azure-functions/src/plugin.test.ts | 16 ++++++++++++++++ plugins/azure-functions/src/plugin.ts | 16 ++++++++++++++++ plugins/azure-functions/src/routes.ts | 16 ++++++++++++++++ plugins/azure-functions/src/setupTests.ts | 16 ++++++++++++++++ yarn.lock | 6 ++++-- 15 files changed, 171 insertions(+), 7 deletions(-) diff --git a/plugins/azure-functions-backend/schema.d.ts b/plugins/azure-functions-backend/schema.d.ts index a86aaad1a3..192aac8477 100644 --- a/plugins/azure-functions-backend/schema.d.ts +++ b/plugins/azure-functions-backend/schema.d.ts @@ -1,3 +1,19 @@ +/* + * Copyright 2022 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 interface Config { azureFunctions: { /** @visibility backend */ diff --git a/plugins/azure-functions-backend/src/api/AzureWebManagementApi.ts b/plugins/azure-functions-backend/src/api/AzureWebManagementApi.ts index bc9dbbce12..bc8722c342 100644 --- a/plugins/azure-functions-backend/src/api/AzureWebManagementApi.ts +++ b/plugins/azure-functions-backend/src/api/AzureWebManagementApi.ts @@ -42,7 +42,7 @@ export class AzureWebManagementApi { constructor(private readonly config: AzureFunctionsConfig) { const creds = new ClientSecretCredential(config.tenantId, config.clientId, config.clientSecret); for (const subscription of config.allowedSubscriptions) { - if (!this.clients.some(c => c.subscriptionId == subscription.id)) { + if (!this.clients.some(c => c.subscriptionId === subscription.id)) { this.clients.push(new WebSiteManagementClient(creds, subscription.id)); } } diff --git a/plugins/azure-functions-backend/src/api/types.ts b/plugins/azure-functions-backend/src/api/types.ts index 6f6963a0af..7aa79aa081 100644 --- a/plugins/azure-functions-backend/src/api/types.ts +++ b/plugins/azure-functions-backend/src/api/types.ts @@ -1,3 +1,19 @@ +/* + * Copyright 2022 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 interface AzureFunctionsAllowedSubscriptionsConfig { name: string; id: string; diff --git a/plugins/azure-functions-backend/src/service/router.ts b/plugins/azure-functions-backend/src/service/router.ts index ac07579a7c..03f4b30f42 100644 --- a/plugins/azure-functions-backend/src/service/router.ts +++ b/plugins/azure-functions-backend/src/service/router.ts @@ -39,7 +39,7 @@ export async function createRouter( response.send({ status: 'ok' }); }); router.get('/get', async (request, response) => { - response.json(await azureWebManagementApi.list({ functionName: request.query['functionName']!.toString() })) + response.json(await azureWebManagementApi.list({ functionName: request.query.functionName!.toString() })) }); router.use(errorHandler()); return router; diff --git a/plugins/azure-functions/dev/index.tsx b/plugins/azure-functions/dev/index.tsx index a46aa4c67b..d34ef19bc7 100644 --- a/plugins/azure-functions/dev/index.tsx +++ b/plugins/azure-functions/dev/index.tsx @@ -1,3 +1,19 @@ +/* + * Copyright 2022 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 { createDevApp } from '@backstage/dev-utils'; import { azureFunctionsPlugin } from '../src/plugin'; diff --git a/plugins/azure-functions/package.json b/plugins/azure-functions/package.json index 1af6e63db2..a1276f977b 100644 --- a/plugins/azure-functions/package.json +++ b/plugins/azure-functions/package.json @@ -23,8 +23,10 @@ "postpack": "backstage-cli package postpack" }, "dependencies": { + "@backstage/catalog-model": "workspace:^", "@backstage/core-components": "^0.11.1-next.2", "@backstage/core-plugin-api": "^1.0.6-next.2", + "@backstage/plugin-catalog-react": "workspace:^", "@backstage/theme": "^0.2.16", "@material-ui/core": "^4.9.13", "@material-ui/icons": "^4.9.1", diff --git a/plugins/azure-functions/src/api/types.ts b/plugins/azure-functions/src/api/types.ts index b3c2a2bd26..4e6e18df32 100644 --- a/plugins/azure-functions/src/api/types.ts +++ b/plugins/azure-functions/src/api/types.ts @@ -1,3 +1,19 @@ +/* + * Copyright 2022 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 type FunctionsData = { href: string; logstreamHref: string; diff --git a/plugins/azure-functions/src/components/AzureFunctionsOverview/AzureFunctionsOverview.tsx b/plugins/azure-functions/src/components/AzureFunctionsOverview/AzureFunctionsOverview.tsx index 17d190e1a9..1a12086fee 100644 --- a/plugins/azure-functions/src/components/AzureFunctionsOverview/AzureFunctionsOverview.tsx +++ b/plugins/azure-functions/src/components/AzureFunctionsOverview/AzureFunctionsOverview.tsx @@ -29,7 +29,7 @@ import { useServiceEntityAnnotations, } from '../../hooks/useServiceEntityAnnotations'; import { MissingAnnotationEmptyState, Table, TableColumn } from '@backstage/core-components'; -import { FlashOn } from '@material-ui/icons' +import FlashOnIcon from '@material-ui/icons/FlashOn' import ErrorBoundary from '../ErrorBoundary'; import { useEntity } from '@backstage/plugin-catalog-react'; @@ -107,7 +107,7 @@ const OverviewComponent = ({ data, loading }: FunctionTableProps) => { - + Azure Functions @@ -135,7 +135,7 @@ const AzureFunctionsOverview = ({ entity }: { entity: Entity }) => { }); return ( - <>{} + <> ); }; diff --git a/plugins/azure-functions/src/index.ts b/plugins/azure-functions/src/index.ts index 6b7079ad36..4d359dc0a2 100644 --- a/plugins/azure-functions/src/index.ts +++ b/plugins/azure-functions/src/index.ts @@ -1,3 +1,19 @@ +/* + * Copyright 2022 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 * from './plugin'; export * from './api'; export * from './components/AzureFunctionsOverview/AzureFunctionsOverview'; \ No newline at end of file diff --git a/plugins/azure-functions/src/mocks/mocks.ts b/plugins/azure-functions/src/mocks/mocks.ts index 487a4b1f5d..053fe27b54 100644 --- a/plugins/azure-functions/src/mocks/mocks.ts +++ b/plugins/azure-functions/src/mocks/mocks.ts @@ -1,3 +1,19 @@ +/* + * Copyright 2022 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 const entityMock = { metadata: { namespace: 'default', diff --git a/plugins/azure-functions/src/plugin.test.ts b/plugins/azure-functions/src/plugin.test.ts index 84dce9eed8..9e6c04708d 100644 --- a/plugins/azure-functions/src/plugin.test.ts +++ b/plugins/azure-functions/src/plugin.test.ts @@ -1,3 +1,19 @@ +/* + * Copyright 2022 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 { azureFunctionsPlugin } from './plugin'; describe('azure-functions', () => { diff --git a/plugins/azure-functions/src/plugin.ts b/plugins/azure-functions/src/plugin.ts index e796eebbfc..b0945f8c5d 100644 --- a/plugins/azure-functions/src/plugin.ts +++ b/plugins/azure-functions/src/plugin.ts @@ -1,3 +1,19 @@ +/* + * Copyright 2022 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 { createApiFactory, createComponentExtension, diff --git a/plugins/azure-functions/src/routes.ts b/plugins/azure-functions/src/routes.ts index d775ceb7b0..61234c4da5 100644 --- a/plugins/azure-functions/src/routes.ts +++ b/plugins/azure-functions/src/routes.ts @@ -1,3 +1,19 @@ +/* + * Copyright 2022 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 { createRouteRef } from '@backstage/core-plugin-api'; export const rootRouteRef = createRouteRef({ diff --git a/plugins/azure-functions/src/setupTests.ts b/plugins/azure-functions/src/setupTests.ts index 48c09b5346..2b5b615b19 100644 --- a/plugins/azure-functions/src/setupTests.ts +++ b/plugins/azure-functions/src/setupTests.ts @@ -1,2 +1,18 @@ +/* + * Copyright 2022 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 '@testing-library/jest-dom'; import 'cross-fetch/polyfill'; diff --git a/yarn.lock b/yarn.lock index 69069ce652..e9090f7e0c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3100,7 +3100,7 @@ __metadata: languageName: node linkType: hard -"@backstage/catalog-model@^1.0.0, @backstage/catalog-model@^1.0.1, @backstage/catalog-model@^1.0.3, @backstage/catalog-model@^1.1.0, @backstage/catalog-model@workspace:packages/catalog-model": +"@backstage/catalog-model@^1.0.0, @backstage/catalog-model@^1.0.1, @backstage/catalog-model@^1.0.3, @backstage/catalog-model@^1.1.0, @backstage/catalog-model@workspace:^, @backstage/catalog-model@workspace:packages/catalog-model": version: 0.0.0-use.local resolution: "@backstage/catalog-model@workspace:packages/catalog-model" dependencies: @@ -4166,11 +4166,13 @@ __metadata: version: 0.0.0-use.local resolution: "@backstage/plugin-azure-functions@workspace:plugins/azure-functions" dependencies: + "@backstage/catalog-model": "workspace:^" "@backstage/cli": ^0.19.0-next.2 "@backstage/core-app-api": ^1.1.0-next.2 "@backstage/core-components": ^0.11.1-next.2 "@backstage/core-plugin-api": ^1.0.6-next.2 "@backstage/dev-utils": ^1.0.6-next.1 + "@backstage/plugin-catalog-react": "workspace:^" "@backstage/test-utils": ^1.2.0-next.2 "@backstage/theme": ^0.2.16 "@material-ui/core": ^4.9.13 @@ -4765,7 +4767,7 @@ __metadata: languageName: unknown linkType: soft -"@backstage/plugin-catalog-react@^1.1.4-next.0, @backstage/plugin-catalog-react@^1.1.4-next.1, @backstage/plugin-catalog-react@workspace:plugins/catalog-react": +"@backstage/plugin-catalog-react@^1.1.4-next.0, @backstage/plugin-catalog-react@^1.1.4-next.1, @backstage/plugin-catalog-react@workspace:^, @backstage/plugin-catalog-react@workspace:plugins/catalog-react": version: 0.0.0-use.local resolution: "@backstage/plugin-catalog-react@workspace:plugins/catalog-react" dependencies: