@kuadrant/kuadrant-backstage-plugin-frontend 0.2.0 → 0.2.1

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.
Files changed (134) hide show
  1. package/dist/components/ApiKeyManagementTab/ApiKeyManagementTab.esm.js +21 -3
  2. package/dist/components/ApiKeyManagementTab/ApiKeyManagementTab.esm.js.map +1 -1
  3. package/dist/components/CreateAPIProductDialog/CreateAPIProductDialog.esm.js +1 -7
  4. package/dist/components/CreateAPIProductDialog/CreateAPIProductDialog.esm.js.map +1 -1
  5. package/dist/components/KuadrantIcon/KuadrantIcon.esm.js +22 -0
  6. package/dist/components/KuadrantIcon/KuadrantIcon.esm.js.map +1 -0
  7. package/dist/components/icons.esm.js +11 -0
  8. package/dist/components/icons.esm.js.map +1 -0
  9. package/dist/index.d.ts +8 -1
  10. package/dist/index.esm.js +2 -0
  11. package/dist/index.esm.js.map +1 -1
  12. package/dist-scalprum/internal.plugin-kuadrant.c4fb9c2347d3ad03a5d0.js +2 -0
  13. package/dist-scalprum/internal.plugin-kuadrant.c4fb9c2347d3ad03a5d0.js.map +1 -0
  14. package/dist-scalprum/plugin-manifest.json +3 -3
  15. package/dist-scalprum/static/{1037.58dd29ad.chunk.js → 1037.25758556.chunk.js} +1 -1
  16. package/dist-scalprum/static/{1037.58dd29ad.chunk.js.map → 1037.25758556.chunk.js.map} +1 -1
  17. package/dist-scalprum/static/{1584.ae3779f0.chunk.js → 1584.1e45e570.chunk.js} +2 -2
  18. package/dist-scalprum/static/{1584.ae3779f0.chunk.js.map → 1584.1e45e570.chunk.js.map} +1 -1
  19. package/dist-scalprum/static/1719.246c020d.chunk.js +2 -0
  20. package/dist-scalprum/static/1719.246c020d.chunk.js.map +1 -0
  21. package/dist-scalprum/static/{1881.8221c002.chunk.js → 1881.56cde36b.chunk.js} +1 -1
  22. package/dist-scalprum/static/{1881.8221c002.chunk.js.map → 1881.56cde36b.chunk.js.map} +1 -1
  23. package/dist-scalprum/static/286.ee43f560.chunk.js +2 -0
  24. package/dist-scalprum/static/286.ee43f560.chunk.js.map +1 -0
  25. package/dist-scalprum/static/2952.b54bd390.chunk.js +2 -0
  26. package/dist-scalprum/static/2952.b54bd390.chunk.js.map +1 -0
  27. package/dist-scalprum/static/2967.0c2ef90e.chunk.js +2 -0
  28. package/dist-scalprum/static/2967.0c2ef90e.chunk.js.map +1 -0
  29. package/dist-scalprum/static/3015.1fe097c2.chunk.js +3 -0
  30. package/dist-scalprum/static/3015.1fe097c2.chunk.js.LICENSE.txt +9 -0
  31. package/dist-scalprum/static/3015.1fe097c2.chunk.js.map +1 -0
  32. package/dist-scalprum/static/{3581.b5b97f08.chunk.js → 3581.ebe5968a.chunk.js} +1 -1
  33. package/dist-scalprum/static/{3581.b5b97f08.chunk.js.map → 3581.ebe5968a.chunk.js.map} +1 -1
  34. package/dist-scalprum/static/3657.882640ca.chunk.js +3 -0
  35. package/dist-scalprum/static/3657.882640ca.chunk.js.LICENSE.txt +8 -0
  36. package/dist-scalprum/static/3657.882640ca.chunk.js.map +1 -0
  37. package/dist-scalprum/static/{3897.ef4554b5.chunk.js → 3897.6e9c07c0.chunk.js} +1 -1
  38. package/dist-scalprum/static/{3897.ef4554b5.chunk.js.map → 3897.6e9c07c0.chunk.js.map} +1 -1
  39. package/dist-scalprum/static/{3947.ad129ba4.chunk.js → 3947.4f4aa8c2.chunk.js} +1 -1
  40. package/dist-scalprum/static/{3947.ad129ba4.chunk.js.map → 3947.4f4aa8c2.chunk.js.map} +1 -1
  41. package/dist-scalprum/static/{3976.e0873210.chunk.js → 3976.e8a8fda2.chunk.js} +2 -2
  42. package/dist-scalprum/static/{3976.e0873210.chunk.js.map → 3976.e8a8fda2.chunk.js.map} +1 -1
  43. package/dist-scalprum/static/{4083.488ff7a9.chunk.js → 4083.811c4e7a.chunk.js} +2 -2
  44. package/dist-scalprum/static/{4083.488ff7a9.chunk.js.map → 4083.811c4e7a.chunk.js.map} +1 -1
  45. package/dist-scalprum/static/4908.196a4425.chunk.js +2 -0
  46. package/dist-scalprum/static/{5453.3c20d0a6.chunk.js.map → 4908.196a4425.chunk.js.map} +1 -1
  47. package/dist-scalprum/static/{5010.6241b64f.chunk.js → 5010.4f67737b.chunk.js} +2 -2
  48. package/dist-scalprum/static/{5010.6241b64f.chunk.js.map → 5010.4f67737b.chunk.js.map} +1 -1
  49. package/dist-scalprum/static/{512.f1c51799.chunk.js → 512.d592d164.chunk.js} +1 -1
  50. package/dist-scalprum/static/{512.f1c51799.chunk.js.map → 512.d592d164.chunk.js.map} +1 -1
  51. package/dist-scalprum/static/{5289.2e686027.chunk.js → 5289.55069930.chunk.js} +2 -2
  52. package/dist-scalprum/static/{5289.2e686027.chunk.js.map → 5289.55069930.chunk.js.map} +1 -1
  53. package/dist-scalprum/static/5605.430f697e.chunk.js +2 -0
  54. package/dist-scalprum/static/5605.430f697e.chunk.js.map +1 -0
  55. package/dist-scalprum/static/5978.bf347a09.chunk.js +2 -0
  56. package/dist-scalprum/static/5978.bf347a09.chunk.js.map +1 -0
  57. package/dist-scalprum/static/6038.63d1f832.chunk.js +3 -0
  58. package/dist-scalprum/static/6038.63d1f832.chunk.js.LICENSE.txt +8 -0
  59. package/dist-scalprum/static/6038.63d1f832.chunk.js.map +1 -0
  60. package/dist-scalprum/static/{6272.b5645dc2.chunk.js → 6272.3ed14ea4.chunk.js} +1 -1
  61. package/dist-scalprum/static/{6272.b5645dc2.chunk.js.map → 6272.3ed14ea4.chunk.js.map} +1 -1
  62. package/dist-scalprum/static/635.f63679a5.chunk.js +3 -0
  63. package/dist-scalprum/static/635.f63679a5.chunk.js.map +1 -0
  64. package/dist-scalprum/static/6371.7b57ac27.chunk.js +3 -0
  65. package/dist-scalprum/static/6371.7b57ac27.chunk.js.LICENSE.txt +9 -0
  66. package/dist-scalprum/static/6371.7b57ac27.chunk.js.map +1 -0
  67. package/dist-scalprum/static/{6386.2d20c412.chunk.js → 6386.5922f271.chunk.js} +3 -3
  68. package/dist-scalprum/static/{6386.2d20c412.chunk.js.map → 6386.5922f271.chunk.js.map} +1 -1
  69. package/dist-scalprum/static/{6426.bf20c588.chunk.js → 6426.4c18bab5.chunk.js} +1 -1
  70. package/dist-scalprum/static/{6426.bf20c588.chunk.js.map → 6426.4c18bab5.chunk.js.map} +1 -1
  71. package/dist-scalprum/static/6777.a2b77ec5.chunk.js +2 -0
  72. package/dist-scalprum/static/6777.a2b77ec5.chunk.js.map +1 -0
  73. package/dist-scalprum/static/{6800.ddabed69.chunk.js → 6800.a45da2f4.chunk.js} +2 -2
  74. package/dist-scalprum/static/{6800.ddabed69.chunk.js.map → 6800.a45da2f4.chunk.js.map} +1 -1
  75. package/dist-scalprum/static/{6972.e47ec97e.chunk.js → 6972.f22b9446.chunk.js} +1 -1
  76. package/dist-scalprum/static/{6972.e47ec97e.chunk.js.map → 6972.f22b9446.chunk.js.map} +1 -1
  77. package/dist-scalprum/static/7005.8190ad95.chunk.js +2 -0
  78. package/dist-scalprum/static/7005.8190ad95.chunk.js.map +1 -0
  79. package/dist-scalprum/static/7164.5dc4bc72.chunk.js +2 -0
  80. package/dist-scalprum/static/7164.5dc4bc72.chunk.js.map +1 -0
  81. package/dist-scalprum/static/{7266.e760b8c3.chunk.js → 7266.3c4174cc.chunk.js} +1 -1
  82. package/dist-scalprum/static/{7266.e760b8c3.chunk.js.map → 7266.3c4174cc.chunk.js.map} +1 -1
  83. package/dist-scalprum/static/7270.d52407cd.chunk.js +2 -0
  84. package/dist-scalprum/static/7270.d52407cd.chunk.js.map +1 -0
  85. package/dist-scalprum/static/7717.6f5b9dd7.chunk.js +3 -0
  86. package/dist-scalprum/static/7717.6f5b9dd7.chunk.js.map +1 -0
  87. package/dist-scalprum/static/{7791.8f84478d.chunk.js → 7791.ad31cf6d.chunk.js} +2 -2
  88. package/dist-scalprum/static/{7791.8f84478d.chunk.js.map → 7791.ad31cf6d.chunk.js.map} +1 -1
  89. package/dist-scalprum/static/{8563.46f1a3e1.chunk.js → 8563.6501eafb.chunk.js} +2 -2
  90. package/dist-scalprum/static/{8563.46f1a3e1.chunk.js.map → 8563.6501eafb.chunk.js.map} +1 -1
  91. package/dist-scalprum/static/{9079.b6d5c19c.chunk.js → 9079.2ddaea57.chunk.js} +1 -1
  92. package/dist-scalprum/static/{9079.b6d5c19c.chunk.js.map → 9079.2ddaea57.chunk.js.map} +1 -1
  93. package/dist-scalprum/static/9239.1acfe112.chunk.js +2 -0
  94. package/dist-scalprum/static/9239.1acfe112.chunk.js.map +1 -0
  95. package/dist-scalprum/static/exposed-KuadrantIcon.08abbb96.chunk.js +3 -0
  96. package/dist-scalprum/static/exposed-KuadrantIcon.08abbb96.chunk.js.LICENSE.txt +9 -0
  97. package/dist-scalprum/static/exposed-KuadrantIcon.08abbb96.chunk.js.map +1 -0
  98. package/dist-scalprum/static/exposed-KuadrantPage.5ae00605.chunk.js +2 -0
  99. package/dist-scalprum/static/exposed-KuadrantPage.5ae00605.chunk.js.map +1 -0
  100. package/dist-scalprum/static/exposed-PluginRoot.949381c2.chunk.js +2 -0
  101. package/dist-scalprum/static/exposed-PluginRoot.949381c2.chunk.js.map +1 -0
  102. package/package.json +6 -3
  103. package/dist-scalprum/internal.plugin-kuadrant.b3d35dc8b21ce867aa09.js +0 -2
  104. package/dist-scalprum/internal.plugin-kuadrant.b3d35dc8b21ce867aa09.js.map +0 -1
  105. package/dist-scalprum/static/1319.ac195ac2.chunk.js +0 -2
  106. package/dist-scalprum/static/1319.ac195ac2.chunk.js.map +0 -1
  107. package/dist-scalprum/static/2967.7c6a34cd.chunk.js +0 -2
  108. package/dist-scalprum/static/2967.7c6a34cd.chunk.js.map +0 -1
  109. package/dist-scalprum/static/3118.daee3324.chunk.js +0 -3
  110. package/dist-scalprum/static/3118.daee3324.chunk.js.map +0 -1
  111. package/dist-scalprum/static/483.d55d6ab2.chunk.js +0 -2
  112. package/dist-scalprum/static/483.d55d6ab2.chunk.js.map +0 -1
  113. package/dist-scalprum/static/5203.3df62d7e.chunk.js +0 -2
  114. package/dist-scalprum/static/5203.3df62d7e.chunk.js.map +0 -1
  115. package/dist-scalprum/static/5453.3c20d0a6.chunk.js +0 -2
  116. package/dist-scalprum/static/6371.f183dddb.chunk.js +0 -3
  117. package/dist-scalprum/static/6371.f183dddb.chunk.js.map +0 -1
  118. package/dist-scalprum/static/7005.d548f8f1.chunk.js +0 -2
  119. package/dist-scalprum/static/7005.d548f8f1.chunk.js.map +0 -1
  120. package/dist-scalprum/static/7270.301a3c46.chunk.js +0 -2
  121. package/dist-scalprum/static/7270.301a3c46.chunk.js.map +0 -1
  122. package/dist-scalprum/static/9051.f095a8a1.chunk.js +0 -2
  123. package/dist-scalprum/static/9051.f095a8a1.chunk.js.map +0 -1
  124. package/dist-scalprum/static/9838.589f2156.chunk.js +0 -2
  125. package/dist-scalprum/static/9838.589f2156.chunk.js.map +0 -1
  126. package/dist-scalprum/static/exposed-PluginRoot.a8448fcc.chunk.js +0 -2
  127. package/dist-scalprum/static/exposed-PluginRoot.a8448fcc.chunk.js.map +0 -1
  128. /package/dist-scalprum/static/{1584.ae3779f0.chunk.js.LICENSE.txt → 1584.1e45e570.chunk.js.LICENSE.txt} +0 -0
  129. /package/dist-scalprum/static/{4083.488ff7a9.chunk.js.LICENSE.txt → 4083.811c4e7a.chunk.js.LICENSE.txt} +0 -0
  130. /package/dist-scalprum/static/{5010.6241b64f.chunk.js.LICENSE.txt → 5010.4f67737b.chunk.js.LICENSE.txt} +0 -0
  131. /package/dist-scalprum/static/{6371.f183dddb.chunk.js.LICENSE.txt → 635.f63679a5.chunk.js.LICENSE.txt} +0 -0
  132. /package/dist-scalprum/static/{6386.2d20c412.chunk.js.LICENSE.txt → 6386.5922f271.chunk.js.LICENSE.txt} +0 -0
  133. /package/dist-scalprum/static/{3118.daee3324.chunk.js.LICENSE.txt → 7717.6f5b9dd7.chunk.js.LICENSE.txt} +0 -0
  134. /package/dist-scalprum/static/{8563.46f1a3e1.chunk.js.LICENSE.txt → 8563.6501eafb.chunk.js.LICENSE.txt} +0 -0
