@backstage-community/plugin-lighthouse 0.20.0 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/dist/Router.esm.js.map +1 -1
- package/dist/alpha/extensions.esm.js +1 -1
- package/dist/alpha/extensions.esm.js.map +1 -1
- package/dist/alpha/plugin.esm.js.map +1 -1
- package/dist/alpha.d.ts +9 -5
- package/dist/api.esm.js.map +1 -1
- package/dist/components/AuditList/AuditListForEntity.esm.js.map +1 -1
- package/dist/components/AuditList/AuditListTable.esm.js.map +1 -1
- package/dist/components/AuditList/index.esm.js.map +1 -1
- package/dist/components/AuditStatusIcon/index.esm.js.map +1 -1
- package/dist/components/AuditView/index.esm.js +1 -1
- package/dist/components/AuditView/index.esm.js.map +1 -1
- package/dist/components/Cards/LastLighthouseAuditCard.esm.js.map +1 -1
- package/dist/components/Cards/index.esm.js +5 -1
- package/dist/components/Cards/index.esm.js.map +1 -1
- package/dist/components/CreateAudit/index.esm.js +2 -2
- package/dist/components/CreateAudit/index.esm.js.map +1 -1
- package/dist/components/Intro/index.esm.js +1 -1
- package/dist/components/Intro/index.esm.js.map +1 -1
- package/dist/components/SupportButton/index.esm.js.map +1 -1
- package/dist/constants.esm.js.map +1 -1
- package/dist/hooks/useWebsiteForEntity.esm.js.map +1 -1
- package/dist/plugin.esm.js.map +1 -1
- package/dist/utils.esm.js.map +1 -1
- package/package.json +14 -14
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @backstage-community/plugin-lighthouse
|
|
2
2
|
|
|
3
|
+
## 0.22.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 2e6c13e: Backstage version bump to v1.50.2
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [2e6c13e]
|
|
12
|
+
- @backstage-community/plugin-lighthouse-common@0.19.0
|
|
13
|
+
|
|
14
|
+
## 0.21.0
|
|
15
|
+
|
|
16
|
+
### Minor Changes
|
|
17
|
+
|
|
18
|
+
- 233c7f0: Backstage version bump to v1.50.1
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- Updated dependencies [233c7f0]
|
|
23
|
+
- @backstage-community/plugin-lighthouse-common@0.18.0
|
|
24
|
+
|
|
3
25
|
## 0.20.0
|
|
4
26
|
|
|
5
27
|
### Minor Changes
|
package/dist/Router.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Router.esm.js","sources":["../src/Router.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Route, Routes } from 'react-router-dom';\nimport {\n useEntity,\n MissingAnnotationEmptyState,\n} from '@backstage/plugin-catalog-react';\nimport AuditList from './components/AuditList';\nimport AuditView, { AuditViewContent } from './components/AuditView';\nimport CreateAudit, { CreateAuditContent } from './components/CreateAudit';\nimport { Entity } from '@backstage/catalog-model';\nimport { LIGHTHOUSE_WEBSITE_URL_ANNOTATION } from '../constants';\nimport { AuditListForEntity } from './components/AuditList/AuditListForEntity';\n\n/** @public */\nexport const isLighthouseAvailable = (entity: Entity) =>\n Boolean(entity.metadata.annotations?.[LIGHTHOUSE_WEBSITE_URL_ANNOTATION]);\n\n/** @public */\nexport const Router = () => (\n <Routes>\n <Route path=\"/\" element={<AuditList />} />\n <Route path=\"/audit/:id\" element={<AuditView />} />\n <Route path=\"/create-audit\" element={<CreateAudit />} />\n </Routes>\n);\n\n/** @public */\nexport const EmbeddedRouter = () => {\n const { entity } = useEntity();\n\n if (!isLighthouseAvailable(entity)) {\n return (\n <MissingAnnotationEmptyState\n annotation={LIGHTHOUSE_WEBSITE_URL_ANNOTATION}\n />\n );\n }\n\n return (\n <Routes>\n <Route path=\"/\" element={<AuditListForEntity />} />\n <Route path=\"/audit/:id\" element={<AuditViewContent />} />\n <Route path=\"/create-audit\" element={<CreateAuditContent />} />\n </Routes>\n );\n};\n"],"names":["AuditView"],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"Router.esm.js","sources":["../src/Router.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Route, Routes } from 'react-router-dom';\nimport {\n useEntity,\n MissingAnnotationEmptyState,\n} from '@backstage/plugin-catalog-react';\nimport AuditList from './components/AuditList';\nimport AuditView, { AuditViewContent } from './components/AuditView';\nimport CreateAudit, { CreateAuditContent } from './components/CreateAudit';\nimport { Entity } from '@backstage/catalog-model';\nimport { LIGHTHOUSE_WEBSITE_URL_ANNOTATION } from '../constants';\nimport { AuditListForEntity } from './components/AuditList/AuditListForEntity';\n\n/** @public */\nexport const isLighthouseAvailable = (entity: Entity) =>\n Boolean(entity.metadata.annotations?.[LIGHTHOUSE_WEBSITE_URL_ANNOTATION]);\n\n/** @public */\nexport const Router = () => (\n <Routes>\n <Route path=\"/\" element={<AuditList />} />\n <Route path=\"/audit/:id\" element={<AuditView />} />\n <Route path=\"/create-audit\" element={<CreateAudit />} />\n </Routes>\n);\n\n/** @public */\nexport const EmbeddedRouter = () => {\n const { entity } = useEntity();\n\n if (!isLighthouseAvailable(entity)) {\n return (\n <MissingAnnotationEmptyState\n annotation={LIGHTHOUSE_WEBSITE_URL_ANNOTATION}\n />\n );\n }\n\n return (\n <Routes>\n <Route path=\"/\" element={<AuditListForEntity />} />\n <Route path=\"/audit/:id\" element={<AuditViewContent />} />\n <Route path=\"/create-audit\" element={<CreateAuditContent />} />\n </Routes>\n );\n};\n"],"names":["AuditView"],"mappings":";;;;;;;;;AA6BO,MAAM,qBAAA,GAAwB,CAAC,MAAA,KACpC,OAAA,CAAQ,OAAO,QAAA,CAAS,WAAA,GAAc,iCAAiC,CAAC;AAGnE,MAAM,MAAA,GAAS,sBACpB,IAAA,CAAC,MAAA,EAAA,EACC,QAAA,EAAA;AAAA,kBAAA,GAAA,CAAC,SAAM,IAAA,EAAK,GAAA,EAAI,OAAA,kBAAS,GAAA,CAAC,aAAU,CAAA,EAAI,CAAA;AAAA,sBACvC,KAAA,EAAA,EAAM,IAAA,EAAK,cAAa,OAAA,kBAAS,GAAA,CAACA,sBAAU,CAAA,EAAI,CAAA;AAAA,sBAChD,KAAA,EAAA,EAAM,IAAA,EAAK,iBAAgB,OAAA,kBAAS,GAAA,CAAC,eAAY,CAAA,EAAI;AAAA,CAAA,EACxD;AAIK,MAAM,iBAAiB,MAAM;AAClC,EAAA,MAAM,EAAE,MAAA,EAAO,GAAI,SAAA,EAAU;AAE7B,EAAA,IAAI,CAAC,qBAAA,CAAsB,MAAM,CAAA,EAAG;AAClC,IAAA,uBACE,GAAA;AAAA,MAAC,2BAAA;AAAA,MAAA;AAAA,QACC,UAAA,EAAY;AAAA;AAAA,KACd;AAAA,EAEJ;AAEA,EAAA,4BACG,MAAA,EAAA,EACC,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,SAAM,IAAA,EAAK,GAAA,EAAI,OAAA,kBAAS,GAAA,CAAC,sBAAmB,CAAA,EAAI,CAAA;AAAA,wBAChD,KAAA,EAAA,EAAM,IAAA,EAAK,cAAa,OAAA,kBAAS,GAAA,CAAC,oBAAiB,CAAA,EAAI,CAAA;AAAA,wBACvD,KAAA,EAAA,EAAM,IAAA,EAAK,iBAAgB,OAAA,kBAAS,GAAA,CAAC,sBAAmB,CAAA,EAAI;AAAA,GAAA,EAC/D,CAAA;AAEJ;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { PageBlueprint, ApiBlueprint, configApiRef, NavItemBlueprint } from '@backstage/frontend-plugin-api';
|
|
3
|
-
import {
|
|
3
|
+
import { compatWrapper, convertLegacyRouteRef } from '@backstage/core-compat-api';
|
|
4
4
|
import { rootRouteRef } from '../plugin.esm.js';
|
|
5
5
|
import { lighthouseApiRef } from '../api.esm.js';
|
|
6
6
|
import { LighthouseRestApi } from '@backstage-community/plugin-lighthouse-common';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extensions.esm.js","sources":["../../src/alpha/extensions.tsx"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n ApiBlueprint,\n configApiRef,\n NavItemBlueprint,\n PageBlueprint,\n} from '@backstage/frontend-plugin-api';\nimport {\n compatWrapper,\n convertLegacyRouteRef,\n} from '@backstage/core-compat-api';\nimport { rootRouteRef } from '../plugin';\nimport { lighthouseApiRef } from '../api';\nimport { LighthouseRestApi } from '@backstage-community/plugin-lighthouse-common';\nimport {\n EntityCardBlueprint,\n EntityContentBlueprint,\n} from '@backstage/plugin-catalog-react/alpha';\nimport { isLighthouseAvailable } from '../Router';\nimport Highlight from '@material-ui/icons/Highlight';\n\nexport const lighthousePage = PageBlueprint.make({\n params: {\n path: '/lighthouse',\n routeRef: convertLegacyRouteRef(rootRouteRef),\n loader: async () =>\n import('../Router').then(m => compatWrapper(<m.Router />)),\n },\n});\n\nexport const lighthouseApi = ApiBlueprint.make({\n params: defineParams =>\n defineParams({\n api: lighthouseApiRef,\n deps: {\n configApi: configApiRef,\n },\n factory: ({ configApi }) => LighthouseRestApi.fromConfig(configApi),\n }),\n});\n\nexport const lighthouseNavItem = NavItemBlueprint.make({\n params: {\n icon: Highlight,\n routeRef: convertLegacyRouteRef(rootRouteRef),\n title: 'Lighthouse',\n },\n});\n\nexport const lighthouseEntityCard = EntityCardBlueprint.make({\n name: 'lighthouse',\n params: {\n filter: isLighthouseAvailable,\n loader: async () =>\n import('../components/Cards/LastLighthouseAuditCard').then(m =>\n compatWrapper(<m.LastLighthouseAuditCard />),\n ),\n },\n});\n\nexport const lighthouseEntityContent = EntityContentBlueprint.make({\n name: 'lighthouse',\n params: {\n path: '/lighthouse',\n title: 'Lighthouse',\n filter: isLighthouseAvailable,\n loader: async () =>\n import('../Router').then(m => compatWrapper(<m.EmbeddedRouter />)),\n },\n});\n"],"names":[],"mappings":";;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"extensions.esm.js","sources":["../../src/alpha/extensions.tsx"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n ApiBlueprint,\n configApiRef,\n NavItemBlueprint,\n PageBlueprint,\n} from '@backstage/frontend-plugin-api';\nimport {\n compatWrapper,\n convertLegacyRouteRef,\n} from '@backstage/core-compat-api';\nimport { rootRouteRef } from '../plugin';\nimport { lighthouseApiRef } from '../api';\nimport { LighthouseRestApi } from '@backstage-community/plugin-lighthouse-common';\nimport {\n EntityCardBlueprint,\n EntityContentBlueprint,\n} from '@backstage/plugin-catalog-react/alpha';\nimport { isLighthouseAvailable } from '../Router';\nimport Highlight from '@material-ui/icons/Highlight';\n\nexport const lighthousePage = PageBlueprint.make({\n params: {\n path: '/lighthouse',\n routeRef: convertLegacyRouteRef(rootRouteRef),\n loader: async () =>\n import('../Router').then(m => compatWrapper(<m.Router />)),\n },\n});\n\nexport const lighthouseApi = ApiBlueprint.make({\n params: defineParams =>\n defineParams({\n api: lighthouseApiRef,\n deps: {\n configApi: configApiRef,\n },\n factory: ({ configApi }) => LighthouseRestApi.fromConfig(configApi),\n }),\n});\n\nexport const lighthouseNavItem = NavItemBlueprint.make({\n params: {\n icon: Highlight,\n routeRef: convertLegacyRouteRef(rootRouteRef),\n title: 'Lighthouse',\n },\n});\n\nexport const lighthouseEntityCard = EntityCardBlueprint.make({\n name: 'lighthouse',\n params: {\n filter: isLighthouseAvailable,\n loader: async () =>\n import('../components/Cards/LastLighthouseAuditCard').then(m =>\n compatWrapper(<m.LastLighthouseAuditCard />),\n ),\n },\n});\n\nexport const lighthouseEntityContent = EntityContentBlueprint.make({\n name: 'lighthouse',\n params: {\n path: '/lighthouse',\n title: 'Lighthouse',\n filter: isLighthouseAvailable,\n loader: async () =>\n import('../Router').then(m => compatWrapper(<m.EmbeddedRouter />)),\n },\n});\n"],"names":[],"mappings":";;;;;;;;;;AAmCO,MAAM,cAAA,GAAiB,cAAc,IAAA,CAAK;AAAA,EAC/C,MAAA,EAAQ;AAAA,IACN,IAAA,EAAM,aAAA;AAAA,IACN,QAAA,EAAU,sBAAsB,YAAY,CAAA;AAAA,IAC5C,MAAA,EAAQ,YACN,OAAO,kBAAW,CAAA,CAAE,IAAA,CAAK,CAAA,CAAA,KAAK,aAAA,iBAAc,G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"version":3,"file":"plugin.esm.js","sources":["../../src/alpha/plugin.ts"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createFrontendPlugin } from '@backstage/frontend-plugin-api';\nimport {\n lighthouseApi,\n lighthouseEntityCard,\n lighthouseEntityContent,\n lighthouseNavItem,\n lighthousePage,\n} from './extensions';\n\n/**\n * @alpha\n */\nexport const lighthousePlugin = createFrontendPlugin({\n pluginId: 'lighthouse',\n extensions: [\n lighthousePage,\n lighthouseApi,\n lighthouseEntityCard,\n lighthouseNavItem,\n lighthouseEntityContent,\n ],\n});\n"],"names":[],"mappings":";;;AA2BO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"plugin.esm.js","sources":["../../src/alpha/plugin.ts"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createFrontendPlugin } from '@backstage/frontend-plugin-api';\nimport {\n lighthouseApi,\n lighthouseEntityCard,\n lighthouseEntityContent,\n lighthouseNavItem,\n lighthousePage,\n} from './extensions';\n\n/**\n * @alpha\n */\nexport const lighthousePlugin = createFrontendPlugin({\n pluginId: 'lighthouse',\n extensions: [\n lighthousePage,\n lighthouseApi,\n lighthouseEntityCard,\n lighthouseNavItem,\n lighthouseEntityContent,\n ],\n});\n"],"names":[],"mappings":";;;AA2BO,MAAM,mBAAmB,oBAAA,CAAqB;AAAA,EACnD,QAAA,EAAU,YAAA;AAAA,EACV,UAAA,EAAY;AAAA,IACV,cAAA;AAAA,IACA,aAAA;AAAA,IACA,oBAAA;AAAA,IACA,iBAAA;AAAA,IACA;AAAA;AAEJ,CAAC;;;;"}
|
package/dist/alpha.d.ts
CHANGED
|
@@ -53,9 +53,9 @@ declare const lighthousePlugin: _backstage_frontend_plugin_api.OverridableFronte
|
|
|
53
53
|
icon: string | undefined;
|
|
54
54
|
};
|
|
55
55
|
configInput: {
|
|
56
|
-
filter?: _backstage_filter_predicates.FilterPredicate | undefined;
|
|
57
|
-
title?: string | undefined;
|
|
58
56
|
path?: string | undefined;
|
|
57
|
+
title?: string | undefined;
|
|
58
|
+
filter?: _backstage_filter_predicates.FilterPredicate | undefined;
|
|
59
59
|
group?: string | false | undefined;
|
|
60
60
|
icon?: string | undefined;
|
|
61
61
|
};
|
|
@@ -87,8 +87,12 @@ declare const lighthousePlugin: _backstage_frontend_plugin_api.OverridableFronte
|
|
|
87
87
|
"nav-item:lighthouse": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
|
|
88
88
|
kind: "nav-item";
|
|
89
89
|
name: undefined;
|
|
90
|
-
config: {
|
|
91
|
-
|
|
90
|
+
config: {
|
|
91
|
+
title: string | undefined;
|
|
92
|
+
};
|
|
93
|
+
configInput: {
|
|
94
|
+
title?: string | undefined;
|
|
95
|
+
};
|
|
92
96
|
output: _backstage_frontend_plugin_api.ExtensionDataRef<{
|
|
93
97
|
title: string;
|
|
94
98
|
icon: _backstage_frontend_plugin_api.IconComponent;
|
|
@@ -109,8 +113,8 @@ declare const lighthousePlugin: _backstage_frontend_plugin_api.OverridableFronte
|
|
|
109
113
|
title: string | undefined;
|
|
110
114
|
};
|
|
111
115
|
configInput: {
|
|
112
|
-
title?: string | undefined;
|
|
113
116
|
path?: string | undefined;
|
|
117
|
+
title?: string | undefined;
|
|
114
118
|
};
|
|
115
119
|
output: _backstage_frontend_plugin_api.ExtensionDataRef<react.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ExtensionDataRef<string, "core.routing.path", {}> | _backstage_frontend_plugin_api.ExtensionDataRef<_backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams>, "core.routing.ref", {
|
|
116
120
|
optional: true;
|
package/dist/api.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.esm.js","sources":["../src/api.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createApiRef } from '@backstage/core-plugin-api';\nimport { LighthouseApi } from '@backstage-community/plugin-lighthouse-common';\n\n/** @public */\nexport const lighthouseApiRef = createApiRef<LighthouseApi>({\n id: 'plugin.lighthouse.service',\n});\n"],"names":[],"mappings":";;AAoBO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"api.esm.js","sources":["../src/api.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createApiRef } from '@backstage/core-plugin-api';\nimport { LighthouseApi } from '@backstage-community/plugin-lighthouse-common';\n\n/** @public */\nexport const lighthouseApiRef = createApiRef<LighthouseApi>({\n id: 'plugin.lighthouse.service',\n});\n"],"names":[],"mappings":";;AAoBO,MAAM,mBAAmB,YAAA,CAA4B;AAAA,EAC1D,EAAA,EAAI;AACN,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuditListForEntity.esm.js","sources":["../../../src/components/AuditList/AuditListForEntity.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ReactNode } from 'react';\nimport { AuditListTable } from './AuditListTable';\nimport { useWebsiteForEntity } from '../../hooks/useWebsiteForEntity';\nimport { LIGHTHOUSE_WEBSITE_URL_ANNOTATION } from '../../../constants';\nimport {\n Content,\n ContentHeader,\n InfoCard,\n Progress,\n WarningPanel,\n} from '@backstage/core-components';\nimport Button from '@material-ui/core/Button';\nimport { resolvePath, useNavigate } from 'react-router-dom';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport { useRouteRef } from '@backstage/core-plugin-api';\nimport { rootRouteRef } from '../../plugin';\nimport LighthouseSupportButton from '../SupportButton';\n\nexport const AuditListForEntity = () => {\n const { value, loading, error } = useWebsiteForEntity();\n const { entity } = useEntity();\n const navigate = useNavigate();\n const fromPath = useRouteRef(rootRouteRef)?.() ?? '../';\n\n let createAuditButtonUrl = 'create-audit';\n const websiteUrl =\n entity.metadata.annotations?.[LIGHTHOUSE_WEBSITE_URL_ANNOTATION] ?? '';\n if (websiteUrl) {\n createAuditButtonUrl += `?url=${encodeURIComponent(websiteUrl)}`;\n }\n\n let content: ReactNode = null;\n content = (\n <Content>\n <ContentHeader title=\"Latest Audit\">\n <Button\n variant=\"contained\"\n color=\"primary\"\n onClick={() => navigate(resolvePath(createAuditButtonUrl, fromPath))}\n >\n Create New Audit\n </Button>\n <LighthouseSupportButton />\n </ContentHeader>\n <AuditListTable items={value ? [value] : []} />\n </Content>\n );\n\n if (loading) {\n content = <Progress />;\n }\n if (error && !error.message.includes('no audited website found for url')) {\n // We only want to display this warning panel when its caused by an error other than no audits for the website\n content = (\n <WarningPanel severity=\"error\" title=\"Could not load audit list.\">\n {error.message}\n </WarningPanel>\n );\n }\n\n return <InfoCard noPadding>{content}</InfoCard>;\n};\n"],"names":[],"mappings":";;;;;;;;;;;;AAiCO,MAAM,qBAAqB,MAAM;AACtC,EAAA,MAAM,EAAE,KAAA,EAAO,
|
|
1
|
+
{"version":3,"file":"AuditListForEntity.esm.js","sources":["../../../src/components/AuditList/AuditListForEntity.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ReactNode } from 'react';\nimport { AuditListTable } from './AuditListTable';\nimport { useWebsiteForEntity } from '../../hooks/useWebsiteForEntity';\nimport { LIGHTHOUSE_WEBSITE_URL_ANNOTATION } from '../../../constants';\nimport {\n Content,\n ContentHeader,\n InfoCard,\n Progress,\n WarningPanel,\n} from '@backstage/core-components';\nimport Button from '@material-ui/core/Button';\nimport { resolvePath, useNavigate } from 'react-router-dom';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport { useRouteRef } from '@backstage/core-plugin-api';\nimport { rootRouteRef } from '../../plugin';\nimport LighthouseSupportButton from '../SupportButton';\n\nexport const AuditListForEntity = () => {\n const { value, loading, error } = useWebsiteForEntity();\n const { entity } = useEntity();\n const navigate = useNavigate();\n const fromPath = useRouteRef(rootRouteRef)?.() ?? '../';\n\n let createAuditButtonUrl = 'create-audit';\n const websiteUrl =\n entity.metadata.annotations?.[LIGHTHOUSE_WEBSITE_URL_ANNOTATION] ?? '';\n if (websiteUrl) {\n createAuditButtonUrl += `?url=${encodeURIComponent(websiteUrl)}`;\n }\n\n let content: ReactNode = null;\n content = (\n <Content>\n <ContentHeader title=\"Latest Audit\">\n <Button\n variant=\"contained\"\n color=\"primary\"\n onClick={() => navigate(resolvePath(createAuditButtonUrl, fromPath))}\n >\n Create New Audit\n </Button>\n <LighthouseSupportButton />\n </ContentHeader>\n <AuditListTable items={value ? [value] : []} />\n </Content>\n );\n\n if (loading) {\n content = <Progress />;\n }\n if (error && !error.message.includes('no audited website found for url')) {\n // We only want to display this warning panel when its caused by an error other than no audits for the website\n content = (\n <WarningPanel severity=\"error\" title=\"Could not load audit list.\">\n {error.message}\n </WarningPanel>\n );\n }\n\n return <InfoCard noPadding>{content}</InfoCard>;\n};\n"],"names":[],"mappings":";;;;;;;;;;;;AAiCO,MAAM,qBAAqB,MAAM;AACtC,EAAA,MAAM,EAAE,KAAA,EAAO,OAAA,EAAS,KAAA,KAAU,mBAAA,EAAoB;AACtD,EAAA,MAAM,EAAE,MAAA,EAAO,GAAI,SAAA,EAAU;AAC7B,EAAA,MAAM,WAAW,WAAA,EAAY;AAC7B,EAAA,MAAM,QAAA,GAAW,WAAA,CAAY,YAAY,CAAA,IAAI,IAAK,KAAA;AAElD,EAAA,IAAI,oBAAA,GAAuB,cAAA;AAC3B,EAAA,MAAM,UAAA,GACJ,MAAA,CAAO,QAAA,CAAS,WAAA,GAAc,iCAAiC,CAAA,IAAK,EAAA;AACtE,EAAA,IAAI,UAAA,EAAY;AACd,IAAA,oBAAA,IAAwB,CAAA,KAAA,EAAQ,kBAAA,CAAmB,UAAU,CAAC,CAAA,CAAA;AAAA,EAChE;AAEA,EAAA,IAAI,OAAA,GAAqB,IAAA;AACzB,EAAA,OAAA,wBACG,OAAA,EAAA,EACC,QAAA,EAAA;AAAA,oBAAA,IAAA,CAAC,aAAA,EAAA,EAAc,OAAM,cAAA,EACnB,QAAA,EAAA;AAAA,sBAAA,GAAA;AAAA,QAAC,MAAA;AAAA,QAAA;AAAA,UACC,OAAA,EAAQ,WAAA;AAAA,UACR,KAAA,EAAM,SAAA;AAAA,UACN,SAAS,MAAM,QAAA,CAAS,WAAA,CAAY,oBAAA,EAAsB,QAAQ,CAAC,CAAA;AAAA,UACpE,QAAA,EAAA;AAAA;AAAA,OAED;AAAA,0BACC,uBAAA,EAAA,EAAwB;AAAA,KAAA,EAC3B,CAAA;AAAA,oBACA,GAAA,CAAC,kBAAe,KAAA,EAAO,KAAA,GAAQ,CAAC,KAAK,CAAA,GAAI,EAAC,EAAG;AAAA,GAAA,EAC/C,CAAA;AAGF,EAAA,IAAI,OAAA,EAAS;AACX,IAAA,OAAA,uBAAW,QAAA,EAAA,EAAS,CAAA;AAAA,EACtB;AACA,EAAA,IAAI,SAAS,CAAC,KAAA,CAAM,OAAA,CAAQ,QAAA,CAAS,kCAAkC,CAAA,EAAG;AAExE,IAAA,OAAA,uBACG,YAAA,EAAA,EAAa,QAAA,EAAS,SAAQ,KAAA,EAAM,4BAAA,EAClC,gBAAM,OAAA,EACT,CAAA;AAAA,EAEJ;AAEA,EAAA,uBAAO,GAAA,CAAC,QAAA,EAAA,EAAS,SAAA,EAAS,IAAA,EAAE,QAAA,EAAA,OAAA,EAAQ,CAAA;AACtC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuditListTable.esm.js","sources":["../../../src/components/AuditList/AuditListTable.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useState, useEffect } from 'react';\nimport Typography from '@material-ui/core/Typography';\nimport { Website } from '@backstage-community/plugin-lighthouse-common';\nimport { lighthouseApiRef } from '../../api';\nimport useInterval from 'react-use/esm/useInterval';\nimport {\n formatTime,\n CATEGORIES,\n CATEGORY_LABELS,\n buildSparklinesDataForItem,\n} from '../../utils';\nimport { generatePath } from 'react-router-dom';\nimport AuditStatusIcon from '../AuditStatusIcon';\n\nimport {\n Link,\n Table,\n TableColumn,\n TrendLine,\n} from '@backstage/core-components';\nimport { useApi } from '@backstage/core-plugin-api';\n\nconst columns: TableColumn[] = [\n {\n title: 'Website URL',\n field: 'websiteUrl',\n },\n ...CATEGORIES.map(category => ({\n title: CATEGORY_LABELS[category],\n field: category,\n })),\n {\n title: 'Last Report',\n field: 'lastReport',\n cellStyle: {\n whiteSpace: 'nowrap',\n },\n },\n {\n title: 'Last Audit Triggered',\n field: 'lastAuditTriggered',\n cellStyle: {\n minWidth: 120,\n },\n },\n];\n\nexport const AuditListTable = ({ items }: { items: Website[] }) => {\n const [websiteState, setWebsiteState] = useState(items);\n const lighthouseApi = useApi(lighthouseApiRef);\n\n useEffect(() => {\n setWebsiteState(items);\n }, [items]);\n\n const runRefresh = (websites: Website[]) => {\n websites.forEach(async website => {\n const response = await lighthouseApi.getWebsiteForAuditId(\n website.lastAudit.id,\n );\n const auditStatus = response.lastAudit.status;\n if (auditStatus === 'COMPLETED' || auditStatus === 'FAILED') {\n const newWebsiteData = websiteState.slice(0);\n newWebsiteData[newWebsiteData.findIndex(w => w.url === response.url)] =\n response;\n setWebsiteState(newWebsiteData);\n }\n });\n };\n\n const runningWebsiteAudits = websiteState\n ? websiteState.filter(website => website.lastAudit.status === 'RUNNING')\n : [];\n\n useInterval(\n () => runRefresh(runningWebsiteAudits),\n runningWebsiteAudits.length > 0 ? 5000 : null,\n );\n\n const data = websiteState.map(website => {\n const trendlineData = buildSparklinesDataForItem(website);\n const trendlines: any = {};\n CATEGORIES.forEach(category => {\n trendlines[category] = (\n <TrendLine\n title={`trendline for ${CATEGORY_LABELS[category]} category of ${website.url}`}\n data={trendlineData[category] || []}\n />\n );\n });\n\n return {\n websiteUrl: (\n <Link to={generatePath('audit/:id', { id: website.lastAudit.id })}>\n {website.url}\n </Link>\n ),\n ...trendlines,\n lastReport: (\n <>\n <AuditStatusIcon audit={website.lastAudit} />{' '}\n <Typography component=\"span\">\n {website.lastAudit.status.toLocaleUpperCase('en-US')}\n </Typography>\n </>\n ),\n lastAuditTriggered: formatTime(website.lastAudit.timeCreated),\n };\n });\n\n return (\n <Table\n options={{\n paging: false,\n toolbar: false,\n }}\n columns={columns}\n data={data}\n />\n );\n};\n\nexport default AuditListTable;\n"],"names":[],"mappings":";;;;;;;;;;;AAqCA,MAAM,
|
|
1
|
+
{"version":3,"file":"AuditListTable.esm.js","sources":["../../../src/components/AuditList/AuditListTable.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useState, useEffect } from 'react';\nimport Typography from '@material-ui/core/Typography';\nimport { Website } from '@backstage-community/plugin-lighthouse-common';\nimport { lighthouseApiRef } from '../../api';\nimport useInterval from 'react-use/esm/useInterval';\nimport {\n formatTime,\n CATEGORIES,\n CATEGORY_LABELS,\n buildSparklinesDataForItem,\n} from '../../utils';\nimport { generatePath } from 'react-router-dom';\nimport AuditStatusIcon from '../AuditStatusIcon';\n\nimport {\n Link,\n Table,\n TableColumn,\n TrendLine,\n} from '@backstage/core-components';\nimport { useApi } from '@backstage/core-plugin-api';\n\nconst columns: TableColumn[] = [\n {\n title: 'Website URL',\n field: 'websiteUrl',\n },\n ...CATEGORIES.map(category => ({\n title: CATEGORY_LABELS[category],\n field: category,\n })),\n {\n title: 'Last Report',\n field: 'lastReport',\n cellStyle: {\n whiteSpace: 'nowrap',\n },\n },\n {\n title: 'Last Audit Triggered',\n field: 'lastAuditTriggered',\n cellStyle: {\n minWidth: 120,\n },\n },\n];\n\nexport const AuditListTable = ({ items }: { items: Website[] }) => {\n const [websiteState, setWebsiteState] = useState(items);\n const lighthouseApi = useApi(lighthouseApiRef);\n\n useEffect(() => {\n setWebsiteState(items);\n }, [items]);\n\n const runRefresh = (websites: Website[]) => {\n websites.forEach(async website => {\n const response = await lighthouseApi.getWebsiteForAuditId(\n website.lastAudit.id,\n );\n const auditStatus = response.lastAudit.status;\n if (auditStatus === 'COMPLETED' || auditStatus === 'FAILED') {\n const newWebsiteData = websiteState.slice(0);\n newWebsiteData[newWebsiteData.findIndex(w => w.url === response.url)] =\n response;\n setWebsiteState(newWebsiteData);\n }\n });\n };\n\n const runningWebsiteAudits = websiteState\n ? websiteState.filter(website => website.lastAudit.status === 'RUNNING')\n : [];\n\n useInterval(\n () => runRefresh(runningWebsiteAudits),\n runningWebsiteAudits.length > 0 ? 5000 : null,\n );\n\n const data = websiteState.map(website => {\n const trendlineData = buildSparklinesDataForItem(website);\n const trendlines: any = {};\n CATEGORIES.forEach(category => {\n trendlines[category] = (\n <TrendLine\n title={`trendline for ${CATEGORY_LABELS[category]} category of ${website.url}`}\n data={trendlineData[category] || []}\n />\n );\n });\n\n return {\n websiteUrl: (\n <Link to={generatePath('audit/:id', { id: website.lastAudit.id })}>\n {website.url}\n </Link>\n ),\n ...trendlines,\n lastReport: (\n <>\n <AuditStatusIcon audit={website.lastAudit} />{' '}\n <Typography component=\"span\">\n {website.lastAudit.status.toLocaleUpperCase('en-US')}\n </Typography>\n </>\n ),\n lastAuditTriggered: formatTime(website.lastAudit.timeCreated),\n };\n });\n\n return (\n <Table\n options={{\n paging: false,\n toolbar: false,\n }}\n columns={columns}\n data={data}\n />\n );\n};\n\nexport default AuditListTable;\n"],"names":[],"mappings":";;;;;;;;;;;AAqCA,MAAM,OAAA,GAAyB;AAAA,EAC7B;AAAA,IACE,KAAA,EAAO,aAAA;AAAA,IACP,KAAA,EAAO;AAAA,GACT;AAAA,EACA,GAAG,UAAA,CAAW,GAAA,CAAI,CAAA,QAAA,MAAa;AAAA,IAC7B,KAAA,EAAO,gBAAgB,QAAQ,CAAA;AAAA,IAC/B,KAAA,EAAO;AAAA,GACT,CAAE,CAAA;AAAA,EACF;AAAA,IACE,KAAA,EAAO,aAAA;AAAA,IACP,KAAA,EAAO,YAAA;AAAA,IACP,SAAA,EAAW;AAAA,MACT,UAAA,EAAY;AAAA;AACd,GACF;AAAA,EACA;AAAA,IACE,KAAA,EAAO,sBAAA;AAAA,IACP,KAAA,EAAO,oBAAA;AAAA,IACP,SAAA,EAAW;AAAA,MACT,QAAA,EAAU;AAAA;AACZ;AAEJ,CAAA;AAEO,MAAM,cAAA,GAAiB,CAAC,EAAE,KAAA,EAAM,KAA4B;AACjE,EAAA,MAAM,CAAC,YAAA,EAAc,eAAe,CAAA,GAAI,SAAS,KAAK,CAAA;AACtD,EAAA,MAAM,aAAA,GAAgB,OAAO,gBAAgB,CAAA;AAE7C,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,eAAA,CAAgB,KAAK,CAAA;AAAA,EACvB,CAAA,EAAG,CAAC,KAAK,CAAC,CAAA;AAEV,EAAA,MAAM,UAAA,GAAa,CAAC,QAAA,KAAwB;AAC1C,IAAA,QAAA,CAAS,OAAA,CAAQ,OAAM,OAAA,KAAW;AA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OACpC;AAAA,IAEJ,CAAC,CAAA;AAED,IAAA,OAAO;AAAA,MACL,UAAA,kBACE,GAAA,CAAC,IAAA,EAAA,EAAK,EAAA,EAAI,aAAa,WAAA,EAAa,EAAE,EAAA,EAAI,OAAA,CAAQ,SAAA,CAAU,EAAA,EAAI,CAAA,EAC7D,kBAAQ,GAAA,EACX,CAAA;AAAA,MAEF,GAAG,UAAA;AAAA,MACH,4BACE,IAAA,CAAA,QAAA,EAAA,EACE,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,eAAA,EAAA,EAAgB,KAAA,EAAO,OAAA,CAAQ,SAAA,EAAW,CAAA;AAAA,QAAG,GAAA;AAAA,wBAC9C,GAAA,CAAC,cAAW,SAAA,EAAU,MAAA,EACnB,kBAAQ,SAAA,CAAU,MAAA,CAAO,iBAAA,CAAkB,OAAO,CAAA,EACrD;AAAA,OAAA,EACF,CAAA;AAAA,MAEF,kBAAA,EAAoB,UAAA,CAAW,OAAA,CAAQ,SAAA,CAAU,WAAW;AAAA,KAC9D;AAAA,EACF,CAAC,CAAA;AAED,EAAA,uBACE,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,OAAA,EAAS;AAAA,QACP,MAAA,EAAQ,KAAA;AAAA,QACR,OAAA,EAAS;AAAA,OACX;AAAA,MACA,OAAA;AAAA,MACA;AAAA;AAAA,GACF;AAEJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../../../src/components/AuditList/index.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Button from '@material-ui/core/Button';\nimport Grid from '@material-ui/core/Grid';\nimport Pagination from '@material-ui/lab/Pagination';\nimport { ChangeEvent, ReactNode, useMemo, useState } from 'react';\nimport { useNavigate } from 'react-router-dom';\nimport useAsync from 'react-use/esm/useAsync';\nimport useLocalStorage from 'react-use/esm/useLocalStorage';\nimport { lighthouseApiRef } from '../../api';\nimport { useQuery } from '../../utils';\nimport LighthouseIntro, { LIGHTHOUSE_INTRO_LOCAL_STORAGE } from '../Intro';\nimport LighthouseSupportButton from '../SupportButton';\nimport AuditListTable from './AuditListTable';\n\nimport {\n Content,\n ContentHeader,\n Header,\n HeaderLabel,\n InfoCard,\n Page,\n Progress,\n WarningPanel,\n} from '@backstage/core-components';\n\nimport { useApi } from '@backstage/core-plugin-api';\n\n// TODO(freben): move all of this out of index\n\nexport const LIMIT = 10;\n\nconst AuditList = () => {\n const [dismissedStored] = useLocalStorage<boolean>(\n LIGHTHOUSE_INTRO_LOCAL_STORAGE,\n );\n const [dismissed, setDismissed] = useState(dismissedStored);\n\n const query = useQuery();\n const page = query.get('page')\n ? parseInt(query.get('page') as string, 10) || 1\n : 1;\n\n const lighthouseApi = useApi(lighthouseApiRef);\n const { value, loading, error } = useAsync(\n async () =>\n await lighthouseApi.getWebsiteList({\n limit: LIMIT,\n offset: (page - 1) * LIMIT,\n }),\n [page],\n );\n\n const pageCount: number = useMemo(() => {\n if (value?.total && value?.limit)\n return Math.ceil(value?.total / value?.limit);\n return 0;\n }, [value?.total, value?.limit]);\n\n const navigate = useNavigate();\n\n let content: ReactNode = null;\n if (value) {\n content = (\n <>\n <AuditListTable items={value?.items || []} />\n {pageCount > 1 && (\n <Pagination\n page={page}\n count={pageCount}\n onChange={(_event: ChangeEvent<unknown>, newPage: number) => {\n navigate(`?page=${newPage}`);\n }}\n />\n )}\n </>\n );\n } else if (loading) {\n content = <Progress />;\n } else if (error) {\n content = (\n <WarningPanel severity=\"error\" title=\"Could not load audit list.\">\n {error.message}\n </WarningPanel>\n );\n }\n\n return (\n <Page themeId=\"tool\">\n <Header\n title=\"Lighthouse\"\n subtitle=\"Website audits powered by Lighthouse\"\n >\n <HeaderLabel label=\"Owner\" value=\"Spotify\" />\n <HeaderLabel label=\"Lifecycle\" value=\"Alpha\" />\n </Header>\n <Content>\n <LighthouseIntro onDismiss={() => setDismissed(true)} />\n <ContentHeader\n title=\"Audits\"\n description=\"View all audits run for your website through Backstage here. Track the trend of your most recent audits.\"\n >\n <Button\n variant=\"contained\"\n color=\"primary\"\n onClick={() => navigate('create-audit')}\n >\n Create Audit\n </Button>\n {dismissed && <LighthouseSupportButton />}\n </ContentHeader>\n <Grid container spacing={3} direction=\"column\">\n <Grid item>\n <InfoCard noPadding>{content}</InfoCard>\n </Grid>\n </Grid>\n </Content>\n </Page>\n );\n};\n\nexport default AuditList;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AA4CO,MAAM,
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../../../src/components/AuditList/index.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Button from '@material-ui/core/Button';\nimport Grid from '@material-ui/core/Grid';\nimport Pagination from '@material-ui/lab/Pagination';\nimport { ChangeEvent, ReactNode, useMemo, useState } from 'react';\nimport { useNavigate } from 'react-router-dom';\nimport useAsync from 'react-use/esm/useAsync';\nimport useLocalStorage from 'react-use/esm/useLocalStorage';\nimport { lighthouseApiRef } from '../../api';\nimport { useQuery } from '../../utils';\nimport LighthouseIntro, { LIGHTHOUSE_INTRO_LOCAL_STORAGE } from '../Intro';\nimport LighthouseSupportButton from '../SupportButton';\nimport AuditListTable from './AuditListTable';\n\nimport {\n Content,\n ContentHeader,\n Header,\n HeaderLabel,\n InfoCard,\n Page,\n Progress,\n WarningPanel,\n} from '@backstage/core-components';\n\nimport { useApi } from '@backstage/core-plugin-api';\n\n// TODO(freben): move all of this out of index\n\nexport const LIMIT = 10;\n\nconst AuditList = () => {\n const [dismissedStored] = useLocalStorage<boolean>(\n LIGHTHOUSE_INTRO_LOCAL_STORAGE,\n );\n const [dismissed, setDismissed] = useState(dismissedStored);\n\n const query = useQuery();\n const page = query.get('page')\n ? parseInt(query.get('page') as string, 10) || 1\n : 1;\n\n const lighthouseApi = useApi(lighthouseApiRef);\n const { value, loading, error } = useAsync(\n async () =>\n await lighthouseApi.getWebsiteList({\n limit: LIMIT,\n offset: (page - 1) * LIMIT,\n }),\n [page],\n );\n\n const pageCount: number = useMemo(() => {\n if (value?.total && value?.limit)\n return Math.ceil(value?.total / value?.limit);\n return 0;\n }, [value?.total, value?.limit]);\n\n const navigate = useNavigate();\n\n let content: ReactNode = null;\n if (value) {\n content = (\n <>\n <AuditListTable items={value?.items || []} />\n {pageCount > 1 && (\n <Pagination\n page={page}\n count={pageCount}\n onChange={(_event: ChangeEvent<unknown>, newPage: number) => {\n navigate(`?page=${newPage}`);\n }}\n />\n )}\n </>\n );\n } else if (loading) {\n content = <Progress />;\n } else if (error) {\n content = (\n <WarningPanel severity=\"error\" title=\"Could not load audit list.\">\n {error.message}\n </WarningPanel>\n );\n }\n\n return (\n <Page themeId=\"tool\">\n <Header\n title=\"Lighthouse\"\n subtitle=\"Website audits powered by Lighthouse\"\n >\n <HeaderLabel label=\"Owner\" value=\"Spotify\" />\n <HeaderLabel label=\"Lifecycle\" value=\"Alpha\" />\n </Header>\n <Content>\n <LighthouseIntro onDismiss={() => setDismissed(true)} />\n <ContentHeader\n title=\"Audits\"\n description=\"View all audits run for your website through Backstage here. Track the trend of your most recent audits.\"\n >\n <Button\n variant=\"contained\"\n color=\"primary\"\n onClick={() => navigate('create-audit')}\n >\n Create Audit\n </Button>\n {dismissed && <LighthouseSupportButton />}\n </ContentHeader>\n <Grid container spacing={3} direction=\"column\">\n <Grid item>\n <InfoCard noPadding>{content}</InfoCard>\n </Grid>\n </Grid>\n </Content>\n </Page>\n );\n};\n\nexport default AuditList;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AA4CO,MAAM,KAAA,GAAQ;AAErB,MAAM,YAAY,MAAM;AACtB,EAAA,MAAM,CAAC,eAAe,CAAA,GAAI,eAAA;AAAA,IACxB;AAAA,GACF;AACA,EAAA,MAAM,CAAC,SAAA,EAAW,YAAY,CAAA,GAAI,SAAS,eAAe,CAAA;AAE1D,EAAA,MAAM,QAAQ,QAAA,EAAS;AACvB,EAAA,MAAM,IAAA,GAAO,KAAA,CAAM,GAAA,CAAI,MAAM,CAAA,GACzB,QAAA,CAAS,KAAA,CAAM,GAAA,CAAI,MAAM,CAAA,EAAa,EAAE,CAAA,IAAK,CAAA,GAC7C,CAAA;AAEJ,EAAA,MAAM,aAAA,GAAgB,OAAO,gBAAgB,CAAA;AAC7C,EAAA,MAAM,EAAE,KAAA,EAAO,OAAA,EAAS,KAAA,EAAM,GAAI,QAAA;AAAA,IAChC,YACE,MAAM,aAAA,CAAc,cAAA,CAAe;AAAA,MACjC,KAAA,EAAO,KAAA;AAAA,MACP,MAAA,EAAA,CAAS,OAAO,CAAA,IAAK;AAAA,KACtB,CAAA;AAAA,IACH,CAAC,IAAI;AAAA,GACP;AAEA,EAAA,MAAM,SAAA,GAAoB,QAAQ,MAAM;AACtC,IAAA,IAAI,KAAA,EAAO,SAAS,KAAA,EAAO,KAAA;AACzB,MAAA,OAAO,IAAA,CAAK,IAAA,CAAK,KAAA,EAAO,KAAA,GAAQ,OAAO,KAAK,CAAA;AAC9C,IAAA,OAAO,CAAA;AAAA,EACT,GAAG,CAAC,KAAA,EAAO,KAAA,EAAO,KAAA,EAAO,KAAK,CAAC,CAAA;AAE/B,E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ACC,QAAA,EAAA;AAAA,sBAAA,GAAA,CAAC,eAAA,EAAA,EAAgB,SAAA,EAAW,MAAM,YAAA,CAAa,IAAI,CAAA,EAAG,CAAA;AAAA,sBACtD,IAAA;AAAA,QAAC,aAAA;AAAA,QAAA;AAAA,UACC,KAAA,EAAM,QAAA;AAAA,UACN,WAAA,EAAY,0GAAA;AAAA,UAEZ,QAAA,EAAA;AAAA,4BAAA,GAAA;AAAA,cAAC,MAAA;AAAA,cAAA;AAAA,gBACC,OAAA,EAAQ,WAAA;AAAA,gBACR,KAAA,EAAM,SAAA;AAAA,gBACN,OAAA,EAAS,MAAM,QAAA,CAAS,cAAc,CAAA;AAAA,gBACvC,QAAA,EAAA;AAAA;AAAA,aAED;AAAA,YACC,SAAA,wBAAc,uBAAA,EAAA,EAAwB;AAAA;AAAA;AAAA,OACzC;AAAA,0BACC,IAAA,EAAA,EAAK,SAAA,EAAS,MAAC,OAAA,EAAS,CAAA,EAAG,WAAU,QAAA,EACpC,QAAA,kBAAA,GAAA,CAAC,IAAA,EAAA,EAAK,IAAA,EAAI,MACR,QAAA,kBAAA,GAAA,CAAC,QAAA,EAAA,EAAS,WAAS,IAAA,EAAE,QAAA,EAAA,OAAA,EAAQ,GAC/B,CAAA,EACF;AAAA,KAAA,EACF;AAAA,GAAA,EACF,CAAA;AAEJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../../../src/components/AuditStatusIcon/index.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Audit } from '@backstage-community/plugin-lighthouse-common';\nimport {\n StatusError,\n StatusOK,\n StatusPending,\n} from '@backstage/core-components';\n\n// TODO(freben): move all of this out of index\n\nconst AuditStatusIcon = ({ audit }: { audit: Audit }) => {\n if (audit.status === 'FAILED') return <StatusError />;\n if (audit.status === 'COMPLETED') return <StatusOK />;\n return <StatusPending />;\n};\n\nexport default AuditStatusIcon;\n"],"names":[],"mappings":";;;AAyBA,MAAM,
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../../../src/components/AuditStatusIcon/index.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Audit } from '@backstage-community/plugin-lighthouse-common';\nimport {\n StatusError,\n StatusOK,\n StatusPending,\n} from '@backstage/core-components';\n\n// TODO(freben): move all of this out of index\n\nconst AuditStatusIcon = ({ audit }: { audit: Audit }) => {\n if (audit.status === 'FAILED') return <StatusError />;\n if (audit.status === 'COMPLETED') return <StatusOK />;\n return <StatusPending />;\n};\n\nexport default AuditStatusIcon;\n"],"names":[],"mappings":";;;AAyBA,MAAM,eAAA,GAAkB,CAAC,EAAE,KAAA,EAAM,KAAwB;AACvD,EAAA,IAAI,KAAA,CAAM,MAAA,KAAW,QAAA,EAAU,2BAAQ,WAAA,EAAA,EAAY,CAAA;AACnD,EAAA,IAAI,KAAA,CAAM,MAAA,KAAW,WAAA,EAAa,2BAAQ,QAAA,EAAA,EAAS,CAAA;AACnD,EAAA,2BAAQ,aAAA,EAAA,EAAc,CAAA;AACxB;;;;"}
|
|
@@ -14,7 +14,7 @@ import { lighthouseApiRef } from '../../api.esm.js';
|
|
|
14
14
|
import { formatTime } from '../../utils.esm.js';
|
|
15
15
|
import AuditStatusIcon from '../AuditStatusIcon/index.esm.js';
|
|
16
16
|
import LighthouseSupportButton from '../SupportButton/index.esm.js';
|
|
17
|
-
import {
|
|
17
|
+
import { Page, Header, HeaderLabel, Content, ContentHeader, Progress, InfoCard } from '@backstage/core-components';
|
|
18
18
|
import { useApi, useRouteRef } from '@backstage/core-plugin-api';
|
|
19
19
|
import { rootRouteRef } from '../../plugin.esm.js';
|
|
20
20
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../../../src/components/AuditView/index.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Button from '@material-ui/core/Button';\nimport Grid from '@material-ui/core/Grid';\nimport List from '@material-ui/core/List';\nimport ListItem from '@material-ui/core/ListItem';\nimport ListItemIcon from '@material-ui/core/ListItemIcon';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport { makeStyles } from '@material-ui/core/styles';\nimport Alert from '@material-ui/lab/Alert';\nimport { ReactNode, useEffect, useState } from 'react';\nimport {\n generatePath,\n Link,\n resolvePath,\n useNavigate,\n useParams,\n} from 'react-router-dom';\nimport useAsync from 'react-use/esm/useAsync';\nimport { Audit, Website } from '@backstage-community/plugin-lighthouse-common';\nimport { lighthouseApiRef } from '../../api';\nimport { formatTime } from '../../utils';\nimport AuditStatusIcon from '../AuditStatusIcon';\nimport LighthouseSupportButton from '../SupportButton';\n\nimport {\n Content,\n ContentHeader,\n Header,\n HeaderLabel,\n InfoCard,\n Page,\n Progress,\n} from '@backstage/core-components';\nimport { useApi, useRouteRef } from '@backstage/core-plugin-api';\nimport { rootRouteRef } from '../../plugin';\n\n// TODO(freben): move all of this out of index\n\nconst useStyles = makeStyles({\n contentGrid: {\n height: '100%',\n },\n iframe: {\n border: '0',\n width: '100%',\n height: '100%',\n },\n errorOutput: { whiteSpace: 'pre' },\n});\n\ninterface AuditLinkListProps {\n audits?: Audit[];\n selectedId: string;\n}\nconst AuditLinkList = ({ audits = [], selectedId }: AuditLinkListProps) => {\n const fromPath = useRouteRef(rootRouteRef)?.() ?? '../';\n return (\n <List\n data-testid=\"audit-sidebar\"\n component=\"nav\"\n aria-label=\"lighthouse audit history\"\n >\n {audits.map(audit => (\n <ListItem\n key={audit.id}\n selected={audit.id === selectedId}\n button\n component={Link}\n replace\n to={resolvePath(\n generatePath('audit/:id', { id: audit.id }),\n fromPath,\n )}\n >\n <ListItemIcon>\n <AuditStatusIcon audit={audit} />\n </ListItemIcon>\n <ListItemText primary={formatTime(audit.timeCreated)} />\n </ListItem>\n ))}\n </List>\n );\n};\n\nconst AuditView = ({ audit }: { audit?: Audit }) => {\n const classes = useStyles();\n const params = useParams() as { id: string };\n const { url: lighthouseUrl } = useApi(lighthouseApiRef);\n\n if (audit?.status === 'RUNNING') return <Progress />;\n if (audit?.status === 'FAILED')\n return (\n <Alert severity=\"error\">\n This audit failed when attempting to run after several retries. Check\n that your instance of lighthouse-audit-service can successfully connect\n to your website and try again.\n </Alert>\n );\n\n return (\n <InfoCard variant=\"fullHeight\">\n <iframe\n className={classes.iframe}\n title={`Lighthouse audit${audit?.url ? ` for ${audit.url}` : ''}`}\n src={`${lighthouseUrl}/v1/audits/${encodeURIComponent(params.id)}`}\n />\n </InfoCard>\n );\n};\n\nexport const AuditViewContent = () => {\n const lighthouseApi = useApi(lighthouseApiRef);\n const fromPath = useRouteRef(rootRouteRef)?.() ?? '../';\n const params = useParams() as { id: string };\n const classes = useStyles();\n const navigate = useNavigate();\n\n const {\n loading,\n error,\n value: nextValue,\n } = useAsync(\n async () => await lighthouseApi.getWebsiteForAuditId(params.id),\n [params.id],\n );\n const [value, setValue] = useState<Website>();\n useEffect(() => {\n if (!!nextValue && nextValue.url !== value?.url) {\n setValue(nextValue);\n }\n }, [value, nextValue, setValue]);\n\n let content: ReactNode = null;\n if (value) {\n content = (\n <Grid container alignItems=\"stretch\" className={classes.contentGrid}>\n <Grid item xs={3}>\n <AuditLinkList audits={value?.audits} selectedId={params.id} />\n </Grid>\n <Grid item xs={9}>\n <AuditView audit={value?.audits.find(a => a.id === params.id)} />\n </Grid>\n </Grid>\n );\n } else if (loading) {\n content = <Progress />;\n } else if (error) {\n content = (\n <Alert\n data-testid=\"error-message\"\n severity=\"error\"\n className={classes.errorOutput}\n >\n {error.message}\n </Alert>\n );\n }\n\n let createAuditButtonUrl = 'create-audit';\n if (value?.url) {\n createAuditButtonUrl += `?url=${encodeURIComponent(value.url)}`;\n }\n\n return (\n <>\n <ContentHeader\n title={value?.url || 'Audit'}\n description=\"See a history of all Lighthouse audits for your website run through Backstage.\"\n >\n <Button\n variant=\"contained\"\n color=\"primary\"\n onClick={() => navigate(resolvePath(createAuditButtonUrl, fromPath))}\n >\n Create New Audit\n </Button>\n <LighthouseSupportButton />\n </ContentHeader>\n {content}\n </>\n );\n};\n\nconst ConnectedAuditView = () => (\n <Page themeId=\"tool\">\n <Header title=\"Lighthouse\" subtitle=\"Website audits powered by Lighthouse\">\n <HeaderLabel label=\"Owner\" value=\"Spotify\" />\n <HeaderLabel label=\"Lifecycle\" value=\"Alpha\" />\n </Header>\n <Content stretch>\n <AuditViewContent />\n </Content>\n </Page>\n);\n\nexport default ConnectedAuditView;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAqDA,MAAM,YAAY,UAAW,CAAA;AAAA,EAC3B,WAAa,EAAA;AAAA,IACX,MAAQ,EAAA;AAAA,GACV;AAAA,EACA,MAAQ,EAAA;AAAA,IACN,MAAQ,EAAA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.js","sources":["../../../src/components/AuditView/index.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Button from '@material-ui/core/Button';\nimport Grid from '@material-ui/core/Grid';\nimport List from '@material-ui/core/List';\nimport ListItem from '@material-ui/core/ListItem';\nimport ListItemIcon from '@material-ui/core/ListItemIcon';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport { makeStyles } from '@material-ui/core/styles';\nimport Alert from '@material-ui/lab/Alert';\nimport { ReactNode, useEffect, useState } from 'react';\nimport {\n generatePath,\n Link,\n resolvePath,\n useNavigate,\n useParams,\n} from 'react-router-dom';\nimport useAsync from 'react-use/esm/useAsync';\nimport { Audit, Website } from '@backstage-community/plugin-lighthouse-common';\nimport { lighthouseApiRef } from '../../api';\nimport { formatTime } from '../../utils';\nimport AuditStatusIcon from '../AuditStatusIcon';\nimport LighthouseSupportButton from '../SupportButton';\n\nimport {\n Content,\n ContentHeader,\n Header,\n HeaderLabel,\n InfoCard,\n Page,\n Progress,\n} from '@backstage/core-components';\nimport { useApi, useRouteRef } from '@backstage/core-plugin-api';\nimport { rootRouteRef } from '../../plugin';\n\n// TODO(freben): move all of this out of index\n\nconst useStyles = makeStyles({\n contentGrid: {\n height: '100%',\n },\n iframe: {\n border: '0',\n width: '100%',\n height: '100%',\n },\n errorOutput: { whiteSpace: 'pre' },\n});\n\ninterface AuditLinkListProps {\n audits?: Audit[];\n selectedId: string;\n}\nconst AuditLinkList = ({ audits = [], selectedId }: AuditLinkListProps) => {\n const fromPath = useRouteRef(rootRouteRef)?.() ?? '../';\n return (\n <List\n data-testid=\"audit-sidebar\"\n component=\"nav\"\n aria-label=\"lighthouse audit history\"\n >\n {audits.map(audit => (\n <ListItem\n key={audit.id}\n selected={audit.id === selectedId}\n button\n component={Link}\n replace\n to={resolvePath(\n generatePath('audit/:id', { id: audit.id }),\n fromPath,\n )}\n >\n <ListItemIcon>\n <AuditStatusIcon audit={audit} />\n </ListItemIcon>\n <ListItemText primary={formatTime(audit.timeCreated)} />\n </ListItem>\n ))}\n </List>\n );\n};\n\nconst AuditView = ({ audit }: { audit?: Audit }) => {\n const classes = useStyles();\n const params = useParams() as { id: string };\n const { url: lighthouseUrl } = useApi(lighthouseApiRef);\n\n if (audit?.status === 'RUNNING') return <Progress />;\n if (audit?.status === 'FAILED')\n return (\n <Alert severity=\"error\">\n This audit failed when attempting to run after several retries. Check\n that your instance of lighthouse-audit-service can successfully connect\n to your website and try again.\n </Alert>\n );\n\n return (\n <InfoCard variant=\"fullHeight\">\n <iframe\n className={classes.iframe}\n title={`Lighthouse audit${audit?.url ? ` for ${audit.url}` : ''}`}\n src={`${lighthouseUrl}/v1/audits/${encodeURIComponent(params.id)}`}\n />\n </InfoCard>\n );\n};\n\nexport const AuditViewContent = () => {\n const lighthouseApi = useApi(lighthouseApiRef);\n const fromPath = useRouteRef(rootRouteRef)?.() ?? '../';\n const params = useParams() as { id: string };\n const classes = useStyles();\n const navigate = useNavigate();\n\n const {\n loading,\n error,\n value: nextValue,\n } = useAsync(\n async () => await lighthouseApi.getWebsiteForAuditId(params.id),\n [params.id],\n );\n const [value, setValue] = useState<Website>();\n useEffect(() => {\n if (!!nextValue && nextValue.url !== value?.url) {\n setValue(nextValue);\n }\n }, [value, nextValue, setValue]);\n\n let content: ReactNode = null;\n if (value) {\n content = (\n <Grid container alignItems=\"stretch\" className={classes.contentGrid}>\n <Grid item xs={3}>\n <AuditLinkList audits={value?.audits} selectedId={params.id} />\n </Grid>\n <Grid item xs={9}>\n <AuditView audit={value?.audits.find(a => a.id === params.id)} />\n </Grid>\n </Grid>\n );\n } else if (loading) {\n content = <Progress />;\n } else if (error) {\n content = (\n <Alert\n data-testid=\"error-message\"\n severity=\"error\"\n className={classes.errorOutput}\n >\n {error.message}\n </Alert>\n );\n }\n\n let createAuditButtonUrl = 'create-audit';\n if (value?.url) {\n createAuditButtonUrl += `?url=${encodeURIComponent(value.url)}`;\n }\n\n return (\n <>\n <ContentHeader\n title={value?.url || 'Audit'}\n description=\"See a history of all Lighthouse audits for your website run through Backstage.\"\n >\n <Button\n variant=\"contained\"\n color=\"primary\"\n onClick={() => navigate(resolvePath(createAuditButtonUrl, fromPath))}\n >\n Create New Audit\n </Button>\n <LighthouseSupportButton />\n </ContentHeader>\n {content}\n </>\n );\n};\n\nconst ConnectedAuditView = () => (\n <Page themeId=\"tool\">\n <Header title=\"Lighthouse\" subtitle=\"Website audits powered by Lighthouse\">\n <HeaderLabel label=\"Owner\" value=\"Spotify\" />\n <HeaderLabel label=\"Lifecycle\" value=\"Alpha\" />\n </Header>\n <Content stretch>\n <AuditViewContent />\n </Content>\n </Page>\n);\n\nexport default ConnectedAuditView;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAqDA,MAAM,YAAY,UAAA,CAAW;AAAA,EAC3B,WAAA,EAAa;AAAA,IACX,MAAA,EAAQ;AAAA,GACV;AAAA,EACA,MAAA,EAAQ;AAAA,IACN,MAAA,EAAQ,GAAA;AAAA,IACR,KAAA,EAAO,MAAA;AAAA,IACP,MAAA,EAAQ;AAAA,GACV;AAAA,EACA,WAAA,EAAa,EAAE,UAAA,EAAY,KAAA;AAC7B,CAAC,CAAA;AAMD,MAAM,gBAAgB,CAAC,EAAE,SAAS,EAAC,EAAG,YAAW,KAA0B;AACzE,EAAA,MAAM,QAAA,GAAW,WAAA,CAAY,YAAY,CAAA,IAAI,IAAK,KAAA;AAClD,EAAA,uBACE,GAAA;AAAA,IAAC,IAAA;AAAA,IAAA;AAAA,MACC,aAAA,EAAY,eAAA;AAAA,MACZ,SAAA,EAAU,K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BAAA,GAAA;AAAA,YAAC,MAAA;AAAA,YAAA;AAAA,cACC,OAAA,EAAQ,WAAA;AAAA,cACR,KAAA,EAAM,SAAA;AAAA,cACN,SAAS,MAAM,QAAA,CAAS,WAAA,CAAY,oBAAA,EAAsB,QAAQ,CAAC,CAAA;AAAA,cACpE,QAAA,EAAA;AAAA;AAAA,WAED;AAAA,8BACC,uBAAA,EAAA,EAAwB;AAAA;AAAA;AAAA,KAC3B;AAAA,IACC;AAAA,GAAA,EACH,CAAA;AAEJ;AAEA,MAAM,kBAAA,GAAqB,sBACzB,IAAA,CAAC,IAAA,EAAA,EAAK,SAAQ,MAAA,EACZ,QAAA,EAAA;AAAA,kBAAA,IAAA,CAAC,MAAA,EAAA,EAAO,KAAA,EAAM,YAAA,EAAa,QAAA,EAAS,sCAAA,EAClC,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,WAAA,EAAA,EAAY,KAAA,EAAM,OAAA,EAAQ,KAAA,EAAM,SAAA,EAAU,CAAA;AAAA,oBAC3C,GAAA,CAAC,WAAA,EAAA,EAAY,KAAA,EAAM,WAAA,EAAY,OAAM,OAAA,EAAQ;AAAA,GAAA,EAC/C,CAAA;AAAA,sBACC,OAAA,EAAA,EAAQ,OAAA,EAAO,IAAA,EACd,QAAA,kBAAA,GAAA,CAAC,oBAAiB,CAAA,EACpB;AAAA,CAAA,EACF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LastLighthouseAuditCard.esm.js","sources":["../../../src/components/Cards/LastLighthouseAuditCard.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport type { ReactNode } from 'react';\nimport Typography from '@material-ui/core/Typography';\nimport {\n Audit,\n AuditCompleted,\n LighthouseCategoryId,\n} from '@backstage-community/plugin-lighthouse-common';\nimport { useWebsiteForEntity } from '../../hooks/useWebsiteForEntity';\nimport AuditStatusIcon from '../AuditStatusIcon';\nimport {\n EmptyState,\n InfoCard,\n InfoCardVariants,\n Progress,\n StatusError,\n StatusOK,\n StatusWarning,\n StructuredMetadataTable,\n WarningPanel,\n} from '@backstage/core-components';\n\nconst LighthouseCategoryScoreStatus = (props: { score: number }) => {\n const scoreAsPercentage = Math.round(props.score * 100);\n switch (true) {\n case scoreAsPercentage >= 90:\n return (\n <>\n <StatusOK />\n {scoreAsPercentage}%\n </>\n );\n case scoreAsPercentage >= 50 && scoreAsPercentage < 90:\n return (\n <>\n <StatusWarning />\n {scoreAsPercentage}%\n </>\n );\n case scoreAsPercentage < 50:\n return (\n <>\n <StatusError />\n {scoreAsPercentage}%\n </>\n );\n default:\n return <Typography component=\"span\">N/A</Typography>;\n }\n};\n\nconst LighthouseAuditStatus = (props: { audit: Audit }) => (\n <>\n <AuditStatusIcon audit={props.audit} />\n {props.audit.status.toLocaleUpperCase('en-US')}\n </>\n);\n\nconst LighthouseAuditSummary = (props: { audit: Audit; dense?: boolean }) => {\n const { audit, dense = false } = props;\n const { url } = audit;\n const flattenedCategoryData: Record<string, ReactNode> = {};\n if (audit.status === 'COMPLETED') {\n const categories = (audit as AuditCompleted).categories;\n const categoryIds = Object.keys(categories) as LighthouseCategoryId[];\n categoryIds.forEach((id: LighthouseCategoryId) => {\n const { title, score } = categories[id];\n\n flattenedCategoryData[title] = (\n <LighthouseCategoryScoreStatus score={score} />\n );\n });\n }\n const tableData = {\n url,\n status: <LighthouseAuditStatus audit={audit} />,\n ...flattenedCategoryData,\n };\n\n return <StructuredMetadataTable metadata={tableData} dense={dense} />;\n};\n\n/** @public */\nexport const LastLighthouseAuditCard = (props: {\n dense?: boolean;\n variant?: InfoCardVariants;\n}) => {\n const { dense = false, variant } = props;\n const { value: website, loading, error } = useWebsiteForEntity();\n\n let content;\n if (loading) {\n content = <Progress />;\n }\n if (error) {\n // We only want to display this warning panel when its caused by an error other than no audits being found for the website\n content = error.message.includes('no audited website found for url') ? (\n <EmptyState title=\"No Audits Found\" missing=\"data\" />\n ) : (\n <WarningPanel severity=\"error\" title=\"Could not load audit list.\">\n {error.message}\n </WarningPanel>\n );\n }\n if (website) {\n content = (\n <LighthouseAuditSummary audit={website.lastAudit} dense={dense} />\n );\n }\n return (\n <InfoCard title=\"Lighthouse Audit\" variant={variant}>\n {content}\n </InfoCard>\n );\n};\n"],"names":[],"mappings":";;;;;;AAoCA,MAAM,6BAAA,GAAgC,CAAC,KAA6B
|
|
1
|
+
{"version":3,"file":"LastLighthouseAuditCard.esm.js","sources":["../../../src/components/Cards/LastLighthouseAuditCard.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport type { ReactNode } from 'react';\nimport Typography from '@material-ui/core/Typography';\nimport {\n Audit,\n AuditCompleted,\n LighthouseCategoryId,\n} from '@backstage-community/plugin-lighthouse-common';\nimport { useWebsiteForEntity } from '../../hooks/useWebsiteForEntity';\nimport AuditStatusIcon from '../AuditStatusIcon';\nimport {\n EmptyState,\n InfoCard,\n InfoCardVariants,\n Progress,\n StatusError,\n StatusOK,\n StatusWarning,\n StructuredMetadataTable,\n WarningPanel,\n} from '@backstage/core-components';\n\nconst LighthouseCategoryScoreStatus = (props: { score: number }) => {\n const scoreAsPercentage = Math.round(props.score * 100);\n switch (true) {\n case scoreAsPercentage >= 90:\n return (\n <>\n <StatusOK />\n {scoreAsPercentage}%\n </>\n );\n case scoreAsPercentage >= 50 && scoreAsPercentage < 90:\n return (\n <>\n <StatusWarning />\n {scoreAsPercentage}%\n </>\n );\n case scoreAsPercentage < 50:\n return (\n <>\n <StatusError />\n {scoreAsPercentage}%\n </>\n );\n default:\n return <Typography component=\"span\">N/A</Typography>;\n }\n};\n\nconst LighthouseAuditStatus = (props: { audit: Audit }) => (\n <>\n <AuditStatusIcon audit={props.audit} />\n {props.audit.status.toLocaleUpperCase('en-US')}\n </>\n);\n\nconst LighthouseAuditSummary = (props: { audit: Audit; dense?: boolean }) => {\n const { audit, dense = false } = props;\n const { url } = audit;\n const flattenedCategoryData: Record<string, ReactNode> = {};\n if (audit.status === 'COMPLETED') {\n const categories = (audit as AuditCompleted).categories;\n const categoryIds = Object.keys(categories) as LighthouseCategoryId[];\n categoryIds.forEach((id: LighthouseCategoryId) => {\n const { title, score } = categories[id];\n\n flattenedCategoryData[title] = (\n <LighthouseCategoryScoreStatus score={score} />\n );\n });\n }\n const tableData = {\n url,\n status: <LighthouseAuditStatus audit={audit} />,\n ...flattenedCategoryData,\n };\n\n return <StructuredMetadataTable metadata={tableData} dense={dense} />;\n};\n\n/** @public */\nexport const LastLighthouseAuditCard = (props: {\n dense?: boolean;\n variant?: InfoCardVariants;\n}) => {\n const { dense = false, variant } = props;\n const { value: website, loading, error } = useWebsiteForEntity();\n\n let content;\n if (loading) {\n content = <Progress />;\n }\n if (error) {\n // We only want to display this warning panel when its caused by an error other than no audits being found for the website\n content = error.message.includes('no audited website found for url') ? (\n <EmptyState title=\"No Audits Found\" missing=\"data\" />\n ) : (\n <WarningPanel severity=\"error\" title=\"Could not load audit list.\">\n {error.message}\n </WarningPanel>\n );\n }\n if (website) {\n content = (\n <LighthouseAuditSummary audit={website.lastAudit} dense={dense} />\n );\n }\n return (\n <InfoCard title=\"Lighthouse Audit\" variant={variant}>\n {content}\n </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O;AAET,IAAA,OAAA,GAAU,MAAM,OAAA,CAAQ,QAAA,CAAS,kCAAkC,CAAA,mBACjE,GAAA,CAAC,cAAW,KAAA,EAAM,iBAAA,EAAkB,SAAQ,MAAA,EAAO,CAAA,uBAElD,YAAA,EAAA,EAAa,QAAA,EAAS,SAAQ,KAAA,EAAM,4BAAA,EAClC,gBAAM,OAAA,EACT,CAAA;AAAA,EAEJ;AACA,EAAA,IAAI,OAAA,EAAS;AACX,IAAA,OAAA,mBACE,GAAA,CAAC,sBAAA,EAAA,EAAuB,KAAA,EAAO,OAAA,CAAQ,WAAW,KAAA,EAAc,CAAA;AAAA,EAEpE;AACA,EAAA,uBACE,GAAA,CAAC,QAAA,EAAA,EAAS,KAAA,EAAM,kBAAA,EAAmB,SAChC,QAAA,EAAA,OAAA,EACH,CAAA;AAEJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs,
|
|
1
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import Button from '@material-ui/core/Button';
|
|
3
3
|
import Grid from '@material-ui/core/Grid';
|
|
4
4
|
import List from '@material-ui/core/List';
|
|
@@ -11,7 +11,7 @@ import { useNavigate } from 'react-router-dom';
|
|
|
11
11
|
import { lighthouseApiRef } from '../../api.esm.js';
|
|
12
12
|
import { useQuery } from '../../utils.esm.js';
|
|
13
13
|
import LighthouseSupportButton from '../SupportButton/index.esm.js';
|
|
14
|
-
import {
|
|
14
|
+
import { Page, Header, HeaderLabel, Content, ContentHeader, InfoCard } from '@backstage/core-components';
|
|
15
15
|
import { useApi, errorApiRef } from '@backstage/core-plugin-api';
|
|
16
16
|
|
|
17
17
|
const useStyles = makeStyles((theme) => ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../../../src/components/CreateAudit/index.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Button from '@material-ui/core/Button';\nimport Grid from '@material-ui/core/Grid';\nimport List from '@material-ui/core/List';\nimport ListItem from '@material-ui/core/ListItem';\nimport MenuItem from '@material-ui/core/MenuItem';\nimport TextField from '@material-ui/core/TextField';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { useCallback, useState } from 'react';\nimport { useNavigate } from 'react-router-dom';\nimport {\n FormFactor,\n LighthouseConfigSettings,\n} from '@backstage-community/plugin-lighthouse-common';\nimport { lighthouseApiRef } from '../../api';\nimport { useQuery } from '../../utils';\nimport LighthouseSupportButton from '../SupportButton';\n\nimport {\n Content,\n ContentHeader,\n Header,\n HeaderLabel,\n InfoCard,\n Page,\n} from '@backstage/core-components';\nimport { errorApiRef, useApi } from '@backstage/core-plugin-api';\n\n// TODO(freben): move all of this out of index\n\nconst useStyles = makeStyles(theme => ({\n input: {\n minWidth: 300,\n [theme.breakpoints.down('xs')]: {\n minWidth: '100%',\n },\n },\n buttonList: {\n marginLeft: theme.spacing(-1),\n marginRight: theme.spacing(-1),\n '& > *': {\n margin: theme.spacing(1),\n },\n [theme.breakpoints.down('xs')]: {\n marginLeft: 0,\n marginRight: 0,\n flexDirection: 'column',\n '& > *': {\n width: '100%',\n },\n },\n },\n}));\n\nconst formFactorToScreenEmulationMap: Record<\n FormFactor,\n LighthouseConfigSettings['screenEmulation']\n> = {\n // the default is mobile, so no need to override\n mobile: undefined,\n // Values from lighthouse's cli \"desktop\" preset\n // https://github.com/GoogleChrome/lighthouse/blob/a6738e0033e7e5ca308b97c1c36f298b7d399402/lighthouse-core/config/constants.js#L71-L77\n desktop: {\n mobile: false,\n width: 1350,\n height: 940,\n deviceScaleFactor: 1,\n disabled: false,\n },\n};\n\nexport const CreateAuditContent = () => {\n const errorApi = useApi(errorApiRef);\n const lighthouseApi = useApi(lighthouseApiRef);\n const classes = useStyles();\n const query = useQuery();\n const navigate = useNavigate();\n const [submitting, setSubmitting] = useState(false);\n const [url, setUrl] = useState<string>(query.get('url') || '');\n const [formFactor, setFormFactor] = useState<FormFactor>('mobile');\n\n const triggerAudit = useCallback(async (): Promise<void> => {\n setSubmitting(true);\n try {\n // TODO use the id from the response to redirect to the audit page for that id when\n // FAILED and RUNNING audits are supported\n await lighthouseApi.triggerAudit({\n url: url.replace(/\\/$/, ''),\n options: {\n lighthouseConfig: {\n settings: {\n formFactor,\n emulatedFormFactor: formFactor,\n screenEmulation: formFactorToScreenEmulationMap[formFactor],\n },\n },\n },\n });\n navigate('..');\n } catch (err) {\n errorApi.post(err);\n } finally {\n setSubmitting(false);\n }\n }, [url, formFactor, lighthouseApi, setSubmitting, errorApi, navigate]);\n\n return (\n <>\n <ContentHeader\n title=\"Trigger a new audit\"\n description=\"Submitting this form will immediately trigger and store a new Lighthouse audit. Trigger audits to track your website's accessibility, performance, SEO, and best practices over time.\"\n >\n <LighthouseSupportButton />\n </ContentHeader>\n <Grid container direction=\"column\">\n <Grid item xs={12} sm={6}>\n <InfoCard>\n <form\n onSubmit={ev => {\n ev.preventDefault();\n triggerAudit();\n }}\n >\n <List>\n <ListItem>\n <TextField\n name=\"lighthouse-create-audit-url-tf\"\n className={classes.input}\n label=\"URL\"\n placeholder=\"https://spotify.com\"\n helperText=\"The target URL for Lighthouse to use.\"\n required\n disabled={submitting}\n onChange={ev => setUrl(ev.target.value)}\n value={url}\n inputProps={{ 'aria-label': 'URL' }}\n />\n </ListItem>\n <ListItem>\n <TextField\n name=\"lighthouse-create-audit-emulated-form-factor-tf\"\n className={classes.input}\n label=\"Emulated Form Factor\"\n helperText=\"Device to simulate when auditing\"\n select\n required\n disabled={submitting}\n onChange={ev =>\n setFormFactor(ev.target.value as FormFactor)\n }\n value={formFactor}\n inputProps={{ 'aria-label': 'Emulated form factor' }}\n >\n <MenuItem value=\"mobile\">Mobile</MenuItem>\n <MenuItem value=\"desktop\">Desktop</MenuItem>\n </TextField>\n </ListItem>\n <ListItem className={classes.buttonList}>\n <Button\n variant=\"outlined\"\n color=\"primary\"\n onClick={() => navigate('..')}\n disabled={submitting}\n >\n Cancel\n </Button>\n <Button\n variant=\"contained\"\n color=\"primary\"\n type=\"submit\"\n disabled={submitting}\n >\n Create Audit\n </Button>\n </ListItem>\n </List>\n </form>\n </InfoCard>\n </Grid>\n </Grid>\n </>\n );\n};\n\nconst CreateAudit = () => (\n <Page themeId=\"tool\">\n <Header title=\"Lighthouse\" subtitle=\"Website audits powered by Lighthouse\">\n <HeaderLabel label=\"Owner\" value=\"Spotify\" />\n <HeaderLabel label=\"Lifecycle\" value=\"Alpha\" />\n </Header>\n <Content>\n <CreateAuditContent />\n </Content>\n </Page>\n);\n\nexport default CreateAudit;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AA6CA,MAAM,SAAA,GAAY,WAAW,CAAU,KAAA,MAAA;AAAA,EACrC,KAAO,EAAA;AAAA,IACL,QAAU,EAAA,GAAA;AAAA,IACV,CAAC,KAAM,CAAA,WAAA,CAAY,IAAK,CAAA,IAAI,CAAC,GAAG;AAAA,MAC9B,QAAU,EAAA;AAAA;AACZ,GACF;AAAA,EACA,UAAY,EAAA;AAAA,IACV,UAAA,EAAY,KAAM,CAAA,OAAA,CAAQ,CAAE,CAAA,CAAA;AAAA,IAC5B,WAAA,EAAa,KAAM,CAAA,OAAA,CAAQ,CAAE,CAAA,CAAA;AAAA,IAC7B,OAAS,EAAA;AAAA,MACP,MAAA,EAAQ,KAAM,CAA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,MAAA;AAAA,cAAA;AAAA,gBACC,OAAQ,EAAA,UAAA;AAAA,gBACR,KAAM,EAAA,SAAA;AAAA,gBACN,OAAA,EAAS,MAAM,QAAA,CAAS,IAAI,CAAA;AAAA,gBAC5B,QAAU,EAAA,UAAA;AAAA,gBACX,QAAA,EAAA;AAAA;AAAA,aAED;AAAA,4BACA,GAAA;AAAA,cAAC,MAAA;AAAA,cAAA;AAAA,gBACC,OAAQ,EAAA,WAAA;AAAA,gBACR,KAAM,EAAA,SAAA;AAAA,gBACN,IAAK,EAAA,QAAA;AAAA,gBACL,QAAU,EAAA,UAAA;AAAA,gBACX,QAAA,EAAA;AAAA;AAAA;AAED,WACF,EAAA;AAAA,SACF,EAAA;AAAA;AAAA,KACF,EACF,GACF,CACF,EAAA;AAAA,GACF,EAAA,CAAA;AAEJ;AAEA,MAAM,WAAc,GAAA,sBACjB,IAAA,CAAA,IAAA,EAAA,EAAK,SAAQ,MACZ,EAAA,QAAA,EAAA;AAAA,kBAAA,IAAA,CAAC,MAAO,EAAA,EAAA,KAAA,EAAM,YAAa,EAAA,QAAA,EAAS,sCAClC,EAAA,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,WAAY,EAAA,EAAA,KAAA,EAAM,OAAQ,EAAA,KAAA,EAAM,SAAU,EAAA,CAAA;AAAA,oBAC1C,GAAA,CAAA,WAAA,EAAA,EAAY,KAAM,EAAA,WAAA,EAAY,OAAM,OAAQ,EAAA;AAAA,GAC/C,EAAA,CAAA;AAAA,kBACC,GAAA,CAAA,OAAA,EAAA,EACC,QAAC,kBAAA,GAAA,CAAA,kBAAA,EAAA,EAAmB,CACtB,EAAA;AAAA,CACF,EAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../../../src/components/CreateAudit/index.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Button from '@material-ui/core/Button';\nimport Grid from '@material-ui/core/Grid';\nimport List from '@material-ui/core/List';\nimport ListItem from '@material-ui/core/ListItem';\nimport MenuItem from '@material-ui/core/MenuItem';\nimport TextField from '@material-ui/core/TextField';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { useCallback, useState } from 'react';\nimport { useNavigate } from 'react-router-dom';\nimport {\n FormFactor,\n LighthouseConfigSettings,\n} from '@backstage-community/plugin-lighthouse-common';\nimport { lighthouseApiRef } from '../../api';\nimport { useQuery } from '../../utils';\nimport LighthouseSupportButton from '../SupportButton';\n\nimport {\n Content,\n ContentHeader,\n Header,\n HeaderLabel,\n InfoCard,\n Page,\n} from '@backstage/core-components';\nimport { errorApiRef, useApi } from '@backstage/core-plugin-api';\n\n// TODO(freben): move all of this out of index\n\nconst useStyles = makeStyles(theme => ({\n input: {\n minWidth: 300,\n [theme.breakpoints.down('xs')]: {\n minWidth: '100%',\n },\n },\n buttonList: {\n marginLeft: theme.spacing(-1),\n marginRight: theme.spacing(-1),\n '& > *': {\n margin: theme.spacing(1),\n },\n [theme.breakpoints.down('xs')]: {\n marginLeft: 0,\n marginRight: 0,\n flexDirection: 'column',\n '& > *': {\n width: '100%',\n },\n },\n },\n}));\n\nconst formFactorToScreenEmulationMap: Record<\n FormFactor,\n LighthouseConfigSettings['screenEmulation']\n> = {\n // the default is mobile, so no need to override\n mobile: undefined,\n // Values from lighthouse's cli \"desktop\" preset\n // https://github.com/GoogleChrome/lighthouse/blob/a6738e0033e7e5ca308b97c1c36f298b7d399402/lighthouse-core/config/constants.js#L71-L77\n desktop: {\n mobile: false,\n width: 1350,\n height: 940,\n deviceScaleFactor: 1,\n disabled: false,\n },\n};\n\nexport const CreateAuditContent = () => {\n const errorApi = useApi(errorApiRef);\n const lighthouseApi = useApi(lighthouseApiRef);\n const classes = useStyles();\n const query = useQuery();\n const navigate = useNavigate();\n const [submitting, setSubmitting] = useState(false);\n const [url, setUrl] = useState<string>(query.get('url') || '');\n const [formFactor, setFormFactor] = useState<FormFactor>('mobile');\n\n const triggerAudit = useCallback(async (): Promise<void> => {\n setSubmitting(true);\n try {\n // TODO use the id from the response to redirect to the audit page for that id when\n // FAILED and RUNNING audits are supported\n await lighthouseApi.triggerAudit({\n url: url.replace(/\\/$/, ''),\n options: {\n lighthouseConfig: {\n settings: {\n formFactor,\n emulatedFormFactor: formFactor,\n screenEmulation: formFactorToScreenEmulationMap[formFactor],\n },\n },\n },\n });\n navigate('..');\n } catch (err) {\n errorApi.post(err);\n } finally {\n setSubmitting(false);\n }\n }, [url, formFactor, lighthouseApi, setSubmitting, errorApi, navigate]);\n\n return (\n <>\n <ContentHeader\n title=\"Trigger a new audit\"\n description=\"Submitting this form will immediately trigger and store a new Lighthouse audit. Trigger audits to track your website's accessibility, performance, SEO, and best practices over time.\"\n >\n <LighthouseSupportButton />\n </ContentHeader>\n <Grid container direction=\"column\">\n <Grid item xs={12} sm={6}>\n <InfoCard>\n <form\n onSubmit={ev => {\n ev.preventDefault();\n triggerAudit();\n }}\n >\n <List>\n <ListItem>\n <TextField\n name=\"lighthouse-create-audit-url-tf\"\n className={classes.input}\n label=\"URL\"\n placeholder=\"https://spotify.com\"\n helperText=\"The target URL for Lighthouse to use.\"\n required\n disabled={submitting}\n onChange={ev => setUrl(ev.target.value)}\n value={url}\n inputProps={{ 'aria-label': 'URL' }}\n />\n </ListItem>\n <ListItem>\n <TextField\n name=\"lighthouse-create-audit-emulated-form-factor-tf\"\n className={classes.input}\n label=\"Emulated Form Factor\"\n helperText=\"Device to simulate when auditing\"\n select\n required\n disabled={submitting}\n onChange={ev =>\n setFormFactor(ev.target.value as FormFactor)\n }\n value={formFactor}\n inputProps={{ 'aria-label': 'Emulated form factor' }}\n >\n <MenuItem value=\"mobile\">Mobile</MenuItem>\n <MenuItem value=\"desktop\">Desktop</MenuItem>\n </TextField>\n </ListItem>\n <ListItem className={classes.buttonList}>\n <Button\n variant=\"outlined\"\n color=\"primary\"\n onClick={() => navigate('..')}\n disabled={submitting}\n >\n Cancel\n </Button>\n <Button\n variant=\"contained\"\n color=\"primary\"\n type=\"submit\"\n disabled={submitting}\n >\n Create Audit\n </Button>\n </ListItem>\n </List>\n </form>\n </InfoCard>\n </Grid>\n </Grid>\n </>\n );\n};\n\nconst CreateAudit = () => (\n <Page themeId=\"tool\">\n <Header title=\"Lighthouse\" subtitle=\"Website audits powered by Lighthouse\">\n <HeaderLabel label=\"Owner\" value=\"Spotify\" />\n <HeaderLabel label=\"Lifecycle\" value=\"Alpha\" />\n </Header>\n <Content>\n <CreateAuditContent />\n </Content>\n </Page>\n);\n\nexport default CreateAudit;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AA6CA,MAAM,SAAA,GAAY,WAAW,CAAA,KAAA,MAAU;AAAA,EACrC,KAAA,EAAO;AAAA,IACL,QAAA,EAAU,GAAA;AAAA,IACV,CAAC,KAAA,CAAM,WAAA,CAAY,IAAA,CAAK,IAAI,CAAC,GAAG;AAAA,MAC9B,QAAA,EAAU;AAAA;AACZ,GACF;AAAA,EACA,UAAA,EAAY;AAAA,IACV,UAAA,EAAY,KAAA,CAAM,OAAA,CAAQ,EAAE,CAAA;AAAA,IAC5B,WAAA,EAAa,KAAA,CAAM,OAAA,CAAQ,EAAE,CAAA;AAAA,IAC7B,OAAA,EAAS;AAAA,MACP,MAAA,EAAQ,KAAA,CAAM,OAAA,CAAQ,CAAC;AAAA,KACzB;AAAA,IACA,CAAC,KAAA,CAAM,WAAA,CAAY,IAAA,CAAK,IAAI,CAAC,GAAG;AAAA,MAC9B,UAAA,EAAY,CAAA;AAAA,MACZ,WAAA,EAAa,CAAA;AAAA,MACb,aAAA,EAAe,QAAA;AAAA,MACf,OAAA,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AA;AAAA,aAED;AAAA,4BACA,GAAA;AAAA,cAAC,MAAA;AAAA,cAAA;AAAA,gBACC,OAAA,EAAQ,WAAA;AAAA,gBACR,KAAA,EAAM,SAAA;AAAA,gBACN,IAAA,EAAK,QAAA;AAAA,gBACL,QAAA,EAAU,UAAA;AAAA,gBACX,QAAA,EAAA;AAAA;AAAA;AAED,WAAA,EACF;AAAA,SAAA,EACF;AAAA;AAAA,KACF,EACF,GACF,CAAA,EACF;AAAA,GAAA,EACF,CAAA;AAEJ;AAEA,MAAM,WAAA,GAAc,sBAClB,IAAA,CAAC,IAAA,EAAA,EAAK,SAAQ,MAAA,EACZ,QAAA,EAAA;AAAA,kBAAA,IAAA,CAAC,MAAA,EAAA,EAAO,KAAA,EAAM,YAAA,EAAa,QAAA,EAAS,sCAAA,EAClC,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,WAAA,EAAA,EAAY,KAAA,EAAM,OAAA,EAAQ,KAAA,EAAM,SAAA,EAAU,CAAA;AAAA,oBAC3C,GAAA,CAAC,WAAA,EAAA,EAAY,KAAA,EAAM,WAAA,EAAY,OAAM,OAAA,EAAQ;AAAA,GAAA,EAC/C,CAAA;AAAA,kBACA,GAAA,CAAC,OAAA,EAAA,EACC,QAAA,kBAAA,GAAA,CAAC,kBAAA,EAAA,EAAmB,CAAA,EACtB;AAAA,CAAA,EACF;;;;"}
|
|
@@ -8,7 +8,7 @@ import CloseIcon from '@material-ui/icons/Close';
|
|
|
8
8
|
import { useState } from 'react';
|
|
9
9
|
import useLocalStorage from 'react-use/esm/useLocalStorage';
|
|
10
10
|
import LighthouseSupportButton from '../SupportButton/index.esm.js';
|
|
11
|
-
import { ContentHeader, InfoCard,
|
|
11
|
+
import { ContentHeader, InfoCard, MarkdownContent, Link } from '@backstage/core-components';
|
|
12
12
|
|
|
13
13
|
const LIGHTHOUSE_INTRO_LOCAL_STORAGE = "@backstage/lighthouse-plugin/intro-dismissed";
|
|
14
14
|
const USE_CASES = `
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../../../src/components/Intro/index.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Button from '@material-ui/core/Button';\nimport Grid from '@material-ui/core/Grid';\nimport Tab from '@material-ui/core/Tab';\nimport Tabs from '@material-ui/core/Tabs';\nimport { makeStyles } from '@material-ui/core/styles';\nimport CloseIcon from '@material-ui/icons/Close';\nimport { useState } from 'react';\nimport useLocalStorage from 'react-use/esm/useLocalStorage';\nimport LighthouseSupportButton from '../SupportButton';\nimport {\n ContentHeader,\n InfoCard,\n Link,\n MarkdownContent,\n} from '@backstage/core-components';\n\n// TODO(freben): move all of this out of index\n\nexport const LIGHTHOUSE_INTRO_LOCAL_STORAGE =\n '@backstage/lighthouse-plugin/intro-dismissed';\n\nconst USE_CASES = `\nGoogle's [Lighthouse](https://developers.google.com/web/tools/lighthouse) auditing tool for websites\nis a great open-source resource for benchmarking and improving the accessibility, performance, SEO, and best practices of your site.\nAt Spotify, we keep track of Lighthouse audit scores over time to look at trends and overall areas for investment.\n\nThis plugin allows you to generate on-demand Lighthouse audits for websites, and to track the trends for the\ntop-level categories of Lighthouse at a glance.\n\nIn the future, we hope to add support for scheduling audits (which we do internally), as well as allowing\ncustom runs of Lighthouse to be ingested (for auditing sites that require authentication or some session state).\n`;\n\nconst SETUP = `\nTo get started, you will need a running instance of [lighthouse-audit-service](https://github.com/spotify/lighthouse-audit-service).\n_It's likely you will need to enable CORS when running lighthouse-audit-service. Initialize the app\nwith the environment variable \\`LAS_CORS\\` set to \\`true\\`._\n\nWhen you have an instance running that Backstage can hook into, first install the plugin into your app:\n\n\\`\\`\\`sh\n# From your Backstage root directory\nyarn --cwd packages/app add @backstage-community/plugin-lighthouse\n\\`\\`\\`\n\nModify your app routes in \\`App.tsx\\` to include the \\`LighthousePage\\` component exported from the plugin, for example:\n\n\\`\\`\\`tsx\n// At the top imports\nimport { LighthousePage } from '@backstage-community/plugin-lighthouse';\n\n<FlatRoutes>\n // ...\n <Route path=\"/lighthouse\" element={<LighthousePage />} />\n // ...\n</FlatRoutes>;\n\\`\\`\\`\n\nThen configure the \\`lighthouse-audit-service\\` URL in your [\\`app-config.yaml\\`](https://github.com/backstage/backstage/blob/master/app-config.yaml).\n\n\\`\\`\\`yaml\nlighthouse:\n baseUrl: http://your-service-url\n\\`\\`\\`\n`;\n\nconst useStyles = makeStyles(theme => ({\n tabs: { marginBottom: -18 },\n tab: { minWidth: 72, paddingLeft: 1, paddingRight: 1 },\n content: { marginBottom: theme.spacing(2) },\n closeButtonContainer: { height: '100%' },\n closeButtonItem: { paddingBottom: 0 },\n}));\n\nfunction GettingStartedCard() {\n const classes = useStyles();\n const [value, setValue] = useState(0);\n return (\n <InfoCard\n title=\"Get started\"\n subheader={\n <Tabs\n value={value}\n indicatorColor=\"primary\"\n textColor=\"primary\"\n onChange={(_ev, newValue: number) => setValue(newValue)}\n aria-label=\"get started tabs\"\n className={classes.tabs}\n >\n <Tab className={classes.tab} label=\"Use cases\" />\n <Tab className={classes.tab} label=\"Setup\" />\n </Tabs>\n }\n divider\n actions={\n <>\n <Grid container direction=\"row\" justifyContent=\"flex-end\">\n <Grid item>\n <Button\n component={Link}\n to=\"https://github.com/spotify/lighthouse-audit-service\"\n size=\"small\"\n >\n Check out the README\n </Button>\n </Grid>\n </Grid>\n </>\n }\n >\n {value === 0 && <MarkdownContent content={USE_CASES} />}\n {value === 1 && <MarkdownContent content={SETUP} />}\n </InfoCard>\n );\n}\n\nexport interface Props {\n onDismiss?: () => void;\n}\n\nexport default function LighthouseIntro({ onDismiss = () => {} }: Props) {\n const classes = useStyles();\n const [dismissed, setDismissed] = useLocalStorage(\n LIGHTHOUSE_INTRO_LOCAL_STORAGE,\n false,\n );\n\n if (dismissed) return null;\n\n return (\n <>\n <ContentHeader title=\"Welcome to Lighthouse in Backstage!\">\n <LighthouseSupportButton />\n </ContentHeader>\n <Grid className={classes.content} container spacing={3} direction=\"row\">\n <Grid item xs={12} sm={6} md={4}>\n <GettingStartedCard />\n </Grid>\n {/* TODO add link and image for blog post here */}\n {/* <Grid item xs={12} sm={6} md={4}>\n <InfoCard>Blog</InfoCard>\n </Grid> */}\n <Grid item xs={12} sm={6} md={8}>\n <Grid\n container\n justifyContent=\"flex-end\"\n alignItems=\"flex-end\"\n className={classes.closeButtonContainer}\n >\n <Grid item className={classes.closeButtonItem}>\n <Button\n variant=\"text\"\n onClick={() => {\n onDismiss();\n setDismissed(true);\n }}\n >\n <CloseIcon /> Hide intro\n </Button>\n </Grid>\n </Grid>\n </Grid>\n </Grid>\n </>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;AAkCO,MAAM,
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../../../src/components/Intro/index.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Button from '@material-ui/core/Button';\nimport Grid from '@material-ui/core/Grid';\nimport Tab from '@material-ui/core/Tab';\nimport Tabs from '@material-ui/core/Tabs';\nimport { makeStyles } from '@material-ui/core/styles';\nimport CloseIcon from '@material-ui/icons/Close';\nimport { useState } from 'react';\nimport useLocalStorage from 'react-use/esm/useLocalStorage';\nimport LighthouseSupportButton from '../SupportButton';\nimport {\n ContentHeader,\n InfoCard,\n Link,\n MarkdownContent,\n} from '@backstage/core-components';\n\n// TODO(freben): move all of this out of index\n\nexport const LIGHTHOUSE_INTRO_LOCAL_STORAGE =\n '@backstage/lighthouse-plugin/intro-dismissed';\n\nconst USE_CASES = `\nGoogle's [Lighthouse](https://developers.google.com/web/tools/lighthouse) auditing tool for websites\nis a great open-source resource for benchmarking and improving the accessibility, performance, SEO, and best practices of your site.\nAt Spotify, we keep track of Lighthouse audit scores over time to look at trends and overall areas for investment.\n\nThis plugin allows you to generate on-demand Lighthouse audits for websites, and to track the trends for the\ntop-level categories of Lighthouse at a glance.\n\nIn the future, we hope to add support for scheduling audits (which we do internally), as well as allowing\ncustom runs of Lighthouse to be ingested (for auditing sites that require authentication or some session state).\n`;\n\nconst SETUP = `\nTo get started, you will need a running instance of [lighthouse-audit-service](https://github.com/spotify/lighthouse-audit-service).\n_It's likely you will need to enable CORS when running lighthouse-audit-service. Initialize the app\nwith the environment variable \\`LAS_CORS\\` set to \\`true\\`._\n\nWhen you have an instance running that Backstage can hook into, first install the plugin into your app:\n\n\\`\\`\\`sh\n# From your Backstage root directory\nyarn --cwd packages/app add @backstage-community/plugin-lighthouse\n\\`\\`\\`\n\nModify your app routes in \\`App.tsx\\` to include the \\`LighthousePage\\` component exported from the plugin, for example:\n\n\\`\\`\\`tsx\n// At the top imports\nimport { LighthousePage } from '@backstage-community/plugin-lighthouse';\n\n<FlatRoutes>\n // ...\n <Route path=\"/lighthouse\" element={<LighthousePage />} />\n // ...\n</FlatRoutes>;\n\\`\\`\\`\n\nThen configure the \\`lighthouse-audit-service\\` URL in your [\\`app-config.yaml\\`](https://github.com/backstage/backstage/blob/master/app-config.yaml).\n\n\\`\\`\\`yaml\nlighthouse:\n baseUrl: http://your-service-url\n\\`\\`\\`\n`;\n\nconst useStyles = makeStyles(theme => ({\n tabs: { marginBottom: -18 },\n tab: { minWidth: 72, paddingLeft: 1, paddingRight: 1 },\n content: { marginBottom: theme.spacing(2) },\n closeButtonContainer: { height: '100%' },\n closeButtonItem: { paddingBottom: 0 },\n}));\n\nfunction GettingStartedCard() {\n const classes = useStyles();\n const [value, setValue] = useState(0);\n return (\n <InfoCard\n title=\"Get started\"\n subheader={\n <Tabs\n value={value}\n indicatorColor=\"primary\"\n textColor=\"primary\"\n onChange={(_ev, newValue: number) => setValue(newValue)}\n aria-label=\"get started tabs\"\n className={classes.tabs}\n >\n <Tab className={classes.tab} label=\"Use cases\" />\n <Tab className={classes.tab} label=\"Setup\" />\n </Tabs>\n }\n divider\n actions={\n <>\n <Grid container direction=\"row\" justifyContent=\"flex-end\">\n <Grid item>\n <Button\n component={Link}\n to=\"https://github.com/spotify/lighthouse-audit-service\"\n size=\"small\"\n >\n Check out the README\n </Button>\n </Grid>\n </Grid>\n </>\n }\n >\n {value === 0 && <MarkdownContent content={USE_CASES} />}\n {value === 1 && <MarkdownContent content={SETUP} />}\n </InfoCard>\n );\n}\n\nexport interface Props {\n onDismiss?: () => void;\n}\n\nexport default function LighthouseIntro({ onDismiss = () => {} }: Props) {\n const classes = useStyles();\n const [dismissed, setDismissed] = useLocalStorage(\n LIGHTHOUSE_INTRO_LOCAL_STORAGE,\n false,\n );\n\n if (dismissed) return null;\n\n return (\n <>\n <ContentHeader title=\"Welcome to Lighthouse in Backstage!\">\n <LighthouseSupportButton />\n </ContentHeader>\n <Grid className={classes.content} container spacing={3} direction=\"row\">\n <Grid item xs={12} sm={6} md={4}>\n <GettingStartedCard />\n </Grid>\n {/* TODO add link and image for blog post here */}\n {/* <Grid item xs={12} sm={6} md={4}>\n <InfoCard>Blog</InfoCard>\n </Grid> */}\n <Grid item xs={12} sm={6} md={8}>\n <Grid\n container\n justifyContent=\"flex-end\"\n alignItems=\"flex-end\"\n className={classes.closeButtonContainer}\n >\n <Grid item className={classes.closeButtonItem}>\n <Button\n variant=\"text\"\n onClick={() => {\n onDismiss();\n setDismissed(true);\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AAAA;AAAA;AAAA,WACf,EACF;AAAA;AAAA,OACF,EACF;AAAA,KAAA,EACF;AAAA,GAAA,EACF,CAAA;AAEJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../../../src/components/SupportButton/index.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { SupportButton } from '@backstage/core-components';\n\nexport default function LighthouseSupportButton() {\n return (\n <SupportButton>\n Lighthouse audits run for any web domain, stored over time.\n </SupportButton>\n );\n}\n"],"names":[],"mappings":";;;AAiBA,SAAwB,
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../../../src/components/SupportButton/index.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { SupportButton } from '@backstage/core-components';\n\nexport default function LighthouseSupportButton() {\n return (\n <SupportButton>\n Lighthouse audits run for any web domain, stored over time.\n </SupportButton>\n );\n}\n"],"names":[],"mappings":";;;AAiBA,SAAwB,uBAAA,GAA0B;AAChD,EAAA,uBACE,GAAA,CAAC,iBAAc,QAAA,EAAA,6DAAA,EAEf,CAAA;AAEJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.esm.js","sources":["../constants.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport const LIGHTHOUSE_WEBSITE_URL_ANNOTATION = 'lighthouse.com/website-url';\n"],"names":[],"mappings":"AAeO,MAAM,
|
|
1
|
+
{"version":3,"file":"constants.esm.js","sources":["../constants.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport const LIGHTHOUSE_WEBSITE_URL_ANNOTATION = 'lighthouse.com/website-url';\n"],"names":[],"mappings":"AAeO,MAAM,iCAAA,GAAoC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useWebsiteForEntity.esm.js","sources":["../../src/hooks/useWebsiteForEntity.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport useAsync from 'react-use/esm/useAsync';\nimport { LIGHTHOUSE_WEBSITE_URL_ANNOTATION } from '../../constants';\nimport { lighthouseApiRef } from '../api';\nimport { errorApiRef, useApi } from '@backstage/core-plugin-api';\n\n// For the sake of simplicity we assume that an entity has only one website url. This is to avoid encoding a list\n// type in an annotation which is a plain string.\nexport const useWebsiteForEntity = () => {\n const { entity } = useEntity();\n const websiteUrl =\n entity.metadata.annotations?.[LIGHTHOUSE_WEBSITE_URL_ANNOTATION] ?? '';\n const lighthouseApi = useApi(lighthouseApiRef);\n const errorApi = useApi(errorApiRef);\n const response = useAsync(\n () => lighthouseApi.getWebsiteByUrl(websiteUrl),\n [websiteUrl],\n );\n // Do not display error alert if its due to no audits found for a website\n if (\n response.error &&\n !response.error.message.includes('no audited website found for url')\n ) {\n errorApi.post(response.error);\n }\n return response;\n};\n"],"names":[],"mappings":";;;;;;AAuBO,MAAM,sBAAsB,MAAM;AACvC,
|
|
1
|
+
{"version":3,"file":"useWebsiteForEntity.esm.js","sources":["../../src/hooks/useWebsiteForEntity.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport useAsync from 'react-use/esm/useAsync';\nimport { LIGHTHOUSE_WEBSITE_URL_ANNOTATION } from '../../constants';\nimport { lighthouseApiRef } from '../api';\nimport { errorApiRef, useApi } from '@backstage/core-plugin-api';\n\n// For the sake of simplicity we assume that an entity has only one website url. This is to avoid encoding a list\n// type in an annotation which is a plain string.\nexport const useWebsiteForEntity = () => {\n const { entity } = useEntity();\n const websiteUrl =\n entity.metadata.annotations?.[LIGHTHOUSE_WEBSITE_URL_ANNOTATION] ?? '';\n const lighthouseApi = useApi(lighthouseApiRef);\n const errorApi = useApi(errorApiRef);\n const response = useAsync(\n () => lighthouseApi.getWebsiteByUrl(websiteUrl),\n [websiteUrl],\n );\n // Do not display error alert if its due to no audits found for a website\n if (\n response.error &&\n !response.error.message.includes('no audited website found for url')\n ) {\n errorApi.post(response.error);\n }\n return response;\n};\n"],"names":[],"mappings":";;;;;;AAuBO,MAAM,sBAAsB,MAAM;AACvC,EAAA,MAAM,EAAE,MAAA,EAAO,GAAI,SAAA,EAAU;AAC7B,EAAA,MAAM,UAAA,GACJ,MAAA,CAAO,QAAA,CAAS,WAAA,GAAc,iCAAiC,CAAA,IAAK,EAAA;AACtE,EAAA,MAAM,aAAA,GAAgB,OAAO,gBAAgB,CAAA;AAC7C,EAAA,MAAM,QAAA,GAAW,OAAO,WAAW,CAAA;AACnC,EAAA,MAAM,QAAA,GAAW,QAAA;AAAA,IACf,MAAM,aAAA,CAAc,eAAA,CAAgB,UAAU,CAAA;AAAA,IAC9C,CAAC,UAAU;AAAA,GACb;AAEA,EAAA,IACE,QAAA,CAAS,SACT,CAAC,QAAA,CAAS,MAAM,OAAA,CAAQ,QAAA,CAAS,kCAAkC,CAAA,EACnE;AACA,IAAA,QAAA,CAAS,IAAA,CAAK,SAAS,KAAK,CAAA;AAAA,EAC9B;AACA,EAAA,OAAO,QAAA;AACT;;;;"}
|
package/dist/plugin.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.esm.js","sources":["../src/plugin.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { LighthouseRestApi } from '@backstage-community/plugin-lighthouse-common';\nimport { lighthouseApiRef } from './api';\nimport {\n createPlugin,\n createRouteRef,\n createApiFactory,\n configApiRef,\n createRoutableExtension,\n createComponentExtension,\n} from '@backstage/core-plugin-api';\n\nexport const rootRouteRef = createRouteRef({\n id: 'lighthouse',\n});\n\nexport const viewAuditRouteRef = createRouteRef({\n id: 'lighthouse:audit',\n});\n\nexport const createAuditRouteRef = createRouteRef({\n id: 'lighthouse:create-audit',\n});\n\nexport const entityContentRouteRef = createRouteRef({\n id: 'lighthouse:entity-content',\n});\n\n/** @public */\nexport const lighthousePlugin = createPlugin({\n id: 'lighthouse',\n apis: [\n createApiFactory({\n api: lighthouseApiRef,\n deps: { configApi: configApiRef },\n factory: ({ configApi }) => LighthouseRestApi.fromConfig(configApi),\n }),\n ],\n routes: {\n root: createAuditRouteRef,\n entityContent: entityContentRouteRef,\n },\n});\n\n/** @public */\nexport const LighthousePage = lighthousePlugin.provide(\n createRoutableExtension({\n name: 'LighthousePage',\n component: () => import('./Router').then(m => m.Router),\n mountPoint: rootRouteRef,\n }),\n);\n\n/** @public */\nexport const EntityLighthouseContent = lighthousePlugin.provide(\n createRoutableExtension({\n name: 'EntityLighthouseContent',\n component: () => import('./Router').then(m => m.EmbeddedRouter),\n mountPoint: entityContentRouteRef,\n }),\n);\n\n/** @public */\nexport const EntityLastLighthouseAuditCard = lighthousePlugin.provide(\n createComponentExtension({\n name: 'EntityLastLighthouseAuditCard',\n component: {\n lazy: () =>\n import('./components/Cards').then(m => m.LastLighthouseAuditCard),\n },\n }),\n);\n"],"names":[],"mappings":";;;;AA2BO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"plugin.esm.js","sources":["../src/plugin.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { LighthouseRestApi } from '@backstage-community/plugin-lighthouse-common';\nimport { lighthouseApiRef } from './api';\nimport {\n createPlugin,\n createRouteRef,\n createApiFactory,\n configApiRef,\n createRoutableExtension,\n createComponentExtension,\n} from '@backstage/core-plugin-api';\n\nexport const rootRouteRef = createRouteRef({\n id: 'lighthouse',\n});\n\nexport const viewAuditRouteRef = createRouteRef({\n id: 'lighthouse:audit',\n});\n\nexport const createAuditRouteRef = createRouteRef({\n id: 'lighthouse:create-audit',\n});\n\nexport const entityContentRouteRef = createRouteRef({\n id: 'lighthouse:entity-content',\n});\n\n/** @public */\nexport const lighthousePlugin = createPlugin({\n id: 'lighthouse',\n apis: [\n createApiFactory({\n api: lighthouseApiRef,\n deps: { configApi: configApiRef },\n factory: ({ configApi }) => LighthouseRestApi.fromConfig(configApi),\n }),\n ],\n routes: {\n root: createAuditRouteRef,\n entityContent: entityContentRouteRef,\n },\n});\n\n/** @public */\nexport const LighthousePage = lighthousePlugin.provide(\n createRoutableExtension({\n name: 'LighthousePage',\n component: () => import('./Router').then(m => m.Router),\n mountPoint: rootRouteRef,\n }),\n);\n\n/** @public */\nexport const EntityLighthouseContent = lighthousePlugin.provide(\n createRoutableExtension({\n name: 'EntityLighthouseContent',\n component: () => import('./Router').then(m => m.EmbeddedRouter),\n mountPoint: entityContentRouteRef,\n }),\n);\n\n/** @public */\nexport const EntityLastLighthouseAuditCard = lighthousePlugin.provide(\n createComponentExtension({\n name: 'EntityLastLighthouseAuditCard',\n component: {\n lazy: () =>\n import('./components/Cards').then(m => m.LastLighthouseAuditCard),\n },\n }),\n);\n"],"names":[],"mappings":";;;;AA2BO,MAAM,eAAe,cAAA,CAAe;AAAA,EACzC,EAAA,EAAI;AACN,CAAC;AAEgC,cAAA,CAAe;AAAA,EAC9C,EAAA,EAAI;AACN,CAAC;AAEM,MAAM,sBAAsB,cAAA,CAAe;AAAA,EAChD,EAAA,EAAI;AACN,CAAC;AAEM,MAAM,wBAAwB,cAAA,CAAe;AAAA,EAClD,EAAA,EAAI;AACN,CAAC;AAGM,MAAM,mBAAmB,YAAA,CAAa;AAAA,EAC3C,EAAA,EAAI,YAAA;AAAA,EACJ,IAAA,EAAM;AAAA,IACJ,gBAAA,CAAiB;AAAA,MACf,GAAA,EAAK,gBAAA;AAAA,MACL,IAAA,EAAM,EAAE,SAAA,EAAW,YAAA,EAAa;AAAA,MAChC,SAAS,CAAC,EAAE,WAAU,KAAM,iBAAA,CAAkB,WAAW,SAAS;AAAA,KACnE;AAAA,GACH;AAAA,EACA,MAAA,EAAQ;AAAA,IACN,IAAA,EAAM,mBAAA;AAAA,IACN,aAAA,EAAe;AAAA;AAEnB,CAAC;AAGM,MAAM,iBAAiB,gBAAA,CAAiB,OAAA;AAAA,EAC7C,uBAAA,CAAwB;AAAA,IACtB,IAAA,EAAM,gBAAA;AAAA,IACN,SAAA,EAAW,MAAM,OAAO,iBAAU,EAAE,IAAA,CAAK,CAAA,CAAA,KAAK,EAAE,MAAM,CAAA;AAAA,IACtD,UAAA,EAAY;AAAA,GACb;AACH;AAGO,MAAM,0BAA0B,gBAAA,CAAiB,OAAA;AAAA,EACtD,uBAAA,CAAwB;AAAA,IACtB,IAAA,EAAM,yBAAA;AAAA,IACN,SAAA,EAAW,MAAM,OAAO,iBAAU,EAAE,IAAA,CAAK,CAAA,CAAA,KAAK,EAAE,cAAc,CAAA;AAAA,IAC9D,UAAA,EAAY;AAAA,GACb;AACH;AAGO,MAAM,gCAAgC,gBAAA,CAAiB,OAAA;AAAA,EAC5D,wBAAA,CAAyB;AAAA,IACvB,IAAA,EAAM,+BAAA;AAAA,IACN,SAAA,EAAW;AAAA,MACT,IAAA,EAAM,MACJ,OAAO,iCAAoB,EAAE,IAAA,CAAK,CAAA,CAAA,KAAK,EAAE,uBAAuB;AAAA;AACpE,GACD;AACH;;;;"}
|
package/dist/utils.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.esm.js","sources":["../src/utils.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useLocation } from 'react-router-dom';\nimport {\n Website,\n Audit,\n LighthouseCategoryId,\n AuditCompleted,\n} from '@backstage-community/plugin-lighthouse-common';\n\nexport function useQuery(): URLSearchParams {\n return new URLSearchParams(useLocation().search);\n}\n\nexport function formatTime(timestamp: string | Date) {\n let date: Date;\n if (timestamp instanceof Date) {\n date = timestamp;\n } else {\n date = new Date(timestamp);\n }\n return date.toUTCString();\n}\n\nexport const CATEGORIES: LighthouseCategoryId[] = [\n 'accessibility',\n 'performance',\n 'seo',\n 'best-practices',\n];\n\nexport const CATEGORY_LABELS: Record<LighthouseCategoryId, string> = {\n accessibility: 'Accessibility',\n performance: 'Performance',\n seo: 'SEO',\n 'best-practices': 'Best Practices',\n pwa: 'Progressive Web App',\n};\n\nexport type SparklinesDataByCategory = Record<LighthouseCategoryId, number[]>;\nexport function buildSparklinesDataForItem(\n item: Website,\n): SparklinesDataByCategory {\n return item.audits\n .filter(\n (audit: Audit): audit is AuditCompleted => audit.status === 'COMPLETED',\n )\n .reduce((scores, audit) => {\n Object.values(audit.categories).forEach(category => {\n scores[category.id] = scores[category.id] || [];\n scores[category.id].unshift(category.score);\n });\n\n // edge case: if only one audit exists, force a \"flat\" sparkline\n Object.values(scores).forEach(arr => {\n if (arr.length === 1) arr.push(arr[0]);\n });\n\n return scores;\n }, {} as SparklinesDataByCategory);\n}\n"],"names":[],"mappings":";;AAuBO,SAAS,
|
|
1
|
+
{"version":3,"file":"utils.esm.js","sources":["../src/utils.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useLocation } from 'react-router-dom';\nimport {\n Website,\n Audit,\n LighthouseCategoryId,\n AuditCompleted,\n} from '@backstage-community/plugin-lighthouse-common';\n\nexport function useQuery(): URLSearchParams {\n return new URLSearchParams(useLocation().search);\n}\n\nexport function formatTime(timestamp: string | Date) {\n let date: Date;\n if (timestamp instanceof Date) {\n date = timestamp;\n } else {\n date = new Date(timestamp);\n }\n return date.toUTCString();\n}\n\nexport const CATEGORIES: LighthouseCategoryId[] = [\n 'accessibility',\n 'performance',\n 'seo',\n 'best-practices',\n];\n\nexport const CATEGORY_LABELS: Record<LighthouseCategoryId, string> = {\n accessibility: 'Accessibility',\n performance: 'Performance',\n seo: 'SEO',\n 'best-practices': 'Best Practices',\n pwa: 'Progressive Web App',\n};\n\nexport type SparklinesDataByCategory = Record<LighthouseCategoryId, number[]>;\nexport function buildSparklinesDataForItem(\n item: Website,\n): SparklinesDataByCategory {\n return item.audits\n .filter(\n (audit: Audit): audit is AuditCompleted => audit.status === 'COMPLETED',\n )\n .reduce((scores, audit) => {\n Object.values(audit.categories).forEach(category => {\n scores[category.id] = scores[category.id] || [];\n scores[category.id].unshift(category.score);\n });\n\n // edge case: if only one audit exists, force a \"flat\" sparkline\n Object.values(scores).forEach(arr => {\n if (arr.length === 1) arr.push(arr[0]);\n });\n\n return scores;\n }, {} as SparklinesDataByCategory);\n}\n"],"names":[],"mappings":";;AAuBO,SAAS,QAAA,GAA4B;AAC1C,EAAA,OAAO,IAAI,eAAA,CAAgB,WAAA,EAAY,CAAE,MAAM,CAAA;AACjD;AAEO,SAAS,WAAW,SAAA,EAA0B;AACnD,EAAA,IAAI,IAAA;AACJ,EAAA,IAAI,qBAAqB,IAAA,EAAM;AAC7B,IAAA,IAAA,GAAO,SAAA;AAAA,EACT,CAAA,MAAO;AACL,IAAA,IAAA,GAAO,IAAI,KAAK,SAAS,CAAA;AAAA,EAC3B;AACA,EAAA,OAAO,KAAK,WAAA,EAAY;AAC1B;AAEO,MAAM,UAAA,GAAqC;AAAA,EAChD,eAAA;AAAA,EACA,aAAA;AAAA,EACA,KAAA;AAAA,EACA;AACF;AAEO,MAAM,eAAA,GAAwD;AAAA,EACnE,aAAA,EAAe,eAAA;AAAA,EACf,WAAA,EAAa,aAAA;AAAA,EACb,GAAA,EAAK,KAAA;AAAA,EACL,gBAAA,EAAkB,gBAAA;AAAA,EAClB,GAAA,EAAK;AACP;AAGO,SAAS,2BACd,IAAA,EAC0B;AAC1B,EAAA,OAAO,KAAK,MAAA,CACT,MAAA;AAAA,IACC,CAAC,KAAA,KAA0C,KAAA,CAAM,MAAA,KAAW;AAAA,GAC9D,CACC,MAAA,CAAO,CAAC,MAAA,EAAQ,KAAA,KAAU;AACzB,IAAA,MAAA,CAAO,MAAA,CAAO,KAAA,CAAM,UAAU,CAAA,CAAE,QAAQ,CAAA,QAAA,KAAY;AAClD,MAAA,MAAA,CAAO,SAAS,EAAE,CAAA,GAAI,OAAO,QAAA,CAAS,EAAE,KAAK,EAAC;AAC9C,MAAA,MAAA,CAAO,QAAA,CAAS,EAAE,CAAA,CAAE,OAAA,CAAQ,SAAS,KAAK,CAAA;AAAA,IAC5C,CAAC,CAAA;AAGD,IAAA,MAAA,CAAO,MAAA,CAAO,MAAM,CAAA,CAAE,OAAA,CAAQ,CAAA,GAAA,KAAO;AACnC,MAAA,IAAI,IAAI,MAAA,KAAW,CAAA,MAAO,IAAA,CAAK,GAAA,CAAI,CAAC,CAAC,CAAA;AAAA,IACvC,CAAC,CAAA;AAED,IAAA,OAAO,MAAA;AAAA,EACT,CAAA,EAAG,EAA8B,CAAA;AACrC;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage-community/plugin-lighthouse",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.0",
|
|
4
4
|
"description": "A Backstage plugin that integrates towards Lighthouse",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "frontend-plugin",
|
|
@@ -68,13 +68,13 @@
|
|
|
68
68
|
"test": "backstage-cli package test"
|
|
69
69
|
},
|
|
70
70
|
"dependencies": {
|
|
71
|
-
"@backstage-community/plugin-lighthouse-common": "^0.
|
|
72
|
-
"@backstage/catalog-model": "^1.
|
|
73
|
-
"@backstage/core-compat-api": "^0.5.
|
|
74
|
-
"@backstage/core-components": "^0.18.
|
|
75
|
-
"@backstage/core-plugin-api": "^1.12.
|
|
76
|
-
"@backstage/frontend-plugin-api": "^0.
|
|
77
|
-
"@backstage/plugin-catalog-react": "^2.1.
|
|
71
|
+
"@backstage-community/plugin-lighthouse-common": "^0.19.0",
|
|
72
|
+
"@backstage/catalog-model": "^1.8.0",
|
|
73
|
+
"@backstage/core-compat-api": "^0.5.10",
|
|
74
|
+
"@backstage/core-components": "^0.18.9",
|
|
75
|
+
"@backstage/core-plugin-api": "^1.12.5",
|
|
76
|
+
"@backstage/frontend-plugin-api": "^0.16.2",
|
|
77
|
+
"@backstage/plugin-catalog-react": "^2.1.4",
|
|
78
78
|
"@material-ui/core": "^4.12.2",
|
|
79
79
|
"@material-ui/icons": "^4.9.1",
|
|
80
80
|
"@material-ui/lab": "4.0.0-alpha.61",
|
|
@@ -82,12 +82,12 @@
|
|
|
82
82
|
"react-use": "^17.2.4"
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|
|
85
|
-
"@backstage/cli": "^0.36.
|
|
86
|
-
"@backstage/core-app-api": "^1.
|
|
87
|
-
"@backstage/frontend-defaults": "^0.5.
|
|
88
|
-
"@backstage/frontend-test-utils": "^0.5.
|
|
89
|
-
"@backstage/plugin-catalog": "^2.0.
|
|
90
|
-
"@backstage/test-utils": "^1.7.
|
|
85
|
+
"@backstage/cli": "^0.36.1",
|
|
86
|
+
"@backstage/core-app-api": "^1.20.0",
|
|
87
|
+
"@backstage/frontend-defaults": "^0.5.1",
|
|
88
|
+
"@backstage/frontend-test-utils": "^0.5.2",
|
|
89
|
+
"@backstage/plugin-catalog": "^2.0.4",
|
|
90
|
+
"@backstage/test-utils": "^1.7.17",
|
|
91
91
|
"@testing-library/jest-dom": "^6.0.0",
|
|
92
92
|
"@testing-library/react": "^15.0.0",
|
|
93
93
|
"@types/react-dom": "^18.2.19",
|