@techdocs/cli 1.8.7 → 1.8.8
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 +12 -0
- package/dist/cjs/{serve-C91gBkLm.cjs.js → serve-Di1O6Sm4.cjs.js} +9 -1
- package/dist/cjs/serve-Di1O6Sm4.cjs.js.map +1 -0
- package/dist/embedded-app/.config-schema.json +22 -22
- package/dist/embedded-app/index.html +1 -1
- package/dist/embedded-app/static/233.35298ac1.chunk.js +3 -0
- package/dist/embedded-app/static/233.35298ac1.chunk.js.map +1 -0
- package/dist/embedded-app/static/5974.625a945e.chunk.js +3 -0
- package/dist/embedded-app/static/5974.625a945e.chunk.js.map +1 -0
- package/dist/embedded-app/static/{main.6a42e4f3.js → main.27572b1b.js} +2 -2
- package/dist/embedded-app/static/main.27572b1b.js.map +1 -0
- package/dist/embedded-app/static/{runtime.6a42e4f3.js → runtime.27572b1b.js} +2 -2
- package/dist/embedded-app/static/{runtime.6a42e4f3.js.map → runtime.27572b1b.js.map} +1 -1
- package/dist/embedded-app/static/vendor.27572b1b.js +160 -0
- package/dist/embedded-app/static/vendor.27572b1b.js.map +1 -0
- package/dist/index.cjs.js +2 -2
- package/package.json +4 -4
- package/dist/cjs/serve-C91gBkLm.cjs.js.map +0 -1
- package/dist/embedded-app/static/4992.cffa1169.chunk.js +0 -3
- package/dist/embedded-app/static/4992.cffa1169.chunk.js.map +0 -1
- package/dist/embedded-app/static/5011.7b676837.chunk.js +0 -3
- package/dist/embedded-app/static/5011.7b676837.chunk.js.map +0 -1
- package/dist/embedded-app/static/main.6a42e4f3.js.map +0 -1
- package/dist/embedded-app/static/vendor.6a42e4f3.js +0 -160
- package/dist/embedded-app/static/vendor.6a42e4f3.js.map +0 -1
package/dist/index.cjs.js
CHANGED
|
@@ -213,7 +213,7 @@ function registerCommands(program) {
|
|
|
213
213
|
"--preview-app-port can only be used together with --preview-app-bundle-path"
|
|
214
214
|
);
|
|
215
215
|
}
|
|
216
|
-
}).action(lazy(() => Promise.resolve().then(function () { return require('./cjs/serve-
|
|
216
|
+
}).action(lazy(() => Promise.resolve().then(function () { return require('./cjs/serve-Di1O6Sm4.cjs.js'); }).then((m) => m.default)));
|
|
217
217
|
}
|
|
218
218
|
function lazy(getActionFunc) {
|
|
219
219
|
return async (...args) => {
|
|
@@ -228,7 +228,7 @@ function lazy(getActionFunc) {
|
|
|
228
228
|
};
|
|
229
229
|
}
|
|
230
230
|
|
|
231
|
-
var version = "1.8.
|
|
231
|
+
var version = "1.8.8";
|
|
232
232
|
|
|
233
233
|
const main = (argv) => {
|
|
234
234
|
commander.program.name("techdocs-cli").version(version);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@techdocs/cli",
|
|
3
3
|
"description": "Utility CLI for managing TechDocs sites in Backstage.",
|
|
4
|
-
"version": "1.8.
|
|
4
|
+
"version": "1.8.8",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"techdocs-cli": "bin/techdocs-cli"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@backstage/cli": "^0.26.
|
|
38
|
+
"@backstage/cli": "^0.26.2",
|
|
39
39
|
"@types/commander": "^2.12.2",
|
|
40
40
|
"@types/fs-extra": "^11.0.0",
|
|
41
41
|
"@types/http-proxy": "^1.17.4",
|
|
@@ -56,11 +56,11 @@
|
|
|
56
56
|
"ext": "ts"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@backstage/backend-common": "^0.21.
|
|
59
|
+
"@backstage/backend-common": "^0.21.6",
|
|
60
60
|
"@backstage/catalog-model": "^1.4.5",
|
|
61
61
|
"@backstage/cli-common": "^0.1.13",
|
|
62
62
|
"@backstage/config": "^1.2.0",
|
|
63
|
-
"@backstage/plugin-techdocs-node": "^1.12.
|
|
63
|
+
"@backstage/plugin-techdocs-node": "^1.12.2",
|
|
64
64
|
"@types/dockerode": "^3.3.0",
|
|
65
65
|
"commander": "^12.0.0",
|
|
66
66
|
"dockerode": "^4.0.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"serve-C91gBkLm.cjs.js","sources":["../../src/lib/httpServer.ts","../../src/commands/serve/serve.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 serveHandler from 'serve-handler';\nimport http from 'http';\nimport httpProxy from 'http-proxy';\nimport { createLogger } from './utility';\n\nexport default class HTTPServer {\n private readonly proxyEndpoint: string;\n private readonly backstageBundleDir: string;\n private readonly backstagePort: number;\n private readonly mkdocsTargetAddress: string;\n private readonly verbose: boolean;\n\n constructor(\n backstageBundleDir: string,\n backstagePort: number,\n mkdocsTargetAddress: string,\n verbose: boolean,\n ) {\n this.proxyEndpoint = '/api/techdocs/';\n this.backstageBundleDir = backstageBundleDir;\n this.backstagePort = backstagePort;\n this.mkdocsTargetAddress = mkdocsTargetAddress;\n this.verbose = verbose;\n }\n\n // Create a Proxy for mkdocs server\n private createProxy() {\n const proxy = httpProxy.createProxyServer({\n target: this.mkdocsTargetAddress,\n });\n\n return (request: http.IncomingMessage): [httpProxy, string] => {\n // If the request path is prefixed with this.proxyEndpoint, remove it.\n const proxyEndpointPath = new RegExp(`^${this.proxyEndpoint}`, 'i');\n const forwardPath = request.url?.replace(proxyEndpointPath, '') || '';\n\n return [proxy, forwardPath];\n };\n }\n\n public async serve(): Promise<http.Server> {\n return new Promise<http.Server>((resolve, reject) => {\n const proxyHandler = this.createProxy();\n const server = http.createServer(\n (request: http.IncomingMessage, response: http.ServerResponse) => {\n if (request.url?.startsWith(this.proxyEndpoint)) {\n const [proxy, forwardPath] = proxyHandler(request);\n\n proxy.on('error', (error: Error) => {\n reject(error);\n });\n\n response.setHeader('Access-Control-Allow-Origin', '*');\n response.setHeader('Access-Control-Allow-Methods', 'GET, OPTIONS');\n\n request.url = forwardPath;\n proxy.web(request, response);\n return;\n }\n\n // This endpoint is used by the frontend to detect where the backend is running.\n if (request.url === '/.detect') {\n response.setHeader('Content-Type', 'text/plain');\n response.end('techdocs-cli-server');\n return;\n }\n\n serveHandler(request, response, {\n public: this.backstageBundleDir,\n trailingSlash: true,\n rewrites: [{ source: '**', destination: 'index.html' }],\n });\n },\n );\n\n const logger = createLogger({ verbose: false });\n server.listen(this.backstagePort, () => {\n if (this.verbose) {\n logger.info(\n `[techdocs-preview-bundle] Running local version of Backstage at http://localhost:${this.backstagePort}`,\n );\n }\n resolve(server);\n });\n\n server.on('error', (error: Error) => {\n reject(error);\n });\n });\n }\n}\n","/*\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 { OptionValues } from 'commander';\nimport path from 'path';\nimport openBrowser from 'react-dev-utils/openBrowser';\nimport { findPaths } from '@backstage/cli-common';\nimport HTTPServer from '../../lib/httpServer';\nimport { runMkdocsServer } from '../../lib/mkdocsServer';\nimport { LogFunc, waitForSignal } from '../../lib/run';\nimport { createLogger } from '../../lib/utility';\nimport { getMkdocsYml } from '@backstage/plugin-techdocs-node';\nimport fs from 'fs-extra';\nimport { checkIfDockerIsOperational } from './utils';\n\nfunction findPreviewBundlePath(): string {\n try {\n return path.join(\n path.dirname(require.resolve('techdocs-cli-embedded-app/package.json')),\n 'dist',\n );\n } catch {\n // If the techdocs-cli-embedded-app package is not available it means we're\n // running a published package. For published packages the preview bundle is\n // copied to dist/embedded-app be the prepack script.\n //\n // This can be tested by running `yarn pack` and extracting the resulting tarball into a directory.\n // Within the extracted directory, run `npm install --only=prod`.\n // Once that's done you can test the CLI in any directory using `node <tmp-dir>/package <command>`.\n // eslint-disable-next-line no-restricted-syntax\n return findPaths(__dirname).resolveOwn('dist/embedded-app');\n }\n}\n\nfunction getPreviewAppPath(opts: OptionValues): string {\n return opts.previewAppBundlePath ?? findPreviewBundlePath();\n}\n\nexport default async function serve(opts: OptionValues) {\n const logger = createLogger({ verbose: opts.verbose });\n\n // Determine if we want to run in local dev mode or not\n // This will run the backstage http server on a different port and only used\n // for proxying mkdocs to the backstage app running locally (e.g. with webpack-dev-server)\n const isDevMode = Object.keys(process.env).includes('TECHDOCS_CLI_DEV_MODE')\n ? true\n : false;\n\n const backstageBackendPort = 7007;\n\n const mkdocsDockerAddr = `http://0.0.0.0:${opts.mkdocsPort}`;\n const mkdocsLocalAddr = `http://127.0.0.1:${opts.mkdocsPort}`;\n const mkdocsExpectedDevAddr = opts.docker\n ? mkdocsDockerAddr\n : mkdocsLocalAddr;\n const mkdocsConfigFileName = opts.mkdocsConfigFileName;\n const siteName = opts.siteName;\n\n const { path: mkdocsYmlPath, configIsTemporary } = await getMkdocsYml('./', {\n name: siteName,\n mkdocsConfigFileName,\n });\n\n // Validate that Docker is up and running\n if (opts.docker) {\n const isDockerOperational = await checkIfDockerIsOperational(logger);\n if (!isDockerOperational) {\n return;\n }\n }\n\n let mkdocsServerHasStarted = false;\n const mkdocsLogFunc: LogFunc = data => {\n // Sometimes the lines contain an unnecessary extra new line\n const logLines = data.toString().split('\\n');\n const logPrefix = opts.docker ? '[docker/mkdocs]' : '[mkdocs]';\n logLines.forEach(line => {\n if (line === '') {\n return;\n }\n\n logger.verbose(`${logPrefix} ${line}`);\n\n // When the server has started, open a new browser tab for the user.\n if (\n !mkdocsServerHasStarted &&\n line.includes(`Serving on ${mkdocsExpectedDevAddr}`)\n ) {\n mkdocsServerHasStarted = true;\n }\n });\n };\n // mkdocs writes all of its logs to stderr by default, and not stdout.\n // https://github.com/mkdocs/mkdocs/issues/879#issuecomment-203536006\n // Had me questioning this whole implementation for half an hour.\n logger.info('Starting mkdocs server.');\n const mkdocsChildProcess = await runMkdocsServer({\n port: opts.mkdocsPort,\n dockerImage: opts.dockerImage,\n dockerEntrypoint: opts.dockerEntrypoint,\n dockerOptions: opts.dockerOption,\n useDocker: opts.docker,\n stdoutLogFunc: mkdocsLogFunc,\n stderrLogFunc: mkdocsLogFunc,\n mkdocsConfigFileName: mkdocsYmlPath,\n mkdocsParameterClean: opts.mkdocsParameterClean,\n mkdocsParameterDirtyReload: opts.mkdocsParameterDirtyreload,\n mkdocsParameterStrict: opts.mkdocsParameterStrict,\n });\n\n // Wait until mkdocs server has started so that Backstage starts with docs loaded\n // Takes 1-5 seconds\n for (let attempt = 0; attempt < 30; attempt++) {\n await new Promise(r => setTimeout(r, 3000));\n if (mkdocsServerHasStarted) {\n break;\n }\n logger.info('Waiting for mkdocs server to start...');\n }\n\n if (!mkdocsServerHasStarted) {\n logger.error(\n 'mkdocs server did not start. Exiting. Try re-running command with -v option for more details.',\n );\n }\n\n const port = isDevMode ? backstageBackendPort : opts.previewAppPort;\n const previewAppPath = getPreviewAppPath(opts);\n const httpServer = new HTTPServer(\n previewAppPath,\n port,\n mkdocsExpectedDevAddr,\n opts.verbose,\n );\n\n httpServer\n .serve()\n .catch(err => {\n logger.error('Failed to start HTTP server', err);\n mkdocsChildProcess.kill();\n process.exit(1);\n })\n .then(() => {\n // The last three things default/component/local/ don't matter. They can be anything.\n openBrowser(`http://localhost:${port}/docs/default/component/local/`);\n logger.info(\n `Serving docs in Backstage at http://localhost:${port}/docs/default/component/local/\\nOpening browser.`,\n );\n });\n\n await waitForSignal([mkdocsChildProcess]);\n\n if (configIsTemporary) {\n process.on('exit', async () => {\n fs.rmSync(mkdocsYmlPath, {});\n });\n }\n}\n"],"names":["httpProxy","http","serveHandler","createLogger","path","findPaths","getMkdocsYml","checkIfDockerIsOperational","runMkdocsServer","openBrowser","waitForSignal","fs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBA,MAAqB,UAAW,CAAA;AAAA,EAO9B,WACE,CAAA,kBAAA,EACA,aACA,EAAA,mBAAA,EACA,OACA,EAAA;AAXF,IAAiB,aAAA,CAAA,IAAA,EAAA,eAAA,CAAA,CAAA;AACjB,IAAiB,aAAA,CAAA,IAAA,EAAA,oBAAA,CAAA,CAAA;AACjB,IAAiB,aAAA,CAAA,IAAA,EAAA,eAAA,CAAA,CAAA;AACjB,IAAiB,aAAA,CAAA,IAAA,EAAA,qBAAA,CAAA,CAAA;AACjB,IAAiB,aAAA,CAAA,IAAA,EAAA,SAAA,CAAA,CAAA;AAQf,IAAA,IAAA,CAAK,aAAgB,GAAA,gBAAA,CAAA;AACrB,IAAA,IAAA,CAAK,kBAAqB,GAAA,kBAAA,CAAA;AAC1B,IAAA,IAAA,CAAK,aAAgB,GAAA,aAAA,CAAA;AACrB,IAAA,IAAA,CAAK,mBAAsB,GAAA,mBAAA,CAAA;AAC3B,IAAA,IAAA,CAAK,OAAU,GAAA,OAAA,CAAA;AAAA,GACjB;AAAA;AAAA,EAGQ,WAAc,GAAA;AACpB,IAAM,MAAA,KAAA,GAAQA,2BAAU,iBAAkB,CAAA;AAAA,MACxC,QAAQ,IAAK,CAAA,mBAAA;AAAA,KACd,CAAA,CAAA;AAED,IAAA,OAAO,CAAC,OAAuD,KAAA;AA/CnE,MAAA,IAAA,EAAA,CAAA;AAiDM,MAAA,MAAM,oBAAoB,IAAI,MAAA,CAAO,IAAI,IAAK,CAAA,aAAa,IAAI,GAAG,CAAA,CAAA;AAClE,MAA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,CAAO,aAAe,EAAA,EAAE,CAAA,CAAA;AAAA,KAC5B,CAAA,CAAA;AAAA,GACH;AACF;;;;"}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
"use strict";(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[4992],{48514:function(Z,L,e){e.d(L,{M:function(){return W}});var t=e(31085),m=e(58837),I=e(71677),R=e(14041),D=e(62220),M=e.n(D),z=e(85058);const U=(0,m.A)({container:{overflow:"visible !important"}},{name:"BackstageOverflowTooltip"});function W(C){const[O,F]=(0,R.useState)(!1),v=(0,z.a)(),y=U(),P=h=>{v()&&F(h)};var S;return(0,t.jsx)(I.Ay,{title:(S=C.title)!==null&&S!==void 0?S:C.text||"",placement:C.placement,disableHoverListener:!O,children:(0,t.jsx)(M(),{text:C.text,line:C.line,onToggled:P,containerClassName:y.container})})}},60413:function(Z,L,e){e.d(L,{C4:function(){return R},tS:function(){return M}});function t({name:O,attributes:F,resourceType:v}){return v?{type:"resource",name:O,attributes:F,resourceType:v}:{type:"basic",name:O,attributes:F}}const m="catalog-entity",I=t({name:"catalog.entity.read",attributes:{action:"read"},resourceType:m}),R=t({name:"catalog.entity.create",attributes:{action:"create"}}),D=t({name:"catalog.entity.delete",attributes:{action:"delete"},resourceType:m}),M=t({name:"catalog.entity.refresh",attributes:{action:"update"},resourceType:m}),z=t({name:"catalog.location.read",attributes:{action:"read"}}),U=t({name:"catalog.location.create",attributes:{action:"create"}}),W=t({name:"catalog.location.delete",attributes:{action:"delete"}}),C=[I,R,D,M,z,U,W]},64992:function(Z,L,e){e.r(L),e.d(L,{BaseCatalogPage:function(){return ft},CatalogPage:function(){return Ce},DefaultCatalogPage:function(){return pt}});var t=e(31085),m=e(14041),I=e(18690),R=e(27155),D=e(26280),M=e(59428),z=e(64947),U=e(29365),W=e(5893),C=e(73970),O=e(25534);function F(n){const{title:a,to:i}=n,l=(0,W.A)(r=>r.breakpoints.down("xs"));return i?l?(0,t.jsx)(U.A,{component:C.N_,color:"primary",title:a,size:"small",to:i,children:(0,t.jsx)(O.A,{})}):(0,t.jsx)(z.A,{component:C.N_,variant:"contained",color:"primary",to:i,children:a}):null}var v=e(3851),y=e(72427),P=e(65461),S=e(9222),h=e(21405),G=e(54203),St=e(95203),tt=e(72348),et=e(51372),Pt=e(6820),Et=e(88640),jt=e(77310),nt=e(14209),V=e(90184),At=e(56889),at=e(67871),J=e(72501),Tt=e(87051),k=e(26694),Lt=e(75625),Rt=e(39330),Ot=e(80109),Ft=e(15303),Kt=e(45250),Mt=e(65398),Bt=e.n(Mt),Nt=e(8859),it=e(34428),lt=e(67720),ot=e(48514);const g=Object.freeze({createNameColumn(n){function a(i){var l;return((l=i.metadata)===null||l===void 0?void 0:l.title)||(0,V.S)(i,{defaultKind:n==null?void 0:n.defaultKind})}return{title:"Name",field:"resolved.entityRef",highlight:!0,customSort({entity:i},{entity:l}){return a(i).localeCompare(a(l))},render:({entity:i})=>(0,t.jsx)(Nt.z,{entityRef:i,defaultKind:(n==null?void 0:n.defaultKind)||"Component"})}},createSystemColumn(){return{title:"System",field:"resolved.partOfSystemRelationTitle",render:({resolved:n})=>(0,t.jsx)(it.i,{entityRefs:n.partOfSystemRelations,defaultKind:"system"})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:n})=>(0,t.jsx)(it.i,{entityRefs:n.ownedByRelations,defaultKind:"group"})}},createSpecTargetsColumn(){return{title:"Targets",field:"entity.spec.targets",customFilterAndSearch:(n,a)=>{var i,l,r,o,c,s;let d=[];if(!((l=a.entity)===null||l===void 0||(i=l.spec)===null||i===void 0)&&i.targets&&Array.isArray((o=a.entity)===null||o===void 0||(r=o.spec)===null||r===void 0?void 0:r.targets)){var u,f;d=(f=a.entity)===null||f===void 0||(u=f.spec)===null||u===void 0?void 0:u.targets}else if(!((s=a.entity)===null||s===void 0||(c=s.spec)===null||c===void 0)&&c.target){var p,x;d=[(x=a.entity)===null||x===void 0||(p=x.spec)===null||p===void 0?void 0:p.target]}return d.join(", ").toLocaleUpperCase("en-US").includes(n.toLocaleUpperCase("en-US"))},render:({entity:n})=>{var a,i;return(0,t.jsx)(t.Fragment,{children:((n==null||(a=n.spec)===null||a===void 0?void 0:a.targets)||(n==null||(i=n.spec)===null||i===void 0?void 0:i.target))&&(0,t.jsx)(ot.M,{text:(n.spec.targets||[n.spec.target]).join(", "),placement:"bottom-start"})})}}},createSpecTypeColumn(n={hidden:!1}){return{title:"Type",field:"entity.spec.type",hidden:n.hidden,width:"auto"}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"entity.spec.lifecycle"}},createMetadataDescriptionColumn(){return{title:"Description",field:"entity.metadata.description",render:({entity:n})=>(0,t.jsx)(ot.M,{text:n.metadata.description,placement:"bottom-start"}),width:"auto"}},createTagsColumn(){return{title:"Tags",field:"entity.metadata.tags",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:n})=>(0,t.jsx)(t.Fragment,{children:n.metadata.tags&&n.metadata.tags.map(a=>(0,t.jsx)(lt.A,{label:a,size:"small",variant:"outlined",style:{marginBottom:"0px"}},a))}),width:"auto"}},createTitleColumn(n){return{title:"Title",field:"entity.metadata.title",hidden:n==null?void 0:n.hidden,searchable:!0}},createLabelColumn(n,a){return{title:(a==null?void 0:a.title)||"Label",field:"entity.metadata.labels",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:i})=>{var l;const r=(l=i.metadata)===null||l===void 0?void 0:l.labels,o=r&&r[n]||(a==null?void 0:a.defaultValue);return(0,t.jsx)(t.Fragment,{children:o&&(0,t.jsx)(lt.A,{label:o,size:"small",variant:"outlined"},o)})},width:"auto"}},createNamespaceColumn(){return{title:"Namespace",field:"entity.metadata.namespace",width:"auto"}}});var B=e(92822);function It(n){const{columns:a,data:i,next:l,prev:r,title:o,isLoading:c,options:s}=n,{updateFilters:d}=(0,h.nK)();return(0,t.jsx)(nt.X,{title:c?"":o,columns:a,data:i,options:{...s,paginationPosition:"both",pageSizeOptions:[],showFirstLastPageButtons:!1,pageSize:Number.MAX_SAFE_INTEGER,emptyRowsWhenPaging:!1},onSearchChange:u=>d({text:u?new B.V3(u):void 0}),onPageChange:u=>{u>0?l==null||l():r==null||r()},page:r?1:0,totalCount:l?Number.MAX_VALUE:Number.MAX_SAFE_INTEGER,localization:{pagination:{labelDisplayedRows:""}}})}const st=({filters:n,entities:a})=>{var i;const l=n.type===void 0;return[g.createTitleColumn({hidden:!0}),g.createNameColumn({defaultKind:(i=n.kind)===null||i===void 0?void 0:i.value}),...r(),g.createMetadataDescriptionColumn(),g.createTagsColumn()];function r(){var o;const c=[g.createSystemColumn(),g.createOwnerColumn(),g.createSpecTypeColumn({hidden:!l}),g.createSpecLifecycleColumn()];switch((o=n.kind)===null||o===void 0?void 0:o.value){case"user":return[];case"domain":case"system":return[g.createOwnerColumn()];case"group":case"template":return[g.createSpecTypeColumn({hidden:!l})];case"location":return[g.createSpecTypeColumn({hidden:!l}),g.createSpecTargetsColumn()];default:return a.every(s=>s.metadata.namespace==="default")?c:[...c,g.createNamespaceColumn()]}}},Dt=(0,Tt.A)({root:{color:"#f3ba37"}})(Ot.A),zt=(n,a)=>{const i=l=>l.metadata.title||(0,V.S)(l,{defaultKind:"Component"});return i(n).localeCompare(i(a))},Q=n=>{var a,i,l;const{columns:r=st,tableOptions:o,subtitle:c,emptyContent:s}=n,{isStarredEntity:d,toggleStarredEntity:u}=(0,At.I)(),f=(0,h.nK)(),{loading:p,error:x,entities:E,filters:j,pageInfo:H,totalItems:$}=f,b=!!H,X=(0,m.useMemo)(()=>typeof r=="function"?r(f):r,[r,f]);if(x)return(0,t.jsx)("div",{children:(0,t.jsx)(Et.B,{severity:"error",title:"Could not fetch catalog entities.",children:(0,t.jsx)(jt.z,{language:"text",text:x.toString()})})});const N=[({entity:K})=>{var A;const T=(A=K.metadata.annotations)===null||A===void 0?void 0:A[tt._P],Y="View";return{icon:()=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(J.A,{style:k.A,children:Y}),(0,t.jsx)(Rt.A,{fontSize:"small"})]}),tooltip:Y,disabled:!T,onClick:()=>{T&&window.open(T,"_blank")}}},({entity:K})=>{var A;const T=(A=K.metadata.annotations)===null||A===void 0?void 0:A[tt.P],Y="Edit";return{icon:()=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(J.A,{style:k.A,children:Y}),(0,t.jsx)(Lt.A,{fontSize:"small"})]}),tooltip:Y,disabled:!T,onClick:()=>{T&&window.open(T,"_blank")}}},({entity:K})=>{const A=d(K),T=A?"Remove from favorites":"Add to favorites";return{cellStyle:{paddingLeft:"1em"},icon:()=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(J.A,{style:k.A,children:T}),A?(0,t.jsx)(Dt,{}):(0,t.jsx)(Ft.A,{})]}),tooltip:T,onClick:()=>u(K)}}],he=((a=j.kind)===null||a===void 0?void 0:a.value)||"",xe=((i=j.type)===null||i===void 0?void 0:i.value)||"";var _;const yt=`${[(0,Kt.capitalize)((_=(l=j.user)===null||l===void 0?void 0:l.value)!==null&&_!==void 0?_:"all"),xe,Bt()(he)].filter(K=>K).join(" ")} (${$})`,gt=n.actions||N,Ct={actionsColumnIndex:-1,loadingType:"linear",showEmptyDataSourceMessage:!p,padding:"dense",...o};if(b)return(0,t.jsx)(It,{columns:X,emptyContent:s,isLoading:p,title:yt,actions:gt,subtitle:c,options:Ct,data:E.map(rt),next:H.next,prev:H.prev});const ht=E.sort(zt).map(rt),xt=20,Se=ht.length>xt;return(0,t.jsx)(nt.X,{isLoading:p,columns:X,options:{paging:Se,pageSize:xt,pageSizeOptions:[20,50,100],...Ct},title:yt,data:ht,actions:gt,subtitle:c,emptyContent:s})};Q.columns=g,Q.defaultColumnsFunc=st;function rt(n){const a=(0,at.t)(n,et.jn,{kind:"system"}),i=(0,at.t)(n,et.vv);return{entity:n,resolved:{name:(0,V.S)(n,{defaultKind:"Component"}),entityRef:(0,Pt.U2)(n),ownedByRelationsTitle:i.map(l=>(0,V.S)(l,{defaultKind:"group"})).join(", "),ownedByRelations:i,partOfSystemRelationTitle:a.map(l=>(0,V.S)(l,{defaultKind:"system"})).join(", "),partOfSystemRelations:a}}}var Ut=e(93184);const Wt=(0,Ut.h)({id:"catalog",messages:{indexPage:{title:"{{orgName}} Catalog",createButtonTitle:"Create"}}});var Ht=e(87849),bt=e(60413),Gt=e(36989),ct=e(66917),dt=e(36017),w=e(10394),ut=e(73466),mt=e(7341);function Vt(){const n=(0,y.gf)(mt.v),{error:a,loading:i,value:l}=(0,ut.A)(async()=>await n.getEntityFacets({facets:["kind"]}).then(o=>{var c;return((c=o.facets.kind)===null||c===void 0?void 0:c.map(s=>s.value).sort())||[]}),[n]);return{loading:i,error:a,allKinds:l!=null?l:[]}}function Xt(n,a,i){let l=n;return a&&(l=l.filter(o=>a.some(c=>c.toLocaleLowerCase("en-US")===o.toLocaleLowerCase("en-US")))),i&&!n.some(o=>o.toLocaleLowerCase("en-US")===i.toLocaleLowerCase("en-US"))&&(l=l.concat([i])),l.sort().reduce((o,c)=>(o[c.toLocaleLowerCase("en-US")]=c,o),{})}function Yt(n){var a;const{filters:i,queryParameters:{kind:l},updateFilters:r}=(0,h.nK)(),o=(0,m.useMemo)(()=>[l].flat()[0],[l]);var c;const[s,d]=(0,m.useState)((c=o!=null?o:(a=i.kind)===null||a===void 0?void 0:a.value)!==null&&c!==void 0?c:n.initialFilter);(0,m.useEffect)(()=>{o&&d(o)},[o]),(0,m.useEffect)(()=>{var x;if(!((x=i.kind)===null||x===void 0)&&x.value){var E;d((E=i.kind)===null||E===void 0?void 0:E.value)}},[i.kind]),(0,m.useEffect)(()=>{r({kind:s?new B.gM(s):void 0})},[s,r]);const{allKinds:u,loading:f,error:p}=Vt();return{loading:f,error:p,allKinds:u!=null?u:[],selectedKind:s,setSelectedKind:d}}const Jt=n=>{const{allowedKinds:a,hidden:i,initialFilter:l="component"}=n,r=(0,y.gf)(dt.k),{error:o,allKinds:c,selectedKind:s,setSelectedKind:d}=Yt({initialFilter:l});if((0,m.useEffect)(()=>{o&&r.post({message:"Failed to load entity kinds",severity:"error"})},[o,r]),o)return null;const u=Xt(c,a,s),f=Object.keys(u).map(p=>({value:p,label:u[p]}));return i?null:(0,t.jsx)(w.A,{pb:1,pt:1,children:(0,t.jsx)(ct.w,{label:"Kind",items:f,selected:s.toLocaleLowerCase("en-US"),onChange:p=>d(String(p))})})};var q=e(58837),vt=e(50207);const Qt=(0,q.A)({input:{}},{name:"CatalogReactEntityLifecyclePicker"}),$t=n=>{const{initialFilter:a=[]}=n,i=Qt();return(0,t.jsx)(vt.y,{label:"Lifecycle",name:"lifecycles",path:"spec.lifecycle",Filter:B.I5,InputProps:{className:i.input},initialSelectedOptions:a})},Zt=(0,q.A)({input:{}},{name:"CatalogReactEntityNamespacePicker"}),kt=n=>{const{initiallySelectedNamespaces:a}=n,i=Zt();return(0,t.jsx)(vt.y,{label:"Namespace",name:"namespace",path:"metadata.namespace",Filter:B.z,InputProps:{className:i.input},initialSelectedOptions:a})};var wt=e(72987),qt=e(86901),_t=e(69076),te=e(16249),ee=e(44148),ne=e(41260),ae=e(6924),ie=e(20577);const le=(0,q.A)({root:{},input:{},label:{}},{name:"CatalogReactEntityProcessingStatusPickerPicker"}),oe=(0,t.jsx)(ne.A,{fontSize:"small"}),se=(0,t.jsx)(ee.A,{fontSize:"small"}),re=()=>{const n=le(),{updateFilters:a}=(0,h.nK)(),[i,l]=(0,m.useState)([]);function r(s){a({orphan:s?new B.Kf(s):void 0})}function o(s){a({error:s?new B.mT(s):void 0})}const c=["Is Orphan","Has Error"];return(0,t.jsx)(w.A,{className:n.root,pb:1,pt:1,children:(0,t.jsxs)(J.A,{className:n.label,variant:"button",component:"label",children:["Processing Status",(0,t.jsx)(ie.Ay,{multiple:!0,disableCloseOnSelect:!0,options:c,value:i,onChange:(s,d)=>{l(d),r(d.includes("Is Orphan")),o(d.includes("Has Error"))},renderOption:(s,{selected:d})=>(0,t.jsx)(qt.A,{control:(0,t.jsx)(_t.A,{icon:oe,checkedIcon:se,checked:d}),onClick:u=>u.preventDefault(),label:s}),size:"small",popupIcon:(0,t.jsx)(ae.A,{"data-testid":"processing-status-picker-expand"}),renderInput:s=>(0,t.jsx)(te.A,{...s,className:n.input,variant:"outlined"})})]})})};var ce=e(91035),de=e(46343),ue=e.n(de),me=e(40074),ve=e.n(me);function fe(){const n=(0,y.gf)(mt.v),{filters:{kind:a,type:i},queryParameters:{type:l},updateFilters:r}=(0,h.nK)(),o=(0,m.useMemo)(()=>[l].flat().filter(Boolean),[l]);var c;const[s,d]=(0,m.useState)(o.length?o:(c=i==null?void 0:i.getTypes())!==null&&c!==void 0?c:[]);(0,m.useEffect)(()=>{o.length&&d(o)},[o]);const[u,f]=(0,m.useState)([]),p=(0,m.useMemo)(()=>a==null?void 0:a.value,[a]),{error:x,loading:E,value:j}=(0,ut.A)(async()=>p?await n.getEntityFacets({filter:{kind:p},facets:["spec.type"]}).then(b=>b.facets["spec.type"]||[]):[],[p,n]),H=(0,m.useRef)(j);return(0,m.useEffect)(()=>{const $=H.current;if(H.current=j,E||!p||$===j||!j)return;const b=[...new Set(ve()(j,N=>-N.count).map(N=>N.value.toLocaleLowerCase("en-US")))];f(b);const X=s.filter(N=>b.includes(N));ue()(s,X)||d(X)},[E,p,s,d,j]),(0,m.useEffect)(()=>{r({type:s.length?new B.qA(s):void 0})},[s,r]),{loading:E,error:x,availableTypes:u,selectedTypes:s,setSelectedTypes:d}}const pe=n=>{const{hidden:a,initialFilter:i}=n,l=(0,y.gf)(dt.k),{error:r,availableTypes:o,selectedTypes:c,setSelectedTypes:s}=fe();if((0,m.useEffect)(()=>{r&&l.post({message:"Failed to load entity types",severity:"error"}),i&&s([i])},[r,l,i,s]),o.length===0||r)return null;const d=[{value:"all",label:"all"},...o.map(f=>({value:f,label:f}))];var u;return a?null:(0,t.jsx)(w.A,{pb:1,pt:1,children:(0,t.jsx)(ct.w,{label:"Type",items:d,selected:(u=d.length>1?c[0]:void 0)!==null&&u!==void 0?u:"all",onChange:f=>s(f==="all"?[]:[String(f)])})})};var ye=e(67626);const ge=n=>{const{initialKind:a,initiallySelectedFilter:i,ownerPickerMode:l,initiallySelectedNamespaces:r}=n;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(Jt,{initialFilter:a}),(0,t.jsx)(pe,{}),(0,t.jsx)(ye.y,{initialFilter:i}),(0,t.jsx)(wt.t,{mode:l}),(0,t.jsx)($t,{}),(0,t.jsx)(ce.m,{}),(0,t.jsx)(re,{}),(0,t.jsx)(kt,{initiallySelectedNamespaces:r})]})};function ft(n){const{filters:a,content:i=(0,t.jsx)(Q,{}),pagination:l}=n;var r;const o=(r=(0,y.gf)(P.U).getOptionalString("organization.name"))!==null&&r!==void 0?r:"Backstage",c=(0,S.S)(St.qP),{t:s}=(0,Ht.i)(Wt),{allowed:d}=(0,Gt.J)({permission:bt.C4});return(0,t.jsx)(R.d,{title:s("indexPage.title",{orgName:o}),themeId:"home",children:(0,t.jsxs)(D.U,{children:[(0,t.jsxs)(M.d,{title:"",children:[d&&(0,t.jsx)(F,{title:s("indexPage.createButtonTitle"),to:c&&c()}),(0,t.jsx)(v.Y,{children:"All your software catalog entities"})]}),(0,t.jsx)(h.B9,{pagination:l,children:(0,t.jsxs)(G.GI,{children:[(0,t.jsx)(G.GI.Filters,{children:a}),(0,t.jsx)(G.GI.Content,{children:i})]})})]})})}function pt(n){const{columns:a,actions:i,initiallySelectedFilter:l="owned",initialKind:r="component",tableOptions:o={},emptyContent:c,pagination:s,ownerPickerMode:d,filters:u,initiallySelectedNamespaces:f}=n;return(0,t.jsx)(ft,{filters:u!=null?u:(0,t.jsx)(ge,{initialKind:r,initiallySelectedFilter:l,ownerPickerMode:d,initiallySelectedNamespaces:f}),content:(0,t.jsx)(Q,{columns:a,actions:i,tableOptions:o,emptyContent:c}),pagination:s})}function Ce(n){return(0,I.P1)()||(0,t.jsx)(pt,{...n})}},36989:function(Z,L,e){e.d(L,{J:function(){return F}});var t=e(72427),m=e(96824);function I(v,y){return v.name===y.name}function R(v,y){return"resourceType"in v?!y||v.resourceType===y:!1}function D(v){return v.attributes.action==="create"}function M(v){return v.attributes.action==="read"}function z(v){return v.attributes.action==="update"}function U(v){return v.attributes.action==="delete"}function W(v){return{authorize:async(y,P)=>await v.authorize(y,P),authorizeConditional(y,P){const S=y;return v.authorize(S,P)}}}var C=e(54241),O=e(68721);function F(v){const y=(0,t.gf)(m.x),{data:P,error:S}=(0,O.Ay)(v,async h=>{if(R(h.permission)&&!h.resourceRef)return C.b.DENY;const{result:G}=await y.authorize(h);return G});return S?{error:S,loading:!1,allowed:!1}:P===void 0?{loading:!0,allowed:!1}:{loading:!1,allowed:P===C.b.ALLOW}}}}]);})();
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=4992.cffa1169.chunk.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"static/4992.cffa1169.chunk.js","mappings":"kQAgCA,MAAMA,KAAYC,EAAAA,GAChB,CACEC,UAAW,CACTC,SAAU,oBACZ,CACF,EACA,CAAEC,KAAM,0BAA2B,CAAC,EAG/B,SAASC,EAAgBC,EAAc,CAC5C,KAAM,CAACC,EAAOC,CAAQ,KAAIC,EAAAA,UAAS,EAAK,EAClCC,KAAYC,EAAAA,GAAa,EACzBC,EAAUZ,EAAU,EAEpBa,EAAiBC,GAAAA,CACjBJ,EAAU,GACZF,EAASM,CAAS,CAEtB,E,IAIWR,EAFX,SACE,OAACS,EAAAA,GAAOA,CACNC,OAAOV,EAAAA,EAAMU,SAAK,MAAXV,IAAAA,OAAAA,EAAgBA,EAAMW,MAAQ,GACrCC,UAAWZ,EAAMY,UACjBC,qBAAsB,CAACZ,E,YAEvB,OAACa,EAAAA,EAAYA,CACXH,KAAMX,EAAMW,KACZI,KAAMf,EAAMe,KACZC,UAAWT,EACXU,mBAAoBX,EAAQV,S,IAIpC,C,iFCvBO,SAASsB,EAAiB,CAC/BpB,KAAAA,EACAqB,WAAAA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/OverflowTooltip.tsx","webpack://techdocs-cli-embedded-app/../../plugins/permission-common/src/permissions/createPermission.ts","webpack://techdocs-cli-embedded-app/../../plugins/catalog-common/src/permissions.ts","webpack://techdocs-cli-embedded-app/../core-components/src/components/CreateButton/CreateButton.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/CatalogTable/columns.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/CatalogTable/PaginatedCatalogTable.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/CatalogTable/defaultCatalogTableColumnsFunc.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/CatalogTable/CatalogTable.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/translation.ts","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/EntityKindPicker/kindFilterUtils.ts","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/EntityKindPicker/EntityKindPicker.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/EntityLifecyclePicker/EntityLifecyclePicker.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/EntityNamespacePicker/EntityNamespacePicker.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/EntityProcessingStatusPicker/EntityProcessingStatusPicker.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/hooks/useEntityTypeFilter.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/EntityTypePicker/EntityTypePicker.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/DefaultFilters/DefaultFilters.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/CatalogPage/DefaultCatalogPage.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/CatalogPage/CatalogPage.tsx","webpack://techdocs-cli-embedded-app/../../plugins/permission-common/src/permissions/util.ts","webpack://techdocs-cli-embedded-app/../../plugins/permission-react/src/hooks/usePermission.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 { makeStyles } from '@material-ui/core/styles';\nimport Tooltip, { TooltipProps } from '@material-ui/core/Tooltip';\nimport React, { useState } from 'react';\nimport TextTruncate, { TextTruncateProps } from 'react-text-truncate';\nimport { useIsMounted } from '@react-hookz/web';\n\ntype Props = {\n text: TextTruncateProps['text'];\n line?: TextTruncateProps['line'];\n element?: TextTruncateProps['element'];\n title?: TooltipProps['title'];\n placement?: TooltipProps['placement'];\n};\n\nexport type OverflowTooltipClassKey = 'container';\n\nconst useStyles = makeStyles(\n {\n container: {\n overflow: 'visible !important',\n },\n },\n { name: 'BackstageOverflowTooltip' },\n);\n\nexport function OverflowTooltip(props: Props) {\n const [hover, setHover] = useState(false);\n const isMounted = useIsMounted();\n const classes = useStyles();\n\n const handleToggled = (truncated: boolean) => {\n if (isMounted()) {\n setHover(truncated);\n }\n };\n\n return (\n <Tooltip\n title={props.title ?? (props.text || '')}\n placement={props.placement}\n disableHoverListener={!hover}\n >\n <TextTruncate\n text={props.text}\n line={props.line}\n onToggled={handleToggled}\n containerClassName={classes.container}\n />\n </Tooltip>\n );\n}\n","/*\n * Copyright 2022 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 {\n BasicPermission,\n Permission,\n PermissionAttributes,\n ResourcePermission,\n} from '../types';\n\n/**\n * Utility function for creating a valid {@link ResourcePermission}, inferring\n * the appropriate type and resource type parameter.\n *\n * @public\n */\nexport function createPermission<TResourceType extends string>(input: {\n name: string;\n attributes: PermissionAttributes;\n resourceType: TResourceType;\n}): ResourcePermission<TResourceType>;\n/**\n * Utility function for creating a valid {@link BasicPermission}.\n *\n * @public\n */\nexport function createPermission(input: {\n name: string;\n attributes: PermissionAttributes;\n}): BasicPermission;\nexport function createPermission({\n name,\n attributes,\n resourceType,\n}: {\n name: string;\n attributes: PermissionAttributes;\n resourceType?: string;\n}): Permission {\n if (resourceType) {\n return {\n type: 'resource',\n name,\n attributes,\n resourceType,\n };\n }\n\n return {\n type: 'basic',\n name,\n attributes,\n };\n}\n","/*\n * Copyright 2021 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 {\n createPermission,\n ResourcePermission,\n} from '@backstage/plugin-permission-common';\n\n/**\n * Permission resource type which corresponds to catalog entities.\n *\n * {@link https://backstage.io/docs/features/software-catalog/}\n * @alpha\n */\nexport const RESOURCE_TYPE_CATALOG_ENTITY = 'catalog-entity';\n\n/**\n * Convenience type for catalog entity\n * {@link @backstage/plugin-permission-common#ResourcePermission}s.\n * @alpha\n */\nexport type CatalogEntityPermission = ResourcePermission<\n typeof RESOURCE_TYPE_CATALOG_ENTITY\n>;\n\n/**\n * This permission is used to authorize actions that involve reading one or more\n * entities from the catalog.\n *\n * If this permission is not authorized, it will appear that the entity does not\n * exist in the catalog — both in the frontend and in API responses.\n * @alpha\n */\nexport const catalogEntityReadPermission = createPermission({\n name: 'catalog.entity.read',\n attributes: {\n action: 'read',\n },\n resourceType: RESOURCE_TYPE_CATALOG_ENTITY,\n});\n\n/**\n * This permission is used to authorize actions that involve creating a new\n * catalog entity. This includes registering an existing component into the\n * catalog.\n * @alpha\n */\nexport const catalogEntityCreatePermission = createPermission({\n name: 'catalog.entity.create',\n attributes: {\n action: 'create',\n },\n});\n\n/**\n * This permission is used to designate actions that involve removing one or\n * more entities from the catalog.\n * @alpha\n */\nexport const catalogEntityDeletePermission = createPermission({\n name: 'catalog.entity.delete',\n attributes: {\n action: 'delete',\n },\n resourceType: RESOURCE_TYPE_CATALOG_ENTITY,\n});\n\n/**\n * This permission is used to designate refreshing one or more entities from the\n * catalog.\n * @alpha\n */\nexport const catalogEntityRefreshPermission = createPermission({\n name: 'catalog.entity.refresh',\n attributes: {\n action: 'update',\n },\n resourceType: RESOURCE_TYPE_CATALOG_ENTITY,\n});\n\n/**\n * This permission is used to designate actions that involve reading one or more\n * locations from the catalog.\n *\n * If this permission is not authorized, it will appear that the location does\n * not exist in the catalog — both in the frontend and in API responses.\n * @alpha\n */\nexport const catalogLocationReadPermission = createPermission({\n name: 'catalog.location.read',\n attributes: {\n action: 'read',\n },\n});\n\n/**\n * This permission is used to designate actions that involve creating catalog\n * locations.\n * @alpha\n */\nexport const catalogLocationCreatePermission = createPermission({\n name: 'catalog.location.create',\n attributes: {\n action: 'create',\n },\n});\n\n/**\n * This permission is used to designate actions that involve deleting locations\n * from the catalog.\n * @alpha\n */\nexport const catalogLocationDeletePermission = createPermission({\n name: 'catalog.location.delete',\n attributes: {\n action: 'delete',\n },\n});\n\n/**\n * List of all catalog permissions.\n * @alpha\n */\nexport const catalogPermissions = [\n catalogEntityReadPermission,\n catalogEntityCreatePermission,\n catalogEntityDeletePermission,\n catalogEntityRefreshPermission,\n catalogLocationReadPermission,\n catalogLocationCreatePermission,\n catalogLocationDeletePermission,\n];\n","/*\n * Copyright 2021 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 IconButton from '@material-ui/core/IconButton';\nimport useMediaQuery from '@material-ui/core/useMediaQuery';\nimport React from 'react';\nimport { Link as RouterLink, LinkProps } from 'react-router-dom';\nimport AddCircleOutline from '@material-ui/icons/AddCircleOutline';\nimport { Theme } from '@material-ui/core/styles';\n\n/**\n * Properties for {@link CreateButton}\n *\n * @public\n */\nexport type CreateButtonProps = {\n title: string;\n} & Partial<Pick<LinkProps, 'to'>>;\n\n/**\n * Responsive Button giving consistent UX for creation of different things\n *\n * @public\n */\nexport function CreateButton(props: CreateButtonProps) {\n const { title, to } = props;\n const isXSScreen = useMediaQuery<Theme>(theme =>\n theme.breakpoints.down('xs'),\n );\n\n if (!to) {\n return null;\n }\n\n return isXSScreen ? (\n <IconButton\n component={RouterLink}\n color=\"primary\"\n title={title}\n size=\"small\"\n to={to}\n >\n <AddCircleOutline />\n </IconButton>\n ) : (\n <Button component={RouterLink} variant=\"contained\" color=\"primary\" to={to}>\n {title}\n </Button>\n );\n}\n","/*\n * Copyright 2021 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 React from 'react';\nimport {\n humanizeEntityRef,\n EntityRefLink,\n EntityRefLinks,\n} from '@backstage/plugin-catalog-react';\nimport Chip from '@material-ui/core/Chip';\nimport { CatalogTableRow } from './types';\nimport { OverflowTooltip, TableColumn } from '@backstage/core-components';\nimport { Entity } from '@backstage/catalog-model';\nimport { JsonArray } from '@backstage/types';\n\n// The columnFactories symbol is not directly exported, but through the\n// CatalogTable.columns field.\n/** @public */\nexport const columnFactories = Object.freeze({\n createNameColumn(options?: {\n defaultKind?: string;\n }): TableColumn<CatalogTableRow> {\n function formatContent(entity: Entity): string {\n return (\n entity.metadata?.title ||\n humanizeEntityRef(entity, {\n defaultKind: options?.defaultKind,\n })\n );\n }\n\n return {\n title: 'Name',\n field: 'resolved.entityRef',\n highlight: true,\n customSort({ entity: entity1 }, { entity: entity2 }) {\n // TODO: We could implement this more efficiently by comparing field by field.\n // This has similar issues as above.\n return formatContent(entity1).localeCompare(formatContent(entity2));\n },\n render: ({ entity }) => (\n <EntityRefLink\n entityRef={entity}\n defaultKind={options?.defaultKind || 'Component'}\n />\n ),\n };\n },\n createSystemColumn(): TableColumn<CatalogTableRow> {\n return {\n title: 'System',\n field: 'resolved.partOfSystemRelationTitle',\n render: ({ resolved }) => (\n <EntityRefLinks\n entityRefs={resolved.partOfSystemRelations}\n defaultKind=\"system\"\n />\n ),\n };\n },\n createOwnerColumn(): TableColumn<CatalogTableRow> {\n return {\n title: 'Owner',\n field: 'resolved.ownedByRelationsTitle',\n render: ({ resolved }) => (\n <EntityRefLinks\n entityRefs={resolved.ownedByRelations}\n defaultKind=\"group\"\n />\n ),\n };\n },\n createSpecTargetsColumn(): TableColumn<CatalogTableRow> {\n return {\n title: 'Targets',\n field: 'entity.spec.targets',\n customFilterAndSearch: (query, row) => {\n let targets: JsonArray = [];\n if (\n row.entity?.spec?.targets &&\n Array.isArray(row.entity?.spec?.targets)\n ) {\n targets = row.entity?.spec?.targets;\n } else if (row.entity?.spec?.target) {\n targets = [row.entity?.spec?.target];\n }\n return targets\n .join(', ')\n .toLocaleUpperCase('en-US')\n .includes(query.toLocaleUpperCase('en-US'));\n },\n render: ({ entity }) => (\n <>\n {(entity?.spec?.targets || entity?.spec?.target) && (\n <OverflowTooltip\n text={(\n (entity!.spec!.targets as JsonArray) || [entity.spec.target]\n ).join(', ')}\n placement=\"bottom-start\"\n />\n )}\n </>\n ),\n };\n },\n createSpecTypeColumn(\n options: {\n hidden: boolean;\n } = { hidden: false },\n ): TableColumn<CatalogTableRow> {\n return {\n title: 'Type',\n field: 'entity.spec.type',\n hidden: options.hidden,\n width: 'auto',\n };\n },\n createSpecLifecycleColumn(): TableColumn<CatalogTableRow> {\n return {\n title: 'Lifecycle',\n field: 'entity.spec.lifecycle',\n };\n },\n createMetadataDescriptionColumn(): TableColumn<CatalogTableRow> {\n return {\n title: 'Description',\n field: 'entity.metadata.description',\n render: ({ entity }) => (\n <OverflowTooltip\n text={entity.metadata.description}\n placement=\"bottom-start\"\n />\n ),\n width: 'auto',\n };\n },\n createTagsColumn(): TableColumn<CatalogTableRow> {\n return {\n title: 'Tags',\n field: 'entity.metadata.tags',\n cellStyle: {\n padding: '0px 16px 0px 20px',\n },\n render: ({ entity }) => (\n <>\n {entity.metadata.tags &&\n entity.metadata.tags.map(t => (\n <Chip\n key={t}\n label={t}\n size=\"small\"\n variant=\"outlined\"\n style={{ marginBottom: '0px' }}\n />\n ))}\n </>\n ),\n width: 'auto',\n };\n },\n createTitleColumn(options?: {\n hidden?: boolean;\n }): TableColumn<CatalogTableRow> {\n return {\n title: 'Title',\n field: 'entity.metadata.title',\n hidden: options?.hidden,\n searchable: true,\n };\n },\n createLabelColumn(\n key: string,\n options?: { title?: string; defaultValue?: string },\n ): TableColumn<CatalogTableRow> {\n return {\n title: options?.title || 'Label',\n field: 'entity.metadata.labels',\n cellStyle: {\n padding: '0px 16px 0px 20px',\n },\n render: ({ entity }: { entity: Entity }) => {\n const labels: Record<string, string> | undefined =\n entity.metadata?.labels;\n const specifiedLabelValue =\n (labels && labels[key]) || options?.defaultValue;\n return (\n <>\n {specifiedLabelValue && (\n <Chip\n key={specifiedLabelValue}\n label={specifiedLabelValue}\n size=\"small\"\n variant=\"outlined\"\n />\n )}\n </>\n );\n },\n width: 'auto',\n };\n },\n createNamespaceColumn(): TableColumn<CatalogTableRow> {\n return {\n title: 'Namespace',\n field: 'entity.metadata.namespace',\n width: 'auto',\n };\n },\n});\n","/*\n * Copyright 2023 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 React from 'react';\n\nimport { Table, TableProps } from '@backstage/core-components';\nimport { CatalogTableRow } from './types';\nimport {\n EntityTextFilter,\n useEntityList,\n} from '@backstage/plugin-catalog-react';\n\ntype PaginatedCatalogTableProps = {\n prev?(): void;\n next?(): void;\n} & TableProps<CatalogTableRow>;\n\n/**\n * @internal\n */\nexport function PaginatedCatalogTable(props: PaginatedCatalogTableProps) {\n const { columns, data, next, prev, title, isLoading, options } = props;\n const { updateFilters } = useEntityList();\n\n return (\n <Table\n title={isLoading ? '' : title}\n columns={columns}\n data={data}\n options={{\n ...options,\n // These settings are configured to force server side pagination\n paginationPosition: 'both',\n pageSizeOptions: [],\n showFirstLastPageButtons: false,\n pageSize: Number.MAX_SAFE_INTEGER,\n emptyRowsWhenPaging: false,\n }}\n onSearchChange={(searchText: string) =>\n updateFilters({\n text: searchText ? new EntityTextFilter(searchText) : undefined,\n })\n }\n onPageChange={page => {\n if (page > 0) {\n next?.();\n } else {\n prev?.();\n }\n }}\n /* this will enable the prev button accordingly */\n page={prev ? 1 : 0}\n /* this will enable the next button accordingly */\n totalCount={next ? Number.MAX_VALUE : Number.MAX_SAFE_INTEGER}\n localization={{ pagination: { labelDisplayedRows: '' } }}\n />\n );\n}\n","/*\n * Copyright 2023 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 { TableColumn } from '@backstage/core-components';\nimport { columnFactories } from './columns';\nimport { CatalogTableColumnsFunc, CatalogTableRow } from './types';\n\n// The defaultCatalogTableColumnsFunc symbol is not directly exported, but through the\n// CatalogTable.defaultColumnsFunc field.\n/** @public */\nexport const defaultCatalogTableColumnsFunc: CatalogTableColumnsFunc = ({\n filters,\n entities,\n}) => {\n const showTypeColumn = filters.type === undefined;\n\n return [\n columnFactories.createTitleColumn({ hidden: true }),\n columnFactories.createNameColumn({ defaultKind: filters.kind?.value }),\n ...createEntitySpecificColumns(),\n columnFactories.createMetadataDescriptionColumn(),\n columnFactories.createTagsColumn(),\n ];\n\n function createEntitySpecificColumns(): TableColumn<CatalogTableRow>[] {\n const baseColumns = [\n columnFactories.createSystemColumn(),\n columnFactories.createOwnerColumn(),\n columnFactories.createSpecTypeColumn({ hidden: !showTypeColumn }),\n columnFactories.createSpecLifecycleColumn(),\n ];\n switch (filters.kind?.value) {\n case 'user':\n return [];\n case 'domain':\n case 'system':\n return [columnFactories.createOwnerColumn()];\n case 'group':\n case 'template':\n return [\n columnFactories.createSpecTypeColumn({ hidden: !showTypeColumn }),\n ];\n case 'location':\n return [\n columnFactories.createSpecTypeColumn({ hidden: !showTypeColumn }),\n columnFactories.createSpecTargetsColumn(),\n ];\n default:\n return entities.every(entity => entity.metadata.namespace === 'default')\n ? baseColumns\n : [...baseColumns, columnFactories.createNamespaceColumn()];\n }\n }\n};\n","/*\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 {\n ANNOTATION_EDIT_URL,\n ANNOTATION_VIEW_URL,\n Entity,\n RELATION_OWNED_BY,\n RELATION_PART_OF,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport {\n CodeSnippet,\n Table,\n TableColumn,\n TableProps,\n WarningPanel,\n} from '@backstage/core-components';\nimport {\n getEntityRelations,\n humanizeEntityRef,\n useEntityList,\n useStarredEntities,\n} from '@backstage/plugin-catalog-react';\nimport Typography from '@material-ui/core/Typography';\nimport { withStyles } from '@material-ui/core/styles';\nimport { visuallyHidden } from '@mui/utils';\nimport Edit from '@material-ui/icons/Edit';\nimport OpenInNew from '@material-ui/icons/OpenInNew';\nimport Star from '@material-ui/icons/Star';\nimport StarBorder from '@material-ui/icons/StarBorder';\nimport { capitalize } from 'lodash';\nimport pluralize from 'pluralize';\nimport React, { ReactNode, useMemo } from 'react';\nimport { columnFactories } from './columns';\nimport { CatalogTableColumnsFunc, CatalogTableRow } from './types';\nimport { PaginatedCatalogTable } from './PaginatedCatalogTable';\nimport { defaultCatalogTableColumnsFunc } from './defaultCatalogTableColumnsFunc';\n\n/**\n * Props for {@link CatalogTable}.\n *\n * @public\n */\nexport interface CatalogTableProps {\n columns?: TableColumn<CatalogTableRow>[] | CatalogTableColumnsFunc;\n actions?: TableProps<CatalogTableRow>['actions'];\n tableOptions?: TableProps<CatalogTableRow>['options'];\n emptyContent?: ReactNode;\n subtitle?: string;\n}\n\nconst YellowStar = withStyles({\n root: {\n color: '#f3ba37',\n },\n})(Star);\n\nconst refCompare = (a: Entity, b: Entity) => {\n const toRef = (entity: Entity) =>\n entity.metadata.title ||\n humanizeEntityRef(entity, {\n defaultKind: 'Component',\n });\n\n return toRef(a).localeCompare(toRef(b));\n};\n\n/** @public */\nexport const CatalogTable = (props: CatalogTableProps) => {\n const {\n columns = defaultCatalogTableColumnsFunc,\n tableOptions,\n subtitle,\n emptyContent,\n } = props;\n const { isStarredEntity, toggleStarredEntity } = useStarredEntities();\n const entityListContext = useEntityList();\n const { loading, error, entities, filters, pageInfo, totalItems } =\n entityListContext;\n const enablePagination = !!pageInfo;\n\n const tableColumns = useMemo(\n () =>\n typeof columns === 'function' ? columns(entityListContext) : columns,\n [columns, entityListContext],\n );\n\n if (error) {\n return (\n <div>\n <WarningPanel\n severity=\"error\"\n title=\"Could not fetch catalog entities.\"\n >\n <CodeSnippet language=\"text\" text={error.toString()} />\n </WarningPanel>\n </div>\n );\n }\n\n const defaultActions: TableProps<CatalogTableRow>['actions'] = [\n ({ entity }) => {\n const url = entity.metadata.annotations?.[ANNOTATION_VIEW_URL];\n const title = 'View';\n\n return {\n icon: () => (\n <>\n <Typography style={visuallyHidden}>{title}</Typography>\n <OpenInNew fontSize=\"small\" />\n </>\n ),\n tooltip: title,\n disabled: !url,\n onClick: () => {\n if (!url) return;\n window.open(url, '_blank');\n },\n };\n },\n ({ entity }) => {\n const url = entity.metadata.annotations?.[ANNOTATION_EDIT_URL];\n const title = 'Edit';\n\n return {\n icon: () => (\n <>\n <Typography style={visuallyHidden}>{title}</Typography>\n <Edit fontSize=\"small\" />\n </>\n ),\n tooltip: title,\n disabled: !url,\n onClick: () => {\n if (!url) return;\n window.open(url, '_blank');\n },\n };\n },\n ({ entity }) => {\n const isStarred = isStarredEntity(entity);\n const title = isStarred ? 'Remove from favorites' : 'Add to favorites';\n\n return {\n cellStyle: { paddingLeft: '1em' },\n icon: () => (\n <>\n <Typography style={visuallyHidden}>{title}</Typography>\n {isStarred ? <YellowStar /> : <StarBorder />}\n </>\n ),\n tooltip: title,\n onClick: () => toggleStarredEntity(entity),\n };\n },\n ];\n\n const currentKind = filters.kind?.value || '';\n const currentType = filters.type?.value || '';\n // TODO(timbonicus): remove the title from the CatalogTable once using EntitySearchBar\n const titlePreamble = capitalize(filters.user?.value ?? 'all');\n const titleDisplay = [titlePreamble, currentType, pluralize(currentKind)]\n .filter(s => s)\n .join(' ');\n\n const title = `${titleDisplay} (${totalItems})`;\n const actions = props.actions || defaultActions;\n const options = {\n actionsColumnIndex: -1,\n loadingType: 'linear' as const,\n showEmptyDataSourceMessage: !loading,\n padding: 'dense' as const,\n ...tableOptions,\n };\n\n if (enablePagination) {\n return (\n <PaginatedCatalogTable\n columns={tableColumns}\n emptyContent={emptyContent}\n isLoading={loading}\n title={title}\n actions={actions}\n subtitle={subtitle}\n options={options}\n data={entities.map(toEntityRow)}\n next={pageInfo.next}\n prev={pageInfo.prev}\n />\n );\n }\n\n const rows = entities.sort(refCompare).map(toEntityRow);\n const pageSize = 20;\n const showPagination = rows.length > pageSize;\n\n return (\n <Table<CatalogTableRow>\n isLoading={loading}\n columns={tableColumns}\n options={{\n paging: showPagination,\n pageSize: pageSize,\n pageSizeOptions: [20, 50, 100],\n ...options,\n }}\n title={title}\n data={rows}\n actions={actions}\n subtitle={subtitle}\n emptyContent={emptyContent}\n />\n );\n};\n\nCatalogTable.columns = columnFactories;\nCatalogTable.defaultColumnsFunc = defaultCatalogTableColumnsFunc;\n\nfunction toEntityRow(entity: Entity) {\n const partOfSystemRelations = getEntityRelations(entity, RELATION_PART_OF, {\n kind: 'system',\n });\n const ownedByRelations = getEntityRelations(entity, RELATION_OWNED_BY);\n\n return {\n entity,\n resolved: {\n // This name is here for backwards compatibility mostly; the\n // presentation of refs in the table should in general be handled with\n // EntityRefLink / EntityName components\n name: humanizeEntityRef(entity, {\n defaultKind: 'Component',\n }),\n entityRef: stringifyEntityRef(entity),\n ownedByRelationsTitle: ownedByRelations\n .map(r => humanizeEntityRef(r, { defaultKind: 'group' }))\n .join(', '),\n ownedByRelations,\n partOfSystemRelationTitle: partOfSystemRelations\n .map(r =>\n humanizeEntityRef(r, {\n defaultKind: 'system',\n }),\n )\n .join(', '),\n partOfSystemRelations,\n },\n };\n}\n","/*\n * Copyright 2023 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 { createTranslationRef } from '@backstage/core-plugin-api/alpha';\n\n/** @alpha */\nexport const catalogTranslationRef = createTranslationRef({\n id: 'catalog',\n messages: {\n indexPage: {\n title: `{{orgName}} Catalog`,\n createButtonTitle: 'Create',\n },\n },\n});\n","/*\n * Copyright 2022 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 { useApi } from '@backstage/core-plugin-api';\nimport useAsync from 'react-use/esm/useAsync';\nimport { catalogApiRef } from '../../api';\n\n/**\n * Fetch and return all availible kinds.\n */\nexport function useAllKinds(): {\n loading: boolean;\n error?: Error;\n allKinds: string[];\n} {\n const catalogApi = useApi(catalogApiRef);\n\n const {\n error,\n loading,\n value: allKinds,\n } = useAsync(async () => {\n const items = await catalogApi\n .getEntityFacets({ facets: ['kind'] })\n .then(response => response.facets.kind?.map(f => f.value).sort() || []);\n return items;\n }, [catalogApi]);\n\n return { loading, error, allKinds: allKinds ?? [] };\n}\n\n/**\n * Filter and capitalize accessible kinds.\n */\nexport function filterKinds(\n allKinds: string[],\n allowedKinds?: string[],\n forcedKinds?: string,\n): Record<string, string> {\n // Before allKinds is loaded, or when a kind is entered manually in the URL, selectedKind may not\n // be present in allKinds. It should still be shown in the dropdown, but may not have the nice\n // enforced casing from the catalog-backend. This makes a key/value record for the Select options,\n // including selectedKind if it's unknown - but allows the selectedKind to get clobbered by the\n // more proper catalog kind if it exists.\n let availableKinds = allKinds;\n if (allowedKinds) {\n availableKinds = availableKinds.filter(k =>\n allowedKinds.some(\n a => a.toLocaleLowerCase('en-US') === k.toLocaleLowerCase('en-US'),\n ),\n );\n }\n if (\n forcedKinds &&\n !allKinds.some(\n a =>\n a.toLocaleLowerCase('en-US') === forcedKinds.toLocaleLowerCase('en-US'),\n )\n ) {\n availableKinds = availableKinds.concat([forcedKinds]);\n }\n\n const kindsMap = availableKinds.sort().reduce((acc, kind) => {\n acc[kind.toLocaleLowerCase('en-US')] = kind;\n return acc;\n }, {} as Record<string, string>);\n\n return kindsMap;\n}\n","/*\n * Copyright 2021 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 { Select } from '@backstage/core-components';\nimport { alertApiRef, useApi } from '@backstage/core-plugin-api';\nimport { Box } from '@material-ui/core';\nimport React, { useEffect, useMemo, useState } from 'react';\nimport { EntityKindFilter } from '../../filters';\nimport { useEntityList } from '../../hooks';\nimport { filterKinds, useAllKinds } from './kindFilterUtils';\n\nfunction useEntityKindFilter(opts: { initialFilter: string }): {\n loading: boolean;\n error?: Error;\n allKinds: string[];\n selectedKind: string;\n setSelectedKind: (kind: string) => void;\n} {\n const {\n filters,\n queryParameters: { kind: kindParameter },\n updateFilters,\n } = useEntityList();\n\n const queryParamKind = useMemo(\n () => [kindParameter].flat()[0],\n [kindParameter],\n );\n\n const [selectedKind, setSelectedKind] = useState(\n queryParamKind ?? filters.kind?.value ?? opts.initialFilter,\n );\n\n // Set selected kinds on query parameter updates; this happens at initial page load and from\n // external updates to the page location.\n useEffect(() => {\n if (queryParamKind) {\n setSelectedKind(queryParamKind);\n }\n }, [queryParamKind]);\n\n // Set selected kind from filters; this happens when the kind filter is\n // updated from another component\n useEffect(() => {\n if (filters.kind?.value) {\n setSelectedKind(filters.kind?.value);\n }\n }, [filters.kind]);\n\n useEffect(() => {\n updateFilters({\n kind: selectedKind ? new EntityKindFilter(selectedKind) : undefined,\n });\n }, [selectedKind, updateFilters]);\n\n const { allKinds, loading, error } = useAllKinds();\n\n return {\n loading,\n error,\n allKinds: allKinds ?? [],\n selectedKind,\n setSelectedKind,\n };\n}\n\n/**\n * Props for {@link EntityKindPicker}.\n *\n * @public\n */\nexport interface EntityKindPickerProps {\n /**\n * Entity kinds to show in the dropdown; by default all kinds are fetched from the catalog and\n * displayed.\n */\n allowedKinds?: string[];\n initialFilter?: string;\n hidden?: boolean;\n}\n\n/** @public */\nexport const EntityKindPicker = (props: EntityKindPickerProps) => {\n const { allowedKinds, hidden, initialFilter = 'component' } = props;\n\n const alertApi = useApi(alertApiRef);\n\n const { error, allKinds, selectedKind, setSelectedKind } =\n useEntityKindFilter({\n initialFilter: initialFilter,\n });\n\n useEffect(() => {\n if (error) {\n alertApi.post({\n message: `Failed to load entity kinds`,\n severity: 'error',\n });\n }\n }, [error, alertApi]);\n\n if (error) return null;\n\n const options = filterKinds(allKinds, allowedKinds, selectedKind);\n\n const items = Object.keys(options).map(key => ({\n value: key,\n label: options[key],\n }));\n\n return hidden ? null : (\n <Box pb={1} pt={1}>\n <Select\n label=\"Kind\"\n items={items}\n selected={selectedKind.toLocaleLowerCase('en-US')}\n onChange={value => setSelectedKind(String(value))}\n />\n </Box>\n );\n};\n","/*\n * Copyright 2021 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 { makeStyles } from '@material-ui/core';\nimport React from 'react';\nimport { EntityLifecycleFilter } from '../../filters';\nimport { EntityAutocompletePicker } from '../EntityAutocompletePicker';\n\n/** @public */\nexport type CatalogReactEntityLifecyclePickerClassKey = 'input';\n\nconst useStyles = makeStyles(\n {\n input: {},\n },\n {\n name: 'CatalogReactEntityLifecyclePicker',\n },\n);\n\n/** @public */\nexport const EntityLifecyclePicker = (props: { initialFilter?: string[] }) => {\n const { initialFilter = [] } = props;\n const classes = useStyles();\n\n return (\n <EntityAutocompletePicker\n label=\"Lifecycle\"\n name=\"lifecycles\"\n path=\"spec.lifecycle\"\n Filter={EntityLifecycleFilter}\n InputProps={{ className: classes.input }}\n initialSelectedOptions={initialFilter}\n />\n );\n};\n","/*\n * Copyright 2023 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 { makeStyles } from '@material-ui/core';\n\nimport React from 'react';\nimport { EntityNamespaceFilter } from '../../filters';\nimport { EntityAutocompletePicker } from '../EntityAutocompletePicker';\n\n/** @public */\nexport type CatalogReactEntityNamespacePickerClassKey = 'input';\n\nconst useStyles = makeStyles(\n {\n input: {},\n },\n {\n name: 'CatalogReactEntityNamespacePicker',\n },\n);\n\n/**\n * Props for {@link EntityNamespacePicker}.\n *\n * @public\n */\nexport interface EntityNamespacePickerProps {\n initiallySelectedNamespaces?: string[];\n}\n\n/** @public */\nexport const EntityNamespacePicker = (props: EntityNamespacePickerProps) => {\n const { initiallySelectedNamespaces } = props;\n const classes = useStyles();\n return (\n <EntityAutocompletePicker\n label=\"Namespace\"\n name=\"namespace\"\n path=\"metadata.namespace\"\n Filter={EntityNamespaceFilter}\n InputProps={{ className: classes.input }}\n initialSelectedOptions={initiallySelectedNamespaces}\n />\n );\n};\n","/*\n * Copyright 2022 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 { EntityErrorFilter, EntityOrphanFilter } from '../../filters';\nimport {\n Box,\n Checkbox,\n FormControlLabel,\n makeStyles,\n TextField,\n Typography,\n} from '@material-ui/core';\nimport CheckBoxIcon from '@material-ui/icons/CheckBox';\nimport CheckBoxOutlineBlankIcon from '@material-ui/icons/CheckBoxOutlineBlank';\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport React, { useState } from 'react';\nimport { useEntityList } from '../../hooks';\nimport { Autocomplete } from '@material-ui/lab';\n\n/** @public */\nexport type CatalogReactEntityProcessingStatusPickerClassKey = 'input';\n\nconst useStyles = makeStyles(\n {\n root: {},\n input: {},\n label: {},\n },\n {\n name: 'CatalogReactEntityProcessingStatusPickerPicker',\n },\n);\n\nconst icon = <CheckBoxOutlineBlankIcon fontSize=\"small\" />;\nconst checkedIcon = <CheckBoxIcon fontSize=\"small\" />;\n\n/** @public */\nexport const EntityProcessingStatusPicker = () => {\n const classes = useStyles();\n const { updateFilters } = useEntityList();\n\n const [selectedAdvancedItems, setSelectedAdvancedItems] = useState<string[]>(\n [],\n );\n\n function orphanChange(value: boolean) {\n updateFilters({\n orphan: value ? new EntityOrphanFilter(value) : undefined,\n });\n }\n\n function errorChange(value: boolean) {\n updateFilters({\n error: value ? new EntityErrorFilter(value) : undefined,\n });\n }\n\n const availableAdvancedItems = ['Is Orphan', 'Has Error'];\n\n return (\n <Box className={classes.root} pb={1} pt={1}>\n <Typography className={classes.label} variant=\"button\" component=\"label\">\n Processing Status\n <Autocomplete<string, true>\n multiple\n disableCloseOnSelect\n options={availableAdvancedItems}\n value={selectedAdvancedItems}\n onChange={(_: object, value: string[]) => {\n setSelectedAdvancedItems(value);\n orphanChange(value.includes('Is Orphan'));\n errorChange(value.includes('Has Error'));\n }}\n renderOption={(option, { selected }) => (\n <FormControlLabel\n control={\n <Checkbox\n icon={icon}\n checkedIcon={checkedIcon}\n checked={selected}\n />\n }\n onClick={event => event.preventDefault()}\n label={option}\n />\n )}\n size=\"small\"\n popupIcon={\n <ExpandMoreIcon data-testid=\"processing-status-picker-expand\" />\n }\n renderInput={params => (\n <TextField\n {...params}\n className={classes.input}\n variant=\"outlined\"\n />\n )}\n />\n </Typography>\n </Box>\n );\n};\n","/*\n * Copyright 2021 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 { useEffect, useMemo, useRef, useState } from 'react';\nimport useAsync from 'react-use/esm/useAsync';\nimport isEqual from 'lodash/isEqual';\nimport sortBy from 'lodash/sortBy';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { catalogApiRef } from '../api';\nimport { useEntityList } from './useEntityListProvider';\nimport { EntityTypeFilter } from '../filters';\n\n/**\n * A hook built on top of `useEntityList` for enabling selection of valid `spec.type` values\n * based on the selected EntityKindFilter.\n * @public\n */\nexport function useEntityTypeFilter(): {\n loading: boolean;\n error?: Error;\n availableTypes: string[];\n selectedTypes: string[];\n setSelectedTypes: (types: string[]) => void;\n} {\n const catalogApi = useApi(catalogApiRef);\n const {\n filters: { kind: kindFilter, type: typeFilter },\n queryParameters: { type: typeParameter },\n updateFilters,\n } = useEntityList();\n\n const flattenedQueryTypes = useMemo(\n () => [typeParameter].flat().filter(Boolean) as string[],\n [typeParameter],\n );\n\n const [selectedTypes, setSelectedTypes] = useState(\n flattenedQueryTypes.length\n ? flattenedQueryTypes\n : typeFilter?.getTypes() ?? [],\n );\n\n // Set selected types on query parameter updates; this happens at initial page load and from\n // external updates to the page location.\n useEffect(() => {\n if (flattenedQueryTypes.length) {\n setSelectedTypes(flattenedQueryTypes);\n }\n }, [flattenedQueryTypes]);\n\n const [availableTypes, setAvailableTypes] = useState<string[]>([]);\n const kind = useMemo(() => kindFilter?.value, [kindFilter]);\n\n // Load all valid spec.type values straight from the catalogApi, paying attention to only the\n // kind filter for a complete list.\n const {\n error,\n loading,\n value: facets,\n } = useAsync(async () => {\n if (kind) {\n const items = await catalogApi\n .getEntityFacets({\n filter: { kind },\n facets: ['spec.type'],\n })\n .then(response => response.facets['spec.type'] || []);\n return items;\n }\n return [];\n }, [kind, catalogApi]);\n\n const facetsRef = useRef(facets);\n useEffect(() => {\n const oldFacets = facetsRef.current;\n facetsRef.current = facets;\n // Delay processing hook until kind and facets load updates have settled to generate list of types;\n // This prevents resetting the type filter due to saved type value from query params not matching the\n // empty set of type values while values are still being loaded; also only run this hook on changes\n // to facets\n if (loading || !kind || oldFacets === facets || !facets) {\n return;\n }\n\n // Sort by facet count descending, so the most common types appear on top\n const newTypes = [\n ...new Set(\n sortBy(facets, f => -f.count).map(f =>\n f.value.toLocaleLowerCase('en-US'),\n ),\n ),\n ];\n setAvailableTypes(newTypes);\n\n // Update type filter to only valid values when the list of available types has changed\n const stillValidTypes = selectedTypes.filter(value =>\n newTypes.includes(value),\n );\n if (!isEqual(selectedTypes, stillValidTypes)) {\n setSelectedTypes(stillValidTypes);\n }\n }, [loading, kind, selectedTypes, setSelectedTypes, facets]);\n\n useEffect(() => {\n updateFilters({\n type: selectedTypes.length\n ? new EntityTypeFilter(selectedTypes)\n : undefined,\n });\n }, [selectedTypes, updateFilters]);\n\n return {\n loading,\n error,\n availableTypes,\n selectedTypes,\n setSelectedTypes,\n };\n}\n","/*\n * Copyright 2021 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 React, { useEffect } from 'react';\nimport { Box } from '@material-ui/core';\nimport { useEntityTypeFilter } from '../../hooks/useEntityTypeFilter';\n\nimport { alertApiRef, useApi } from '@backstage/core-plugin-api';\nimport { Select } from '@backstage/core-components';\n\n/**\n * Props for {@link EntityTypePicker}.\n *\n * @public\n */\nexport interface EntityTypePickerProps {\n initialFilter?: string;\n hidden?: boolean;\n}\n\n/** @public */\nexport const EntityTypePicker = (props: EntityTypePickerProps) => {\n const { hidden, initialFilter } = props;\n const alertApi = useApi(alertApiRef);\n const { error, availableTypes, selectedTypes, setSelectedTypes } =\n useEntityTypeFilter();\n\n useEffect(() => {\n if (error) {\n alertApi.post({\n message: `Failed to load entity types`,\n severity: 'error',\n });\n }\n if (initialFilter) {\n setSelectedTypes([initialFilter]);\n }\n }, [error, alertApi, initialFilter, setSelectedTypes]);\n\n if (availableTypes.length === 0 || error) return null;\n\n const items = [\n { value: 'all', label: 'all' },\n ...availableTypes.map((type: string) => ({\n value: type,\n label: type,\n })),\n ];\n\n return hidden ? null : (\n <Box pb={1} pt={1}>\n <Select\n label=\"Type\"\n items={items}\n selected={(items.length > 1 ? selectedTypes[0] : undefined) ?? 'all'}\n onChange={value =>\n setSelectedTypes(value === 'all' ? [] : [String(value)])\n }\n />\n </Box>\n );\n};\n","/*\n * Copyright 2024 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 React from 'react';\nimport { UserListFilterKind } from '../../types';\nimport { EntityKindPicker } from '../EntityKindPicker';\nimport { EntityLifecyclePicker } from '../EntityLifecyclePicker';\nimport { EntityNamespacePicker } from '../EntityNamespacePicker';\nimport {\n EntityOwnerPickerProps,\n EntityOwnerPicker,\n} from '../EntityOwnerPicker';\nimport { EntityProcessingStatusPicker } from '../EntityProcessingStatusPicker';\nimport { EntityTagPicker } from '../EntityTagPicker';\nimport { EntityTypePicker } from '../EntityTypePicker';\nimport { UserListPicker } from '../UserListPicker';\n\n/**\n * Props for default filters.\n *\n * @public\n */\nexport type DefaultFiltersProps = {\n initialKind?: string;\n initiallySelectedFilter?: UserListFilterKind;\n ownerPickerMode?: EntityOwnerPickerProps['mode'];\n initiallySelectedNamespaces?: string[];\n};\n\n/** @public */\nexport const DefaultFilters = (props: DefaultFiltersProps) => {\n const {\n initialKind,\n initiallySelectedFilter,\n ownerPickerMode,\n initiallySelectedNamespaces,\n } = props;\n return (\n <>\n <EntityKindPicker initialFilter={initialKind} />\n <EntityTypePicker />\n <UserListPicker initialFilter={initiallySelectedFilter} />\n <EntityOwnerPicker mode={ownerPickerMode} />\n <EntityLifecyclePicker />\n <EntityTagPicker />\n <EntityProcessingStatusPicker />\n <EntityNamespacePicker\n initiallySelectedNamespaces={initiallySelectedNamespaces}\n />\n </>\n );\n};\n","/*\n * Copyright 2021 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 {\n Content,\n ContentHeader,\n CreateButton,\n PageWithHeader,\n SupportButton,\n TableColumn,\n TableProps,\n} from '@backstage/core-components';\nimport { configApiRef, useApi, useRouteRef } from '@backstage/core-plugin-api';\nimport {\n CatalogFilterLayout,\n EntityListProvider,\n UserListFilterKind,\n EntityOwnerPickerProps,\n} from '@backstage/plugin-catalog-react';\nimport React, { ReactNode } from 'react';\nimport { createComponentRouteRef } from '../../routes';\nimport { CatalogTable, CatalogTableRow } from '../CatalogTable';\nimport { catalogTranslationRef } from '../../translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\nimport { CatalogTableColumnsFunc } from '../CatalogTable/types';\nimport { catalogEntityCreatePermission } from '@backstage/plugin-catalog-common/alpha';\nimport { usePermission } from '@backstage/plugin-permission-react';\nimport { DefaultFilters } from '@backstage/plugin-catalog-react';\n\n/** @internal */\nexport type BaseCatalogPageProps = {\n filters: ReactNode;\n content?: ReactNode;\n pagination?: boolean | { limit?: number };\n};\n\n/** @internal */\nexport function BaseCatalogPage(props: BaseCatalogPageProps) {\n const { filters, content = <CatalogTable />, pagination } = props;\n const orgName =\n useApi(configApiRef).getOptionalString('organization.name') ?? 'Backstage';\n const createComponentLink = useRouteRef(createComponentRouteRef);\n const { t } = useTranslationRef(catalogTranslationRef);\n const { allowed } = usePermission({\n permission: catalogEntityCreatePermission,\n });\n\n return (\n <PageWithHeader title={t('indexPage.title', { orgName })} themeId=\"home\">\n <Content>\n <ContentHeader title=\"\">\n {allowed && (\n <CreateButton\n title={t('indexPage.createButtonTitle')}\n to={createComponentLink && createComponentLink()}\n />\n )}\n <SupportButton>All your software catalog entities</SupportButton>\n </ContentHeader>\n <EntityListProvider pagination={pagination}>\n <CatalogFilterLayout>\n <CatalogFilterLayout.Filters>{filters}</CatalogFilterLayout.Filters>\n <CatalogFilterLayout.Content>{content}</CatalogFilterLayout.Content>\n </CatalogFilterLayout>\n </EntityListProvider>\n </Content>\n </PageWithHeader>\n );\n}\n\n/**\n * Props for root catalog pages.\n *\n * @public\n */\nexport interface DefaultCatalogPageProps {\n initiallySelectedFilter?: UserListFilterKind;\n columns?: TableColumn<CatalogTableRow>[] | CatalogTableColumnsFunc;\n actions?: TableProps<CatalogTableRow>['actions'];\n initialKind?: string;\n tableOptions?: TableProps<CatalogTableRow>['options'];\n emptyContent?: ReactNode;\n ownerPickerMode?: EntityOwnerPickerProps['mode'];\n pagination?: boolean | { limit?: number };\n filters?: ReactNode;\n initiallySelectedNamespaces?: string[];\n}\n\nexport function DefaultCatalogPage(props: DefaultCatalogPageProps) {\n const {\n columns,\n actions,\n initiallySelectedFilter = 'owned',\n initialKind = 'component',\n tableOptions = {},\n emptyContent,\n pagination,\n ownerPickerMode,\n filters,\n initiallySelectedNamespaces,\n } = props;\n\n return (\n <BaseCatalogPage\n filters={\n filters ?? (\n <DefaultFilters\n initialKind={initialKind}\n initiallySelectedFilter={initiallySelectedFilter}\n ownerPickerMode={ownerPickerMode}\n initiallySelectedNamespaces={initiallySelectedNamespaces}\n />\n )\n }\n content={\n <CatalogTable\n columns={columns}\n actions={actions}\n tableOptions={tableOptions}\n emptyContent={emptyContent}\n />\n }\n pagination={pagination}\n />\n );\n}\n","/*\n * Copyright 2021 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 React from 'react';\nimport { useOutlet } from 'react-router-dom';\nimport {\n DefaultCatalogPage,\n DefaultCatalogPageProps,\n} from './DefaultCatalogPage';\n\nexport function CatalogPage(props: DefaultCatalogPageProps) {\n const outlet = useOutlet();\n\n return outlet || <DefaultCatalogPage {...props} />;\n}\n","/*\n * Copyright 2021 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 {\n AuthorizePermissionRequest,\n AuthorizePermissionResponse,\n DefinitivePolicyDecision,\n EvaluatorRequestOptions,\n Permission,\n PermissionAuthorizer,\n PermissionEvaluator,\n QueryPermissionRequest,\n QueryPermissionResponse,\n ResourcePermission,\n} from '../types';\n\n/**\n * Check if the two parameters are equivalent permissions.\n * @public\n */\nexport function isPermission<T extends Permission>(\n permission: Permission,\n comparedPermission: T,\n): permission is T {\n return permission.name === comparedPermission.name;\n}\n\n/**\n * Check if a given permission is a {@link ResourcePermission}. When\n * `resourceType` is supplied as the second parameter, also checks if\n * the permission has the specified resource type.\n * @public\n */\nexport function isResourcePermission<T extends string = string>(\n permission: Permission,\n resourceType?: T,\n): permission is ResourcePermission<T> {\n if (!('resourceType' in permission)) {\n return false;\n }\n\n return !resourceType || permission.resourceType === resourceType;\n}\n\n/**\n * Check if a given permission is related to a create action.\n * @public\n */\nexport function isCreatePermission(permission: Permission) {\n return permission.attributes.action === 'create';\n}\n\n/**\n * Check if a given permission is related to a read action.\n * @public\n */\nexport function isReadPermission(permission: Permission) {\n return permission.attributes.action === 'read';\n}\n\n/**\n * Check if a given permission is related to an update action.\n * @public\n */\nexport function isUpdatePermission(permission: Permission) {\n return permission.attributes.action === 'update';\n}\n\n/**\n * Check if a given permission is related to a delete action.\n * @public\n */\nexport function isDeletePermission(permission: Permission) {\n return permission.attributes.action === 'delete';\n}\n\n/**\n * Convert {@link PermissionAuthorizer} to {@link PermissionEvaluator}.\n *\n * @public\n */\nexport function toPermissionEvaluator(\n permissionAuthorizer: PermissionAuthorizer,\n): PermissionEvaluator {\n return {\n authorize: async (\n requests: AuthorizePermissionRequest[],\n options?: EvaluatorRequestOptions,\n ): Promise<AuthorizePermissionResponse[]> => {\n const response = await permissionAuthorizer.authorize(requests, options);\n\n return response as DefinitivePolicyDecision[];\n },\n authorizeConditional(\n requests: QueryPermissionRequest[],\n options?: EvaluatorRequestOptions,\n ): Promise<QueryPermissionResponse[]> {\n const parsedRequests =\n requests as unknown as AuthorizePermissionRequest[];\n return permissionAuthorizer.authorize(parsedRequests, options);\n },\n };\n}\n","/*\n * Copyright 2021 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 { useApi } from '@backstage/core-plugin-api';\nimport { permissionApiRef } from '../apis';\nimport {\n AuthorizeResult,\n isResourcePermission,\n Permission,\n ResourcePermission,\n} from '@backstage/plugin-permission-common';\nimport useSWR from 'swr';\n\n/** @public */\nexport type AsyncPermissionResult = {\n loading: boolean;\n allowed: boolean;\n error?: Error;\n};\n\n/**\n * React hook utility for authorization. Given either a non-resource\n * {@link @backstage/plugin-permission-common#Permission} or a\n * {@link @backstage/plugin-permission-common#ResourcePermission} and an\n * optional resourceRef, it will return whether or not access is allowed (for\n * the given resource, if resourceRef is provided). See\n * {@link @backstage/plugin-permission-common/PermissionClient#authorize} for\n * more details.\n *\n * The resourceRef field is optional to allow calling this hook with an\n * entity that might be loading asynchronously, but when resourceRef is not\n * supplied, the value of `allowed` will always be false.\n *\n * Note: This hook uses stale-while-revalidate to help avoid flicker in UI\n * elements that would be conditionally rendered based on the `allowed` result\n * of this hook.\n * @public\n */\nexport function usePermission(\n input:\n | {\n permission: Exclude<Permission, ResourcePermission>;\n resourceRef?: never;\n }\n | {\n permission: ResourcePermission;\n resourceRef: string | undefined;\n },\n): AsyncPermissionResult {\n const permissionApi = useApi(permissionApiRef);\n const { data, error } = useSWR(input, async (args: typeof input) => {\n // We could make the resourceRef parameter required to avoid this check, but\n // it would make using this hook difficult in situations where the entity\n // must be asynchronously loaded, so instead we short-circuit to a deny when\n // no resourceRef is supplied, on the assumption that the resourceRef is\n // still loading outside the hook.\n if (isResourcePermission(args.permission) && !args.resourceRef) {\n return AuthorizeResult.DENY;\n }\n\n const { result } = await permissionApi.authorize(args);\n return result;\n });\n\n if (error) {\n return { error, loading: false, allowed: false };\n }\n if (data === undefined) {\n return { loading: true, allowed: false };\n }\n return { loading: false, allowed: data === AuthorizeResult.ALLOW };\n}\n"],"names":["useStyles","makeStyles","container","overflow","name","OverflowTooltip","props","hover","setHover","useState","isMounted","useIsMounted","classes","handleToggled","truncated","Tooltip","title","text","placement","disableHoverListener","TextTruncate","line","onToggled","containerClassName","createPermission","attributes","resourceType","type","RESOURCE_TYPE_CATALOG_ENTITY","catalogEntityReadPermission","action","catalogEntityCreatePermission","catalogEntityDeletePermission","catalogEntityRefreshPermission","catalogLocationReadPermission","catalogLocationCreatePermission","catalogLocationDeletePermission","catalogPermissions","CreateButton","to","isXSScreen","useMediaQuery","theme","breakpoints","down","IconButton","component","RouterLink","color","size","AddCircleOutline","Button","variant","columnFactories","Object","freeze","createNameColumn","options","formatContent","entity","metadata","humanizeEntityRef","defaultKind","field","highlight","customSort","entity1","entity2","localeCompare","render","EntityRefLink","entityRef","createSystemColumn","resolved","EntityRefLinks","entityRefs","partOfSystemRelations","createOwnerColumn","ownedByRelations","createSpecTargetsColumn","customFilterAndSearch","query","row","targets","spec","Array","isArray","target","join","toLocaleUpperCase","includes","createSpecTypeColumn","hidden","width","createSpecLifecycleColumn","createMetadataDescriptionColumn","description","createTagsColumn","cellStyle","padding","tags","map","t","Chip","label","style","marginBottom","createTitleColumn","searchable","createLabelColumn","key","labels","specifiedLabelValue","defaultValue","createNamespaceColumn","PaginatedCatalogTable","columns","data","next","prev","isLoading","updateFilters","useEntityList","Table","paginationPosition","pageSizeOptions","showFirstLastPageButtons","pageSize","Number","MAX_SAFE_INTEGER","emptyRowsWhenPaging","onSearchChange","searchText","EntityTextFilter","undefined","onPageChange","page","totalCount","MAX_VALUE","localization","pagination","labelDisplayedRows","defaultCatalogTableColumnsFunc","filters","entities","showTypeColumn","kind","value","createEntitySpecificColumns","baseColumns","every","namespace","YellowStar","withStyles","root","Star","refCompare","a","b","toRef","CatalogTable","tableOptions","subtitle","emptyContent","isStarredEntity","toggleStarredEntity","useStarredEntities","entityListContext","loading","error","pageInfo","totalItems","enablePagination","tableColumns","useMemo","div","WarningPanel","severity","CodeSnippet","language","toString","defaultActions","url","annotations","ANNOTATION_VIEW_URL","icon","Typography","visuallyHidden","OpenInNew","fontSize","tooltip","disabled","onClick","window","open","ANNOTATION_EDIT_URL","Edit","isStarred","paddingLeft","StarBorder","currentKind","currentType","capitalize","user","pluralize","filter","s","actions","actionsColumnIndex","loadingType","showEmptyDataSourceMessage","toEntityRow","rows","sort","showPagination","length","paging","defaultColumnsFunc","getEntityRelations","RELATION_PART_OF","RELATION_OWNED_BY","stringifyEntityRef","ownedByRelationsTitle","r","partOfSystemRelationTitle","catalogTranslationRef","createTranslationRef","id","messages","indexPage","createButtonTitle","useAllKinds","catalogApi","useApi","catalogApiRef","allKinds","useAsync","getEntityFacets","facets","then","response","f","filterKinds","allowedKinds","forcedKinds","availableKinds","k","some","toLocaleLowerCase","concat","reduce","acc","useEntityKindFilter","opts","queryParameters","kindParameter","queryParamKind","flat","selectedKind","setSelectedKind","initialFilter","useEffect","EntityKindFilter","EntityKindPicker","alertApi","alertApiRef","post","message","items","keys","Box","pb","pt","Select","selected","onChange","String","input","EntityLifecyclePicker","EntityAutocompletePicker","path","Filter","EntityLifecycleFilter","InputProps","className","initialSelectedOptions","EntityNamespacePicker","initiallySelectedNamespaces","EntityNamespaceFilter","CheckBoxOutlineBlankIcon","checkedIcon","CheckBoxIcon","EntityProcessingStatusPicker","selectedAdvancedItems","setSelectedAdvancedItems","orphanChange","orphan","EntityOrphanFilter","errorChange","EntityErrorFilter","availableAdvancedItems","Autocomplete","multiple","disableCloseOnSelect","_","renderOption","option","FormControlLabel","control","Checkbox","checked","event","preventDefault","popupIcon","ExpandMoreIcon","data-testid","renderInput","params","TextField","useEntityTypeFilter","kindFilter","typeFilter","typeParameter","flattenedQueryTypes","Boolean","selectedTypes","setSelectedTypes","getTypes","availableTypes","setAvailableTypes","facetsRef","useRef","oldFacets","current","newTypes","Set","sortBy","count","stillValidTypes","isEqual","EntityTypeFilter","EntityTypePicker","DefaultFilters","initialKind","initiallySelectedFilter","ownerPickerMode","UserListPicker","EntityOwnerPicker","mode","EntityTagPicker","BaseCatalogPage","content","orgName","configApiRef","getOptionalString","createComponentLink","useRouteRef","createComponentRouteRef","useTranslationRef","allowed","usePermission","permission","PageWithHeader","themeId","Content","ContentHeader","SupportButton","EntityListProvider","CatalogFilterLayout","Filters","DefaultCatalogPage","CatalogPage","useOutlet","isPermission","comparedPermission","isResourcePermission","isCreatePermission","isReadPermission","isUpdatePermission","isDeletePermission","toPermissionEvaluator","permissionAuthorizer","authorize","requests","authorizeConditional","parsedRequests","permissionApi","permissionApiRef","useSWR","args","resourceRef","AuthorizeResult","DENY","result","ALLOW"],"sourceRoot":""}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[5011],{39330:function(f,m,e){"use strict";var o,a=e(4293),u=e(78920);o={value:!0},m.A=void 0;var i=u(e(14041)),n=a(e(74044)),l=(0,n.default)(i.createElement("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"}),"OpenInNew");m.A=l},26694:function(f,m){"use strict";const e={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:-1,overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"};m.A=e},86912:function(f){function m(e,o,a){switch(a.length){case 0:return e.call(o);case 1:return e.call(o,a[0]);case 2:return e.call(o,a[0],a[1]);case 3:return e.call(o,a[0],a[1],a[2])}return e.apply(o,a)}f.exports=m},84570:function(f,m,e){var o=e(47170),a=e(45770),u=a(o);f.exports=u},90313:function(f,m,e){var o=e(11129),a=e(20714);function u(i,n,l,d,s){var x=-1,b=i.length;for(l||(l=a),s||(s=[]);++x<b;){var h=i[x];n>0&&l(h)?n>1?u(h,n-1,l,d,s):o(s,h):d||(s[s.length]=h)}return s}f.exports=u},41393:function(f,m,e){var o=e(84570),a=e(36529);function u(i,n){var l=-1,d=a(i)?Array(i.length):[];return o(i,function(s,x,b){d[++l]=n(s,x,b)}),d}f.exports=u},70310:function(f,m,e){var o=e(65111),a=e(57923),u=e(3334),i=e(41393),n=e(50642),l=e(49460),d=e(46775),s=e(22053),x=e(53142);function b(h,t,g){t.length?t=o(t,function($){return x($)?function(P){return a(P,$.length===1?$[0]:$)}:$}):t=[s];var O=-1;t=o(t,l(u));var w=i(h,function($,P,W){var Y=o(t,function(j){return j($)});return{criteria:Y,index:++O,value:$}});return n(w,function($,P){return d($,P,g)})}f.exports=b},23945:function(f,m,e){var o=e(22053),a=e(75234),u=e(80796);function i(n,l){return u(a(n,l,o),n+"")}f.exports=i},47403:function(f,m,e){var o=e(82619),a=e(72532),u=e(22053),i=a?function(n,l){return a(n,"toString",{configurable:!0,enumerable:!1,value:o(l),writable:!0})}:u;f.exports=i},50642:function(f){function m(e,o){var a=e.length;for(e.sort(o);a--;)e[a]=e[a].value;return e}f.exports=m},63521:function(f,m,e){var o=e(51187);function a(u,i){if(u!==i){var n=u!==void 0,l=u===null,d=u===u,s=o(u),x=i!==void 0,b=i===null,h=i===i,t=o(i);if(!b&&!t&&!s&&u>i||s&&x&&h&&!b&&!t||l&&x&&h||!n&&h||!d)return 1;if(!l&&!s&&!t&&u<i||t&&n&&d&&!l&&!s||b&&n&&d||!x&&d||!h)return-1}return 0}f.exports=a},46775:function(f,m,e){var o=e(63521);function a(u,i,n){for(var l=-1,d=u.criteria,s=i.criteria,x=d.length,b=n.length;++l<x;){var h=o(d[l],s[l]);if(h){if(l>=b)return h;var t=n[l];return h*(t=="desc"?-1:1)}}return u.index-i.index}f.exports=a},45770:function(f,m,e){var o=e(36529);function a(u,i){return function(n,l){if(n==null)return n;if(!o(n))return u(n,l);for(var d=n.length,s=i?d:-1,x=Object(n);(i?s--:++s<d)&&l(x[s],s,x)!==!1;);return n}}f.exports=a},20714:function(f,m,e){var o=e(65650),a=e(3283),u=e(53142),i=o?o.isConcatSpreadable:void 0;function n(l){return u(l)||a(l)||!!(i&&l&&l[i])}f.exports=n},74535:function(f,m,e){var o=e(46285),a=e(36529),u=e(69632),i=e(41580);function n(l,d,s){if(!i(s))return!1;var x=typeof d;return(x=="number"?a(s)&&u(d,s.length):x=="string"&&d in s)?o(s[d],l):!1}f.exports=n},75234:function(f,m,e){var o=e(86912),a=Math.max;function u(i,n,l){return n=a(n===void 0?i.length-1:n,0),function(){for(var d=arguments,s=-1,x=a(d.length-n,0),b=Array(x);++s<x;)b[s]=d[n+s];s=-1;for(var h=Array(n+1);++s<n;)h[s]=d[s];return h[n]=l(b),o(i,this,h)}}f.exports=u},80796:function(f,m,e){var o=e(47403),a=e(3316),u=a(o);f.exports=u},3316:function(f){var m=800,e=16,o=Date.now;function a(u){var i=0,n=0;return function(){var l=o(),d=e-(l-n);if(n=l,d>0){if(++i>=m)return arguments[0]}else i=0;return u.apply(void 0,arguments)}}f.exports=a},82619:function(f){function m(e){return function(){return e}}f.exports=m},46343:function(f,m,e){var o=e(94687);function a(u,i){return o(u,i)}f.exports=a},40074:function(f,m,e){var o=e(90313),a=e(70310),u=e(23945),i=e(74535),n=u(function(l,d){if(l==null)return[];var s=d.length;return s>1&&i(l,d[0],d[1])?d=[]:s>2&&i(d[0],d[1],d[2])&&(d=[d[0]]),a(l,o(d,1),[])});f.exports=n},65398:function(f){(function(m,e){f.exports=e()})(this,function(){var m=[],e=[],o={},a={},u={};function i(t){return typeof t=="string"?new RegExp("^"+t+"$","i"):t}function n(t,g){return t===g?g:t===t.toLowerCase()?g.toLowerCase():t===t.toUpperCase()?g.toUpperCase():t[0]===t[0].toUpperCase()?g.charAt(0).toUpperCase()+g.substr(1).toLowerCase():g.toLowerCase()}function l(t,g){return t.replace(/\$(\d{1,2})/g,function(O,w){return g[w]||""})}function d(t,g){return t.replace(g[0],function(O,w){var $=l(g[1],arguments);return n(O===""?t[w-1]:O,$)})}function s(t,g,O){if(!t.length||o.hasOwnProperty(t))return g;for(var w=O.length;w--;){var $=O[w];if($[0].test(g))return d(g,$)}return g}function x(t,g,O){return function(w){var $=w.toLowerCase();return g.hasOwnProperty($)?n(w,$):t.hasOwnProperty($)?n(w,t[$]):s($,w,O)}}function b(t,g,O,w){return function($){var P=$.toLowerCase();return g.hasOwnProperty(P)?!0:t.hasOwnProperty(P)?!1:s(P,P,O)===P}}function h(t,g,O){var w=g===1?h.singular(t):h.plural(t);return(O?g+" ":"")+w}return h.plural=x(u,a,m),h.isPlural=b(u,a,m),h.singular=x(a,u,e),h.isSingular=b(a,u,e),h.addPluralRule=function(t,g){m.push([i(t),g])},h.addSingularRule=function(t,g){e.push([i(t),g])},h.addUncountableRule=function(t){if(typeof t=="string"){o[t.toLowerCase()]=!0;return}h.addPluralRule(t,"$0"),h.addSingularRule(t,"$0")},h.addIrregularRule=function(t,g){g=g.toLowerCase(),t=t.toLowerCase(),u[t]=g,a[g]=t},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach(function(t){return h.addIrregularRule(t[0],t[1])}),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach(function(t){return h.addPluralRule(t[0],t[1])}),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach(function(t){return h.addSingularRule(t[0],t[1])}),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eé]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(h.addUncountableRule),h})},62220:function(f,m,e){"use strict";var o,a,u;(function(i,n){if(1)a=[m,e(14041),e(39067)],o=n,u=typeof o=="function"?o.apply(m,a):o,u!==void 0&&(f.exports=u);else var l})(void 0,function(i,n,l){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;var d=x(n),s=x(l);function x(c){return c&&c.__esModule?c:{default:c}}function b(c){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?b=function(v){return typeof v}:b=function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},b(c)}function h(c,p){if(c==null)return{};var v=t(c,p),r,y;if(Object.getOwnPropertySymbols){var C=Object.getOwnPropertySymbols(c);for(y=0;y<C.length;y++)r=C[y],!(p.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(c,r)&&(v[r]=c[r])}return v}function t(c,p){if(c==null)return{};var v={},r=Object.keys(c),y,C;for(C=0;C<r.length;C++)y=r[C],!(p.indexOf(y)>=0)&&(v[y]=c[y]);return v}function g(c,p){if(!(c instanceof p))throw new TypeError("Cannot call a class as a function")}function O(c,p){for(var v=0;v<p.length;v++){var r=p[v];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(c,r.key,r)}}function w(c,p,v){return p&&O(c.prototype,p),v&&O(c,v),c}function $(c,p){return p&&(b(p)==="object"||typeof p=="function")?p:W(c)}function P(c){return P=Object.setPrototypeOf?Object.getPrototypeOf:function(v){return v.__proto__||Object.getPrototypeOf(v)},P(c)}function W(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function Y(c,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function");c.prototype=Object.create(p&&p.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),p&&j(c,p)}function j(c,p){return j=Object.setPrototypeOf||function(r,y){return r.__proto__=y,r},j(c,p)}function L(c,p,v){return p in c?Object.defineProperty(c,p,{value:v,enumerable:!0,configurable:!0,writable:!0}):c[p]=v,c}var ae=1e-4,te=function(p,v){return Math.abs(p-v)<ae},G=function(c){Y(p,c);function p(){var v,r;g(this,p);for(var y=arguments.length,C=new Array(y),z=0;z<y;z++)C[z]=arguments[z];return r=$(this,(v=P(p)).call.apply(v,[this].concat(C))),L(W(r),"onResize",function(){r.rafId&&window.cancelAnimationFrame(r.rafId),r.rafId=window.requestAnimationFrame(r.update.bind(W(r)))}),L(W(r),"onToggled",function(A){typeof r.props.onToggled=="function"&&setTimeout(function(){return r.props.onToggled(A)},0)}),L(W(r),"onTruncated",function(){typeof r.props.onTruncated=="function"&&setTimeout(function(){return r.props.onTruncated()},0)}),L(W(r),"onCalculated",function(){typeof r.props.onCalculated=="function"&&setTimeout(function(){return r.props.onCalculated()},0)}),L(W(r),"update",function(){var A=window.getComputedStyle(r.scope),k=[A["font-weight"],A["font-style"],A["font-size"],A["font-family"],A["letter-spacing"]].join(" ");r.canvas.font=k,r.forceUpdate()}),r}return w(p,[{key:"componentDidMount",value:function(){var r=document.createElement("canvas"),y=document.createDocumentFragment(),C=window.getComputedStyle(this.scope),z=[C["font-weight"],C["font-style"],C["font-size"],C["font-family"]].join(" ");y.appendChild(r),this.canvas=r.getContext("2d"),this.canvas.font=z,this.forceUpdate(),window.addEventListener("resize",this.onResize)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.onResize),this.rafId&&window.cancelAnimationFrame(this.rafId)}},{key:"measureWidth",value:function(r){return this.canvas.measureText(r).width}},{key:"getRenderText",value:function(){var r=this.props,y=r.containerClassName,C=r.element,z=r.line,A=r.onCalculated,k=r.onTruncated,ne=r.onToggled,E=r.text,_=r.textElement,U=r.textTruncateChild,J=r.truncateText,Q=r.maxCalculateTimes,D=h(r,["containerClassName","element","line","onCalculated","onTruncated","onToggled","text","textElement","textTruncateChild","truncateText","maxCalculateTimes"]),M=this.scope.getBoundingClientRect().width;if(M===0)return null;var X=this.measureWidth(E);if(M>X||te(M,X))return this.onToggled(!1),(0,n.createElement)(_,D,E);var I="";if(U&&typeof U.type=="string"){var K=U.type;(K.indexOf("span")>=0||K.indexOf("a")>=0)&&(I=U.props.children)}for(var T=1,B=E.length,S="",H=0,R=0,N=z,F=0,V=!1,re=!1,Z=0,q=-1,ee="",ie=0;N-- >0;){for(ee=N?"":J+(I?" "+I:"");T<=B;)if(S=E.substr(R,T),F=this.measureWidth(S+ee),F<M)H=E.indexOf(" ",T+1),H===-1?(T+=1,V=!1):(V=!0,T=H);else{do{if(ie++>=Q)break;S=E.substr(R,T),N||T--,S[S.length-1]===" "&&(S=E.substr(R,T-1)),V?(q=S.lastIndexOf(" "),q>-1?(T=q,N&&T++,S=E.substr(R,T)):(T--,S=E.substr(R,T))):(T--,S=E.substr(R,T)),F=this.measureWidth(S+ee)}while((F>M||te(F,M))&&S.length>0);R+=T;break}if(T>=B){R=B;break}V&&!re&&E.substr(Z,T).indexOf(" ")===-1&&(re=E.substr(Z,T).indexOf(" ")===-1,N--),Z=T+1}return R===B?(this.onToggled(!1),(0,n.createElement)(_,D,E)):(this.onTruncated(),this.onToggled(!0),d.default.createElement("span",D,(0,n.createElement)(_,D,E.substr(0,R)+J+" "),U))}},{key:"render",value:function(){var r=this,y=this.props,C=y.element,z=y.text,A=y.style,k=A===void 0?{}:A,ne=y.containerClassName,E=y.line,_=y.onCalculated,U=y.onTruncated,J=y.onToggled,Q=y.textElement,D=y.textTruncateChild,M=y.truncateText,X=y.maxCalculateTimes,I=h(y,["element","text","style","containerClassName","line","onCalculated","onTruncated","onToggled","textElement","textTruncateChild","truncateText","maxCalculateTimes"]),K=k.fontWeight,T=k.fontStyle,B=k.fontSize,S=k.fontFamily,H=this.scope&&E?this.getRenderText():(0,n.createElement)(Q,I,z),R={ref:function(F){r.scope=F},className:ne,style:{overflow:"hidden",fontWeight:K,fontStyle:T,fontSize:B,fontFamily:S}};return this.scope&&this.onCalculated(),(0,n.createElement)(C,R,H)}}]),p}(n.Component);L(G,"propTypes",{containerClassName:s.default.string,element:s.default.string,line:s.default.oneOfType([s.default.number,s.default.bool]),onCalculated:s.default.func,onTruncated:s.default.func,onToggled:s.default.func,text:s.default.string,textElement:s.default.elementType,textTruncateChild:s.default.node,truncateText:s.default.string,maxCalculateTimes:s.default.number}),L(G,"defaultProps",{element:"div",line:1,text:"",textElement:"span",truncateText:"\u2026",maxCalculateTimes:10}),i.default=G,f.exports=i.default})},85058:function(f,m,e){"use strict";e.d(m,{a:function(){return a}});var o=e(14041);function a(u=!1){const i=(0,o.useRef)(u),n=(0,o.useCallback)(()=>i.current,[]);return(0,o.useEffect)(()=>(i.current=!0,()=>{i.current=!1}),[]),n}}}]);})();
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=5011.7b676837.chunk.js.map
|