@techdocs/cli 0.0.0-nightly-20240313022044 → 0.0.0-nightly-20240315021107

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 CHANGED
@@ -1,14 +1,14 @@
1
1
  # @techdocs/cli
2
2
 
3
- ## 0.0.0-nightly-20240313022044
3
+ ## 0.0.0-nightly-20240315021107
4
4
 
5
5
  ### Patch Changes
6
6
 
7
7
  - Updated dependencies
8
- - @backstage/backend-common@0.0.0-nightly-20240313022044
9
- - @backstage/config@0.0.0-nightly-20240313022044
10
- - @backstage/plugin-techdocs-node@0.0.0-nightly-20240313022044
11
- - @backstage/catalog-model@0.0.0-nightly-20240313022044
8
+ - @backstage/backend-common@0.0.0-nightly-20240315021107
9
+ - @backstage/config@0.0.0-nightly-20240315021107
10
+ - @backstage/plugin-techdocs-node@0.0.0-nightly-20240315021107
11
+ - @backstage/catalog-model@0.0.0-nightly-20240315021107
12
12
  - @backstage/cli-common@0.1.13
13
13
 
14
14
  ## 1.8.6-next.2
@@ -961,6 +961,56 @@
961
961
  "$schema": "http://json-schema.org/draft-07/schema#"
962
962
  }
963
963
  },
964
+ {
965
+ "path": "../../plugins/stackstorm/config.d.ts",
966
+ "value": {
967
+ "type": "object",
968
+ "properties": {
969
+ "stackstorm": {
970
+ "type": "object",
971
+ "properties": {
972
+ "webUrl": {
973
+ "description": "StackStorm Web UI url\nUsed in links to StackStorm web UI",
974
+ "visibility": "frontend",
975
+ "type": "string"
976
+ }
977
+ },
978
+ "required": [
979
+ "webUrl"
980
+ ]
981
+ }
982
+ },
983
+ "$schema": "http://json-schema.org/draft-07/schema#"
984
+ }
985
+ },
986
+ {
987
+ "path": "../../node_modules/@oriflame/backstage-plugin-score-card/config.d.ts",
988
+ "value": {
989
+ "type": "object",
990
+ "properties": {
991
+ "scorecards": {
992
+ "description": "Extra configuration for score card plugin",
993
+ "type": "object",
994
+ "properties": {
995
+ "jsonDataUrl": {
996
+ "description": "The public absolute root URL with json file defining the score card entries.",
997
+ "visibility": "frontend",
998
+ "type": "string"
999
+ },
1000
+ "wikiLinkTemplate": {
1001
+ "description": "The template for the link to the wiki, e.g. \"https://TBD/XXX/_wiki/wikis/XXX.wiki/{id}\"",
1002
+ "visibility": "frontend",
1003
+ "type": "string"
1004
+ }
1005
+ }
1006
+ }
1007
+ },
1008
+ "required": [
1009
+ "scorecards"
1010
+ ],
1011
+ "$schema": "http://json-schema.org/draft-07/schema#"
1012
+ }
1013
+ },
964
1014
  {
965
1015
  "path": "../backend-common/config.d.ts",
966
1016
  "value": {
@@ -1376,52 +1426,47 @@
1376
1426
  }
1377
1427
  },