@@ -0,0 +1,2 @@
1
+ "use strict";(self.webpackChunkinternal_plugin_kuadrant=self.webpackChunkinternal_plugin_kuadrant||[]).push([[4908],{34541:(n,t,i)=>{i.d(t,{G:()=>j});var e=i(31085),o=(i(95478),i(25467)),r=i(22097),a=i(42367),s=i(86687),l=i(96040),d=i(72501),u=i(10394),c=i(58837),h=i(91638),v=i(46205),p=i(34955),A=i(89509),m=i(71255),P=i(70980);const x=(0,c.A)(n=>({label:{fontWeight:600,color:n.palette.text.secondary,marginBottom:n.spacing(.5),fontSize:"0.75rem",textTransform:"uppercase"}})),j=()=>{var n,t,i,c,j,f,I,y,w,g;const k=x(),{entity:b}=(0,o.tN)(),N=(0,r.useApi)(P.s),O=(0,r.useApi)(r.identityApiRef),{allowed:S,loading:_}=(0,v.l)(p.Al),C=null===(n=b.metadata.annotations)||void 0===n?void 0:n["kuadrant.io/namespace"],B=null===(t=b.metadata.annotations)||void 0===t?void 0:t["kuadrant.io/apiproduct"],{value:E}=(0,h.A)(async()=>(await O.getBackstageIdentity()).userEntityRef.split("/")[1]||"guest",[O]),{value:D,loading:G,error:R}=(0,h.A)(async()=>C&&B?N.getApiProduct(C,B):null,[N,C,B]),U=null==D||null===(c=D.metadata)||void 0===c||null===(i=c.annotations)||void 0===i?void 0:i["backstage.io/owner"],Y=null==U?void 0:U.split("/")[1],z=S||E&&Y===E;if(!C||!B)return(0,e.jsx)(l.n,{title:"API Product Information",children:(0,e.jsx)(d.A,{children:"No APIProduct linked to this API entity"})});if(G||_)return(0,e.jsx)(l.n,{title:"API Product Information",children:(0,e.jsx)(s.k,{})});if(D&&!z)return(0,e.jsx)(l.n,{title:"API Product Information",children:(0,e.jsx)(u.A,{p:2,children:(0,e.jsx)(d.A,{variant:"body2",color:"textSecondary",children:"You don't have permission to view this API product's details. Only the API owner or users with admin permissions can view this information."})})});if(R&&R.message.includes("you can only read your own"))return(0,e.jsx)(l.n,{title:"API Product Information",children:(0,e.jsx)(u.A,{p:2,children:(0,e.jsx)(d.A,{variant:"body2",color:"textSecondary",children:"You don't have permission to view this API product's details. Only the API owner or users with admin permissions can view this information."})})});if(R)return(0,e.jsx)(l.n,{title:"API Product Information",children:(0,e.jsx)(a._,{error:R})});if(!D)return(0,e.jsx)(l.n,{title:"API Product Information",children:(0,e.jsx)(d.A,{children:"APIProduct not found"})});const F=(null===(f=D.status)||void 0===f||null===(j=f.discoveredAuthScheme)||void 0===j?void 0:j.authentication)||{},L=Object.values(F).find(n=>n.hasOwnProperty("jwt")),T=Boolean(L),W=null==L||null===(I=L.jwt)||void 0===I?void 0:I.issuerUrl,q=null===(w=D.status)||void 0===w||null===(y=w.oidcDiscovery)||void 0===y?void 0:y.tokenEndpoint;return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(l.n,{title:"API Product Details",children:[(0,e.jsxs)(u.A,{mb:2,children:[(0,e.jsx)(d.A,{variant:"caption",className:k.label,children:"Product Name"}),(0,e.jsx)(d.A,{variant:"h6",children:(null===(g=D.spec)||void 0===g?void 0:g.displayName)||B})]}),(0,e.jsx)(A.O,{product:D,showStatus:!1,showCatalogLink:!1})]}),T&&W&&(0,e.jsx)(u.A,{mt:2,children:(0,e.jsx)(m.n,{issuerUrl:W,tokenEndpoint:q})})]})}},34908:(n,t,i)=>{i.r(t),i.d(t,{ApiProductInfoCard:()=>e.G});var e=i(34541)}}]);
2
+ //# sourceMappingURL=4908.196a4425.chunk.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"static/5453.3c20d0a6.chunk.js","mappings":"kWAYA,MAAMA,GAAYC,EAAAA,EAAAA,GAAYC,IAAW,CACvCC,MAAO,CACLC,WAAY,IACZC,MAAOH,EAAMI,QAAQC,KAAKC,UAC1BC,aAAcP,EAAMQ,QAAQ,IAC5BC,SAAU,UACVC,cAAe,gBAINC,EAAqB,K,IAUdC,EACKA,EAgBTC,EAAAA,EA+DMA,EAAAA,EAIF,EACOA,EAAAA,EAUdA,EAxGX,MAAMC,EA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AAA,EAAGA,CAACgC,GAAI,E,UACP,SAACC,EAAAA,EAAgBA,CACfb,UAAWF,EACXK,cAAeF,S","sources":["webpack://internal.plugin-kuadrant/./src/components/ApiProductInfoCard/ApiProductInfoCard.tsx"],"sourcesContent":["import React from 'react';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport { useApi, identityApiRef } from '@backstage/core-plugin-api';\nimport { InfoCard, Progress, ResponseErrorPanel } from '@backstage/core-components';\nimport { Typography, Box, makeStyles } from '@material-ui/core';\nimport useAsync from 'react-use/lib/useAsync';\nimport { useKuadrantPermission } from '../../utils/permissions';\nimport { kuadrantApiProductReadAllPermission } from '../../permissions';\nimport { ApiProductDetails } from '../ApiProductDetails';\nimport { OidcProviderCard } from '../OidcProviderCard';\nimport { kuadrantApiRef } from '../../api';\n\nconst useStyles = makeStyles((theme) => ({\n label: {\n fontWeight: 600,\n color: theme.palette.text.secondary,\n marginBottom: theme.spacing(0.5),\n fontSize: '0.75rem',\n textTransform: 'uppercase',\n },\n}));\n\nexport const ApiProductInfoCard = () => {\n const classes = useStyles();\n const { entity } = useEntity();\n const kuadrantApi = useApi(kuadrantApiRef);\n const identityApi = useApi(identityApiRef);\n\n const { allowed: canReadAll, loading: permLoading } = useKuadrantPermission(\n kuadrantApiProductReadAllPermission\n );\n\n const namespace = entity.metadata.annotations?.['kuadrant.io/namespace'];\n const apiProductName = entity.metadata.annotations?.['kuadrant.io/apiproduct'];\n\n const { value: currentUserId } = useAsync(async () => {\n const identity = await identityApi.getBackstageIdentity();\n return identity.userEntityRef.split('/')[1] || 'guest';\n }, [identityApi]);\n\n const { value: apiProduct, loading, error } = useAsync(async () => {\n if (!namespace || !apiProductName) {\n return null;\n }\n\n return kuadrantApi.getApiProduct(namespace, apiProductName);\n }, [kuadrantApi, namespace, apiProductName]);\n\n // check if user has permission to view this api product\n const owner = apiProduct?.metadata?.annotations?.['backstage.io/owner'];\n const ownerUserId = owner?.split('/')[1];\n const canView = canReadAll || (currentUserId && ownerUserId === currentUserId);\n\n if (!namespace || !apiProductName) {\n return (\n <InfoCard title=\"API Product Information\">\n <Typography>No APIProduct linked to this API entity</Typography>\n </InfoCard>\n );\n }\n\n if (loading || permLoading) {\n return (\n <InfoCard title=\"API Product Information\">\n <Progress />\n </InfoCard>\n );\n }\n\n // show permission message if user doesn't have permission\n if (apiProduct && !canView) {\n return (\n <InfoCard title=\"API Product Information\">\n <Box p={2}>\n <Typography variant=\"body2\" color=\"textSecondary\">\n You don't have permission to view this API product's details. Only the API owner or users with admin permissions can view this information.\n </Typography>\n </Box>\n </InfoCard>\n );\n }\n\n // also show permission message if we got a permission error from the backend\n if (error && error.message.includes('you can only read your own')) {\n return (\n <InfoCard title=\"API Product Information\">\n <Box p={2}>\n <Typography variant=\"body2\" color=\"textSecondary\">\n You don't have permission to view this API product's details. Only the API owner or users with admin permissions can view this information.\n </Typography>\n </Box>\n </InfoCard>\n );\n }\n\n if (error) {\n return (\n <InfoCard title=\"API Product Information\">\n <ResponseErrorPanel error={error} />\n </InfoCard>\n );\n }\n\n if (!apiProduct) {\n return (\n <InfoCard title=\"API Product Information\">\n <Typography>APIProduct not found</Typography>\n </InfoCard>\n );\n }\n\n // check for OIDC auth scheme\n const authSchemes = apiProduct.status?.discoveredAuthScheme?.authentication || {};\n const schemeObjects = Object.values(authSchemes);\n const jwtScheme = schemeObjects.find((scheme: any) => scheme.hasOwnProperty('jwt'));\n const hasOidc = Boolean(jwtScheme);\n const jwtIssuer = (jwtScheme as any)?.jwt?.issuerUrl;\n const jwtTokenEndpoint = apiProduct.status?.oidcDiscovery?.tokenEndpoint;\n\n return (\n <>\n <InfoCard title=\"API Product Details\">\n <Box mb={2}>\n <Typography variant=\"caption\" className={classes.label}>\n Product Name\n </Typography>\n <Typography variant=\"h6\">\n {apiProduct.spec?.displayName || apiProductName}\n </Typography>\n </Box>\n <ApiProductDetails\n product={apiProduct}\n showStatus={false}\n showCatalogLink={false}\n />\n </InfoCard>\n {hasOidc && jwtIssuer && (\n <Box mt={2}>\n <OidcProviderCard\n issuerUrl={jwtIssuer}\n tokenEndpoint={jwtTokenEndpoint}\n />\n </Box>\n )}\n </>\n );\n};\n"],"names":["useStyles","makeStyles","theme","label","fontWeight","color","palette","text","secondary","marginBottom","spacing","fontSize","textTransform","ApiProductInfoCard","entity","apiProduct","classes","useEntity","kuadrantApi","useApi","kuadrantApiRef","identityApi","identityApiRef","allowed","canReadAll","loading","permLoading","useKuadrantPermission","kuadrantApiProductReadAllPermission","namespace","metadata","annotations","apiProductName","value","currentUserId","useAsync","async","getBackstageIdentity","userEntityRef","split","error","getApiProduct","owner","ownerUserId","canView","InfoCard","title","Typography","Progress","Box","p","variant","message","includes","ResponseErrorPanel","authSchemes","status","discoveredAuthScheme","authentication","jwtScheme","Object","values","find","scheme","hasOwnProperty","hasOidc","Boolean","jwtIssuer","jwt","issuerUrl","jwtTokenEndpoint","oidcDiscovery","tokenEndpoint","mb","className","spec","displayName","ApiProductDetails","product","showStatus","showCatalogLink","mt","OidcProviderCard"],"sourceRoot":""}
1
+ {"version":3,"file":"static/4908.196a4425.chunk.js","mappings":"0UAYA,MAAMA,GAAYC,EAAAA,EAAAA,GAAYC,IAAW,CACvCC,MAAO,CACLC,WAAY,IACZC,MAAOH,EAAMI,QAAQC,KAAKC,UAC1BC,aAAcP,EAAMQ,QAAQ,IAC5BC,SAAU,UACVC,cAAe,gBAINC,EAAqB,K,IAUdC,EACKA,EAgBTC,EAAAA,EA+DMA,EAAAA,EAIF,EACOA,EAAAA,EAUdA,EAxGX,MAAMC,EAAUhB,KACV,OAAEc,IAAWG,EAAAA,EAAAA,MACbC,GAAcC,EAAAA,EAAAA,QAAOC,EAAAA,GACrBC,GAAcF,EAAAA,EAAAA,QAAOG,EAAAA,iBAEnBC,QAASC,EAAYC,QAASC,IAAgBC,EAAAA,EAAAA,GACpDC,EAAAA,IAGIC,EAAuC,QAA3Bf,EAAAA,EAAOgB,SAASC,mBAAhBjB,IAAAA,OAAAA,EAAAA,EAA8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A,EAAkBA,CAACd,MAAOA,MAKjC,IAAKzB,EACH,OACE,SAAC8B,EAAAA,EAAQA,CAACC,MAAM,0B,UACd,SAACC,EAAAA,EAAUA,C,SAAC,2BAMlB,MAAMQ,GAA+B,QAAjBxC,EAAAA,EAAWyC,cAAXzC,IAAAA,GAAuC,QAAvCA,EAAAA,EAAmB0C,4BAAnB1C,IAAAA,OAAAA,EAAAA,EAAyC2C,iBAAkB,CAAC,EAE1EC,EADgBC,OAAOC,OAAON,GACJO,KAAMC,GAAgBA,EAAOC,eAAe,QACtEC,EAAUC,QAAQP,GAClBQ,EAAaR,SAAsB,QAAvB,IAAoBS,WAApB,WAACT,EAAD,EAAyBU,UACrCC,EAAoC,QAAjBvD,EAAAA,EAAWyC,cAAXzC,IAAAA,GAAgC,QAAhCA,EAAAA,EAAmBwD,qBAAnBxD,IAAAA,OAAAA,EAAAA,EAAkCyD,cAE3D,OACE,sB,WACE,UAAC3B,EAAAA,EAAQA,CAACC,MAAM,sB,WACd,UAACG,EAAAA,EAAGA,CAACwB,GAAI,E,WACP,SAAC1B,EAAAA,EAAUA,CAACI,QAAQ,UAAUuB,UAAW1D,EAAQb,M,SAAO,kBAGxD,SAAC4C,EAAAA,EAAUA,CAACI,QAAQ,K,UACF,QAAfpC,EAAAA,EAAW4D,YAAX5D,IAAAA,OAAAA,EAAAA,EAAiB6D,cAAe5C,QAGrC,SAAC6C,EAAAA,EAAiBA,CAChBC,QAAS/D,EACTgE,YAAY,EACZC,iBAAiB,OAGpBf,GAAWE,IACV,SAAClB,EAAAA,EAAGA,CAACgC,GAAI,E,UACP,SAACC,EAAAA,EAAgBA,CACfb,UAAWF,EACXK,cAAeF,S","sources":["webpack://internal.plugin-kuadrant/./src/components/ApiProductInfoCard/ApiProductInfoCard.tsx"],"sourcesContent":["import React from 'react';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport { useApi, identityApiRef } from '@backstage/core-plugin-api';\nimport { InfoCard, Progress, ResponseErrorPanel } from '@backstage/core-components';\nimport { Typography, Box, makeStyles } from '@material-ui/core';\nimport useAsync from 'react-use/lib/useAsync';\nimport { useKuadrantPermission } from '../../utils/permissions';\nimport { kuadrantApiProductReadAllPermission } from '../../permissions';\nimport { ApiProductDetails } from '../ApiProductDetails';\nimport { OidcProviderCard } from '../OidcProviderCard';\nimport { kuadrantApiRef } from '../../api';\n\nconst useStyles = makeStyles((theme) => ({\n label: {\n fontWeight: 600,\n color: theme.palette.text.secondary,\n marginBottom: theme.spacing(0.5),\n fontSize: '0.75rem',\n textTransform: 'uppercase',\n },\n}));\n\nexport const ApiProductInfoCard = () => {\n const classes = useStyles();\n const { entity } = useEntity();\n const kuadrantApi = useApi(kuadrantApiRef);\n const identityApi = useApi(identityApiRef);\n\n const { allowed: canReadAll, loading: permLoading } = useKuadrantPermission(\n kuadrantApiProductReadAllPermission\n );\n\n const namespace = entity.metadata.annotations?.['kuadrant.io/namespace'];\n const apiProductName = entity.metadata.annotations?.['kuadrant.io/apiproduct'];\n\n const { value: currentUserId } = useAsync(async () => {\n const identity = await identityApi.getBackstageIdentity();\n return identity.userEntityRef.split('/')[1] || 'guest';\n }, [identityApi]);\n\n const { value: apiProduct, loading, error } = useAsync(async () => {\n if (!namespace || !apiProductName) {\n return null;\n }\n\n return kuadrantApi.getApiProduct(namespace, apiProductName);\n }, [kuadrantApi, namespace, apiProductName]);\n\n // check if user has permission to view this api product\n const owner = apiProduct?.metadata?.annotations?.['backstage.io/owner'];\n const ownerUserId = owner?.split('/')[1];\n const canView = canReadAll || (currentUserId && ownerUserId === currentUserId);\n\n if (!namespace || !apiProductName) {\n return (\n <InfoCard title=\"API Product Information\">\n <Typography>No APIProduct linked to this API entity</Typography>\n </InfoCard>\n );\n }\n\n if (loading || permLoading) {\n return (\n <InfoCard title=\"API Product Information\">\n <Progress />\n </InfoCard>\n );\n }\n\n // show permission message if user doesn't have permission\n if (apiProduct && !canView) {\n return (\n <InfoCard title=\"API Product Information\">\n <Box p={2}>\n <Typography variant=\"body2\" color=\"textSecondary\">\n You don't have permission to view this API product's details. Only the API owner or users with admin permissions can view this information.\n </Typography>\n </Box>\n </InfoCard>\n );\n }\n\n // also show permission message if we got a permission error from the backend\n if (error && error.message.includes('you can only read your own')) {\n return (\n <InfoCard title=\"API Product Information\">\n <Box p={2}>\n <Typography variant=\"body2\" color=\"textSecondary\">\n You don't have permission to view this API product's details. Only the API owner or users with admin permissions can view this information.\n </Typography>\n </Box>\n </InfoCard>\n );\n }\n\n if (error) {\n return (\n <InfoCard title=\"API Product Information\">\n <ResponseErrorPanel error={error} />\n </InfoCard>\n );\n }\n\n if (!apiProduct) {\n return (\n <InfoCard title=\"API Product Information\">\n <Typography>APIProduct not found</Typography>\n </InfoCard>\n );\n }\n\n // check for OIDC auth scheme\n const authSchemes = apiProduct.status?.discoveredAuthScheme?.authentication || {};\n const schemeObjects = Object.values(authSchemes);\n const jwtScheme = schemeObjects.find((scheme: any) => scheme.hasOwnProperty('jwt'));\n const hasOidc = Boolean(jwtScheme);\n const jwtIssuer = (jwtScheme as any)?.jwt?.issuerUrl;\n const jwtTokenEndpoint = apiProduct.status?.oidcDiscovery?.tokenEndpoint;\n\n return (\n <>\n <InfoCard title=\"API Product Details\">\n <Box mb={2}>\n <Typography variant=\"caption\" className={classes.label}>\n Product Name\n </Typography>\n <Typography variant=\"h6\">\n {apiProduct.spec?.displayName || apiProductName}\n </Typography>\n </Box>\n <ApiProductDetails\n product={apiProduct}\n showStatus={false}\n showCatalogLink={false}\n />\n </InfoCard>\n {hasOidc && jwtIssuer && (\n <Box mt={2}>\n <OidcProviderCard\n issuerUrl={jwtIssuer}\n tokenEndpoint={jwtTokenEndpoint}\n />\n </Box>\n )}\n </>\n );\n};\n"],"names":["useStyles","makeStyles","theme","label","fontWeight","color","palette","text","secondary","marginBottom","spacing","fontSize","textTransform","ApiProductInfoCard","entity","apiProduct","classes","useEntity","kuadrantApi","useApi","kuadrantApiRef","identityApi","identityApiRef","allowed","canReadAll","loading","permLoading","useKuadrantPermission","kuadrantApiProductReadAllPermission","namespace","metadata","annotations","apiProductName","value","currentUserId","useAsync","async","getBackstageIdentity","userEntityRef","split","error","getApiProduct","owner","ownerUserId","canView","InfoCard","title","Typography","Progress","Box","p","variant","message","includes","ResponseErrorPanel","authSchemes","status","discoveredAuthScheme","authentication","jwtScheme","Object","values","find","scheme","hasOwnProperty","hasOidc","Boolean","jwtIssuer","jwt","issuerUrl","jwtTokenEndpoint","oidcDiscovery","tokenEndpoint","mb","className","spec","displayName","ApiProductDetails","product","showStatus","showCatalogLink","mt","OidcProviderCard"],"sourceRoot":""}