1378
1428
  {
1379
- "path": "../../plugins/stackstorm/config.d.ts",
1380
- "value": {
1381
- "type": "object",
1382
- "properties": {
1383
- "stackstorm": {
1384
- "type": "object",
1385
- "properties": {
1386
- "webUrl": {
1387
- "description": "StackStorm Web UI url\nUsed in links to StackStorm web UI",
1388
- "visibility": "frontend",
1389
- "type": "string"
1390
- }
1391
- },
1392
- "required": [
1393
- "webUrl"
1394
- ]
1395
- }
1396
- },
1397
- "$schema": "http://json-schema.org/draft-07/schema#"
1398
- }
1399
- },
1400
- {
1401
- "path": "../../node_modules/@oriflame/backstage-plugin-score-card/config.d.ts",
1429
+ "path": "../../node_modules/@oriflame/backstage-plugin-score-card/node_modules/@backstage/core-components/config.d.ts",
1402
1430
  "value": {
1403
1431
  "type": "object",
1404
1432
  "properties": {
1405
- "scorecards": {
1406
- "description": "Extra configuration for score card plugin",
1433
+ "auth": {
1407
1434
  "type": "object",
1408
1435
  "properties": {
1409
- "jsonDataUrl": {
1410
- "description": "The public absolute root URL with json file defining the score card entries.",
1411
- "visibility": "frontend",
1412
- "type": "string"
1413
- },
1414
- "wikiLinkTemplate": {
1415
- "description": "The template for the link to the wiki, e.g. \"https://TBD/XXX/_wiki/wikis/XXX.wiki/{id}\"",
1416
- "visibility": "frontend",
1417
- "type": "string"
1436
+ "autologout": {
1437
+ "description": "Autologout feature configuration",
1438
+ "type": "object",
1439
+ "properties": {
1440
+ "enabled": {
1441
+ "description": "Enable or disable the autologout feature",
1442
+ "visibility": "frontend",
1443
+ "type": "boolean"
1444
+ },
1445
+ "idleTimeoutMinutes": {
1446
+ "description": "Number of minutes after which the inactive user is logged out automatically.\nDefault is 60 minutes (1 hour)",
1447
+ "visibility": "frontend",
1448
+ "type": "number"
1449
+ },
1450
+ "promptBeforeIdleSeconds": {
1451
+ "description": "Number of seconds before the idle timeout where the user will be asked if it's still active.\nA dialog will be shown.\nDefault is 10 seconds.\nSet to 0 seconds to disable the prompt.",
1452
+ "visibility": "frontend",
1453
+ "type": "number"
1454
+ },
1455
+ "useWorkerTimers": {
1456
+ "description": "Enable/disable the usage of worker thread timers instead of main thread timers.\nDefault is true.\nIf you experience some browser incompatibility, you may try to set this to false.",
1457
+ "visibility": "frontend",
1458
+ "type": "boolean"
1459
+ },
1460
+ "logoutIfDisconnected": {
1461
+ "description": "Enable/disable the automatic logout also on users that are logged in but with no Backstage tabs open.\nDefault is true.",
1462
+ "visibility": "frontend",
1463
+ "type": "boolean"
1464
+ }
1465
+ }
1418
1466
  }
1419
1467
  }
1420
1468
  }
1421
1469
  },
1422
- "required": [
1423
- "scorecards"
1424
- ],
1425
1470
  "$schema": "http://json-schema.org/draft-07/schema#"
1426
1471
  }
1427
1472
  },
@@ -1609,51 +1654,6 @@
1609
1654
  "$schema": "http://json-schema.org/draft-07/schema#"
1610
1655
  }
1611
1656
  },
1612
- {
1613
- "path": "../../node_modules/@oriflame/backstage-plugin-score-card/node_modules/@backstage/core-components/config.d.ts",
1614
- "value": {
1615
- "type": "object",
1616
- "properties": {
1617
- "auth": {
1618
- "type": "object",
1619
- "properties": {
1620
- "autologout": {
1621
- "description": "Autologout feature configuration",
1622
- "type": "object",
1623
- "properties": {
1624
- "enabled": {
1625
- "description": "Enable or disable the autologout feature",
1626
- "visibility": "frontend",
1627
- "type": "boolean"
1628
- },
1629
- "idleTimeoutMinutes": {
1630
- "description": "Number of minutes after which the inactive user is logged out automatically.\nDefault is 60 minutes (1 hour)",
1631
- "visibility": "frontend",
1632
- "type": "number"
1633
- },
1634
- "promptBeforeIdleSeconds": {
1635
- "description": "Number of seconds before the idle timeout where the user will be asked if it's still active.\nA dialog will be shown.\nDefault is 10 seconds.\nSet to 0 seconds to disable the prompt.",
1636
- "visibility": "frontend",
1637
- "type": "number"
1638
- },
1639
- "useWorkerTimers": {
1640
- "description": "Enable/disable the usage of worker thread timers instead of main thread timers.\nDefault is true.\nIf you experience some browser incompatibility, you may try to set this to false.",
1641
- "visibility": "frontend",
1642
- "type": "boolean"
1643
- },
1644
- "logoutIfDisconnected": {
1645
- "description": "Enable/disable the automatic logout also on users that are logged in but with no Backstage tabs open.\nDefault is true.",
1646
- "visibility": "frontend",
1647
- "type": "boolean"
1648
- }
1649
- }
1650
- }
1651
- }
1652
- }
1653
- },
1654
- "$schema": "http://json-schema.org/draft-07/schema#"
1655
- }
1656
- },
1657
1657
  {
1658
1658
  "path": "../../node_modules/@oriflame/backstage-plugin-score-card/node_modules/@backstage/plugin-permission-common/config.d.ts",
1659
1659
  "value": {
@@ -1 +1 @@
1
- <!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Backstage is an open source framework for building developer portals"/><link rel="manifest" href="/manifest.json" crossorigin="use-credentials"/><link rel="icon" href="/favicon.ico"/><link rel="shortcut icon" href="/favicon.ico"/><link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"/><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"/><link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"/><link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5"/><title>Techdocs Preview App</title><script defer="defer" src="/static/runtime.d7355744.js"></script><script defer="defer" src="/static/module-material-ui.8c838e72.js"></script><script defer="defer" src="/static/module-material-table.7d74b785.js"></script><script defer="defer" src="/static/module-lodash.11460fc1.js"></script><script defer="defer" src="/static/module-react-dom.266912b1.js"></script><script defer="defer" src="/static/module-react-router.296c491a.js"></script><script defer="defer" src="/static/module-react-router-dom.3fde9fd7.js"></script><script defer="defer" src="/static/module-react-beautiful-dnd.d141b9e2.js"></script><script defer="defer" src="/static/module-zod.e526c254.js"></script><script defer="defer" src="/static/module-i18next.b1663d5a.js"></script><script defer="defer" src="/static/vendor.d7355744.js"></script><script defer="defer" src="/static/main.d7355744.js"></script></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
1
+ <!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Backstage is an open source framework for building developer portals"/><link rel="manifest" href="/manifest.json" crossorigin="use-credentials"/><link rel="icon" href="/favicon.ico"/><link rel="shortcut icon" href="/favicon.ico"/><link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"/><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"/><link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"/><link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5"/><title>Techdocs Preview App</title><script defer="defer" src="/static/runtime.1ac2bc2a.js"></script><script defer="defer" src="/static/module-material-ui.8c838e72.js"></script><script defer="defer" src="/static/module-material-table.7d74b785.js"></script><script defer="defer" src="/static/module-lodash.11460fc1.js"></script><script defer="defer" src="/static/module-react-dom.266912b1.js"></script><script defer="defer" src="/static/module-react-router.296c491a.js"></script><script defer="defer" src="/static/module-react-router-dom.3fde9fd7.js"></script><script defer="defer" src="/static/module-react-beautiful-dnd.d141b9e2.js"></script><script defer="defer" src="/static/module-zod.e526c254.js"></script><script defer="defer" src="/static/module-i18next.b1663d5a.js"></script><script defer="defer" src="/static/vendor.1ac2bc2a.js"></script><script defer="defer" src="/static/main.1ac2bc2a.js"></script></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
@@ -0,0 +1,3 @@
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(7031),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(91638),mt=e(7341);function Vt(){const n=(0,y.gf)(mt.v),{error:a,loading:i,value:l}=(0,ut.default)(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.default)(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.e587d970.chunk.js.map